Shortest distance search and positioning method and system based on grid compression, terminal and storage medium

CN122306110BActive Publication Date: 2026-08-07SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2026-06-03
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0006]本发明的主要目的在于提供一种基于网格压缩的最短距离搜索与定位方法、系统、终端及计算机可读存储介质,旨在解决现有技术中计算目标点的最近线段时,利用索引结构的计算过程过于缓慢,无法定位大规模目标点的最近线段的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122306110B_ABST
    Figure CN122306110B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of geographic information science, and discloses a shortest distance search and positioning method and system based on grid compression, a terminal and a storage medium.The method comprises the following steps: dividing a target map into multiple grids, scanning data points into the grids to obtain a candidate grid set; determining a nearest route to the center point of the candidate grid to obtain an initial nearest route, and projecting the data points onto the initial nearest route to obtain an initial position; constructing a potential search space of the candidate grid according to the initial nearest route and the center point, and determining a target nearest route and a target position closest to each data point in the potential search space.The present application uses the center point of each grid to represent multiple data points falling in the grid, thereby reducing the number of times of calling an index structure and improving the search efficiency of the nearest target route in the road network analysis process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geographic information analysis technology, and in particular to a method, system, terminal, and computer-readable storage medium for shortest distance search and positioning based on grid compression. Background Technology

[0002] Road network spatiotemporal analysis has been used in many application scenarios, but many road network spatiotemporal analysis tools require that each data point be projected onto the nearest road segment (line) in advance.

[0003] However, for a given n points and L Given a map of a road segment, calculate the time required to travel the shortest distance from a given point to a given road segment. Therefore, existing technologies cannot support the calculation of large-scale data points and lines.

[0004] Although existing index structures can be built online to speed up the process, these methods still require processing each data point individually, which remains a relatively slow process.

[0005] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0006] The main objective of this invention is to provide a method, system, terminal, and computer-readable storage medium for shortest distance search and positioning based on grid compression, aiming to solve the problem that the calculation process using index structures is too slow when calculating the shortest line segment of a target point in the prior art, making it impossible to locate the shortest line segment of a large number of target points.

[0007] To achieve the above objectives, the present invention provides a shortest distance search and localization method based on grid compression, the shortest distance search and localization method based on grid compression comprising the following steps: Obtain the target map, divide the target map into multiple grids according to the defined grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set; Among all routes on the target map, determine the route closest to the center point of each candidate grid to obtain the initial closest route for each candidate grid. For each candidate grid, project all data points in the candidate grid onto the initial closest route of the candidate grid to obtain the initial position of each data point on the initial closest route. For each candidate grid, the initial nearest route and the center point are obtained. A circular region of the candidate grid is constructed based on the center point, and a potential search space larger than the circular region is constructed. All intersecting routes that intersect with the potential search space are scanned. The target nearest route to each data point is determined based on the intersecting routes, and multiple initial positions are updated to obtain the corresponding target position.

[0008] Optionally, the shortest distance search and localization method based on grid compression, wherein the acquired target map is divided into multiple grids according to a defined absolute error, and all data points in the target map are scanned into all the grids to obtain a candidate grid set, specifically includes: Obtain the absolute error between the target map and the user-defined map; The grid size of the target map is defined based on the absolute error, and the target map is divided into multiple grids based on the grid size. For each data point, the data points in the target map are scanned to divide the data points into corresponding grids, thus obtaining corresponding candidate grids; All candidate grids containing all the data points are added to the initial grid set to obtain the candidate grid set.

[0009] Optionally, the shortest distance search and localization method based on grid compression, wherein adding all candidate grids containing all the data points to the initial grid set to obtain a candidate grid set specifically includes: For the current data point, when scanning the data point, the position of the data point in the target map is determined, and the data point is determined to be in the candidate grid of the candidate grid set based on the position; If not, then add the candidate grid containing the data points to the candidate grid set, and determine the center point of the candidate grid; If so, then scan the next data point, and continue scanning the next data point until all data points in the target map have been scanned.

[0010] Optionally, the shortest distance search and localization method based on grid compression, wherein the steps of acquiring the target map, determining the grid size based on a defined absolute error, dividing the target map into multiple grids according to the grid size, and scanning all data points in the target map into all the grids to obtain a candidate grid set, further include: Based on the absolute error, the size of the candidate grid is maximized to obtain the relationship between the absolute error, the data points, and the center point: ; in, Representing data points and the line closest to the data point The distance between them Representing data points and the line closest to the center point The distance between them Indicates absolute error; For each candidate grid, the relationship between the center point and each data point is as follows: ; ; in, Represents data points, Indicates the center point. Indicates absolute error. and This represents the length and width of the candidate grid.

[0011] Optionally, the shortest distance search and localization method based on grid compression, wherein determining the route closest to the center point of each candidate grid among all routes on the target map to obtain the initial shortest route corresponding to each candidate grid, and for each candidate grid, projecting all data points in the candidate grid onto the initial shortest route of the candidate grid to obtain the initial position of each data point on the initial shortest route, specifically includes: Extract all routes from the target map, and among all the routes, calculate the route closest to each of the center points to obtain the initial closest route corresponding to each candidate grid. For each candidate grid, all data points in the candidate grid are projected onto the initial shortest path corresponding to the candidate grid to obtain the initial position of each data point.

[0012] Optionally, the shortest distance search and localization method based on grid compression, wherein obtaining the initial nearest path and the center point corresponding to each candidate grid, and constructing the potential search space of the candidate grids, specifically includes: For each candidate grid, determine the initial nearest path and center point of the candidate grid; A circular region of the candidate grid is constructed with the center point as the center, wherein the range of the circular region covers a preset range; Using the center point as the center, a potential search space for the candidate grid is constructed based on the circular region; The area of ​​the potential search space is larger than the area of ​​the circular region.

[0013] Optionally, the shortest distance search and localization method based on grid compression, wherein scanning all intersecting routes with the potential search space, determining the nearest target route to each data point based on the intersecting routes, and updating multiple initial positions to obtain the corresponding target position, specifically includes: For each candidate grid, scan all intersecting paths that intersect with the potential search space, and add all intersecting paths to the intersection line set; Calculate the spatial distance from each data point to each of the intersecting paths in the set of intersecting lines; If there exists a spatial distance that is less than the distance from the data point to the initial nearest route, then the intersecting route corresponding to the spatial distance is defined as the target nearest route of the data point. Once the scanning of all candidate grids is complete, each data point in the target map is projected onto the corresponding nearest route to the target to update the corresponding initial position and obtain the target position of each data point.

[0014] Furthermore, to achieve the above objectives, the present invention also provides a shortest distance search and positioning system based on grid compression, wherein the shortest distance search and positioning system based on grid compression includes: The grid partitioning module is used to acquire the target map, divide the target map into multiple grids according to the defined grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set. The preliminary search module is used to determine the route closest to the center point of each candidate grid among all routes on the target map, obtain the initial nearest route corresponding to each candidate grid, and for each candidate grid, project all the data points in the candidate grid onto the initial nearest route of the candidate grid to obtain the initial position of each data point on the initial nearest route; The final search module is used to obtain the initial nearest route and the center point for each candidate grid, construct a circular region of the candidate grid based on the center point, construct a potential search space larger than the circular region, scan all intersecting routes that intersect with the potential search space, determine the target nearest route to each data point based on the intersecting routes, and update multiple initial positions to obtain the corresponding target position.

[0015] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a grid-compressed shortest distance search and positioning program stored in the memory and executable on the processor, wherein when the grid-compressed shortest distance search and positioning program is executed by the processor, it implements the steps of the grid-compressed shortest distance search and positioning method as described above.

[0016] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a shortest distance search and localization program based on grid compression, and the shortest distance search and localization program based on grid compression, when executed by a processor, implements the steps of the shortest distance search and localization method based on grid compression as described above.

[0017] In this invention, a target map is acquired and divided into multiple grids according to a defined grid size. All data points in the target map are scanned into all the grids to obtain a candidate grid set. The route closest to the center point of each candidate grid is determined from all routes in the target map, resulting in an initial nearest route for each candidate grid. All data points in each candidate grid are projected onto the corresponding initial nearest route to obtain the initial position of each data point. For each candidate grid, the initial nearest route and the center point are acquired. A circular region of the candidate grid is constructed based on the center point, and a potential search space larger than the circular region is constructed. All intersecting routes with the potential search space are scanned. The nearest target route to each data point is determined based on the intersecting routes, and the multiple initial positions are updated to obtain the corresponding target position. This invention utilizes the center point of each grid to represent multiple data points falling within the grid, thereby reducing the number of index structure calls and improving the search efficiency for the nearest target route during road network analysis. Attached Figure Description

[0018] Figure 1 This is a flowchart of a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 2 This is a schematic diagram of the point-to-line shortest distance of a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention; Figure 3 This is a schematic diagram of grid compression, representing a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention. Figure 4 This is a schematic diagram of the nearest line search in a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 5This is a schematic diagram of the point-to-line distance between data points and center points in a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention; Figure 6 This is a schematic diagram of a candidate grid of a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 7 This is a schematic diagram of the grid division of a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 8 This is a schematic diagram of a circular region representing a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention. Figure 9 This is a schematic diagram illustrating the potential search space range of a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention. Figure 10 This is a schematic diagram illustrating the variation of the number of grids under different absolute errors in a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention; Figure 11 This is a schematic diagram illustrating the response time variation under different datasets for a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 12 This is a schematic diagram illustrating the response time variation under different absolute errors in a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 13 This is a schematic diagram of the average error under different absolute errors of a preferred embodiment of the shortest distance search and positioning method based on grid compression of the present invention; Figure 14 This is a schematic diagram illustrating the spatial overhead variation under different datasets for a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 15 This is a schematic diagram illustrating the spatial overhead variation under different absolute errors in a preferred embodiment of the shortest distance search and localization method based on grid compression of the present invention; Figure 16 This is a structural diagram of a preferred embodiment of the shortest distance search and positioning system based on grid compression of the present invention; Figure 17 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0020] Road network spatiotemporal analysis has been used in many applications, such as traffic, traffic accident analysis, pedestrian flow analysis, and urban planning. However, many road network spatiotemporal analysis tools require pre-projecting each data point onto the nearest road segment (i.e., line).

[0021] While many existing index structures can be built online to speed up this process, these methods still require processing each data point individually. Therefore, this type of approach remains very slow.

[0022] The preferred embodiment of the present invention describes a shortest distance search and localization method based on grid compression, such as... Figure 1 As shown, the shortest distance search and localization method based on grid compression includes the following steps: Step S10: Obtain the target map, divide the target map into multiple grids according to the defined grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set.

[0023] Among them, given n points and L On the target map of the road segment, when performing this process using the existing methods, the time required to calculate the shortest distance from a point to a road segment is... To avoid the slowness caused by processing each point individually in existing index structures, this invention proposes establishing a mesh structure for the point set and designs a mesh compression approximation method (defined as...). ).

[0024] First, such as Figure 2 The diagram illustrates three cases of the shortest point-to-line distance. For the target map, the shortest point-to-line distance between each line and point is first defined: (1) A line It can be represented by two endpoints s and e, expressed as .

[0025] (2) Given a data point p and a line Then the shortest distance from the data point to this line can be expressed as: : ; ; in, Indicates transpose. Represents data point p and line The intermediate judgment value, , and Let represent the Euclidean norms of p and s, e and s, and p and e, respectively.

[0026] Based on the above definition, the method disclosed in this invention can be used to locate the shortest route for a certain data point.

[0027] Before performing grid division, several core concepts are first defined for the target map: (1) For example Figure 3 As shown, a network structure is added to the target map, and then each structure is of size [missing information]. The center point c of the grid replaces all data points p within the entire grid.

[0028] (2) For example Figure 4 As shown, based on the idea of ​​this invention, the center point of the grid is used to determine the closest line. (in, This represents the line closest to the center point. and They represent (The endpoints), and then this line can be used as the approximate closest line to the data points within each grid, and these data points can be projected onto this line. However, there is a trade-off: if the grid size... If the grid is too large, it can contain many data points. This reduces the time required to find the closest line for each data point within the grid, but also increases the error (some data points are projected onto incorrect lines). However, if the grid size is too small... If the absolute error is too small, each data point is more likely to be projected onto the correct data point, but such a calculation process takes too long. Therefore, this invention needs to define an absolute error to determine a maximum grid size, such that the data points within each grid meet the defined absolute error guarantee. ; Among them, such as Figure 5 As shown, This represents the line that is closest to data point p. The distance between them Indicates data point p and The distance between them Indicates absolute error.

[0029] Specifically, obtain the absolute error between the target map and the user-defined map; The grid size of the target map is defined based on the absolute error, and the target map is divided into multiple grids based on the grid size. For each data point, the data points in the target map are scanned to divide the data points into corresponding grids, thus obtaining corresponding candidate grids; All candidate grids containing all the data points are added to the initial grid set to obtain the candidate grid set.

[0030] Furthermore, for the current data point, when scanning the data point, the position of the data point in the target map is determined, and based on the position, it is determined whether the data point is in the candidate grid of the candidate grid set; If not, then add the candidate grid containing the data points to the candidate grid set, and determine the center point of the candidate grid; If so, then scan the next data point, and continue scanning the next data point until all data points in the target map have been scanned.

[0031] After dividing the data into grids, each grid is an empty set. At this point, each data point is scanned. If the location of the data point in the target map is within a certain grid, then the data point is added to that grid and defined as a candidate grid. Then the next data point is scanned.

[0032] When scanning the next data point, there are grids (empty sets) and candidate grids (containing data points). The process involves scanning whether the data point belongs to a grid or a candidate grid. If it belongs to a candidate grid, the data point is added to the candidate grid; if it belongs to a grid, the data point is added to the grid. Then, the grid is redefined as a candidate grid. After scanning all data points, all candidate grids can be combined into a candidate grid set.

[0033] Furthermore, based on the absolute error, the size of the candidate grid is maximized to obtain the relationship between the absolute error, the data points, and the center point: ; in, Representing data points and the line closest to the data point The distance between them Representing data points and the line closest to the center point The distance between them Indicates absolute error; For each candidate grid, the relationship between the center point and each data point is as follows: ; ; in, Represents data points, Indicates the center point. Indicates absolute error. and This represents the length and width of the candidate grid.

[0034] Through data derivation, this invention determines that as long as all data points contained in the grid and the absolute error satisfy the following relationship, the absolute error guarantee of the above core viewpoint (2) can be satisfied: ; Among them, such as Figure 6 As shown, as long as the grid can be divided by a radius of The circle enclosing the error can satisfy the absolute error guarantee of the core viewpoint (2) above.

[0035] Furthermore, for the target map (size is...) ), construct a grid structure in the target map (such as Figure 7 As shown), it is necessary to The size is The grid.

[0036] To reduce the total number of grid cells while maintaining positioning accuracy (i.e., determining the absolute error value), this invention can achieve this by solving the following optimization problem: ; This problem is subject to the following constraint (this condition is based on the guarantee of absolute error): ; After solving this problem, the present invention concludes that when and When it approaches 0, This is the optimal solution, and the target map can be divided according to this grid size.

[0037] Step S20: Determine the route closest to the center point of each candidate grid among all routes on the target map to obtain the initial closest route corresponding to each candidate grid. For each candidate grid, project all data points in the candidate grid onto the initial closest route of the candidate grid to obtain the initial position of each data point on the initial closest route.

[0038] Specifically, all routes are extracted from the target map, and among all the routes, the route closest to each center point is calculated to obtain the initial closest route corresponding to each candidate grid. For each candidate grid, all data points in the candidate grid are projected onto the initial shortest path corresponding to the candidate grid to obtain the initial position of each data point.

[0039] Once the candidate grid set is obtained, the method disclosed in this invention is used. The principle of the method is to calculate the initial shortest path to the center point of each candidate grid, and then project this initial shortest path onto each data point in the candidate grid to obtain the initial position of each data point on this initial shortest path.

[0040] Step S30: For each candidate grid, obtain the initial nearest route and the center point, construct a circular region of the candidate grid based on the center point, and construct a potential search space larger than the circular region. Scan all intersecting routes that intersect with the potential search space, determine the target nearest route to each data point based on the intersecting routes, and update multiple initial positions to obtain the corresponding target position.

[0041] Among them, the present invention discloses Even after determining the initial shortest route for each data point, the method may still have the potential for error, such as... Figure 5 In the process, all data points in the candidate grid are projected onto the shortest path to the center point c (this path is defined as the initial shortest path). However, this path is not necessarily the shortest path for these data points; there may be a path that is closer to the data point. To address this issue, this invention further discloses another grid compression method (defined as...). ).

[0042] Specifically, for each candidate grid, the initial nearest route and center point of the candidate grid are determined; A circular region of the candidate grid is constructed with the center point as the center, wherein the range of the circular region covers a preset range; Using the center point as the center, a potential search space for the candidate grid is constructed based on the circular region; The area of ​​the potential search space is larger than the area of ​​the circular region.

[0043] In the embodiments disclosed in this invention, the preset range refers to the circle formed by each data point in the candidate grid and its shortest path. That is, in this candidate grid, each data point and its corresponding shortest path can construct a circle, and this preset range needs to include all circles. However, at this point, the shortest path for each data point cannot be determined. Therefore, it is necessary to ensure that the potential search space is large enough. Through a series of data derivations in this invention, it can be determined that the radius of the potential search space is defined as the sum of the absolute error and the shortest path. The sum of their lengths can satisfy this condition.

[0044] in, Algorithms are based on the concept of a potential search space, such as Figure 8 As shown, a candidate grid centered at point c contains two data points. and ,and and These represent the shortest routes between the two points. Then it means arrive distance, Then it means arrive The distance.

[0045] In defining the potential search space, the initial shortest path for all data points in the candidate grid is determined. Then, each data point is used as the center and its distance from the initial shortest path is used as the radius to define the corresponding data point circle. At this time, multiple data point circles will appear. The potential search space is the smallest circular area that can cover all data point circles. This smallest circular area is centered on the center point of the candidate grid.

[0046] Furthermore, such as Figure 9 As shown, lines that do not intersect this potential search space cannot be the shortest lines for all points in the grid, and therefore can be directly eliminated. Through mathematical derivation, it can be found that any lines whose distance from the center point of the candidate grid exceeds [a certain value]... This will filter out these lines.

[0047] Furthermore, for each candidate grid, all intersecting routes that intersect with the potential search space are scanned, and all intersecting routes are added to the intersection line set; Calculate the spatial distance from each data point to each of the intersecting paths in the set of intersecting lines; If there exists a spatial distance that is less than the distance from the data point to the initial nearest route, then the intersecting route corresponding to the spatial distance is defined as the target nearest route of the data point. Once the scanning of all candidate grids is complete, each data point in the target map is projected onto the corresponding nearest route to the target to update the corresponding initial position and obtain the target position of each data point.

[0048] In this process, after constructing the potential search space for each candidate grid, each candidate grid is scanned again. From the lines that intersect with the potential search space, the closest route for each data point is re-determined, thus obtaining the target nearest route for each data point. The target nearest route obtained at this time is the route closest to the data point in the entire target map. By further projecting this data point onto the corresponding target nearest route, the target location of the data point can be obtained.

[0049] Furthermore, in order to verify the disclosure of this invention... and To demonstrate the effectiveness of the method, experiments were conducted on point datasets from multiple locations and their corresponding road networks (line datasets).

[0050] In the embodiments disclosed in this invention, such as Figure 10 As shown, this illustrates how the absolute error varies in different locations ( Figure 10 (a) represents the case of location A. Figure 10 (b) represents the situation in location B. Figure 10 (c) in the text represents the case of location C. Figure 10 (d) represents the case of location D. and The method varies in the number of grid cells. This verification demonstrates that the proposed grid compression method can effectively compress point datasets into a small number of grid cells.

[0051] Furthermore, such as Figure 11 As shown, the response time of different methods in solving the computational problem of point-line nearest neighbor search is demonstrated under varying dataset size. Figure 11 (a) shows the situation in location A. Figure 11 (b) represents the situation in location B. Figure 11 (c) in the text represents the case of location C. Figure 11 In this context, (d) represents the case of location D. For example... Figure 12 As shown, the response time of different methods in solving the computational problem of point-line nearest neighbor search is illustrated under varying absolute errors. Figure 12 (a) shows the situation in location A. Figure 12 (b) represents the situation in location B. Figure 12 (c) in the text represents the case of location C. Figure 12 (d) in the text represents the case of location D. According to... Figure 11 and Figure 12 It can be seen that the invention disclosed herein (i.e., the second method) and The third method (i.e., the first method) is superior to the first method (the first method refers to the prior art). The method (a spatial indexed data structure method) is 7.72 times faster than 524.3 times faster and 5.64 times faster than 18.76 times faster. Specific results can be seen in Table 1. Table 1: Comparison of Results

[0052] Among them, QGIS stands for Quantum GIS, an open-source desktop geographic information system software; PostGIS stands for an open-source spatial database extension module; OSMnx stands for a city network analysis platform; spNetwork stands for Spatial Analysis on Network, used to solve the point-to-line nearest neighbor search problem on network structures (such as road networks and pipeline networks); Table 1 compares... , The effectiveness of existing methods and software has been verified. and Both can significantly reduce the time required to solve the point-to-line nearest neighbor search problem.

[0053] Furthermore, based on the above... Errors in the method, such as Figure 13 As shown, this illustrates the actual average error of different methods in solving the computational problem of point-line nearest neighbor search, with varying absolute errors. Figure 13 (a) shows the situation in location A. Figure 13 (b) represents the situation in location B. Figure 13 (c) in the text represents the case of location C. Figure 13 In this context, (d) represents the case at location D. (Through...) Figure 13 It can be known The method has very small errors.

[0054] Furthermore, such as Figure 14 and Figure 15 As shown, Figure 14 This demonstrates the space overhead of different methods in solving the point-line nearest neighbor search problem as the size of the point dataset changes; Figure 15 This demonstrates the space overhead of different methods in solving the point-line nearest neighbor search problem, while varying the absolute error. Figure 14 (a) shows the situation in location A. Figure 14 (b) represents the situation in location B. Figure 14 (c) in the text represents the case of location C. Figure 14 (d) in the text represents the case of location D; Figure 15 (a) shows the situation in location A. Figure 15 (b) represents the situation in location B. Figure 15 (c) in the text represents the case of location C. Figure 15 In this context, (d) represents the case of location D. Specifically, according to... Figure 14 and Figure 15 It can be known and The method did not actually incur significant space overhead.

[0055] Furthermore, the present invention will , This method combines existing road network analysis tools (road network kernel density visualization) with the present invention. First, each data point in the point dataset is projected onto the nearest road (the process described in this invention). Then, visualization is performed on the generated road network, resulting in a visualized heatmap of the target map. Results show that for visualization of relatively large areas (such as city-level areas), this method can be used. For visualization of smaller areas (such as street-level areas), one can choose... method

[0056] This invention utilizes the center point of each grid to represent multiple data points falling within the grid, thereby reducing the number of times the index structure is called and improving the search efficiency for the nearest target route during road network analysis.

[0057] Furthermore, such as Figure 16 As shown, based on the above-described shortest distance search and localization method based on grid compression, the present invention also provides a shortest distance search and localization system based on grid compression, wherein the shortest distance search and localization system based on grid compression includes: The grid division module 51 is used to acquire the target map, divide the target map into multiple grids according to the defined grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set. The preliminary search module 52 is used to determine the route closest to the center point of each candidate grid among all routes in the target map, to obtain the initial closest route corresponding to each candidate grid, and for each candidate grid, to project all the data points in the candidate grid onto the initial closest route of the candidate grid, to obtain the initial position of each data point on the initial closest route; The final search module 53 is used to obtain the initial nearest route and the center point for each candidate grid, construct a circular region of the candidate grid based on the center point, construct a potential search space larger than the circular region, scan all intersecting routes that intersect with the potential search space, determine the target nearest route to each data point based on the intersecting routes, and update multiple initial positions to obtain the corresponding target position.

[0058] Furthermore, such as Figure 17 As shown, based on the above-mentioned shortest distance search and positioning method and system based on grid compression, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 17Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0059] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a grid compression-based shortest distance search and positioning program 40, which can be executed by the processor 10 to implement the grid compression-based shortest distance search and positioning method of this application.

[0060] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the shortest distance search and positioning method based on grid compression.

[0061] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.

[0062] In one embodiment, when the processor 10 executes the grid-compressed shortest distance search and localization program 40 in the memory 20, it implements the steps of the grid-compressed shortest distance search and localization method as described above.

[0063] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a shortest distance search and localization program based on grid compression, and the shortest distance search and localization program based on grid compression, when executed by a processor, implements the steps of the shortest distance search and localization method based on grid compression as described above.

[0064] In summary, this invention provides a method and related device for shortest distance search and positioning based on grid compression. The method includes: acquiring a target map; dividing the target map into multiple grids according to a defined grid size; scanning all data points in the target map into all the grids to obtain a candidate grid set; determining the route closest to the center point of each candidate grid among all routes in the target map to obtain an initial nearest route for each candidate grid; projecting all data points in each candidate grid onto the corresponding initial nearest route to obtain the initial position of each data point; for each candidate grid, acquiring the initial nearest route and the center point; constructing a circular region of the candidate grid based on the center point; constructing a potential search space larger than the circular region; scanning all intersecting routes with the potential search space; determining the target nearest route closest to each data point based on the intersecting routes; and updating the multiple initial positions to obtain the corresponding target position. This invention utilizes the center point of each grid to represent multiple data points falling within the grid, thereby reducing the number of times the index structure is called and improving the search efficiency for the nearest target route during road network analysis.

[0065] It should be noted that, in this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or terminal.

[0066] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.

[0067] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A method for shortest distance search and localization based on grid compression, characterized in that, The shortest distance search and localization method based on grid compression includes: Obtain the target map, determine the grid size based on the defined absolute error, divide the target map into multiple grids according to the grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set; Among all routes on the target map, determine the route closest to the center point of each candidate grid to obtain the initial closest route for each candidate grid. For each candidate grid, project all data points in the candidate grid onto the initial closest route of the candidate grid to obtain the initial position of each data point on the initial closest route. Specifically, this includes: Extract all routes from the target map, and among all the routes, calculate the route closest to each of the center points to obtain the initial closest route corresponding to each candidate grid. For each candidate grid, all data points in the candidate grid are projected onto the initial shortest path corresponding to the candidate grid to obtain the initial position of each data point; For each candidate grid, the initial nearest route and the center point are obtained. A circular region of the candidate grid is constructed with the center point as the center, and a potential search space larger than the circular region is constructed with the center point as the center. All intersecting routes with the potential search space are scanned. Based on the intersecting routes, the target nearest route to each data point is determined, and multiple initial positions are updated to obtain the corresponding target positions. Specifically, this includes: For each candidate grid, scan all intersecting paths that intersect with the potential search space, and add all intersecting paths to the intersection line set; Calculate the spatial distance from each data point to each of the intersecting paths in the set of intersecting lines; If there exists a spatial distance that is less than the distance from the data point to the initial nearest route, then the intersecting route corresponding to the spatial distance is defined as the target nearest route of the data point. Once the scanning of all candidate grids is complete, each data point in the target map is projected onto the corresponding nearest route to the target to update the corresponding initial position and obtain the target position of each data point.

2. The shortest distance search and localization method based on grid compression according to claim 1, characterized in that, The process of acquiring the target map involves determining the grid size based on a defined absolute error, dividing the target map into multiple grids according to the grid size, and scanning all data points in the target map into all the grids to obtain a candidate grid set. Specifically, this includes: Obtain the absolute error between the target map and the user-defined map; The grid size of the target map is defined based on the absolute error, and the target map is divided into multiple grids based on the grid size. For each data point, the data points in the target map are scanned to divide the data points into corresponding grids, thus obtaining corresponding candidate grids; All candidate grids containing all the data points are added to the initial grid set to obtain the candidate grid set.

3. The shortest distance search and localization method based on grid compression according to claim 2, characterized in that, The step of adding all the candidate grids containing all the data points to the initial grid set to obtain the candidate grid set specifically includes: For the current data point, when scanning the data point, the position of the data point in the target map is determined, and the data point is determined to be in the candidate grid of the candidate grid set based on the position; If not, then add the candidate grid containing the data points to the candidate grid set, and determine the center point of the candidate grid; If so, then scan the next data point, and continue scanning the next data point until all data points in the target map have been scanned.

4. The shortest distance search and positioning method based on grid compression according to claim 3, characterized in that, The process of acquiring the target map includes determining the grid size based on a defined absolute error, dividing the target map into multiple grids according to the grid size, and scanning all data points in the target map into all the grids to obtain a candidate grid set. The process further includes: Based on the absolute error, the size of the candidate grid is maximized to obtain the relationship between the absolute error, the data points, and the center point: ; in, Representing data points and the line closest to the data point The distance between them Representing data points and the line closest to the center point The distance between them Indicates absolute error; For each candidate grid, the relationship between the center point and each data point is as follows: ; ; in, Represents data points, Indicates the center point. Indicates absolute error. and This represents the length and width of the candidate grid.

5. The shortest distance search and positioning method based on grid compression according to claim 4, characterized in that, For each candidate grid, the initial nearest path and the center point are obtained. A circular region of the candidate grid is constructed with the center point as the center, and a potential search space larger than the circular region is constructed with the center point as the center. Specifically, this includes: For each candidate grid, determine the initial nearest path and center point of the candidate grid; A circular region of the candidate grid is constructed with the center point as the center, wherein the range of the circular region covers a preset range; Using the center point as the center, a potential search space for the candidate grid is constructed based on the circular region; The area of ​​the potential search space is larger than the area of ​​the circular region.

6. A shortest distance search and positioning system based on grid compression, characterized in that, The shortest distance search and localization system based on grid compression is used to implement the shortest distance search and localization method based on grid compression as described in any one of claims 1-5, wherein the shortest distance search and localization system based on grid compression includes: The grid partitioning module is used to acquire the target map, divide the target map into multiple grids according to the defined grid size, and scan all data points in the target map into all the grids to obtain a candidate grid set. The preliminary search module is used to determine the route closest to the center point of each candidate grid among all routes on the target map, obtain the initial nearest route corresponding to each candidate grid, and for each candidate grid, project all the data points in the candidate grid onto the initial nearest route of the candidate grid to obtain the initial position of each data point on the initial nearest route; The final search module is used to obtain the initial nearest route and the center point for each candidate grid, construct a circular region of the candidate grid with the center point as the center, construct a potential search space larger than the circular region with the center point as the center, scan all intersecting routes with the potential search space, determine the target nearest route to each data point based on the intersecting routes, and update multiple initial positions to obtain the corresponding target position.

7. A terminal, characterized in that, The terminal includes: a memory, a processor, and a grid-compressed shortest distance search and localization program stored in the memory and executable on the processor. When the grid-compressed shortest distance search and localization program is executed by the processor, it implements the steps of the grid-compressed shortest distance search and localization method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a shortest distance search and localization program based on grid compression, which, when executed by a processor, implements the steps of the shortest distance search and localization method based on grid compression as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for re-establishing three-dimensional model gridding

    CN101110126A

  • Three-dimensional path planning method for urban low-altitude unmanned aerial vehicle

    CN122108160A