Design and Implementation of Browser based GPS / GPRS Vehicle Positioning and Tracking System

This paper mainly describes a vehicle positioning and tracking system which is based on browser, GPS and GPRS. And this system takes advantage of Baidu Map as basic material to show vehicle status, which enables drivers and supervisor to monitor the vehicle’s current and past positions. The vehicle’s location data is got from satellites, and these data is sent to the central server through GPRS, the central server will store formatted data into the database after the data is parsed; Later, these data stored in the database will be used by web application and displayed on the map as markers. This paper also involves the implementation on mobile side, and this system used Baidu map JavaScript interface, Ajax, JSP and JSON to implement the vehicle positioning and tracking system.


SYSTEM REQUIREMENTS AND VALUE
The system this paper describes will be applied into mining factory, there is several coaling stations, the coal will be carried away by vehicles.Sometimes, one coal station gathers many vehicles, and so that some of them often wait for a long time for shipment.At the meantime, some other coaling stations are not so busy, and have space to accept more vehicles.This system enable drivers and mining managers can monitor the status of vehicles from browser or mobile endpoint, this will avoid more vehicles gather in one coaling station, and it will be a efficient management means for modern mining factory and which enables mining manager's management be more efficient and ensure the production be under better management with high performance.

DESIGN OF SYSTEM ARCHITECTRE
This system consists of three parties, which are GPS/GRPS devices, central communication servers and the application based on browser(including the application of mobile), it integrates the main modern communication and internet technologies.Due to this system is built based on browser application, so that whatever drivers or the manager of mining factory can access this system from browser and mobile.The architecture diagram as following figure 1.

GPS
GPS(Global Positioning System, GPS), which was developed in 1970 to overcome the limitations of previous navigation systems, integrating ideas from several predecessors, including a number of classified engineering design studies.GPS was created and realized by the U.S. Department of Defense (DoD) and was originally run with multiple satellites.It became fully operational .Bradford Parkinson, Roger L. Easton, and Ivan A. Getting are credited with inventing it.GPS equipment terminal can receive the positioning signal of more than three of the GPS satellite and can get high precision, global coverage, allweather speed, longitude and latitude, time,direction of geographic information, The Location positioning error in the range of 15 meters, Because GPS has wide coverage, allweather, high precision of a variety of advantages, it has been widely used in various industries worldwide in the field of.The vehicle location real-time monitoring system will become the most rapidly developing application market and promising.The GPS system includes three parts: First, a part of space -GPS satellite constellation, Second, ground control part-Ground monitoring system; Third, the user equipment Part-GPS signal receiver; The two have function independently, at the same time is also organically with integral whole.

GPRS
General packet radio service (GPRS) is a packet oriented mobile data service on the 2G and 3G cellular communication system's global system for mobile communications (GSM).A GPRS connection is established by reference to its access point name (APN).And for Internet communication services such as email and World Wide Web access.In order to set up a GPRS connection for a wireless modem, a user must specify an APN, optionally a user name and password, and very rarely an IP address, all provided by the network operator.Because GPRS is a group data data network, it supports TCP/IP, X.25 and so on.

SOFTWARES
According to the architecture and functionality of the system, central communication server needs following softwares: z Linux Ubuntu 12.0.4LTS Operating System z Mongodb 2.6.6 Software z Tomcat 7.0 An application software which provides extra http service

DETAILED DESIGN
From the view of application itself, the central communication server mainly consists of data receiving module and map generating module.The data receiving module, as metioned before, is used to receive the data which is sent from GPS/GPRS devices, map generating module will use these data to generate map and provide http service for outside clients, see following detailed data flow by figure 2: Fig. 2: System data flow

DATABASE DESIGN
The backend database is MongoDB because it's a very popular No-sql database currently, and is widely used by multiple big enterprise company.It is a document oriented database which format is JSON, it differentiates from the traditional database, MongoDB is more flexible.Every single document in the database represents the location of one vehicle at some time, it mainly consists of id of device, longitude, latitude, date time of data generation, also it support custom fields and which make the database be more flexible and extended easily.Following table 1 lists the definition of MongoDB document: {"id" : "k12345", "long":111.898989,"lat": 78.098789, "datetime":ISODate("2014-12-01T13:22:57Z", "custom_fields":{})}

MAP GENERATION MODULE
The map generation module, a service within central communication server, is listening on port 80.This module will search the location data of vehicle from the database, and used to generate map after the module is called by clients browser or mobile, it will provide http service for outside clients, such as mobile application, phone and computer, so that the vehicle tracking is finished.The benefit from using browser is that the http service can be used directly by not only computer browser but also mobile application, without any change for specific platform, In addition, this module also designed to provide following functionalities: • The map generation module can read data from the database and mark the location on the map, also, it will show the total number of vehicles of every coaling station in a specific radius.
• Based on the center of coaling station, design the solution in 300 meters to show the vehicle.Following will introduce the detailed design about how to generate on map for vehicles.
• Initialize amp This system is using Baidu map as basic map material to show the location of vehicle on the map, besides of the rich API Baidu provides, and it provides the functionality of marker on the map.The map generation modules generate a JSP page to show the map and the markers of vehicle.In this JSP, will include the header of Baidu map <%@ page language="java" content Type="text/html;%>, to initialize the map, such as involving <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=yourkey"></script> into the JSP, so that the entire JSP can call various Baidu api, map = new BMap.Map("allmap"); After that, a central location on map is needed, it looks like: map.centeAndZoom(new BMap.Point(109.797816,39.605589),15); • Get the map data To get the location of vehicles from JSP page, the JSP page need query the database periodically, it will refresh the markers on the map to make the map is up-to-data with the latest location data of vehicles, it does not refresh entire JSP page with Ajax technology, following is segment with Ajax to get the location data: $.ajax({ url: http://192.168.

ACCESS THE SYSTEM BY BROWSER
On the map page, the JSON data will be parsed by JavaScript, so that the page gets the longitude and latitude of vehicle, with 17002-p.3 the map marker, such as: var point = new BMap.Point(long, lat);So that the location of vehicle can be displayed on the map, On the internet , there is unique address for each resource, it is named URL Uniform Resource Locator , it's indicator of www, it can be accessed by http protocol, the URL of map looks like: http://192.169.1.110/v1/geo.json,the location can be shown for the specific vehicle on the map, : http://192.169.1.110/v1/geo.json?id=K12345Through the browser, mining manager can view the status of all vehicles and monitor them reat time.

IMPLEMENT ON COMPUTER AND MOBILE
With the development of mobile communication, in particular, the wide cover of smart phone which has the functionality of GPS, it becomes to true to monitor vehicle on mobile.In this system, because the location is shown as map, and which is abide of http protocol, It's easily integrated into Apple iOS application without any change.The overall flow chart of client terminal application, as shown in figure 3

CONCLUSION
This paper takes advantage of modern communication and information technology to design and implement a vehicle positioning and tracking system, which can be used on both browser and mobile.The big character of this system is one system can be used by different platforms, as well as Android devices.It has the ability of cross-platform, energy-saving and high performance management.

Fig 1 :
Fig 1: Vehicle positioning and tracking of GPS/GPRS based onmobile and browser The current positioning of vehicles is got from GPS/GPS device which is fixed within the vehicle, after that,the data will be sent to central communication server which is in charge of receiving and parsing positioning data, then those data will be stored into the mongodb in a json format.These data will be searched by map generating module, which uses these data to show the position of vehicle on the map, and display the position of vehicle through http application.

Fig. 4 :
Fig.4: Integration of monitoring system on mobile

Table 1
Definition of vehicle location data