WO2022222828A1 - 定位方法和相关装置 - Google Patents

定位方法和相关装置 Download PDF

Info

Publication number
WO2022222828A1
WO2022222828A1 PCT/CN2022/086658 CN2022086658W WO2022222828A1 WO 2022222828 A1 WO2022222828 A1 WO 2022222828A1 CN 2022086658 W CN2022086658 W CN 2022086658W WO 2022222828 A1 WO2022222828 A1 WO 2022222828A1
Authority
WO
WIPO (PCT)
Prior art keywords
polygon
target
coordinates
polygons
area identifier
Prior art date
Application number
PCT/CN2022/086658
Other languages
English (en)
French (fr)
Inventor
卢国瑞
黎耀炳
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022222828A1 publication Critical patent/WO2022222828A1/zh

Links

Images

Classifications

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

Definitions

  • the present application relates to the field of electronic maps, and more particularly, to a positioning method and related devices.
  • Inverse geographic search can realize the function of determining location information according to coordinates (such as longitude and latitude). For example, input the latitude and longitude (39.991366, 116.25952), the returned inverse geographic search results may include: Beiwu Park West Gate; Beiwu Village Road; Haidian District; Beijing; China.
  • LBS Location based service
  • the LBS determines the user's location through the coordinates uploaded by the user, so that it can provide the user with corresponding services. For example, recommend accessories for shopping malls, restaurants, cafes, etc. for the user; determine the user's current location so that the car-hailing driver can find the user, etc.
  • the response speed of inverse geographic search has a great impact on the user experience.
  • the present application provides a positioning method and a related device, which can improve the response speed of reverse geographic search.
  • an embodiment of the present application provides a positioning method, the method includes: receiving coordinates from a terminal device; determining a target data node corresponding to the target area identifier according to routing information and a target area identifier corresponding to the coordinates, The routing information is used to indicate the corresponding relationship between the area identifier and the data node, and the target area identifier is used to indicate the area containing the coordinates; send a positioning request to the target data node, where the positioning request includes the coordinates; receive data from the target Positioning feedback of the data node, where the positioning feedback includes geographic position information, which is used to describe the geographic position containing the coordinates.
  • different data nodes store different corresponding relationships between area identifiers and polygons (ie, polygon index information).
  • the routing node stores the corresponding relationship between the area identifier and the data node (ie, routing information).
  • the routing node can determine the corresponding target area identifier according to the coordinates, and then determine the target data node corresponding to the target area identifier according to the routing information.
  • the routing node can send the received coordinates to the determined target data node without sending the coordinates to all data nodes in the system. Except for the target data node, other data nodes do not need to participate in the calculation of determining the polygon corresponding to the coordinates.
  • the target data node can quickly determine the polygon containing the coordinates. In this way, the response speed of the reverse geographic search can be improved, and the user experience can be improved.
  • the routing information includes multiple indexes and identifiers of data nodes corresponding to each index, wherein each index in the multiple indexes is an area identifier Or a range that identifies a region.
  • determining the target data node corresponding to the target area identifier according to the routing information and the target area identifier includes: determining a target index matching the target area identifier from the multiple indexes; determining the target index matching the target area identifier The corresponding data node is the target data node.
  • the positioning feedback further includes at least one information point POI, and the distance between the coordinate and each POI in the at least one POI is less than a preset threshold.
  • an embodiment of the present application provides a positioning method.
  • the method includes: receiving a positioning request from a routing node, where the positioning request includes coordinates; and according to polygon index information, the coordinates and a target area identifier corresponding to the coordinates, Determine the target polygon corresponding to the coordinates, wherein the polygon index information is used to indicate the correspondence between the area identifier and the polygon, the target area identifier corresponds to a plurality of first polygons, and the target polygon is the plurality of first polygons One of the first polygons, the plurality of first polygons are part or all of the polygons obtained by dividing a second polygon, and the coordinates are within the range of the target polygon; send positioning feedback to the routing node, the positioning The feedback includes geographic location information describing the geographic location containing the coordinates.
  • the first polygon is obtained by dividing the second polygon.
  • the polygon index information includes multiple indices and a first polygon corresponding to each index, wherein each index in the multiple indices is one area identification; determining the target polygon according to the polygon index information, the target area identification and the coordinates, including: determining a target index matching the target area identification from the plurality of indexes; The first polygon is sorted; the target polygon is determined according to the sorting result and the coordinates.
  • the sorting of the plurality of first polygons corresponding to the target index includes: according to information of the plurality of first polygons Regional AOI level, sorting the plurality of first polygons, wherein the ranking of the first polygons with a higher AOI level is higher than the ranking of the first polygons with a lower AOI level.
  • the higher the AOI level of the polygon the smaller the area of the polygon; the smaller the area of the polygon, the faster the speed of judging that the coordinates are within the range of the polygon. Therefore, the above technical solution can further improve the response speed of the reverse geographic search.
  • the sorting the plurality of first polygons corresponding to the target index further includes: determining which of the plurality of first polygons N first polygons with the same AOI level, where N is a positive integer greater than or equal to 2; according to the distance from the center point of each reference area in the N first polygons with the same AOI level to the coordinate , sort the N first polygons with the same AOI level, wherein the first polygon with the same coordinate distance from the center point of the N first polygons with the same AOI level ranks higher than The rank of the first polygon whose center point is farther from this coordinate.
  • the closer a coordinate is to the center point of a polygon the greater the probability that the coordinate belongs to the polygon. Therefore, the above technical solution can further improve the response speed of the reverse geographic search.
  • the determining the target polygon according to the sorting result and the coordinates includes: selecting the first polygon with the highest ranking from the plurality of first polygons From the polygon, determine whether the first polygon contains the coordinates in turn, until the target polygon is determined.
  • the method before the positioning feedback is sent to the routing node, the method further includes: determining whether the target data node includes a target information point POI, where the target A POI is a POI whose distance from the coordinate is less than a preset threshold; if the target data node includes the target POI, the positioning feedback also includes the target POI.
  • the number of boundary points of the second polygon is greater than a preset threshold number of boundary points, and the number of boundary points of the first polygon is less than or equal to the a preset threshold number of boundary points;
  • the number of boundary points of the second polygon is greater than the preset threshold number of boundary points and the area of the second polygon is greater than the preset area threshold, and the number of boundary points of the first polygon is less than or equal to the preset boundary
  • the threshold of the number of points, or, the area of the first polygon is less than or equal to the preset area.
  • the plurality of first polygons are divided according to the center point of the circumscribed graph of the second polygon, and the second polygon is divided Some or all of the resulting polygons.
  • the circumscribed figure is a regular polygon, a trapezoid, a parallelogram, or a circle, wherein the number of sides of the circumscribed regular polygon is less than or equal to 8.
  • the target area identifier is one of at least one area identifier corresponding to the target polygon.
  • an embodiment of the present application provides a computer device, where the computer device includes a unit for implementing the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a computer device, where the computer device includes a unit for implementing the second aspect or any possible implementation manner of the second aspect.
  • an embodiment of the present application provides a computer device, where the computer device includes a processor, and the processor is configured to be coupled with a memory, and read and execute instructions and/or program codes in the memory to execute the first aspect or Any possible implementation of the first aspect.
  • an embodiment of the present application provides a computer device, the computer device includes a processor, and the processor is configured to be coupled with a memory, and read and execute instructions and/or program codes in the memory to execute the second aspect or Any possible implementation of the second aspect.
  • an embodiment of the present application provides a chip system, the chip system includes a logic circuit, the logic circuit is used for coupling with an input/output interface, and data is transmitted through the input/output interface, so as to execute the first aspect or the first any possible implementation of the aspect.
  • an embodiment of the present application provides a chip system, the chip system includes a logic circuit, the logic circuit is configured to be coupled with an input/output interface, and transmit data through the input/output interface, so as to execute the second aspect or the second any possible implementation of the aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where program codes are stored in the computer-readable storage medium, and when the computer storage medium runs on a computer, the computer is made to execute the first aspect or the first aspect any possible implementation.
  • embodiments of the present application provide a computer-readable storage medium, where program codes are stored in the computer-readable storage medium, and when the computer storage medium is run on a computer, the computer is made to execute the second aspect or the second aspect any possible implementation.
  • an embodiment of the present application provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on a computer, the computer is made to execute the first aspect or the first aspect. any possible implementation.
  • an embodiment of the present application provides a computer program product, the computer program product comprising: computer program code, when the computer program code is run on a computer, the computer is made to execute the second aspect or the second aspect. any possible implementation.
  • FIG. 1 is a schematic diagram of a possible application scenario provided according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a positioning method provided according to an embodiment of the present application.
  • Fig. 3 is a schematic flowchart of a method for determining a map index according to an embodiment of the application.
  • Figure 4 shows a schematic diagram of a polygon A.
  • Figure 5 shows four schematic diagrams of the results of segmenting polygon A.
  • FIG. 6 is a schematic diagram of the final segmentation result of polygon A.
  • FIG. 7 is a schematic flowchart of a positioning method provided according to an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a positioning method provided according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a computer device provided according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another computer device provided according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of another computer device provided according to an embodiment of the present application.
  • Map projection refers to a method of establishing a one-to-one correspondence between points on the surface of the earth (or other planetary surfaces or celestial spheres) and points on the projected plane (ie, the map plane), that is, establishing a mathematical conversion formula between them. It is used as a basic method for projecting a non-flattenable surface (such as the earth's surface) to a plane, which ensures the connection and integrity of spatial information in the area. This projection process will produce projection deformation, and different projection methods have projection deformation of different nature and size.
  • Commonly used projection methods include Mercator projection, Gauss-Krüger projection, oblique equal-area azimuth projection, bi-standard parallel equiangular conic projection, equal-differential parallel polyconic projection, positive axis azimuthal projection, etc.
  • the Mercator projection is an equirectangular cylindrical projection, formulated by the Dutch cartographer Gerhardus Mercator in 1569.
  • the "equiangular” feature of the Mercator projection ensures that the shape of the object is not deformed, and a square object will not become a rectangle after being projected. "Isometric” also ensures the correctness of directions and mutual positions, so it is often used in navigation and aviation, so that people will not make mistakes when inquiring about the direction of objects.
  • the "cylindrical" nature of the Mercator projection ensures that north-south (latitude) and east-west (longitude) are parallel straight lines and perpendicular to each other. And the meridian spacing is the same, the weft spacing gradually increases from the standard parallel (here is the equator, but also other parallels) to two levels.
  • the earth coordinate system can be expressed either in the form of Cartesian coordinates or in the form of geodetic coordinates.
  • the earth coordinate system expressed in Cartesian coordinates is called a space Cartesian coordinate system. Its X axis usually points to a certain starting meridian plane, the Z axis is parallel or coincident with the earth's rotation axis, and the Y axis is perpendicular to the X and Z axes.
  • the earth coordinate system expressed in geodetic coordinates is called the space geodetic coordinate system, which can also be referred to as the geodetic coordinate system or the geographic coordinate system.
  • the spatial geodetic coordinate system uses geodetic latitude, geodetic longitude, and geodetic height to describe the spatial location of objects.
  • a reference ellipsoid is a mathematically defined surface of the Earth that approximates the geoid. Because it is a geometric model, it can be determined by the major semi-axis, minor semi-axis and flattening. Geodetic latitude, geodetic longitude, and geodetic height are all based on this.
  • the Beijing 54 coordinate system uses the reference ellipsoid of Krasovsky 1940, and the Xi'an 80 coordinate system uses the reference ellipsoid recommended by the 16th Congress of the International Union of Geodesy and Geophysics in 1975.
  • the reference ellipsoid defined by WGS is currently more commonly used worldwide.
  • Geodetic latitude, geodetic longitude and geodetic height can indicate any location on the earth.
  • different regions may use different reference ellipsoids. Even if the same ellipsoid is used, the orientation and even size of the ellipsoid may be adjusted to better match the local geoid. . This requires the use of a different geodetic datum for identification. Therefore, for a certain position on the earth, using different geodetic systems, the obtained coordinates are not the same.
  • the Beijing 54 coordinate system and the Xi'an 80 coordinate system mentioned above are two commonly used coordinate systems.
  • common coordinate systems include WGS 84 coordinate system, National Bureau of Surveying and Mapping No. 02 standard (GCJ-02) coordinate system, Baidu (baidu, BD)-09 coordinate system, etc.
  • the area of information can be an administrative region, country, city, etc.
  • AOI can be represented by a polygon (composed of the latitude and longitude coordinates of the boundary points of the polygon).
  • a point of information can be a building, a shop, a bus stop, etc., and a latitude and longitude coordinate is used to identify the location.
  • the POI corresponding to the latitude and longitude may be the West Gate of Beiwu Park; the corresponding AOI may be Beiwu Village Road; Haidian District; Beijing; China.
  • FIG. 1 is a schematic diagram of a possible application scenario provided according to an embodiment of the present application.
  • the positioning system 100 includes a routing node 101 , data nodes 102 to 104 and a processing node 105 .
  • the terminal device 110 sends the acquired coordinates (eg, latitude and longitude) to the routing node 101 in the positioning system 100 .
  • the routing node 101 forwards the coordinates to one of the plurality of data nodes.
  • the data node that has received the coordinates determines the location information according to the coordinates, and sends the location information to the routing node 101 , and the routing node 101 sends the location information to the terminal device 110 .
  • the processing node 105 is responsible for constructing the index information and distributing the constructed index information to the corresponding data nodes, so that the data nodes can determine the location information according to the index information.
  • the positioning system 100 shown in FIG. 1 is only an example of a positioning system.
  • This embodiment of the present application does not limit the number of routing nodes and processing nodes included in the positioning system.
  • the positioning system may include multiple routing nodes and/or multiple processing nodes.
  • the number of data nodes in this embodiment of the present application may be a positive integer greater than or equal to 2.
  • the positioning system may include two or more data nodes.
  • the terminal device referred to in the embodiments of the present application may be any terminal device with a positioning function, for example, a mobile phone, a tablet computer, a notebook computer, a smart watch, and the like.
  • FIG. 2 is a schematic flowchart of a positioning method provided according to an embodiment of the present application. As shown in Figure 2, the positioning method can be divided into an offline part and an online part.
  • the offline part includes steps 201 to 203 , wherein steps 201 to 203 may be implemented by a processing node or a component (eg, a chip or a circuit, etc.) in the processing node.
  • steps 201 to 203 may be implemented by a processing node or a component (eg, a chip or a circuit, etc.) in the processing node.
  • the online part includes steps 204 to 208, wherein steps 204 and 205 can be implemented by routing nodes or components (eg chips or circuits, etc.) in routing nodes, and steps 206 to 208 can be implemented by data nodes.
  • steps 204 and 205 can be implemented by routing nodes or components (eg chips or circuits, etc.) in routing nodes, and steps 206 to 208 can be implemented by data nodes.
  • the projection map obtained according to the web Mercator projection can be divided into multiple regions.
  • the regions obtained by segmenting the projection map obtained according to the web Mercator projection can be called tiles.
  • the identification used to identify a tile may be referred to as a tile identification (ID) or a tile coordinate.
  • the map area obtained by dividing the projected map can also be called by other names. Therefore, the word tile in the following embodiments may also be replaced by area, map area, map unit, map tile, and the like.
  • the tile ID can also be replaced with map unit coordinates, map tile coordinates, and the like.
  • the area identifier may be geohash encoding for a map area to obtain a geohash corresponding to the area.
  • the coordinate system based on is the WGS 84 coordinate system. Coordinates in the WGS 84 coordinate system use latitude and longitude. It can be understood that the coordinates in the following embodiments can also be replaced by coordinates in a Cartesian coordinate system.
  • Fig. 3 is a schematic flowchart of a method for determining a map index according to an embodiment of the application.
  • the method shown in FIG. 3 may be implemented by a processing node or components in a processing node.
  • Polygon A can be an administrative region, a country or a city.
  • Figure 4 shows a polygon A.
  • the polygon A can be divided according to the center point of the circumscribed graph of the polygon A.
  • the circumscribed figure of the polygon A may be a regular polygon (for example, a rectangle, a regular hexagon, etc.) whose side number is less than or equal to 8.
  • the circumscribed figure of the polygon A may also be a trapezoid, a parallelogram, a circle, or the like.
  • the polygon A can be divided according to the midpoints of the sides of the circumscribed graphics of the polygon A.
  • the polygon A may be divided into equal parts to obtain a plurality of first polygons.
  • Figure 5 shows the results of four segmentations of polygon A.
  • (a) in FIG. 5 is that the polygon A is divided according to the center of the circumscribed rectangle of the polygon A, and four polygons are obtained, namely, polygon A1, polygon A2, polygon A3 and polygon A4.
  • (b) in FIG. 5 is that the polygon A is divided according to the center of the short side of the circumscribed rectangle of the polygon A, and two polygons are obtained, namely the polygon A1 and the polygon A2.
  • the polygon A is divided according to the center of the long side of the circumscribed rectangle of the polygon A to obtain the second polygon.
  • FIG. 5 are four first polygons obtained by dividing the circumscribed rectangle of the polygon A into equal parts.
  • the four four polygons are respectively polygon A1, polygon A2, polygon A3 and polygon A4.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • step 303 and the steps after step 303 may be performed.
  • Figure 6 is the final segmentation result for polygon A.
  • FIG. 6 is obtained by continuing the segmentation on the basis of the segmentation result shown in (a) of FIG. 5 .
  • the polygon A1 does not satisfy the preset condition. Therefore, the polygon A1 is further divided to obtain the polygon A11, the polygon A12, the polygon A13 and the polygon A14.
  • the polygon A11, the polygon A13, and the polygon A14 satisfy the preset conditions. Therefore, the polygon A11, the polygon A13 and the polygon A14 do not need to be further divided.
  • Polygon A12 does not satisfy the preset condition. Therefore, polygon A12 is further divided into polygon A121, polygon A122, polygon A123 and polygon A124.
  • Polygon A2 also does not satisfy the preset condition. Therefore, polygon A2 is further divided to obtain polygon A21, polygon A22, polygon A23 and polygon A24. Polygon A21 , polygon A22 , polygon A23 , and polygon A24 satisfy the preset conditions, and therefore do not need to be further divided.
  • Polygon A3 also does not satisfy the preset condition. Therefore, polygon A3 is further divided to obtain polygon A31, polygon A32, polygon A33 and polygon A34. Polygon A31 , polygon A32 , polygon A33 , and polygon A34 satisfy the preset conditions, and therefore do not need to be further divided.
  • Polygon A4 also does not satisfy the preset conditions. Therefore, polygon A4 is further divided to obtain polygon A41, polygon A42, polygon A43 and polygon A44. Polygon A41 , polygon A42 , polygon A43 , and polygon A44 satisfy the preset conditions, and therefore do not need to be further divided.
  • the final segmentation result of polygon A as shown in FIG. 4 includes: polygon A11, polygon A13, polygon A14, polygon A21, polygon A22, polygon A23, polygon A24, polygon A31, polygon A32, polygon A33, Polygon A34, Polygon A41, Polygon A42, Polygon A43, Polygon A44, Polygon 121, Polygon A122, Polygon A123 and Polygon A124, a total of 19 polygons.
  • the preset condition for judging whether the polygon needs to be further divided is: judging whether the number of boundary points included in the polygon is less than or equal to a preset threshold number of boundary points. If the number of boundary points of the polygon is greater than the preset threshold number of boundary points, it is determined that the polygon does not meet the preset condition; if the number of boundary points of the polygon is less than or equal to the preset threshold number of boundary points, it is determined that the polygon satisfies the preset condition. Set conditions.
  • the preset conditions for judging whether the polygon needs to be further divided are: judging whether the number of boundary points included in the polygon is less than or equal to a preset threshold number of boundary points, and determining whether the area of the polygon is smaller than the predetermined threshold. Set the area threshold. If the number of boundary points of the polygon is greater than the preset threshold number of boundary points and the area of the polygon is greater than the preset area threshold, it is determined that the polygon does not meet the preset condition. If the number of boundary points of the polygon is less than or equal to the preset threshold number of boundary points or the area of the polygon is less than or equal to the preset area threshold, it is determined that the polygon satisfies the preset condition.
  • the preset condition for judging whether the polygon needs to be further divided is: judging whether the area of the polygon is less than or equal to a preset area threshold. If the area of the polygon is greater than the preset area threshold, it is determined that the polygon does not meet the preset condition. If the area of the polygon is less than or equal to the preset area threshold, it is determined that the polygon satisfies the preset condition.
  • the preset threshold number of boundary points is too large or too small, the final determination result will be affected. If the preset threshold number of boundary points is smaller, more polygons need to be divided, so the offline processing time will increase accordingly, and the determined number of polygons corresponding to the coordinates input by the user will increase accordingly, so that the feedback result will be increased accordingly. time increases. Conversely, if the preset threshold number of boundary points is larger, the area of the polygon obtained by segmentation may be too large. In this way, it may increase the difficulty of judging the coordinates containing the user input, thereby increasing the time for feedback of the results.
  • the above-mentioned preset threshold number of boundary points may be a positive integer greater than or equal to 4 and less than or equal to 1000.
  • the preset threshold number of boundary points may be a positive integer greater than or equal to 100 and less than or equal to 300.
  • it can be 200, 180, 220, etc.
  • the preset area threshold is too large or too small, the final determination result will be affected. If the preset area threshold is smaller, more polygons need to be segmented, so the offline processing time will increase accordingly, and the determined number of polygons corresponding to the coordinates input by the user will increase accordingly, so that the time to feedback the results will be increased accordingly. Increase. Conversely, if the preset area threshold is larger, the area of the polygon obtained by segmentation may be too large.
  • the preset area threshold value may be a preset value or a value calculated according to a preset ratio value and the polygon initially divided.
  • step 303 and the steps after step 303 may be performed.
  • the polygons that do not need to be further divided may be referred to as reference polygons.
  • Each tile has a unique tile ID.
  • the number of tiles obtained by the projection map segmentation is related to the tile level.
  • the number of tiles is related to the tile level as follows:
  • Num_tile represents the number of tiles
  • Level represents the tile level
  • level is a positive integer greater than or equal to 0.
  • a world map with a tile level of 0 has only one tile; a world map with a tile level of 1 is divided into four tiles, and the tile IDs of these four tiles can be (0,0), ( 0,1), (1,0) and (1,1).
  • the tile ID can be calculated according to the tile level and latitude and longitude.
  • the tile ID consists of two parts, tileX and tileY, and tileX can be determined according to the following formula:
  • Level represents the tile level
  • tileY can be determined according to the following formula:
  • lat represents the latitude
  • ln represents the logarithmic symbol with the constant e as the base
  • tan represents the tangent symbol
  • sec represents the secant symbol
  • represents the value of the pi.
  • the tile ID corresponding to the reference polygon may be determined according to the coordinates of each point in the reference polygon.
  • the corresponding relationship between the tile and the polygon may be determined according to the points and polygons in the tile.
  • the relationship between the point and the polygon in the tile may be determined by the vector product method, the area method, the angle sum method, etc., which is not limited in this embodiment of the present application.
  • JTS may be used to determine the correspondence between tiles and polygons.
  • JTS is an application programming interface (API) for processing geographic data in Java.
  • API application programming interface
  • JTS supports a complete set of binary predicate operations.
  • the binary predicate method takes two geometries as arguments and returns a boolean value indicating whether the geometries have the specified spatial relationship.
  • the spatial relationships it supports are: equals, disjoint, intersect, touches, crosses, within, contains, overlaps/overlaps ).
  • general relational operators are also supported.
  • Table 1 shows the correspondence between all reference polygons and tile IDs obtained by dividing the polygon A, and this correspondence may be referred to as total polygon index information.
  • the corresponding relationship between the reference polygon and the tile ID may be sent to a data node.
  • the correspondence between all reference polygons and tile IDs may be determined, and then the total polygon index information may be split into multiple polygon index information, and the Multiple polygon index information is sent to multiple data nodes.
  • the total polygon index information shown in Table 1 can be split into three polygon index information shown in Table 2, Table 3 and Table 4.
  • the three polygon index information shown in Tables 2 to 4 may be respectively sent to the three data nodes.
  • the polygon index information shown in Table 2 can be sent to the data node 102
  • the polygon index information shown in Table 3 can be sent to the data node 103, as shown in Table 4
  • the polygon index information can be sent to the data node 104 .
  • a data node can store received polygon index information.
  • each polygon corresponds to only one tile ID.
  • a polygon may correspond to multiple tile IDs. For example, one part of a polygon has a tile ID of 225,131 and another part has a tile ID of 225,132.
  • the routing information records the corresponding relationship between tile IDs and data nodes. Also take the distribution rules of Tables 2 to 4 above as an example.
  • the processing node may store routing information as shown in Table 5.
  • the routing information determined by the processing node can be sent to the routing node, so that the routing node can determine the data node corresponding to the coordinates input by the user according to the routing information.
  • the tile ID in the corresponding relationship between the tile ID and the data node as shown in Table 5 includes the tile X value and the tile Y value of the tile ID.
  • the corresponding relationship between the tile ID and the data node in the routing information may also include only one of tile X and tile Y of the tile ID.
  • the routing node may also be as shown in Table 6.
  • routing information shown in Table 5 and Table 6 may be part of the routing information determined by the processing node.
  • the processing node can divide a polygon corresponding to a country, province, city or administrative region into multiple polygons, and save the corresponding relationship between the polygon and the tile ID to different data nodes.
  • each POI also has corresponding coordinates.
  • the processing node can also determine the tile ID of the tile where the POI is located according to the coordinates of the POI, and send the correspondence between the POI and the tile ID to the corresponding data node.
  • POI 1 to POI 10 For example, suppose there are ten POIs, called POI 1 to POI 10. According to POI 1 to POI 10, it can be determined that POI 1 to POI 10 have the corresponding relationship as shown in Table 7.
  • the data nodes can also save the correspondence between POIs and tile IDs to different data nodes.
  • the correspondence between POI and tile ID shown in Table 6 can be split into three correspondences shown in Table 8, Table 9 and Table 10.
  • the correspondence between POIs and tile IDs shown in Table 8 can be saved to the data node 102, and the correspondence between POIs and tile IDs shown in Table 9 can be saved to the data node 103.
  • the POIs and tile IDs shown in Table 10 The correspondence between the slice IDs can be saved to the data node 104 .
  • the routing node and the data node can determine the geographic location information according to the coordinates input by the user.
  • FIG. 7 is a schematic flowchart of a positioning method provided according to an embodiment of the present application.
  • the terminal device obtains the coordinates.
  • the coordinates may be determined by a chip with a positioning function or a system on chip (SoC) in the terminal device.
  • SoC system on chip
  • the terminal device sends the coordinates to the routing node.
  • the routing node determines, according to the coordinates, a tile ID corresponding to the coordinates.
  • a tile ID corresponding to the coordinates may be referred to as a target tile ID.
  • the target tile ID is used to indicate the tile containing the coordinates.
  • the tile ID corresponding to the coordinates can be calculated according to formula 2 and formula 3 as 225,131.
  • the routing node determines, according to the target tile ID and routing information, a data node corresponding to the target tile ID.
  • the data node corresponding to the target tile ID may be referred to as a target data node.
  • the routing node may determine that the target data node corresponding to the tile ID (225, 131) is the data node 104 according to the routing information shown in Table 6.
  • the routing node may send a positioning request to the data node 104, where the positioning request includes the coordinates. Accordingly, the data node 104 receives the positioning request.
  • the data node 104 determines the target polygon according to the polygon index information, the target tile ID and the coordinates.
  • the data node 104 may determine the corresponding target tile ID according to the coordinates in the positioning request.
  • the routing node has already determined the target tile ID according to the coordinates when determining the target data node. Therefore, the location request sent by the routing node to the data node 104 may also carry the target tile ID. In this case, the data node 104 can use the target tile ID directly.
  • the data node 104 may determine a plurality of polygons according to the polygon index information and the target tile ID; and determine the target polygon according to the plurality of polygons and the coordinates, wherein the coordinates are within the range of the target polygon.
  • tile ID (225, 131) As described above, data node 104 holds polygon index information as shown in Table 4. According to the index information shown in Table 4, it can be determined that the polygons corresponding to the tile ID (225, 131) include polygon A41, polygon A42, polygon A43 and polygon A44. The data node 104 may then determine, in order, whether the coordinates 33.55, 69.57 are contained within each polygon's extent.
  • the data node 104 may sequentially determine whether coordinates 33.55 and 69.57 are included in the polygon range according to the polygon order in the index entry corresponding to the tile ID (225, 131) in the polygon index information.
  • the data node 104 may also determine the distances from the coordinates 33.55, 69.57 to the center point of each of the four polygons, and determine the distance between the coordinates and the center point of each polygon for the four polygons. Sort, where the closer the coordinates to the center point, the higher the ranking. The data node 104 then determines whether the polygon contains that coordinate in order from highest to lowest.
  • the distance from coordinates 33.55,69.57 to the center point of polygon A41 is DIST 41
  • the distance from coordinates 33.55,69.57 to the center point of polygon A42 is DIST 42
  • the distance from coordinates 33.55,69.57 to the center point of polygon A43 is DIST 43
  • the distance from the coordinates 33.55,69.57 to the center point of polygon A44 is DIST 44 .
  • DIST 43 ⁇ DIST 44 ⁇ DIST 42 ⁇ DIST 41
  • the ranking of polygons A41 to A44 from high to low is: polygon A43, polygon A44, polygon A42 and polygon A41.
  • the data node 104 can first determine whether the polygon A43 contains coordinates 33.55 and 69.57. If polygon A43 contains coordinates 33.55, 69.57, then polygon A43 is the target polygon. If polygon A43 does not contain coordinates 33.55, 69.57, then data node 104 can determine whether polygon A44 contains coordinates 33.55, 69.57; if data node 104 determines that polygon A44 does not contain coordinates 33.55, 69.57, then continue to determine whether polygon A42 contains coordinates 33.55, 69.57, and so on.
  • the four polygons corresponding to the tile IDs (225, 131) are all obtained by dividing one polygon A. Therefore, the AOI level of these four polygons is the same. If the AOI levels of the polygons corresponding to the tile IDs (225, 131) are different, the rank of the polygons with the higher rank is higher than the rank of the polygons with the lower rank.
  • the polygons corresponding to tile ID (225, 131) include: polygon A41, polygon A42, polygon A43, polygon A44, polygon B11, polygon B12, polygon B13, polygon C11 and polygon C12, where polygon C11 and polygon C12
  • the AOI level is level 1
  • the level of polygon B11, polygon B12 and polygon B13 is level 2
  • the level of polygon A41, polygon A42, polygon A43 and polygon A44 is level 3.
  • level 1 is the highest level
  • level 2 is lower than level 1
  • level 2 is higher than level 3.
  • polygons C11 and C12 rank higher than polygons B11, B12, and B13, which rank higher than polygons A41, A42, A43, and A44. If the number of polygons in the same level is greater than or equal to a preset value, then it is necessary to determine the distance from the center of each polygon to the coordinates, and then sort the polygons of the same level according to the distance. For example, assuming that the preset threshold is 3, polygons B11, B12, and B13 need to be sorted, and polygons A41, A42, A43, and A44 need to be sorted.
  • the order of polygon C11 and polygon C12 may be arbitrary.
  • the final sorting result of the above polygons is (ranked from high to low): C11, C12, B12, B11, B13, A43, A44, A42 and A41.
  • the data node 104 can first determine whether the polygon C11 contains coordinates 33.55 and 69.57. If polygon C11 contains coordinates 33.55, 69.57, then polygon C11 is the target polygon.
  • data node 104 can determine whether polygon C12 contains coordinates 33.55, 69.57; if data node 104 determines that polygon C12 does not contain coordinates 33.55, 69.57, then continue to determine whether polygon B12 contains coordinates 33.55, 69.57, and so on.
  • the AOI level may be related to the borough type of the polygon that initially needs to be segmented.
  • the AOI level of the country is lower than the AOI level of the province
  • the AOI level of the province is lower than the AOI level of the city
  • the AOI level of the city is lower than the AOI level of the district.
  • the AOI level may also be related to the area of the polygon that initially needs to be segmented. The smaller the area, the higher the AOI level.
  • the data node 104 sends positioning feedback to the routing node, where the positioning feedback includes geographic location information, where the geographic location information is used to describe the target polygon.
  • the target polygon determined according to the coordinates 33.55 and 69.57 is the polygon A43, and the polygon A43 is obtained by dividing the map of Afghanistan. Then the geographic location information used to describe the target polygon is: Afghanistan.
  • the positioning feedback may further include a target POI, and the target POI is a POI near the coordinate.
  • the data node can determine one or more POIs corresponding to the tile ID according to the corresponding relationship between the tile ID and the POI, and then determine the distance between each POI and the coordinate, if the distance between the POI and the coordinate is less than A preset threshold, then the POI can be used as the target POI.
  • the positioning feedback may not include the target POI or indicate that the target POI is not found.
  • it may occur that the distances from multiple POIs to the coordinate are all smaller than the preset threshold. In this case, the multiple POIs may all serve as the target POIs.
  • the routing node sends the positioning feedback to the terminal device.
  • different data nodes store different correspondences between tile IDs and polygons (ie, polygon index information).
  • the routing node stores the corresponding relationship between tile IDs and data nodes (ie, routing information).
  • the routing node can determine the corresponding tile ID according to the coordinates, and then determine the data node corresponding to the tile ID according to the routing information.
  • the routing node can send the received coordinates to a certain data node (hereinafter referred to as the target data node) without sending the coordinates to all data nodes in the system.
  • the target data node a certain data node
  • other data nodes do not need to participate in the calculation of determining the polygon corresponding to the coordinates.
  • the target data node can quickly determine the polygon containing the coordinates. In this way, the response speed of the reverse geographic search can be improved, and the user experience can be improved.
  • sorting is performed according to the AOI level and/or the distance from the coordinate to the center point, and then it is judged whether the polygon contains the coordinate according to the sorting result.
  • FIG. 8 is a schematic flowchart of a positioning method provided according to an embodiment of the present application. The method shown in FIG. 8 may be performed by a data node or a component in a data node.
  • the 802. Determine a target polygon corresponding to the coordinates according to the polygon index information, the coordinates, and the target area identifier corresponding to the coordinates, wherein the polygon index information is used to indicate the correspondence between the area identifier and the polygon, and the target area identifier is associated with the multi-point polygon.
  • the target polygon is one of a plurality of first polygons, and the plurality of first polygons are part or all of the polygons obtained by dividing a second polygon, and the coordinates are located at within the bounds of the target polygon.
  • the target area identifier corresponding to the coordinates can be calculated as 225, 131 according to formula 2 and formula 3.
  • the polygon index information may be index information as shown in Table 4.
  • the polygon A41, the polygon A42, the polygon A43 and the polygon A44 may be the first polygon, and the polygon A41, the polygon A42, the polygon A43 and the polygon A44 are obtained by dividing the polygon A4.
  • Polygon A4 may be a second polygon.
  • polygon A121, polygon A122, polygon A123, and polygon A124 may be the first polygon
  • polygon A12 may be the second polygon
  • the polygon A11, the polygon A13 and the polygon A14 may be the first polygon, and the polygon A1 may be the second polygon.
  • the geographic location information may be an AOI.
  • the geographic location described by the geographic location information may be the target polygon determined in step 802 .
  • each step of the method shown in FIG. 8 may refer to the embodiment shown in FIG. 7
  • the determination methods of polygon division, index and routing information may refer to the embodiment shown in FIG. 3 . Repeat.
  • FIG. 9 is a schematic diagram of a computer device provided according to an embodiment of the present application.
  • the computer device 900 shown in FIG. 9 may perform the steps performed by the routing nodes in the above-described embodiments.
  • the computer device 900 shown in FIG. 9 includes a receiving unit 901 , a processing unit 902 and a sending unit 903 .
  • the receiving unit 901 is configured to receive coordinates from a terminal device.
  • the processing unit 902 is used to determine the target data node corresponding to the target area identifier according to the routing information and the target area identifier corresponding to the coordinate, wherein the routing information is used to indicate the corresponding relationship between the area identifier and the data node, and the target area Identifier is used to indicate the area that contains this coordinate.
  • the sending unit 903 is configured to send a positioning request to the target data node, where the positioning request includes the coordinates.
  • the receiving unit 901 is further configured to receive positioning feedback from the target data node, where the positioning feedback includes geographic location information, where the geographic location information is used to describe the geographic location including the coordinates.
  • FIG. 9 is only an example and not a limitation, and the above-mentioned computer device including a receiving unit, a sending unit and a processing unit may not depend on the structure shown in FIG. 9 .
  • the chip When the computer device 900 is a chip, the chip includes a receiving unit, a sending unit and a processing unit.
  • the receiving unit and the sending unit may be an input and output circuit and a communication interface;
  • the processing unit is a processor or a microprocessor or an integrated circuit integrated on the chip.
  • FIG. 10 is a schematic diagram of another computer device provided according to an embodiment of the present application.
  • the computer device 1000 shown in FIG. 10 may perform the steps performed by the data nodes in the above-mentioned embodiments.
  • the computer device 1000 shown in FIG. 10 includes a receiving unit 1001 , a processing unit 1002 and a sending unit 1003 .
  • the receiving unit 1001 is configured to receive a positioning request from a routing node, where the positioning request includes coordinates.
  • the processing unit 1002 is configured to determine the target polygon corresponding to the coordinates according to the polygon index information, the coordinates and the target area identifier corresponding to the coordinates, wherein the polygon index information is used to indicate the corresponding relationship between the area identifier and the polygon, and the target polygon
  • the area identifier corresponds to a plurality of first polygons
  • the target polygon is one of the plurality of first polygons
  • the plurality of first polygons are parts obtained by dividing a second polygon or All polygons whose coordinates are within the bounds of the target polygon.
  • the sending unit 1003 is configured to send positioning feedback to the routing node, where the positioning feedback includes geographic location information, and the geographic location information is used to describe the target polygon.
  • FIG. 10 is only an example and not a limitation, and the above-mentioned computer device including a receiving unit, a sending unit and a processing unit may not depend on the structure shown in FIG. 10 .
  • the chip When the computer device 1000 is a chip, the chip includes a receiving unit, a sending unit and a processing unit.
  • the receiving unit and the sending unit may be an input and output circuit and a communication interface;
  • the processing unit is a processor or a microprocessor or an integrated circuit integrated on the chip.
  • FIG. 11 is a schematic diagram of another computer device provided according to an embodiment of the present application.
  • the computer device 1100 shown in FIG. 11 may perform the steps performed by the processing nodes in the above-described embodiments.
  • the computer device 1100 shown in FIG. 11 includes a processing unit 1101 and a sending unit 1102 .
  • the processing unit 1101 may be configured to divide the polygon to obtain multiple polygons.
  • the processing unit 1101 can also be used to determine whether each polygon in the divided polygons satisfies the preset condition; determine the correspondence between the polygons that satisfy the condition and the area identifier, and obtain the polygon index information; The polygons continue to be divided until a polygon that satisfies the condition is obtained.
  • the sending unit 1102 is configured to send the plurality of index information determined by the processing unit 1101 to the plurality of data nodes.
  • the processing unit 1101 is further configured to determine routing information.
  • the sending unit 1102 is further configured to send the routing information to the routing node.
  • processing unit 1101 and the sending unit 1102 For the specific functions and beneficial effects of the processing unit 1101 and the sending unit 1102, reference may be made to the descriptions of some embodiments of the above method, which are not repeated here for brevity.
  • FIG. 11 is only an example and not a limitation, and the above-mentioned computer device including a receiving unit, a sending unit and a processing unit may not depend on the structure shown in FIG. 11 .
  • the chip When the computer device 1100 is a chip, the chip includes a sending unit and a processing unit.
  • the sending unit may be an input/output circuit or a communication interface;
  • the processing unit may be a processor, a microprocessor or an integrated circuit integrated on the chip.
  • Embodiments of the present application also provide a computer device, including a processor and a memory.
  • the processor is coupled to the memory, and reads and executes the instructions and/or program codes in the memory, so as to execute the steps executed by the processing node in the above method embodiments.
  • Embodiments of the present application also provide a computer device, including a processor and a memory.
  • the processor is coupled to the memory, and reads and executes the instructions and/or program codes in the memory, so as to execute the steps executed by the routing node in the above method embodiments.
  • Embodiments of the present application also provide a computer device, including a processor and a memory.
  • the processor is configured to be coupled with the memory to read and execute instructions and/or program codes in the memory, so as to execute the steps executed by the data nodes in the above method embodiments.
  • the above-mentioned processor may be a chip.
  • the processor may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), or a It is a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller unit). , MCU), it can also be a programmable logic device (PLD), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or other integrated chips.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • MCU microcontroller unit
  • MCU programmable logic device
  • PLD programmable logic device
  • each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, detailed description is omitted here.
  • the processor in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability.
  • each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • the present application also provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on a computer, the computer is made to execute the processing node in the above embodiment. the various steps performed.
  • the present application also provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on a computer, the computer is made to execute the routing node in the above embodiment. the various steps performed.
  • the present application further provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on a computer, the computer is made to execute the data node in the above embodiment. the various steps performed.
  • the present application further provides a computer-readable medium, where the computer-readable medium stores program code, when the program code is executed on a computer, the computer is made to execute the processing node in the above-mentioned embodiment. the various steps performed.
  • the present application further provides a computer-readable medium, where program codes are stored in the computer-readable medium, and when the program codes are run on a computer, the computer is made to execute the data nodes in the above-mentioned embodiments. the various steps performed.
  • the present application further provides a computer-readable medium, where program codes are stored in the computer-readable medium, and when the program codes are run on a computer, the computer is made to execute the routing node in the above-mentioned embodiments. the various steps performed.
  • the present application further provides a system, which includes the aforementioned processing node, one or more routing nodes, and multiple data nodes.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and 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 in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

Abstract

一种定位方法和相关装置,该方法包括:接收来自于终端设备的坐标;根据路由信息和对应该坐标的目标区域标识,确定对应于该目标区域标识的目标数据节点;向该目标数据节点发送定位请求,该定位请求包括该坐标;接收来自于该目标数据节点的定位反馈。通过上述方法,路由节点可以将接收到的坐标发送至确定的目标数据节点,而无需将坐标发送至系统中的所有数据节点。除目标数据节点外,其他数据节点无需参与到确定与坐标对应的多边形的计算中。这样,可以减少整个系统的功率消耗。该目标数据节点可以较快地确定出包含有该坐标的多边形。这样,可以提高逆地理搜索的响应速度,提高用户体验。

Description

定位方法和相关装置
本申请要求于2021年04月20日提交中国专利局、申请号为202110426810.3、申请名称为“定位方法和相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子地图领域,更具体地,涉及一种定位方法和相关装置。
背景技术
逆地理搜索可以实现根据坐标(例如经纬度)确定位置信息的功能。例如,输入经纬度(39.991366,116.25952),返回的逆地理搜索结果可以包括:北坞公园西门;北坞村路;海淀区;北京市;中国。
逆地理搜索的应用场景非常广泛。基于位置的服务(location based service,LBS)是逆地理搜索的最为常见的一个应用场景。LBS通过用户上传的坐标,确定用户的位置,从而可以为用户提供相应的服务。例如,为用户推荐附件的商场、餐馆、咖啡馆等;确定用户的当前位置以便于网约车司机找到用户等。
逆地理搜索的响应速度对用户体验的影响很大。响应速度越快,用户体验越好。因此,业界希望能够提高逆地理搜索的响应速度。
发明内容
本申请提供一种定位方法和相关装置,可以提高逆地理搜索的响应速度。
第一方面,本申请实施例提供一种定位方法,该方法包括:接收来自于终端设备的坐标;根据路由信息和对应该坐标的目标区域标识,确定对应于该目标区域标识的目标数据节点,其中该路由信息用于指示区域标识和数据节点的对应关系,该目标区域标识用于指示包含该坐标的区域;向该目标数据节点发送定位请求,该定位请求包括该坐标;接收来自于该目标数据节点的定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述包含该坐标的地理位置。
上述技术方案中,不同的数据节点保存有不同的区域标识和多边形的对应关系(即多边形索引信息)。路由节点保存有区域标识和数据节点的对应关系(即路由信息)。这样,当路由节点接收到来自于终端设备的坐标后,可以根据坐标确定对应的目标区域标识,进而根据路由信息确定与该目标区域标识对应的目标数据节点。这样,路由节点可以将接收到的坐标发送至确定的目标数据节点,而无需将坐标发送至系统中的所有数据节点。除目标数据节点外,其他数据节点无需参与到确定与坐标对应的多边形的计算中。这样,可以减少整个系统的功率消耗。此外,由于目标数据节点保存的多边形是经过分割后得到的较小的多边形,因此该目标数据节点可以较快地确定出包含有该坐标的多边形。这样,可以 提高逆地理搜索的响应速度,提高用户体验。
结合第一方面,在第一方面的一种可能的实现方式中,该路由信息包括多个索引以及与各个索引对应的数据节点的标识,其中该多个索引中的每个索引为一个区域标识或者一个区域标识范围。在此情况下,根据路由信息和该目标区域标识,确定对应于该目标区域标识的目标数据节点,包括:从该多个索引中确定与该目标区域标识匹配的目标索引;确定与该目标索引对应的数据节点为该目标数据节点。
结合第一方面,在第一方面的一种可能的实现方式中,该定位反馈还包括至少一个信息点POI,该坐标与该至少一个POI中的每个POI之间的距离小于预设阈值。
第二方面,本申请实施例提供一种定位方法,该方法包括:接收来自于路由节点的定位请求,该定位请求包括坐标;根据多边形索引信息、该坐标和对应于该坐标的目标区域标识,确定该坐标对应的目标多边形,其中,该多边形索引信息用于指示区域标识和多边形的对应关系,该目标区域标识与多个第一多边形对应,该目标多边形为该多个第一多边形中的一个,该多个第一多边形是对一个第二多边形进行分割得到的部分或全部多边形,该坐标位于该目标多边形的范围内;向该路由节点发送定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述包含该坐标的地理位置。
上述实施例中,第一多边形是对第二多边形分割得到的。多边形面积越小,判断坐标在该多边形的范围内的速度就越快。因此,上述技术方案可以提高逆地理搜索的响应速度。
结合第二方面,在第二方面的一种可能的实现方式中,该多边形索引信息包括多个索引以及与各个索引对应的第一多边形,其中该多个索引中的每个索引为一个区域标识;该根据多边形索引信息、该目标区域标识和该坐标,确定目标多边形,包括:从该多个索引中确定与该目标区域标识匹配的目标索引;对与该目标索引对应的该多个第一多边形进行排序;根据排序结果和该坐标,确定该目标多边形。
结合第二方面,在第二方面的一种可能的实现方式中,该对与该目标索引对应的该多个第一多边形进行排序,包括:根据该多个第一多边形的信息区域AOI级别,对该多个第一多边形进行排序,其中AOI级别较高的第一多边形的排名高于AOI级别较低的第一多边形排名。多边形的AOI级别越高,多边形的面积就越小;多边形面积越小,判断坐标在该多边形的范围内的速度就越快。因此,上述技术方案可以更进一步提高逆地理搜索的响应速度。
结合第二方面,在第二方面的一种可能的实现方式中,该对与该目标索引对应的该多个第一多边形进行排序,还包括:确定该多个第一多边形中的N个AOI级别相同的第一多边形,其中N为大于或等于2的正整数;根据N个AOI级别相同的第一多边形中的每个参考区域的中心点到该坐标的距离,对该N个AOI级别相同的第一多边形进行排序,其中,该N个AOI级别相同的第一多边形中中心点到该坐标距离较近的第一多边形的排名高于中心点到该坐标较远的第一多边形的排名。通常情况下,坐标到某一多边形的中心点的距离越近,该坐标属于该多边形的概率越大。因此,上述技术方案可以更进一步提高逆地理搜索的响应速度。
结合第二方面,在第二方面的一种可能的实现方式中,该根据排序结果和该坐标,确定该目标多边形,包括:从该多个第一多边形中的排名最高的第一多边形起,依次判断该第一多边形是否包含该坐标,直到确定出该目标多边形。
结合第二方面,在第二方面的一种可能的实现方式中,在该向该路由节点发送定位反馈之前,该方法还包括:确定该目标数据节点中是否包括目标信息点POI,其中该目标POI为与该坐标距离小于预设阈值的POI;在该目标数据节点中包括该目标POI的情况下,该定位反馈还包括该目标POI。
结合第二方面,在第二方面的一种可能的实现方式中,该第二多边形的边界点数量大于预设边界点数量阈值,该第一多边形的边界点数量小于或等于该预设边界点数量阈值;或者
该第二多边形的边界点数量大于该预设边界点数量阈值且该第二多边形的面积大于预设面积阈值,该第一多边形的边界点数量小于或等于该预设边界点数量阈值,或者,该第一多边形的面积小于或等于该预设面积。
结合第二方面,在第二方面的一种可能的实现方式中,该多个第一多边形是根据该第二多边形的外接图形的中心点,对该第二多边形进行分割得到的部分或全部多边形。
结合第二方面,在第二方面的一种可能的实现方式中,该外接图形为正多边形、梯形、平行四边形,或者圆形,其中该外接正多边形的边数小于或等于8。
结合第二方面,在第二方面的一种可能的实现方式中,该目标区域标识为与该目标多边形对应的至少一个区域标识中的一个。
第三方面,本申请实施例提供一种计算机设备,该计算机设备包括用于实现第一方面或第一方面的任一种可能的实现方式的单元。
第四方面,本申请实施例提供一种计算机设备,该计算机设备包括用于实现第二方面或第二方面的任一种可能的实现方式的单元。
第五方面,本申请实施例提供一种计算机设备,该计算机设备包括处理器,该处理器用于与存储器耦合,读取并执行该存储器中的指令和/或程序代码,以执行第一方面或第一方面的任一种可能的实现方式。
第六方面,本申请实施例提供一种计算机设备,该计算机设备包括处理器,该处理器用于与存储器耦合,读取并执行该存储器中的指令和/或程序代码,以执行第二方面或第二方面的任一种可能的实现方式。
第七方面,本申请实施例提供一种芯片系统,该芯片系统包括逻辑电路,该逻辑电路用于与输入/输出接口耦合,通过该输入/输出接口传输数据,以执行第一方面或第一方面任一种可能的实现方式。
第八方面,本申请实施例提供一种芯片系统,该芯片系统包括逻辑电路,该逻辑电路用于与输入/输出接口耦合,通过该输入/输出接口传输数据,以执行第二方面或第二方面任一种可能的实现方式。
第九方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有程序代码,当该计算机存储介质在计算机上运行时,使得计算机执行如第一方面或第一方面的任一种可能的实现方式。
第十方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有程序代码,当该计算机存储介质在计算机上运行时,使得计算机执行如第二方面或第二方面的任一种可能的实现方式。
第十一方面,本申请实施例提供一种计算机程序产品,该计算机程序产品包括:计算 机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行如第一方面或第一方面的任一种可能的实现方式。
第十二方面,本申请实施例提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行如第二方面或第二方面的任一种可能的实现方式。
附图说明
图1是根据本申请实施例提供的一种可能的应用场景的示意图。
图2是根据本申请实施例提供的定位方法的示意性流程图。
图3是根据申请实施例提供的一种确定地图索引的方法的示意性流程图。
图4示出了一个多边形A的示意图。
图5示出了四种对多边形A进行分割的结果示意图。
图6是对多边形A的最终分割结果示意图。
图7是根据本申请实施例提供的一种定位方法的示意性流程图。
图8是根据本申请实施例提供的一种定位方法的示意性流程图。
图9是根据本申请实施例提供的一种计算机设备的示意图。
图10是根据本申请实施例提供的另一种计算机设备的示意图。
图11是根据本申请实施例提供的另一种计算机设备的示意图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
为了便于本领域技术人员更好地理解本申请的技术方案,首先对本申请涉及的一些相关技术和概念进行简单介绍。
1,地图投影
地图投影就是指建立地球表面(或其他星球表面或天球面)上的点与投影平面(即地图平面)上点之间的一一对应关系的方法,即建立之间的数学转换公式。它将作为一个不可展平的曲面(例如地球表面)投影到一个平面的基本方法,保证了空间信息在区域上的联系与完整。这个投影过程将产生投影变形,而且不同的投影方法具有不同性质和大小的投影变形。
常用的投影方法有墨卡托投影、高斯-克吕格投影、斜轴等面积方位投影、双标准纬线等角圆锥投影、等差分纬线多圆锥投影、正轴方位投影等。
墨卡托投影是一种等角正切圆柱投影,由荷兰地图学家墨卡托(Gerhardus Mercator)在1569年拟定。
墨卡托投影的“等角”特性,保证了对象的形状的不变形,正方形的物体投影后不会变为长方形。“等角”也保证了方向和相互位置的正确性,因此在航海和航空中常常应用,使得人们查询地物的方向时不会出错。
墨卡托投影的“圆柱”特性,保证了南北(纬线)和东西(经线)都是平行直线,并且相互垂直。而且经线间隔是相同的,纬线间隔从标准纬线(此处是赤道,也可能是其他纬线)向两级逐渐增大。
在实际应用中为了便于计算,部分厂商(例如谷歌、百度等)采用的是墨卡托投影的变种——网络墨卡托投影(web墨卡托投影)。它接收的输入是世界大地测量系统(word geodetic system,WGS)84坐标系的经纬度,但在投影时不再把地球当做椭球而当做半径为6378137米的标准球体,以简化计算。
2,地球坐标系统
地球坐标系既可以以笛卡尔坐标的形式表达,也可以采用大地坐标的形式表达。
以笛卡尔坐标表达的地球坐标系被称为空间直角坐标系,其X轴通常指向某一起始子午面,Z轴与地球自转轴平行或重合,Y轴则与X轴和Z轴向垂直。
以大地坐标表达的地球坐标系被称为空间大地坐标系,也可简称为大地坐标系或者地理坐标系。空间大地坐标系使用大地纬度、大地经度和大地高来描述物体的空间位置。
因为大地水准面并不规则,地球上不同地区往往需要使用不同的参考椭球体(reference ellipsoid),来尽可能适合当地的大地水准面。
参考椭球体是一个数学上定义的地球表面,它近似于大地水准面。因为是几何模型,可以用长半轴、短半轴和扁率来确定。大地纬度、大地经度和大地高都以此为基础。
北京54坐标系使用的是克拉索夫斯基(Krasovsky)1940的参考椭球,西安80坐标系使用的是1975年国际大地测量与地球物理联合会第16届大会推荐的参考椭球。当前世界范围内更普遍使用的是WGS所定义的参考椭球。
大地纬度、大地经度和大地高可以标示地球上的任何一个位置。如前所述,不同地区可能会使用不同的参考椭球体,即使是使用相同的椭球体,也可能会为了让椭球体更好地吻合当地的大地水准面,而调整椭球体的方位,甚至大小。这就需要使用不同的大地测量系统(geodetic datum)来标识。因此,对于地球上某一个位置来说,使用不同的大地测量系统,得到的坐标是不一样的。
前面提到的北京54坐标系和西安80坐标系是常用的两种坐标系统。除此之外,常见的坐标系统还包括WGS 84坐标系、国家测绘局02号标准(GCJ-02)坐标系、百度(baidu,BD)-09坐标系等。
3,信息区域和信息点
信息区域(area of information,AOI)可以是一个行政区、国家、城市等。AOI可以用一个多边形(由多边形的边界点经纬度坐标构成)表示。
信息点(point of information,POI)可以是一个建筑、商铺、公交站等,用一个经纬度坐标来标识位置。
例如经纬度(39.991366,116.25952)对应的POI可以是北坞公园西门;对应的AOI可以是北坞村路;海淀区;北京市;中国。
图1是根据本申请实施例提供的一种可能的应用场景的示意图。如图1所示,定位系统100包括路由节点101,数据节点102至104和处理节点105。终端设备110将获取到的坐标(例如经纬度)发送至定位系统100中的路由节点101。路由节点101将该坐标转发至多个数据节点中的一个。接收到坐标的数据节点根据该坐标确定位置信息,并将该位置信息发送至路由节点101,路由节点101将该位置信息发送至终端设备110。处理节点105负责构建索引信息并将构建的索引信息分发给相应的数据节点,以便于数据节点根据该索引信息确定位置信息。
可以理解的是,如图1所示的定位系统100仅是一个定位系统的示例。本申请实施例对定位系统中包括的路由节点和处理节点的数目并没有限定。例如,在另一些实施例中,定位系统可以包括多个路由节点和/或多个处理节点。本申请实施例中的数据节点的数目可以是大于或等于2的正整数。例如,在另一些实施例中,定位系统可以包括两个或者三个以上的数据节点。
本申请实施例中所称的终端设备可以是任何具有定位功能的终端设备,例如可以是手机、平板电脑、笔记本电脑、智能手表等。
图2是根据本申请实施例提供的定位方法的示意性流程图。如图2所示,该定位方法可以分为离线部分和在线部分。
离线部分包括步骤201至步骤203,其中步骤201至步骤203可以由处理节点或者处理节点中的部件(例如芯片或者电路等)实现。
在线部分包括步骤204至步骤208,其中步骤204和步骤205可以由路由节点或路由节点中的部件(例如芯片或电路等)实现,步骤206至步骤208可以由数据节点实现。
下面,分别对处理节点、路由节点和数据节点的功能进行介绍。为了便于描述,以下实施例中假设使用根据web墨卡托投影得到的投影地图。
根据web墨卡托投影得到的投影地图可以划分为多个区域。对根据web墨卡托投影得到的投影地图分割得到的区域可以称为瓦片。用于标识瓦片的标识可以称为瓦片标识(ID)或者瓦片坐标。
本领域技术人员可以理解对投影地图进行分割得到的地图区域也可以有其他称呼。因此,以下实施例中的瓦片一词也可以替换为区域、地图区域、地图单元、地图块等。相应的,瓦片ID也可以替换为地图单元坐标、地图块坐标等。此外,区域标识可以是对地图区域进行geohash编码得到与该区域对应的geohash。
类似的,以下实施例中假设基于的坐标系是WGS 84坐标系。WGS 84坐标系中的坐标用经纬度。可以理解,以下实施例中的坐标也可以替换为笛卡尔坐标系中的坐标。
图3是根据申请实施例提供的一种确定地图索引的方法的示意性流程图。如图3所示的方法可以由处理节点或者处理节点中的部件实现。
301,对多边形A进行分割,得到多个多边形。
多边形A可以是一个行政区、一个国家或者一个城市。例如,图4示出了一个多边形A。
对多边形A进行分割的方式可以有多种。例如,可以根据多边形A的外接图形的中心点对该多边形A进行划分。多边形A的外接图形可以是边数小于或等于8的正多边形(例如矩形、正六边形等)。多边形A的外接图形还可以是梯形、平行四边形或者圆形等。
又如,可以根据多边形A的外接图形的边的中点对该多边形A进行划分。
又如,可以将多边形A进行等分,得到多个第一多边形。
图5示出了四种对多边形A进行分割的结果。
如图5中的(a)是根据多边形A的外接矩形的中心,对该多边形A进行分割,得到了四个多边形,分别为多边形A1、多边形A2、多边形A3和多边形A4。
如图5中的(b)是根据多边形A的外接矩形的短边的中心,对该多边形A进行分割,得到了两个多边形,分别为多边形A1和多边形A2。
如图5中的(c)是根据多边形A的外接矩形的长边的中心,对该多边形A进行分割,得到了第二多边形。
如图5中的(d)是将多边形A的外接矩形进行等分后得到的四个第一多边形。该四个四个多边形,分别为多边形A1、多边形A2、多边形A3和多边形A4。
302,确定分割得到的多个多边形中的每个多边形是否满足预设条件。对于满足预设条件的多边形,可以执行步骤303及步骤303以后的步骤。对于不满足条件的多边形,则继续进行分割,直到得到满足预设条件的多边形。对不满足条件的多边形进行分割的方式与对多边形A进行分割的方式相同。继续分割的方式与最初分割的方式可以相同也可以不相同。
图6是对多边形A的最终分割结果。图6是在如图5中的(a)所示的分割结果的基础上,继续分割得到的。
如图6所示,多边形A1不满足预设条件。因此多边形A1被继续分割,得到多边形A11、多边形A12、多边形A13和多边形A14。多边形A11、多边形A13和多边形A14满足预设条件。因此多边形A11、多边形A13和多边形A14不需要被继续分割。多边形A12不满足预设条件。因此多边形A12被继续分割为多边形A121、多边形A122、多边形A123和多边形A124。
多边形A2也不满足预设条件。因此,多边形A2被继续分割,得到多边形A21、多边形A22、多边形A23和多边形A24。多边形A21、多边形A22、多边形A23和多边形A24满足预设条件,因此不需要被继续分割。
多边形A3也不满足预设条件。因此,多边形A3被继续分割,得到多边形A31、多边形A32、多边形A33和多边形A34。多边形A31、多边形A32、多边形A33和多边形A34满足预设条件,因此不需要被继续分割。
多边形A4也不满足预设条件。因此,多边形A4被继续分割,得到多边形A41、多边形A42、多边形A43和多边形A44。多边形A41、多边形A42、多边形A43和多边形A44满足预设条件,因此不需要被继续分割。
综上所述,对如图4所示的多边形A的最终分割结果包括:多边形A11、多边形A13、多边形A14、多边形A21、多边形A22、多边形A23、多边形A24、多边形A31、多边形A32、多边形A33、多边形A34、多边形A41、多边形A42、多边形A43、多边形A44、多边形121、多边形A122、多边形A123和多边形A124,共计19个多边形。
可选的,在一些实施例中,用于判断多边形是否需要继续分割的预设条件是:判断多边形包括的边界点数量是否小于或等于预设边界点数量阈值。如果多边形的边界点数量大于该预设边界点数量阈值,则确定该多边形不满足该预设条件;如果多边形的边界点数量小于或等于该预设边界点数量阈值,则确定该多边形满足该预设条件。
可选的,在另一些实施例中,用于判断多边形是否需要继续分割的预设条件是:判断多边形包括的边界点数量是否小于或等于预设边界点数量阈值以及确定多边形的面积是否小于预设面积阈值。如果多边形的边界点数量大于该预设边界点数量阈值并且多边形的面积大于该预设面积阈值,则确定该多边形不满足该预设条件。如果多边形的边界点数量小于或等于该预设边界点数量阈值或者多边形的面积小于或等于该预设面积阈值,则确定该多边形满足该预设条件。
可选的,在另一些实施例中,用于判断多边形是否需要继续分割的预设条件是:判断多边形的面积是否小于或等于预设面积阈值。如果多边形的面积大于该预设面积阈值,则确定该多边形不满足该预设条件。如果多边形的面积小于或等于该预设面积阈值,则确定该多边形满足该预设条件。
可以理解的是,预设边界点数量阈值过大或过小都会影响最终的确定结果。如果预设边界点数量阈值越少,那么就有越多的多边形需要被继续分割,这样离线处理时间会相应增加,而且确定的与用户输入的坐标对应的多边形数量会相应增加,从而使得反馈结果的时间增加。相反地,如果预设边界点数量阈值越多,那么可能出现分割得到的多边形面积过大。这样,可能会增加判断包含用户输入的坐标的难度,从而使得反馈结果的时间增加。
上述预设边界点数量阈值可以是大于或等于4且小于或等于1000的正整数。可选的,在一些实施例中,预设边界点数量阈值可以是大于或等于100且小于或等于300的正整数。例如,可以是200、180、220等。
类似的,预设面积阈值过大或过小都会影响最终的确定结果。如果预设面积阈值越小,那么就有越多的多边形需要被继续分割,这样离线处理时间会相应增加,而且确定的与用户输入的坐标对应的多边形数量会相应增加,从而使得反馈结果的时间增加。相反地,如果预设面积阈值越大,那么可能出现分割得到的多边形面积过大。预设面积阈值可以是一个预设的数值或者是根据一个预设比例值和最初分割的多边形计算得到的数值。
如上所述,对于满足预设条件的多边形,可以不需要对该多边形继续分割;对于不满足预设条件的多边形,需要继续分割,直到得到满足该预设条件的多边形。
对于不需要继续分割的多边形,可以执行步骤303及步骤303以后的步骤。为了便于描述,可以将不需要继续分割的多边形称为参考多边形。
303,确定参考多边形和瓦片ID的对应关系。
每个瓦片有唯一的瓦片ID。投影地图分割得到的瓦片数量与瓦片等级有关。瓦片的数量与瓦片等级有如下关系:
Num_tile=4 Level,  (公式1)
其中Num_tile表示瓦片数量,Level表示瓦片等级,level为大于或等于0的正整数。
例如,瓦片等级为0的世界地图只有一个瓦片;瓦片等级为1的世界地图被分为四个瓦片,这四个瓦片的瓦片ID可以分别为(0,0)、(0,1)、(1,0)和(1,1)。
瓦片ID可以根据瓦片等级和经纬度计算得到。瓦片ID包括两部分,tileX和tileY,tileX可以根据以下公式确定:
Figure PCTCN2022086658-appb-000001
其中lng表示经度,Level表示瓦片等级。
tileY可以根据以下公式确定:
Figure PCTCN2022086658-appb-000002
其中,lat表示纬度,ln表示以常数e为底数的对数符号,tan表示正切符号,sec表示正割符号,π表示圆周率的值。
可以看出,根据公式2和公式3,如果地球上一个点的经纬度和瓦片等级是确定的, 那么就可以确定出该点所在的瓦片ID。
在一些实施例中,可以根据参考多边形中的每个点的坐标确定出参考多边形对应的瓦片ID。
在另一些实施例中,可以根据瓦片中的点和多边形,来确定该瓦片与多边形的对应关系。确定瓦片中的点和多边形的关系可以用向量积法、面积法、角度和法等,本申请实施例对此并不限定。
在另一些实施例中,可以使用JTS确定瓦片和多边形的对应关系。JTS是Java的处理地理数据的应用程序接口(application programming interface,API)。JTS支持一套完整的二元谓词操作。二元谓词方法将两个几何图形作为参数,返回一个布尔值来表示几何图形是否有指定的空间关系。它支持的空间关系有:相等(equals)、分离(disjoint)、相交(intersect)、相接(touches)、交叉(crosses)、包含于(within)、包含(contains)、覆盖/覆盖于(overlaps)。同时,也支持一般的关系(relate)操作符。
假设如图6所示的参考多边形和瓦片ID有如表1所示的对应关系。
表1
瓦片ID 多边形
223,132 A11,A13
223,131 A31,A33
224,132 A121,A122,A123,A124,A14
224,131 A32,A34
225,132 A21,A23
225,131 A41,A42,A43,A44
226,132 A22,A24
如表1示出了对多边形A分割后得到的所有参考多边形和瓦片ID的对应关系,这个对应关系可以称为总多边形索引信息。
304,将多边形索引信息分发给不同的数据节点。
可选的,在一些实施例中,可以在每确定出一个参考多边形和瓦片ID的对应关系后,将该参考多边形和瓦片ID的对应关系发送至一个数据节点中。
可选的,在另一些实施例中,可以在确定出所有参考多边形和瓦片ID的对应关系(即总多边形索引信息),再将总多边形索引信息分拆为多个多边形索引信息,将该多个多边形索引信息发送至多个数据节点中。
还以如表1所示的总多边形索引信息为例。如表1所示的总多边形索引信息可以分拆为如表2,表3和表4所示的三个多边形索引信息。
表2
瓦片ID 多边形
223,132 A11,A13
223,131 A31,A33
表3
瓦片ID 多边形
224,132 A121,A122,A123,A124,A14
224,131 A32,A34
表4
瓦片ID 多边形
225,132 A21,A23
225,131 A41,A42,A43,A44
226,132 A22,A24
如表2至表4所示的三个多边形索引信息可以分别发送至三个数据节点。还以如图1所示的系统100为例,如表2所示的多边形索引信息可以发送至数据节点102,如表3所示的多边形索引信息可以发送至数据节点103,如表4所示的多边形索引信息可以发送至数据节点104。数据节点可以保存接收到的多边形索引信息。
表1所示的多边形索引信息中,每个多边形只与一个瓦片ID对应。在另一些实施例中,可能出现一个多边形与多个瓦片ID对应的情况。例如,一个多边形的一部分的瓦片ID为225,131,另一部分的瓦片ID为225,132。
305,确定路由信息并将路由信息发送至路由节点。
该路由信息记录了瓦片ID和数据节点的对应关系。还以上述表2至表4的分发规则为例。处理节点可以保存如表5所示的路由信息。
表5
Figure PCTCN2022086658-appb-000003
处理节点确定的路由信息可以发送至路由节点,以便于路由节点根据该路由信息确定出与用户输入的坐标对应的数据节点。
如表5所示的瓦片ID和数据节点的对应关系中的瓦片ID包括瓦片ID的tile X值和tile Y值。在另一些实施例中,路由信息中的瓦片ID和数据节点的对应关系中也可以仅包括瓦片ID的tile X和tile Y中的一个。例如,路由节点还可以如表6所示。
表6
Figure PCTCN2022086658-appb-000004
可以理解的是,如表5和表6所示的路由信息可以是处理节点确定的路由信息的一部分。
处理节点通过离线计算,可以将一个对应于一个国家、省、城市或者行政区等的多边形划分为多个多边形,并将多边形和瓦片ID的对应关系分别保存至不同的数据节点。
此外,如上所述,每个POI也有对应的坐标。处理节点还可以根据POI的坐标,确定出该POI所在的瓦片的瓦片ID,并将POI和瓦片ID的对应关系发送至对应的数据节点。
例如,假设存在十个POI,分别称为POI 1至POI 10。根据POI 1至POI 10可以确定出POI 1至POI 10存在如表7所示的对应关系。
表7
Figure PCTCN2022086658-appb-000005
类似的,数据节点也可以将POI和瓦片ID的对应关系保存至不同的数据节点。例如如表6所示的POI和瓦片ID的对应关系可以分拆为如表8、表9和表10所示的三个对应关系。
表8
瓦片ID POI
223,132 POI 1
223,131 POI 2
表9
瓦片ID POI
224,131 POI 4
224,132 POI 3
表10
瓦片ID POI
225,132 POI 5
225,131 POI 6,POI7
226,132 POI 8,POI 9,POI 10
如表8所示的POI和瓦片ID对应关系可以保存至数据节点102,如表9所示的POI和瓦片ID的对应关系可以保存至数据节点103,如表10所示的POI和瓦片ID的对应关系可以保存至数据节点104。
在完成了如图3所示的离线计算后,路由节点和数据节点可以根据用户输入的坐标确定地理位置信息。
图7是根据本申请实施例提供的一种定位方法的示意性流程图。
701,终端设备获取坐标。
该坐标可以是终端设备中具有定位功能的芯片或者片上系统(system on chip,SoC)等确定的。
702,终端设备将该坐标发送至路由节点。
703,路由节点根据该坐标,确定对应于该坐标的瓦片ID。为了便于描述,可以将对应于该坐标的瓦片ID称为目标瓦片ID。该目标瓦片ID用于指示包含该坐标的瓦片。
还以web墨卡托投影和WGS 84坐标系为例,假设终端设备确定的坐标的经纬度分别为33.55,69.57,那么可以根据公式2和公式3计算出与该坐标对应的瓦片ID为225,131。
704,路由节点根据该目标瓦片ID和路由信息,确定出与该目标瓦片ID对应数据节点。为了便于描述,可以将与该目标瓦片ID对应的数据节点称为目标数据节点。
假设路由节点确定出的瓦片ID为225,131。该路由节点可以根据如表6所示的路由信息,确定出与该瓦片ID(225,131)对应的目标数据节点为数据节点104。
705,路由节点可以向数据节点104发送定位请求,该定位请求包括该坐标。相应的,数据节点104接收该定位请求。
706,数据节点104根据多边形索引信息、目标瓦片ID和该坐标,确定出目标多边形。
可选的,在一些实施例中,数据节点104可以根据定位请求中的坐标,确定对应的目标瓦片ID。
可选的,在另一些实施例中,路由节点在确定目标数据节点时已经根据该坐标确定了目标瓦片ID。因此该路由节点向数据节点104发送的定位请求中也可以携带该目标瓦片ID。在此情况下,数据节点104可以直接使用该目标瓦片ID。
数据节点104可以根据该多边形索引信息和目标瓦片ID,确定多个多边形;根据该多个多边形和该坐标,确定该目标多边形,其中该坐标在该目标多边形的范围内。
还以瓦片ID(225,131)为例。如上所述,数据节点104保存如表4所示的多边形 索引信息。根据如表4所示的索引信息,可以确定与瓦片ID(225,131)对应的多边形包括多边形A41、多边形A42、多边形A43和多边形A44。然后,数据节点104可以按照顺序确定每个多边形的范围内是否包含坐标33.55,69.57。
可选的,在一些实施例中,数据节点104可以按照多边形索引信息中的与瓦片ID(225,131)对应的索引条目中的多边形顺序依次确定多边形范围内是否包含坐标33.55,69.57。
可选的,在另一些实施例中,数据节点104还可以确定坐标33.55,69.57到上述四个多边形中每个多边形中心点的距离,根据坐标到各个多边形的中心点的距离对上述四个多边形进行排序,其中坐标到中心点的距离越近,排名越高。然后数据节点104按照排名从高到低确定多边形是否包含该坐标。例如,假设坐标33.55,69.57到多边形A41的中心点的距离为DIST 41,坐标33.55,69.57到多边形A42的中心点的距离为DIST 42,坐标33.55,69.57到多边形A43的中心点的距离为DIST 43,坐标33.55,69.57到多边形A44的中心点的距离为DIST 44。假设,DIST 43<DIST 44<DIST 42<DIST 41。那么,多边形A41至多边形A44排名由高到低依次为:多边形A43、多边形A44、多边形A42和多边形A41。在此情况下,数据节点104可以先判断多边形A43中是否包含坐标33.55,69.57。如果多边形A43中包含坐标33.55,69.57,那么多边形A43即为该目标多边形。如果多边形A43不包含坐标33.55,69.57,那么数据节点104可以确定多边形A44是否包含坐标33.55,69.57;如果数据节点104确定多边形A44也不包含坐标33.55,69.57,那么继续确定多边形A42是否包含坐标33.55,69.57,以此类推。
如表4所示的与瓦片ID(225,131)对应的四个多边形都是从一个多边形A中分割得到的。因此,这四个多边形的AOI级别相同。如果与瓦片ID(225,131)对应的多个多边形的AOI级别不同,那么级别高的多边形的排名高于级别低的多边形的排名。例如,假设与瓦片ID(225,131)对应的多边形包括:多边形A41、多边形A42、多边形A43、多边形A44、多边形B11、多边形B12、多边形B13、多边形C11和多边形C12,其中多边形C11和多边形C12的AOI级别为级别1,多边形B11、多边形B12和多边形B13的级别为级别2,多边形A41、多边形A42、多边形A43和多边形A44的级别为级别3。假设级别1的级别最高,级别2的级别低于级别1,且级别2的级别高于级别3。那么多边形C11和多边形C12的排名高于多边形B11、多边形B12和多边形B13的排名,多边形B11、多边形B12和多边形B13的排名高于多边形A41、多边形A42、多边形A43和多边形A44的排名。如果同一级别中的多边形数目大于或等于一个预设值,那么需要确定每个多边形的中心到坐标的距离,然后根据距离对同一级别的多边形排序。例如,假设该预设阈值为3,那么需要对多边形B11、多边形B12和多边形B13进行排序,多边形A41、多边形A42、多边形A43和多边形A44进行排序。可以看出,由于级别1的多边形数目少于该预设阈值,因此可以不需要按照中心点到坐标的距离对多边形C11和多边形C12进行排序。多边形C11和多边形C12的顺序可以是任意的。假设上述多边形最终的排序结果为(排名由高到低):C11,C12,B12,B11,B13,A43,A44,A42和A41。数据节点104可以先判断多边形C11中是否包含坐标33.55,69.57。如果多边形C11中包含坐标33.55,69.57,那么多边形C11即为该目标多边形。如果多边形C11不包含坐标33.55,69.57,那么数据节点104可以确定多边形C12是否包含坐标33.55,69.57;如果数据节点104确定多边形C12也不包含坐标33.55,69.57,那么继续确定多边形B12是否包含坐标33.55, 69.57,以此类推。
在一些实施例中,AOI级别可以与最初需要被分割的多边形的行政区类型相关。行政区越小,AOI级别越高。例如,国家的AOI级别低于省的AOI级别,省的AOI级别低于市的AOI级别,市的AOI级别低于区的AOI级别。
在另一些实施例中,AOI级别也可以与最初需要被分割的多边形的面积相关。面积越小,AOI级别越高。
707,数据节点104向路由节点发送定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述该目标多边形。
还以坐标33.55,69.57为例,假设根据坐标33.55,69.57确定的目标多边形为多边形A43,多边形A43是根据阿富汗地图分割得到的。那么用于描述该目标多边形的地理位置信息为:阿富汗。
可选的,在一些实施例中,该定位反馈还可以包括目标POI,该目标POI是该坐标附近的POI。换句话说,数据节点可以根据瓦片ID和POI的对应关系,确定出与瓦片ID对应的一个或多个POI,然后确定每个POI到该坐标的距离,如果POI到该坐标的距离小于一个预设阈值,那么该POI可以作为目标POI。可以理解的是,在一些实施例中,可能会出现所有POI到该坐标的距离都大于该预设阈值。在此情况下,该定位反馈中可以不包含目标POI或者指示没有找到目标POI。在另一些实施例中,可能会出现多个POI到该坐标的距离都小于该预设阈值。在此情况下该多个POI可以都作为该目标POI。
708,路由节点将该定位反馈发送至终端设备。
上述技术方案中,不同的数据节点保存有不同的瓦片ID和多边形的对应关系(即多边形索引信息)。路由节点保存有瓦片ID和数据节点的对应关系(即路由信息)。这样,当路由节点接收到来自于终端设备的坐标后,可以根据坐标确定对应的瓦片ID,进而根据路由信息确定与瓦片ID对应的数据节点。这样,路由节点可以将接收到的坐标发送至确定的数据节点(以下称为目标数据节点),而无需将坐标发送至系统中的所有数据节点。除目标数据节点外,其他数据节点无需参与到确定与坐标对应的多边形的计算中。这样,可以减少整个系统的功率消耗。此外,由于目标数据节点保存的多边形是经过分割后得到的较小的多边形,因此该目标数据节点可以较快地确定出包含有该坐标的多边形。这样,可以提高逆地理搜索的响应速度,提高用户体验。
此外,在一些实施例中,在从多个多边形中确定目标多边形的过程中,先根据AOI级别和/或坐标到中心点的距离进行排序,然后根据排序结果以此判断多边形中是否包含该坐标。通常情况下,坐标到某一多边形的中心点的距离越近,该坐标属于该多边形的概率越大。多边形的AOI级别越高,多边形的面积就越小;多边形面积越小,判断坐标在该多边形的范围内的速度就越快。因此,上述技术方案可以更进一步提高逆地理搜索的响应速度。
图8是根据本申请实施例提供的一种定位方法的示意性流程图。图8所示的方法可以由数据节点或者数据节点中的部件执行。
801,接收来自于路由节点的定位请求,该定位请求包括坐标。
802,根据多边形索引信息、该坐标和对应于该坐标的目标区域标识,确定该坐标对应的目标多边形,其中,该多边形索引信息用于指示区域标识和多边形的对应关系,该目 标区域标识与多个第一多边形对应,该目标多边形是多个第一多边形中的一个,该多个第一多边形是对一个第二多边形分割得到的部分或全部多边形,该坐标位于该目标多边形的范围内。
例如,假设该坐标是33.55,69.57,那么可以根据公式2和公式3计算出与该坐标对应的目标区域标识为225,131。
例如,该多边形索引信息可以是如表4所示的索引信息。多边形A41、多边形A42、多边形A43和多边形A44可以是第一多边形,多边形A41、多边形A42、多边形A43和多边形A44是对多边形A4分割得到的。多边形A4可以是一个第二多边形。
又如,多边形A121、多边形A122、多边形A123和多边形A124可以是第一多边形,多边形A12可以是第二多边形。
又如,多边形A11、多边形A13和多边形A14可以是第一多边形,多边形A1可以是第二多边形。
803,向该路由节点发送定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述包含该坐标的地理位置。
该地理位置信息可以是AOI。该地理位置信息描述的地理位置可以是步骤802中所确定的目标多边形。
图8所示的方法的各个步骤的具体实现方式可以参考图7所示的实施例,多边形分割、索引以及路由信息的确定方式可以参考图3所示的实施例,为了简洁,在此就不再赘述。
图9是根据本申请实施例提供的一种计算机设备的示意图。如图9所示的计算机设备900可以执行上述实施例中由路由节点执行的步骤。如图9所示的计算机设备900包括接收单元901、处理单元902和发送单元903。
接收单元901,用于接收来自于终端设备的坐标。
处理单元902,用于根据路由信息和对应于该坐标的目标区域标识,确定对应于该目标区域标识的目标数据节点,其中该路由信息用于指示区域标识和数据节点的对应关系,该目标区域标识用于指示包含该坐标的区域。
发送单元903,用于向该目标数据节点发送定位请求,该定位请求包括该坐标。
接收单元901,还用于接收来自于该目标数据节点的定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述包含该坐标的地理位置。
接收单元901、处理单元902和发送单元903的具体功能和有益效果可以参考上述方法部分实施例的描述,为了简洁,在此就不再赘述。
应理解,图9仅为示例而非限定,上述包括接收单元、发送单元和处理单元的计算机设备可以不依赖于图9所示的结构。
当该计算机设备900为芯片时,该芯片包括接收单元、发送单元和处理单元。其中,接收单元和发送单元可以是输入输出电路、通信接口;处理单元为该芯片上集成的处理器或者微处理器或者集成电路。
图10是根据本申请实施例提供的另一种计算机设备的示意图。如图10所示的计算机设备1000可以执行上述实施例中由数据节点执行的步骤。如图10所示的计算机设备1000包括接收单元1001、处理单元1002和发送单元1003。
接收单元1001,用于接收来自于路由节点的定位请求,该定位请求包括坐标。
处理单元1002,用于根据多边形索引信息、该坐标和对应于该坐标的目标区域标识,确定该坐标对应的目标多边形,其中,该多边形索引信息用于指示区域标识和多边形的对应关系,该目标区域标识与多个第一多边形对应,该目标多边形为该多个第一多边形中的一个,该多个第一多边形是对一个第二多边形进行分割得到的部分或全部多边形,该坐标位于该目标多边形的范围内。
发送单元1003,用于向该路由节点发送定位反馈,该定位反馈包括地理位置信息,该地理位置信息用于描述该目标多边形。
接收单元1001、处理单元1002和发送单元1003的具体功能和有益效果可以参考上述方法部分实施例的描述,为了简洁,在此就不再赘述。
应理解,图10仅为示例而非限定,上述包括接收单元、发送单元和处理单元的计算机设备可以不依赖于图10所示的结构。
当该计算机设备1000为芯片时,该芯片包括接收单元、发送单元和处理单元。其中,接收单元和发送单元可以是输入输出电路、通信接口;处理单元为该芯片上集成的处理器或者微处理器或者集成电路。
图11是根据本申请实施例提供的另一种计算机设备的示意图。如图11所示的计算机设备1100可以执行上述实施例中由处理节点执行的步骤。如图11所示的计算机设备1100包括处理单元1101和发送单元1102。
处理单元1101,可以用于对多边形分割,得到多个多边形。
处理单元1101,还可以用于确定分割得到的多个多边形中的每个多边形是否满足预设条件;确定满足条件的多边形和区域标识的对应关系,得到多边形索引信息;对不满足预设条件的多边形继续分割直到得到满足条件的多边形。
发送单元1102,用于将处理单元1101确定的多个索引信息发送给多个数据节点。
处理单元1101,还用于确定路由信息。
发送单元1102,还用于将该路由信息发送至路由节点。
处理单元1101和发送单元1102的具体功能和有益效果可以参考上述方法部分实施例的描述,为了简洁,在此就不再赘述。
应理解,图11仅为示例而非限定,上述包括接收单元、发送单元和处理单元的计算机设备可以不依赖于图11所示的结构。
当该计算机设备1100为芯片时,该芯片包括发送单元和处理单元。其中,发送单元可以是输入输出电路、通信接口;处理单元为该芯片上集成的处理器或者微处理器或者集成电路。
本申请实施例还提供了一种计算机设备,包括处理器和存储器。处理器用于与存储器耦合,读取并执行存储器中的指令和/或程序代码,以执行上述方法实施例中处理节点执行的步骤。
本申请实施例还提供了一种计算机设备,包括处理器和存储器。处理器用于与存储器耦合,读取并执行存储器中的指令和/或程序代码,以执行上述方法实施例中路由节点执行的步骤。
本申请实施例还提供了一种计算机设备,包括处理器和存储器。处理器用于与存储器耦合,读取并执行存储器中的指令和/或程序代码,以执行上述方法实施例中数据节点执 行的步骤。
应理解,上述处理器可以是一个芯片。例如,该处理器可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)、其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,或其他集成芯片。
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
应注意,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
根据本申请实施例提供的方法,本申请还提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行上述实施例中处理节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行上 述实施例中路由节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行上述实施例中数据节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种计算机可读介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行上述实施例中处理节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种计算机可读介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行上述实施例中数据节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种计算机可读介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行上述实施例中路由节点执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种系统,其包括前述的处理节点、一个或多个路由节点和多个数据节点。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随 机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (32)

  1. 一种定位方法,其特征在于,所述方法包括:
    接收来自于终端设备的坐标;
    根据路由信息和对应所述坐标的目标区域标识,确定对应于所述目标区域标识的目标数据节点,其中所述路由信息用于指示区域标识和数据节点的对应关系,所述目标区域标识用于指示包含所述坐标的区域;
    向所述目标数据节点发送定位请求,所述定位请求包括所述坐标;
    接收来自于所述目标数据节点的定位反馈,所述定位反馈包括地理位置信息,所述地理位置信息用于描述包含所述坐标的地理位置。
  2. 如权利要求1所述的方法,其特征在于,所述路由信息包括多个索引以及与各个索引对应的数据节点的标识,其中所述多个索引中的每个索引为一个区域标识或者一个区域标识范围。
  3. 如权利要求1或2所述的方法,其特征在于,所述定位反馈还包括至少一个信息点POI,所述坐标与所述至少一个POI中的每个POI之间的距离小于预设阈值。
  4. 一种定位方法,其特征在于,所述方法包括:
    接收来自于路由节点的定位请求,所述定位请求包括坐标;
    根据多边形索引信息、所述坐标和对应于所述坐标的目标区域标识,确定所述坐标对应的目标多边形,其中,所述多边形索引信息用于指示区域标识和多边形的对应关系,所述目标区域标识与多个第一多边形对应,所述目标多边形为所述多个第一多边形中的一个,所述多个第一多边形是对一个第二多边形进行分割得到的部分或全部多边形,所述坐标位于所述目标多边形的范围内;
    向所述路由节点发送定位反馈,所述定位反馈包括地理位置信息,所述地理位置信息用于描述包含所述坐标的地理位置。
  5. 如权利要求4所述的方法,其特征在于,所述多边形索引信息包括多个索引以及与各个索引对应的第一多边形,其中所述多个索引中的每个索引为一个区域标识;
    所述根据多边形索引信息、所述目标区域标识和所述坐标,确定目标多边形,包括:
    从所述多个索引中确定与所述目标区域标识匹配的目标索引;
    对与所述目标索引对应的所述多个第一多边形进行排序;
    根据排序结果和所述坐标,确定所述目标多边形。
  6. 如权利要求5所述的方法,其特征在于,所述对与所述目标索引对应的所述多个第一多边形进行排序,包括:
    根据所述多个第一多边形的信息区域AOI级别,对所述多个第一多边形进行排序,其中AOI级别较高的第一多边形的排名高于AOI级别较低的第一多边形排名。
  7. 如权利要求6所述的方法,其特征在于,所述对与所述目标索引对应的所述多个第一多边形进行排序,还包括:
    确定所述多个第一多边形中的N个AOI级别相同的第一多边形,其中N为大于或等于2的正整数;
    根据N个AOI级别相同的第一多边形中的每个参考区域的中心点到所述坐标的距离,对所述N个AOI级别相同的第一多边形进行排序,其中,所述N个AOI级别相同的第一多边形中中心点到所述坐标距离较近的第一多边形的排名高于中心点到所述坐标较远的第一多边形的排名。
  8. 如权利要求5至7中任一项所述的方法,其特征在于,所述根据排序结果和所述坐标,确定所述目标多边形,包括:
    从所述多个第一多边形中的排名最高的第一多边形起,依次判断所述第一多边形是否包含所述坐标,直到确定出所述目标多边形。
  9. 如权利要求4至8中任一项所述的方法,其特征在于,在所述向所述路由节点发送定位反馈之前,所述方法还包括:
    确定所述目标数据节点中是否包括目标信息点POI,其中所述目标POI为与所述坐标距离小于预设阈值的POI;
    在所述目标数据节点中包括所述目标POI的情况下,所述定位反馈还包括所述目标POI。
  10. 如权利要求4至9中任一项所述的方法,其特征在于,
    所述第二多边形的边界点数量大于预设边界点数量阈值,所述第一多边形的边界点数量小于或等于所述预设边界点数量阈值;或者
    所述第二多边形的边界点数量大于所述预设边界点数量阈值且所述第二多边形的面积大于预设面积阈值,所述第一多边形的边界点数量小于或等于所述预设边界点数量阈值,或者,所述第一多边形的面积小于或等于所述预设面积。
  11. 如权利要求4至10中任一项所述的方法,其特征在于,所述多个第一多边形是根据所述第二多边形的外接图形的中心点,对所述第二多边形进行分割得到的部分或全部多边形。
  12. 如权利要求11所述的方法,其特征在于,所述外接图形为正多边形、梯形、平行四边形,或者圆形,其中所述外接正多边形的边数小于或等于8。
  13. 如权利要求4至12中任一项所述的方法,其特征在于,所述目标区域标识为与所述目标多边形对应的至少一个区域标识中的一个。
  14. 一种计算机设备,其特征在于,包括:
    接收单元,用于接收来自于终端设备的坐标;
    处理单元,用于根据路由信息和对应所述坐标的目标区域标识,确定对应于所述目标区域标识的目标数据节点,其中所述路由信息用于指示区域标识和数据节点的对应关系,所述目标区域标识用于指示包含所述坐标的区域;
    发送单元,用于向所述目标数据节点发送定位请求,所述定位请求包括所述坐标;
    所述接收单元,还用于接收来自于所述目标数据节点的定位反馈,所述定位反馈包括地理位置信息,所述地理位置信息用于描述包含所述坐标的地理位置。
  15. 如权利要求14所述的计算机设备,其特征在于,所述路由信息包括多个索引以及与各个索引对应的数据节点的标识,其中所述多个索引中的每个索引为一个区域标识或者一个区域标识范围。
  16. 如权利要求14或15所述的计算机设备,其特征在于,所述定位反馈还包括至少 一个信息点POI,所述坐标与所述至少一个POI中的每个POI之间的距离小于预设阈值。
  17. 一种计算机设备,其特征在于,包括:
    接收单元,用于接收来自于路由节点的定位请求,所述定位请求包括坐标;
    处理单元,用于根据多边形索引信息、所述坐标和对应于所述坐标的目标区域标识,确定所述坐标对应的目标多边形,其中,所述多边形索引信息用于指示区域标识和多边形的对应关系,所述目标区域标识与多个第一多边形对应,所述目标多边形为所述多个第一多边形中的一个,所述多个第一多边形是对一个第二多边形进行分割得到的部分或全部多边形,所述坐标位于所述目标多边形的范围内;
    发送单元,用于向所述路由节点发送定位反馈,所述定位反馈包括地理位置信息,所述地理位置信息用于描述包含所述坐标的地理位置。
  18. 如权利要求17所述的计算机设备,其特征在于,所述多边形索引信息包括多个索引以及与各个索引对应的第一多边形,其中所述多个索引中的每个索引为一个区域标识;
    所述处理单元,具体用于从所述多个索引中确定与所述目标区域标识匹配的目标索引;对与所述目标索引对应的所述多个第一多边形进行排序;根据排序结果和所述坐标,确定所述目标多边形。
  19. 如权利要求18所述的计算机设备,其特征在于,所述处理单元,具体用于根据所述多个第一多边形的信息区域AOI级别,对所述多个第一多边形进行排序,其中AOI级别较高的第一多边形的排名高于AOI级别较低的第一多边形排名。
  20. 如权利要求19所述的计算机设备,其特征在于,所述处理单元,具体用于确定所述多个第一多边形中的N个AOI级别相同的第一多边形,其中N为大于或等于2的正整数;
    根据N个AOI级别相同的第一多边形中的每个参考区域的中心点到所述坐标的距离,对所述N个AOI级别相同的第一多边形进行排序,其中,所述N个AOI级别相同的第一多边形中中心点到所述坐标距离较近的第一多边形的排名高于中心点到所述坐标较远的第一多边形的排名。
  21. 如权利要求18至20中任一项所述的计算机设备,其特征在于,所述处理单元,具体用于从所述多个第一多边形中的排名最高的第一多边形起,依次判断所述第一多边形是否包含所述坐标,直到确定出所述目标多边形。
  22. 如权利要求17至21中任一项所述的计算机设备,其特征在于,在所述向所述路由节点发送定位反馈之前,所述方法还包括:
    确定所述目标数据节点中是否包括目标信息点POI,其中所述目标POI为与所述坐标距离小于预设阈值的POI;
    在所述目标数据节点中包括所述目标POI的情况下,所述定位反馈还包括所述目标POI。
  23. 如权利要求17至22中任一项所述的计算机设备,其特征在于,
    所述第二多边形的边界点数量大于预设边界点数量阈值,所述第一多边形的边界点数量小于或等于所述预设边界点数量阈值;或者
    所述第二多边形的边界点数量大于所述预设边界点数量阈值且所述第二多边形的面 积大于预设面积阈值,所述第一多边形的边界点数量小于或等于所述预设边界点数量阈值,或者,所述第一多边形的面积小于或等于所述预设面积。
  24. 如权利要求17至23中任一项所述的计算机设备,其特征在于,所述多个第一多边形是根据所述第二多边形的外接图形的中心点,对所述第二多边形进行分割得到的部分或全部多边形。
  25. 如权利要求24所述的计算机设备,其特征在于,所述外接图形为正多边形、梯形、平行四边形,或者圆形,其中所述外接正多边形的边数小于或等于8。
  26. 如权利要求17至25中任一项所述的计算机设备,其特征在于,所述目标区域标识为与所述目标多边形对应的至少一个区域标识中的一个。
  27. 一种计算机设备,其特征在于,包括:处理器,所述处理器用于与存储器耦合,读取并执行所述存储器中的指令和/或程序代码,以执行如权利要求1至3中任一项所述的方法。
  28. 一种计算机设备,其特征在于,包括处理器,所述处理器用于与存储器耦合,读取并执行所述存储器中的指令和/或程序代码,以执行如权利要求4至13中任一项所述的方法。
  29. 一种芯片系统,其特征在于,包括:逻辑电路,所述逻辑电路用于与输入/输出接口耦合,通过所述输入/输出接口传输数据,以执行如权利要求1至3中任一项所述的方法。
  30. 一种芯片系统,其特征在于,包括:逻辑电路,所述逻辑电路用于与输入/输出接口耦合,通过所述输入/输出接口传输数据,以执行如权利要求4至13中任一项所述的方法。
  31. 一种计算机可读介质,其特征在于,所述计算机可读介质存储有程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行如权利要求1至3中任一项所述的方法。
  32. 一种计算机可读介质,其特征在于,所述计算机可读介质存储有程序代码,当所述计算机程序代码在计算机上运行时,使得计算机执行如权利要求4至13中任一项所述的方法。
PCT/CN2022/086658 2021-04-20 2022-04-13 定位方法和相关装置 WO2022222828A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110426810.3A CN115221159A (zh) 2021-04-20 2021-04-20 定位方法和相关装置
CN202110426810.3 2021-04-20

Publications (1)

Publication Number Publication Date
WO2022222828A1 true WO2022222828A1 (zh) 2022-10-27

Family

ID=83605047

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086658 WO2022222828A1 (zh) 2021-04-20 2022-04-13 定位方法和相关装置

Country Status (2)

Country Link
CN (1) CN115221159A (zh)
WO (1) WO2022222828A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290617A (zh) * 2023-08-18 2023-12-26 中国船舶集团有限公司第七〇九研究所 一种海上分布式多源异构时空数据查询方法及系统
CN117290617B (zh) * 2023-08-18 2024-05-10 中国船舶集团有限公司第七〇九研究所 一种海上分布式多源异构时空数据查询方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103563405A (zh) * 2011-06-03 2014-02-05 苹果公司 选择用于地理围栏监视的无线接入点
CN105103619A (zh) * 2013-03-15 2015-11-25 波音公司 基于路由器物理位置的安全路由
CN107004175A (zh) * 2014-09-25 2017-08-01 美国邮政管理局 用于形成和使用位置标识网格的方法和系统
CN108271120A (zh) * 2017-12-22 2018-07-10 阿里巴巴集团控股有限公司 目标区域及目标用户的确定方法、装置及设备
WO2020072074A1 (en) * 2018-10-05 2020-04-09 Google Llc Improving offline map data availability

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103563405A (zh) * 2011-06-03 2014-02-05 苹果公司 选择用于地理围栏监视的无线接入点
CN105103619A (zh) * 2013-03-15 2015-11-25 波音公司 基于路由器物理位置的安全路由
CN107004175A (zh) * 2014-09-25 2017-08-01 美国邮政管理局 用于形成和使用位置标识网格的方法和系统
CN108271120A (zh) * 2017-12-22 2018-07-10 阿里巴巴集团控股有限公司 目标区域及目标用户的确定方法、装置及设备
WO2020072074A1 (en) * 2018-10-05 2020-04-09 Google Llc Improving offline map data availability

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117290617A (zh) * 2023-08-18 2023-12-26 中国船舶集团有限公司第七〇九研究所 一种海上分布式多源异构时空数据查询方法及系统
CN117290617B (zh) * 2023-08-18 2024-05-10 中国船舶集团有限公司第七〇九研究所 一种海上分布式多源异构时空数据查询方法及系统

Also Published As

Publication number Publication date
CN115221159A (zh) 2022-10-21

Similar Documents

Publication Publication Date Title
US10149094B2 (en) Systems and methods to identify a predefined geographical region in which a mobile device is located
US9430510B2 (en) Computer implemented methods and systems for multi-level geographic query
US9910878B2 (en) Methods for processing within-distance queries
CN108268504A (zh) 一种划分兴趣点的搜索区域的方法及设备
WO2022222828A1 (zh) 定位方法和相关装置
US20210311971A1 (en) Geocoding methods and systems of correcting latitude and longitude of a point of interest
US20190005574A1 (en) System and method for matching a service provider to a service requestor
CN116168096A (zh) 变分辨率矢量瓦片的构建方法
CN113360586B (zh) 地址聚集度查询方法、装置、设备及计算机可读存储介质
CN103279524A (zh) 基于geocoding的二手车车源信息搜索和排序法
WO2014089095A1 (en) Locating position within enclosure
CN116541616A (zh) 对象放置地址确定方法、装置、计算机设备和存储介质
CN110750602A (zh) 确定订单地址所属站点的方法和装置
US8914357B1 (en) Mapping keywords to geographic features
CN105677843A (zh) 一种自动获取宗地四至属性的方法
WO2023050647A1 (zh) 地图更新的方法、装置、计算机设备及介质
CN115511701A (zh) 一种地理信息的转换方法及装置
US11537622B2 (en) K-nearest neighbour spatial queries on a spatial database
CN103186528A (zh) 筛选地理信息的方法、装置与移动终端
WO2021135106A1 (zh) 地理位置数据的匹配方法、装置、电子设备及存储介质
CN111274272B (zh) 一种对象的查找方法、装置及计算机系统
CN113658033B (zh) 一种计算给定区域内部点集的gpu方法
CN113868555A (zh) 一种轨迹检索方法、装置、设备以及存储介质
CN107092630B (zh) 业务对象的搜索方法和装置
US20220155087A1 (en) Map data processing method, device, storage medium and program product

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: 22790936

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22790936

Country of ref document: EP

Kind code of ref document: A1