Method, device and medium for querying grid to which a point belongs

By constructing a tree-assisted search structure and a heuristic search method, the problem of low efficiency when there are many points and grids is solved, and efficient judgment of the grid to which a point belongs is achieved.

CN117972172BActive Publication Date: 2025-10-03INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410159494.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2025-10-03
Estimated Expiration
2044-02-02

AI Technical Summary

Technical Problem

When there are a large number of points and grids, the process of directly using the ray method to determine the grid to which the point belongs is inefficient and time-consuming.

Method used

A heuristic search method is adopted. By constructing a tree-shaped auxiliary search structure composed of regional nodes of different levels, the latitude and longitude of the point and the boundary longitude and longitude dataset of the search node are used to determine the inclusion relationship, and the target node is searched level by level to obtain the grid information to which it belongs.

Benefits of technology

It effectively narrows the search and comparison scope, reduces invalid search and judgment operations, and improves the efficiency and accuracy of judging the grid to which a point belongs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117972172B_ABST
    Figure CN117972172B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method, device and medium for querying the grid to which a point belongs. The method comprises: constructing a corresponding auxiliary search structure based on the zoning information of the application area corresponding to a given point; wherein the auxiliary search structure is a tree structure composed of regional nodes of different levels; taking the starting point of the auxiliary search structure as the current search node, and determining the inclusion relationship between the given point and the current search node area based on the longitude and latitude of the given point and the boundary longitude and latitude data set corresponding to the current search node; determining the heuristic information corresponding to the current search node based on the inclusion relationship, so as to search for the target node step by step based on the auxiliary search structure when the heuristic information meets the node selection condition; and obtaining the grid information corresponding to the target node when the target node meets the preset grid node condition, so as to complete the grid query process to which the point belongs. The above method improves the efficiency of the grid query to which the point belongs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, and medium for querying the grid to which a point belongs. Background Art

[0002] As a crucial component of grassroots social governance, grid management divides the management area into grids according to prescribed standards, using these grids as the basic units of management or governance. This management model enables the rational allocation of resources and the precise identification of problems, making grassroots social governance more scientific and refined, and improving its efficiency and quality.

[0003] When implementing resource allocation and problem location based on grid cells, it's necessary to consider the grid boundaries to determine whether a point belongs to a specific grid. This problem is typically solved using the ray method. However, when there are a large number of points and grid cells, using the ray method directly can result in inefficient and time-consuming grid determination. Summary of the Invention

[0004] The embodiments of the present application provide a method, device and medium for querying the grid to which a point belongs, which are used to solve the following technical problem: when there are a large number of points and grids, directly using the ray method will make the process of determining the grid to which the point belongs less efficient and more time-consuming.

[0005] The embodiments of this application adopt the following technical solutions:

[0006] The embodiment of the present application provides a method for querying the grid to which a point belongs. The method comprises: constructing a corresponding auxiliary search structure based on the zoning information of the application area corresponding to a given point; wherein the auxiliary search structure is a tree structure composed of regional nodes of different levels; using the starting point of the auxiliary search structure as the current search node, determining the inclusion relationship between the given point and the current search node area based on the longitude and latitude of the given point and the boundary longitude and latitude data set corresponding to the current search node; determining the heuristic information corresponding to the current search node based on the inclusion relationship, and performing a target node search step by step based on the auxiliary search structure when the heuristic information meets the node selection condition; and obtaining the grid information corresponding to the target node when the target node meets the preset grid node condition, so as to complete the grid query process to which the point belongs.

[0007] The embodiments of this application implement the process of determining the grid to which a point belongs by using a heuristic search approach. By narrowing the search and comparison range, the proposed search and determination method reduces invalid search and determination operations and improves actual search and determination efficiency. This effectively addresses the inefficiency and time-consuming process of determining the grid to which a point belongs when there are a large number of points and grids, thereby improving the practical effectiveness of the process of determining the grid to which a point belongs.

[0008] In one implementation of the present application, based on the longitude and latitude of a given point and the boundary longitude and longitude data set corresponding to the current search node, the inclusion relationship between the given point and the current search node area is determined, specifically including: based on the boundary longitude and latitude data set corresponding to the current search node, determining the minimum enclosing rectangle corresponding to the current search node; based on the positional relationship between the longitude and latitude of the given point and the minimum enclosing rectangle, obtaining a preliminary positional relationship; based on the preliminary positional relationship, constructing a corresponding ray to determine the inclusion relationship between the given point and the current search node area based on the ray.

[0009] In one implementation of the present application, a corresponding ray is constructed based on the preliminary position relationship to determine the inclusion relationship between a given point and the current search node area based on the ray, specifically including: when the preliminary position relationship is that the given point is inside the minimum enclosing rectangle, determining the number of intersections of the ray starting from the given point and parallel to the latitude with all valid boundary segments of the current search node area; determining the inclusion relationship between the given point and the current search node area based on the number of intersections.

[0010] In one implementation of the present application, a corresponding auxiliary search structure is constructed based on the zoning information of the application area corresponding to a given point, specifically including: based on the zoning information of the application area corresponding to the given point, determining multiple areas of different levels and multiple grid areas corresponding to the application area; wherein the application area contains multiple areas of different levels, and the lowest level area contains multiple different grid areas; using the application area as the starting node of the auxiliary search structure, and using the area of ​​the next level corresponding to the application area as the adjacent set corresponding to the starting node to establish an association relationship between the starting node and the adjacent set; based on the levels of different areas corresponding to the application area, determining area nodes of different levels, and constructing adjacent sets corresponding to area nodes of different levels, and based on the different area levels, connecting the area nodes and their corresponding adjacent sets in a tree structure; using multiple grid areas as the ending nodes of the auxiliary search structure to complete the construction of the auxiliary search structure.

[0011] In one implementation of the present application, before using multiple grid areas as the termination nodes of the auxiliary search structure, the method also includes: determining the boundary longitude and latitude corresponding to the termination node, and determining the longitude and latitude data set corresponding to the lowest-level node area in the auxiliary search structure; based on the boundary longitude and latitude corresponding to the termination node and the longitude and latitude data set corresponding to the lowest-level node area, determining the regional overlapping relationship between the termination node area and the lowest-level node area, forming a node set consisting of all termination nodes that have a regional overlapping relationship with the lowest-level node in the auxiliary search structure, and setting the node set as the adjacent set corresponding to the lowest-level node.

[0012] In one implementation of the present application, when the heuristic information meets the node selection conditions, the target node search is performed step by step based on the auxiliary search structure, specifically including: when the heuristic information meets the node selection conditions, the adjacent set corresponding to the current search node is determined based on the auxiliary search structure as the current search node set; the unsearched nodes in the current search node set are selected in turn as the next search nodes, and the heuristic information corresponding to the next search node is obtained. After determining the node whose heuristic information meets the node selection conditions, the target node search is performed step by step based on the next search node and the auxiliary search structure, and the search process in the current search node set is stopped; until the target node is determined or the search node cannot be updated to complete the target node query.

[0013] In one implementation of the present application, the heuristic information corresponding to the current search node is determined based on the inclusion relationship, specifically including: when there is an inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is preset first annotation information; when there is no inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is preset second annotation information; when the preset first annotation information is received, performing a target node search based on the current search node and the auxiliary search structure.

[0014] In one implementation of the present application, the target node search is performed step by step based on the auxiliary search structure, specifically including: detecting the current search node set; if there are no unsearched nodes in the current search node set, the result of the current search process is that the given point is not contained in any grid, and the given point selection operation is re-executed; if there are unsearched nodes in the current search node set, the unsearched node is selected as the current search node.

[0015] An embodiment of the present application provides a point grid query device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so as to enable the at least one processor to: construct a corresponding auxiliary search structure based on zoning information of an application area corresponding to a given point; wherein the auxiliary search structure is a tree structure composed of area nodes of different levels; using the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node, determine the inclusion relationship between the given point and the current search node area; based on the inclusion relationship, determine the heuristic information corresponding to the current search node, so as to perform a target node search step by step based on the auxiliary search structure when the heuristic information meets the node selection condition; and when the target node meets the preset grid node condition, obtain the grid information corresponding to the target node to complete the point grid query process.

[0016] A non-volatile computer storage medium provided by an embodiment of the present application stores computer-executable instructions, wherein the computer-executable instructions are configured to: construct a corresponding auxiliary search structure based on zoning information of an application area corresponding to a given point; wherein the auxiliary search structure is a tree structure composed of area nodes of different levels; using the starting point of the auxiliary search structure as the current search node, determining the inclusion relationship between the given point and the current search node area based on the longitude and latitude of the given point and a boundary longitude and longitude data set corresponding to the current search node; determining heuristic information corresponding to the current search node based on the inclusion relationship, so as to perform a target node search step by step based on the auxiliary search structure when the heuristic information meets a node selection condition; and obtaining the corresponding grid information of the target node when the target node meets a preset grid node condition, so as to complete the point-to-grid query process.

[0017] At least one of the above-mentioned technical solutions employed in the embodiments of the present application can achieve the following beneficial effects: The embodiments of the present application implement the process of determining the grid to which a point belongs by using a heuristic search approach. The proposed search and determination method reduces invalid search and determination operations by narrowing the search and comparison range, thereby improving actual search and determination efficiency. This effectively addresses the inefficiency and time-consuming process of determining the grid to which a point belongs when there are a large number of points and grids, thereby improving the practical effectiveness of the process of determining the grid to which a point belongs. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] In the picture:

[0020] Figure 1 A flowchart of a method for querying the grid to which a point belongs provided in an embodiment of the present application;

[0021] Figure 2 An example diagram of an auxiliary search structure provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of a process for determining the grid to which a point belongs provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of the structure of a point grid query device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The embodiments of the present application provide a method, device, and medium for querying the grid to which a point belongs.

[0025] In order to enable those skilled in the art to better understand the technical solutions in this application, the following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0026] The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0027] Figure 1 A flowchart of a method for querying the grid to which a point belongs is provided in an embodiment of the present application. Figure 1 As shown in FIG, the method for querying the grid to which a point belongs includes the following steps:

[0028] S101: Construct a corresponding auxiliary search structure based on the zoning information of the application area corresponding to a given point.

[0029] In one embodiment of the present application, based on the zoning information of the application area corresponding to a given point, multiple areas of different levels and multiple grid areas corresponding to the application area are determined; wherein, the application area contains multiple areas of different levels, and the lowest level area contains multiple different grid areas. The application area is used as the starting node of the auxiliary search structure, and the area of ​​the next level corresponding to the application area is used as the adjacent set corresponding to the starting node to establish an association relationship between the starting node and the adjacent set. Based on the levels of different areas corresponding to the application area, the area nodes of different levels are determined, and the adjacent sets corresponding to the area nodes of different levels are constructed. Based on the different area levels, the area nodes and their corresponding adjacent sets are connected in a tree structure. Multiple grid areas are used as the ending nodes of the auxiliary search structure to complete the construction of the auxiliary search structure.

[0030] Specifically, before implementing the heuristic search process to determine the grid to which a point belongs, an auxiliary search structure must be pre-constructed to determine the search path based on the specific implementation of the grid query process. The auxiliary search structure is a tree structure composed of regional nodes at different levels. To facilitate the implementation of heuristic search based on the auxiliary search structure, the auxiliary search structure is designed as a tree structure composed of nodes at different levels, where each node corresponds to the actual current search node region during the search process.

[0031] Based on all the grid data within the actual application area, an auxiliary search structure is constructed using the adjacency set combination method. The specific implementation process is as follows: the area of ​​the actual application area is set as the starting node of the auxiliary search structure, and the single grid area within the administrative area corresponding to the starting node is set as the ending node of the auxiliary search structure. The area of ​​the next-level area belonging to the area corresponding to the starting node is set as the second-level node of the auxiliary search structure, and the node set consisting of all second-level nodes is set as the adjacent set of the starting node, establishing an association relationship between the starting node and its adjacent set.

[0032] Furthermore, for each secondary node in the auxiliary search structure, the area corresponding to the secondary node is evenly divided into three subdivided areas of similar area. The resulting subdivided areas are set as the third-level nodes of the auxiliary search structure, and the node set consisting of the third-level nodes obtained by even division is set as the adjacent set of the second-level node, establishing an association relationship between the second-level node and its adjacent set.

[0033] It should be noted that during the construction of the auxiliary search structure, the number of secondary nodes divided equally is not fixed. When the number of secondary nodes divided equally is large, the number of tertiary nodes will be large. When the number of secondary nodes divided equally is small, the number of grids in the tertiary node adjacency set will be large. Both situations may increase the number of search and judgment operations. Therefore, reasonable adjustments can be made based on the ratio of the total number of grids to the total number of secondary nodes. If this ratio is high, the number of secondary nodes divided equally can be appropriately increased; otherwise, the number of secondary nodes divided equally can be reduced. In particular, if the ratio of the total number of grids to the total number of secondary nodes is small, it is not necessary to divide the secondary nodes equally. This adjustment can keep the number of grids in the tertiary node adjacency set at a relatively reasonable level, achieving better performance.

[0034] In one embodiment of the present application, the boundary longitude and latitude corresponding to the terminating node are determined, and the longitude and latitude dataset corresponding to the lowest-level node region in the auxiliary search structure is determined. Based on the boundary longitude and latitude corresponding to the terminating node and the longitude and latitude dataset corresponding to the lowest-level node region, the region overlap relationship between the terminating node region and the lowest-level node region is determined. All terminating nodes that have a region overlap relationship with the lowest-level node in the auxiliary search structure are formed into a node set, and the node set is set as the adjacent set corresponding to the lowest-level node.

[0035] Specifically, for each terminating node in the auxiliary search structure, based on the boundary latitude and longitude dataset corresponding to the terminating node and all third-level nodes in the auxiliary search structure, the third-level nodes that have a regional overlap relationship with the terminating node are determined. For each third-level node in the auxiliary search structure, the node set consisting of all terminating nodes that have a regional overlap relationship with the third-level node is set as the adjacent set of the third-level node, and an association relationship is established between the third-level node and its adjacent set.

[0036] Through the above construction process, an auxiliary search structure for optimizing the grid query process to which a point belongs can be obtained, which is a tree structure consisting of four levels of nodes and three categories of adjacent sets. Figure 2 This is an example diagram of an auxiliary search structure provided in an embodiment of the present application, such as Figure 2 As shown in the figure, taking City A as the regional division area and City A as the starting node, City A can be divided into City B, District C, and County D. City B, District C, and County D are all second-level nodes. City B can be divided into District 1, District 2, and District 3; District C can be planned as District 1, District 2, and District 3; and County D can also be divided into District 1, District 2, and District 3. After division, District 1, District 2, and District 3 are all third-level nodes. Furthermore, each district can contain multiple grids. The multiple grids corresponding to each district are associated with the district, and each grid is a terminal node.

[0037] The embodiment of the present application is based on an auxiliary search structure, and determines a heuristic search method for finding a specific target node. The starting node of the auxiliary search structure is used as the current search node, and the heuristic information corresponding to the current search node is obtained. After evaluating that the heuristic information meets the node selection condition, the node is used as the current search selected node. In combination with the association relationship, the adjacent set corresponding to the current search selected node is selected as the current search node set, and the lower-level nodes in the node set are searched and selected as the current search node in turn. The heuristic information corresponding to the current search node is obtained and evaluated. After determining that the heuristic information meets the node selection condition, the node is used as the new current search selected node, and the search process in the current search node set is stopped. Based on the updated current search selected node, the previous heuristic search operation is repeated until the target node is determined or the current search selected node cannot be updated.

[0038] S102: Taking the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node, determine the inclusion relationship between the given point and the current search node area.

[0039] In one embodiment of the present application, a minimum bounding rectangle corresponding to the current search node is determined based on a dataset of longitude and latitude boundaries corresponding to the current search node. A preliminary positional relationship is obtained based on the positional relationship between the longitude and latitude of a given point and the minimum bounding rectangle. Based on the preliminary positional relationship, a corresponding ray is constructed to determine the inclusion relationship between the given point and the current search node region based on the ray.

[0040] In one embodiment of the present application, when the initial positional relationship indicates that a given point is within the minimum bounding rectangle, the number of intersections between rays originating from the given point and parallel to the latitude and all valid boundary segments of the current search node region is determined. Based on the number of intersections, the inclusion relationship between the given point and the current search node region is determined.

[0041] Specifically, in order to determine the inclusion relationship between a point and the current search node region based on the point's longitude and latitude coordinates and the current search node region boundary longitude and latitude dataset, a point determination module consisting of specific calculation and determination processes is constructed, mainly including a first calculation process, a first determination process, a second calculation process, and a second determination process. The first calculation process and the first determination process can achieve a preliminary determination of the inclusion relationship between a given point and the selected current search node region, while the second calculation process and the second determination process can achieve a precise determination of the inclusion relationship between the given point and the current search node region.

[0042] Combining the characteristics of the minimum bounding rectangle and the principle of the ray method, the calculation and judgment process in the point judgment module is constructed:

[0043] The first calculation process: based on the selected current search node area boundary longitude and latitude data set, determine the minimum enclosing rectangle of the current search node area, that is, obtain the maximum longitude, minimum longitude, maximum latitude and minimum latitude in the selected current search node area boundary longitude and latitude.

[0044] The first judgment process: Based on the longitude and latitude coordinates of the given point, determine whether the given point is located inside the minimum enclosing rectangle of the selected current search node area, that is, determine whether the longitude of the given point is between the minimum longitude and maximum longitude corresponding to the selected current search node area, and determine whether the latitude of the given point is between the minimum latitude and maximum latitude corresponding to the selected current search node area.

[0045] The second calculation process: based on the longitude and latitude coordinates of the given point and the longitude and latitude coordinates of the endpoints of the boundary line segment of the selected current search node area, determine the relative position of the given point and the boundary line segment of the selected current search node area, and preliminarily determine all valid boundary line segments in the area boundary segment based on the relative position information, and use the plane analytic geometry method to calculate the number of intersections between the ray starting from the given point and parallel to the latitude and all valid boundary line segments of the selected current search node area, where the valid boundary line segment refers to the boundary line segment that may intersect with the ray starting from the given point and parallel to the latitude.

[0046] The second judgment process: judge whether the given point is located inside the selected current search node area, that is, whether the number of intersections of the ray starting from the given point and parallel to the latitude line and the boundary of the selected current search node area is odd.

[0047] After constructing the calculation and judgment processes in the point judgment module, a method for determining the inclusion relationship between the point and the current search node area based on the module is determined: the latitude and longitude coordinates of the given point and the latitude and longitude data set of the boundary of the selected current search node area are obtained. A first calculation process is executed to determine the minimum enclosing rectangle of the selected current search node area. The inclusion relationship between the given point and the minimum enclosing rectangle of the selected current search node area is determined through the first judgment process. If the given point is within the minimum enclosing rectangle, a second calculation process is executed to determine the number of intersections between rays starting from the given point and parallel to the latitude line and all valid boundary segments of the selected current search node area. Based on the number of intersections, a second judgment process is used to determine whether the given point is within the selected current search node area. If the given point is outside the minimum enclosing rectangle, a judgment result indicating that the given point is outside the selected current search node area is returned.

[0048] S103: Determine the heuristic information corresponding to the current search node based on the inclusion relationship, and search for the target node step by step based on the auxiliary search structure when the heuristic information meets the node selection condition.

[0049] In one embodiment of the present application, when a given point has a containment relationship with the current search node, the heuristic information corresponding to the current search node is determined to be preset first annotation information. When a given point does not have a containment relationship with the current search node, the heuristic information corresponding to the current search node is determined to be preset second annotation information. Upon receiving the preset first annotation information, a target node search is performed based on the current search node and the auxiliary search structure.

[0050] Specifically, before implementing the heuristic search process, combined with the realization goal of determining the grid to which the point belongs, the heuristic information used to evaluate the importance of the current search node in the heuristic search process is determined, and the node selection condition of the current search selected node is updated based on the heuristic information corresponding to the current search node. Specifically, the inclusion relationship between the given point and the search node is used as the node heuristic information. For the search node, if the given point is inside the search node, the node heuristic information is 1, indicating that the node importance is high. If the given point is outside the search node, the node heuristic information is 0, indicating that the node importance is low. The node heuristic information being 1 is used as the node selection condition. If the node heuristic information meets the node selection condition, the node is selected as the current search selected node.

[0051] It should be noted that the embodiment of the present application preferentially sets the inspiration information to 1 and 0. In the application, it can be changed according to needs, and the embodiment of the present application does not limit this.

[0052] Furthermore, based on the auxiliary search structure, after using the point judgment module to obtain valid node heuristic information, a single search node with specific heuristic information is selected as the next search selected node according to the node selection conditions, and the adjacent set of the search selected node is selected as the next search range, thereby guiding the search process to search and judge in the direction of the corresponding terminal node of the grid to which the given point is most likely to belong, without the need to blindly traverse and search all nodes. The method for judging the grid to which a point belongs based on heuristic search in the embodiment of the present application can effectively narrow the search comparison range while ensuring accuracy, reduce invalid search judgment operations, thereby reducing the workload of search judgment and improving the efficiency of the process of judging the grid to which the point belongs.

[0053] In one embodiment of the present application, when the heuristic information satisfies the node selection criteria, the adjacent set corresponding to the current search node is determined based on the auxiliary search structure to serve as the current search node set. Unsearched nodes in the current search node set are sequentially selected as the next search node, and the heuristic information corresponding to the next search node is obtained. After determining a node whose heuristic information satisfies the node selection criteria, the target node search is performed step by step based on the next search node and the auxiliary search structure, and the search process in the current search node set is stopped. This process continues until the target node is determined or the search node cannot be updated, thereby completing the target node query.

[0054] In one embodiment of the present application, the current search node set is checked. If no unsearched node exists in the current search node set, the result of the current search process is that the given point is not contained within any grid, and the given point selection operation is re-executed. If no unsearched node exists in the current search node set, the unsearched node is selected as the current search node.

[0055] Specifically, by combining the point judgment module and the auxiliary search structure, the process of determining the grid to which a point belongs based on heuristic search is as follows:

[0056] Based on the point data set, if there is no undetermined point in the data set, the grid judgment process to which the point belongs is stopped. If there is an undetermined point in the point data set, the undetermined point in the data set is selected as the current judgment point, and the starting node of the auxiliary search structure is used as the current search node.

[0057] Furthermore, based on the latitude and longitude coordinates of the current judgment point and the boundary longitude and longitude data set of the current search node, the point judgment module is used to obtain the heuristic information of the current search node. If the heuristic information does not meet the node selection conditions, the initial judgment point selection operation is re-executed. If the heuristic information meets the node selection conditions, the current search node is used as the current search selected node, and the corresponding adjacent set is obtained according to the association relationship of the node, and the adjacent set is used as the current search node set.

[0058] Furthermore, based on the current search node set, an unsearched node in the node set is selected as the current search node.

[0059] Furthermore, based on the latitude and longitude coordinates of the current judgment point and the boundary longitude and longitude data set of the current search node, the point judgment module is used to obtain the heuristic information of the current search node. If the heuristic information does not meet the node selection conditions, the previous search node selection operation is re-executed. If the heuristic information meets the node selection conditions, the current search node is used as the current search selected node, and its corresponding adjacent set is obtained based on the association relationship existing in the node. The adjacent set is used as the current search node set. If the current search selected node is a secondary node, the previous search node selection operation is re-executed. Otherwise, continue to perform the following operations.

[0060] Furthermore, based on the current search node set, if there are no unsearched nodes in the current search node set, the result of this round of search judgment process is that the current judgment point is not contained in any grid, and the initial judgment point selection operation is re-executed. If there are unsearched nodes in the current search node set, the unsearched nodes in the node set are selected as the current search nodes.

[0061] Furthermore, based on the latitude and longitude coordinates of the current judgment point and the boundary longitude and longitude data set of the current search node, the point judgment module is used to obtain the heuristic information of the current search node. If the heuristic information does not meet the node selection conditions, the previous search node selection operation is re-executed. If the heuristic information meets the node selection conditions, the current search node is determined as the final target node obtained, and the initial judgment point selection operation is re-executed.

[0062] S104: When the target node meets the preset grid node conditions, obtain the grid information corresponding to the target node to complete the grid query process of the point.

[0063] Specifically, if the queried target node meets the preset grid node condition, the grid information corresponding to the corresponding grid area is changed to complete the grid query process to which the point belongs.

[0064] In the embodiment of the present application, the method for determining the grid to which a point belongs based on heuristic search can effectively narrow the search and comparison range while ensuring accuracy, reduce invalid search and judgment operations, thereby reducing the workload of search and judgment and improving the efficiency of the process of determining the grid to which a point belongs.

[0065] Figure 3 This is a flow chart of a process for determining the grid to which a point belongs provided in an embodiment of the present application. Figure 3 As shown, after the search and judgment process begins, a point dataset is acquired. If any undetermined points are determined within the point dataset, a current determined point is determined based on the undetermined points. The starting node in the constructed auxiliary search structure is used as the current search node, and judgment is performed by the point judgment module. The judgment process includes a first calculation process, a first judgment process, a second calculation process, and a second judgment process. If the first judgment process is satisfied, the second calculation process is entered. After the second judgment process is satisfied, heuristic information for the current search node is obtained to determine whether it meets the node selection criteria. If the node selection criteria are not met, a search node update operation or a judgment point update operation is selected based on the type of the current search node. If the node selection criteria are met, a determination is made as to whether the current search node satisfies a grid node. If not, the current search node is used as the current search selected node, and the adjacent set corresponding to the current search selected node is obtained based on the search auxiliary structure. The auxiliary search structure includes the adjacent set of the starting node, the adjacent sets of the second-level nodes, the adjacent sets of the third-level nodes, and the relationship between the node and its corresponding adjacent set. Determine whether there is an unsearched node in the current search node set. If so, use the unsearched node as the current search node and perform point determination. If the grid node is satisfied, obtain the current search node information and the grid information to which the current determination point belongs.

[0066] Figure 4This is a schematic diagram of the structure of a point grid query device provided in an embodiment of the present application. Figure 4 As shown, a point grid query device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: construct a corresponding auxiliary search structure based on the zoning information of the application area corresponding to the given point; wherein the auxiliary search structure is a tree structure composed of area nodes of different levels; using the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and latitude data set corresponding to the current search node, determine the inclusion relationship between the given point and the current search node area; based on the inclusion relationship, determine the heuristic information corresponding to the current search node, so as to perform a target node search step by step based on the auxiliary search structure when the heuristic information meets the node selection condition; and when the target node meets the preset grid node condition, obtain the grid information corresponding to the target node to complete the point grid query process.

[0067] An embodiment of the present application also provides a non-volatile computer storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are configured to: construct a corresponding auxiliary search structure based on zoning information of an application area corresponding to a given point; wherein the auxiliary search structure is a tree structure composed of area nodes of different levels; using the starting point of the auxiliary search structure as the current search node, determining the inclusion relationship between the given point and the current search node area based on the longitude and latitude of the given point and a boundary longitude and latitude data set corresponding to the current search node; determining the heuristic information corresponding to the current search node based on the inclusion relationship, so as to perform a target node search step by step based on the auxiliary search structure when the heuristic information meets a node selection condition; and obtaining the grid information corresponding to the target node when the target node meets a preset grid node condition, so as to complete the point-to-grid query process.

[0068] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, apparatus, and non-volatile computer storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.

[0069] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. It will be apparent to those skilled in the art that various modifications and variations may be made to the embodiments of the present application. However, such modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for querying the grid to which a point belongs, characterized in that: The method comprises: Based on the zoning information of the application area corresponding to the given point, a corresponding auxiliary search structure is constructed; wherein the auxiliary search structure is a tree structure composed of regional nodes of different levels; Taking the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node, determining the inclusion relationship between the given point and the current search node area; Determining heuristic information corresponding to the current search node based on the inclusion relationship, so as to search for a target node level by level based on the auxiliary search structure when the heuristic information satisfies a node selection condition; When the target node meets the preset grid node conditions, the grid information corresponding to the target node is obtained to complete the grid query process of the point; The construction of a corresponding auxiliary search structure based on the zoning information of the application area corresponding to the given point specifically includes: Based on the zoning information of the application area corresponding to the given point, a plurality of areas of different levels and a plurality of grid areas corresponding to the application area are determined; wherein the application area includes a plurality of areas of different levels, and the lowest level area includes a plurality of different grid areas; Taking the application area as the starting node of the auxiliary search structure, and taking the area of ​​the next level corresponding to the application area as the adjacent set corresponding to the starting node, so as to establish an association relationship between the starting node and the adjacent set; Based on the levels of different regions corresponding to the application area, regional nodes of different levels are determined, and adjacent sets corresponding to the regional nodes of different levels are constructed. Based on the different regional levels, the regional nodes and their corresponding adjacent sets are connected in a tree structure; Using the plurality of grid areas as termination nodes of the auxiliary search structure to complete the construction of the auxiliary search structure; Before using the multiple grid areas as terminating nodes of the auxiliary search structure, the method further includes: Determine the boundary longitude and latitude corresponding to the termination node, and determine the longitude and latitude dataset corresponding to the lowest level node area in the auxiliary search structure; Determining an area overlap relationship between the terminating node area and the lowest-level node area based on the boundary longitude and latitude corresponding to the terminating node and the longitude and latitude dataset corresponding to the lowest-level node area; All the termination nodes that have the region overlapping relationship with the lowest-level node in the auxiliary search structure form a node set, and the node set is set as the adjacent set corresponding to the lowest-level node; When the heuristic information satisfies the node selection condition, searching for the target node step by step based on the auxiliary search structure specifically includes: In the case where the heuristic information satisfies the node selection condition, determining an adjacent set corresponding to the current search node based on the auxiliary search structure as the current search node set; sequentially selecting unsearched nodes in the current search node set as next search nodes, obtaining heuristic information corresponding to the next search nodes, and after determining a node whose heuristic information satisfies the node selection condition, performing a target node search step by step based on the next search node and the auxiliary search structure, and stopping the search process in the current search node set; Until the target node is determined or the search node cannot be updated to complete the target node query; The determining, based on the inclusion relationship, the heuristic information corresponding to the current search node specifically includes: In a case where there is an inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is the preset first annotation information; In a case where there is no inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is preset second annotation information; When the preset first annotation information is received, searching for a target node based on the current search node and the auxiliary search structure; The step-by-step target node search based on the auxiliary search structure specifically includes: Detect the current search node set; If there is no unsearched node in the current search node set, the result of the current search process is that the given point is not contained in any grid, and the given point selection operation is executed again; If there is an unsearched node in the current search node set, the unsearched node is selected as the current search node.

2. A method for querying the grid to which a point belongs according to claim 1, characterized in that: The determining of the inclusion relationship between the given point and the current search node area based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node specifically includes: Determining a minimum bounding rectangle corresponding to the current search node based on a boundary latitude and longitude dataset corresponding to the current search node; Obtaining a preliminary positional relationship based on the positional relationship between the longitude and latitude of the given point and the minimum bounding rectangle; A corresponding ray is constructed based on the preliminary position relationship, so as to determine the inclusion relationship between the given point and the current search node area based on the ray.

3. A method for querying the grid to which a point belongs according to claim 2, characterized in that: The step of constructing a corresponding ray based on the preliminary position relationship to determine an inclusion relationship between the given point and the current search node area based on the ray specifically includes: When the preliminary positional relationship is that the given point is inside the minimum bounding rectangle, determining the number of intersections between rays starting from the given point and parallel to the latitude and all valid boundary segments of the current search node area; The inclusion relationship between the given point and the current search node area is determined based on the number of intersections.

4. A point grid query device, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Based on the zoning information of the application area corresponding to the given point, a corresponding auxiliary search structure is constructed; wherein the auxiliary search structure is a tree structure composed of regional nodes of different levels; Taking the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node, determining the inclusion relationship between the given point and the current search node area; Determining heuristic information corresponding to the current search node based on the inclusion relationship, so as to search for a target node level by level based on the auxiliary search structure when the heuristic information satisfies a node selection condition; When the target node meets the preset grid node conditions, the grid information corresponding to the target node is obtained to complete the grid query process of the point; The construction of a corresponding auxiliary search structure based on the zoning information of the application area corresponding to the given point specifically includes: Based on the zoning information of the application area corresponding to the given point, a plurality of areas of different levels and a plurality of grid areas corresponding to the application area are determined; wherein the application area includes a plurality of areas of different levels, and the lowest level area includes a plurality of different grid areas; Taking the application area as the starting node of the auxiliary search structure, and taking the area of ​​the next level corresponding to the application area as the adjacent set corresponding to the starting node, so as to establish an association relationship between the starting node and the adjacent set; Based on the levels of different regions corresponding to the application area, regional nodes of different levels are determined, and adjacent sets corresponding to the regional nodes of different levels are constructed. Based on the different regional levels, the regional nodes and their corresponding adjacent sets are connected in a tree structure; Using the plurality of grid areas as termination nodes of the auxiliary search structure to complete the construction of the auxiliary search structure; Before using the plurality of grid areas as the termination nodes of the auxiliary search structure, the method further includes: Determine the boundary longitude and latitude corresponding to the termination node, and determine the longitude and latitude dataset corresponding to the lowest level node area in the auxiliary search structure; Determining an area overlap relationship between the terminating node area and the lowest-level node area based on the boundary longitude and latitude corresponding to the terminating node and the longitude and latitude dataset corresponding to the lowest-level node area; All the termination nodes that have the region overlapping relationship with the lowest-level node in the auxiliary search structure form a node set, and the node set is set as the adjacent set corresponding to the lowest-level node; When the heuristic information satisfies the node selection condition, searching for the target node step by step based on the auxiliary search structure specifically includes: In the case where the heuristic information satisfies the node selection condition, determining an adjacent set corresponding to the current search node based on the auxiliary search structure as the current search node set; sequentially selecting unsearched nodes in the current search node set as next search nodes, obtaining heuristic information corresponding to the next search nodes, and after determining a node whose heuristic information satisfies the node selection condition, performing a target node search step by step based on the next search node and the auxiliary search structure, and stopping the search process in the current search node set; Until the target node is determined or the search node cannot be updated to complete the target node query; The determining, based on the inclusion relationship, the heuristic information corresponding to the current search node specifically includes: In a case where there is an inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is the preset first annotation information; In a case where there is no inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is preset second annotation information; When the preset first annotation information is received, searching for a target node based on the current search node and the auxiliary search structure; The step-by-step target node search based on the auxiliary search structure specifically includes: Detect the current search node set; If there is no unsearched node in the current search node set, the result of the current search process is that the given point is not contained in any grid, and the given point selection operation is executed again; If there is an unsearched node in the current search node set, the unsearched node is selected as the current search node.

5. A non-volatile computer storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are configured to: Based on the zoning information of the application area corresponding to the given point, a corresponding auxiliary search structure is constructed; wherein the auxiliary search structure is a tree structure composed of regional nodes of different levels; Taking the starting point of the auxiliary search structure as the current search node, based on the longitude and latitude of the given point and the boundary longitude and longitude data set corresponding to the current search node, determining the inclusion relationship between the given point and the current search node area; Determining heuristic information corresponding to the current search node based on the inclusion relationship, so as to search for a target node level by level based on the auxiliary search structure when the heuristic information satisfies a node selection condition; When the target node meets the preset grid node conditions, the grid information corresponding to the target node is obtained to complete the grid query process of the point; The construction of a corresponding auxiliary search structure based on the zoning information of the application area corresponding to the given point specifically includes: Based on the zoning information of the application area corresponding to the given point, a plurality of areas of different levels and a plurality of grid areas corresponding to the application area are determined; wherein the application area includes a plurality of areas of different levels, and the lowest level area includes a plurality of different grid areas; Taking the application area as the starting node of the auxiliary search structure, and taking the area of ​​the next level corresponding to the application area as the adjacent set corresponding to the starting node, so as to establish an association relationship between the starting node and the adjacent set; Based on the levels of different regions corresponding to the application area, regional nodes of different levels are determined, and adjacent sets corresponding to the regional nodes of different levels are constructed. Based on the different regional levels, the regional nodes and their corresponding adjacent sets are connected in a tree structure; Using the plurality of grid areas as termination nodes of the auxiliary search structure to complete the construction of the auxiliary search structure; Before using the plurality of grid areas as the termination nodes of the auxiliary search structure, the method further includes: Determine the boundary longitude and latitude corresponding to the termination node, and determine the longitude and latitude dataset corresponding to the lowest level node area in the auxiliary search structure; Determining an area overlap relationship between the terminating node area and the lowest-level node area based on the boundary longitude and latitude corresponding to the terminating node and the longitude and latitude dataset corresponding to the lowest-level node area; All the termination nodes that have the region overlapping relationship with the lowest-level node in the auxiliary search structure form a node set, and the node set is set as the adjacent set corresponding to the lowest-level node; When the heuristic information satisfies the node selection condition, searching for the target node step by step based on the auxiliary search structure specifically includes: In the case where the heuristic information satisfies the node selection condition, determining an adjacent set corresponding to the current search node based on the auxiliary search structure as the current search node set; sequentially selecting unsearched nodes in the current search node set as next search nodes, obtaining heuristic information corresponding to the next search nodes, and after determining a node whose heuristic information satisfies the node selection condition, performing a target node search step by step based on the next search node and the auxiliary search structure, and stopping the search process in the current search node set; Until the target node is determined or the search node cannot be updated to complete the target node query; The determining, based on the inclusion relationship, the heuristic information corresponding to the current search node specifically includes: In a case where there is an inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is the preset first annotation information; In a case where there is no inclusion relationship between the given point and the current search node, determining that the heuristic information corresponding to the current search node is preset second annotation information; When the preset first annotation information is received, searching for a target node based on the current search node and the auxiliary search structure; The step-by-step target node search based on the auxiliary search structure specifically includes: Detect the current search node set; If there is no unsearched node in the current search node set, the result of the current search process is that the given point is not contained in any grid, and the given point selection operation is executed again; If there is an unsearched node in the current search node set, the unsearched node is selected as the current search node.

Citation Information

Patent Citations

  • Retrieval method and device for area to which position point belongs, electronic equipment, medium and product

    CN114138925A