CN107092623B - Interest point query method and device - Google Patents

Interest point query method and device Download PDF

Info

Publication number
CN107092623B
CN107092623B CN201611192745.8A CN201611192745A CN107092623B CN 107092623 B CN107092623 B CN 107092623B CN 201611192745 A CN201611192745 A CN 201611192745A CN 107092623 B CN107092623 B CN 107092623B
Authority
CN
China
Prior art keywords
query
interest
index
point
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611192745.8A
Other languages
Chinese (zh)
Other versions
CN107092623A (en
Inventor
窦方钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Koubei Holding Ltd
Original Assignee
Koubei Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Koubei Holding Ltd filed Critical Koubei Holding Ltd
Priority to CN201611192745.8A priority Critical patent/CN107092623B/en
Publication of CN107092623A publication Critical patent/CN107092623A/en
Application granted granted Critical
Publication of CN107092623B publication Critical patent/CN107092623B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Navigation (AREA)

Abstract

The application discloses a method and a device for inquiring a point of interest. The query index construction method comprises the following steps: obtaining coordinates of n interest points to be indexed; determining the index coordinate precision required to be used; according to the determined precision of the index coordinates, carrying out precision reduction processing on the coordinates of the n interest points to be indexed to obtain m kinds of characteristic coordinates, and recording the corresponding relation between the characteristic coordinate points and the interest points to be indexed; sorting the m characteristic coordinates according to the gradient sequence of the coordinate values; and storing the sequencing information of the characteristic coordinate points and the corresponding relation to obtain the interest point query index. By applying the technical scheme, the processing efficiency and accuracy of the interest point query can be effectively improved.

Description

Interest point query method and device
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a method and an apparatus for querying a point of interest.
Background
In LBS (Location Based Service) related technology, one common requirement is: given a geographical location Point X, the distance between the location Point and other location points is calculated to provide further POI (Point of Interest) information service based on the calculation result. For example: the method comprises the steps that the current position and interest of a user are known, and merchants which are possibly interested in the user are recommended to the user; or recommend restaurant, hotel information, etc. to the user based on the user's travel destination location.
In order to achieve the above requirement, it is necessary to calculate the distances between the given location point X and the multiple other interest points, and assuming that the number of other location points satisfying the requirement is n, when the number of n is large, if all the n distances are calculated in a traversal manner, not only a large amount of calculation resources (e.g., CPU, memory, etc.) are consumed, but also the processing speed is difficult to satisfy the actual use requirement of the user.
Disclosure of Invention
In order to solve the technical problems, the application provides a method and a device for inquiring a point of interest, and the technical scheme is as follows:
according to a first aspect of the present application, a method for constructing an interest point query index is provided, the method including:
obtaining coordinates of n interest points to be indexed, wherein n is more than or equal to 1;
determining the index coordinate precision required to be used;
according to the determined precision of the index coordinates, carrying out precision reduction processing on the coordinates of n interest points to be indexed to obtain m kinds of characteristic coordinates, and recording the corresponding relation between the characteristic coordinate points and the interest points to be indexed, wherein m is less than or equal to n;
sorting the m characteristic coordinates according to the gradient sequence of the coordinate values;
and storing the sequencing information of the characteristic coordinate points and the corresponding relation to obtain the interest point query index.
According to a second aspect of the present application, there is provided a method for querying a point of interest based on the aforementioned index, the method including:
obtaining an interest point query request, wherein the query request at least carries the coordinates of a specified reference point P;
mapping the reference point P to be a characteristic coordinate point P' by using precision reduction processing used in index construction;
determining adjacent characteristic coordinate points of the characteristic coordinate points P' according to the characteristic coordinate sorting information in the index;
determining the interest points corresponding to the P' and the adjacent characteristic coordinate points thereof according to the corresponding relation in the index;
and generating a query result by using the determined interest points.
According to a third aspect of the present application, there is provided a point of interest query index constructing apparatus, including:
the interest point determining module is used for obtaining the coordinates of n interest points to be indexed, wherein n is more than or equal to 1;
the index coordinate precision determining module is used for determining the index coordinate precision required to be used;
the characteristic coordinate calculation module is used for carrying out precision reduction processing on the coordinates of n interest points to be indexed according to the determined precision of the index coordinates to obtain m kinds of characteristic coordinates, and recording the corresponding relation between the characteristic coordinate points and the interest points to be indexed, wherein m is less than or equal to n;
the characteristic coordinate sorting module is used for sorting the m characteristic coordinates according to the gradient sequence of the coordinate values;
and the index generation module is used for storing the sequencing information of the characteristic coordinate points and the corresponding relation to obtain the interest point query index.
According to a fourth aspect of the present application, there is provided an apparatus for querying a point of interest based on the foregoing index, the apparatus comprising:
the query request obtaining module is used for obtaining an interest point query request, and the query request at least carries the coordinates of a specified reference point P;
the mapping processing module is used for mapping the reference point P to be a characteristic coordinate point P' by utilizing precision reduction processing used in index construction;
the adjacent characteristic coordinate point determining module is used for determining an adjacent characteristic coordinate point of the characteristic coordinate point P' according to the characteristic coordinate sequencing information in the index;
the interest point determining module is used for determining the interest points corresponding to the P' and the adjacent characteristic coordinate points thereof according to the corresponding relation in the index;
and the query result generation module is used for generating a query result by using the determined interest points.
Compared with the prior art, the scheme of the application has at least the following advantages:
firstly, by dividing a large-area geographic area into a plurality of rectangular blocks, the query is only performed within a small number of blocks, so that the unnecessary processing overhead can be effectively reduced.
Secondly, the query algorithm is designed aiming at the boundary problem, and the adjacent area of the specified position point can be quickly determined by storing the sequencing information of each characteristic coordinate point, so that the query result which is more in line with the actual situation can be efficiently generated.
Thirdly, the mapping algorithm of the real coordinate → the characteristic coordinate is simple, the mapping algorithm can be realized through simple rounding calculation, the position of the characteristic coordinate can be intuitively reflected, and all the characteristic coordinate values are regular, so that various processing is more convenient.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Moreover, not all of the above-described effects need to be achieved by any of the embodiments in this application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of GeoHash zone division in the present application;
FIG. 2 is a flowchart illustrating a method for constructing an interest point query index according to the present application;
FIG. 3 is a schematic diagram of coordinate point mapping according to the present application;
FIG. 4 is a schematic flow chart diagram of a point of interest query method of the present application;
FIG. 5 is a schematic illustration of a gasoline station location point mapping of the present application;
FIG. 6 is a schematic diagram of a two-dimensional linked list construction method according to the present application;
FIG. 7 is a schematic structural diagram of an interest point query index building apparatus according to the present application;
FIG. 8 is a schematic structural diagram of a point of interest query device according to the present application;
fig. 9 is a schematic diagram of an apparatus for configuring the device of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments that can be derived from the embodiments given herein by a person of ordinary skill in the art are intended to be within the scope of the present disclosure.
First, briefly introducing the basic concept related to the present application, a POI (Point of Interest) is a concept in a geographic information system, and generally refers to all geographic objects that can be abstracted as points, such as some geographic entities closely related to people's lives: schools, banks, restaurants, gas stations, hospitals, supermarkets, etc. The main purpose of the interest points is to describe the addresses of the things or events, so that the description capability and the query capability of the positions of the things or events can be greatly enhanced, and the accuracy and the speed of geographic positioning are improved.
The point of interest query (point of interest search) is one of the basic technologies of location information service, and its basic requirements are: and generating a query result from the information of the one or more interest points according to the query condition specified by the user, and feeding the query result back to the user. Since location information (typically in the form of latitude and longitude coordinates) is an inherent attribute of a point of interest, many queries for a point of interest are provided based on the location information of the point of interest, such as that mentioned in the background, calculating the distance between two points based on the location information of the two points, and then providing further services based on the distance calculation result.
When a large number of inter-location-point distances need to be calculated, in order to improve the processing efficiency of inter-location-point distance calculation, a solution that is available is to reduce the amount of calculation using GeoHash. The GeoHash is a coding mode for geographical position information, and can convert two-dimensional longitude and latitude into a character string. Each GeoHash code represents not a point but a rectangular area. In other words, the GeoHash divides a large geographical area into several rectangular areas, and each position point in the same rectangular area has the same GeoHash code. The precision of the rectangular region can be controlled by the GeoHash coding length, and the longer the coding length is, the smaller the area of the corresponding rectangular region is, and the higher the representable precision is. For example, when the code length is 5, the precision is about 2400m, and when the code length is 9, the precision can reach about 2 m.
By utilizing the GeoHash algorithm, a large-area geographic area can be divided into a plurality of rectangular blocks, and then the distance of the position point pair is calculated in each block, so that the unnecessary distance calculation of the position point pair can be effectively reduced. For example, when information push of "nearby restaurants" needs to be performed on the user, only the location points meeting the "restaurant" condition need to be determined in the GeoHash rectangle where the user location point X is located, and then the distances between the X and the location points need to be calculated respectively (in some cases, even no calculation needs to be performed), so that a large amount of unnecessary location point-to-distance calculation is avoided.
However, in the practical application process, it is found that the above solution based on GeoHash still has some disadvantages:
first, since the GeoHash divides the region into several rectangular regions, when the nearby location query is actually performed, the following problems may be caused: as shown in fig. 1, assuming that the point X is the current location of the user, and Y1 and Y2 are two restaurants, respectively, it can be seen from the figure that Y1 is closer to the user, but when computing with GeoHash, since Y2 and X are in the same GeoHash rectangle, Y2 which is farther away is preferentially recommended to the user, and the recommendation result deviates from the actual requirement of the user, which is often generated near the boundary of the rectangular region, and is also called a boundary problem.
Secondly, before distance calculation, two-dimensional position information (generally longitude and latitude) needs to be converted into a one-dimensional GeoHash code, and the conversion needs to consume certain processing resources due to certain complexity of the coding method. More importantly, as the GeoHash adopts recursive hierarchical coding, the coded value obtained after conversion is not visual enough and is inconvenient in practical application.
For example, as shown in fig. 1, it can be seen that the encoding of 9 rectangular regions does not have a definite rule, because the calculation results are different due to different recursive layers. Therefore, even if the GeoHash code of a region is known, complex calculation is still needed to obtain the GeoHash codes of 4 (or more) adjacent regions above, below, left and right (or more) adjacent regions. If it is desired to take into account the neighborhood of the rectangular area where the X point is located, it is troublesome to actually process the rectangular area.
In view of the above problem, the present application further provides a point of interest query scheme, which includes two parts: the construction scheme of the query index and the query scheme implemented based on the index are respectively described in detail below.
The requirements to be realized by the query index construction are as follows: for a large number of known interest points, specific processing is carried out on internal information of the known interest points, and the internal information is stored in a specific form, so that a basis is provided for realizing efficient query of the interest points subsequently. Fig. 2 is a schematic flow chart of a method for constructing an interest point query index according to the present application, where the method includes the following steps:
s101, obtaining coordinates of interest points to be indexed;
the method and the device for extracting the geographical position information are provided based on a geographical information system, the geographical position information is a basic attribute of an interest point, the geographical position information can be directly extracted from any known interest point, the most common expression form of the geographical position information is longitude and latitude, namely, the position of one point is represented by one (longitude and latitude) two-dimensional coordinate, of course, other coordinate expression forms can be adopted theoretically, and the method and the device for extracting the geographical position information are not limited in the application.
It is understood that "interest point to be indexed" refers to a set containing n interest points, where n ≧ 1, and the set may be "all interest points" stored in the current system, or a set of interest points with some kind of the same characteristics, such as "all restaurants", "all gas stations", and the like, according to the actual application requirements, which need not be limited in this application.
S102, determining the precision of index coordinates to be used;
the basic idea of the scheme of the application is to map a large number of interest points (assuming that the number is n) into a small number of points (assuming that the number is m), thereby achieving the purpose of indexing. The mapping method adopted in the present application is "reduce the coordinate accuracy", and it can be understood that the lower the coordinate accuracy of a position point is, the more sparsely distributed it is on the map, and for a plurality of position points represented by higher accuracy, after the coordinate accuracy is reduced, the position points will be finally concentrated into a smaller number of points, and the lower the accuracy is, the more obvious the "concentrated" effect is.
The coordinate precision to be used in the index can be determined according to the actual use requirement, for example, through statistical discovery, a user often searches for an interest point within 1km, and then the coordinate precision can be converted according to geographic knowledge to obtain: longitude 0.01 degrees corresponds to approximately 1.1km and latitude 0.01 degrees corresponds to approximately 1km, and index coordinate accuracy may be set to 0.01 (longitude/latitude) for simplification of the processing.
Of course, if there are multiple requirements for the query region range of the interest point by the user, multiple index accuracy levels may also be determined to generate an index containing multiple accuracy levels. For example, if the user frequently uses the conditions of "within 500m of the periphery", "within 1km of the periphery", and "within 2km of the periphery" to perform the interest point search, 500m, 1km, and 2km may be respectively converted into corresponding coordinate accuracies, and then index construction may be performed for the three accuracy levels.
In addition, if the query area range requirement of the user is relatively random, for example, in some map systems, such as "circle search" and "search in current display area" provided in the present disclosure, it is difficult to determine the index accuracy directly according to the query area range requirement of the user, in this case, one or more index accuracy levels may also be directly determined according to the experience of the user, for example, three index accuracy levels are set: 0.01, 0.05 and 0.2 which correspond to about 1km, 5km and 20km respectively, and subsequently, when the query request is actually processed, one index precision level closer to the query requirement can be selected from the multiple index precision levels for query processing according to the query region range specified in the query request and a certain matching rule.
S103, according to the determined precision of the index coordinate, carrying out precision reduction processing on the coordinate of the interest point to be indexed to obtain a characteristic coordinate, and recording the corresponding relation between the interest point to be indexed and the characteristic coordinate point;
first, as can be understood by those skilled in the art, the precision reduction processing is based on the processing idea of "rounding down", not the processing idea of "rounding up". The specific rounding algorithm implementation can be found in the prior art.
Assuming that the number of interest points to be indexed is n, the n two-dimensional coordinates are corresponding to the n two-dimensional coordinates, and after precision reduction processing is performed on the n two-dimensional coordinates, the n two-dimensional coordinates can be classified into m two-dimensional coordinates, wherein the m two-dimensional coordinates are referred to as feature coordinates in the application, and points of the feature coordinates corresponding to a map are referred to as feature coordinate points.
Theoretically, m is less than or equal to n, and in practical cases, m is less than n so as to achieve the purpose of improving the query efficiency, that is, two sets can be considered to exist: the number of elements in the interest point set to be indexed is n, the number of elements in the feature coordinate point set is m, each element in the indexed interest point set can find a uniquely determined corresponding element in the feature coordinate point through precision reduction processing, and the precision reduction processing can be regarded as mapping from the interest point set to the feature coordinate point set according to mathematical definition.
It can be seen that, one "feature coordinate point" corresponds to at least one "interest point to be indexed", as shown in fig. 3, if the two-dimensional map is used for visual representation, each feature coordinate point (shown as a solid point) corresponds to a rectangular area, and the feature coordinate point is located at one corner (shown as a lower left corner in the figure) of the rectangular area, and a plurality of interest points to be indexed (shown as hollow points) corresponding to the feature coordinate point are distributed in the rectangular area. Because of the undetermined corresponding rule of the feature coordinate points → the interest points to be indexed, the corresponding relationship between the feature coordinate points and the interest points to be indexed needs to be recorded, so that the interest points in the corresponding area can be found according to the feature coordinate points in the subsequent query.
It should be noted that, if the coordinates of the location point are expressed in terms of latitude and longitude, the area corresponding to the feature coordinate point is not a rectangle in a strict sense, but this does not affect the implementation of the solution of the present application.
S104, sorting the characteristic coordinates according to the gradient sequence of the coordinate values;
as can be seen from the foregoing description, each feature coordinate point corresponds to a rectangular (or approximately rectangular) region. According to actual use requirements, under the condition that an area is known, the adjacent area of the area is expected to be found quickly, in the scheme of the application, m kinds of characteristic coordinates are sorted according to the geographical position, and each characteristic coordinate point is stored in a sequence mode according to the sorting result, so that the quick positioning of the adjacent area in the inquiry process is realized.
Since each feature coordinate point is represented by a two-dimensional coordinate value, it is necessary to express the positional relationship of each feature coordinate point in a two-dimensional space in a two-dimensional sequence. Taking longitude and latitude coordinates as an example, for m feature coordinate points, a longitude sequence can be obtained according to the gradient order (increasing or decreasing) of the longitudes, and a latitude sequence can be obtained according to the gradient order (increasing or decreasing) of the latitudes.
Of course, in practice, other ways to generate the two-dimensional sequence may be used, such as: firstly, sorting first characteristic coordinate points at each latitude according to the latitude and writing the first characteristic coordinate points into a sequence to obtain a latitude sequence; and then, aiming at different latitudes, writing a plurality of characteristic coordinate points on the latitude into a sequence after sorting according to the longitude to obtain a plurality of longitude sequences.
In addition, since the feature coordinate points are obtained based on the interest points to be indexed, in an actual situation, each rectangular area does not necessarily correspond to one feature coordinate point. Since the side length of each rectangular region is fixed, for any two continuous feature coordinate points in the sequence, how many "blank" rectangular regions are separated from each other can also be directly calculated, for the blank regions, a special identifier can be recorded in the sequence, so that whether a "non-blank" region exists around a certain feature coordinate point can be directly determined in the subsequent query process, and the above processing can also be realized in the query process.
In a word, the specific data form and the generation means of the two-dimensional sequence can be flexibly designed according to actual requirements, and the application does not need to be limited.
And S105, storing the sequencing information and the corresponding relation of the characteristic coordinate points to obtain the interest point query index.
And storing the sequencing information of the characteristic coordinate points obtained in the step S104 and the corresponding relation obtained in the step S103, so as to obtain the finally required interest point query index. The sorting information (two-dimensional sequence) can be stored in the form of a linked list and the like, each element of the linked list corresponds to one characteristic coordinate point, interest point information corresponding to each characteristic coordinate point is stored in a correlated manner, and the index can realize the basic functions of: for any one designated position point P, the position point P can be quickly mapped into a characteristic coordinate point P 'through precision reduction processing, then the adjacent characteristic coordinate point of P' is quickly determined through a two-dimensional sequence, the corresponding interest point of the adjacent characteristic coordinate point is found, and then the query result is generated by only using the found interest points, so that the overall query response efficiency is improved.
Based on the generated interest point query index, the present application further provides a corresponding interest point query method, as shown in fig. 4, which may include the following steps:
s201, obtaining an interest point query request;
the query request at least needs to carry the coordinates of a specified reference point P, and the specified reference point P may be, corresponding to the actual use requirement: the location where the user is currently located, the location selected by the user on the map, and so on.
In addition, one or more other query conditions may also be carried in the interest point query request, for example: the conditions of how large area range the content is to be queried (within 500m of the perimeter, within 1km of the perimeter, etc.), what type of interest point is to be queried (restaurant, hotel, etc.), what type of interest point is to be queried, whether there is discount activity … …, etc. may be specified by the user or by default, and the application is not limited thereto.
S202, mapping the reference point P to be a characteristic coordinate point P' by using precision reduction processing used in index construction;
since the coordinate accuracy of the index is determined, the reference point P can be directly mapped to a feature coordinate point in the index by using the accuracy reduction process used in constructing the index, and the mapping result is referred to as P' for convenience of description.
S203, determining adjacent characteristic coordinate points of the characteristic coordinate point P' according to the characteristic coordinate sorting information in the index;
from the two-dimensional sequence stored in the index, the adjacent feature coordinate points of P' can be quickly determined, where "adjacent" refers to adjacent in a geographic sense. As can be seen from the description in S104, two feature coordinate points adjacent to each other in the sequence are not necessarily adjacent feature coordinate points in the real geographic sense, and if a "blank" area spaced between two feature coordinate points is recorded in the index construction process, it is possible to directly determine how many adjacent feature coordinate points are actually around P'. Of course, even if no record is made, according to the side length of each rectangular region, it is possible to determine how many adjacent feature coordinate points are actually around P' by simple calculation.
In addition, for the "proximity" criterion, a simplest way is to determine at most 8 neighboring feature coordinate points around P ', which correspond to the east, south, west, north, east, north, west, and north-west 8 neighboring directions of P', respectively, but in practical applications, it may be necessary to determine the selection range or the selection number of the neighboring feature coordinate points in combination with the query area range (within 500m of the periphery, within 1km of the periphery, etc.) specified in the query request and the currently used index precision, for example, on the basis of the above 8 neighboring feature coordinate points, it may be necessary to further select more "outer" neighboring feature coordinate points, for example, select 24 (obtained by 5 × 5-1) neighboring feature coordinate points around P ', select 48 (obtained by 7 × 7-1) neighboring feature coordinate points around P', and so on. Since the sequence information of the feature coordinate points is saved in advance and the size of each region is fixed, the above results can be quickly determined by calculation, and the present application does not describe these cases one by one.
S204, determining the P' and the interest points corresponding to the adjacent characteristic coordinate points thereof according to the corresponding relation in the index;
according to S103, each feature coordinate point corresponds to one or more interest points, and the corresponding relationship stored in the index can be directly obtained by querying.
And S205, generating a query result by using the determined interest points.
In this step, the query result may be directly generated from the interest point determined in S204, so as to be fed back to the query initiator. Of course, according to the actual requirement, the interest points may be further processed, which is illustrated as follows:
the determined points of interest may be ranked and/or filtered according to the point of interest information specified in the query request to generate the query result. The filtering may be based on the type of points of interest specified in the query request, the ranking may be based on similarity of the point of interest names to the names specified in the query request, and so on.
Or respectively calculating the distance between the reference point P and each determined interest point, and sorting and/or screening the determined interest points according to the distance calculation result to generate a query result. E.g., points of interest will be ranked by distance to point of interest, only points of interest within a certain distance threshold will be displayed, etc.
Of course, the above processing manner is only used for illustrative illustration, and those skilled in the art may also design other query result generation rules according to the actual application requirements, and this application is not limited thereto.
According to an embodiment of the present application, if the pre-constructed index includes multiple precision levels, before S203 is executed, the index precision level used in the query is first selected, specifically, a most suitable index precision level may be selected according to the query area range specified in the query request, and when the selection is performed, the factors that may be considered include: the matching degree of the index precision and the query range, the average number of the interest points covered by each area corresponding to the index precision level, the number of the adjacent areas needing to be queried corresponding to the index precision level, and the like.
For example, the query performance for each index precision level may be evaluated according to the following algorithm:
defining: index precision level i query cost Wi*Cdi*Cpi
Wherein WiRepresents: index precision level i performance weight value, which may be set empirically, one special case is all WiAll the same, namely weight processing is not needed;
Cdirepresents: the number of regions to be queried at index precision level i, which may beThe calculation is carried out according to the specified query area range and the size of each calculation area, such as 9, 25, 49 and the like;
Cpirepresents: the average number of the interest points covered by each region in the index precision level i can be obtained by statistics after the index construction is finished;
finally, the index precision level with the smaller query overhead value is selected for subsequent query processing, which is described with reference to an example as follows:
two index precision levels of 0.01 and 0.03 are assumed, wherein:
the weight value corresponding to the 0.01 precision level is 10, and the average interest point number of each region (rectangle with the side length of 1 km) is 10;
the weight value corresponding to the 0.03 precision level is 4, and the average interest point number of each region (rectangle with the side length of 3 km) is 90;
assuming the query request specifies a search of "2 km ambient", then:
the query cost at the 0.01 precision level is: 10 × 25 ═ 2500;
the query cost at the 0.03 precision level is: 4, 90, 9, 3240;
therefore, for the query request of "2 km around", the 0.01 precision index with smaller overhead should be selected.
Assuming the query request specifies a search of "peripheral 3km," then:
the query cost at the 0.01 precision level is: 10 × 49 ═ 4900;
the query cost at the 0.03 precision level is: 4, 90, 9, 3240;
therefore, for the query request of "peripheral 3 km", the 0.03 precision index with smaller overhead should be selected.
Of course, the above selection factors and algorithms are only used for illustrative purposes, and those skilled in the art may design other forms of index precision level selection rules according to actual requirements, and the present application does not need to be limited thereto.
Compared with the prior art, the scheme of the application has at least the following advantages:
firstly, by dividing a large-area geographic area into a plurality of rectangular blocks, the query is only performed within a small number of blocks, so that the unnecessary processing overhead can be effectively reduced.
Secondly, the query algorithm is designed aiming at the boundary problem, and the adjacent area of the specified position point can be quickly determined by storing the sequencing information of each characteristic coordinate point, so that the query result which is more in line with the actual situation can be efficiently generated.
Thirdly, the mapping algorithm of the real coordinate → the characteristic coordinate is simple, the mapping algorithm can be realized through simple rounding calculation, the position of the characteristic coordinate can be intuitively reflected, and all the characteristic coordinate values are regular, so that various processing is more convenient.
The above query index construction scheme and the corresponding query scheme are described below with reference to a specific application example.
Assuming that there are hundreds of thousands of gas stations nationwide, longitude and latitude information of the gas stations is prestored in the system, and the expression form is as follows:
101.735184,26.521964
101.735184,26.599169
101.735438,36.651483
101.736001,26.560173
101.737824,26.489486
101.740376,36.681045
101.741125,36.638765
……
through statistics, it is found that the user often searches only gas stations within 1km of the vicinity, and both the longitude and latitude accuracies of the index coordinates can be set to 0.01 according to the description in S102. Through an rounding algorithm, the gas station position points can be mapped to characteristic coordinate points with the precision of 0.01:
101.735184,26.521964→101.73,26.52
101.735184,26.599169→101.73,26.59
101.735438,36.651483→101.73,36.65
101.736001,26.560173→101.73,26.56
101.737824,26.489486→101.73,26.48
101.740376,36.681045→101.74,36.68
……
as shown in fig. 5, the true gasoline station locations are represented by two open dots, one (101.73432873,36.50239092) and the other (101.73782313, 36.50782321). But after the accuracy reduction process, the feature coordinates are mapped (101.73,36.50) to the solid feature coordinate point. It will be appreciated that all real gasoline stations in the shaded area will be mapped to the solid feature coordinate points as shown, and the latitude and longitude information of each real gasoline station in the area will be further recorded at this point.
Although there are many gas stations nationwide, there are not every square kilometer. Therefore, the data structure of the sparse two-bit linked list is adopted to store the sequence of the characteristic coordinate points, and when the linked list is stored, the longitude linked list and the latitude linked list both adopt a certain sorting mode so as to be convenient for quick positioning in the inquiry process.
Latitude linked list: carrying out latitude sequencing on the first characteristic coordinate point on each latitude and storing the first characteristic coordinate point;
longitude linked list: and in the same latitude, sorting and storing the longitude of the feature coordinate points in the latitude.
The schematic diagram of the two-dimensional linked list is shown in fig. 6. Through the pointing of the two-dimensional linked list, the longitude and latitude of any characteristic coordinate point near a gasoline station closest to a given position can be quickly positioned.
When a user needs to inquire a gas station closest to the user, the system firstly obtains the longitude and latitude of the current position of the user, and then inquires through the following algorithm:
firstly, precision reduction processing is carried out on the longitude and latitude of the current position P of the user, and the longitude and latitude are mapped to a certain characteristic coordinate point P'.
According to the characteristic coordinate point sequencing information in the index, the area where the user is located and the adjacent area of the user can be quickly determined, 9 areas can be determined at most theoretically, and through the filtering, the remaining areas of the real data are generally few.
According to the corresponding relation between the characteristic coordinate points in the index and the gas stations, the actual longitude and latitude of the gas stations in the areas can be further obtained, and then the distance between the user and each gas station is respectively calculated, so that one or more gas stations closest to the user are obtained.
The scheme is very suitable for application scenes (within 1 kilometer, for example) with clear query range, and the number of the gas stations in each area is not large, so that the query performance is improved obviously in the scene. According to preliminary tests, each query takes up to within 0.1ms for a number of stations of around 20 tens of thousands. Of course, this embodiment is only used for schematically illustrating the scheme of the present application, and should not be construed as limiting the scheme of the present application.
Corresponding to the above method embodiment, the present application further provides an apparatus for constructing an index of interest query, as shown in fig. 7, where the apparatus may include:
the interest point determining module 110 is configured to obtain coordinates of n interest points to be indexed, where n is greater than or equal to 1;
an index coordinate precision determining module 120, configured to determine the precision of the index coordinate to be used;
the feature coordinate calculation module 130 is configured to perform precision reduction processing on the coordinates of n interest points to be indexed according to the determined precision of the index coordinate to obtain m kinds of feature coordinates, and record a corresponding relationship between the feature coordinate points and the interest points to be indexed, where m is less than or equal to n;
the characteristic coordinate sorting module 140 is used for sorting the m characteristic coordinates according to the gradient sequence of the coordinate values;
and an index generating module 150, configured to store the sorting information and the corresponding relationship of the feature coordinate points, so as to obtain an interest point query index.
In one embodiment of the present application, the determined index coordinate precision includes multiple precision levels, and the query index of interest including the multiple precision levels is obtained correspondingly.
In an embodiment of the present application, the feature coordinate sorting module 140 may be specifically configured to: and respectively sequencing according to the m longitude values and the m latitude values to obtain two-dimensional coordinate point sequencing information.
The present application further provides an interest point query device based on the aforementioned index, and as shown in fig. 8, the device may include:
a query request obtaining module 210, configured to obtain a query request for a point of interest, where the query request at least carries coordinates of a specified reference point P;
a mapping processing module 220, configured to map the reference point P as a feature coordinate point P' by using precision reduction processing used in index construction;
an adjacent feature coordinate point determination module 230, configured to determine an adjacent feature coordinate point of the feature coordinate point P' according to the feature coordinate sorting information in the index;
an interest point determining module 240, configured to determine, according to the corresponding relationship in the index, an interest point corresponding to P' and the adjacent feature coordinate point thereof;
and a query result generation module 250, configured to generate a query result by using the determined interest points.
In a specific embodiment of the present application, the index includes multiple precision levels, and the mapping processing module 220 is further configured to: and selecting the index precision level used by the query according to the query area range specified in the query request.
In an embodiment of the present application, the adjacent feature coordinate point determining module 230 may be specifically configured to: and determining the selection range or the selection number of the adjacent characteristic coordinate points according to the query area range specified in the query request and/or the currently used index precision.
In a specific embodiment of the present application, the query result generating module 250 may be specifically configured to: and sorting and/or screening the determined interest points according to the interest point information specified in the query request to generate a query result.
Or
And respectively calculating the distance between the reference point P and each determined interest point, and sequencing and/or screening the determined interest points according to the distance calculation result to generate a query result.
The two devices provided by the present application are mainly configured on a server providing an interest point query function, in some cases, some or all modules in the devices may also be configured on a terminal device such as a mobile phone, a tablet computer, a smart watch, and the like, as shown in fig. 9, for a schematic diagram of a hardware structure of an apparatus for configuring the devices provided by the present application, the apparatus may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided in the present Application.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the present application is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. Furthermore, it will be understood by those skilled in the art that the apparatus described above may also include only the components necessary to implement the solution of the present application, and not necessarily all of the components shown in the figures.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the solution of the present application. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.

Claims (12)

1. A method of point of interest query, the method comprising:
obtaining an interest point query request, wherein the query request at least carries the coordinates of a specified reference point P;
mapping the reference point P to be a characteristic coordinate point P' by using precision reduction processing used in constructing the interest point query index; the interest point query index is constructed in the following way: obtaining coordinates of n interest points to be indexed, determining index coordinate precision required to be used, wherein the determined index coordinate precision comprises multiple precision levels, and correspondingly obtaining an interest point query index containing the multiple precision levels; wherein n is more than or equal to 1; according to the determined precision of the index coordinates, carrying out precision reduction processing on the coordinates of n interest points to be indexed to obtain m kinds of characteristic coordinates, and recording the corresponding relation between the characteristic coordinate points and the interest points to be indexed, wherein m is less than or equal to n; sorting the m kinds of characteristic coordinates according to the gradient sequence of the coordinate values, and storing sorting information of the characteristic coordinate points and the corresponding relation to obtain an interest point query index;
determining query cost of the interest point query index corresponding to various index precision levels according to the query area range specified in the query request, wherein the query cost of the index precision level i is Wi*Cdi*Cpi,i>0;
Wherein, WiRepresents: indexing a performance weight value of a precision level i; cd [ Cd ]iRepresents: the number of characteristic coordinate points to be inquired under an index precision level i is associated with the inquiry area range; cpiRepresents: the average number of interest points covered by each characteristic coordinate point under the index precision level i;
selecting an index precision grade used in the query based on the determined query cost, and determining a characteristic coordinate point close to the characteristic coordinate point P' according to characteristic coordinate sorting information in a target interest point query index corresponding to the selected index precision grade;
and according to the corresponding relation in the target interest point query index, determining the interest points corresponding to the P' and the adjacent characteristic coordinate points thereof, and generating a query result by using the determined interest points.
2. The method according to claim 1, wherein the sorting of the m feature coordinates according to the gradient order of the coordinate values comprises:
and respectively sequencing according to the m longitude values and the m latitude values to obtain two-dimensional coordinate point sequencing information.
3. The method of claim 1, wherein determining neighboring feature coordinate points of the feature coordinate point P' comprises:
and determining the selection range or the selection number of the adjacent characteristic coordinate points according to the query area range specified in the query request and/or the currently used index precision.
4. The method of claim 1, wherein generating query results using the determined points of interest comprises:
and sorting and/or screening the determined interest points according to the interest point information appointed in the query request to generate a query result.
5. The method of claim 1, wherein generating query results using the determined points of interest comprises:
and respectively calculating the distance between the reference point P and each determined interest point, and sequencing and/or screening the determined interest points according to the distance calculation result to generate a query result.
6. An apparatus for point of interest query, the apparatus comprising:
the query request obtaining module is used for obtaining an interest point query request, and the query request at least carries the coordinates of a specified reference point P;
the mapping processing module is used for mapping the reference point P to be a characteristic coordinate point P' by utilizing precision reduction processing used in the process of constructing the interest point query index; the interest point query index is constructed in the following way: obtaining coordinates of n interest points to be indexed, determining index coordinate precision required to be used, wherein the determined index coordinate precision comprises multiple precision levels, and correspondingly obtaining an interest point query index containing the multiple precision levels; wherein n is more than or equal to 1; according to the determined precision of the index coordinates, carrying out precision reduction processing on the coordinates of n interest points to be indexed to obtain m kinds of characteristic coordinates, and recording the corresponding relation between the characteristic coordinate points and the interest points to be indexed, wherein m is less than or equal to n; sorting the m kinds of characteristic coordinates according to the gradient sequence of the coordinate values, and storing sorting information of the characteristic coordinate points and the corresponding relation to obtain an interest point query index;
a near characteristic coordinate point determination module for determining query cost of interest point query indexes corresponding to various index precision levels according to the query area range specified in the query request, and determining index precisionQuery cost for level i ═ Wi*Cdi*Cpi,i>0; wherein, WiRepresents: indexing a performance weight value of a precision level i; cd [ Cd ]iRepresents: the number of characteristic coordinate points to be inquired under an index precision level i is associated with the inquiry area range; cpiRepresents: the average number of interest points covered by each characteristic coordinate point under the index precision level i; selecting an index precision grade used in the query based on the determined query cost, and determining a characteristic coordinate point close to the characteristic coordinate point P' according to characteristic coordinate sorting information in a target interest point query index corresponding to the selected index precision grade;
the interest point determining module is used for determining the interest points corresponding to the P' and the adjacent characteristic coordinate points thereof according to the corresponding relation in the target interest point query index;
and the query result generation module is used for generating a query result by using the determined interest points.
7. The apparatus of claim 6, wherein the m feature coordinates are ordered by:
and respectively sequencing according to the m longitude values and the m latitude values to obtain two-dimensional coordinate point sequencing information.
8. The apparatus of claim 6, wherein the neighboring feature coordinate point determination module is specifically configured to:
and determining the selection range or the selection number of the adjacent characteristic coordinate points according to the query area range specified in the query request and/or the currently used index precision.
9. The apparatus of claim 6, wherein the query result generation module is specifically configured to:
and sorting and/or screening the determined interest points according to the interest point information appointed in the query request to generate a query result.
10. The apparatus of claim 6, wherein the query result generation module is specifically configured to:
and respectively calculating the distance between the reference point P and each determined interest point, and sequencing and/or screening the determined interest points according to the distance calculation result to generate a query result.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the point of interest query method as claimed in any one of claims 1-5 by executing the executable instructions.
12. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 5.
CN201611192745.8A 2016-12-21 2016-12-21 Interest point query method and device Active CN107092623B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611192745.8A CN107092623B (en) 2016-12-21 2016-12-21 Interest point query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611192745.8A CN107092623B (en) 2016-12-21 2016-12-21 Interest point query method and device

Publications (2)

Publication Number Publication Date
CN107092623A CN107092623A (en) 2017-08-25
CN107092623B true CN107092623B (en) 2021-03-23

Family

ID=59648665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611192745.8A Active CN107092623B (en) 2016-12-21 2016-12-21 Interest point query method and device

Country Status (1)

Country Link
CN (1) CN107092623B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763522A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 POI retrieval orderings method, apparatus and computer readable storage medium
CN109325088A (en) * 2018-09-04 2019-02-12 北京奇虎科技有限公司 Screening method, device and the computer readable storage medium of wireless access node
CN110888947B (en) * 2018-09-10 2023-08-01 北京嘀嘀无限科技发展有限公司 Service request processing method and system
CN110059260B (en) * 2019-04-29 2020-07-31 北京字节跳动网络技术有限公司 Recommendation method, device, equipment and medium
CN110379152B (en) * 2019-07-19 2021-12-31 同济大学 Visualization method for real-time monitoring and rebalancing of shared bicycle
CN110889049B (en) * 2019-12-09 2023-03-24 腾讯科技(深圳)有限公司 Position coordinate retrieval method, device, equipment and medium
CN111274272B (en) * 2020-01-15 2022-08-05 江苏苏宁物流有限公司 Object searching method and device and computer system
CN111274346A (en) * 2020-01-21 2020-06-12 青梧桐有限责任公司 Method, system, electronic device and readable storage medium for obtaining point of interest data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102651005A (en) * 2011-02-24 2012-08-29 北京千橡网景科技发展有限公司 Interest point searching method and equipment
CN104516950A (en) * 2014-12-10 2015-04-15 百度在线网络技术(北京)有限公司 Inquiring method and device of interest points
CN105509743A (en) * 2015-11-24 2016-04-20 上海汽车集团股份有限公司 A positioning processing method, a business platform and a network system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060122776A1 (en) * 2004-12-03 2006-06-08 Knowles Kenneth W Backtrack orbit search algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102651005A (en) * 2011-02-24 2012-08-29 北京千橡网景科技发展有限公司 Interest point searching method and equipment
CN104516950A (en) * 2014-12-10 2015-04-15 百度在线网络技术(北京)有限公司 Inquiring method and device of interest points
CN105509743A (en) * 2015-11-24 2016-04-20 上海汽车集团股份有限公司 A positioning processing method, a business platform and a network system

Also Published As

Publication number Publication date
CN107092623A (en) 2017-08-25

Similar Documents

Publication Publication Date Title
CN107092623B (en) Interest point query method and device
US8352480B2 (en) Methods, apparatuses and computer program products for converting a geographical database into a map tile database
US9378291B2 (en) System and method for preferred services in nomadic environments
CN110008293B (en) Geographic position query method and device
EP2958033A1 (en) Tile-based distribution of searchable geospatial data to client devices
CN109478184B (en) Identifying, processing, and displaying clusters of data points
KR20100068468A (en) Method, apparatus and computer program product for performing a visual search using grid-based feature organization
CN112559667B (en) Map editor, map engine, map editing system, map editing method, and storage medium
CN111651685A (en) Interest point obtaining method and device, electronic equipment and storage medium
CN103714080A (en) Spatial index structure tree based method and device for providing results of searching spatial objects
CN113077181B (en) Parking station setting method, device, medium and electronic equipment
CN104320848B (en) The system and method for indoor positioning is realized based on cloud computing
JP2021120867A (en) Fusion relation network construction method, fusion relation network construction device, electronic device, storage medium and program
CN114372133A (en) Query information question answering method, related device and computer program product
CN108009205B (en) Search result caching method based on position, search method, client and system
US20190095536A1 (en) Method and device for content recommendation and computer readable storage medium
CN103714081A (en) Method and device for recognizing proprietary place names
JP2008089815A (en) Area information provision method
Piarsa et al. Web-based gis by using spatial decision support system (sdss) concept for searching commercial marketplace-using google map api
US9449110B2 (en) Geotiles for finding relevant results from a geographically distributed set
CN105991400B (en) Group searching method and device
US20160283990A1 (en) Apparatus, System, Method, Computer Program, and Computer Program Product For Generating Activity Information For a Cell
US20130110826A1 (en) Method for searching contacts, electronic apparatus, and storage medium using the method thereof
CN111737374A (en) Position coordinate determination method and device, electronic equipment and storage medium
CN111274272B (en) Object searching method and device and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant