CN106126575A - A kind of geo-location service method, server and system - Google Patents

A kind of geo-location service method, server and system Download PDF

Info

Publication number
CN106126575A
CN106126575A CN201610439677.4A CN201610439677A CN106126575A CN 106126575 A CN106126575 A CN 106126575A CN 201610439677 A CN201610439677 A CN 201610439677A CN 106126575 A CN106126575 A CN 106126575A
Authority
CN
China
Prior art keywords
data
unit
user
geographical
unit marks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610439677.4A
Other languages
Chinese (zh)
Inventor
马庆升
江壬
赖剑冰
洪小军
麦俊生
阮永丽
刘谬勇
郭晨晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN201610439677.4A priority Critical patent/CN106126575A/en
Publication of CN106126575A publication Critical patent/CN106126575A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of geo-location service method, including: receive the inquiry request of user, this inquiry request includes the current geographic position information of user;Centered by current geographic position, the first distance for radius, one border circular areas is set;Unit marks according to all geographical space unit covered in border circular areas described in geographical spatial index library searching;In distributed cache, the data of coupling are searched for according to the unit marks retrieved;If not searching the data mated with unit marks from distributed cache, then all not unit marks that the match is successful are scanned in data base as key word;Merge neutralizing all data searched from data base from distributed cache according to the condition comprised in the inquiry request of user successively, filter and sequence process;The Query Result of the data after comprising process is returned to user.The invention also discloses a kind of server and geographical position service system.

Description

A kind of geo-location service method, server and system
Technical field
The present invention relates to Information Technology Agreement field, particularly relate to a kind of geo-location service method, server and system.
Background technology
Address location service (Location Based Service, LBS), it is common that based on supporting spaced geographic locations rope The address location data directory that the data base (such as MongoDB, PostGIS) drawn builds and inquiry service.When due to imprevision Accident cause certain geographic location area to rapidly become focus and thus bring the short time in mass data index and look into When asking request, performing index and inquiry owing to depending on data base unduly, data base readily becomes the bottleneck of whole service, draws Play service quality to decline.The most once data base goes wrong and cannot access, and can directly result in service unavailable.
LBS inquiry and write, the peak period of such as coming off duty exploded will often occur in the application scenarios of some softwares Period, a large number of users assembled Central commerce district about car on about car software, or the lunchtime concentrates on take-away software outside point Sell, i.e. have more people these regions all can be made to become hot spot region when using LBS service within the short time of crowd massing region.And LBS that these explode inquiry and write normally result in the query performance of data base and drastically reduce, and inquiry is time-consuming to be increased, and inquiry gulps down The amount of telling is greatly reduced, and server cpu load steeply rises, and the phenomenon of bigger delay occurs in data base's leader follower replication.
Existing solution is to carry out subregion according to longitude and latitude, and sets up data-base cluster for each subregion.By this Plant the mode that data are carried out partitioned storage, index and inquiry are distributed to multiple storage cluster to alleviate the problems referred to above.This Although partition solution can alleviate problem to a certain extent, but the most fundamentally solve focus and access to explode and brought Problem.Occurring that focus accesses in any one subregion, the most inevitably there is above-mentioned asking when exploding in index and queries Topic, causes the inquiry service quality in same subregion to decline.
Summary of the invention
To this end, the present invention provides a kind of geo-location service method, server and system, to try hard to solve or at least alleviate The problem existed above.
According to an aspect of the present invention, it is provided that a kind of geo-location service method, be suitable to perform in the server, the party Method includes: receive the data inquiry request relevant with geographical position of user, includes working as of user in this data inquiry request Front geographical location information;Centered by the current geographic position of user, the first distance for radius, one border circular areas is set;Base area The unit marks of all geographical space unit covered in reason spatial index library searching border circular areas;With the unit marks retrieved Search for the data of coupling in distributed cache as key word, wherein the data in this distributed cache are and list Unit's mark association storage;If not searching the data mated with unit marks from this distributed cache, then by institute The unit marks that the match is successful is had to search for the data of coupling in data base respectively as key word;Inquiry according to user please The condition comprised is asked the data searched from distributed cache and the data searched from data base to be entered successively Row merges, filters and sequence process;The Query Result of the data after comprising process is returned to user.
Alternatively, in the method according to the invention, geographical space index database include Google S2Library or Geohash tool storage room.
Alternatively, in the method according to the invention, Google S2Library instrument is used when geographical spatial index storehouse During storehouse, geographical space unit is suitable for use with the size of the 15th grade.
Alternatively, in the method according to the invention, data base is suitable for use with MongoDB data base, described distributed height Speed caching is suitable for use with Memcache memory cache system.
Alternatively, in the method according to the invention, using all not unit marks that the match is successful as key word The step of the data searching for coupling in data base includes: calculate the summit of geographical space unit corresponding to each unit marks Longitude and latitude;In MongoDB data base, coupling is searched for by the method performing polygon inquiry according to this summit latitude and longitude information Corresponding data.
Alternatively, in the method according to the invention, also include: if data total amount after treatment is not up to first Numerical value, then the data outside all geographical space unit covered in continuing to search for border circular areas in data base, until data Total amount reaches the first numerical value.
Alternatively, in the method according to the invention, also include: will make respectively with all not unit marks that the match is successful The data searched in data base for key word and the unit marks association of correspondence thereof store in distributed cache.
Alternatively, in the method according to the invention, also include: receive the data write relevant with geographical position of user Request, includes the current geographic position information of user and data to be written in described data write request;According to geographical empty Between the unit marks of the geographical space unit belonging to current geographic position of index database retrieval user;By described data to be written Send and carry out transfer process to message queue;Judging whether stored described write according to data in distributed cache please Seek the unit marks retrieved;If then described data after transfer processes being simultaneously sent to data base and distributed height Speed caching stores;Otherwise it is only sent to data base stores.
According to another aspect of the present invention, it is provided that a kind of server, including: request reception unit, be suitable to receive user Data inquiry request, this data inquiry request includes the current geographic position information of user;Region setup unit, is suitable to Centered by the current geographic position of user, the first distance for radius, one border circular areas is set;Identification retrieval unit, is suitable to basis The unit marks of all geographical space unit covered in geographical space index database retrieval border circular areas;First acquiring unit, suitable In distributed cache, the data of coupling, wherein this distributed height is searched for as key word in the unit marks to retrieve Data in speed caching associate storage with unit marks;Second acquisition unit, being suitable to ought be from distributed cache When searching the data mated with unit marks, using all not unit marks that the match is successful as key word data base The data of middle search coupling;Data processing unit, being suitable to will be from distributed height according to the condition comprised in the inquiry request of user The data and the data searched from data base that search in speed caching merge successively, filter and sequence process;Result Return unit, be suitable to return to user the Query Result of the data after comprising process.
Alternatively, according in the server of the present invention, geographical space index database include Google S2Library or Geohash tool storage room.
Alternatively, according in the server of the present invention, when geographical spatial index storehouse uses described Google During S2Library tool storage room, geographical space unit is suitable for use with the size of the 15th grade.
Alternatively, according in the server of the present invention, data base is suitable for use with MongoDB data base, distributed type high speed Caching is suitable for use with Memcache memory cache system.
Alternatively, according in the server of the present invention, second acquisition unit is suitable to according to following methods according to not mating Successfully unit marks searches for the data of coupling in data base: calculate geographical space unit corresponding to each unit marks Summit longitude and latitude;Searched for by the method performing polygon inquiry in MongoDB data base according to this summit latitude and longitude information The data of coupling.
Alternatively, according in the server of the present invention, also include: data filling unit, be suitable to when described through processing After data total amount when being not up to the first numerical value, all geographical space lists covered in continuing to search for border circular areas in data base Data outside unit, until data total amount reaches the first numerical value.
Alternatively, according in the server of the present invention, also include: data storage cell, be suitable to not mate with all Data and the unit marks association of correspondence thereof that successfully unit marks searches in data base respectively as key word store In distributed cache.
Alternatively, according in the server of the present invention, request reception unit is further adapted for receiving user's and geographical position Relevant data write request, comprises the current geographic position information of user and data to be written in this data write request; Identification retrieval unit is further adapted for the geographical space unit belonging to the current geographic position according to geographical spatial index library searching user Unit marks.
Alternatively, according in the server of the present invention, also include: data relay unit, be suitable to the data being written into Send and carry out transfer process to message queue.
Alternatively, according in the server of the present invention, data storage cell is further adapted for judging in distributed cache Whether store the unit marks that with good grounds data write request retrieves;If then the data after transfer processes are sent out simultaneously Deliver to data base and distributed cache store;Otherwise it is only sent to data base stores.
According to another aspect of the present invention, it is provided that a kind of geographical position service system, including server as above With at least one mobile terminal.
The technical scheme provided according to the present invention, is divided into geographical space according to Google S2Libarary tool storage room Multiple geographical space unit, each geographical space unit has the unit marks of its correspondence, and will in distributed cache Unit marks described in the data relevant with geographical position and this position is associated storage.When occurring based on a certain hotspot location During magnanimity inquiry request, from distributed cache, preferentially search for the matched data in the range of the 500m of current location, with this Support hotspot location thus solve the data query strong Dependence Problem to data base.If the unit marks of a certain position is distributed The data of cache-miss Corresponding matching, then search for data from data base, and take the WriteAnyway strategy will be from number Store in distributed cache according to the data got in storehouse.
And mass data is write to the pressure that data base is caused, then to be alleviated by increase message queue, write please Data included in asking are first sent to message queue, then by queue handler take out from message queue data and Reason.Additionally, when processing queue message and updating storage to distributed cache and data base double write to ensure memory cache and The concordance of data base.
Accompanying drawing explanation
In order to realize above-mentioned and relevant purpose, herein in conjunction with explained below and accompanying drawing, some illustrative side is described Face, these aspects indicate can to put into practice the various modes of principles disclosed herein, and all aspects and equivalence aspect It is intended to fall under in the range of theme required for protection.By reading in conjunction with the accompanying detailed description below, the disclosure above-mentioned And other purpose, feature and advantage will be apparent from.Throughout the disclosure, identical reference generally refers to identical Parts or element.
Fig. 1 shows the schematic diagram of geographical position service system 100 according to an embodiment of the invention;
Fig. 2 shows the flow chart of geo-location service method 200 according to an embodiment of the invention;
Fig. 3 shows the geographical space cell schematics according to the in Google S2Library the 14th grade;
Fig. 4 shows the geographical space cell schematics according to the in Google S2Library the 15th grade;
Fig. 5 shows the geographical space cell schematics according to the in Google S2Library the 16th grade;
Fig. 6 shows the flow chart of geo-location service method 600 in accordance with another embodiment of the present invention;
Fig. 7 shows the structural representation of server 700 according to an embodiment of the invention.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing shows the disclosure Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should be by embodiments set forth here Limited.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Fig. 1 shows the schematic diagram of geographical position service system 100 according to an embodiment of the invention.As it is shown in figure 1, One server of this system and at least one intelligent terminal.Server can be a station server, it is also possible to be by some clothes The server cluster of business device composition, or a cloud computing service center.Additionally, be used for forming server cluster or cloud computing Multiple servers of service centre may reside within multiple geographical position, and the deployment way of server is not limited by the present invention System.Intelligent terminal can be web-enabled vehicle mounted guidance, the mobile device such as mobile phone, panel computer, it is also possible to be intelligent watch, intelligence The wearable device that energy glasses etc. can network.Although exemplarily only show an intelligent terminal in Fig. 1, but this area Technical staff is it is to be appreciated that can also include multiple intelligent terminal in this system, the present invention is in geographical position service system The number of intelligent terminal unrestricted.Intelligent terminal can set up with navigation server in a wired or wireless manner and be connected. Certainly, in great majority navigation situation, what intelligent terminal and navigation server were set up is wireless connections, such as, use 3G, 4G, The technology such as WiFi, individual focus, IEEE802.11x, bluetooth set up wireless connections.
Server provides the service relevant to geographical position to intelligent terminal, as in response to user is at Mei Tu company (longitude and latitude Degree (24.492143,118.175379)) submit to inquiry neighbouring 500 meters in U.S.A shoot the video, return Query Result to user. Further, it is also possible to receive, by number of ways, the data relevant to geographical position that user uploads, as received user in a certain position Put the U.S.A uploaded shoot the video, microblogging and model, these data are generally all with the current geographic position information of user, such as longitude and latitude Information etc..
Fig. 2 shows the stream of the geo-location service method 200 accessed according to an embodiment of the invention based on focus Cheng Tu, the method starts from step S210.
In step S210, receive the data inquiry request relevant with geographical position of user, described data inquiry request In include the current geographic position information of user.
Subsequently, in step S220, centered by the current geographic position of user, that the first distance arranges one for radius is circular Region.Service based on geographical position, the data in the most neighbouring 500m are the most more meaningful, in neighbouring 500m Special train, restaurant etc., therefore the first distance can be set as 500m, naturally it is also possible to is set to other numerical value according to practical situation.
Subsequently, in step S230, according to all geography covered in border circular areas described in geographical spatial index library searching The unit marks of space cell.Wherein, all geographical space unit covered in border circular areas can be found in the shown institute in Fig. 3 There is tetragon cells.
Geographical space index database as above can use Google S2Library or GeoHash tool storage room, different Be the former based on Sphere Measurement Model the latter based on areal model.As a example by Google S2Library, it is by the sphere of the earth Being divided into little geographical space unit (Cell) according to hierarchy rules, each unit has its unique ID to number, and can be referred to as For Cell ID.It practice, the area of each square centimeter can represent, by Cell with a unique Cell ID on the earth ID is converted into 16 scale codings and is the unit marks (Cell Token) of this geographical space unit, with unit marks as key word The data of coupling geographical space unit belonging to this unit marks can be searched in distributed cache or data base.Often The size and shape of individual unit is the most incomplete same, and this generally depends on this unit position on earth.
Grade and the represented cellar area magnitude relationship thereof of geographical space unit are as shown in the table:
Grade Minimum area Maximum area
0 85,011,012km2 85,011,012km2
1 21,252,753km2 21,252,753km2
12 3.31km2 6.38km2
30 0.48cm2 0.93cm2
The unit covered required for a given shape can be calculated by Google S2Library.If setting inquiry Near data in 500m, then we are it needs to be determined that circle centered by covering the geographical position that user is current, with 500 meters as radius Shape region, the geographical space unit of required same levels and unit area coverage.
Fig. 3-5 respectively illustrates the 14th grade, 15 grades, the geographical space unit signal of 16 grades in Google S2Library Figure, border circular areas therein is the regional extent covering neighbouring 500m.Inventor finds according to a large amount of actual tests, 14 grades Geographical space unit area coverage is relatively big, the extraneous data outside causing user to obtain more 500m scope when inquiry;16 grades Geographical space unit area coverage the most too small, then cover 500 meters border circular areas need more geographical space unit, increase The workload of caching query.Therefore, inventor considers the unit number required for covering specific region and each unit The region area covered, selects the geographical space unit of 15 grades to obtain preferable Consumer's Experience.
Calculate the unit marks of 15 grades of geographical units belonging to a geographical position, can call by the following method Go out:
public String getCellToken(double longitude,double latitude){
S2Cell cell=new S2Cell (S2LatLng.fromDegrees (latitude, longitude));
return cell.id().parent(15).toToken();
}
As a example by Mei Tu company place longitude and latitude (24.4921434999,118.1753793695), 15 grades of its place geography The ID of space cell is 3752794007428661248, and be converted to 16 systems obtaining unit marks Token is 34149a444, root Mei Tu company place geography space cell can be searched in distributed cache or data base according to this unit marks The data relevant with position.
If user video U.S. near requesting query near Mei Tu company claps, after server receives this request, the most logical Cross Google S2Library and calculate the unit marks of all geographical space unit covered in 500 meters of this geographical position, when So can also adjust radius size according to practical situation.Wherein, calculating and cover centered by specifying longitude and latitude, 500 meters is radius All geographical space unit marks, can draw by the following method (Java):
In the above example, covering all geographical space unit marks of 500m border circular areas near Mei Tu company is:
"34149a40c","34149a414","34149a434","34149a43c","34149a444"," 34149a44c","34149a454","34149a45c","34149a464","34149a46c","34149a474"," 34149a47c ", " 34149a48c ", " 34149a4f4 ", " 34149a4fc ", " 34149a5ac ", " 34149a5b4 ", totally 17 Individual, 17 quadrilateral units shown in corresponding diagram 4 respectively.
Subsequently, in step S240, search in distributed cache using the unit marks retrieved as key word The data of coupling, wherein the data in this distributed cache associate storage with unit marks.Specifically, distributed height Speed caching can use Memcache memory cache system, can be concurrent by the MultiGet of Memcache when searching for data Obtain the data in each geographical space unit stored in memory cache.
Subsequently, in step s 250, if not searching the number mated with unit marks from this distributed cache According to, then in data base, the data of coupling are searched for using all not unit marks that the match is successful as key word.Additionally also Can by the above-mentioned data searched in data base as key word using all not unit marks that the match is successful and Corresponding unit marks association stores in distributed cache.
Specifically, if not setting up the subitem of certain unit marks in distributed cache, then with this unit marks for closing The data of coupling searched in data base in keyword;I.e. to all unit marks miss in distributed cache, directly Data are obtained from data base.Additionally, can obtain and this without reference to the querying condition of user when obtaining data from data base All data that individual unit marks is relevant, and use the data buffer storage of WriteAnyway to write strategy in distributed cache The unit marks of the data got from data base and correspondence thereof is associated storage.
As user needs the U.S. bat near inquiry in Mei Tu company, but in distributed cache, do not store figure institute of U.S. " 34149a444 " unit marks and the data of correspondence.Now can be with " 34149a444 " unit marks in data base Data corresponding to keyword search, are the most just not limited to U.S. bat class data, but all relevant to this unit marks Data, such as the microblogging in this geographical space unit, model, special train information, restaurant etc., and all data that these are got And " 34149a444 " unit marks of correspondence associates storage distributed telling in caching.
Data base as above can use MongoDB data base, for when caching penetrates from MongoDB data base Accurately read the data in a geographical space unit, use the summit longitude and latitude first calculating this unit, then in MongoDB Perform polygon inquiry to realize.
Specifically, geographical space unit summit (Java) can be calculated by the following method:
The incoming summit by Google S2Library calculated geographical space unit in<coordinates> Longitude and latitude data.
Subsequently, in step S260, will be from distributed cache according to the condition comprised in the inquiry request of user The data searched and the data searched from data base merge successively, filter and sequence process.
Subsequently, in step S270, return the Query Result of the data after comprising process to user.Specifically, Ke Yixian Judge whether above-mentioned data total amount after treatment reaches the first numerical value, such as whether full one page can be taken.If then directly to User returns Query Result;Outside all geographical space unit covered in otherwise continuing to search for border circular areas in data base Data, until data total amount reaches the first numerical value, and return the inquiry knot including the data meeting the first numerical value to user Really.Here, because priority treatment is the data in the range of 500m, the follow-up data supplemented from 500m scope can be straight It is connected on after being attached to legacy data and returns to user, naturally it is also possible to these data supplemented are carried out certain filtration and sequence Process, the invention is not limited in this regard.
MongoDB data base can read 500 meters by following query grammar outside data:
Wherein,<point coordinates>middle appointment user current location,<minDistance>middle specify minimum away from From, be set as 500 outside 500 meters during inquiry first, non-when inquiring about first<minDistance>value be set as in upper page result Little value.
It should be noted that in some cases user can directly set require to look up in neighbouring certain distance data, Such as 1km, 2km or 5km etc., now for reducing inquiry workload, the data for 500m can use such scheme, outside 500m Data then can directly go to search in data base, and the data that these two parts get the most at last return to after merging process use Family.
Fig. 6 shows the flow chart of geo-location service method 600 in accordance with another embodiment of the present invention, and the method begins In step S610.
In step S610, receive the data write request relevant with geographical position of user, described data write request In include the current geographic position information of user and data to be written.Upload as a example by neighbouring U.S. bat by user, Yong Hushang Pass while U.S.A shoots the video, the longitude and latitude that the geographical location information i.e. user of user is currently located can be brought, server need by Positional information and this U.S.A shoot the video and are written in distributed cache and data base for inquiry.
Subsequently, in step S620, according to the geography belonging to the current geographic position of geographical spatial index library searching user The unit marks of space cell, concrete search method describes in detail in step S230.
Subsequently, in step S630, the data being written into send and carry out transfer process to message queue.Specifically, The data being written into send to message queue, and multiple queue handler read message from message queue and process.
Subsequently, in step S640, it is judged that whether distributed cache has stored described according to data write request The unit marks retrieved, if be then simultaneously sent to data base by above-mentioned data after transfer processes in step S650 Store with in distributed cache;Otherwise then it is only sent to data base stores in step S660.I.e. use The data buffer storage of WriteIfExisted writes strategy, when writing data in distributed cache, if uncached in Huan Cun Current unit marks, the data write caching will newly do not submitted to, avoid storage in distributed cache a large amount of with this Cold data (data that user did not the most inquire about) committed memory;Cache also can arrange certain expired time, too The most it is accessed to be fallen clearly from cache.Wherein, when data are stored in distributed cache, can be first Take out former data, and laggard row storage of the data newly submitted to change merging being entered.
Fig. 7 shows the structural representation of server 700 according to an embodiment of the invention, and this server includes: please Ask reception unit 710, region setup unit 720, identification retrieval unit the 730, first acquiring unit 740, second acquisition unit 750, data processing unit 760 and result return unit 770.
Request reception unit 710 is suitable to receive the data inquiry request of user, includes user in this data inquiry request Current geographic position information;Being further adapted for receiving the data write request relevant with geographical position of user, the write of these data please The current geographic position information of user and data to be written are comprised in asking.
Region setup unit 720 is suitable to centered by the current geographic position of user, the first distance arranges a circle for radius Shape region.
Identification retrieval unit 730 is suitable to according to all geographical spaces covered in geographical spatial index library searching border circular areas The unit marks of unit;It is further adapted for the geographical space list belonging to the current geographic position according to geographical spatial index library searching user The unit marks of unit.Wherein geographical space index database can use Google S2Library or Geohash tool storage room, works as employing During Google S2Library tool storage room, geographical space unit is suitable for use with the size of the 15th grade.
First acquiring unit 740 is suitable to search in distributed cache using the unit marks retrieved as key word The data of coupling, wherein the data in this distributed cache associate storage with unit marks.
Second acquisition unit 750 is suitable to not search the data mated with unit marks from distributed cache Time, in data base, the data of coupling are searched for using all not unit marks that the match is successful as key word.Wherein, data Storehouse can use MongoDB data base, and distributed cache can use Memcache memory cache system.Specifically, When two acquiring units search for data in MongoDB data base, the geographical space list corresponding to each unit marks can be calculated The summit longitude and latitude of unit;According to this summit latitude and longitude information method by execution polygon inquiry in MongoDB data base The data of search coupling.
Data processing unit 760 is suitable to will be from distributed cache according to the condition comprised in the inquiry request of user The data searched and the data searched from data base merge successively, filter and sequence process.Result returns unit 770 are suitable to return the Query Result of the data after comprising process to user.
Additionally, according to the server of the present invention, it is also possible to include data storage cell, data filling unit and data relay Unit.Data filling unit is suitable to when data total amount after treatment is not up to the first numerical value, continues to search in data base Data outside all geographical space unit covered in rope border circular areas, until data total amount reaches the first numerical value.In data Turn the data that unit is suitable to be written into send and carry out transfer process to message queue.Data storage cell is suitable to all Data and the unit marks of correspondence thereof that the unit marks that the match is successful searches in data base respectively as key word close Connection stores in distributed cache;Being further adapted for judging whether store the write of with good grounds data in this distributed cache please Seek the unit marks retrieved;If then the data after transfer processes being simultaneously sent to data base and distributed type high speed delaying Store in depositing;Otherwise it is only sent to data base stores.
According to the server of the present invention, its detail detailed disclosure in description based on Fig. 1-6, no longer enter at this Row repeats.
According to technical scheme, it is divided into multiple geographical space list according to Google S2Libarary tool storage room Unit, and by the data relevant with geographical position and corresponding unit thereof in each geographical space unit in distributed cache Mark association storage.The data stored for memory cache need not read from data base again, alleviates the inquiry of data base Pressure, the height solving hot spot region concurrently reads the problem restricted by the concurrent capability of data base, and memory cache is also simultaneously Shorter inquiry is brought time-consumingly to handle up with higher.Additionally, also by message queue transfer write operation, write request initially enters Message queue, is taken out message from message queue by queue handler and processes, and eliminates the bigger peak value to back-end data base Write, it is achieved thereby that the purpose of protection back-end data base.
B10, server as described in B9, wherein said geographical space index database include Google S2Library or Geohash tool storage room.
B11, server as described in B10, when described geographical space index database uses described Google S2Library work During tool storehouse, described geographical space unit is suitable for use with the size of the 15th grade.
B12, server as described in B9, described data base is suitable for use with MongoDB data base, and described distributed type high speed delays Deposit and be suitable for use with Memcache memory cache system.
B13, server as described in B12, wherein said second acquisition unit is suitable to according to following methods according to not mating Successfully unit marks searches for the data of coupling in data base:
Calculate the summit longitude and latitude of geographical space unit corresponding to each unit marks;
Searched for by the method performing polygon inquiry in described MongoDB data base according to this summit latitude and longitude information The data of coupling.
B14, server as described in B9, also include: data filling unit, be suitable to when described data after treatment are total During amount not up to the first numerical value, outside all geographical space unit covered in continuing to search for described border circular areas in data base Data, until data total amount reaches the first numerical value.
B15, server as described in B9, also include: data storage cell, is suitable to described that the match is successful with all not Distribution is arrived in data and the unit marks association storage of correspondence thereof that unit marks searches in data base respectively as key word In formula cache.
B16, server as described in B9, described request reception unit is further adapted for receiving the relevant with geographical position of user Data write request, comprises the current geographic position information of user and data to be written in described data write request;Described Identification retrieval unit is further adapted for the geographical space unit belonging to the current geographic position according to geographical spatial index library searching user Unit marks.
B17, server as described in B15, also include data relay unit, is suitable to send extremely described data to be written Message queue carries out transfer process.
B18, server as described in B17, described data storage cell is further adapted for judging in described distributed cache Whether storage has the described unit marks retrieved according to data write request;If then by described number after transfer processes Store according to being simultaneously sent in data base and distributed cache;Otherwise it is only sent to data base stores.
In description mentioned herein, illustrate a large amount of detail.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case of not having these details.In some instances, it is not shown specifically known method, knot Structure and technology, in order to do not obscure the understanding of this description.
Similarly, it will be appreciated that one or more in order to simplify that the disclosure helping understands in each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.But, the method for the disclosure should not be construed to reflect an intention that i.e. required guarantor The application claims protected is than the feature more features being expressly recited in each claim.More precisely, as following As claims are reflected, inventive aspect is all features less than single embodiment disclosed above.Therefore, abide by The claims following detailed description of the invention are thus expressly incorporated in this detailed description of the invention, the most each claim itself Independent embodiment as the present invention.
Those skilled in the art are to be understood that the module of the equipment in example disclosed herein or unit or group Part can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in this example In different one or more equipment.Module in aforementioned exemplary can be combined as a module or be segmented into multiple in addition Submodule.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodiment adaptively Change and they are arranged in one or more equipment different from this embodiment.Can be the module in embodiment or list Unit or assembly are combined into a module or unit or assembly, and can put them in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit excludes each other, can use any Combine all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint Where method or all processes of equipment or unit are combined.Unless expressly stated otherwise, this specification (includes adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be carried out generation by providing identical, equivalent or the alternative features of similar purpose Replace.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein include other embodiments Some feature included by rather than further feature, but the combination of the feature of different embodiment means to be in the present invention's Within the scope of and form different embodiments.Such as, in the following claims, embodiment required for protection appoint One of meaning can mode use in any combination.
Additionally, some in described embodiment be described as at this can be by the processor of computer system or by performing The method of other device enforcement of described function or the combination of method element.Therefore, have for implementing described method or method The processor of the necessary instruction of element is formed for implementing the method or the device of method element.Additionally, device embodiment This described element is the example of following device: this device is for implementing by performed by the element of the purpose in order to implement this invention Function.
As used in this, unless specifically stated so, ordinal number " first ", " second ", " the 3rd " etc. is used Describe plain objects and be merely representative of the different instances relating to similar object, and be not intended to imply that the object being so described must Must have the time upper, spatially, sequence aspect or in any other manner to definite sequence.
Although the embodiment according to limited quantity describes the present invention, but benefits from above description, the art In it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that The language that uses in this specification primarily to the readable and purpose of teaching and select rather than in order to explain or limit Determine subject of the present invention and select.Therefore, in the case of without departing from the scope of the appended claims and spirit, for this For the those of ordinary skill of technical field, many modifications and changes will be apparent from.For the scope of the present invention, to this The disclosure that invention is done is illustrative and not restrictive, and it is intended that the scope of the present invention be defined by the claims appended hereto.

Claims (10)

1. a geo-location service method, is suitable to perform in the server, and the method includes:
Receive the data inquiry request relevant with geographical position of user, described data inquiry request includes the current of user Geographical location information;
Centered by the current geographic position of user, the first distance for radius, one border circular areas is set;
Unit marks according to all geographical space unit covered in border circular areas described in geographical spatial index library searching;
Search for the data of coupling in distributed cache using the unit marks that retrieves as key word, wherein this is distributed Data in cache associate storage with unit marks;
If do not search the data mated with unit marks from this distributed cache, then the match is successful by all not Unit marks searches for the data of coupling respectively as key word in data base;
According to the condition comprised in the inquiry request of user by the data searched from distributed cache with from data base In the data that search merge successively, filter and sequence processes;
The Query Result of the data after comprising process is returned to user.
2. the method for claim 1, wherein said geographical space index database include Google S2 Library or Geohash tool storage room.
3. method as claimed in claim 2, when described geographical space index database uses described Google S2 Library instrument During storehouse, described geographical space unit is suitable for use with the size of the 15th grade.
4. the method for claim 1, described data base is suitable for use with MongoDB data base, and described distributed type high speed delays Deposit and be suitable for use with Memcache memory cache system.
5. method as claimed in claim 4, wherein said using all not unit marks that the match is successful as key word The step of the data searching for coupling in data base includes:
Calculate the summit longitude and latitude of geographical space unit corresponding to each unit marks;
In described MongoDB data base, coupling is searched for by the method performing polygon inquiry according to this summit latitude and longitude information Corresponding data.
6. the method for claim 1, also includes:
If described data total amount after treatment is not up to the first numerical value, then continue in data base, search for described circle In territory cover all geographical space unit outside data, until data total amount reaches the first numerical value.
7. the method for claim 1, also includes:
By the described data searched in data base as key word using the unit marks that the match is successful and correspondence thereof Unit marks association storage in distributed cache.
8. the method for claim 1, also includes:
Receive the data write request relevant with geographical position of user, described data write request includes the current of user Geographical location information and data to be written;
The unit marks of the geographical space unit belonging to current geographic position according to geographical spatial index library searching user;
Described data to be written are sent to message queue, carries out transfer process;
Judge whether distributed cache stores the described unit marks retrieved according to data write request;
If then being simultaneously sent in data base and distributed cache deposit by described data after transfer processes Storage;Otherwise it is only sent to data base stores.
9. a server, including:
Request reception unit, is suitable to receive the data inquiry request of user, includes working as of user in described data inquiry request Front geographical location information;
Region setup unit, is suitable to centered by the current geographic position of user, the first distance arranges a border circular areas for radius;
Identification retrieval unit, is suitable to according to all geographical space lists covered in border circular areas described in geographical spatial index library searching The unit marks of unit;
First acquiring unit, is suitable to search for coupling using the unit marks retrieved in distributed cache as key word Data, wherein the data in this distributed cache associate storage with unit marks;
Second acquisition unit, is suitable to when not searching the data mated with unit marks from distributed cache, by institute The unit marks that the match is successful is had to search for the data of coupling in data base respectively as key word;
Data processing unit, is suitable to search from distributed cache according to the condition comprised in the inquiry request of user Data and the data searched from data base merge successively, filter and sequence process;
Result returns unit, is suitable to return the Query Result of the data after comprising process to user.
10. a geographical position service system, including server as claimed in claim 9 and at least one mobile terminal.
CN201610439677.4A 2016-06-17 2016-06-17 A kind of geo-location service method, server and system Pending CN106126575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610439677.4A CN106126575A (en) 2016-06-17 2016-06-17 A kind of geo-location service method, server and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610439677.4A CN106126575A (en) 2016-06-17 2016-06-17 A kind of geo-location service method, server and system

Publications (1)

Publication Number Publication Date
CN106126575A true CN106126575A (en) 2016-11-16

Family

ID=57470212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610439677.4A Pending CN106126575A (en) 2016-06-17 2016-06-17 A kind of geo-location service method, server and system

Country Status (1)

Country Link
CN (1) CN106126575A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402966A (en) * 2017-06-23 2017-11-28 口碑控股有限公司 The computational methods and device and electronic equipment of hunting zone
CN108009205A (en) * 2017-11-02 2018-05-08 口碑(上海)信息技术有限公司 Location-based search result caching method, searching method, client and system
CN109325089A (en) * 2018-10-10 2019-02-12 北京锐安科技有限公司 A kind of non-pointing object querying method, device, terminal device and storage medium
CN109885755A (en) * 2019-02-20 2019-06-14 广东顺德顺协企业服务有限公司 A kind of information processing system
CN110287215A (en) * 2019-05-20 2019-09-27 湖南大学 Large-scale area target real-time searching method based on hibert curve
CN111427983A (en) * 2020-03-23 2020-07-17 携程旅游信息技术(上海)有限公司 Service method, system, device and storage medium based on geographic information retrieval
CN112558939A (en) * 2020-12-18 2021-03-26 中国科学院软件研究所 Method, system and equipment for constructing service satellite-borne software of software-defined satellite
CN113761088A (en) * 2020-07-01 2021-12-07 北京沃东天骏信息技术有限公司 Method and device for processing position data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739603A (en) * 2008-11-27 2010-06-16 中国电信股份有限公司 Centralized sharing type digital urban management application platform system and implementation method
CN102495941A (en) * 2011-10-24 2012-06-13 北京东方车云信息技术有限公司 Taxi taking difficulty assessment method and system
CN102567377A (en) * 2010-12-27 2012-07-11 上海博泰悦臻电子设备制造有限公司 Electronic map data management system and method
CN104135715A (en) * 2014-06-10 2014-11-05 腾讯科技(深圳)有限公司 Method and device of implementing location based services as well as system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739603A (en) * 2008-11-27 2010-06-16 中国电信股份有限公司 Centralized sharing type digital urban management application platform system and implementation method
CN102567377A (en) * 2010-12-27 2012-07-11 上海博泰悦臻电子设备制造有限公司 Electronic map data management system and method
CN102495941A (en) * 2011-10-24 2012-06-13 北京东方车云信息技术有限公司 Taxi taking difficulty assessment method and system
CN104135715A (en) * 2014-06-10 2014-11-05 腾讯科技(深圳)有限公司 Method and device of implementing location based services as well as system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
无: "Mongodb地理空间索引", 《HTTPS://WWW.2CTO.COM/DATABASE/201406/305985.HTML》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402966A (en) * 2017-06-23 2017-11-28 口碑控股有限公司 The computational methods and device and electronic equipment of hunting zone
CN108009205A (en) * 2017-11-02 2018-05-08 口碑(上海)信息技术有限公司 Location-based search result caching method, searching method, client and system
CN108009205B (en) * 2017-11-02 2021-03-16 口碑(上海)信息技术有限公司 Search result caching method based on position, search method, client and system
CN109325089A (en) * 2018-10-10 2019-02-12 北京锐安科技有限公司 A kind of non-pointing object querying method, device, terminal device and storage medium
CN109885755A (en) * 2019-02-20 2019-06-14 广东顺德顺协企业服务有限公司 A kind of information processing system
CN110287215A (en) * 2019-05-20 2019-09-27 湖南大学 Large-scale area target real-time searching method based on hibert curve
CN111427983A (en) * 2020-03-23 2020-07-17 携程旅游信息技术(上海)有限公司 Service method, system, device and storage medium based on geographic information retrieval
CN113761088A (en) * 2020-07-01 2021-12-07 北京沃东天骏信息技术有限公司 Method and device for processing position data
CN112558939A (en) * 2020-12-18 2021-03-26 中国科学院软件研究所 Method, system and equipment for constructing service satellite-borne software of software-defined satellite

Similar Documents

Publication Publication Date Title
CN106126575A (en) A kind of geo-location service method, server and system
CN105007320B (en) Based on the intelligent movable tourist guide system of Cloud Server
US8634860B2 (en) Location determination using cached location area codes
Huang et al. Skyline queries against mobile lightweight devices in MANETs
CN105025101B (en) Based on the intelligent guide guide system of the android system of hand-drawing map
CN104135715B (en) The implementation method of location-based service, a device, and system
US8655371B2 (en) Location determination using cached location area codes
Zheng et al. Semantic caching in location-dependent query processing
CN103581828B (en) Method for inquiring nearby mobile terminals, server and system
CN106708833B (en) Method and device for acquiring data based on position information
US8447326B2 (en) Selective location determination
CN103927933A (en) Method and device for rendering mass moving targets
CN105021186B (en) Intelligent guide guide system based on hand-drawing map
CN111935820B (en) Positioning implementation method based on wireless network and related equipment
CN102708193A (en) Method and system for aggregate search and interaction of restaurant information based on location service
CN103488679A (en) Inverted grid index-based car-sharing system under mobile cloud computing environment
CN105183921A (en) Shop addressing system based on bi-chromatic reverse nearest neighbor inquiry under mobile cloud computing environment
CN103327041B (en) A kind of method and system obtaining user content
CN108009205B (en) Search result caching method based on position, search method, client and system
CN105025100A (en) IOS system-based hand-drawn map intelligent guide and navigation system
CN103596128B (en) A kind of information providing method, device, system and mobile terminal
TWI490523B (en) Information processing methods, server device and mobile terminal device
CN104598503A (en) Geographic information data inquiry method, device and system
CN104424189A (en) Positioning resolving method and positioning resolving system based on cloud platform
CN105066987A (en) GPS navigation system based on Android platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20161116

RJ01 Rejection of invention patent application after publication