Embodiment
Embodiments herein is described below in detail, the example of the embodiment is shown in the drawings, wherein identical from beginning to end
Or similar label represents same or similar element or the element with same or like function.Retouched below with reference to accompanying drawing
The embodiment stated is exemplary, it is intended to for explaining the application, and it is not intended that limitation to the application.
Below with reference to the accompanying drawings the acquisition methods and device of the geographic position data of the embodiment of the present application described.
The acquisition methods of the geographic position data of the embodiment of the present application, by carrying out multilevel region to geographic position data in advance
Divide, be multiple less data cells by geographic position data cutting, after data request information is obtained, directly basis is worked as
The distance between front position and first order region, obtain the first order region away from its nearest neighbours, and pair first order region determined
In subregions at different levels traveled through step by step using identical method, until obtain current location where lowermost level subregion, and then
Obtain the corresponding geographic position data of lowermost level subregion where current location., wherein it is desired to explanation, to geographical position
The division that data carry out multilevel region is put, and stores the related works such as the geographic position data of multilevel region and is all prepared in advance
, therefore do not influence to implement operational efficiency of method of acquisition of geographic position data etc. in the application.
Fig. 1 is the flow chart of the acquisition methods of the geographic position data according to the application one embodiment.
As shown in figure 1, the acquisition methods of the geographic position data include:
S110, obtains data request information, wherein, data request information includes the current location of request.
It is appreciated that the data request information can with positioning function program actively send, for example, user makes
During with application program with positioning function, the program actively sends data request information;The data request information can also be use
The dynamic transmission of householder, for example, user passes through the button with positioning function when using the application program for carrying positioning function
Or button sends the data request information.
As a kind of example, in embodiments herein, user is obtained in the scene with positioning function such as application program
The data request information of transmission, the wherein data request information include the current location of request, and the present bit of above-mentioned request
The acquisition methods put are related to the concrete application scene for sending data request information, if for example, user is by using GPS
The data request information that the map application A of positioning is sent, then the current location of the request in data request information is to pass through
What GPS was obtained.
Based on above-described embodiment, it will be appreciated that, the acquisition methods of the geographic position data in the embodiment of the present application are applicable
In the application scenarios of a variety of positioning, such as it can be applied in map application, the life clothes such as shopping with positioning function
In application program of being engaged in, in the html web page with positioning function etc., it is numerous to list herein.
S120, the ID in the first order region according to residing for current location determines current location, wherein, first order region includes many
Individual second level subregion.
In embodiments herein, the division of multilevel region is carried out to geographic position data to be retrieved in advance, will be geographical
Geographic area where position data is divided into multiple first order regions, and multiple first order regions are divided again, will
Each first order region division is multiple second level subregions, and the rest may be inferred, is drawn with the multistage completed to geographic position data
Point, wherein partition level it is other how much with the size of current geographic position region, to the accuracy of geographic position data will
Ask etc. related, how much partition level is other can be demarcated by system, also can voluntarily be set according to demand by user.
In addition, it is above-mentioned per level-1 area can be area identical regular shape geometric areas, for example square, hexagon,
Octagon region etc. or other irregular regions, the shapes and sizes in specific region can be according to specific geographical position
The size and shape for putting data is set.Wherein, the size and shape per level-1 area is identical, not the size of level region
Difference, region shape not at the same level can be the same or different.
In embodiments herein, the ID in first order region that can be according to residing for the current location of acquisition determines current location
(Identity, identity number), for obtaining corresponding geographical position number according further to the ID of the geographical area
According to.Wherein, first order region includes multiple second level subregions.Specifically, during above-mentioned multiple first order regions can have
Heart point, thus can calculate respectively in current location and multiple first order regions between the central point in each first order region away from
From, and judged according to the size of the distance between central point in each first order region in current location and multiple first order regions
The ID in the first order region where the first order region where current location, and then acquisition current location.That is, due to
The position of the central point in first order region of the current location where it must be nearest, therefore according to current location distance
The distance of the central point in each first order region determines the first order region residing for current location, and obtains the first order region
ID。
It should be noted that above-mentioned calculating current location during the distance of the central point in each first order region, has
It is likely to occur apart from identical situation, therefore in certain situations it is desirable to carry out duplicate removal processing to the geographic position data of acquisition,
Such as can carry out duplicate removal processing to it by Duplicate Removal Algorithm.For example, current location is in the side in two first order regions
When in boundary line, the distance for calculating it apart from above-mentioned two first order regional center point is identical, therefore can randomly choose one
Level-1 area obtains corresponding ID as the first order region where it.
S130, successively travel through current location residing for first order region included by second level subregion to N grades of subregions with
The ID of N grades of subregions corresponding to current location is determined, wherein, N is the positive integer more than or equal to 2.
Specifically, the second level subregion according to residing for current location determines current location, wherein, second level subregion bag
Multiple third level subregions are included, third level subregion is traveled through successively to N grades of subregions to determine the corresponding to current location
The ID of N grades of subregions.
That is, after the ID in the first order region residing for the current location got, this where current location can be obtained
Second level subregion included by first order region, wherein, the second level subregion can be multiple, obtain current location place
Second level subregion method it is identical with the method for obtaining first order region, you can with according to current location and multiple second level
The distance between central point of each second level subregion judges the second level subregion where current location in subregion, true
After second level subregion residing for settled front position, second level subregion that can be according to residing for current location determines current location
Included third level subregion, wherein, the method for obtaining the third level subregion residing for current location obtains current with foregoing
The method of second level subregion where position is identical.By that analogy, until obtaining N grades of sub-districts corresponding to current location
The ID in domain, the N grades of subregions are contained in N-1 grades of subregions.
S140, the corresponding geographic position data of N grades of subregions is obtained according to the ID of N grades of subregions.
It is appreciated that the ID and corresponding geographic position data of N grades of subregions are stored in server in advance, the service
Be stored with the ID of multilevel region and the corresponding relation of geographic position data in device, wherein the ID of above-mentioned multilevel region can be managed
Solve the key assignments of the uniqueness to identify multiple regions, the key assignments can be by the numberings of N grades of subregions where current location
Etc. representing.Therefore, after the corresponding N grades of subregions in current location are got, obtained according to the ID of N grades of subregions
The corresponding geographic position data of N grades of subregions.The diminution step by step to current geographic position region scope is realized, it is real
The quick positioning to current location geographic location data and retrieval are showed.
Wherein, above-mentioned geographic position data can be the street information where current location, and number information, current location are attached
The data that near retail shop's information, favor information, sight spot information, transport information etc. and geographic position data are associated.
In order that those skilled in the art, the geographic position data that can be more apparent from the embodiment of the present application obtains
Method is taken, is carried out below using Fig. 2 (a)-Fig. 2 (c) and Fig. 3 as a kind of example of acquisition methods of geographic position data
Illustrate, in the example, geographic position data is divided into two ranks and the figure in the region divided is square, at this
In example, with the distance of the central point of square to square vertices, the area of the corresponding square area in regions at different levels is limited
Size.It is described as follows:
, it is necessary to carry out the division of rank to geographic position data before geographic position data is obtained, before division, it is determined that
Border and the granularity of geographic position data are divided, shown in such as Fig. 2 (a), the side of the part geographic position data in Chengdu is determined
Boundary 21, is illustrated so that 21 is squares as an example here, and then the geographic position data in pair border 21 determined enters
Shown in the division of row rank, such as Fig. 2 (b), the geographic position data that 21 include is divided into 9 square first order
Region, by this 9 first order zone numbers be region 1, region 2 until region 9, and determine each square firstth area
The transit square degree of the central point in domain, carries out the mark of first order regional center point (in figure with (x1, y1)-(x9, y9) here
Only show (x1, y1) and (x9, y9)), at the same records center point with square fixed point distance for r1 (in region 9
Show).With the above-mentioned division methods to first order region, on the basis of shown in Fig. 2 (b), such as shown in Fig. 2 (c),
The division of second level subregion is carried out to geographic position data, will first order region division be each 9 second level subregions,
And on the basis of the numbering in first order region, second level subregion is numbered, such as by the 5th, first order region
The numbering of second level subregion is sub15 (numbering that the 5th second level subregion in first order region is only shown in figure), and
Here the mark (not shown) of second level subregion central point is carried out with (subx11, suby11)-(subx91, suby99),
Simultaneously record second level subregion each central point be currently located square area summit apart from r21 (in region sub51
In mark).
Further, after the completion of to geographic position data partition of the level, by the ID of each second level subregion and accordingly
Geographic position data it is nested with the ID in first order region, wherein Fig. 3 is illustrated by zone numbers at different levels of the ID.
In Fig. 3 example, geographic position data is solid data value and preserves the data in the server, wherein the solid data
It is corresponding with zone numbers at different levels.After user initiates data request information, using traversal method from it is highest step by step over the ground
Reason position data is retrieved, the zone number of the second level subregion where acquisition current location, and passes through second level
The zone number in region, obtains the corresponding geographic position data of zone number stored in server.
Specifically, as shown in figure 3, after user locality data request message (S310) near initiating to obtain, from the
Level-1 area proceeds by the retrieval of geographic position data, obtains the nearest first order region (S320) in current location, adopts afterwards
The second level subregion in first order region is retrieved with the method for traversal, with obtain apart from current location it is nearest second
Level subregion (S330), and corresponding geographic position data (S340) is obtained according to the region ID of the second level subregion of acquisition,
Get after the geographic position data, return to geographic position data (S350) to user.
In summary, the acquisition methods of the geographic position data of the embodiment of the present application, are carried out multistage to geographic position data in advance
The division in region, after data request information is obtained, obtains residing first order region according to current location, and to this first
Subregions at different levels in level region are traveled through step by step, so as to obtain current geographic position data.This method passes through data are larger
Geographic position data cutting is multiple independent data cells, realizes the quick obtaining to geographic position data and retrieval.
Based on above-described embodiment, further, if user needs to obtain the geographical position number near the region of current location
According to, then can by obtain current location region near zone geographic position data realize.Such as user is in B business
, and the B markets are determined in some second level subregion, if then user wants to know about the neighbouring direction in B markets, such as
What north region also has, then can directly obtain the ID of the northern corresponding second level subregion of above-mentioned second level subregion,
And can obtain corresponding geographic position data to obtain relevant information according to the ID.Specifically, Fig. 4 is according to the application one
The flow chart of the acquisition methods of the geographic position data of individual specific embodiment, as shown in figure 4, on the basis of as shown in Figure 1,
It is determined that after the ID of N grades of subregions corresponding to current location, this method also includes:
S150, obtains the ID of the N grade subregion adjacent with N grades of subregions corresponding to current location.
If it is appreciated that to obtain the geographic position data of other the N grade subregions adjacent with current N grades of subregions,
N grades of subregion ID adjacent thereto can be obtained on the basis of the corresponding N grades of subregions in current location of acquisition.Than
Such as, as shown in Fig. 2 (c), if the zone number for the position E that user is currently located is sub59, its adjacent left
The numbering of second level subregion is sub52, and the numbering of the second level subregion of its adjacent top is sub58 etc..Namely
Say, the N in each orientation adjacent thereto on the basis of the corresponding N grades of subregions in current location of acquisition, can be obtained
Level subregion ID.
S160, receives user instruction.
In embodiments herein, the user instruction of reception may include that map translation instruction, map zoom in or out instruction etc.,
The input mode of the instruction is different and different according to specific application scenarios, can be touch input, word input, voice
Input etc..In addition, the mode of the touch input can be gesture input mode, can also be the input that is provided by application by
Key (as reduced button, amplifying key-press, left, right translation button etc.) input.
Selected in S170, the N grades of subregions adjacent according to N grades of subregions of the user instruction corresponding to current location
N grades of subregions of target, and determine the ID of N grades of subregions of target.
In embodiments herein, the N adjacent according to N grade subregion of the user instruction corresponding to current location
N grades of subregions of selection target in level subregion, and determine the ID of N grades of subregions of target, such as, user can be by double
Hit the top of current region, selection and N grades of subregions above N grade subregions corresponding to current location are target the
N grades of subregions, it is achieved thereby that the quick positioning of the data area to the N grades of subregions of target, and can be according to acquisition
The ID of N grades of subregions of target obtains its corresponding geographic position data.
S180, obtains the corresponding geographic position data of N grades of subregions of target according to the ID of N grades of subregions of target and provides
To user.
In one embodiment of the application, the N stored in server can be got according to the ID of N grades of subregions of target
The corresponding geographic position data of level subregion is simultaneously provided to user, such as, user can be supplied in the way of text.
In summary, the acquisition methods of the geographic position data in the embodiment of the present application, obtain N corresponding with current location
The ID of N grades of adjacent subregions of level subregion, and selected according to user instruction from the ID of N grades of adjacent subregions
N grades of subregions of target, and then corresponding geographic position data is obtained according to the ID of N grades of subregions of target, and be supplied to
User, realizes the geographic position data of the close region of quick obtaining current location, further increases recall precision.
In order to realize above-described embodiment, the application also proposed a kind of acquisition device of geographic position data, and Fig. 5 is according to this
Apply for the structural representation of the acquisition device of the geographic position data of one embodiment, as shown in figure 5, the geographic position data
Acquisition device include:First acquisition module 510, determining module 520, the acquisition module 540 of spider module 530 and second.
Wherein, the first acquisition module 510 is used to obtain data request information, wherein, data request information includes working as request
Front position.
It is appreciated that the data request information can with positioning function program actively send, for example, user makes
During with application program with positioning function, the program actively sends data request information;The data request information can also be use
The dynamic transmission of householder, for example, user passes through the button with positioning function when using the application program for carrying positioning function
Or button sends the data request information.
As a kind of example, in embodiments herein, the first acquisition module 510 obtains user and carried in application program etc.
The data request information sent in the scene of positioning function, the wherein data request information include the current location of request, and
The acquisition methods of the current location of above-mentioned request are related to the concrete application scene for sending data request information, if for example, the
What one acquisition module 510 was obtained is the data request information that user sends by using the map application A of GPS location,
Then the current location of the request in data request information is obtained by GPS.
Determining module 520, for the ID in the first order region residing for determining current location according to current location, wherein, first
Level region includes multiple second level subregions.
In embodiments herein, the division of multilevel region is carried out to geographic position data to be retrieved in advance, will be geographical
Geographic area where position data is divided into multiple first order regions, and multiple first order regions are divided again, will
Each first order region division is multiple second level subregions, and the rest may be inferred, is drawn with the multistage completed to geographic position data
Point, wherein partition level it is other how much with the size of current geographic position region, to the accuracy of geographic position data will
Ask etc. related, how much partition level is other can be demarcated by system, also can voluntarily be set according to demand by user.
In addition, it is above-mentioned per level-1 area can be area identical regular shape geometric areas, for example square, hexagon,
Octagon region etc. or other irregular regions, the shapes and sizes in specific region can be according to specific geographical position
The size and shape for putting data is set.Wherein, the size and shape per level-1 area is identical, not the size of level region
Difference, region shape not at the same level can be the same or different.
In embodiments herein, first that determining module 520 can be according to residing for the current location of acquisition determines current location
The ID in level region, for obtaining corresponding geographic position data according further to the ID of the geographical area.Wherein, first
Level region includes multiple second level subregions.Specifically, Fig. 6 is the geographical position according to one specific embodiment of the application
The structural representation of the acquisition device of data, as shown in fig. 6, the determining module 520 may include computing unit 521, judgement
Unit 522 and acquiring unit 523.Above-mentioned multiple first order regions can have central point, therefore computing unit 521 can be with
Current location and the distance between the central point in each first order region, judging unit 522 in multiple first order regions are calculated respectively
Present bit is judged according to the size of the distance between central point in each first order region in current location and multiple first order regions
The ID in the first order region where the first order region where putting, and then the acquisition of acquiring unit 523 current location.That is,
Because the position of the central point in first order region of the current location where it must be nearest, therefore judging unit 522
According to residing for the current location that computing unit 521 is calculated apart from the distance of the central point in each first order region determines current location
First order region, and pass through acquiring unit 523 obtain the first order region ID.
Spider module 530, for traveling through the second level subregion included by the first order region residing for current location successively to N
Level subregion to determine the ID of N grade subregions corresponding to current location, wherein, N is positive integer more than or equal to 2.
Specifically, the second level subregion according to residing for current location determines current location, wherein, second level subregion bag
Multiple third level subregions are included, spider module 530 travels through third level subregion to N grades of subregions to determine present bit successively
Put the ID of N grades of corresponding subregions.
Fig. 7 is the structural representation of the acquisition device of the geographic position data according to the application another embodiment, such as Fig. 7 institutes
Show, the spider module 530 may include determining unit 531 and Traversal Unit 532.
That is, after the ID in the first order region residing for the current location that determining module 520 is got, determining unit
531 can obtain the second level subregion included by the first order region where current location, wherein, the second level subregion
Can be multiple, the method for the second level subregion where acquisition current location is identical with the method for obtaining first order region, you can
To judge present bit according to the distance between central point of each second level subregion in current location and multiple second level subregions
Second level subregion where putting, it is determined that after second level subregion residing for current location, can be determined according to current location
The third level subregion included by the subregion of the second level residing for current location, wherein, obtain the third level residing for current location
The method of subregion is identical with the method for the second level subregion where foregoing acquisition current location.By that analogy, Traversal Unit
532 travel through third level subregion to N grades of subregions successively, until obtaining N grades of subregions corresponding to current location
ID, the N grades of subregions are contained in N-1 grades of subregions.
Second acquisition module 540, for obtaining the corresponding geographical position number of N grades of subregions according to the ID of N grades of subregions
According to.
It is appreciated that the ID and corresponding geographic position data of N grades of subregions are stored in server in advance, the service
Be stored with the ID of multilevel region and the corresponding relation of geographic position data in device, wherein the ID of above-mentioned multilevel region can be managed
Solve the key assignments of the uniqueness to identify multiple regions, the key assignments can be by the numberings of N grades of subregions where current location
Etc. representing.Therefore, after spider module 530 gets the corresponding N grades of subregions in current location, the second acquisition module
540 obtain the corresponding geographic position data of N grades of subregions according to the ID of N grades of subregions.Realize to current geographic position
The diminution step by step of region scope is put, the quick positioning to current location geographic location data and retrieval is realized.
Wherein, above-mentioned geographic position data can be the street information where current location, and number information, current location are attached
The data that near retail shop's information, favor information, sight spot information, transport information etc. and geographic position data are associated.
In summary, the acquisition device of the geographic position data of the embodiment of the present application, is carried out multistage to geographic position data in advance
The division in region, after data request information is obtained, obtains residing first order region according to current location, and to this first
Subregions at different levels in level region are traveled through step by step, so as to obtain current geographic position data.The device passes through data are larger
Geographic position data cutting is multiple independent data cells, realizes the quick obtaining to geographic position data and retrieval.
Based on above-described embodiment, further, if user needs to obtain the geographical position number near the region of current location
According to, then can by obtain current location region near zone geographic position data realize.Specifically, Fig. 8
For the structural representation of the acquisition device of the geographic position data according to the application another embodiment, as shown in figure 8, such as
On the basis of shown in Fig. 5, after the ID that spider module 530 determines N grades of subregions corresponding to current location, the dress
Putting also includes:3rd acquisition module 550, receiving module 560, selecting module 570 and offer module 580.
Wherein, the 3rd acquisition module 550 is used to obtain the N grade sons adjacent with N grades of subregions corresponding to current location
The ID in region.
If it is appreciated that to obtain the geographic position data of other the N grade subregions adjacent with current N grades of subregions,
3rd acquisition module 550 can obtain adjacent thereto the on the basis of the corresponding N grades of subregions in current location of acquisition
N grades of subregion ID.That is, the 3rd acquisition module 550 can be in the corresponding N grades of subregions in current location of acquisition
On the basis of, obtain the N grades of subregion ID in each orientation adjacent thereto.
Receiving module 560, for receiving user instruction.
In embodiments herein, the user instruction that receiving module 560 is received may include that map translation instruction, map are reduced
Or amplification instruction etc., the input mode of the instruction, according to the different and different of specific application scenarios, can be touch input,
Word is inputted, phonetic entry etc..In addition, the mode of the touch input can be gesture input mode, it can also be by answering
With input button (as reduced button, amplifying key-press, left, right translation button etc.) input of offer.
Selecting module 570, N grades adjacent for the N grades of subregions according to user instruction corresponding to current location
N grades of subregions of selection target in subregion, and determine the ID of N grades of subregions of target.
In embodiments herein, N grade sub-districts of the selecting module 570 according to user instruction corresponding to current location
N grades of subregions of selection target in N grades of adjacent subregions of domain, and determine the ID of N grades of subregions of target.
Module 580 is provided, for obtaining the corresponding geographical position of N grades of subregions of target according to the ID of N grades of subregions of target
Put data and provide to user.
Server can be got according to the ID of N grades of subregions of target there is provided module 580 in one embodiment of the application
The corresponding geographic position data of N grades of subregions of middle storage is simultaneously provided to user, such as, can be provided in the way of text
To user.
In summary, the acquisition device of the geographic position data in the embodiment of the present application, obtains N corresponding with current location
The ID of N grades of adjacent subregions of level subregion, and selected according to user instruction from the ID of N grades of adjacent subregions
N grades of subregions of target, and then corresponding geographic position data is obtained according to the ID of N grades of subregions of target, and be supplied to
User, realizes the geographic position data of the close region of quick obtaining current location, further increases recall precision.
In the description of the present application, it is to be understood that term " first ", " second " are only used for describing purpose, and can not
It is interpreted as indicating or implies relative importance or the implicit quantity for indicating indicated technical characteristic.Thus, define " the
One ", at least one this feature can be expressed or be implicitly included to the feature of " second ".In the description of the present application, " multiple "
It is meant that at least two, such as two, three etc., unless otherwise specifically defined.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specific example ",
Or the description of " some examples " etc. means to combine specific features, structure, material or the feature that the embodiment or example are described
It is contained at least one embodiment of the application or example.In this manual, need not to the schematic representation of above-mentioned term
Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office
Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, this area
Technical staff can be tied the not be the same as Example or the feature of example and non-be the same as Example or example described in this specification
Close and combine.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes one
Or more be used for executable instruction the step of realize specific logical function or process code module, fragment or part,
And the scope of the preferred embodiment of the application includes other realization, wherein order that is shown or discussing can not be pressed,
Including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be by the application's
Embodiment person of ordinary skill in the field is understood.
It should be appreciated that each several part of the application can be realized with hardware, software, firmware or combinations thereof.In above-mentioned reality
Apply in mode, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage or
Firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA) is existing
Field programmable gate array (FPGA) etc..
Those skilled in the art be appreciated that to realize all or part of step that above-described embodiment method is carried is can
To instruct the hardware of correlation to complete by program, described program can be stored in a kind of computer-readable recording medium,
The program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in the application each embodiment can be integrated in a processing module or each
Individual unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated module was both
It can be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.If the integrated module with
The form of software function module realize and as independent production marketing or in use, can also be stored in one it is computer-readable
Take in storage medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although having been shown and described above
Embodiments herein, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limitation to the application,
One of ordinary skill in the art can be changed to above-described embodiment, change, replacing and modification within the scope of application.