WO2017020765A1 - 基于位置信息获取数据的方法和装置 - Google Patents
基于位置信息获取数据的方法和装置 Download PDFInfo
- Publication number
- WO2017020765A1 WO2017020765A1 PCT/CN2016/091947 CN2016091947W WO2017020765A1 WO 2017020765 A1 WO2017020765 A1 WO 2017020765A1 CN 2016091947 W CN2016091947 W CN 2016091947W WO 2017020765 A1 WO2017020765 A1 WO 2017020765A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- area
- hotspot data
- range
- user terminal
- data
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
- G06F16/24539—Query rewriting; Transformation using cached or materialised query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
Definitions
- the embodiments of the present application relate to the field of data processing, and in particular, to a method and apparatus for acquiring data based on location information.
- LBS Location Based Service
- GSM Global System for Mobile communications
- GIS Geographic Information System
- LBS includes two meanings: first, to determine the geographic location of the mobile device or user; secondly, to provide various types of information services related to the geographic location. For example, find the current geographic location of the mobile phone user (such as located in Beijing), and then find the name and address of the hotel, theater, library, gas station, etc. within 1 km of the current location of the mobile phone user within the scope of Beijing. And other information.
- the mobile terminal or the latitude and longitude information of the user may be used to search for the mobile terminal or the business information in the vicinity of the user (for example, the name and address of the restaurant, supermarket, hospital, hotel, theater, library, gas station, etc.) information).
- the geographical segment of the coverage is segmented according to a fixed range (for example, the geographic plate corresponding to Beijing is divided into a plurality of squares having a side length of 1 km), and a plurality of segmented sections are obtained, and Every post-cut version All listings contained in the block are cached as business data to the backend server.
- a user in a certain section sends location information (for example, latitude and longitude information of the user) to the background server to request nearby business information (such as restaurant information within a range of 1 km from the current location of the user), the hit is determined according to the latitude and longitude information of the user. Which section is used, and then directly obtains the business data corresponding to the section saved in the cache.
- location information for example, latitude and longitude information of the user
- business information such as restaurant information within a range of 1 km from the current location of the user
- the embodiment of the present application provides a method and an apparatus for acquiring data based on location information, so as to at least solve the problem that in the prior art, when searching for nearby merchant information according to latitude and longitude, all the merchant information needs to be cached in the background server, resulting in a large occupation.
- Technical issues with storage space are provided.
- a data acquisition based on location information includes: receiving a query request for acquiring object information sent by a user terminal, where the query request carries location information of the user terminal; and if the buffer area is not empty, querying location information of the user terminal from the buffer area.
- the hotspot data in the area where the hotspot data is the information of the object included in the cached area when the frequency of the query access in the area exceeds a predetermined threshold; the hotspot data in the obtained area is sent. To the user terminal.
- an apparatus for acquiring data based on location information including: a receiving unit, configured to receive a query request sent by a user terminal for acquiring object information, where the query request is carried in The location information of the user terminal is used to query the hotspot data in the area where the location information of the user terminal is located from the buffer area when the buffer area is not empty, wherein the hotspot data is generated within the area The information of the object included in the cached area when the frequency of the query exceeds the predetermined threshold; the sending unit is configured to send the hotspot data in the obtained area to the user terminal.
- the query request for acquiring the object information sent by the user terminal is received, where the query request carries the location information of the user terminal; if the buffer area is not empty, the user terminal is queried from the buffer area.
- the hotspot data in the area where the location information is located, where the hotspot data is the information of the object included in the cached area when the frequency of the query access occurs in the area exceeds a predetermined threshold; the hotspot within the obtained area The data is sent to the user terminal, which solves the problem that in the prior art, when searching for nearby business information according to latitude and longitude, all the business information needs to be cached in the background server, which leads to technical problems of occupying a large storage space, and reduces the occupation background. The effect of the server's storage space.
- FIG. 1 is a flowchart of a method for acquiring data based on location information according to Embodiment 1 of the present application;
- FIG. 2 is a flowchart of an optional method for acquiring data based on location information according to Embodiment 1 of the present application;
- FIG. 3 is a flowchart of another optional method for acquiring data based on location information according to Embodiment 1 of the present application;
- FIG. 4 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 5 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 6 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 7 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application.
- FIG. 8 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application.
- FIG. 9 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application.
- FIG. 10 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 11 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 12 is a schematic structural diagram of an apparatus for acquiring data based on location information according to Embodiment 2 of the present application;
- FIG. 13 is a structural block diagram of a computer terminal according to an embodiment of the present application.
- GeoHash algorithm Converts two-dimensional latitude and longitude information into a sortable and comparable string encoding.
- the GeoHash algorithm has the following characteristics: First, the GeoHash algorithm uses a string encoding to represent the longitude and latitude coordinates; secondly, the string encoding obtained by the GeoHash algorithm represents not a point but a rectangular area; The prefix of the string encoding can represent a larger area, and this feature can be used for searching in nearby locations.
- a method for acquiring data based on location information is provided. As shown in FIG. 1, the method may include the following steps:
- Step S10 Receive a query request sent by the user terminal for acquiring object information.
- the query request carries the location information of the user terminal.
- the query request sent by the user terminal for acquiring the object information may be received by the background server.
- the user terminal may be a personal computer or a mobile terminal, such as a smart phone, a notebook, a tablet, or the like.
- the object may be a merchant in the vicinity of the user terminal, and the object information may include any one or more of the following data: a distance from the user terminal (eg, less than 500 meters), and a geographical area information of the merchant (eg, XX City XX District), the street information of the merchant, the latitude and longitude information of the merchant, the name of the store's store, and whether the merchant has preferential activities.
- the merchants in the above embodiments may be restaurants, cinemas, hotels, KTVs, tourist attractions, and the like.
- the location information of the user terminal may include at least one of the following information: latitude and longitude information, street information, geographical area information, attribution of business circle information, and the like.
- the user terminal before the background server receives the query request sent by the user terminal, the user terminal needs to generate a corresponding query request.
- the query request can be generated by an application installed on the user terminal.
- the user holding the user terminal needs to obtain the object information (for example, the user needs to obtain the hotel information in the vicinity thereof)
- the user can generate a query request carrying the location information of the user terminal through the user terminal, and then the user terminal queries the query.
- the request is sent to the background server, and the background server receives the query request sent by the user terminal for acquiring the object information.
- the above query request may be generated by an application installed on the user terminal.
- the above embodiment of the embodiment of the present application is described by taking an application scenario in which the user terminal is a smart phone and the application installed on the user terminal is an application scenario of the mobile phone QQ application.
- the user of the smartphone wants to obtain the hotel information in the vicinity, the user can click on the mobile phone QQ.
- the mobile QQ application After entering the interface of "Eating, Drinking and Playing” option, select “Gourmet" in the upper left corner, then the mobile QQ application will Send a query request to the background server according to the options selected by the user and the location information of the mobile phone (such as the specific location of the user).
- the above embodiment of the present application will be described by taking the user terminal as the smart phone and the application program installed on the user terminal as the application scenario of the mobile phone WeChat.
- the user of the smartphone wants to obtain the restaurant information in the vicinity, the user can click on “I” in the mobile phone WeChat interface, and further select the “eat, drink and play” option in “I”, and enter “eat, drink and play”.
- select “Gourmet” in the upper left corner After the interface of the option, select “Gourmet” in the upper left corner.
- the mobile phone WeChat will send a query request to the background server according to the option selected by the user and the location information of the mobile phone (such as the specific location where the user is located).
- Step S13 In the case that the buffer area is not empty, query the hotspot data in the area of the area where the location information of the user terminal is located from the buffer area.
- the hotspot data is information of an object included in the cached area when the frequency of the query access occurs in the area exceeds a predetermined threshold.
- step S13 of the embodiment of the present application after receiving the query request sent by the user terminal, when the buffer area of the background server is not empty, the background server queries the hot spot data in the area of the location where the location information is located from the buffer area.
- the area range may be a range covering a preset geographic section
- the area-wide hotspot data may include object information of all merchants within its coverage.
- the hotspot data is triggered by the user.
- the hit rate of the business information in the area stored in the cache area is higher.
- the area is considered to be hot data.
- a predetermined threshold that is, when the number of user terminals performing the query operation in the area is large, that is, when there are more users gathering in the area.
- the area is determined as a hotspot area, and object information of all objects included in the hotspot area is cached as hotspot data in the area range (ie, the hotspot area).
- the predetermined threshold may be set according to actual application requirements, which is not specifically limited in this embodiment of the present application.
- querying the hotspot data in the area of the area where the location information of the user terminal is located from the buffer area may include the steps shown in FIG. 2:
- step S131 the area of the area where the location information of the user terminal is located is queried from the buffer area.
- the buffer area caches at least one preset area range and hotspot data in the area range.
- the background server After receiving the query request sent by the user terminal, the background server detects whether the buffer area is non-empty; when detecting that the buffer area of the background server is not empty, querying the user terminal according to the location information of the user terminal The scope of the area.
- the above embodiment of the present application will be described by taking an application scenario in which the user terminal is a smart phone and an application installed on the user terminal for the mobile phone QQ application as an example.
- the mobile QQ application sends a query request carrying location information (such as latitude and longitude information) of the current location of the mobile phone to the background server
- the background server detects whether the buffer is non-empty, and when detecting that the buffer is not empty, According to the latitude and longitude information of the user, the area of the area to which the current location of the mobile phone belongs belongs is queried from the buffer area.
- At least one preset area range and hotspot data in the area are cached in the buffer area of the background server, where the area range has an association relationship with the hotspot data in the area.
- the hotspot data within it can be read.
- step S133 if the query is successful, the hotspot data in the area range is read from the buffer area.
- the hotspot data in the area is read from the buffer area.
- the above embodiment of the present application will be described by taking an application scenario in which the user terminal is a smart phone and an application installed on the user terminal for the mobile phone QQ application as an example.
- the mobile QQ application sends a query request carrying location information (such as latitude and longitude information) of the current location of the mobile phone to the background server
- the background server detects whether the buffer is non-empty, and when detecting that the buffer is not empty, According to the latitude and longitude information of the user, the area of the area to which the current location of the mobile phone belongs belongs is queried from the buffer area.
- Step S135 In the case that the query fails, the hotspot data in the area of the location where the location information of the user terminal is located is obtained by accessing the third-party server, and the area range and the corresponding hotspot data are cached into the buffer area.
- the background server needs to forward the query request sent by the user terminal to a third-party server (such as a server of an external partner merchant).
- a third-party server such as a server of an external partner merchant.
- the hotspot data in the area of the area where the location information of the user terminal is located is obtained by accessing the third server, and the obtained hotspot data in the area is associated with the area range and then cached in the buffer area of the background server.
- the hotspot data in the area where the location information of the user terminal is located is obtained by accessing the third-party server, and the area range and the corresponding hotspot data are cached in the buffer area, if the data is received again, In the process of performing the step S13, the step S13 to S15 are performed, and the hotspot data in the area is not required to be accessed again by accessing the third-party server. The hotspot data in the area is read from the cache area, thereby reducing the processing pressure of the third-party server.
- obtaining hotspot data in the area of the location where the location information of the user terminal is located by accessing the third-party server may be implemented by forwarding the query request to an interface of the third-party server (such as a merchant interface of the external cooperative merchant), because the external cooperative merchant Processing capability of the merchant interface Therefore, the above embodiments of the present application can greatly alleviate the pressure of the merchant interface, that is, reduce the processing pressure of the third-party server.
- an interface of the third-party server such as a merchant interface of the external cooperative merchant
- the obtained hotspot data may be directly returned to the user terminal by the third-party server, and the hotspot data is returned to the background server for the background server.
- the hotspot data and the corresponding area range are cached in the buffer area, and the hotspot data may be returned to the user terminal by the background server after the background server completes the cache.
- the above embodiment of the present application will be described by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is a mobile QQ application, and the third-party server is used as a server of the public comment network.
- the background server detects whether the buffer is non-empty, and detects that the buffer is not empty. Then, according to the latitude and longitude information of the user, the area of the area to which the current location of the mobile phone belongs belongs is queried from the buffer area.
- location information such as latitude and longitude information
- the query request of the user is forwarded to the server of the public comment network for processing, and the server of the public comment network is based on the current location of the mobile phone.
- the corresponding hotspot data is not required to be obtained by the third-party server again, and the hotspot data can be directly read from the buffer area, thereby reducing the hotspot data.
- the processing pressure of third-party servers is not required to be obtained by the third-party server again, and the hotspot data can be directly read from the buffer area, thereby reducing the hotspot data.
- step S15 the hotspot data in the obtained area range is sent to the user terminal.
- the hotspot data in the area where the location information of the user terminal is located is obtained, the hotspot data is returned to the user terminal.
- the above embodiment of the present application will be described by taking an application scenario in which the user terminal is a smart phone and an application installed on the user terminal for the mobile phone QQ application as an example.
- the mobile QQ application sends a query request carrying location information (such as latitude and longitude information) of the current location of the mobile phone to the background server
- the background server detects whether the buffer is non-empty, and when detecting that the buffer is not empty, According to the latitude and longitude information of the user, the area of the area to which the current location of the mobile phone belongs belongs is queried from the buffer area.
- All the hotel information (such as the name of the hotel and the current location of the mobile phone) in the area to which the current location of the mobile phone belongs (for example, 500 meters near the Zhichun Road subway in Haidian District, Beijing) is obtained through the buffer area or through a third-party server. After the distance, whether there are special promotions and the specific location of the hotel, etc.), the background server returns all the obtained hotel information to the mobile QQ application, and the mobile QQ application displays the received hotspot data in the display interface for the user. View.
- the hot spot data in the area where the location information is located is queried from the buffer area according to the location information of the user terminal carried in the query request, and the data is sent to the user terminal.
- hotspot data such as merchant information
- the merchant information of the remote location is not cached, and the geographical coverage of the national coverage is not required to be segmented according to a fixed range in the prior art and cached in each section after the division.
- All business information that is, without having to store all the business information in each section of the country, reduces the required storage space and reduces the storage pressure of the background server.
- the prior art needs to cache all the merchant information in the background server when searching for the nearby merchant information according to the latitude and longitude, thereby causing technical problems of occupying a large storage space, and reducing the occupation background.
- the storage space of the server reduces the storage pressure of the background server.
- step S135 the cache area range and the corresponding hotspot Data to the buffer can include:
- step S1351 the two-dimensional latitude and longitude data for indicating the area range is converted into a one-dimensional first character string code.
- the background server converts the two-dimensional latitude and longitude data for indicating the range of the area into a one-dimensional first string code.
- the two-dimensional latitude and longitude data can be converted into a sortable and comparable one-dimensional string encoding by the GeoHash algorithm, and each string encoding represents a certain range of regions.
- each string encoding represents a certain range of regions.
- the accuracy of the range of the range indicated by the GeoHash string is higher.
- the length of the GeoHash string encoding is 8
- the accuracy of the range of the range represented by the GeoHash is about 19 meters
- the GeoHash character is
- the length of the string code is 9
- the accuracy of the range of the range indicated by the string is about 2 meters, and the length of the string encoding needs to be selected according to the data.
- step S1353 the first character string is encoded and the hotspot data in the acquired region is associated with the cached data.
- the background server converts the two-dimensional latitude and longitude data for indicating the range of the region into the one-dimensional first string encoding
- the first string encoding and the obtained hotspot data in the region range are associated, , and then cached to the cache of the background server.
- the above embodiment of the present application will be described by taking an example of converting a two-dimensional latitude and longitude data into a one-dimensional string encoding by the GeoHash algorithm.
- the geographic extent covered by Beijing is pre-divided into nine regional ranges (such as rectangular regions), and the first string encoding (such as the GeoHash string) of each rectangular region is WX4ER, WX4G2, WX4G3, etc., each of which The GeoHash string represents a rectangular area. That is to say, all the points in this rectangular area (the position of each point in latitude and longitude coordinates) share the same GeoHash string, which can protect privacy (only means approximate area location instead of specific point), and it is easier Do the caching.
- WX4ER For example, users in the rectangular area of WX4ER keep sending The location information is sent to the background server for the restaurant information in the vicinity (ie, the hotspot data mentioned above). Since the GeoHash string of all users in the rectangular area of the WX4ER is WX4ER, the WX4ER can be regarded as a key, and the rectangular area can be Hot data is cached as value, and if GeoHash is not used, it is difficult to cache because the latitude and longitude data sent by users in the same rectangular area are different.
- the length of the first character string encoding can be conveniently adjusted according to the frequency of the query access occurring in the region.
- the area range represented by the first character string encoding can also conveniently adjust the geographical range covered by the area range, and solves the problem that the prior art divides the board according to the fixed range, and when the size of the section is updated, the update operation. The cumbersome and low-efficiency problem enables a convenient and fast dynamic adjustment of the size of the area.
- the area range in which the location information of the user terminal is located from the buffer area may include:
- Step S1311 Convert the latitude and longitude data in the location information of the user terminal into a second character string code recognizable by the buffer area.
- the latitude and longitude data in the location information of the user terminal carried in the received query request is converted into a second character string code recognizable by the buffer.
- the above embodiment of the present application will be described by taking an example of converting a two-dimensional latitude and longitude data into a one-dimensional string encoding by the GeoHash algorithm.
- the latitude and longitude data of the user terminal is converted into a one-dimensional GeoHash string by the GeoHash algorithm.
- step S1313 it is queried in the buffer area whether or not the first character string encoding identical to the second character string encoding is stored.
- step S1315 is performed; in the case where the first character string encoding identical to the second character string encoding is not stored in the buffer area, step S1317 is performed.
- the latitude and longitude data of the user terminal is converted by the GeoHash algorithm to a GeoHash character string (ie, the second string code described above) and used to represent the area.
- the latitude and longitude data of the range is the same as the GeoHash string converted by the GeoHash algorithm (ie, the first string encoding described above). If the first string encoding the same as the second string encoding is queried in the buffer area, the buffer area is indicated. The hotspot data of the area is stored in the area.
- step S1315 it is determined that the area range is successfully queried.
- the hotspot data in the area is read from the buffer area, and the implementation manner of the step S1315 is consistent with the implementation manner of step S133 in the foregoing embodiment, and is no longer Narration.
- step S1317 it is determined that the query area range fails.
- the hotspot data in the area of the location where the location information of the user terminal is located is obtained by accessing the third-party server, and the area range and the corresponding hotspot data are cached in the buffer area, and the step S1317 is performed.
- the implementation manner is the same as the implementation manner of step S135 in the foregoing embodiment, and details are not described herein again.
- the above embodiment of the present application will be described below by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is the application scenario of the mobile phone QQ application, and the third-party server is used as the server of the public comment network.
- the background server detects the cache. Whether the area is non-empty, in the case that the buffer area is detected to be non-empty, the GeoHash algorithm is used to convert the user's latitude and longitude information into a one-dimensional second string code, and the buffer is queried whether the second string is stored. Encode the same first string encoding (used to represent the range-wide string encoding).
- the range of the query area is determined to be successful, that is, the area of the area where the current location of the mobile phone belongs is stored in the buffer area. (such as 500 meters near the Zhichun Road subway in Haidian District, Beijing), then read all the hotel information within 500 meters from the Zhichun Road subway in Haidian District, Beijing, and return to the mobile QQ application for users to view. .
- the background server forwards the user's query request to the server of the public comment network for processing, and the server of the public comment network determines the area of the area according to the current location of the mobile phone (such as Beijing 500 meters near the Zhichun Road subway in Haidian District, and return all the hotel information in the area (such as the name of the hotel, the distance from the current location of the mobile phone, whether there are special promotions and the specific location of the hotel, etc.) to the back-end server.
- the current location of the mobile phone such as Beijing 500 meters near the Zhichun Road subway in Haidian District
- the background server converts the corresponding area range (such as 500 meters near the Zhichun Road subway in Haidian District, Beijing) into a one-dimensional first string code by the GeoHash algorithm, and returns the first string code to the server of the public comment network.
- the hotspot data is cached and cached in the cache.
- the hotspot data may be returned to the mobile QQ application by the server of the public comment network for viewing by the user, or the background server may cache the hot data of the first string encoded and returned to the buffer area. After that, the hotspot data is returned to the mobile QQ application.
- the location information of the user terminal when the location information of the user terminal is queried according to the location of the user terminal, only the latitude and longitude data of the location of the user terminal needs to be converted into a one-dimensional GeoHash character string, and the GeoHash of each area range stored in the buffer area is String prefix prefix
- the GeoHash string of the area is the same as the GeoHash string of the location of the user terminal
- the area of the area where the user terminal is located in the buffer area can be determined, and the query is convenient and efficient, and the query efficiency is high.
- the method may further include: setting a preset for the hotspot data, while the cached to the cache area is associated with the hotspot data in the area where the first character string is encoded and acquired.
- the expiration time wherein the expiration time is determined according to the frequency at which the hotspot data is queried; when the time when the hotspot data is stored in the buffer reaches the expiration time, the hotspot data is deleted from the cache.
- a preset expiration time is set for the hotspot data, and When the time when the hotspot data is stored in the buffer reaches the expiration time, the hotspot data is deleted from the cache to achieve the effect of updating the hotspot data in time.
- the background server receives the query request for acquiring the object information in the area again, it needs to return.
- the above steps S10 to S15 are performed.
- the length of the expiration time is related to the processing pressure of the third-party server. If the expiration time is short, the third-party server needs to process the query request of the user terminal multiple times, and the processing capability of the third-party server becomes the bottleneck of the entire system. The query efficiency cannot process the query request sent by the user terminal in time, resulting in long waiting time and poor user experience. If the expiration time is too long, the business information in the area may not be updated in time.
- the expiration time may be determined according to the frequency at which the hotspot data is queried, that is, according to the hit rate of the hotspot data.
- the cache area stores hotspot data in the area, and is called Hit the hotspot data, the more times you hit the hotspot data, It means that the hit rate of the hotspot data is higher.
- the hotspot data in the area is set to a long expiration time, such as 1 day or 2 days, to avoid hot data in the area being repeatedly updated in a short time, resulting in high processing pressure of the background server and the third party server.
- setting an expiration time for the hotspot data can ensure that the merchant information in the corresponding area is updated in time and effectively, so as to provide the user with the latest business information, such as when adding a new merchant or adding a merchant offer, Provide relevant information to users in a timely manner.
- the above embodiment of the present application will be described below by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is the application scenario of the mobile phone QQ application, and the third-party server is used as the server of the public comment network.
- the user's query request is forwarded to the server of the public comment network for processing, and the server of the public comment network determines the area to which the mobile phone belongs according to the current location of the mobile phone (for example, 500 meters near the Zhichun Road subway in Haidian District, Beijing), and After returning all the hotel information in the area to the background server, the server will convert the corresponding area range (such as 500 meters near the Zhichun Road subway in Haidian District, Beijing) into a one-dimensional first string code by the GeoHash algorithm.
- the background server sets the expiration time corresponding to the hot spot data, and the expiration time can be based on the hot spot.
- the hit rate of the data is dynamically adjusted, that is, when the hit rate of the hotspot data is high, that is, when there are more users in the corresponding area, when the query operation is performed, the expiration time can be extended to alleviate the repeated update of the background server.
- the foregoing method may further include: monitoring, querying the same from the buffer area.
- the third party server After receiving the query request for obtaining the object information in the adjusted region, the third party server obtains the hotspot data in the adjusted region, and caches the adjusted region range and corresponding Hotspot data into the cache.
- the number of queries that query the same area range from the buffer area is monitored, that is, the hit rate of each hotspot data in the buffer area is monitored, and when the number of queries that query the same area range from the buffer area is monitored, the number of queries exceeds
- the query threshold is preset, it indicates that there are more users in the area to perform the query operation. If there are more users querying the object information at the outer edge of the area, the users at the outer edge will not It will hit the hotspot data in the area. At this time, the processing pressure of the third-party server may be too large, and the query request sent by the user terminal cannot be processed in time. The user waits for a long time and the user experience is poor. Therefore, the monitoring is performed.
- the precision of the first string encoding may be shortened by shortening the length of the first string encoding, thereby expanding the coverage of the range of the queried region.
- the adjusted area range can cover a larger geographical range.
- the adjusted region range after receiving the query request for acquiring the object information in the adjusted region, obtaining the adjusted region-wide hotspot data by accessing the third-party server, and The adjusted area range and the corresponding hotspot data are cached in the buffer area.
- the specific implementation of the step is the same as the implementation of the step S135 in the foregoing embodiment, and details are not described herein again.
- the hotspot data in the adjusted area is obtained by accessing the third-party server, and the adjusted area range and the corresponding hotspot data are associated and cached in the buffer area, if Receiving the query request for acquiring the object information in the adjusted area, and returning to the step S13 to S15, in the process of performing the step S13, it is not necessary to acquire the area within the area by accessing the third party server again.
- Hot data The hotspot data in the area can be read directly from the buffer area, thereby reducing the processing pressure of the third party server.
- obtaining the hotspot data in the adjusted area by accessing the third-party server may be implemented by forwarding the query request to an interface of the third-party server (such as the merchant interface of the external partner), because the merchant interface of the external partner merchant
- the above embodiments of the present application can greatly alleviate the pressure on the merchant interface and reduce the processing pressure of the third-party server.
- the above embodiment of the present application will be described below by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is the application scenario of the mobile phone QQ application, and the third-party server is used as the server of the public comment network.
- the background server monitors the number of queries from the cache area to the same area (such as 300 meters near Tiananmen Square in Beijing), the number of queries exceeds the preset query threshold, indicating that more users within 300 meters near Tiananmen Square in Beijing are passing their mobile QQ.
- the application performs the inquiry operation of the hotel information.
- the users within 300 meters to 1500 meters near Tiananmen Square in Beijing have more inquiries about the operation of nearby hotel information through their mobile phones, and the users within 300 meters to 1500 meters near Tiananmen Square in Beijing.
- the query operation cannot hit the hotspot data (such as hotel information) within 300 meters near Tiananmen Square in Beijing.
- the server of the public comment network may be required to process the query request of this part of the user. Due to the limited processing capacity of the server of the public comment network, Only a limited number (such as 1000) of query requests can be processed, which will cause some users to wait for a long time, resulting in poor user experience.
- the code length used to represent the GeoHash string within 300 meters of Tiananmen Square in Beijing can be reduced, as reduced by a 6-bit code (representing a range of about 0.34 square kilometers) to a 5-digit code (representing 10 square kilometers).
- Meter range which can represent the area within 1500 meters near Tiananmen Square in Beijing.
- the server processes the server, and the server of the public comment network determines the area of the mobile phone according to the current location of the mobile phone (such as within 1500 meters near Tiananmen Square in Beijing), and all the hotel information in the area (such as the name of the hotel, the current mobile phone) The distance from the location, whether there are special offers, and the specific location of the hotel, etc.)
- the background server caches the hotspot data returned by the server of the public comment network and the corresponding area range (such as within 1500 meters near Tiananmen Square in Beijing) and caches it in the buffer area.
- the corresponding hotspot data is not required to be obtained through the server of the public comment network again (for example, Hotel information), but can directly read the hotspot data from the buffer area, reducing the processing pressure of the server of the public comment network.
- the foregoing method may further include: monitoring the access volume of the third-party server; When the number of visits exceeds the preset access threshold, the expiration time of the hotspot data is extended according to the amount of access.
- the processing capability of the third-party server is limited, and the system processing bottleneck is caused in order to avoid the processing capability of the third-party server.
- you need to monitor the access volume of the third-party server that is, monitor the number of query requests processed by the third-party server.
- the number of accesses monitored by the third-party server exceeds the preset access threshold, It can be considered that the processing capability of the third-party server has reached the limit, and other query requests cannot be processed in time.
- the expiration time of the corresponding hot-spot data can be extended according to the amount of the access, and the hot-spot data can be avoided. Repeat updates in a short period of time while reducing the processing pressure on third-party servers.
- the above embodiment of the present application will be described by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is a mobile QQ application, and the third-party server is used as a server of the public comment network.
- the hotspot data such as hotel information
- the server of the public comment network such as 500 meters near the Zhichun Road subway in Haidian District, Beijing
- the background server monitors the forwarding to the public comment network
- the number of query requests of the server exceeds the preset access threshold, indicating that the processing capacity of the server of the public comment network has reached its upper limit.
- the subsequent query request will be temporarily suspended. Unable to process, which in turn causes some users to wait For a long time, the user experience is reduced. At this time, the expiration time of the corresponding hotel information within 500 meters near the Zhichun Road subway in Haidian District, Beijing can be extended to extend the storage time in the buffer area, thereby reducing the update frequency of hotspot data, when a user requests to obtain Beijing.
- the hotel information within 500 meters near the subway of Zhichun Road in Haidian District you do not need to forward the request to the server of the public comment network, but directly read the corresponding hotel information from the buffer area of the background server to reduce the server of the public comment network. Handling the pressure of individual user requests, and also reducing the processing pressure of the background server to repeatedly update hotspot data within the area.
- the method may further include: obtaining, by accessing a third-party server, hotspot data in an area where the location information of the user terminal is located, and buffering the area range and the corresponding area. Hotspot data into the cache; set expiration time for hotspot data.
- the background server after receiving the query request of the user acquiring the object information sent by the user terminal, if the background server detects that the buffer area is empty (such as when the system first starts running or the hotspot data cached in the background server is all expired and the query request is After the query operation is performed, the background server forwards the query request to the third-party server to obtain the hotspot data in the corresponding area by accessing the third-party server, and after obtaining the hot data returned by the third-party server, The background server associates the area range and the corresponding hotspot data into the buffer area, and sets an expiration time for the hotspot data.
- the implementation manner of the step is the implementation manner of the step S135 in the foregoing embodiment of the present application, and the step “setting a preset expiration time for the hotspot data; when the hotspot data is stored in the buffer area reaches the expiration time, the hotspot is The implementation of deleting data from the cache area is consistent, and will not be described here.
- the foregoing method may further include: acquiring an object in the area of the location where the location information of the user terminal is located by accessing the third-party server. Information, and cache the area range and corresponding object information into the buffer area; set an expiration time for the object information, wherein the expiration time of the object information is less than the expiration time of the hot item data.
- the background server forwards the query request to the third-party server, and obtains the corresponding object information by accessing the third-party server, so as to avoid other user terminals querying in the short-term.
- the object information in the area the background server caches the obtained object information and the corresponding area range into its buffer area, and sets a short expiration time for the object information, so as to avoid using the cached data for a long time to occupy the background server. Storage space.
- the above embodiment of the present application will be described by taking the above-mentioned application scenario in which the user terminal is a smart phone and the application installed on the user terminal is a mobile QQ application, and the third-party server is used as a server of the public comment network.
- the mobile QQ application When the user is located in a remote town, if there are not many users in the town, when a user needs to obtain the information of the nearby hotel, the mobile QQ application will carry the location information of the current location of the mobile phone (such as The query request of the latitude and longitude information is sent to the background server.
- the background server After the background server does not query the area range of the current location of the mobile phone from the cache area, the query request of the user is forwarded to the server of the public comment network for processing, and the public comment
- the server of the network determines the area of the area to which the mobile phone belongs according to the current location of the mobile phone, and all the hotel information in the area (such as the name of the hotel, the distance from the current location of the mobile phone, whether there is a preferential event, and the specific location of the hotel, etc.)
- the background server associates the object information returned by the server of the public comment network with the corresponding area range (such as 500 meters near the XX street of XX Town, XX City) and caches it in the buffer area.
- the background server associates and caches the object information returned by the server of the public comment network and the corresponding area range into the buffer area
- the background server sets a short expiration time for the object information, and does not need to store the hot spot data for a long time. So as to avoid the use of less cached data for a long time to occupy the storage space of the background server.
- the user terminal is a smart phone
- the application program installed on the user terminal is an application scenario of the mobile phone QQ application
- the third party server is used as a public comment network.
- the server is used as an example.
- the foregoing embodiment of the present application provides an optional technical solution, and the method may include the following steps:
- Step S301 The user sends the location of the merchant through the user terminal to initiate a query request for obtaining the merchant information of the merchant in the vicinity thereof.
- the user terminal can be a mobile QQ application installed on the smart phone.
- the user of the smartphone wants to obtain the restaurant information in the vicinity thereof, the user can click “Dynamic” in the QQ application interface of the mobile phone, and further select the “eat, drink and play” option in “Dynamic”. After entering the interface of “eat, drink and play” option, select “Gourmet” in the upper left corner.
- the mobile QQ application will send a background to the background server according to the options selected by the user and the location information of the mobile phone (such as the specific location of the user). Query request.
- Step S302 After receiving the query request of the user, the background server queries, in the cache area, whether the area range to which the user belongs is stored according to the location of the user.
- step S302 is the same as the implementation manner of the step S131 in the foregoing embodiment of the present application, and details are not described herein again.
- Step S303 is performed when the range of the area to which the user belongs is successfully queried, and step S304 is performed when the range of the area to which the user belongs is not found.
- Step S303 the background server reads the hotspot data in the area from the buffer area, and returns the hotspot data to the smart phone.
- the hotspot data may include the name of the store of the merchant in the area, the distance of the merchant from the user terminal, the geographical area information of the merchant, the street information of the merchant, the latitude and longitude information of the merchant, and whether the merchant has a preferential event, etc. .
- the hotspot data is triggered by the user and the expiration time is set for it in the background, and the expired hotspot data is automatically reconstructed.
- step S303 is the same as the implementation manner of the step S133 in the foregoing embodiment of the present application, and details are not described herein again.
- Step S304 The background server forwards the query request of the user to the third-party server to obtain the corresponding hotspot data by accessing the third-party server.
- the third-party server can be the server of the public comment network.
- step S304 is the same as the implementation manner of the step S135 in the foregoing embodiment of the present application, and details are not described herein again.
- Step S305 the third party server returns the corresponding hotspot data to the background server.
- step S305 optionally, after the server of the public comment network returns the corresponding hotspot data to the background server, the background server caches the hotspot data.
- step S306 is performed.
- Step S306 monitoring the performance of the third party server.
- step S305 is consistent with the implementation of the step of “monitoring the access amount of the third-party server” in the foregoing embodiment of the present application, and details are not described herein again.
- step S305 can be performed by the merchant interface monitoring device on the background server.
- step S307 is performed.
- Step S307 dynamically adjusting the first character string encoding length of the area range, and dynamically adjusting the expiration time of the hotspot data.
- the first string encoding may be a GeoHash string.
- the accuracy of the GeoHash string and the expiration time of the hotspot data are dynamically adjusted according to the server performance of the public comment network, and the coverage of the area range can be adjusted by adjusting the length of the GeoHash string, thereby adjusting the hit of the hotspot data cached in the area. rate.
- the background service pressure is relatively large, especially when the server processing capability of the public comment network becomes a bottleneck, the length of GeoHash is dynamically adjusted, and the coverage of the area is expanded. As the coverage of the area becomes larger, the number of users covered by it becomes also changed. Large, which can increase the hit rate of hotspot data in the region.
- Dynamically adjusting the expiration time of hotspot data (such as cache timeout failure time), when the server processing capability of the public comment network becomes a bottleneck, monitor the server processing capability of the public comment network and dynamically adjust the expiration time of the hotspot data of the corresponding region to Reduce the public Review the server's processing pressure.
- step S306 when the user-initiated query request is received again, the process returns to step S302.
- the two-dimensional latitude and longitude data is converted into a character string by a GeoHash algorithm to represent a certain range of geographical locations, and the GeoHash algorithm is used to cache the merchants in the vicinity of the user, and are executed by other users in the range.
- the cache can be hit, realizing a low-cost, high-efficiency cache, and by dynamically adjusting the cache area and expiration time, the pressure on the server of the background server and the external partner is reduced, and the user is provided with flexibility. Service.
- the technical solution of the embodiments of the present application may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic
- a storage medium such as ROM/RAM, magnetic
- the disc, the optical disc includes a plurality of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the various embodiments of the present application.
- the foregoing method for acquiring data based on location information may be applied to a hardware environment formed by the computer terminal A shown in FIG. As shown in FIG. 13, the computer terminal A is connected to other computer terminals through a network, including but not limited to: a wide area network, a metropolitan area network, or a local area network.
- a network including but not limited to: a wide area network, a metropolitan area network, or a local area network.
- an apparatus for acquiring data based on location information for implementing the foregoing method for acquiring data based on location information.
- the apparatus may include: a receiving unit 40, an inquiring unit 41, and Transmitting unit 42.
- the receiving unit 40 is configured to receive a query request sent by the user terminal for acquiring object information.
- the query request carries the location information of the user terminal.
- the background server receives a query request sent by the user terminal for acquiring object information.
- the user terminal may be a personal computer or a mobile terminal such as a smart phone, a notebook, a tablet, or the like.
- the object may be a merchant near the user terminal, and the object information may include a distance between the merchant (eg, less than 500 meters), a geographical area of the merchant (such as the XX area of the XX city), and the location of the merchant. Street information, latitude and longitude information of the merchant, the name of the store's store, and whether the merchant has preferential activities.
- the merchants in the above embodiments may be restaurants, cinemas, hotels, KTVs, tourist attractions, and the like.
- the location information of the user terminal may include at least one of the following information: latitude and longitude information, street information, geographical area information, attribution of business circle information, and the like.
- the user terminal before the background server receives the query request sent by the user terminal, the user terminal needs to generate a corresponding query request.
- the query request can be generated by an application installed on the user terminal.
- the user holding the user terminal needs to obtain the object information (for example, the user needs to obtain the hotel information in the vicinity thereof)
- the user can generate a query request carrying the location information of the user terminal through the user terminal, and then the user terminal queries the query.
- the request is sent to the background server, and the background server receives the query request sent by the user terminal for acquiring the object information.
- the above query request may be generated by an application installed on the user terminal.
- the query unit 41 is configured to query the hotspot data in the area of the area where the location information of the user terminal is located from the buffer area if the buffer area is not empty.
- the hotspot data is information of an object included in the cached area when the frequency of the query access occurs in the area exceeds a predetermined threshold.
- the background server after receiving the query request sent by the user terminal, when the buffer of the background server is not empty, the background server queries the cache area for the hotspot data in the area where the location information is located.
- the area range may be a range covering a preset geographic section
- the area-wide hotspot data may include object information of all merchants within its coverage.
- the hotspot data is triggered by the user.
- the hit rate of the business information in the area stored in the cache area is higher.
- the area is considered to be hot data.
- the frequency of the query access occurs in the area exceeds a predetermined threshold, that is, when the number of user terminals performing the query operation is large in the area, that is, when there are many users in the area, the area is It is determined as a hotspot area, and the object information of all objects included in the hotspot area is cached as hotspot data in the area range (that is, the hotspot area).
- the predetermined threshold may be set according to actual application requirements, which is not specifically limited in this application.
- the query unit 41 may include a query module 411, a read module 413, and an acquisition module 415.
- the query module 411 is configured to query the area of the area where the location information of the user terminal is located from the buffer area.
- the buffer area caches at least one preset area range and hotspot data in the area range.
- the background server After receiving the query request sent by the user terminal, the background server detects the slow response. Whether the storage area is non-empty; when it is detected that the buffer area of the background server is not empty, the area of the area where the user terminal is located is queried from the buffer area according to the location information of the user terminal.
- At least one preset area range and hotspot data in the area are cached in the buffer area of the background server, where the area range has an association relationship with the hotspot data in the area.
- the hotspot data within it can be read.
- the reading module 413 is configured to read the hotspot data in the area range from the buffer area if the query is successful.
- the hotspot data in the area is read from the buffer area.
- the obtaining module 415 is configured to obtain hotspot data in the area of the area where the location information of the user terminal is located by accessing the third-party server, and cache the area range and the corresponding hotspot data into the buffer area.
- the background server needs to forward the query request sent by the user terminal to a third-party server (such as a server of an external partner merchant).
- a third-party server such as a server of an external partner merchant.
- the hotspot data in the area of the area where the location information of the user terminal is located is obtained by accessing the third server, and the obtained hotspot data in the area is associated with the area range and then cached in the buffer area of the background server.
- the hotspot data in the area where the location information of the user terminal is located is obtained by accessing the third-party server, and the area range and the corresponding hotspot data are cached in the buffer area, if the data is received again, The query requesting the object information in the range of the area is returned to the execution query unit 41 to the sending unit 42.
- the hotspot data in the area is not required to be accessed again by accessing the third party server.
- the hotspot data in the area can be read directly from the buffer area, thereby reducing the processing pressure of the third party server.
- the hot spot data in the area where the location information of the user terminal is located by accessing the third-party server may be forwarded to the interface of the third-party server by using the query request (eg,
- the merchant interface of the partner merchant realizes that, because the processing capability of the merchant interface of the external partner is limited, the pressure of the merchant interface can be greatly alleviated by the above-mentioned embodiment of the present application, that is, the processing pressure of the third-party server is alleviated.
- the obtained hotspot data may be directly returned to the user terminal by the third-party server, and the hotspot data is returned to the background server for the background server.
- the hotspot data and the corresponding area range are cached in the buffer area, and the hotspot data may be returned to the user terminal by the background server after the background server completes the cache.
- the sending unit 42 is configured to send the hotspot data in the obtained area range to the user terminal.
- the hotspot data in the area where the location information of the user terminal is located is obtained, the hotspot data is returned to the user terminal.
- the hot spot data in the area where the location information is located is queried from the buffer area according to the location information of the user terminal carried in the query request, and the data is sent to the user terminal.
- hotspot data such as merchant information
- the merchant information of the remote location is not cached, and the geographical coverage of the national coverage is not required to be segmented according to a fixed range in the prior art and cached in each section after the division.
- All business information that is, without having to store all the business information in each section of the country, reduces the required storage space and reduces the storage pressure of the background server.
- the prior art needs to cache all the merchant information in the background server when searching for the nearby merchant information according to the latitude and longitude, thereby causing technical problems of occupying a large storage space, and reducing the occupation background.
- the storage space of the server reduces the storage pressure of the background server.
- the obtaining module 415 may include: a first conversion sub-module 4151 and a cache sub-module 4153.
- the first conversion sub-module is configured to convert the two-dimensional latitude and longitude data used to represent the area range into a one-dimensional first character string code.
- the background server converts the two-dimensional latitude and longitude data for indicating the range of the area into a one-dimensional first string code.
- the two-dimensional latitude and longitude data can be converted into a sortable and comparable one-dimensional string encoding by the GeoHash algorithm, and each string encoding represents a certain range of regions.
- each string encoding represents a certain range of regions.
- the accuracy of the range of the range indicated by the GeoHash string is higher.
- the length of the GeoHash string encoding is 8
- the accuracy of the range of the range represented by the GeoHash is about 19 meters
- the GeoHash character is
- the length of the string code is 9
- the accuracy of the range of the range indicated by the string is about 2 meters, and the length of the string encoding needs to be selected according to the data.
- the cache sub-module is configured to cache the hot-spot data in the range of the first string encoded and acquired, and then cache the data to the buffer.
- the background server converts the two-dimensional latitude and longitude data for indicating the range of the region into the one-dimensional first string encoding
- the first string encoding and the obtained hotspot data in the region range are associated, , and then cached to the cache of the background server.
- the length of the first character string encoding can be conveniently adjusted according to the frequency of the query access occurring in the region.
- the area range represented by the first character string encoding can also conveniently adjust the geographical range covered by the area range, and solves the problem that the prior art divides the board according to the fixed range, and when the size of the section is updated, the update operation. The cumbersome and low-efficiency problem enables a convenient and fast dynamic adjustment of the size of the area.
- the query module 411 may include: The transformation sub-module 4111, the query sub-module 4113, the first determination sub-module 4115, and the second determination sub-module 4117.
- the second conversion sub-module is configured to convert the latitude and longitude data in the location information of the user terminal into a second character string code recognizable by the buffer area.
- the latitude and longitude data in the location information of the user terminal carried in the received query request is converted into a second character string code recognizable by the buffer.
- the query submodule is configured to query, in the buffer area, whether the first string encoding the same as the second string encoding is stored.
- the latitude and longitude data of the user terminal is converted by the GeoHash algorithm to a GeoHash character string (ie, the second string code described above) and used to represent the area.
- the latitude and longitude data of the range is the same as the GeoHash string converted by the GeoHash algorithm (ie, the first string encoding described above). If the first string encoding the same as the second string encoding is queried in the buffer area, the buffer area is indicated. The hotspot data of the area is stored in the area.
- the first determining submodule is configured to determine that the region range is successfully queried in the case that the first string encoding the same as the second string encoding is stored in the buffer.
- the hotspot data in the area is read from the buffer area, and the implementation manner of the first determining sub-module is consistent with the implementation manner of the reading module 413 in the foregoing embodiment. , will not repeat them here.
- the second determining submodule is configured to determine that the query area range fails in a case where the first character string encoding identical to the second string encoding is not stored in the buffer area.
- the hotspot data in the area of the location where the location information of the user terminal is located is obtained by accessing the third-party server, and the area range and the corresponding hotspot data are cached into the buffer area, and the second determination is performed.
- the implementation of the sub-module is the same as that of the implementation of the obtaining module 415 in the foregoing embodiment, and details are not described herein again.
- the location information of the user terminal when the location information of the user terminal is queried according to the location of the user terminal, only the latitude and longitude data of the location of the user terminal needs to be converted into a one-dimensional GeoHash character string, and the GeoHash of each area range stored in the buffer area is The prefix matching of the string is performed.
- the GeoHash string of the area is the same as the GeoHash string of the user terminal, the area of the area where the user terminal is located in the buffer area can be determined.
- the query is convenient and fast, and the query efficiency is high. .
- the above apparatus may further include: a first setting unit 43 and a deleting unit 44.
- the first setting unit is configured to set a preset expiration time for the hotspot data simultaneously or after buffering to the buffer area after the first character string is encoded and the hotspot data in the acquired area is associated.
- the expiration time is determined according to the frequency at which the hotspot data is queried.
- the deleting unit is configured to delete the hotspot data from the buffer when the time when the hotspot data is stored in the buffer reaches the expiration time.
- a preset expiration time is set for the hotspot data, and When the time when the hotspot data is stored in the buffer reaches the expiration time, the hotspot data is deleted from the cache to achieve the effect of updating the hotspot data in time.
- the background server receives the query request for acquiring the object information in the area again, it needs to return.
- the receiving unit 40 to the sending unit 42 are executed.
- the corresponding hotspot data needs to be obtained by accessing the third party server. Therefore, the length of the expiration time is related to the third party. If the processing time of the server is too short, the third-party server needs to process the query request of the user terminal multiple times, and the processing capability of the third-party server becomes the bottleneck of the entire system, affecting the query efficiency, and cannot timely process the sending of the user terminal.
- the query request causes the user to wait for a long time and the user experience is poor; if the expiration time is too long, the business information in the area may not be updated in time.
- the expiration time may be determined according to the frequency at which the hotspot data is queried, that is, according to the hit rate of the hotspot data.
- the cache area stores hotspot data in the area, and is called Hit the hotspot data, the more times the hotspot data is hit, the higher the hit rate of the hotspot data.
- the hotspot data in the area is set to a long expiration time, such as 1 day or 2 days, to avoid hot data in the area being repeatedly updated in a short time, resulting in high processing pressure of the background server and the third party server.
- setting an expiration time for the hotspot data can ensure that the merchant information in the corresponding area is updated in time and effectively, so as to provide the user with the latest business information, such as when adding a new merchant or adding a merchant offer, Provide relevant information to users in a timely manner.
- the foregoing apparatus may further include: a first monitoring unit 45, an adjusting unit 46, and a first acquiring unit 47.
- the first monitoring unit is configured to monitor the number of times of querying the same area range from the buffer area in the process of querying the area range of the location information of the user terminal from the buffer area.
- the adjusting unit is configured to adjust the precision of the first string encoding to expand the coverage of the region range to be queried when the number of queries for querying the same region range from the buffer area exceeds the preset query threshold, and obtain the adjusted region. range.
- the first obtaining unit is configured to: after receiving the query request for acquiring the object information in the adjusted region, obtain the hotspot data in the adjusted region by accessing the third-party server, and buffer the adjusted region range and The corresponding hotspot data is in the buffer area.
- the number of queries that query the same area range from the buffer area is monitored, that is, the hit rate of each hotspot data in the buffer area is monitored, and when the number of queries that query the same area range from the buffer area is monitored, the number of queries exceeds
- the query threshold is preset, it indicates that there are more users in the area to perform the query operation. If there are more users querying the object information at the outer edge of the area, the users at the outer edge will not It will hit the hotspot data in the area. At this time, the processing pressure of the third-party server may be too large, and the query request sent by the user terminal cannot be processed in time. The user waits for a long time and the user experience is poor. Therefore, the monitoring is performed.
- the precision of the first string encoding may be shortened by shortening the length of the first string encoding, thereby expanding the coverage of the range of the queried region.
- the adjusted area range can cover a larger geographical range.
- the adjusted region range after receiving the query request for acquiring the object information in the adjusted region, obtaining the adjusted region-wide hotspot data by accessing the third-party server, and The adjusted area range and the corresponding hotspot data are cached in the buffer area, and the specific implementation manner is the same as the implementation manner of the obtaining module 415 in the foregoing embodiment, and details are not described herein again.
- the hotspot data in the adjusted area is obtained by accessing the third-party server, and the adjusted area range and the corresponding hotspot data are associated and cached in the buffer area, if Receiving the query request for acquiring the object information in the adjusted region range again, returning to the execution query unit 41 to the sending unit 42, wherein in the process of executing the query unit 41, it is not necessary to obtain the third-party server again.
- Hotspot data in the area, and the hotspot data in the area can be directly read from the buffer area, thereby reducing the processing pressure of the third-party server.
- obtaining the hotspot data in the adjusted area by accessing the third-party server It can be implemented by forwarding the query request to the interface of the third-party server (such as the merchant interface of the external partner). Since the processing capability of the merchant interface of the external partner is limited, the above-mentioned embodiment of the present application can greatly alleviate the merchant interface. Stress, reducing the processing pressure of third-party servers.
- the above apparatus may further include: a second monitoring unit 48 and an extension unit 49.
- the second monitoring unit is configured to monitor the amount of access of the third-party server in the process of obtaining the hotspot data in the area where the location information of the user terminal is located by accessing the third-party server.
- the extension unit is configured to extend the expiration time of the hotspot data according to the amount of access if the access volume of the third-party server exceeds the preset access threshold.
- the processing capability of the third-party server is limited, and the system processing bottleneck is caused in order to avoid the processing capability of the third-party server.
- you need to monitor the access volume of the third-party server that is, monitor the number of query requests processed by the third-party server.
- the number of accesses monitored by the third-party server exceeds the preset access threshold, It can be considered that the processing capability of the third-party server has reached the limit, and other query requests cannot be processed in time.
- the expiration time of the corresponding hot-spot data can be extended according to the amount of the access, and the hot-spot data can be avoided. Repeat updates in a short period of time while reducing the processing pressure on third-party servers.
- the above apparatus may further include: a second obtaining unit 50 and a second setting unit 51.
- the second obtaining unit is configured to obtain the hotspot data in the area of the area where the location information of the user terminal is located by accessing the third-party server, and cache the area range and the corresponding hotspot data into the buffer area. .
- the second setting unit is used to set an expiration time for the hotspot data.
- the background server after receiving the query request of the user acquiring the object information sent by the user terminal, if the background server detects that the buffer area is empty (such as when the system first starts running or the hotspot data cached in the background server is all expired and the query request is After the query operation is performed, the background server forwards the query request to the third-party server to obtain the hotspot data in the corresponding area by accessing the third-party server, and after obtaining the hot data returned by the third-party server, The background server associates the area range and the corresponding hotspot data into the buffer area, and sets an expiration time for the hotspot data.
- implementation manners of the foregoing embodiments are consistent with the implementation manners of the obtaining module 415 and the implementation manners of the first setting unit and the deleting unit in the foregoing embodiments of the present application, and details are not described herein again.
- the foregoing apparatus may further include: a third obtaining unit 52 and a third setting unit 53.
- the third obtaining unit is configured to acquire object information in the area of the location where the location information of the user terminal is located by accessing the third-party server, and cache the area range and the corresponding object, if the frequency of the query access occurs in the area exceeds a predetermined threshold. Information is in the cache.
- the third setting unit is configured to set an expiration time for the object information, wherein the expiration time of the object information is less than the expiration time of the hotspot data.
- the background server forwards the query request to the third-party server, and obtains the corresponding object information by accessing the third-party server, so as to avoid other user terminals querying in the short-term.
- the object information in the area the background server caches the obtained object information and the corresponding area range into its buffer area, and sets a short expiration time for the object information, so as to avoid using the cached data for a long time to occupy the background server. Storage space.
- the foregoing apparatus for acquiring data based on location information may be applied.
- the computer terminal A In the hardware environment constituted by the computer terminal A shown in FIG. As shown in FIG. 13, the computer terminal A is connected to other computer terminals through a network, including but not limited to: a wide area network, a metropolitan area network, or a local area network.
- Embodiments of the present application may provide a computer terminal, which may be any one of computer terminal groups.
- the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
- the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
- FIG. 13 is a structural block diagram of a computer terminal according to an embodiment of the present application.
- the computer terminal A may include one or more (only one shown in the figure) processor 61, memory 63, and transmission device 65.
- the memory 63 can be used to store software programs and modules, such as the method and device corresponding to the method and device for acquiring data based on the location information in the embodiment of the present application, and the processor 61 runs the software program and the module stored in the memory 63. , thereby performing various functional applications and data processing, that is, implementing the above method of acquiring data based on location information.
- Memory 63 may include high speed random access memory and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
- memory 63 may further include memory remotely located relative to processor 61, which may be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- the transmission device 66 described above is for receiving or transmitting data via a network.
- Specific examples of the above network may include a wired network and a wireless network.
- transmission device 66 includes a Network Interface Controller (NIC) that can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network.
- NIC Network Interface Controller
- the transmission device 66 is a radio frequency (RF) module for passing no Line mode communicates with the Internet.
- RF radio frequency
- the memory 63 is configured to store preset action conditions and information of the preset rights user, and an application.
- the processor 61 may call the information and the application stored in the memory 63 by the transmission device to perform the following steps: receiving a query request for acquiring the object information sent by the user terminal, where the query request carries the location information of the user terminal; In the case that the buffer area is not empty, the hotspot data in the area where the location information of the user terminal is located is queried from the buffer area, where the hotspot data is the area that is cached when the frequency of query access occurs in the area exceeds a predetermined threshold. The information of the object included in the range; the hotspot data within the obtained area is sent to the user terminal.
- the processor 61 may further execute the following step: querying, from the buffer area, a range of the area where the location information of the user terminal is located, where the buffer area at least caches a preset area range, and the area range Hotspot data; in the case of successful query, the hotspot data in the area is read from the cache area; if the query fails, the hotspot data in the area where the location information of the user terminal is located is obtained by accessing the third party server, And cache the area range and the corresponding hotspot data into the buffer area.
- the processor 61 may further execute the following steps: converting the two-dimensional latitude and longitude data used to represent the area range into a one-dimensional first string encoding; encoding and acquiring the first character string Hotspot data within the scope is cached to the cache after association.
- the processor 61 may further execute the following steps: converting the latitude and longitude data in the location information of the user terminal into a second string code recognizable by the buffer area; and querying whether the storage area is stored in the buffer area.
- the second string encodes the same first string encoding; if the first string encoding the same as the second string encoding is stored in the buffer, it is determined that the region range is successfully queried; if not stored in the buffer If the second string encodes the same first string encoding, then the range of the query region is determined to have failed.
- the processor 61 may further execute the following program code: the number of hotspots According to the preset expiration time, the expiration time is determined according to the frequency of the hotspot data being queried; when the time when the hotspot data is stored in the buffer reaches the expiration time, the hotspot data is deleted from the buffer.
- the processor 61 may further execute the following program code: monitoring the number of queries for querying the same area from the buffer area; and monitoring the number of queries querying the same area from the buffer area exceeds the preset query.
- the precision of the first string encoding is adjusted to expand the coverage of the region range to be queried, and the adjusted region range is obtained; after receiving the query request for acquiring the object information in the adjusted region, the The third-party server is accessed to obtain the hotspot data in the adjusted area, and the adjusted area range and the corresponding hotspot data are cached in the cache area.
- the processor 61 may further execute the following program code: monitoring the access volume of the third-party server; and extending the expiration time of the hot-spot data according to the access amount if the access volume of the third-party server exceeds the preset access threshold. .
- the processor 61 may further execute the following program code: obtain the hotspot data in the area where the location information of the user terminal is located by accessing the third-party server, and cache the area range and the corresponding hotspot data into the buffer area. ; Set expiration time for hotspot data.
- the processor 61 may further execute the following program code: obtain the object information in the area of the location where the location information of the user terminal is located by accessing the third-party server, and cache the area range and the corresponding object information into the buffer area. Setting an expiration time for the object information, wherein the expiration time of the object information is less than the expiration time of the hotspot data.
- FIG. 13 is only for illustration, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
- FIG. 13 does not limit the structure of the above electronic device.
- computer terminal 10 may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 13, or have a different configuration than that shown in FIG.
- Embodiments of the present application also provide a storage medium.
- the storage medium may store the program code of the method for acquiring data based on the location information in the first embodiment.
- the foregoing storage medium 902 may be located in at least one of a plurality of network devices in a computer network.
- the storage medium 902 is configured to store program code for performing the following steps: receiving a query request sent by the user terminal for acquiring object information, where the query request carries the user terminal. Location information; in the case that the buffer area is not empty, the hotspot data in the area where the location information of the user terminal is located is queried from the buffer area, wherein the hotspot data is when the frequency of the query access occurs within the area exceeds a predetermined threshold.
- the information of the object included in the cached area; the hotspot data in the obtained area is sent to the user terminal.
- the storage medium is further configured to store program code for performing the following steps: querying a range of areas in which the location information of the user terminal is located from the buffer area, wherein the buffer area at least caches a preset area range, and the area Hotspot data in the range; in the case of successful query, the hotspot data in the area is read from the cache area; in the case of the query failure, the third-party server is accessed to obtain the location of the location information of the user terminal. Hotspot data, and cache the area range and corresponding hotspot data to the cache area.
- the storage medium is further configured to store program code for performing the following steps: converting the two-dimensional latitude and longitude data for representing the area range into a one-dimensional first string encoding; encoding and acquiring the first character string The hotspot data within the range of the area is cached and cached to the cache area.
- the storage medium is further configured to store program code for performing: converting the latitude and longitude data in the location information of the user terminal into a second string encoding recognizable by the buffer; querying whether to store in the buffer area Having the same first string encoding as the second string encoding; if the first string encoding the same as the second string encoding is stored in the buffer, it is determined that the region range is successfully queried; if not in the buffer region The first string encoding the same as the second string encoding is stored, and it is determined that the query region range fails.
- the storage medium is further configured to store program code for performing the following steps: setting a preset expiration time for the hotspot data, wherein the expiration time is determined according to the frequency at which the hotspot data is queried; when the hotspot data is stored in the buffer area When the time reaches the expiration time, the hotspot data is deleted from the cache.
- the storage medium is further configured to store program code for performing the following steps: monitoring the number of queries querying the same area range from the buffer area; and monitoring the number of queries querying the same area range from the buffer area exceeds
- the threshold is preset
- the precision of the first string encoding is adjusted to expand the coverage of the region range to be queried, and the adjusted region range is obtained; and the query request for acquiring the object information in the adjusted region is received.
- the hotspot data in the adjusted area is obtained by accessing the third-party server, and the adjusted area range and the corresponding hotspot data are cached in the buffer area.
- the storage medium is further configured to store program code for performing the following steps: monitoring the access amount of the third-party server; and extending the hotspot data according to the access amount if the access amount of the third-party server exceeds the preset access threshold Expiration time.
- the storage medium is further configured to store program code for performing the following steps: obtaining the hotspot data in the area of the location where the location information of the user terminal is located by accessing the third-party server, and buffering the area range and the corresponding hotspot data to In the cache area; set the expiration time for hotspot data.
- the storage medium is further configured to store program code for performing the following steps: obtaining object information in the area of the location where the location information of the user terminal is located by accessing the third-party server, and buffering the area range and the corresponding object information to In the cache area, an expiration time is set for the object information, wherein the expiration time of the object information is less than the expiration time of the hot item data.
- the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
- ROM Read-Only Memory
- RAM Random Access Memory
- a mobile hard disk e.g., a hard disk
- magnetic memory e.g., a hard disk
- the integrated unit in the above embodiment if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in the above-described computer readable storage medium.
- the technical solution of the embodiments of the present application may be embodied in the form of a software product in the form of a software product in essence or in the form of a contribution to the prior art, and the computer software product is stored in the storage medium.
- a number of instructions are included to cause one or more computer devices (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
- the disclosed client may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be through some interface, indirect coupling of the unit or module or The communication connection can be in electrical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Remote Sensing (AREA)
- Information Transfer Between Computers (AREA)
- Telephonic Communication Services (AREA)
- Telephone Function (AREA)
Abstract
Description
Claims (27)
- 一种基于位置信息获取数据的方法,包括:接收用户终端发送的用于获取对象信息的查询请求,其中,所述查询请求中携带有所述用户终端的位置信息;在缓存区非空的情况下,从所述缓存区中查询所述用户终端的位置信息所在的区域范围内的热点数据,其中,所述热点数据为当所述区域范围内发生查询访问的频率超过预定阈值时,缓存的所述区域范围内所包含的对象的信息;将得到的所述区域范围内的热点数据发送至所述用户终端。
- 根据权利要求1所述的方法,其中,从所述缓存区中查询所述用户终端的位置信息所在的区域范围内的热点数据,包括:从所述缓存区中查询所述用户终端的位置信息所在的所述区域范围,其中,所述缓存区至少缓存一个预先设置的区域范围,以及所述区域范围内的热点数据;在查询成功的情况下,从所述缓存区中读取所述区域范围内的热点数据;在查询失败的情况下,通过访问第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围及对应的所述热点数据至所述缓存区中。
- 根据权利要求2所述的方法,其中,缓存所述区域范围及对应的所述热点数据至所述缓存区中包括:将用于表示所述区域范围的二维经纬度数据转化为一维的第一字符串编码;将所述第一字符串编码和获取到的所述区域范围内的热点数据关联之后缓存至所述缓存区。
- 根据权利要求3所述的方法,其中,从所述缓存区中查询所述用户终 端的位置信息所在的所述区域范围包括:将所述用户终端的位置信息中的经纬度数据转化为所述缓存区可识别的第二字符串编码;在所述缓存区中查询是否存储有与所述第二字符串编码相同的所述第一字符串编码;若在所述缓存区中存储有与所述第二字符串编码相同的所述第一字符串编码,则确定成功查询到所述区域范围;若在所述缓存区中未存储与所述第二字符串编码相同的所述第一字符串编码,则确定查询所述区域范围失败。
- 根据权利要求3所述的方法,其中,在将所述第一字符串编码和获取到的所述区域范围内的热点数据关联之后缓存至所述缓存区的同时或之后,所述方法还包括:为所述热点数据设置预设的过期时间,其中,所述过期时间根据所述热点数据被查询的频率确定;当所述热点数据存储在所述缓存区的时间达到所述过期时间时,将所述热点数据从所述缓存区中删除。
- 根据权利要求3所述的方法,其中,在从所述缓存区中查询所述用户终端的位置信息所在的所述区域范围的过程中,所述方法还包括:监控从所述缓存区中查询同一个所述区域范围的查询次数;在监控到从所述缓存区中查询同一个所述区域范围的查询次数超过预设查询阈值时,调整所述第一字符串编码的精度以扩大被查询的所述区域范围的覆盖范围,得到调整后的区域范围;在接收到用于获取所述调整后的区域范围内的对象信息的查询请求之后,通过访问所述第三方服务器获取所述调整后的区域范围内的热点数据,并缓存所述调整后的区域范围及对应的所述热点数据至所述缓存区中。
- 根据权利要求5所述的方法,其中,在通过访问第三方服务器获取所 述用户终端的位置信息所在的所述区域范围内的热点数据的过程中,所述方法还包括:监控所述第三方服务器的访问量;在所述第三方服务器的访问量超过预设访问阈值的情况下,根据所述访问量延长所述热点数据的过期时间。
- 根据权利要求5所述的方法,其中,在所述缓存区为空的情况下,所述方法还包括:通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围及对应的所述热点数据至所述缓存区中;为所述热点数据设置所述过期时间。
- 根据权利要求5所述的方法,其中,在所述区域范围内发生查询访问的频率未超过所述预定阈值的情况下,所述方法还包括:通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的对象信息,并缓存所述区域范围及对应的所述对象信息至所述缓存区中;为所述对象信息设置所述过期时间,其中,所述对象信息的过期时间小于所述热点数据的过期时间。
- 一种基于位置信息获取数据的装置,包括:接收单元,用于接收用户终端发送的用于获取对象信息的查询请求,其中,所述查询请求中携带有所述用户终端的位置信息;查询单元,用于在缓存区非空的情况下,从所述缓存区中查询所述用户终端的位置信息所在的区域范围内的热点数据,其中,所述热点数据为当所述区域范围内发生查询访问的频率超过预定阈值时,缓存的所述区域范围内所包含的对象的信息;发送单元,用于将得到的所述区域范围内的热点数据发送至所述用户终端。
- 根据权利要求10所述的装置,其中,所述查询单元包括:查询模块,用于从所述缓存区中查询所述用户终端的位置信息所在的所述区域范围,其中,所述缓存区至少缓存一个预先设置的区域范围,以及所述区域范围内的热点数据;读取模块,用于在查询成功的情况下,从所述缓存区中读取所述区域范围内的热点数据;获取模块,用于在查询失败的情况下,通过访问第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围及对应的所述热点数据至所述缓存区中。
- 根据权利要求11所述的装置,其中,所述获取模块包括:第一转化子模块,用于将用于表示所述区域范围的二维经纬度数据转化为一维的第一字符串编码;缓存子模块,用于将所述第一字符串编码和获取到的所述区域范围内的热点数据关联之后缓存至所述缓存区。
- 根据权利要求12所述的装置,其中,所述查询模块包括:第二转化子模块,用于将所述用户终端的位置信息中的经纬度数据转化为所述缓存区可识别的第二字符串编码;查询子模块,用于在所述缓存区中查询是否存储有与所述第二字符串编码相同的所述第一字符串编码;第一确定子模块,用于在所述缓存区中存储有与所述第二字符串编码相同的所述第一字符串编码的情况下,确定成功查询到所述区域范围;第二确定子模块,用于在所述缓存区中未存储与所述第二字符串编码相同的所述第一字符串编码的情况下,确定查询所述区域范围失败。
- 根据权利要求12所述的装置,其中,所述装置还包括:第一设置单元,用于在将所述第一字符串编码和获取到的所述区域范围内的热点数据关联之后缓存至所述缓存区的同时或之后,为所述热点数据设置预设的过期时间,其中,所述过期时间根据所述热点数据被查询的频率确定;删除单元,用于当所述热点数据存储在所述缓存区的时间达到所述过期时间时,将所述热点数据从所述缓存区中删除。
- 根据权利要求12所述的装置,其中,所述装置还包括:第一监控单元,用于在从所述缓存区中查询所述用户终端的位置信息所在的所述区域范围的过程中,监控从所述缓存区中查询同一个所述区域范围的查询次数;调整单元,用于在监控到从所述缓存区中查询同一个所述区域范围的查询次数超过预设查询阈值时,调整所述第一字符串编码的精度以扩大被查询的所述区域范围的覆盖范围,得到调整后的区域范围;第一获取单元,用于在接收到用于获取所述调整后的区域范围内的对象信息的查询请求之后,通过访问所述第三方服务器获取所述调整后的区域范围内的热点数据,并缓存所述调整后的区域范围及对应的所述热点数据至所述缓存区中。
- 根据权利要求14所述的装置,其中,所述装置还包括:第二监控单元,用于在通过访问第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据的过程中,监控所述第三方服务器的访问量;延长单元,用于在所述第三方服务器的访问量超过预设访问阈值的情况下,根据所述访问量延长所述热点数据的过期时间。
- 根据权利要求14所述的装置,其中,所述装置还包括:第二获取单元,用于在所述缓存区为空的情况下,通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围及对应的所述热点数据至所述缓存 区中;第二设置单元,用于为所述热点数据设置所述过期时间。
- 根据权利要求14所述的装置,其中,所述装置还包括:第三获取单元,用于在所述区域范围内发生查询访问的频率未超过所述预定阈值的情况下,通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的对象信息,并缓存所述区域范围及对应的所述对象信息至所述缓存区中;第三设置单元,用于为所述对象信息设置所述过期时间,其中,所述对象信息的过期时间小于所述热点数据的过期时间。
- 一种存储介质,所述存储介质被设置为存储用于执行以下步骤的程序代码,包括:接收用户终端发送的用于获取对象信息的查询请求,其中,所述查询请求中携带有所述用户终端的位置信息;在缓存区非空的情况下,从所述缓存区中查询所述用户终端的位置信息所在的区域范围内的热点数据,其中,所述热点数据为当所述区域范围内发生查询访问的频率超过预定阈值时,缓存的所述区域范围内所包含的对象的信息;将得到的所述区域范围内的热点数据发送至所述用户终端。
- 根据权利要求19所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:从所述缓存区中查询所述用户终端的位置信息所在的所述区域范围,其中,所述缓存区至少缓存一个预先设置的区域范围,以及所述区域范围内的热点数据;在查询成功的情况下,从所述缓存区中读取所述区域范围内的热点数据;在查询失败的情况下,通过访问第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围 及对应的所述热点数据至所述缓存区中。
- 根据权利要求20所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:将用于表示所述区域范围的二维经纬度数据转化为一维的第一字符串编码;将所述第一字符串编码和获取到的所述区域范围内的热点数据关联之后缓存至所述缓存区。
- 根据权利要求21所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:将所述用户终端的位置信息中的经纬度数据转化为所述缓存区可识别的第二字符串编码;在所述缓存区中查询是否存储有与所述第二字符串编码相同的所述第一字符串编码;若在所述缓存区中存储有与所述第二字符串编码相同的所述第一字符串编码,则确定成功查询到所述区域范围;若在所述缓存区中未存储与所述第二字符串编码相同的所述第一字符串编码,则确定查询所述区域范围失败。
- 根据权利要求21所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:为所述热点数据设置预设的过期时间,其中,所述过期时间根据所述热点数据被查询的频率确定;当所述热点数据存储在所述缓存区的时间达到所述过期时间时,将所述热点数据从所述缓存区中删除。
- 根据权利要求21所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:监控从所述缓存区中查询同一个所述区域范围的查询次数;在监控到从所述缓存区中查询同一个所述区域范围的查询次数超过预设查询阈值时,调整所述第一字符串编码的精度以扩大被查询的所述区域范围的覆盖范围,得到调整后的区域范围;在接收到用于获取所述调整后的区域范围内的对象信息的查询请求之后,通过访问所述第三方服务器获取所述调整后的区域范围内的热点数据,并缓存所述调整后的区域范围及对应的所述热点数据至所述缓存区中。
- 根据权利要求23所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:监控所述第三方服务器的访问量;在所述第三方服务器的访问量超过预设访问阈值的情况下,根据所述访问量延长所述热点数据的过期时间。
- 根据权利要求23所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的热点数据,并缓存所述区域范围及对应的所述热点数据至所述缓存区中;为所述热点数据设置所述过期时间。
- 根据权利要求23所述的存储介质,所述存储介质还被设置为存储用于执行以下步骤的程序代码,包括:通过访问所述第三方服务器获取所述用户终端的位置信息所在的所述区域范围内的对象信息,并缓存所述区域范围及对应的所述对象信息至所述缓存区中;为所述对象信息设置所述过期时间,其中,所述对象信息的过期时间小于所述热点数据的过期时间。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/571,082 US11144609B2 (en) | 2015-08-03 | 2016-07-27 | Method and apparatus for obtaining data based on location information |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510482174.0A CN106708833B (zh) | 2015-08-03 | 2015-08-03 | 基于位置信息获取数据的方法和装置 |
CN201510482174.0 | 2015-08-03 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017020765A1 true WO2017020765A1 (zh) | 2017-02-09 |
Family
ID=57942413
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/091947 WO2017020765A1 (zh) | 2015-08-03 | 2016-07-27 | 基于位置信息获取数据的方法和装置 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11144609B2 (zh) |
CN (1) | CN106708833B (zh) |
WO (1) | WO2017020765A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110637292A (zh) * | 2017-05-19 | 2019-12-31 | 甲骨文国际公司 | 用于查询资源高速缓存的系统和方法 |
CN110889042A (zh) * | 2019-11-26 | 2020-03-17 | 北京梧桐车联科技有限责任公司 | 资源推荐方法、装置、计算机设备及存储介质 |
CN112559570A (zh) * | 2020-12-16 | 2021-03-26 | 中国平安财产保险股份有限公司 | 缓存数据获取方法、装置、设备及存储介质 |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6308093B2 (ja) * | 2014-10-07 | 2018-04-11 | 株式会社デンソー | 情報取得システム、通信端末、情報取得プログラム及び記憶媒体 |
CN108984553B (zh) * | 2017-06-01 | 2022-02-01 | 北京京东尚科信息技术有限公司 | 缓存方法和装置 |
CN107301215B (zh) * | 2017-06-09 | 2020-12-18 | 北京奇艺世纪科技有限公司 | 一种搜索结果缓存方法及装置、搜索方法及装置 |
CN107885873B (zh) * | 2017-11-28 | 2021-08-24 | 百度在线网络技术(北京)有限公司 | 用于输出信息的方法和装置 |
CN108376157B (zh) * | 2018-02-08 | 2022-06-07 | 腾讯科技(深圳)有限公司 | 目标用户查询方法、系统和装置 |
CN110069419A (zh) * | 2018-09-04 | 2019-07-30 | 中国平安人寿保险股份有限公司 | 多级缓存系统及其访问控制方法、设备和存储介质 |
CN111767352A (zh) * | 2019-09-27 | 2020-10-13 | 北京京东尚科信息技术有限公司 | 信息获取方法、装置、lbs系统以及存储介质 |
CN110765222B (zh) * | 2019-10-24 | 2022-04-19 | 成都路行通信息技术有限公司 | 一种基于Geohash编码的兴趣点自驾热度计算方法和平台 |
CN111897902A (zh) * | 2020-07-14 | 2020-11-06 | 西安润森数码网络科技有限责任公司 | 基于lbs和gis的精准定位方法、装置及存储介质 |
CN112487326B (zh) * | 2020-11-27 | 2024-03-19 | 杭州安恒信息技术股份有限公司 | 数据缓存方法、系统、存储介质及设备 |
CN112507199B (zh) * | 2020-12-22 | 2022-02-25 | 北京百度网讯科技有限公司 | 用于对搜索系统进行优化的方法和装置 |
CN112948674A (zh) * | 2021-02-26 | 2021-06-11 | 平安科技(深圳)有限公司 | 基于Redis的智能推送服务的方法、装置及计算机设备 |
CN113763051A (zh) * | 2021-09-08 | 2021-12-07 | 北京房江湖科技有限公司 | 门店到访信息确定方法、装置及存储介质 |
CN114880421B (zh) * | 2022-07-08 | 2022-10-18 | 北谷电子有限公司 | 位置服务方法、系统、电子设备和存储介质 |
CN115996227A (zh) * | 2022-12-23 | 2023-04-21 | 中国联合网络通信集团有限公司 | 数据共享方法、装置、系统、服务器及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103023946A (zh) * | 2011-09-26 | 2013-04-03 | 北京千橡网景科技发展有限公司 | 用于在社交网络中推荐共同兴趣场所的方法和设备 |
CN103020125A (zh) * | 2012-11-19 | 2013-04-03 | 百度国际科技(深圳)有限公司 | 提供服务资源的方法、输入的方法及服务器、电子设备 |
CN103246679A (zh) * | 2012-02-13 | 2013-08-14 | 刘龙 | 一种实现基于位置的搜索的系统和方法 |
US20140297415A1 (en) * | 2007-07-03 | 2014-10-02 | Vulcan, Inc. | Method and system for continuous, dynamic, adaptive recommendation based on a continuously evolving personal region of interest |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7346360B1 (en) * | 2005-08-03 | 2008-03-18 | At&T Mobility Ii Llc | Location caching with expiration based on location |
US8943043B2 (en) * | 2010-01-24 | 2015-01-27 | Microsoft Corporation | Dynamic community-based cache for mobile search |
US9177069B1 (en) * | 2011-05-19 | 2015-11-03 | Google Inc. | Determining labels from similar geographic features |
CN103686860A (zh) * | 2011-07-15 | 2014-03-26 | 上海华为技术有限公司 | 缓存数据的分布缓存方法和装置 |
KR101584329B1 (ko) * | 2011-08-16 | 2016-01-21 | 엠파이어 테크놀로지 디벨롭먼트 엘엘씨 | 복수 개의 저장 장치로 데이터의 할당 |
US8983953B2 (en) * | 2011-10-18 | 2015-03-17 | Nokia Corporation | Methods and apparatuses for facilitating interaction with a geohash-indexed data set |
CN102523279B (zh) * | 2011-12-12 | 2015-09-23 | 深圳市安云信息科技有限公司 | 一种分布式文件系统及其热点文件存取方法 |
CN103177005B (zh) * | 2011-12-21 | 2016-08-03 | 深圳市腾讯计算机系统有限公司 | 一种数据访问的处理方法和系统 |
US9510141B2 (en) * | 2012-06-04 | 2016-11-29 | Apple Inc. | App recommendation using crowd-sourced localized app usage data |
CN103944958A (zh) * | 2014-03-14 | 2014-07-23 | 中国科学院计算技术研究所 | 一种广域文件系统及实现方法 |
CN104135715B (zh) * | 2014-06-10 | 2015-10-07 | 腾讯科技(深圳)有限公司 | 一种位置服务的实现方法、装置,及系统 |
WO2015195923A1 (en) * | 2014-06-21 | 2015-12-23 | Google Inc. | Tile-based distribution of searchable geospatial data to client devices |
-
2015
- 2015-08-03 CN CN201510482174.0A patent/CN106708833B/zh active Active
-
2016
- 2016-07-27 US US15/571,082 patent/US11144609B2/en active Active
- 2016-07-27 WO PCT/CN2016/091947 patent/WO2017020765A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140297415A1 (en) * | 2007-07-03 | 2014-10-02 | Vulcan, Inc. | Method and system for continuous, dynamic, adaptive recommendation based on a continuously evolving personal region of interest |
CN103023946A (zh) * | 2011-09-26 | 2013-04-03 | 北京千橡网景科技发展有限公司 | 用于在社交网络中推荐共同兴趣场所的方法和设备 |
CN103246679A (zh) * | 2012-02-13 | 2013-08-14 | 刘龙 | 一种实现基于位置的搜索的系统和方法 |
CN103020125A (zh) * | 2012-11-19 | 2013-04-03 | 百度国际科技(深圳)有限公司 | 提供服务资源的方法、输入的方法及服务器、电子设备 |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110637292A (zh) * | 2017-05-19 | 2019-12-31 | 甲骨文国际公司 | 用于查询资源高速缓存的系统和方法 |
CN110637292B (zh) * | 2017-05-19 | 2023-10-10 | 甲骨文国际公司 | 用于查询资源高速缓存的系统和方法 |
US11803547B2 (en) | 2017-05-19 | 2023-10-31 | Oracle International Corporation | System and method for query resource caching |
CN110889042A (zh) * | 2019-11-26 | 2020-03-17 | 北京梧桐车联科技有限责任公司 | 资源推荐方法、装置、计算机设备及存储介质 |
CN110889042B (zh) * | 2019-11-26 | 2022-03-15 | 北京梧桐车联科技有限责任公司 | 资源推荐方法、装置、计算机设备及存储介质 |
CN112559570A (zh) * | 2020-12-16 | 2021-03-26 | 中国平安财产保险股份有限公司 | 缓存数据获取方法、装置、设备及存储介质 |
CN112559570B (zh) * | 2020-12-16 | 2024-05-10 | 中国平安财产保险股份有限公司 | 缓存数据获取方法、装置、设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US20180165293A1 (en) | 2018-06-14 |
CN106708833B (zh) | 2020-04-07 |
US11144609B2 (en) | 2021-10-12 |
CN106708833A (zh) | 2017-05-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017020765A1 (zh) | 基于位置信息获取数据的方法和装置 | |
CN102546656B (zh) | 在社交网络中查找用户的方法、系统和装置 | |
JP5928739B2 (ja) | 位置ベースの無線タワー・キャッシング | |
US8457652B2 (en) | Device, method, and system for receiving content on a mobile computing device | |
US20130073671A1 (en) | Offloading traffic to device-to-device communications | |
WO2017020552A1 (zh) | 用于提供无线接入点的接入点信息的方法与设备 | |
US20150156609A1 (en) | Prefetching and caching map data based on mobile network coverage | |
US11172460B2 (en) | User location monitoring in mobile edge environment | |
JP2015537398A (ja) | 位置情報を取得する方法、および、そのためのシステム | |
JP5849155B2 (ja) | ユーザコンテンツの取得方法及び取得システム | |
US20160187143A1 (en) | Mechanism for facilitating dynamic location-based zone management for computing systems | |
US11224040B2 (en) | Clientless method for context driven wireless interactions | |
JP2008517372A (ja) | 位置データベースのための装置および方法 | |
KR100597395B1 (ko) | 이동통신 단말기를 이용한 위치 정보 검색 장치 및 방법 | |
WO2018032705A1 (zh) | 用于提供无线接入点信息包的方法与设备 | |
US9294897B2 (en) | Apparatuses and methods for downloading data | |
JP6682342B2 (ja) | 情報提供装置および端末装置 | |
CN111818457B (zh) | 一种地理围栏的确定方法、装置、电子设备及存储介质 | |
WO2018121795A1 (zh) | 用于连接无线接入点的方法与设备 | |
CN102546846A (zh) | 业务服务器地址的获取方法、系统及装置 | |
US8780741B2 (en) | On-demand information retrieval using wireless communication devices | |
JP5992544B2 (ja) | ユーザ情報を提供する方法、装置及びコンピュータ記憶媒体 | |
JP2002049622A (ja) | 位置関連情報取得装置及びそのシステム並びにその方法並びにそれに用いるプログラムを記録した記録媒体 | |
US20230362268A1 (en) | Apparatus, method and computer program | |
WO2023024541A1 (zh) | 设备定位方法和系统、存储介质及电子装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16832253 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 15571082 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 06.07.18. |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06.07.2018) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16832253 Country of ref document: EP Kind code of ref document: A1 |