Summary of the invention
(1) technical problem that will solve
The technical problem to be solved in the present invention is at the WebGIS system, propose a kind of to the method for mobile terminal locations data gridding management with incremental update, realization is to the efficient renewal of a large amount of mobile terminal locations and monitoring in real time, effectively reduce the volume of transmitted data between client and location server, guarantee a large amount of client users demand of a plurality of portable terminals of online browse simultaneously.
(2) technical scheme
In order to solve the problems of the technologies described above, the invention provides a kind of mobile terminal locations data buffer memory and real-time update system, it comprises:
Server end portable terminal real time position data service module, it comprises the backstage location server, this location server receives the latest position data of each portable terminal in real time, this position data is buffered in the mobile terminal locations tables of data of described system, and the latest position data of each portable terminal are placed in the grid container of dividing according to geographic range;
Client mobile terminal locations data buffer memory and real-time update module, link to each other with described server end portable terminal real time position data service module, it comprises client browser, by client browser mobile terminal position updating data in the current demonstration geographic range of described backstage location server request periodically, and these data are buffered in the described grid container.
Wherein, also comprise: client portable terminal dynamic layer drafting module, link to each other with real-time update module with described client mobile terminal locations data buffer memory, it is according to the position of portable terminal new data more, the notice dynamic layer redraws the portable terminal demonstration object that renewal takes place in the position in described browser.
The invention also discloses a kind of mobile terminal locations data buffer memory and real time updating method, it comprises following process:
S1: server end portable terminal real time position data service module receives the latest position data of each portable terminal in real time, this position data is buffered in the mobile terminal locations tables of data, and the latest position data of each portable terminal are placed in the grid container of dividing according to geographic range;
S2: the client browser in client mobile terminal locations data buffer memory and the real-time update module is the mobile terminal position updating data in the current demonstration geographic range of described server end portable terminal real time position data service module request periodically, and these data are buffered in the described grid container.
S3: client portable terminal dynamic layer drafting module is according to the position of portable terminal new data more, and the notice dynamic layer redraws the portable terminal that the position takes place to upgrade and shows object in described browser.
Wherein, described process S1 specifically comprises following process:
S101: server end portable terminal real time position data service module receives the latest position data of each mobile terminal reporting in real time;
S102: in the mobile terminal locations tables of data, each portable terminal that has received the latest position data is upgraded its position data record one by one;
S103: according to the more new situation of mobile terminal locations tables of data, upgrade the mobile terminal locations data in each grid container successively.
Wherein, described process S2 specifically comprises following process:
S201: the client browser in client mobile terminal locations data buffer memory and the real-time update module sends the update request of the mobile terminal locations data in the current demonstration geographic range according to the geographic range of current demonstration to server end portable terminal real time position data service module;
S202: the request of server end portable terminal real time position data service module customer in response end browser, client is upgraded each mobile terminal locations data after receiving the mobile terminal position updating data of real time position data service module passback one by one in grid container.
Wherein, described process S103 is specially:
Leave the grid container at its original place when portable terminal, when entering into another grid container, server end portable terminal real time position data service module with the status indication of the position data of this portable terminal in the original grid container for leaving, and in the grid container that this portable terminal newly enters the new record that adds the position data of this portable terminal; Perhaps
When the mobile terminal locations data changed and do not leave the grid container at its original place, server end portable terminal real time position data service module upgraded the position data record in this portable terminal place grid container.
Wherein, the parameter of update request comprises the geographic range of the current demonstration of client browser and the grid container tabulation that is positioned at current demonstration geographic range of client institute buffer memory among the described process S201.
Wherein, the processing of request process of server end portable terminal real time position data service module customer in response end browser is among the described process S202:
Resolve the parameter of the request of client browser transmission, obtain the geographic range of the current demonstration of client browser and the buffer memory present situation of each grid container in this scope;
According to the geographic range of client browser requests, calculate each grid container in this scope;
In each grid container tabulation of server end portable terminal real time position data service module buffer memory, visit is positioned at each grid container that the client map shows geographic range successively, judges in the parameter of client browser requests whether comprise this grid container; If comprise this grid container, then judge successively on each mobile terminal locations data in this grid container in the portable terminal real time position data service module up-to-date and call time, with on the later mobile terminal locations data centralization of uploading at client browser of this grid container final updating time tag that calls time gather, be memory cell with the grid container, client browser is given in passback; Otherwise, if do not comprise this grid container in the client browser requests parameter, then the whole mobile terminal locations data in this grid container are returned to client.
Wherein, the processing that client is upgraded each mobile terminal locations data one by one among the described process S202 in grid container specifically comprises:
S2021: when the grid container of server end portable terminal real time position data service module passback when client does not exist, then this grid container is added in the grid container tabulation of client; Perhaps
S2022: the grid container that returns when server end portable terminal real time position data service module exists in client, then upgrades the mobile terminal locations data of this grid container in this client-cache.
Wherein, described process S2022 specifically comprises:
The mobile terminal locations data record is marked as when leaving this grid container, from this grid container of client-cache, deletes this mobile terminal locations data record; Perhaps
The mobile terminal locations data are recorded in this grid container of client-cache and do not exist, and increase this mobile terminal locations data record in this grid container of client-cache newly; Perhaps
The mobile terminal locations data are recorded in this grid container of client-cache and exist, and upgrade this location data of terminals record in this grid container of client-cache.
(3) beneficial effect
Technique scheme has following advantage: server end portable terminal real time position data service module is unit with the grid container, preserves and manage the latest position data of all portable terminals; Client also is unit with the grid container, buffer memory from the request of server end real time position data service module to location data of terminals, and give each grid container additional final updating time tag respectively; Client is unit with the grid, sends request to location server, obtains the updating of terminal position data in each grid in the current demonstration geographic range, realizes the incremental update to the location data of terminals of client-cache.The technology of location data of terminals gridding management and incremental update, both guaranteed the real-time update to the mobile terminal locations in the map indication range, reduce the volume of transmitted data between client and location server again effectively, guaranteed a large amount of client users demand of a plurality of portable terminals of online browse simultaneously.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used for explanation the present invention, but are not used for limiting the scope of the invention.
The present invention is directed to the WebGIS system, propose a kind of to the technology of mobile terminal locations data gridding management with incremental update, realization is to the efficient renewal of a large amount of mobile terminal locations and monitoring in real time, with the volume of transmitted data between effective minimizing client and location server, guarantee a large amount of client users demand of a plurality of portable terminals of online browse simultaneously.
In the WebGIS system, realization is to the real-time monitoring of portable terminal, be constantly (to be at interval with the set time, periodically) to the latest position data of location server request mobile terminal to be monitored, and it is plotted in realizes in the dynamic layer of client map platform by client.
The technology of mobile terminal locations data gridding management used in the present invention and incremental update, main thought is: the service of server end real time position data is unit with the grid container, preserves and manage the latest position data of all portable terminals; Client also is unit with the grid container, buffer memory from server end real time position data service request to the mobile terminal locations data, and give each grid container additional final updating time tag respectively; Client is unit (attaching has the final updating time tag) with the grid, send request to location server, obtain mobile terminal position updating data in each grid in the current demonstration geographic range (the mobile terminal locations data of upgrading later at its final updating time tag), realize the incremental update to the mobile terminal locations data of client-cache.The technology of the management of mobile terminal locations data gridding and incremental update, both guaranteed the real-time update to the mobile terminal locations in the map indication range, reduce the volume of transmitted data between client and location server again effectively, guaranteed a large amount of client users demand of a plurality of portable terminals of online browse simultaneously.
Particularly, the embodiment of the invention provides a kind of mobile terminal locations data buffer memory and real-time update system, its structural representation as shown in Figure 1, it mainly comprises two modules:
(1) server end portable terminal real time position data service module: it comprises the backstage location server, the backstage location server receives the latest position data of each mobile terminal reporting in real time, renewal is buffered in the mobile terminal locations tables of data in the internal memory, and each portable terminal latest position data is placed in the grid container of dividing according to geographic range, preferably be buffered in the internal memory.
(2) client mobile terminal locations data buffer memory and real-time update module: client browser is unit with the grid, (be at interval with the set time termly, periodically) the mobile terminal position updating data in the current demonstration geographic range of location server request, and be buffered in the grid container of memory headroom.
The system of present embodiment also comprises a client portable terminal dynamic layer drafting module, link to each other with real-time update module with client mobile terminal locations data buffer memory, it is according to the position of portable terminal new data more, the notice dynamic layer redraws the portable terminal demonstration object that renewal takes place in the position in described browser.
The embodiment of the invention has also designed a kind of mobile terminal locations data buffer memory and real time updating method, at first server end portable terminal real time position data service module receives the latest position data of each portable terminal in real time, and be buffered in the grid container of internal memory, the regular Data Update request of customer in response end then returns the mobile terminal locations data of the recent renewal in the grid container to client.Client is upgraded the mobile terminal locations data that are buffered in the grid container, and redraws the portable terminal demonstration object that has the position to upgrade in the dynamic layer.
The process schematic diagram of the inventive method specifically comprises as Figure 1-3:
(1) real time position data service module.The real time position data service module receives the latest position data of each mobile terminal reporting in real time, renewal is buffered in the mobile terminal data table in the internal memory, and each mobile terminal locations data is placed in the grid container of dividing according to geographic range, preferably be buffered in the internal memory.
Concrete treatment step is as follows:
S101: the latest position data that receive each mobile terminal reporting.
S202: from the mobile terminal locations tables of data that is buffered in memory headroom, each portable terminal that has reported latest position is upgraded its position data record one by one.
In Installed System Memory, it is the tables of data of all information of mobile terminal of major key that buffer memory with portable terminal ID.
The information of mobile terminal data had both comprised multidate informations such as mobile terminal locations, speed, state, travel direction, comprised that also portable terminal title, expectation arrive static informations such as destination.
S103: upgrade the location information of mobile terminal in each grid container (Grid) successively.
For the ease of searching the portable terminal multidate information on the arbitrary geographic location point fast, geographical position in the global range can be divided into the grid of several rows (direction parallel with parallel) and some row (with the direction through line parallel) according to geographical coordinate etc., each portable terminal multidate information can be stored in the grid that is arranged in separately.Such as, with global geographic scope (scope that contains about north and south latitude 85 degree), be divided into 2 according to longitude and latitude
13Row and 2
13The grid scope of row.In each moment, each portable terminal is kept at multidate informations such as position the grid that is arranged in separately according to its longitude and latitude position.This is that the data capsule of each portable terminal dynamic location information of buffer memory of memory cell is called as grid container with the grid, and which which row of row its coding rule is.Exist the grid container of portable terminal dynamic position data to be buffered in the memory headroom.
After the real time position data service module receives the latest position data that some portable terminal uploads, after the mobile terminal locations tables of data in the updating memory, need simultaneously respectively dynamic position data record before these mobile terminal to update and in the grid container at the place after upgrading is upgraded.Following 2 kinds of situations may be arranged:
Certain portable terminal leaves original grid, enters into another grid.At this moment, need be " leaving " this grid with the status indication of these portable terminal dynamic position data in the original grid container, in the grid container that newly enters, newly add the dynamic position data record of this portable terminal simultaneously;
Certain portable terminal does not leave original grid, and just the dynamic position data change, and then upgrade these portable terminal dynamic position data in its place grid container;
Be kept at each the mobile terminal locations data in the grid container, both comprised multidate informations such as position, also recorded its final updating time simultaneously, just report the time of position recently.Each portable terminal has all recorded its final updating time, is convenient to realize the incremental update of client mobile terminal locations data.
After handling all mobile terminal locations Data Update that report, the real time position data service module is waited for the mobile terminal locations Data Update request of (monitoring) customer in response end.
(2) client mobile terminal locations data buffer memory and real-time update module.Client is with regular time (as 10 seconds) mobile terminal position updating data in the current demonstration geographic range of backstage location server request periodically at interval, and is that unit caches is in memory headroom with the grid container.
Concrete treatment step is as follows:
S201: the mobile terminal position updating data in the current indication range of server end real time position data service request.According to the geographic range of current demonstration, send the update request of the mobile terminal locations data in the current scope to the service of server end real time position data.
The parameter of request mobile terminal position updating data is:
The geographic range of current demonstration (boundary);
Client is the grid container tabulation that is positioned at current scope of buffer memory; This parameter can be told backstage real time position service, and client is to the caching situation of each grid container, and it comprises: grid numbering and client are to the final updating time data cached in this grid container;
If request for the first time, then just there is not any grid container in client any mobile terminal locations data of buffer memory not in internal memory.At this moment, only need pass to the geographic range of the current demonstration of backstage real time position server.
The processing logic of the position updating request of server end real time position data service response client is:
Resolve the parameter of the update request of client transmission, obtain asking the geographic range of mobile terminal locations, and the caching situation of each grid container in this scope;
According to the geographic range of request, calculate each related grid of this scope;
Visit above-mentioned each grid container in the real time position data service buffer memory successively, judge whether comprise this grid in the client-requested parameter.If comprise this grid, then judge successively on each mobile terminal locations data in this grid container in the server up-to-date and call time, with on call time those later mobile terminal locations data of this grid final updating time tag of client upload (they are the position datas of asking this grid data newly to report later on the last time in client), be brought together, be memory cell with the grid container, client is given in passback; Otherwise, if do not comprise this grid (the expression client is not also asked the mobile terminal locations data in this grid scope before this) in the client-requested parameter, then directly all mobile terminal locations data of this grid are returned to client;
Server end real time position data service is in the request of customer in response end, during passback mobile terminal position updating data, simultaneously can this request responding time of affix, as the final updating time tag of client to all grid container of this renewal;
S202: client mobile terminal receive position is new data and buffer memory more.Client is upgraded each mobile terminal locations data after receiving the mobile terminal position updating data of backstage real time position server passback one by one in the grid container buffer memory of memory headroom.
The mobile terminal position updating data of server end real time position data service passback are data cell with the grid container, and the mobile terminal locations data of all renewals in the current indication range are provided.Simultaneously, the service of server end real time position data also can return the update time of these mobile terminal locations data.
Client also can be with each mobile terminal locations data of form buffer memory of grid container.The more new situation of client grid container has:
The grid container of passback does not exist in client, just client in the past not buffer memory cross this grid container data, then this grid container is added in the grid container tabulation of memory headroom;
The grid container of passback exists in client, then upgrades the mobile terminal locations data of this grid container in this client-cache; Each mobile terminal locations data in the grid container of passback, may be for following three kinds of one of new situations be more arranged:
The mobile terminal locations data are marked as " leaving " this grid, represent that then this portable terminal not in this grid, from this grid container of client-cache, deletes this mobile terminal locations record;
The mobile terminal locations data are recorded in this grid container of client-cache and do not exist, and represent that then this portable terminal is newly to enter in this grid, increases this mobile terminal locations record newly in this grid container of client-cache;
This grid container that the mobile terminal locations data are recorded in client-cache exists, and represents that then this portable terminal still is arranged in this grid, upgrades this mobile terminal locations data record in this grid container of client-cache;
Each grid container that client is updated, its final updating time tag are modified to the update time of these mobile terminal locations data of server end real time position data service passback.
The real time position supervisory control system that has a large amount of mobile portable terminals, as global vessel position supervisory control system or hackney vehicle supervisory control system, the mobile terminal data amount of networking reaches several ten thousand even 1,000,000.The WebGIS platform client when the map indication range is wide, needs the portable terminal quantity of demonstration many.If client is at every turn to these vessel's position data of location server request, the data flow of server passback is very big, can cause server network to block up, online demand when can not satisfy than the multi-user.
Mobile terminal locations data gridding management proposed by the invention and the method for incremental update, owing in the real time position data service module of backstage, used buffer memory and the management method of grid container, and in client mobile terminal locations Data Update and cache module, client has also been used the method for grid container to the mobile terminal locations data, and the mobile terminal locations data in the big zone around the current indication range are buffered in the client memory headroom.Client when sending the mobile terminal position updating request to backstage real time position service at every turn, by transmitting client each grid numbering and grid recent renewal time tag of buffer memory, tell the caching situation of backstage real time position server client to the mobile terminal locations data, thereby allow the real time position server only return up-to-date those mobile terminal locations data (reporting later at the recent renewal time tag) that report, thereby reach the purpose that client mobile terminal locations data increment is upgraded.The incremental update method to the mobile terminal locations data of client that this real time position data module is supported, both guaranteed upgrading in time to client mobile terminal locations data, effectively reduce the volume of transmitted data of server and client again, thereby greatly reduce the network pressure of server, guaranteed the support simultaneously online to a large number of users.For example, global vessel position supervisory control system is in the Google Maps of 1280*1024 pixel in indication range, under the 13rd grade of engineer's scale all dynamic boats and ships in marine site, PORT OF SHANGHAI is monitored.15 seconds of every interval, client automatically to backstage real time position server request should the zone vessel position new data more, at every turn more amount of new data all about 3KB.The real time position service arrangement on the logical IBM server of a Daepori, under the network traffics of 10Mb/s bandwidth, online when can support nearly ten thousand users (monitoring the dynamic boats and ships in marine site, PORT OF SHANGHAI simultaneously).And one of several maximum harbours that to be the world today few in number, PORT OF SHANGHAI, its boats and ships turnover quantity is very big.As seen, the global vessel position supervisory control system of using method of the present invention to realize, its performance is very outstanding.
In a word, mobile terminal locations data gridding management proposed by the invention and the method for incremental update have solved the WebGIS platform client well to the position data real-time update of portable terminal and the problem of demonstration.Both guaranteed to show with efficient in the position real-time update of client to a large amount of portable terminals, effectively reduced the volume of transmitted data between server and the client simultaneously again, reduced the pressure of server network transmission, guaranteed the simultaneously online demand of a large number of users.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the technology of the present invention principle; can also make some improvement and replacement, these improvement and replacement also should be considered as protection scope of the present invention.