CN116539056B - Path planning method and device and electronic equipment - Google Patents

Path planning method and device and electronic equipment Download PDF

Info

Publication number
CN116539056B
CN116539056B CN202310480205.3A CN202310480205A CN116539056B CN 116539056 B CN116539056 B CN 116539056B CN 202310480205 A CN202310480205 A CN 202310480205A CN 116539056 B CN116539056 B CN 116539056B
Authority
CN
China
Prior art keywords
node
analyzed
level
path
cavity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310480205.3A
Other languages
Chinese (zh)
Other versions
CN116539056A (en
Inventor
李永瑾
许京奕
孙霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Big Data Advanced Technology Research Institute
Original Assignee
Beijing Big Data Advanced Technology Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Big Data Advanced Technology Research Institute filed Critical Beijing Big Data Advanced Technology Research Institute
Priority to CN202310480205.3A priority Critical patent/CN116539056B/en
Publication of CN116539056A publication Critical patent/CN116539056A/en
Application granted granted Critical
Publication of CN116539056B publication Critical patent/CN116539056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/26Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
    • G01C21/34Route searching; Route guidance
    • G01C21/3446Details of route searching algorithms, e.g. Dijkstra, A*, arc-flags, using precalculated routes

Abstract

The application provides a path planning method, a path planning device and electronic equipment, and relates to the technical field of path planning, wherein the method comprises the following steps: splitting and layering the road network to obtain a plurality of layers and a plurality of splitting cavities of each layer, wherein each splitting cavity comprises a plurality of nodes; the nodes comprise a starting point and an ending point of path planning; constructing a priority queue, setting a key value of a starting point to 0, and adding the key value into the priority queue; selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue; executing the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into a priority queue; updating the path mapping table by using the next node; repeating the next node determining step until the next node is the end point; circularly accessing the path mapping table from the terminal point until the access obtains the starting point, and obtaining a path node list from the starting point to the terminal point; and obtaining an optimal path according to the path node list.

Description

Path planning method and device and electronic equipment
Technical Field
The application relates to the technical field of path planning, in particular to a path planning method, a path planning device and electronic equipment.
Background
In the technical field of path planning, the main stream idea is to accurately calculate by adopting layering (each layer corresponds to one level of subdivision) based on Dijkstra algorithm. However, the calculation process of the method is too complex, and the practical application efficiency is not high. If the calculation time is replaced by the storage space, all the optional paths are stored, the shortest path is determined from the stored paths, and the excessive storage space is needed. For example, assuming that graph G has N points in total, if all possible paths are stored, storage space for N square paths is required, and when the value of N is large, an unacceptable memory capacity is often associated.
Therefore, it is necessary to provide a path planning method, apparatus and electronic device, so as to implement path planning with higher efficiency and smaller storage capacity.
Disclosure of Invention
In view of the above, embodiments of the present application provide a path planning method, apparatus, and electronic device, so as to overcome or at least partially solve the above problem.
A first aspect of an embodiment of the present application provides a path planning method, including:
splitting and layering the road network to obtain a plurality of layers and a plurality of splitting cavities of each layer, wherein each splitting cavity comprises a plurality of nodes, and the nodes are divided into splitting cavity boundary points and splitting cavity inner nodes; the nodes comprise a starting point and an ending point of path planning;
Constructing a priority queue, setting the key value of the starting point to 0, and adding the key value into the priority queue; the key value represents the estimated value of the node;
executing a node selection step to be analyzed: selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node to be analyzed into a node list;
executing the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node;
repeating the node selection step and the next node determination step until the next node is the endpoint;
circularly accessing the path mapping table from the end point until the access to the start point is obtained, and obtaining a path node list from the start point to the end point;
and obtaining an optimal path according to the path node list.
In a possible implementation manner, the determining the next node according to the position information of the node to be analyzed and the position information of the end point includes:
determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a higher level of the level where the node to be analyzed is located under the condition that the level where the node to be analyzed is located is lower than the level where the terminal is located according to the position information of the node to be analyzed and the position information of the terminal;
And determining the next node according to the position of the node to be analyzed and the position of the end point under the condition that the node to be analyzed and the end point are in the same level and the position of the profile cavity where the node to be analyzed and the end point are located.
In a possible implementation manner, in a case that the node to be analyzed and the endpoint are at the same level, determining the next node according to the position of the cavity where the node to be analyzed and the endpoint are located includes:
determining that the next node is determined from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level higher than the level where the node to be analyzed is located in under the condition that the node to be analyzed is not located in the same cavity as the end point according to the cavity location where the node to be analyzed is located in the end point;
and in the hierarchy of the higher level than the hierarchy of the node to be analyzed, determining the end point as the next node under the condition that the node to be analyzed and the end point are in the same profile.
In one possible implementation manner, the determining the next node from among a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a level higher than the level where the node to be analyzed is located includes:
Calculating a key value and a path value of each candidate lumen boundary point, wherein the path value represents the estimated value of the shortest path from the starting point to the candidate lumen boundary point;
calculating the path value of the node to be analyzed;
and determining the candidate cavity boundary point as the next node under the condition that the candidate cavity boundary point meets the following formula:
the path value of the node to be analyzed+the key value of the candidate cavity boundary point < the path value of the candidate cavity boundary point;
updating the path value of the next node as follows: and the sum of the path value of the node to be analyzed and the key value of the candidate anatomical cavity boundary point.
In one possible embodiment, after splitting and layering the road network, the method further includes:
setting all the storage strategies of the hierarchy as initial storage strategies, wherein the initial storage strategies are as follows: no path information is stored;
traversing sequentially from a high level to a low level according to the size of available storage resources, and updating the storage strategies of a plurality of levels into a second storage strategy, wherein the second storage strategy is as follows: storing path information between every two of all section boundary points of each section of the hierarchy;
And under the condition that the storage strategies of all the levels can be updated to be the second storage strategy, traversing from a high level to a low level in sequence according to the size of the residual available storage resources, and updating the storage strategies of a plurality of levels to be a third storage strategy, wherein the third storage strategy is as follows: path information between all nodes of the hierarchy is stored.
In a possible implementation manner, the obtaining an optimal path according to the path node list includes:
according to the node sequence in the path node list, two nodes which are arbitrarily adjacent to each other in the path node list are set to be a first node and a second node, the level of the first node is a low level, and the level of the second node is a higher level;
determining whether the first node and the second node are adjacent in the low level;
obtaining a shortest path between the first node and the second node in the case where the first node and the second node are adjacent in the low hierarchy;
determining, in the case where the first node and the second node are not adjacent in the low hierarchy, whether a shortest path between the first node and the second node is stored according to a storage policy of the low hierarchy;
In the case that the shortest path between the first node and the second node is stored in the low level, the shortest path between the first node and the second node is directly obtained from stored data;
and under the condition that the shortest path between the first node and the second node is not stored in the low level, calculating the shortest path between the first node and the second node by utilizing a shortest path algorithm.
In one possible implementation, according to the path node list, the first node is determined to be located between a third node and the second node, and after determining the shortest path between the first node and the second node, the method further includes:
determining a plurality of intermediate nodes through which a shortest path between the first node and the second node passes;
determining a target intermediate node from the plurality of intermediate nodes, wherein the target intermediate node is the node of which the last level is the same as the level of the first node when the plurality of intermediate nodes are arranged according to the node sequence;
updating the shortest path to a path between the target intermediate node and the second node;
A path between the third node and the target intermediate node is recalculated.
In a possible implementation manner, the determining the next node according to the position information of the node to be analyzed and the position information of the end point includes:
according to the position information of the node to be analyzed and the position information of the end point, determining that the level of the node to be analyzed is higher than the level of the end point, and in the level of the higher level of the node to be analyzed, under the condition that the node to be analyzed and the end point are located in the same profile cavity:
when the node to be analyzed and the end point are positioned in the same profile cavity in the level where the node to be analyzed is positioned, determining the next node from a plurality of candidate profile cavity boundary points of the profile cavity where the node to be analyzed is positioned in a level lower than the level where the node to be analyzed is positioned;
when the node to be analyzed and the end point are not located in the same cavity in the level where the node to be analyzed is located, determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level where the node to be analyzed is located;
and determining that the level of the node to be analyzed is higher than the level of the end point according to the position information of the node to be analyzed and the position information of the end point, and determining the next node in a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level of the higher level of the node to be analyzed under the condition that the node to be analyzed and the end point are not located in the same cavity in the level of the higher level of the node to be analyzed.
A second aspect of an embodiment of the present application provides a path planning apparatus, including:
the layering module is used for carrying out subdivision layering on the road network to obtain a plurality of layers and a plurality of dissection cavities of each layer, each dissection cavity comprises a plurality of nodes, and the nodes are divided into dissection cavity boundary points and dissection cavity inner nodes; the nodes comprise a starting point and an ending point of path planning;
the queue construction module is used for constructing a priority queue, setting the key value of the starting point to 0 and adding the key value into the priority queue; the key value represents the estimated value of the node;
the selecting module is used for executing the node selecting step to be analyzed: selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node to be analyzed into a node list;
the next node determining module is configured to perform the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node;
the repeating module is used for repeating the node selection step to be analyzed and the next node determination step until the next node is the end point;
A path node list obtaining module, configured to start to circularly access the path mapping table from the end point until the access obtains the start point, and obtain a path node list from the start point to the end point;
and the optimal path determining module is used for obtaining an optimal path according to the path node list.
A third aspect of the embodiments of the present application provides an electronic device, including a memory, a processor and a computer program stored on the memory, where the processor executes the computer program to implement the steps in the path planning method according to any one of the first aspect of the embodiments of the present application.
The embodiment of the application provides a path planning method, a path planning device and electronic equipment, wherein the method comprises the following steps: splitting and layering the road network to obtain a plurality of layers and a plurality of splitting cavities of each layer, wherein each splitting cavity comprises a plurality of nodes, and the nodes are divided into splitting cavity boundary points and splitting cavity inner nodes; the nodes comprise a starting point and an ending point of path planning; constructing a priority queue, setting the key value of the starting point to 0, and adding the key value into the priority queue; the key value represents the estimated value of the node; selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node u to be analyzed into a node list; executing the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node; repeating the node selection step and the next node determination step until the next node is the endpoint; circularly accessing the path mapping table from the end point until the access to the start point is obtained, and obtaining a path node list from the start point to the end point; and obtaining an optimal path according to the path node list. According to the embodiment of the application, the next node is determined according to the priority of the node and the position information of the current node and the terminal point, the information of a plurality of nodes from the starting point to the terminal point is obtained, a corresponding path node list is generated, and finally an optimal path is generated according to the path node list, so that the optimal path is rapidly and efficiently determined. Compared with a method for directly traversing all paths, the method for traversing all paths has the advantages that through subdivision layering, the intermediate nodes from the starting point to the end point are determined, then the optimal paths are determined, storage space is saved, and calculation efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a step flowchart of a path planning method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a node distribution provided in an embodiment of the present application;
FIG. 3 is a flowchart of a step of optimal path planning according to an embodiment of the present application;
fig. 4 is a schematic distribution diagram of a path planning apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the related art, the path planning algorithm of the main flow is a customizable path planning algorithm (customizable route planning, CRP), and the main flow idea is to precisely calculate based on layering (one level of subdivision for each layer) of the Dijkstra algorithm. However, the calculation process of the method is too complex, the practical application efficiency is not high, and a faster calculation method is needed in a practical application scene. If the calculation time is replaced by the storage space, all the optional paths are stored, the shortest path is determined from the stored paths, and the excessive storage space is needed. For example, assuming that graph G has N points in total, if all possible paths are stored, storage space for N square paths is required, and when the value of N is large, an unacceptable memory capacity is often associated.
Furthermore, another possible idea of path planning is heuristic path optimization, which represents an algorithm that is a well-known a-algorithm that in most cases can find a relative optimal solution in far fewer steps than the Dijkstra algorithm. Unlike the same-priority traversal of Dijkstra's algorithm, the a-x algorithm assigns a different priority to each point to be explored according to heuristic rules associated with the objective when finding the next explored point, thereby making it relatively easier for those points that are intuitively closer to the objective to be preferentially computed.
However, in the above method, the CRP algorithm is complicated in calculation step or the required storage capacity is too large, the a algorithm allocates a priority to each point to be explored when the priority is required, and in practical application, the number of points to be explored to be calculated is often too large, resulting in long time required in the whole calculation process.
In order to improve the related technology, the embodiment of the application provides a path planning method, a path planning device and electronic equipment, and in order to improve the path planning efficiency, an optimal path is obtained by using smaller computing resources and storage capacity. The following describes in detail a path planning method, a path planning device and an electronic device provided by the embodiments of the present application through some embodiments and application scenarios thereof with reference to the accompanying drawings.
A first aspect of the embodiments of the present application provides a path planning method, referring to fig. 1, fig. 1 shows a step flowchart of the path planning method, as shown in fig. 1, where the method includes:
step S101, splitting and layering a road network to obtain a plurality of layers and a plurality of splitting cavities of each layer, wherein each splitting cavity comprises a plurality of nodes, and the nodes are divided into splitting cavity boundary points and splitting cavity inner nodes; the plurality of nodes include a start point and an end point of path planning.
The road network is represented in a certain area, has a traffic system composed of all roads, and contains path information of a map of the whole area. The road network is split and layered, and when the road network is implemented specifically, the road network can be split and layered by using a CRP algorithm, and the specific layering method is not limited in this embodiment.
By splitting the hierarchy, multiple levels can be obtained, each representing a map of different scale, similar to the levels of the map. Each hierarchy includes a plurality of dissections, one dissecting representing a sub-region, an exemplary metropolitan area map as a hierarchy including Wu Houou, the mall and the high-new areas, each as a dissecting, the dissections being adjacent to one another to collectively form a hierarchy. Each profile cavity comprises a plurality of nodes, wherein among the nodes of the profile cavity, the node positioned in the profile cavity is a node in the profile cavity, and the node positioned at the profile cavity boundary is a profile cavity boundary point. The plurality of nodes includes a start point and an end point of path planning. For each node, it may belong to one or more levels at the same time, and the levels of the node to be analyzed referred to hereinafter all refer to the highest level to which the node to be analyzed belongs. The starting point of the path planning is set at the lowest level, and the ending point of the path planning is set as the boundary point of the dissection cavity at the highest level.
In one possible embodiment, after splitting and layering the road network, the method further includes:
step S201, setting all the storage policies of the hierarchy as an initial storage policy, where the initial storage policy is: no path information is stored;
step S202, traversing from a high level to a low level in sequence according to the size of the available storage resources, and updating the storage strategies of the multiple levels into a second storage strategy, wherein the second storage strategy is as follows: storing path information between every two of all section boundary points of each section of the hierarchy;
step S203, when all the storage policies of the hierarchy can be updated to the second storage policy, traversing sequentially from a high hierarchy to a low hierarchy according to the size of the remaining available storage resources, and updating the storage policies of the plurality of hierarchies to a third storage policy, where the third storage policy is: path information between all nodes of the hierarchy is stored.
In the related art, after splitting and layering are performed by using a CRP algorithm, in order to improve the optimal path calculation efficiency as much as possible, save calculation time, all possible paths in the road network are stored in advance, so that the optimal path is directly determined from the stored paths. However, the method needs a large amount of storage resources, and under the condition of large road network coverage area and more nodes, the actual storage resources often cannot meet the requirements.
The present embodiment proposes to set different storage policies according to the available storage resources of different tiers. After the split layering is completed, for any one of the levels, three different storage strategies can be employed: 1) Initial storage policy: no path information is stored. 2) Second storage policy: path information between every two dissecting cavity boundary points of every dissecting cavity in the hierarchy is stored. 3) Third storage policy: path information between every two nodes of each profile within the hierarchy is stored.
In the specific implementation, step S201 is executed first, where each level is set to default to the first policy, and all levels of storage policies are set to the initial storage policies, and no path information is stored. Then, step S202 is executed to sequentially traverse from a high level to a low level, and update the storage policies of the multiple levels to a second storage policy according to the size of the available storage resources, where the second storage policy is: path information between every two of all the section boundary points of each section of the hierarchy is stored. For example, if there are 10 tiers and 100M storage resources, traversing from a high tier to a low tier in sequence, and if the 10 th tier needs 50M storage resources for executing the second storage policy, and if the storage resources can be satisfied, updating the 10 th tier storage policy to the second storage policy; 30M is needed for the 9 th level, and correspondingly updating the 9 th level storage strategy into a second storage strategy; 20M is needed for the 8 th level, and correspondingly updating the storage strategy of the 8 th level into a second storage strategy; level 7 requires 10M, however, the remaining storage resources are 0, and the demand cannot be satisfied, so the storage resources from level 7 to level 1 are kept as the initial storage policy.
Then, step S203 is executed, where the storage resources are sufficient to set all the storage policies of the hierarchy as the second storage policy, and according to the remaining storage resources, the storage policies of the plurality of hierarchies are traversed from the high hierarchy to the low hierarchy again, and updated as the third storage policy, where the third storage policy is: path information between all nodes of the hierarchy is stored. For example, if there are 10 tiers in total, after setting all the storage policies of the tiers as the second storage policy, 100M storage resources remain, traversing from the higher tier to the lower tier in sequence, updating the second storage policy as the third storage policy by the 10 th tier, requiring 80M storage resources, and updating the storage policy of the 10 th tier as the third storage policy if the storage resources can be satisfied; updating the level 9 from the second storage policy to the third storage policy requires 50M, but the remaining storage resources are 20M, which cannot meet the demand, so the level 9 to level 1 storage resources are kept as the second storage policy.
According to the embodiment of the application, the storage strategies are divided into the initial storage strategy, the second storage strategy and the third storage strategy, and the storage strategies of each level are flexibly set according to the storage resources, so that the availability of the path planning method can be improved, and the method is prevented from being limited by the storage resources.
Step S102, constructing a priority queue, setting a key value of the starting point to 0, and adding the key value into the priority queue; the key value represents the estimated value of the node.
Referring to fig. 3, fig. 3 shows a flowchart of an optimal path planning step, as shown in fig. 3, a priority queue U is constructed, where the priority queue includes a plurality of nodes to be explored, each node to be explored has a corresponding key value, where the key value represents an estimated value of the node, and the smaller the key value is, the higher the priority is. The key value may be calculated by a corresponding path planning algorithm. Specifically, the calculation may be performed by using the formula f (n) =g (n) +h (n) in an algorithm a, where the size of f (n) represents a key value. g (n) represents the movement cost from the node to be analyzed to the node, along the path generated to reach the node. h (n) represents the estimated cost of moving from the node to the endpoint, so the f (n) or key value represents the total cost or estimated total value through the node. The key value may also be calculated using an a-x algorithm, for example. Heuristic search of Dijkstra algorithm can be used, where when the key value is g (n) is implemented, the key value of the starting point is set to 0, and the starting point is added to the priority queue (r is as the structure U in fig. 3, the starting point s is added, and the key=0 of the starting point s is set).
Step S103, executing a node selection step to be analyzed: and selecting the node with the minimum key value in the priority queue as a node to be analyzed, dequeuing the node to be analyzed, and pushing the node to be analyzed into a node list.
In a specific implementation, when the priority queue is not empty, the node with the smallest key value is selected as the node to be analyzed to dequeue, that is, the node with the highest priority is selected as the node to be analyzed (as shown in fig. 3, when the priority queue U is not empty, the queue node U is taken out and is used as the node to be analyzed). And pushing the node to be analyzed into a node list, wherein the node list is used for storing node information of the node to be analyzed, such as position information, key value information and the like of the node to be analyzed. Since the starting point is added to the priority queue in step S102 and the key value of the starting point is 0, the priority of the starting point is highest, and the starting point is typically dequeued as the first node to be analyzed first.
Step S104, the next node determining step is performed: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; and updating a path mapping table by using the next node.
In the implementation, the position information of the node to be analyzed mainly represents the information of the level where the node to be analyzed is located, the information of the profile cavity where the node to be analyzed is located, and the position information of the terminal point mainly represents the information of the level where the terminal point is located and the information of the profile cavity where the terminal point is located. The next node is determined according to the information of the two nodes, specifically, a different priority can be allocated to each point to be explored by using an a-x algorithm, so that the points which are intuitively closer to the target are relatively easier to be preferentially calculated. And the next node represents the next node which the optimal path needs to pass through after passing through the node to be analyzed. And updating a path mapping table by using the next node, wherein the path mapping table is used for representing the path driving direction or the node sequence, and the driving direction is driven by the node to be analyzed to the next node in the optimal path. For example, P (t) =u, indicating that the planned path is the direction of travel from the u node to the t node.
In practice, there are three possibilities for the relationship between the node to be analyzed and the endpoint: the first case is a different profile cavity where the two nodes are at different levels; the second case is a different profile cavity where the two nodes are at the same level; the third case is the same lumen where both nodes are at the same level. For the first case, the node to be analyzed needs to draw close to the level boundary where the terminal is located by using a heuristic strategy of an A-algorithm, and continuously proceeds to the boundary of the level until the relation between the node to be analyzed and the terminal accords with the second case or the third case. For the second case, the node to be analyzed needs to be close to the boundary of the profile cavity where the endpoint is located until the relationship with the endpoint accords with the third case. For the third case, the nodes to be analyzed can be directly close to the end point.
Step S105, repeating the node selection step and the next node determination step until the next node is the endpoint.
Since in step S104, the next node is added to the priority queue, step S103 is performed again, and a new node to be analyzed is determined (in general, in the priority queue, the priority of the "next node" that has just been added to the queue is highest, and is the "node to be analyzed" dequeued), so that step S104 is repeatedly performed according to the new node to be analyzed, and the new next node is obtained until the next node is the end point, which means that all intermediate nodes from the start point to the end point are determined.
And S106, starting to circularly access the path mapping table from the end point until the access to the start point is obtained, and acquiring a path node list from the start point to the end point.
In the implementation, after the execution of step S105 is completed, a path mapping table and a node list are obtained. The path mapping table P includes: the direction of node mapping between a plurality of nodes in the path from the start point s to the end point t. The node information of all the nodes to be analyzed is included in the final node list (the nodes in the node list are the nodes to be analyzed pushed into the node list each time step S103 is performed). Since the path mapping table can only store mapping direction information between nodes, it is necessary to combine node information in the node list to generate a path node list (as shown in fig. 3, calculate a path node list L). The path node list includes node order and node position information of a plurality of path nodes in a path from a start point s to an end point t.
In specific implementation, the path node list L is sequentially accessed, any two adjacent list nodes a and b are acquired, wherein the level of one node with the smallest level is lm (as shown in fig. 3, a, b and lm are acquired), and if lm is not equal to 0, an intermediate node between a and b is recursively acquired until lm is equal to 0. So that nodes in the final path node list L can all be displayed on level 0.
And step S107, obtaining an optimal path according to the path node list.
According to the embodiment of the application, the next node is determined according to the priority of the nodes and the position information of the profile cavity according to the current levels of the nodes and the terminal, the information of a plurality of nodes from the starting point to the terminal is obtained, a corresponding path node list is generated, and finally an optimal path is generated according to the path node list, so that the optimal path is determined quickly and efficiently. Compared with a method for directly traversing all paths, the method for traversing all paths has the advantages that through subdivision layering, the intermediate nodes from the starting point to the end point are determined, then the optimal paths are determined, storage space is saved, and calculation efficiency is improved.
In a possible implementation manner, step S104, determining a next node according to the location information of the node to be analyzed and the location information of the endpoint, further includes:
Step S1041, determining, according to the position information of the node to be analyzed and the position information of the end point, that the level of the node to be analyzed is lower than the level of the end point, and determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a level higher than the level of the node to be analyzed.
In the implementation, if the level of the node to be analyzed is lower than the level of the endpoint, the node to be analyzed needs to be close to the level of the endpoint in order to be close to the endpoint, so that the next node is determined from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level higher than the level where the node to be analyzed is located. Wherein, since a node may belong to multiple levels at the same time, the level where the endpoint is located represents the level where the endpoint exists as a lumen boundary point. Illustratively, at level 4, the node to be analyzed is at level 10 (the endpoint exists as a lumen boundary point in level 10), and in order to approach the endpoint, the next node is determined from the boundary points of the lumen where the node to be analyzed is located in level 5, so that the next node approaches the endpoint more hierarchically. Specifically, a key value of each of a plurality of candidate lumen boundary points may be calculated using an a-algorithm, and then a next node may be determined from the key values. As shown in fig. 3, lu represents the level of the node to be analyzed, lt represents the level of the endpoint t, and when lu is smaller than lt, B (U, lu+1) is traversed, namely, the boundary points of the profile where all U are located are traversed from the lu+1 level, the key value of each point is calculated by using an a-x algorithm, finally, the next node a is obtained, and the node is added into the priority queue U.
Step S1042, determining the next node according to the position information of the node to be analyzed and the position information of the end point, where the node to be analyzed and the end point are at the same level, and the position of the cavity where the node to be analyzed and the end point are located.
When the node to be analyzed and the endpoint are located at the same level, there may be two cases: one is that the node to be analyzed and the end point are not in the same profile cavity, and the other is that the node to be analyzed and the end point are in the same profile cavity.
In a possible implementation manner, the step S1042, when the node to be analyzed and the endpoint are at the same level, determines the next node according to the position of the cavity where the node to be analyzed and the endpoint are located, includes:
step S1042a, determining, according to the position of the cavity where the node to be analyzed and the end point are located, that in a level higher than the level where the node to be analyzed is located, the next node is determined from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a level higher than the level where the node to be analyzed is located when the node to be analyzed and the end point are not located in the same cavity.
In a specific implementation, the node to be analyzed and the end point are in the same level (when lu=lt) as shown in fig. 3, but when two nodes are not in the same cavity in a level higher than the level in which the node to be analyzed is located (when C (U, lt+1) is not equal to C (t, lt+1) as shown in fig. 3), the node needs to be drawn toward the end point, so that from the level higher than the level in which the node to be analyzed is located, a plurality of candidate cavity boundary points of the cavity in which the node to be analyzed is located (as shown in fig. 3, B (U, lu+1) are traversed), a next node is determined, that is, the cavity boundary points of the cavity in which all U is located are traversed from the level lu+1, the key value of each point is calculated by using an a-algorithm, and finally the next node a is obtained, and the node is added into the priority queue U. Since a node may belong to multiple levels at the same time, the level of the node to be analyzed is the highest level of the node to be analyzed, and when the node to be analyzed and the node to be analyzed are not in the same cavity, the next node needs to be determined from multiple candidate cavity boundary points of the cavity where the node to be analyzed is located in a higher level. Illustratively, the node to be analyzed is at the 9 th level, the end point is at the 9 th level, the profile cavities where the two nodes are at the 10 th level are not the same profile cavity, and in order to approach the end point, the next node is determined from the boundary points of the profile cavities where the node to be analyzed is at the 10 th level, so that the next node approaches the end point more on the 10 th level. Specifically, a key value of each of a plurality of candidate lumen boundary points may be calculated using an a-algorithm, and then a next node may be determined from the key values.
In step S1042b, in a level higher than the level of the node to be analyzed, the node to be analyzed and the endpoint are determined to be the next node under the condition that the node to be analyzed and the endpoint are in the same profile.
In a specific implementation, in a level higher than the level of the node to be analyzed, the node to be analyzed and the endpoint are in the same level, and when the node to be analyzed and the endpoint are in the same cavity (when C (u, lt+1) is equal to C (t, lt+1) as shown in fig. 3), the endpoint can be directly determined as the next node (when P (t) =u) is set as shown in fig. 3), which indicates that the nodes between the start point and the endpoint are all determined completely. Illustratively, the node to be analyzed is at the 9 th level, the end point is at the 9 th level, the profile cavities where the two nodes are at the 10 th level are the same profile cavity, and the next node can be directly determined as the end point.
In one possible implementation manner, the determining the next node from among a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a level higher than the level where the node to be analyzed is located includes:
step S301, calculating a key value and a path value of each candidate lumen boundary point, where the path value represents an estimated value of a shortest path from the start point to the candidate lumen boundary point.
In particular implementations, the key value and path value g (a) of the candidate lumen boundary point a may be utilized using a bi-directional a-algorithm. Where g (a) represents the estimated value or cost of the shortest path from the start point to the candidate lumen boundary point a.
Step S302, calculating the path value of the node to be analyzed;
in the implementation, by the same method (bi-directional a-algorithm) as in step S301, a path value g (u) of the node u to be analyzed is calculated, where the path value represents the value of the shortest path from the start point to the node u to be analyzed.
Step S303, determining the candidate lumen boundary point as the next node if the candidate lumen boundary point satisfies the following formula:
the path value of the node to be analyzed+the key value of the candidate cavity boundary point < the path value of the candidate cavity boundary point;
referring to fig. 2, fig. 2 shows a schematic distribution of nodes, and an arrow indicates a path direction as shown in fig. 2. Wherein, as shown in fig. 3, when g (u) +key < g (a), g (u) represents the cost or the path value of the path L1 from the starting point s to the node u to be analyzed, and key represents the cost or the value of the node u to be analyzed to the candidate lumen boundary point a, and represents the cost or the path value of the shortest path L2 from the starting point s to the candidate lumen boundary point a. Therefore, when the total cost of the path from the starting point s to the node u to be analyzed to the candidate cavity boundary point a is smaller than the total cost from the starting point s to the candidate cavity boundary point a, the candidate cavity boundary point a is on the optimal path. If all the candidate lumen boundary points do not satisfy the formula, the process returns to step S102.
Step S304, updating the path value of the next node as follows: and the sum of the path value of the node to be analyzed and the key value of the candidate anatomical cavity boundary point.
In addition, after determining the next node, the path value of the next node is updated as follows: the sum of the path value of the node to be analyzed and the key value of the candidate lumen boundary point, i.e., g (a) =g (u) +key. It should be noted that the node to be analyzed and the next node represent key nodes in the optimal path, and a plurality of child nodes exist between the two nodes. As shown in fig. 3, after determining the next node, the path a is obtained, that is, the shortest path from the node u to be analyzed to the next node a, or the shortest path, can be calculated by using an algorithm aA plurality of child nodes passing through: u--/>-……-/>-a. Therefore, in this embodiment, the key value and the path value are calculated by using the bidirectional a-algorithm, so that from a plurality of boundary points of the profile cavity, a next node is determined, so that the next node is located on an optimal path, as shown in fig. 3, after the next node is determined, the a-path is obtained, the path value g (a) =g (u) +key of the node is updated, and the path mapping table is updated, that is, a new path mapping table is generated with the node to be analyzed. Correspondingly, the update path mapping table is: p (a) = = >,P(/>)=/>,…,P(/>) =u. After adding the next node a to the priority queue U, the process returns to step S102.
In a possible implementation manner, the step S104 of determining a next node according to the location information of the node to be analyzed and the location information of the endpoint includes:
according to the position information of the node to be analyzed and the position information of the end point, determining that the level of the node to be analyzed is higher than the level of the end point, and in the level of the higher level of the node to be analyzed, under the condition that the node to be analyzed and the end point are located in the same profile cavity:
step S1043, when the node to be analyzed and the end point are located in the same cavity in the level where the node to be analyzed is located, determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a level lower than the level where the node to be analyzed is located.
Step S1044, when the node to be analyzed and the end point are not located in the same cavity in the level where the node to be analyzed is located, determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level where the node to be analyzed is located.
In practice, when the level of the node to be analyzed u is higher than the level of the endpoint t (as shown in fig. 3, lu is greater than lt), there are two cases, one is that in the higher level, the node to be analyzed u is in the same profile cavity as the endpoint t (as shown in fig. 3, C (u, lu+1) is equal to C (t, lu+1)); the other is that in the higher level (lu+1), the node to be analyzed is not in the same lumen as u endpoint t (as shown in fig. 3, C (u, lu+1) is not equal to C (t, lu+1)).
In the first case, there are also two possibilities: one possibility is that in the level (lu) where the node to be analyzed is located, the node to be analyzed u and the endpoint t are located in the same lumen (as shown in fig. 3, C (u, lu) is equal to C (t, lu)); another possibility is that in the level (lu) where the node to be analyzed is located, the node to be analyzed u and the endpoint t are not located in the same lumen (as shown in fig. 3, C (u, lu) is not equal to C (t, lu)).
In the first possibility, in order to approach the endpoint t, step S1043 is performed, so that the next node is determined from among the plurality of candidate lumen boundary points of the lumen in which the node to be analyzed is located (as shown in fig. 3, traversal B (u, lu-1)) in the hierarchy (lu-1) lower than the hierarchy (lu) in which the node to be analyzed is located. The node to be analyzed is at the 10 th level, the terminal point is at the 8 th level, the profile cavities where the two nodes are at the 10 th level are the same profile cavity, and in order to get close to the terminal point, the next node is determined from the boundary points of the profile cavity where the node to be analyzed is at the 9 th level, so that the next node is closer to the terminal point at the 9 th level. Specifically, a key value and a corresponding path value of each of a plurality of candidate lumen boundary points may be calculated by using an a-x algorithm, and then according to the formula: g (u) +key < g (a), from which the next node a is determined.
In the second possibility, in order to approach the end point t, step S1044 is performed to approach the lumen where the end point t is located, so that the next node is determined from among the plurality of candidate lumen boundary points (as shown in fig. 3, traversal B (u, lu)) of the lumen where the node to be analyzed is located in the hierarchy (lu) where the node to be analyzed is located. The node to be analyzed is at the 10 th level, the end point is at the 8 th level, the profile cavities where the two nodes are at the 10 th level are not the same profile cavity, and in order to close towards the end point, the next node is determined from the boundary points of the profile cavities where the node to be analyzed is at the 10 th level, so that the next node is closer to the end point at the 10 th level, and the profile cavities where the two nodes are at the 10 th level are the same profile cavity. Specifically, a key value and a corresponding path value of each of a plurality of candidate lumen boundary points may be calculated by using an a-x algorithm, and then according to the formula: g (u) +key < g (a), from which the next node a is determined.
Step S1045, determining, according to the position information of the node to be analyzed and the position information of the end point, that the level of the node to be analyzed is higher than the level of the end point, and determining, in the level of the node to be analyzed that is higher than the level of the node to be analyzed, the next node in the multiple candidate cavity boundary points of the cavity where the node to be analyzed is located if the node to be analyzed and the end point are not located in the same cavity in the level of the node to be analyzed that is higher than the level of the node to be analyzed.
In the second case (in the higher level (lu+1), the node to be analyzed is not in the same lumen as u-terminal t), step S1045 is performed in order to approach toward terminal t. The nodes are close to the level where the terminal point t is located, so that the next node is determined from a plurality of candidate cavity boundary points (as shown in fig. 3, traversing B (u, lu+1)) of the cavities where the node to be analyzed is located in a level (lu+1) higher than the level where the node to be analyzed is located. The node to be analyzed is at the 10 th level, the end point is at the 8 th level, the profile cavities where the two nodes are at the 10 th level are not the same profile cavity, and in order to get close to the end point, the next node is determined from the boundary points of the profile cavities where the node to be analyzed is at the 11 th level, so that the profile cavities where the two nodes are at the 11 th level are the same profile cavity. Specifically, a key value and a corresponding path value of each of a plurality of candidate lumen boundary points may be calculated by using an a-x algorithm, and then according to the formula: g (u) +key < g (a), from which the next node a is determined.
In a possible implementation manner, the step S107, according to the path node list, obtains an optimal path, including:
step S1071, according to the order of the nodes in the path node list, two nodes arbitrarily adjacent to the path node list are set as a first node and a second node, the level of the first node is a low level, and the level of the second node is a higher level.
In a specific implementation, the path node list includes a plurality of path nodes and a node sequence of the plurality of path nodes. Illustratively, the path node list P1 may be expressed as: starting point S-A-B-C-D-E-F-G-end point T. For any two nodes in the path node list, if the levels (the highest levels corresponding to the two nodes) of the two nodes are different, the node with the higher level is called a second node, the node with the lower level is called a first node, and a plurality of child nodes exist between the two nodes. Illustratively, of the two nodes B and C, if the node B is located at the 7 th level and the node C is located at the 8 th level, the node B is correspondingly regarded as the first node and the node C is regarded as the second node. As shown in fig. 3, the first node corresponds to the second node with nodes a and b, and the low level in the two corresponds to lm.
Step S1072, determining whether the first node and the second node are adjacent in the low hierarchy. As shown in fig. 3, it is determined whether a and b are adjacent in the lm hierarchy.
Step S1073, where the first node and the second node are adjacent in the low hierarchy, obtaining a shortest path between the first node and the second node.
And under the condition that two nodes are directly adjacent at a low level, the two nodes are very close to each other, a plurality of child nodes do not exist between the two nodes, and the shortest path between the two nodes can be directly acquired.
Step S1074, determining, if the first node and the second node are not adjacent in the low hierarchy, whether a shortest path between the first node and the second node is stored according to the low hierarchy storage policy.
For the case where two nodes are not adjacent in the low hierarchy, the shortest path needs to be determined according to the storage policy in the low hierarchy. Specifically, different storage strategies are set according to available storage resources of different levels. After the split layering is completed, for any one of the levels, three different storage strategies can be employed: 1) Initial storage policy: no path information is stored. 2) Second storage policy: path information between every two dissecting cavity boundary points of every dissecting cavity in the hierarchy is stored. 3) Third storage policy: path information between every two nodes of each profile within the hierarchy is stored.
Step S1075, when the shortest path between the first node and the second node is stored in the low hierarchy, the shortest path between the first node and the second node is directly obtained from the stored data.
Therefore, when the low level is the 3 rd storage policy, the information of the shortest path between the first node and the second node is stored in advance, and the information can be obtained directly (as shown in fig. 3, when it is determined that the ab path is stored, the storage path is directly read). When the low level is the second storage policy, if the first node and the second node are the cavity boundary points, the information of the shortest path between the first node and the second node is stored in advance, if the first node and the second node are not the cavity boundary points, the information of the shortest path between the first node and the second node is not stored in advance, and when the low level is the initial storage policy, the shortest path between the first node and the second node cannot be directly obtained.
Step S1076, when the shortest path between the first node and the second node is not stored in the low hierarchy, calculating the shortest path between the first node and the second node by using a shortest path algorithm.
When the shortest path between the first node and the second node is not stored in advance, the path may be calculated using a shortest path algorithm. Specifically, a bi-directional a-x algorithm may be utilized to obtain the shortest path between two nodes. As shown in fig. 3, the paths are calculated using a bi-directional a-algorithm.
On one hand, according to the embodiment, different storage strategies are set for different levels, so that storage resources are utilized to the maximum extent, and the storage strategies are flexibly set; on the other hand, according to different storage strategies, different methods for acquiring the shortest paths are selected, the storage resources are fully utilized to store the path information, and the path information is stored as much as possible on the basis of the existing storage resources, so that the calculation resources are saved, and the path planning efficiency is improved.
In one possible implementation, the first node is located intermediate to the third node and the second node, and after determining the shortest path between the first node and the second node, the method further includes:
step S108, determining a plurality of intermediate nodes through which the shortest path between the first node and the second node passes.
In a specific implementation, a plurality of intermediate nodes or child nodes are also included between the first node and the second node. According to the determined shortest path from the first node to the second node, the node sequence of a plurality of intermediate nodes in the shortest path can be determined. For example, for both nodes B and C, the shortest path L1 is determined, along with a plurality of intermediate nodes on that path: b→b1→b2→b3→b4→b5→b6→b7→c.
Step S109, determining a target intermediate node from the plurality of intermediate nodes, where the last node is the same as the first node in the hierarchy when the plurality of intermediate nodes are arranged in the node sequence. As shown in fig. 3, calculateThe current path is a->The last point in the order which is identical to the level of a is +.>。/>
When the first node and the second node are in different levels, for a plurality of intermediate nodes between the two nodes, there may be a part of intermediate nodes having the same level as the first node and a part of intermediate nodes having the same level as the second node. For two nodes, namely B and C, a plurality of intermediate nodes are determined as follows: b→b1→b2→b3→b4→b5→b6→b7→c. Wherein, the levels of B1, B2, B3 and the node B are the 7 th level, the rest B4, B5 are the 8 th level, and the levels of B6, B7 and the node C are the 9 th node. Correspondingly, B3 is determined as a target intermediate node, and B3 is the last node in all intermediate nodes, which is the same as the level of the first node (node B).
Step S110, updating the shortest path to a path between the target intermediate node and the second node.
For example, for two nodes B and C, the shortest path originally determined is L1, i.e.: b→b1→b2→b3→b4→b5→b6→b7→c. Updating the shortest path to be L2 according to the determined target intermediate node b3, wherein the path is as follows: b3→b4→b5→b6→b7→c.
Step S111, recalculating a path between the third node and the target intermediate node.
In the path node list, the first node is set to be positioned between the third node and the second node: third node → first node → second node. According to the method of the above embodiment, it is known that the level at which the nodes are located gradually approaches the level at which the end points are located in the order of the nodes, so that the level at which the nodes are located gradually increases in the order of the nodes in the path node list. For example, for both nodes B and C, the original shortest path L1 (b→b1→b2→b3→b4→b5→b6→b7→c) is updated to L2 (b3→b4→b5→b6→b7→c). The node B is a first node, the node C is a second node, and the node B is a path node list: the starting point S-A-B-C-D-E-F-G-end point T, the node A is a third node, the path from the node B to the node B3 is added to the path from the node A to the node B, and path calculation is carried out together, namely the shortest path from the node A to the node B3 is recalculated. Since the node B is the same as the node B3 in the hierarchy, in the case where the shortest path from the node a to the node B can be determined, the shortest path from the node a to the node B3 can be determined correspondingly. Since node B3 is closer to the endpoint than node B, there may be a better shortest path between node a and node B3.
In practice, the preamble section is modified as shown in fig. 3. After the corrected road section is obtained, the current road section is recorded. And acquiring another pair of adjacent nodes according to the path node list L again, thereby determining the optimal path between the two nodes. And after the optimal paths among all the nodes are determined, splicing to obtain the final optimal path from the starting point to the end point. Therefore, the embodiment of the application further determines the currently planned path as the optimal path by re-dividing the road sections according to the level of the intermediate node and planning the node of one level in one road section as much as possible.
The second aspect of the embodiments of the present application further provides a path planning device, referring to fig. 4, fig. 4 shows a schematic distribution diagram of the path planning device, as shown in fig. 4, where the system includes:
the layering module is used for carrying out subdivision layering on the road network to obtain a plurality of layers and a plurality of dissection cavities of each layer, each dissection cavity comprises a plurality of nodes, and the nodes are divided into dissection cavity boundary points and dissection cavity inner nodes; the nodes comprise a starting point and an ending point of path planning;
the queue construction module is used for constructing a priority queue, setting the key value of the starting point to 0 and adding the key value into the priority queue; the key value represents the estimated value of the node;
The selecting module is used for executing the node selecting step to be analyzed: selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node to be analyzed into a node list;
the next node determining module is configured to perform the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node;
the repeating module is used for repeating the node selection step to be analyzed and the next node determination step until the next node is the end point;
a path node list obtaining module, configured to start to circularly access the path mapping table from the end point until the access obtains the start point, and obtain a path node list from the start point to the end point;
and the optimal path determining module is used for obtaining an optimal path according to the path node list.
In one possible implementation manner, the next node determining module includes:
the first determining submodule is used for determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a higher level of the level where the node to be analyzed is located under the condition that the level where the node to be analyzed is located is lower than the level where the terminal is located according to the position information of the node to be analyzed and the position information of the terminal;
And the second determining submodule is used for determining the next node according to the position information of the node to be analyzed and the position information of the end point under the condition that the node to be analyzed and the end point are in the same level and the position of the profile cavity where the node to be analyzed and the end point are located.
In one possible embodiment, the second determining sub-module includes:
the first determining unit is configured to determine, according to the position of the to-be-analyzed node and the position of the end point in the cavity, that the next node is determined from a plurality of candidate cavity boundary points of the cavity where the to-be-analyzed node is located in a level higher than the level where the to-be-analyzed node is located in the cavity, when the to-be-analyzed node and the end point are not in the same cavity;
and the second determining unit is used for determining the endpoint as the next node under the condition that the node to be analyzed and the endpoint are in the same profile cavity in a level higher than the level of the node to be analyzed.
In one possible embodiment, the first determining unit includes:
a predicted value calculation subunit, configured to calculate a key value and a path value of each candidate lumen boundary point, where the path value represents a predicted value of a shortest path from the start point to the candidate lumen boundary point;
A path value calculation subunit, configured to calculate a path value of the node to be analyzed;
a determining subunit, configured to determine the candidate lumen boundary point as the next node if the candidate lumen boundary point satisfies the following formula:
the path value of the node to be analyzed+the key value of the candidate cavity boundary point < the path value of the candidate cavity boundary point;
an updating subunit, configured to update the path value of the next node to be: and the sum of the path value of the node to be analyzed and the key value of the candidate anatomical cavity boundary point.
In one possible embodiment, the apparatus further comprises:
the initial storage strategy setting module is used for setting all the storage strategies of the hierarchy as initial storage strategies, wherein the initial storage strategies are as follows: no path information is stored;
the second storage strategy setting module is used for traversing from a high level to a low level in sequence according to the size of the available storage resources, and updating the storage strategies of the multiple levels into a second storage strategy, wherein the second storage strategy is as follows: storing path information between every two of all section boundary points of each section of the hierarchy;
The third storage policy setting module is configured to, when all the storage policies of the hierarchy level can be updated to the second storage policy, sequentially traverse from a high hierarchy level to a low hierarchy level according to the size of the remaining available storage resources, and update the storage policies of the plurality of hierarchy levels to a third storage policy, where the third storage policy is: path information between all nodes of the hierarchy is stored.
In one possible implementation manner, the optimal path determining module includes:
the node determining submodule is used for setting any two adjacent nodes in the path node list as a first node and a second node according to the node sequence in the path node list, wherein the level of the first node is a low level, and the level of the second node is a higher level;
a neighbor determination submodule for determining whether the first node and the second node are adjacent in the low hierarchy;
a shortest path determining submodule, configured to obtain a shortest path between the first node and the second node in a case where the first node and the second node are adjacent in the low hierarchy;
A storage determination submodule, configured to determine, in a case where the first node and the second node are not adjacent in the low hierarchy, whether a shortest path between the first node and the second node is stored according to a storage policy of the low hierarchy;
a path obtaining sub-module, configured to directly obtain, in the case where the shortest path between the first node and the second node is stored in the low hierarchy, the shortest path between the first node and the second node from stored data;
and the path calculation sub-module is used for calculating the shortest path between the first node and the second node by utilizing a shortest path algorithm under the condition that the shortest path between the first node and the second node is not stored in the low level.
In a possible implementation manner, according to the path node list, the first node is determined to be located between a third node and the second node, and the apparatus further includes:
an intermediate node determining module, configured to determine a plurality of intermediate nodes through which a shortest path between the first node and the second node passes;
the target intermediate node determining module is used for determining a target intermediate node from the plurality of intermediate nodes, wherein the target intermediate node is the node of which the last level is the same as the level of the first node when the plurality of intermediate nodes are arranged according to the node sequence;
A path updating module, configured to update the shortest path to a path between the target intermediate node and the second node;
and the path recalculation module is used for recalculating the path between the third node and the target intermediate node.
In one possible implementation manner, the next node determining module includes:
according to the position information of the node to be analyzed and the position information of the end point, determining that the level of the node to be analyzed is higher than the level of the end point, and in the level of the higher level of the node to be analyzed, under the condition that the node to be analyzed and the end point are located in the same profile cavity:
the first next node determining submodule is used for determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a lower level of the level where the node to be analyzed is located when the node to be analyzed and the end point are located in the same cavity;
the second next node determining submodule is used for determining the next node from a plurality of candidate profile cavity boundary points of the profile cavity where the node to be analyzed is located in the level where the node to be analyzed is located when the node to be analyzed and the endpoint are not located in the same profile cavity;
And the third next node determining submodule is used for determining that the level of the node to be analyzed is higher than the level of the terminal point according to the position information of the node to be analyzed and the position information of the terminal point, and determining the next node in a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level of the higher level of the node to be analyzed under the condition that the node to be analyzed and the terminal point are not located in the same cavity in the level of the higher level of the node to be analyzed.
The embodiment of the invention also provides an electronic device, and referring to fig. 5, fig. 5 is a schematic structural diagram of the electronic device according to the embodiment of the invention. As shown in fig. 5, the electronic device 100 includes: the memory 110 and the processor 120 are connected through a bus communication, and the memory 110 and the processor 120 are stored with a computer program, and the computer program can run on the processor 120, so as to implement the steps in a path planning method disclosed by the embodiment of the invention.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program/instruction is stored, which when executed by a processor, implements the steps of a path planning method disclosed in the embodiment of the invention.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, electronic devices, and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail a path planning method, apparatus and electronic device provided in the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only for aiding in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (7)

1. A method of path planning, the method comprising:
splitting and layering the road network to obtain a plurality of layers and a plurality of splitting cavities of each layer, wherein each splitting cavity comprises a plurality of nodes, and the nodes are divided into splitting cavity boundary points and splitting cavity inner nodes; the nodes comprise a starting point and an ending point of path planning;
constructing a priority queue, setting the key value of the starting point to 0, and adding the key value into the priority queue; the key value represents the estimated value of the node;
executing a node selection step to be analyzed: selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node to be analyzed into a node list; the hierarchy of the nodes to be analyzed is the highest hierarchy to which the nodes to be analyzed belong;
Executing the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node;
repeating the node selection step and the next node determination step until the next node is the endpoint;
circularly accessing the path mapping table from the end point until the access to the start point is obtained, and obtaining a path node list from the start point to the end point;
obtaining an optimal path according to the path node list;
the determining the next node according to the position information of the node to be analyzed and the position information of the end point comprises the following steps:
determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a higher level of the level where the node to be analyzed is located under the condition that the level where the node to be analyzed is located is lower than the level where the terminal is located according to the position information of the node to be analyzed and the position information of the terminal;
determining the next node according to the position information of the node to be analyzed and the position information of the end point, and determining that the node to be analyzed and the end point are in the same level;
Under the condition that the node to be analyzed and the end point are in the same level, determining the next node according to the position of the section cavity where the node to be analyzed and the end point are located comprises the following steps:
determining that the next node is determined from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level higher than the level where the node to be analyzed is located in under the condition that the node to be analyzed is not located in the same cavity as the end point according to the cavity location where the node to be analyzed is located in the end point;
in a hierarchy of a higher level than the hierarchy in which the node to be analyzed is located, determining the end point as the next node under the condition that the node to be analyzed and the end point are in the same profile;
the determining the next node according to the position information of the node to be analyzed and the position information of the end point further includes:
according to the position information of the node to be analyzed and the position information of the end point, determining that the level of the node to be analyzed is higher than the level of the end point, and in the level of the higher level of the node to be analyzed, under the condition that the node to be analyzed and the end point are located in the same profile cavity:
When the node to be analyzed and the end point are positioned in the same profile cavity in the level where the node to be analyzed is positioned, determining the next node from a plurality of candidate profile cavity boundary points of the profile cavity where the node to be analyzed is positioned in a level lower than the level where the node to be analyzed is positioned;
when the node to be analyzed and the end point are not located in the same cavity in the level where the node to be analyzed is located, determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level where the node to be analyzed is located;
and determining that the level of the node to be analyzed is higher than the level of the end point according to the position information of the node to be analyzed and the position information of the end point, and determining the next node in a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level of the higher level of the node to be analyzed under the condition that the node to be analyzed and the end point are not located in the same cavity in the level of the higher level of the node to be analyzed.
2. The path planning method according to claim 1, wherein the determining the next node from among a plurality of candidate lumen boundary points of a lumen in which the node to be analyzed is located in a hierarchy higher than the hierarchy in which the node to be analyzed is located includes:
Calculating a key value and a path value of each candidate lumen boundary point, wherein the path value represents the estimated value of the shortest path from the starting point to the candidate lumen boundary point;
calculating the path value of the node to be analyzed;
and determining the candidate cavity boundary point as the next node under the condition that the candidate cavity boundary point meets the following formula:
the path value of the node to be analyzed+the key value of the candidate cavity boundary point < the path value of the candidate cavity boundary point;
updating the path value of the next node as follows: and the sum of the path value of the node to be analyzed and the key value of the candidate anatomical cavity boundary point.
3. The path planning method according to claim 1, wherein after the splitting and layering of the road network, the method further comprises:
setting all the storage strategies of the hierarchy as initial storage strategies, wherein the initial storage strategies are as follows: no path information is stored;
traversing sequentially from a high level to a low level according to the size of available storage resources, and updating the storage strategies of a plurality of levels into a second storage strategy, wherein the second storage strategy is as follows: storing path information between every two of all section boundary points of each section of the hierarchy;
And under the condition that the storage strategies of all the levels can be updated to be the second storage strategy, traversing from a high level to a low level in sequence according to the size of the residual available storage resources, and updating the storage strategies of a plurality of levels to be a third storage strategy, wherein the third storage strategy is as follows: path information between all nodes of the hierarchy is stored.
4. A path planning method according to claim 3, wherein said obtaining an optimal path according to said path node list comprises:
according to the node sequence in the path node list, two nodes which are arbitrarily adjacent to each other in the path node list are set to be a first node and a second node, the level of the first node is a low level, and the level of the second node is a higher level;
determining whether the first node and the second node are adjacent in the low level;
obtaining a shortest path between the first node and the second node in the case where the first node and the second node are adjacent in the low hierarchy;
determining, in the case where the first node and the second node are not adjacent in the low hierarchy, whether a shortest path between the first node and the second node is stored according to a storage policy of the low hierarchy;
In the case that the shortest path between the first node and the second node is stored in the low level, the shortest path between the first node and the second node is directly obtained from stored data;
and under the condition that the shortest path between the first node and the second node is not stored in the low level, calculating the shortest path between the first node and the second node by utilizing a shortest path algorithm.
5. The path planning method of claim 4 wherein the first node is located intermediate a third node and the second node, the method further comprising, after determining a shortest path between the first node and the second node:
determining a plurality of intermediate nodes through which a shortest path between the first node and the second node passes;
determining a target intermediate node from the plurality of intermediate nodes, wherein the target intermediate node is the node of which the last level is the same as the level of the first node when the plurality of intermediate nodes are arranged according to the node sequence;
updating the shortest path to a path between the target intermediate node and the second node;
A path between the third node and the target intermediate node is recalculated.
6. A path planning apparatus, the apparatus comprising:
the layering module is used for carrying out subdivision layering on the road network to obtain a plurality of layers and a plurality of dissection cavities of each layer, each dissection cavity comprises a plurality of nodes, and the nodes are divided into dissection cavity boundary points and dissection cavity inner nodes; the nodes comprise a starting point and an ending point of path planning;
the queue construction module is used for constructing a priority queue, setting the key value of the starting point to 0 and adding the key value into the priority queue; the key value represents the estimated value of the node;
the selecting module is used for executing the node selecting step to be analyzed: selecting a node with the minimum key value in the priority queue as a node to be analyzed to dequeue, and pushing the node to be analyzed into a node list; the hierarchy of the nodes to be analyzed is the highest hierarchy to which the nodes to be analyzed belong;
the next node determining module is configured to perform the next node determining step: determining a next node according to the position information of the node to be analyzed and the position information of the end point, and placing the next node into the priority queue; updating a path mapping table by using the next node;
The repeating module is used for repeating the node selection step to be analyzed and the next node determination step until the next node is the end point;
a path node list obtaining module, configured to start to circularly access the path mapping table from the end point until the access obtains the start point, and obtain a path node list from the start point to the end point;
the optimal path determining module is used for obtaining an optimal path according to the path node list;
the next node determining module includes:
the first determining submodule is used for determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a higher level of the level where the node to be analyzed is located under the condition that the level where the node to be analyzed is located is lower than the level where the terminal is located according to the position information of the node to be analyzed and the position information of the terminal;
the second determining submodule is used for determining the next node according to the position information of the node to be analyzed and the position information of the end point under the condition that the node to be analyzed and the end point are in the same level and the position of the profile cavity where the node to be analyzed and the end point are located;
The second determination submodule includes:
the first determining unit is configured to determine, according to the position of the to-be-analyzed node and the position of the end point in the cavity, that the next node is determined from a plurality of candidate cavity boundary points of the cavity where the to-be-analyzed node is located in a level higher than the level where the to-be-analyzed node is located in the cavity, when the to-be-analyzed node and the end point are not in the same cavity;
the second determining unit is used for determining the endpoint as the next node under the condition that the node to be analyzed and the endpoint are in the same profile cavity in a level higher than the level of the node to be analyzed;
the next node determining module further includes:
according to the position information of the node to be analyzed and the position information of the end point, determining that the level of the node to be analyzed is higher than the level of the end point, and in the level of the higher level of the node to be analyzed, under the condition that the node to be analyzed and the end point are located in the same profile cavity:
the first next node determining submodule is used for determining the next node from a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in a lower level of the level where the node to be analyzed is located when the node to be analyzed and the end point are located in the same cavity;
The second next node determining submodule is used for determining the next node from a plurality of candidate profile cavity boundary points of the profile cavity where the node to be analyzed is located in the level where the node to be analyzed is located when the node to be analyzed and the endpoint are not located in the same profile cavity;
and the third next node determining submodule is used for determining that the level of the node to be analyzed is higher than the level of the terminal point according to the position information of the node to be analyzed and the position information of the terminal point, and determining the next node in a plurality of candidate cavity boundary points of the cavity where the node to be analyzed is located in the level of the higher level of the node to be analyzed under the condition that the node to be analyzed and the terminal point are not located in the same cavity in the level of the higher level of the node to be analyzed.
7. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the path planning method of any one of claims 1 to 5.
CN202310480205.3A 2023-04-28 2023-04-28 Path planning method and device and electronic equipment Active CN116539056B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310480205.3A CN116539056B (en) 2023-04-28 2023-04-28 Path planning method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310480205.3A CN116539056B (en) 2023-04-28 2023-04-28 Path planning method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN116539056A CN116539056A (en) 2023-08-04
CN116539056B true CN116539056B (en) 2024-03-01

Family

ID=87451700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310480205.3A Active CN116539056B (en) 2023-04-28 2023-04-28 Path planning method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116539056B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5513110A (en) * 1993-07-09 1996-04-30 Xanavi Informatics Corporation Navigation system and path search method using hierarchized road data
US8824337B1 (en) * 2012-03-14 2014-09-02 Google Inc. Alternate directions in hierarchical road networks
KR102036716B1 (en) * 2019-02-15 2019-10-25 국방과학연구소 Path planning method for visiting multiple mission points and apparatus therefor
CN111027743A (en) * 2019-11-06 2020-04-17 深圳市城市交通规划设计研究中心有限公司 OD optimal path searching method and device based on hierarchical road network
CN112985443A (en) * 2021-03-19 2021-06-18 深圳依时货拉拉科技有限公司 Path planning method and device and terminal equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8660789B2 (en) * 2011-05-03 2014-02-25 University Of Southern California Hierarchical and exact fastest path computation in time-dependent spatial networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5513110A (en) * 1993-07-09 1996-04-30 Xanavi Informatics Corporation Navigation system and path search method using hierarchized road data
US8824337B1 (en) * 2012-03-14 2014-09-02 Google Inc. Alternate directions in hierarchical road networks
KR102036716B1 (en) * 2019-02-15 2019-10-25 국방과학연구소 Path planning method for visiting multiple mission points and apparatus therefor
CN111027743A (en) * 2019-11-06 2020-04-17 深圳市城市交通规划设计研究中心有限公司 OD optimal path searching method and device based on hierarchical road network
CN112985443A (en) * 2021-03-19 2021-06-18 深圳依时货拉拉科技有限公司 Path planning method and device and terminal equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Liu can等.Application of artificial intelligence combined with 5G technology in the reform of English teaching in universityies.Computational intelligence and neuroscience.2022,第22卷全文. *
林娜等.基于出租车轨迹数据的路径规划方法.计算机应用与软件.2016,第33卷(第1期),全文. *

Also Published As

Publication number Publication date
CN116539056A (en) 2023-08-04

Similar Documents

Publication Publication Date Title
US8824337B1 (en) Alternate directions in hierarchical road networks
JP4227304B2 (en) Outline wiring method and apparatus, and recording medium storing outline wiring program
US20180109439A1 (en) Constrained shortest path determination in a network
US9680665B2 (en) Apparatus and method for dynamic hybrid routing in SDN networks to avoid congestion and balance loads under changing traffic load
CN111750862A (en) Multi-region-based robot path planning method, robot and terminal equipment
US8532922B2 (en) Method for simplifying a description of a route of travel
US10753751B2 (en) Systems and methods for street level routing
US11486714B2 (en) Matching algorithm for data with different scales based on global road network features
CN112201075B (en) Parking lot parking space availability prediction method and system
CN112985443B (en) Path planning method and device and terminal equipment
CN113496375A (en) Information processing apparatus, information processing method, and computer-readable storage medium
CN104268243A (en) Position data processing method and device
CN116539056B (en) Path planning method and device and electronic equipment
JP6312949B2 (en) Pressure loss determination device, pressure loss determination program, and pressure loss determination method
CN108627163B (en) Weight table maintenance method and device and navigation route planning method and device
CN112562325B (en) Large-scale urban traffic network flow monitoring method based on block coordinate descent
CN113256029A (en) In-building path finding method, device, equipment and storage medium
JP6912859B2 (en) Map update device, map update method, computer program, and recording medium on which the computer program is recorded.
CN106034266B (en) Optical route generation method and device
CN111177190B (en) Data processing method, device, electronic equipment and readable storage medium
CN115115318A (en) Dangerous goods transportation network planning method and system considering user path selection behavior
JP2010217459A (en) Device, system, program, and method for managing road network diagram
CN116703016B (en) Storage and use methods and devices for transport task paths
CN112749458B (en) Cable path planning method, device, equipment and storage medium
CN117171401B (en) Query method and device for shortest path in graph data based on hierarchical pre-calculation

Legal Events

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