A kind of acquisition methods and system of shift position peripheral dynamic position resource
Technical field
The present invention relates to the acquisition of surrounding resources, and in particular to a kind of shift position periphery real time dynamic location resource obtains
Take method and system.
Background technology
With the popularization of mobile terminal, the location-based service based on mobile terminal is also more and more, in actual applications, more next
More people begins to focus on the resource information for how obtaining periphery.The acquisition of the surrounding resources information of mobile terminal is presently mainly
There is two ways:
One kind is the mode drawn based on " Drag ", that is, needs once to arrive and go to initiate to ask from the background, from the background before
The requirement at end carries out corresponding space querying and returns result to mobile terminal.Under this mode, due to being to need movement eventually
Request is actively initiated at end, and resource information, which obtains, easily produces distortion, that is, has just got ambient signal resource in mobile terminal
During position, and actually this when of mobile terminal is in itself and its periphery dynamic resource position obtained may all change,
This change causes the location resource distortion got before.Meanwhile under this Drag modes, due to can not automatically know week
The change of side resource is, it is necessary to which the mechanism such as mobile terminal timing request causes the waste of Internet resources and computing resource to obtain.
Another kind is to be based on P2P (Peer-to-Peer, point-to-point) mode, needs to know periphery dynamic resource in certain terminal
During information, it by broadcast mode, informs all mobile terminals in a network, these neighboring mobile terminals first
Communication interaction mechanism end to end just is established with the mobile terminal to be asked, and calculates mobile terminal locations and oneself position in real time
Between relation, as it is eligible it is lower if will be sent to the mobile terminal to be asked.Under this mode, position change is suitable only for
Change the relatively low surrounding resources of frequency, while if to calculate timely and accurately, then need end-to-end both sides constantly to send communication
Interactive command, and respective position signalling is constantly sent to other side and calculated, easily cause Internet resources and calculating
The waste of resource.Simultaneously under this mode, the request for the dynamic change resource that pair hope obtains different segment is relatively difficult.
The content of the invention
For defect present in prior art, it is an object of the invention to provide a kind of shift position peripheral dynamic position
The acquisition methods and system of resource, mobile terminal is set automatically to be obtained when its position changes by this method and system
Know the location resource information of periphery dynamic change.
To achieve the above object, the technical solution adopted by the present invention is as follows:
A kind of acquisition methods of shift position peripheral dynamic position resource, comprise the following steps:
(1) each mobile terminal sends respective real-time location coordinates information to background server;
(2) background server establishes memory headroom map according to the coordinate range of the location coordinate information, and will be all
The location coordinate information of mobile terminal is mapped on memory headroom map;
(3) background server is according to the required parameter of the mobile terminal for initiating to subscribe to request, in internal memory spatially structure on figure
Memory request region is built, and position coordinates is spatially obtained on figure in internal memory and falls the mobile terminal in the memory request region
Information;The required parameter includes asked area coordinate information, surrounding resources classification and hierarchical resource;It is described mobile whole
The information at end includes the numbering of mobile terminal and the location coordinate information of mobile terminal;
(4) background server falls position coordinates the information active push of the mobile terminal in memory request region to hair
Act the mobile terminal for subscribing to request.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (2), root
The concrete mode that memory headroom map is established according to the coordinate range of location coordinate information is:
A. the real-time location coordinates information of each mobile terminal is saved in localization message queue by background server;
B. background server calculates space model according to the location coordinate information of all mobile terminals in localization message queue
Enclose, and memory headroom map is established with reference to engineer's scale;The spatial dimension refers to by the location coordinate information of all mobile terminals
The scope that middle minimum location coordinate information and maximum location coordinate information are determined;
C. the position coordinates of all mobile terminals is mapped on memory headroom map.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step b, calculate
The concrete mode of spatial dimension is:
1. obtain the location coordinate information of all mobile terminals in localization message queue;
2. the ordinate of all location coordinate informations and abscissa are compared respectively, all location coordinate informations are obtained
In minimum abscissa and minimum ordinate, maximum abscissa and maximum ordinate;
3. space model is determined according to described minimum abscissa and minimum ordinate, maximum abscissa and maximum ordinate
Enclose.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (3), institute
State the periphery that area coordinate information refers to initiate the peripheral distance asked of mobile terminal for subscribing to request or decision is asked
Multiple coordinate informations of scope.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (3), when
The area coordinate information for asked peripheral distance when, the mode in structure memory request region is:
The position coordinates for the mobile terminal asked using initiating subscription is made circle as radius as the center of circle, using the peripheral distance and obtained
Memory request region.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (3), when
During the multiple coordinate informations for the peripheral extent that the area coordinate information is asked by decision, the mode in structure memory request region
For:With the multiple coordinate points memory request region is obtained as irregular polygon.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (3),
When building memory request region, its corresponding memory request buffering area is created always according to constructed memory request region;It is described
The scope of memory request buffering area includes and is more than memory request region;The size of memory request buffering area is set by user.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, in step (4),
Background server falls information and position coordinates that position coordinates falls in the mobile terminal in memory request region to be delayed in memory request
The information for the mobile terminal for rushing area, which is saved in, to be sent in message queue, and please to initiation subscription by transmission message queue active push
The mobile terminal asked.
Further, a kind of acquisition methods of shift position peripheral dynamic position resource as described above, background server will
Transmission message queue is pushed to the concrete mode for initiating to subscribe to the mobile terminal asked:
Background server will meet the mobile end of required parameter according to the required parameter for the mobile terminal for initiating to subscribe to request
The information at end is layered according to the type and hierarchical resource of surrounding resources, classification processing, by the letter of the mobile terminal after processing
Breath is assembled into corresponding message package and is sent in transmission message queue respectively, and background server will send message queue active push
To the mobile terminal for initiating subscription request.
A kind of acquisition system of shift position peripheral dynamic position resource, including:
Position coordinates sending module:Respective real-time location coordinates are sent for each mobile terminal to background server to believe
Breath;
Map establishes module:Memory headroom is established according to the coordinate range of the location coordinate information for background server
Map, and the location coordinate information of all mobile terminals is mapped on memory headroom map;
Surrounding resources acquisition module:Required parameter for background server according to the mobile terminal for initiating to subscribe to request,
Spatially build memory request region on figure in internal memory, and spatially obtain that position coordinates falls on figure in internal memory please in the internal memory
Seek the information of the mobile terminal in region;
Info push module:Position coordinates is fallen to the letter of the mobile terminal in memory request region for background server
Active push is ceased to the mobile terminal for initiating subscription request.
Further, a kind of acquisition system of shift position peripheral dynamic position resource as described above, the map are established
Module includes:
Localization message receiving unit:The real-time location coordinates information of all mobile terminals is saved in for background server
In localization message queue;
Map size computing unit:Location coordinate information for all mobile terminals in localization message queue moves
State calculates the spatial dimension of memory headroom map;
Map drawing unit:Established for the spatial dimension according to memory headroom map, and with reference to engineer's scale in internal memory
Memory headroom map;
Location data drawing unit:For the location coordinate information of all mobile terminals to be plotted into memory headroom map
On.
Further, a kind of acquisition system of shift position peripheral dynamic position resource as described above, the surrounding resources
Acquisition module includes:
Request message receiving unit:Received for background server and initiate to subscribe to the periphery transmitted by the mobile terminal asked
The required parameter information of resource;
Memory request region construction unit:It is empty in internal memory for the required parameter according to the mobile terminal for initiating to subscribe to request
Between memory request region is built on map;
Surrounding resources acquiring unit:Fall for spatially obtaining position coordinates on figure in internal memory in the memory request region
The information of interior mobile terminal.
Further, a kind of acquisition system of shift position peripheral dynamic position resource as described above, described information
Pushing module includes:
Information process unit:For position coordinates to be fallen to the mobile terminal in memory request region according to required parameter
Information is layered, classification is handled;
Information module units:It is sent to for the information of the mobile terminal after processing to be assembled into corresponding message package respectively
Send in message queue;
Information push unit:Message queue active push will be sent to the movement for initiating subscription request for background server
Terminal.
Further, a kind of acquisition system of shift position peripheral dynamic position resource as described above, the periphery money
Source acquisition module also includes:
Memory request buffering area construction unit:For building the buffering area in the memory request region, memory request buffering
The scope in area includes and is more than memory request region;The size of memory request buffering area is set by user.
The beneficial effects of the present invention are:
1. mobile terminal in itself and its surrounding resources both sides be at it is continually changing in the case of, can ensure as far as possible
The dynamic resource on mobile terminal periphery is dynamically known in real time, and larger effect can be played in instant monitoring field, especially mobile whole
In the case that the change in location frequency of end and surrounding resources is very high, advantage can be more shown;
2. present invention employs memory headroom map and request area maps mechanism, can lifting system judge position relationship
Computing capability, while the concept of multilevel region buffering area can be easily formed.
3. last generation result is classified by the present invention by the information requirements of surrounding resources, the processing such as layering, so as to
It can provide client more effective resource information.
Brief description of the drawings
Fig. 1 and Fig. 2 is a kind of acquisition methods of shift position peripheral dynamic position resource of the present invention and the technology original of system
Manage schematic diagram;
Fig. 3 is a kind of structured flowchart of the acquisition system of shift position peripheral dynamic position resource in embodiment;
Fig. 4 is the structured flowchart that map establishes module in embodiment;
Fig. 5 is the structured flowchart of surrounding resources acquisition module in embodiment;
Fig. 6 is the structured flowchart of info push module in embodiment;
A kind of acquisition methods flow chart of shift position peripheral dynamic position resource in Fig. 7 embodiment of the present invention.
Embodiment
With reference to Figure of description, the present invention is described in further detail with embodiment.
For a better understanding of the present invention, the core concept of the present invention is illustrated with technical principle scheme first:
Fig. 1 and Fig. 2 shows a kind of acquisition methods of shift position peripheral dynamic position resource of the present invention and the skill of system
Art principle schematic, the present invention require first all timing actives of each mobile terminal to send it to background server current real-time
Location coordinate information, in Fig. 1, mobile terminal a current position coordinates are (x1, y1), mobile terminal b position changing coordinates
For (x2, y2) etc., receiving these position determination data messages (real-time location coordinates information) of each mobile terminal in background service
Afterwards, spatial dimension (maximum external boundary) in the position coordinates that is currently received will be calculated, memory headroom is then established according to this
Map, the size of the memory headroom map dynamic change according to the maximum region scope of the position coordinates of reception, while will be all
The location coordinate information of mobile terminal is mapped on the memory headroom map space object, as shown in figure 1, certainly with reality
The dynamic change of terminal location, the position coordinates for each terminal being mapped on the memory headroom map similarly become
Change, that is, the mobile terminal locations on memory headroom map are dynamic changes.
Afterwards, after initiating to subscribe to the subscription request command of periphery dynamic resource, background service can connect some mobile terminal
Receive the association requests parameter that the client mobile terminal of request (initiate subscribe to) is initiated, and according to required parameter in internal memory spatially
Memory request region, and its corresponding zone buffer object are dynamically created on figure, as shown in Figure 2, mobile terminal c hairs
Rise and subscribe to request, background server is built with terminal c position coordinates (x according to its required parameter3, y3) centered on point (center of circle)
Memory request region A, the border circular areas in figure shown in dotted line, and establish the memory request buffer area in the memory request region
B, so in internal memory spatially on figure, it is possible to which the current position coordinates point for easily judging which mobile terminal is please
In the regional extent asked, or in the range of the buffering area in request region, and it will fall in memory request region A or memory request buffering
The information of region B mobile terminal is actively pushed to mobile terminal c, and mobile terminal c is after these information are received, as needed
Showed accordingly on Memory Map.
Above step completes client (initiating to subscribe to the mobile terminal of request) corresponding periphery money from asking to getting
The process and method of source information.As can be seen that a background service system and two is at least needed to move in scheme involved in the present invention
Dynamic terminal device, and require that mobile terminal actively can send localization message data to background service in real time.
Fig. 3 shows a kind of structured flowchart of the acquisition system of shift position peripheral dynamic position resource of the present invention, and this is
System includes position coordinates sending module 11, map establishes module 12, surrounding resources acquisition module 13 and info push module 14, its
In:
Position coordinates sending module 11 is used for each mobile terminal and sends respective real-time location coordinates letter to background server
Breath;
Map establishes module 12 and establishes internal memory sky according to the coordinate range of the location coordinate information for background server
Between map, and the location coordinate information of all mobile terminals is mapped on memory headroom map;The structured flowchart of the module is such as
Shown in Fig. 4, including for background server the location coordinate information of all mobile terminals is saved in localization message queue surely
Localization message receiving unit 121, for all mobile terminals in localization message queue location coordinate information dynamic
Calculate the map size computing unit 122 of the spatial dimension of memory headroom map, for the space model according to memory headroom map
Enclose, and with reference to engineer's scale established in internal memory memory headroom map map drawing unit 123 and for will it is all it is mobile eventually
The location coordinate information at end, the location data drawing unit 124 being plotted on memory headroom map;
Surrounding resources acquisition module 13 is used for required parameter of the background server according to the mobile terminal for initiating to subscribe to request,
Spatially build memory request region on figure in internal memory, and spatially obtain that position coordinates falls on figure in internal memory please in the internal memory
Seek the information of the mobile terminal in region;The structured flowchart of the module including being received for background server as shown in figure 5, initiate
Subscribe to the request message receiving unit 131 of the surrounding resources required parameter information transmitted by the mobile terminal of request, for basis
The required parameter for initiating the mobile terminal of subscription request spatially builds the memory request area in memory request region in internal memory on figure
Domain construction unit 132, buffering area for building the memory request region memory request buffering area construction unit 134, with
And in internal memory, spatially acquisition position coordinates to fall the week of the information of the mobile terminal in the memory request region on figure
Side resource acquisition unit 133;Wherein, the scope of memory request buffering area includes and is more than the size in memory request region;Internal memory
The size of request buffer is set by user;
Info push module 14 falls position coordinates for background server the mobile terminal in memory request region
Information active push subscribes to the mobile terminal of request to initiation;The structured flowchart of the module for basis as shown in fig. 6, including asking
Parameter is asked the information that position coordinates falls the mobile terminal in memory request region to be layered, is classified the information processing of processing
Unit 141, for by the information after processing be assembled into respectively corresponding message package be sent to send message queue in information group
Fill unit 142 and will send letter of the message queue active push to the mobile terminal for initiating to subscribe to request for background server
Cease push unit 143.
Fig. 7 shows a kind of shift position week based on the acquisition system of shift position peripheral dynamic position resource in Fig. 3
The flow chart of the acquisition methods of side dynamic position resource, this method mainly include the following steps that:
Step S201:Each mobile terminal sends respective real-time location coordinates information to background server;
Transmission respective location coordinate information of each mobile terminal to background server timing;
Step S202:Memory headroom map is established according to location coordinate information;
The real-time location coordinates information that each mobile terminal is sent in background server receiving step S201, and according to these positions
The coordinate range for putting coordinate information establishes memory headroom map, and the location coordinate information of all mobile terminals is mapped into internal memory sky
Between on map.It is by the concrete mode that memory headroom map is established according to the coordinate range of location coordinate information:
A. the real-time location coordinates information of each mobile terminal is saved in localization message queue by background server;
B. background server calculates space model according to the location coordinate information of all mobile terminals in localization message queue
Enclose, and memory headroom map is established with reference to engineer's scale;The spatial dimension refers to by the location coordinate information of all mobile terminals
The scope that middle minimum location coordinate information and maximum location coordinate information are determined;
C. the position coordinates of all mobile terminals is mapped on memory headroom map.
In step b, background server is according to the location data (location coordinate information) of all mobile terminals received
All coordinate values are X, Y value, calculate spatial dimension (Xmin, Ymin)(Xmax, Ymax), obtain the border of maximum outer rim, such as Fig. 1
Shown in, establish memory headroom map in conjunction with factors such as memory size and engineer's scales.
When specifically calculating spatial dimension, by taking the location coordinate information of two dimension as an example, due to the reality of each mobile terminal
When signal have a location coordinate information X of itself, Y, the maximum boundary that space coordinates position specifically calculates maximum outer rim can be with
In the following ways:
1) variable X is establishedmin,Ymin,Xmax,Ymax;
2) x of the signal (location coordinate information) of first in localization message queue is taken1,y1Coordinate value so that:Xmin=
X1, Ymin=Y1;
Xmax=X1, Ymin=Y1;
Obtain the coordinate X of second signal2, Y2, judge X2Same Xmin、XmaxRelation, if X2<XminThen:Xmin=X2;Such as
Fruit X2>XmaxThen Xmax=X2;
If Y2<YminThen Ymin=Y2;If Y2>Ymax, then Ymax=Y2;
3) position coordinates (X of other mobile terminals is traveled through3, Y3)、(X4, Y4),…(Xn, Yn) repeat step 2);
4) (X is got by above step canmin, Ymin))(Xmax, Ymax) this is box value outside maximum, pass through
Box value determines spatial dimension outside the maximum.
Step S203:Satisfactory surrounding resources are spatially obtained on figure in internal memory;
When some mobile terminal needs to obtain surrounding resources, initiate to subscribe to request to server, initiating to subscribe to periphery
After the subscription request command of dynamic resource, background service can receive the phase that client (initiating to subscribe to the mobile terminal of request) is initiated
Close required parameter, and memory request region is spatially built in internal memory according to required parameter on figure, and in internal memory spatially on figure
Obtain the information that position coordinates falls the mobile terminal in the memory request region.Required parameter includes asked region and sat
Mark information, surrounding resources classification and hierarchical resource;The information of mobile terminal includes the numbering of mobile terminal and the position of mobile terminal
Put coordinate information.
Wherein, the area coordinate information in required parameter refers to asked peripheral distance or the periphery that decision is asked
Multiple coordinate informations of scope.
When the area coordinate information for asked peripheral distance when, the mode in structure memory request region is:
The position coordinates for the mobile terminal asked using initiating subscription is made circle as radius as the center of circle, using the peripheral distance and obtained
Memory request region (memory request region A as shown in Figure 2).
When the multiple coordinate informations for the peripheral extent that the area coordinate information is asked by decision, memory request is built
The mode in region is:With the multiple coordinate points memory request region is obtained as irregular polygon.
After structure obtains memory request region, method of the present invention is yet further still according to constructed memory request
Region creates its corresponding memory request buffering area, such as the buffer area B in Fig. 2.Wherein, the memory request buffering area
Scope includes and is more than memory request region;The size of memory request buffering area can be configured as needed by user.This
Sample is on Memory Map, it is possible to which the current position coordinates point for easily judging which mobile terminal is in memory request region
In the range of, or in the range of memory request buffering area.
Step S204:Background server subscribes to satisfactory information active push to initiation the mobile terminal of request;
Background server will get current position coordinates point in step S203 and fall in the range of memory request region, or
The information active push of mobile terminal in the range of person's memory request buffering area subscribes to the mobile terminal of request to initiation.Push
Concrete mode is:
Background server, will according to the required parameter (resource class, hierarchical resource) for the mobile terminal for initiating to subscribe to request
The surrounding resources information (information of mobile terminal) for meeting required parameter is layered according to required parameter, classification processing, will be located
Surrounding resources information after reason is assembled into corresponding message package and is sent in transmission message queue respectively, and background server will be sent
Message queue active push subscribes to the mobile terminal of request to initiation.
Used in present embodiment and positioning signal (real-time location coordinates information) is established into memory headroom map, and it is all
Mobile terminal locations are mapped on the memory headroom map, while the neighboring area request of client is also mapped onto into internal memory pair
As when, by internal memory spatially region decision on figure, so as to quickly obtain the situation of surrounding resources.In mobile terminal and week
In the case that the change in location frequency of side resource is very high, advantage can be more shown.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technology
Within, then the present invention is also intended to comprising including these changes and modification.