Path planning method, device and storage medium
By screening important passing points and constructing a sparse road network, the problem of low path planning efficiency caused by the large amount of geographical information data is solved, and fast and efficient path planning is achieved.
Patent Information
- Application Number
- CN202410891155.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The amount of geographical information data in the existing technology is huge, resulting in low path planning efficiency.
By filtering out the important passing points in the map data of the target area, and generating a set of neighborhood road segments corresponding to each important passing point, a sparse road network is constructed, and the starting point of the path planning is determined using the sparse road network and the preset path planning algorithm. The target path between the destination and the destination.
It greatly reduces the amount of map data, saves storage space, and quickly obtains path planning results in a sparse road network, improving computing efficiency.
Smart Images

Figure CN118424319B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of path planning, and in particular to a path planning method, device and storage medium. Background Art
[0002] Path planning has a wide range of applications in many fields. Applications in the field of high-tech include: autonomous collision-free actions of robots, obstacle avoidance and penetration flight of drones, radar search avoidance of cruise missiles, anti-rebound attacks, and completion of penetration and blasting tasks. Applications in the field of daily life include: GPS navigation, road planning based on GIS systems, urban road network planning and navigation, etc. When performing path planning analysis on a certain area, the geographic information of all roads in the area is usually input into the algorithm for calculation, but the amount of data is too large, resulting in extremely low efficiency of path planning. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a path planning method, device and storage medium to solve the technical problem in the prior art that the amount of geographic information data is huge, resulting in low efficiency of path planning.
[0004] In order to achieve the above-mentioned object, the present application provides a path planning method in a first aspect, the method comprising:
[0005] Acquire map data of a target area, the map data including a plurality of roads, each road being a waypoint sequence consisting of a plurality of waypoints;
[0006] The waypoints included in at least two roads at the same time, the starting waypoints and the ending waypoints on each road are determined as important waypoints;
[0007] For any important waypoint, search for other important waypoints adjacent to the important waypoint in each road containing the important waypoint;
[0008] Add the road section between each important waypoint and any important waypoint among other adjacent important waypoints to the neighborhood road section set corresponding to any important waypoint, where any road section is defined by the two important waypoints at both ends and the distance between the two important waypoints;
[0009] Generate a sparse road network corresponding to the target area based on the set of neighborhood road segments corresponding to each important waypoint, the sparse road network is a road network simplified based on the road network of the target area;
[0010] Obtain a path planning task, which includes a path planning starting point and a path planning end point;
[0011] The target path between the path planning starting point and the path planning end point is determined based on the sparse road network and the preset path planning algorithm.
[0012] In an embodiment of the present application, the method also includes: determining waypoints other than important waypoints as non-important waypoints; obtaining a set of non-important waypoints corresponding to each road section, wherein the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of any road section.
[0013] In an embodiment of the present application, obtaining a set of non-important waypoints corresponding to each road section includes: determining the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, searching for two important waypoints closest to the waypoint in the current road; for each waypoint, adding the waypoint to the set of non-important waypoints corresponding to the road section between the two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road section.
[0014] In an embodiment of the present application, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint includes: for each waypoint sequence included in the road, traversing the important waypoints in the waypoint sequence one by one in the order of the waypoint sequence; when traversing to any important waypoint, searching each waypoint one by one in the order of the waypoint sequence to determine the first important waypoint searched as the other important waypoint adjacent to any important waypoint, and determining the searched waypoints that are not important waypoints as non-important waypoints; obtaining a set of non-important waypoints corresponding to each road section, including: generating a set of non-important waypoints corresponding to the road section between any important waypoint and other important waypoints adjacent to any important waypoint based on the non-important waypoints between any important waypoint and other important waypoints adjacent to any important waypoint.
[0015] In an embodiment of the present application, the method also includes: obtaining a set of non-important waypoints corresponding to each section included in the target path; inserting the set of non-important waypoints corresponding to each section included in the target path as a sequence into each section included in the target path to generate a detailed target path between the path planning starting point and the path planning end point.
[0016] In an embodiment of the present application, determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints includes: obtaining the latitude and longitude coordinates of each waypoint; traversing each waypoint on each road based on the latitude and longitude coordinates; for each waypoint, determining the waypoint as an important waypoint if the number of traversals of the waypoint is greater than or equal to a preset threshold.
[0017] In an embodiment of the present application, the method further includes: for each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, determining that the waypoint is indeed a non-important waypoint.
[0018] In an embodiment of the present application, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint includes: for any important waypoint, in a sequence of waypoints included in each road including any important waypoint, searching each waypoint one by one towards the front and back of any important waypoint according to the sequence number of any important waypoint, and determining the important waypoints first searched in the process of searching one by one towards the back and front as other important waypoints adjacent to any important waypoint.
[0019] In an embodiment of the present application, the method is applied to a multi-level road network scenario including different levels of road networks, wherein each level of road network corresponds to a sparse road network, the highest level of the different levels of road networks is not less than level 2, each waypoint in any N-level road network belongs to the N-level waypoint and there is at least one waypoint belonging to the N+1-level waypoint, any N-level waypoint is in at least one N-level road network, the road sections in different road networks do not overlap, the waypoints in the same road network have connectivity in the same road network, N is an arbitrary positive integer and is less than the highest level; the path planning starting point and the path planning end point are not in the same In a first-level road network, determining a target path between a path planning start point and a path planning end point according to a sparse road network and a preset path planning algorithm includes: generating an initial start-segment temporary path corresponding to the path planning start point and an initial end-segment temporary path corresponding to the path planning end point according to the sparse road network and the preset path planning algorithm; adding the initial start-segment temporary path to a first-level start-segment temporary path set, adding the initial end-segment temporary path to a first-level end-segment temporary path set, and updating the current level to the first level; when the current level is updated and does not exceed the highest level, determining the current level The connectivity between each starting temporary path in the starting temporary path set and each last temporary path in the last temporary path set of the current level; in the case that any starting temporary path and any last temporary path have connectivity at the current level, the path splicing operation corresponding to the current level is performed for any starting temporary path and any last temporary path, and the generated candidate path is added to the candidate path set; in the case that any starting temporary path and any last temporary path do not have connectivity at the current level, the path splicing operation corresponding to the current level is performed for any starting temporary path and any last temporary path, and the generated candidate path is added to the candidate path set; The path extension operation corresponding to the current level is performed, and the generated initial temporary path is added to the initial temporary path set of the previous level of the current level, and the generated final temporary path is added to the final temporary path set of the previous level of the current level; when the path splicing operation or the path extension operation has been performed on each initial temporary path and each final temporary path, the current level is updated to the corresponding previous level; when the current level exceeds the highest level, the alternative path with the shortest path length in the alternative path set is determined as the target path between the path planning starting point and the path planning end point.
[0020] In an embodiment of the present application, determining a target path between a path planning starting point and a path planning end point according to a sparse road network and a preset path planning algorithm includes: in the case where at least one node between the path planning starting point and the path planning end point belongs to a non-important waypoint, based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determining the starting transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point; determining a transfer path and its path length between any starting transfer waypoint and any final transfer waypoint according to the sparse road network and the preset path planning algorithm; determining a preceding path and a succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path The path is the path between the path planning starting point and the initial transfer waypoint among the two endpoints of any transfer path, and the subsequent path corresponding to any transfer path is the path between the last transfer waypoint among the two endpoints of any transfer path and the path planning end point; based on each transfer path, the corresponding candidate path and its path length are determined, wherein the candidate path corresponding to any transfer path is obtained by splicing the any transfer path and the preceding path and the succeeding path corresponding to the any transfer path, and the path length of the candidate path corresponding to any transfer path is the sum of the lengths of the any transfer path and the preceding path and the succeeding path corresponding to the any transfer path; the candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
[0021] A second aspect of the present application provides a path planning device, characterized by comprising:
[0022] A memory is configured to store instructions; and a processor is configured to call the instructions from the memory and implement the path planning method when executing the instructions.
[0023] A third aspect of the present application provides a machine-readable storage medium, characterized in that the machine-readable storage medium stores instructions, which are used to enable a machine to execute the path planning method described above.
[0024] Through the above technical solution, important waypoints in the map data of the target area are screened out, and other important waypoints near each important waypoint are searched out, and a set of neighborhood road segments corresponding to each important waypoint is generated. The set of neighborhood road segments is stored in the data format of the adjacency table, and a sparse road network map of the target area is generated, which greatly reduces the amount of map data and saves storage space. Executing the path planning task in the sparse road network can quickly obtain the target path between the path planning starting point and the path planning end point, thereby improving the calculation efficiency.
[0025] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0027] Figure 1 A schematic diagram of a process flow of a path planning method according to an embodiment of the present application is shown;
[0028] Figure 2 A schematic diagram schematically shows a path planning for a multi-level road network scenario according to an embodiment of the present application;
[0029] Figure 3 A schematic diagram of the structure of a path planning device according to an embodiment of the present application is shown;
[0030] Figure 4 The schematic diagram shows a structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0032] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0033] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0034] Figure 1 The following schematically shows a flow chart of a path planning method according to an embodiment of the present application. Figure 1 As shown, an embodiment of the present application provides a path planning method, which may include the following steps.
[0035] S102, obtaining map data of the target area, the map data including a plurality of roads, each road being a waypoint sequence consisting of a plurality of waypoints.
[0036] It can be understood that the target area is a designated geographical area or administrative geographical area. The map data includes multiple roads in the target area, wherein each road is a sequence of waypoints consisting of multiple waypoints. It can be understood that the waypoints in the road are vector data, and each waypoint has its position information in the road. The data form of the map data is stored in a hierarchical directory, which can also be understood as a tree structure, and is composed of some uncommon file formats. The vector data stored in these formats cannot be directly read into the memory by the program code, so the Global Mapper map software can be used to convert these vector data into files that can be directly read by the program.
[0037] S104: Determine the waypoints simultaneously included in at least two roads, the starting point waypoint and the ending point waypoint on each road as important waypoints.
[0038] It can be understood that important waypoints are the more critical waypoints on the road, including the starting waypoint and the terminal waypoint of each road, that is, the two end points of each road. Important waypoints also include waypoints that are simultaneously included in at least two roads, that is, intersection points between roads. Since the amount of waypoint data in the map data is too large, if all the waypoints on the roads in the map data are input into the algorithm for calculation, it will result in extremely low efficiency. Therefore, these waypoints can be screened, and the starting waypoint, the terminal waypoint and the intersection point can be screened out as important waypoints. For subsequent path planning, this method greatly reduces the data volume and can improve the computing efficiency.
[0039] In an embodiment of the present application, determining waypoints simultaneously included in at least two roads, starting waypoints and ending waypoints on each road as important waypoints includes: obtaining the latitude and longitude coordinates of each waypoint; traversing each waypoint on each road based on the latitude and longitude coordinates; for each waypoint, determining the waypoint as an important waypoint if the number of traversals of the waypoint is greater than or equal to a preset threshold.
[0040] It can be understood that each waypoint in the map data has its corresponding longitude and latitude coordinates, and the position of each waypoint in the road can be determined based on the longitude and latitude coordinates. In addition, the waypoints in the road are vector data, and the waypoints constitute a waypoint sequence in the road based on the longitude and latitude coordinates. Then, each waypoint of each road can be traversed one by one based on the longitude and latitude coordinates. It can be understood that there are waypoints with the same longitude and latitude coordinates in different roads, which will be traversed many times. After all roads are traversed, the number of traversals of each waypoint can be counted. When the number of traversals is greater than or equal to a preset threshold, the waypoint is determined to be an important waypoint. Among them, the preset threshold can be set to a positive integer greater than or equal to 2. It can be understood that only waypoints that are simultaneously included in at least two roads will be traversed many times, so the important waypoints in the road can be accurately determined by the number of traversals.
[0041] In an embodiment of the present application, the method further includes: for each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, determining that the waypoint is indeed a non-important waypoint.
[0042] S106, for any important waypoint, searching for other important waypoints adjacent to the important waypoint in each road including the important waypoint.
[0043] It can be understood that, in a road including any important waypoint, other important waypoints adjacent to any important waypoint may be a starting point waypoint, an end point waypoint, or waypoints simultaneously included in at least two roads.
[0044] In an embodiment of the present application, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint includes: for any important waypoint, in a sequence of waypoints included in each road including the important waypoint, searching each waypoint one by one towards the front and back of the important waypoint according to the sequence number of the important waypoint, and determining the important waypoints searched for the first time in the process of searching one by one towards the back and forth as other important waypoints adjacent to any important waypoint.
[0045] It can be understood that each waypoint in the map data has its corresponding serial number, and the distance between each waypoint and the waypoints with adjacent serial numbers in each road is the shortest. Among them, the distance is determined according to the longitude and latitude coordinates of the waypoints. Then, in each road, each waypoint is searched one by one in front of and behind the serial number of the important waypoint. In the search process, the important waypoints that are first searched in the front or the important waypoints that are first searched in the back are determined as other important waypoints adjacent to any important waypoint.
[0046] S108, adding the road section between each important waypoint among other adjacent important waypoints and any important waypoint to the neighborhood road section set corresponding to any important waypoint, wherein any road section is defined by two important waypoints at both ends thereof and the distance between the two important waypoints.
[0047] It can be understood that the important waypoints on each road can divide the road into multiple continuous sections. For each important waypoint, multiple sections corresponding to multiple other important waypoints adjacent to it can constitute a neighborhood section set corresponding to the important waypoint. That is to say, when locking any important waypoint, other important waypoints adjacent to the important waypoint can be searched according to the neighborhood section set, as well as the distance between the two sections. In addition, the distance between the important waypoint and other adjacent important waypoints is calculated based on the latitude and longitude coordinates.
[0048] S110, generating a sparse road network corresponding to the target area according to a set of neighborhood road segments corresponding to each important waypoint.
[0049] After obtaining the neighborhood road segment set corresponding to each important waypoint in the target area, each important waypoint has been associated with other important waypoints adjacent to it, then, a sparse road network corresponding to the target area can be generated based on all the neighborhood road segment sets. The sparse road network is a road network that is simplified in the target area, and the neighborhood road segment set is stored in the data structure of the adjacency list, which can save storage space. The sparse road network retains the important waypoints in the map data, and simplifies the roads in the road network based on these important waypoints. In other words, the sparse road network retains every original road, but discards non-important waypoints in the road. In this way, the data volume of the map data can be greatly reduced, and the computing efficiency can be improved.
[0050] S112, obtaining a path planning task, where the path planning task includes a path planning starting point and a path planning end point.
[0051] It can be understood that the path planning task refers to the task of planning a target path from the path planning starting point to the path planning end point. The target path here can be planned based on various factors such as time, distance, safety, etc.
[0052] S114, determining a target path between a path planning starting point and a path planning end point according to the sparse road network and a preset path planning algorithm.
[0053] The preset path planning algorithm is a path planning algorithm preset by the technician. Specifically, the path planning algorithm includes but is not limited to the Dijkstra algorithm, the A star algorithm, the ant colony algorithm, the genetic algorithm, the neural network algorithm, etc. In the specific implementation of the present application, the Dijkstra algorithm is used as the preset path planning algorithm, which calculates all paths from the path planning starting point to the path planning end point by traversing, and selects the path with the lowest cost. The global optimal path can be obtained by this algorithm, but it takes a long time. In addition, the original Dijkstra algorithm has a high time complexity, and the adjacency matrix is used for data storage. For dense road networks, the adjacency matrix is still feasible in terms of space utilization, but for sparse road networks, it greatly wastes memory space. Therefore, in the embodiment of the present application, the path planning is carried out through the simplified sparse road network, and the adjacency list structure is used for data storage, and the Dijkstra algorithm is optimized for searching the target path. The simplified sparse road network includes each neighborhood road section set only related to important waypoints, removes non-important waypoints, reduces time complexity, and also reduces space complexity.
[0054] Through the above technical solution, important waypoints in the map data of the target area are screened out, and other important waypoints near each important waypoint are searched out, and a set of neighborhood road segments corresponding to each important waypoint is generated. The set of neighborhood road segments is stored in the data format of the adjacency table, and a sparse road network map of the target area is generated, which greatly reduces the amount of map data and saves storage space. Executing the path planning task in the sparse road network can quickly obtain the target path between the path planning starting point and the path planning end point, thereby improving the calculation efficiency.
[0055] In an embodiment of the present application, the method also includes: determining waypoints other than important waypoints as non-important waypoints; obtaining a set of non-important waypoints corresponding to each road section, wherein the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of any road section.
[0056] It can be understood that after determining the important waypoints in the map data, the remaining waypoints are all non-important waypoints. Then, for any road section, the waypoint sequence composed of non-important waypoints between the important waypoints at both ends of the road section can be used as the non-important waypoint set corresponding to the road section. It is understandable that waypoints other than important waypoints are not useless. In the general steps of path planning, the last step is route optimization. The path searched out with important waypoints as input may not be completely consistent with the actual map road. Further processing and optimization are required to make it an actually passable route. Therefore, the non-important waypoint set is stored in the road section in the code for smoothing.
[0057] In an embodiment of the present application, obtaining a set of non-important waypoints corresponding to each road section includes: determining the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, searching for two important waypoints closest to the waypoint in the current road; for each waypoint, adding the waypoint to the set of non-important waypoints corresponding to the road section between the two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road section.
[0058] Specifically, as a specific implementation method, waypoints other than important waypoints are determined as non-important waypoints, and then each waypoint can be traversed. In the case where the waypoint is a non-important waypoint, the waypoint can be searched forward and backward on the road where it is located to search for the two important waypoints closest to the waypoint, and the waypoint is added to the non-important waypoint set corresponding to the road section between the two important waypoints closest to the waypoint, and the waypoints are arranged in order according to the latitude and longitude coordinates of the waypoints to form a waypoint sequence, thereby obtaining a non-important waypoint set corresponding to each road section.
[0059] In an embodiment of the present application, the method also includes: obtaining a set of non-important waypoints corresponding to each section included in the target path; inserting the set of non-important waypoints corresponding to each section included in the target path as a sequence into each section included in the target path to generate a detailed target path between the path planning starting point and the path planning end point.
[0060] After obtaining the non-important waypoint set corresponding to each road section according to the aforementioned scheme and determining the target path between the path planning starting point and the path planning end point, the non-important waypoint set stored in each road section of the target path can be called, and the non-important waypoint set can be inserted as a sequence into each road section included in the target path, and the target path is smoothed to generate a detailed target path between the path planning starting point and the path planning end point, so that it becomes an actually passable route.
[0061] In a specific embodiment, the Global Mapper map software is used to convert these vector data in the map data into files that can be directly read by the program. First, piece together the maps and then convert the format. For example, all the map data at the district and county level of a province can be imported into Global Mapper, piece together the complete map information of the province, and then export it in the form of geojson format. The converted file is still stored in the form of a folder hierarchy directory. Each city in the province corresponds to a folder, which contains the geojson files of each city-level map in the area. From the perspective of data structure, the geojson file can be seen as a json object, which contains two key-value pairs, the key of one key-value pair is type, the value is FeatureCollection, and the key of the other key-value pair is features, and the value is a JsonArray array. Each json object in the array is a route in the current area. Each route contains three key-value pairs, one of which is type, the value is Feature, and the other key is properties. The value is the route name stored in the form of a key-value pair. The last key is geometry, which represents the geographic information of the route, and the value is a json object again. There are two key-value pairs in this object. One represents the route form, with key being type and value being LineString. The other contains discrete coordinate points on the route, with key being coordinates and value being a two-dimensional JsonArray array. Each element in the array is a one-dimensional array with a length of 2, which are longitude coordinates and latitude coordinates, representing a location coordinate point on the earth. From a differential point of view, the two points in the array can be considered as a straight line, and the distance error depends on the accuracy of the map data. In the actual process, the output detailed target path is imported into Global Mapper for verification. The calculated route information is very consistent with the actual map route trajectory. It is an actual passable path and the shortest path between the starting and ending points.
[0062] Optionally, for S106, in one embodiment, searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint includes: for the waypoint sequence included in each road, traversing the important waypoints in the waypoint sequence one by one in the order of the waypoint sequence; when traversing to any important waypoint, searching each waypoint one by one in the order of the waypoint sequence to determine the first important waypoint searched as the other important waypoint adjacent to any important waypoint, and determining the searched waypoints that are not important waypoints as non-important waypoints; obtaining a set of non-important waypoints corresponding to each road section, including: generating a set of non-important waypoints corresponding to the road section between any important waypoint and other important waypoints adjacent to any important waypoint based on the non-important waypoints between any important waypoint and other important waypoints adjacent to any important waypoint.
[0063] It can be understood that the specific method of searching for other important waypoints adjacent to any important waypoint can be to first search for all the important waypoints in the map data, then select any important waypoint, and search for other important waypoints adjacent to it, and such a search method is relatively time-consuming. Then, in the implementation of the present application, for the waypoint sequence included in each road, the important waypoints in the waypoint sequence are traversed one by one in the order of the waypoint sequence. When any important waypoint is traversed, starting from the any important waypoint, each waypoint is continued to be searched one by one in the order of the waypoint sequence, so as to determine the first important waypoint searched as the other important waypoint adjacent to the any important waypoint, and determine the waypoints that are not important waypoints searched as non-important waypoints. In this way, it is possible to simultaneously search for important waypoints, other adjacent important waypoints, and non-important waypoints, thereby improving computational efficiency. Furthermore, after the first important waypoint searched is determined to be another important waypoint adjacent to any important waypoint, the road section between any important waypoint and the other adjacent important waypoint is simultaneously added to the neighborhood road section sets corresponding to the two. Compared with the random and disordered search method, search resources can be saved and search efficiency can be improved. For example, when searching for important waypoints, other important waypoints adjacent to B are searched, and then the road section AB can be added to the neighborhood road section set corresponding to A, and also added to the neighborhood road section set corresponding to B.
[0064] At the same time, based on the non-important waypoints between any important waypoint and other important waypoints adjacent to any important waypoint, a set of non-important waypoints corresponding to the road section between any important waypoint and other important waypoints adjacent to any important waypoint is generated.
[0065] For S114, in an embodiment of the present application, determining the target path between the path planning starting point and the path planning end point according to the sparse road network and the preset path planning algorithm includes: when at least one node between the path planning starting point and the path planning end point is a non-important waypoint, based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determining the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point; determining the transfer path and its path length between any starting transfer waypoint and any last transfer waypoint according to the sparse road network and the preset path planning algorithm; determining the preceding path and the succeeding path corresponding to each transfer path, wherein any transfer path is The corresponding preceding path is the path between the path planning starting point and the initial transfer waypoint among the two endpoints of any transfer path, and the corresponding succeeding path of any transfer path is the path between the last transfer waypoint among the two endpoints of any transfer path and the path planning end point; the corresponding candidate path and its path length are determined based on each transfer path, wherein the candidate path corresponding to any transfer path is obtained by splicing the preceding path and the succeeding path corresponding to any transfer path, and the path length of the candidate path corresponding to any transfer path is the sum of the lengths of the preceding path and the succeeding path corresponding to any transfer path; the candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
[0066] It can be understood that if the starting point or the end point of the path planning is a non-important waypoint, for the starting point of the path planning, it is necessary to first call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the starting point of the path planning. For each end point of the path planning, it is necessary to call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the end point of the path planning. Further, for the path planning points, the important waypoints at both ends of the road where the non-important waypoints corresponding to the starting point of the path planning are located are determined, that is, the starting and transit waypoints corresponding to the starting point of the path planning. Then the important waypoints at both ends of the road where the non-important waypoints corresponding to the end point of the path planning are located are the final transit waypoints corresponding to the end point of the path planning. That is to say, in the sparse road network, the starting and transit waypoints or the final transit waypoints are both important waypoints in the sparse road network, and the number can be two. If the starting point or the end point of the path planning is an important waypoint, the starting point of the path planning can be directly used as the starting and transit waypoint, and the starting point of the path planning can be used as the final transit waypoint. Then, in the sparse road network, based on the preset path planning algorithm, the transfer path between any starting transfer point and any final transfer point can be planned, and the path length of each transfer path can be obtained. In addition, the path planning can also be performed for the preceding path between the starting point and the starting transfer point at the two end points of any transfer path, and the following path between the final transfer point at the two end points of any transfer path and the path planning end point.
[0067] Furthermore, any transfer path and the preceding path and the following path corresponding to the transfer path are concatenated to obtain a candidate path corresponding to the transfer path, and the path length of the candidate path corresponding to the transfer path is determined according to the sum of the lengths of the transfer path, the preceding path and the following path. Then, the candidate path with the shortest path length can be determined as the target path between the path planning starting point and the path planning end point.
[0068] In one embodiment, determining the starting transfer waypoint corresponding to the starting point of path planning and the last transfer waypoint corresponding to the end point of path planning includes: when the starting point of path planning is an important waypoint in the sparse road network, determining the starting point of path planning as the starting transfer waypoint corresponding to the starting point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the starting transfer waypoint; when the end point of path planning is an important waypoint in the sparse road network, determining the end point of path planning as the last transfer waypoint corresponding to the end point of path planning; when the starting point of path planning is included in the set of non-important waypoints corresponding to any road section, determining two important waypoints at both ends of any road section as the last transfer waypoint.
[0069] If the path planning starting point or the path planning end point belongs to an important waypoint in the sparse road network, the path planning starting point can be directly used as the corresponding starting transfer waypoint, and the path planning end point can be used as the corresponding final transfer waypoint. If the path planning starting point or the path planning end point are both non-important waypoints, for the path planning starting point, it is necessary to first call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the path planning starting point. For each path planning end point, it is necessary to call the non-important waypoint set corresponding to each road section to determine the non-important waypoint corresponding to the path planning end point. Further, for the path planning points, the important waypoints at both ends of the road where the non-important waypoints corresponding to the path planning starting point are located are determined, that is, the starting transfer waypoints corresponding to the path planning starting point. Then the important waypoints at both ends of the road where the non-important waypoints corresponding to the path planning end point are located are the final transfer waypoints corresponding to the path planning end point. That is to say, in the sparse road network, the starting transfer waypoints or the final transfer waypoints are both important waypoints in the sparse road network, and the number can be two.
[0070] In a sparse road network, a transfer path between any starting transfer point and any final transfer point can be planned based on a preset path planning algorithm, and the path length of each transfer path can be obtained. The preset path planning algorithm is a path planning algorithm preset by a technician. Specifically, the path planning algorithm includes but is not limited to the Dijkstra algorithm, the A star algorithm, the ant colony algorithm, the genetic algorithm, the neural network algorithm, etc. In a specific embodiment of the present application, the Dijkstra algorithm is used as the preset path planning algorithm, which calculates all paths between any starting transfer point and any final transfer point by traversing, and selects the path with the lowest cost as the transfer path. The global optimal path can be obtained by this algorithm, but it takes a long time. In addition, the original Dijkstra algorithm has a high time complexity, and an adjacency matrix is used for data storage. For dense road networks, the adjacency matrix is still feasible in terms of space utilization, but for sparse road networks, it greatly wastes memory space. Therefore, in the embodiment of the present application, the path planning is performed through the simplified sparse road network, and the adjacency list structure is used for data storage to optimize the Dijkstra algorithm to search for transit paths. The simplified sparse road network includes each neighborhood road segment set that is only related to important waypoints, removes non-important waypoints, reduces time complexity, and also reduces space complexity.
[0071] If the starting point of the path planning is a non-important waypoint, the preceding path corresponding to each transfer path is the path between the starting point of the path planning and each starting transfer waypoint, and its path length can be calculated based on the longitude and latitude coordinates of the starting point of the path planning and each starting transfer waypoint. Similarly, if the end point of the path planning is a non-important waypoint, the following path corresponding to each transfer path is the path between the end point of the path planning and each last transfer waypoint, and its path length can be calculated based on the longitude and latitude coordinates of the end point of the path planning and each last transfer waypoint. If the starting point or the end point of the path planning is an important waypoint, then the starting transfer waypoint is the starting point of the path planning, the path length of the preceding path between the starting transfer waypoint and the starting point of the path planning is 0, and the path length of the following path between the last transfer waypoint and the end point of the path planning is 0.
[0072] For example, the starting point of the planned route is A1, and the end point of the planned route is A2. A1 and A2 are both non-important waypoints. The starting transfer points at both ends of A1 are B1 and B2, and the ending transfer points at both ends of A2 are C1 and C2. Then, the transfer routes include B1-C1, B2-C1, B1-C2, and B2-C2. For the transfer path B1-C1, its preceding path is A1-B1, its following path is C1-A2, and the candidate path is A1-B1-C1-A2; for the transfer path B2-C1, its preceding path is A1-B2, its following path is C1-A2, and the candidate path is A1-B2-C1-A2; for the transfer path B1-C2, its preceding path is A1-B1, its following path is C2-A2, and the candidate path is A1-B1-C2-A2; for the transfer path B2-C2, its preceding path is A1-B2, its following path is C2-A2, and the candidate path is A1-B2-C2-A2. Further, the path lengths of the above four candidate paths are calculated, and the candidate path with the shortest path length is taken as the target path between A1 and A2.
[0073] In an embodiment of the present application, the method is applied to a multi-level road network scenario including different levels of road networks, wherein each level of road network corresponds to a sparse road network, the highest level of the different levels of road networks is not less than level 2, each waypoint in any N-level road network belongs to the N-level waypoint and there is at least one waypoint belonging to the N+1-level waypoint, any N-level waypoint is in at least one N-level road network, the road sections in different road networks do not overlap, the waypoints in the same road network have connectivity in the same road network, N is an arbitrary positive integer and is less than the highest level; the path planning starting point and the path planning end point are not in the same In a first-level road network, determining a target path between a path planning start point and a path planning end point according to a sparse road network and a preset path planning algorithm includes: generating an initial start-segment temporary path corresponding to the path planning start point and an initial end-segment temporary path corresponding to the path planning end point according to the sparse road network and the preset path planning algorithm; adding the initial start-segment temporary path to a first-level start-segment temporary path set, adding the initial end-segment temporary path to a first-level end-segment temporary path set, and updating the current level to the first level; when the current level is updated and does not exceed the highest level, determining the current level The connectivity between each starting temporary path in the starting temporary path set and each last temporary path in the last temporary path set of the current level; in the case that any starting temporary path and any last temporary path have connectivity at the current level, the path splicing operation corresponding to the current level is performed for any starting temporary path and any last temporary path, and the generated candidate path is added to the candidate path set; in the case that any starting temporary path and any last temporary path do not have connectivity at the current level, the path splicing operation corresponding to the current level is performed for any starting temporary path and any last temporary path, and the generated candidate path is added to the candidate path set; The path executes the path extension operation corresponding to the current level, and adds the generated initial temporary path to the initial temporary path set of the level above the current level, and adds the generated final temporary path to the final temporary path set of the level above the current level; when the path splicing operation or the path extension operation has been performed on each initial temporary path and each final temporary path, the current level is updated to the corresponding previous level; when the current level exceeds the highest level, the alternative path with the shortest path length in the alternative path set is determined as the target path between the path planning starting point and the path planning end point.
[0074] The multi-level road network scenario includes multiple road networks with different attributes, such as railway networks, highway networks, etc. Taking the railway network and highway network as an example, as a specific implementation method of the present application, the railway network and the highway network belong to different levels of networks, the roads in the railway network do not overlap with the roads in the highway network, and the longitude and latitude coordinates of at least one waypoint in the railway network are the same as the longitude and latitude coordinates of the waypoints in the highway network, so that the road networks at different levels have connectivity. The road network can also be divided according to the region, and different regions have their corresponding railway networks and highway networks. For example, the railway network includes the railway network of region 1 and the railway network of region 2. Then, for the railway network of region 1, the waypoints in its network all belong to the railway network of region 1, but there are also waypoints that belong to both the railway network of region 1 and the railway network of region 2, so that the railway networks of region 1 and region 2 have connectivity. Further, the railway network has a corresponding sparse road network, and the highway network has a corresponding sparse road network. Furthermore, the railway network in different regions corresponds to a sparse road network, and the highway network in different regions corresponds to a sparse road network. In other words, each level of the road network can correspond to multiple sparse road networks corresponding to different regions. For example, the railway network can have a sparse road network corresponding to the railway network in region 1 and a sparse road network corresponding to the railway network in region 1.
[0075] The above scheme describes a specific multi-level road network scenario, which is specifically applied when the path planning starting point and the path planning end point are not in the same first-level road network, that is, the path planning starting point and the path planning end point are not in the same area, but belong to the same level of road network. Then, on this basis, the target path between the path planning starting point and the path planning end point can be determined in detail according to the sparse road network and the preset path planning algorithm.
[0076] It can be understood that the path planning starting point and the path planning end point are each in a different first-level road network, which specifically means that the path planning starting point and the path planning end point are not in the same area, but belong to the same level of road network. For example, the highway network is a first-level road network, and the railway network is a second-level road network. The path planning starting point Q is in the highway network of M, and the path planning end point V is in the highway network of K. The initial starting temporary path refers to the path generated based on the path planning starting point in the first-level road network when the cross-level path planning task is initialized. The initial end temporary path refers to the path generated based on the path planning end point in the first-level road network when the cross-level path planning task is initialized. It should be noted that in an embodiment of the present application, the starting point and end point of the initial starting temporary path are both the path planning starting point, and the starting point and end point of the initial end temporary path are both the path planning end point. That is, the path length of the initial starting temporary path is 0, and the path length of the initial end temporary path is 0. The initial starting temporary path is added to the first-level starting temporary path set, the initial end temporary path is added to the first-level end temporary path set, and the current level is initialized to the first level.
[0077] Furthermore, if there is no connectivity between the initial temporary path of the first segment and the initial temporary path of the last segment. Then, it is necessary to update the current level, and continue the path search from the path planning starting point and the path planning end point to the road network of the next level. Then, it is necessary to update the current level, and perform the path search from the path planning starting point and the path planning end point to the sparse road network of the next level. After the current level is updated to the corresponding previous level, the corresponding temporary path of the first segment and the temporary path of the last segment are generated based on the current level. Specifically, for the starting point of the path planning, the waypoints where the road network of the previous level and the road network of the current level are connected can be searched, and the waypoints are used as the end points of the temporary path of the first segment corresponding to the current level, and the end points of the temporary path of the first segment of the previous level are used as the starting points of the temporary path of the first segment corresponding to the current level, and the temporary path of the first segment corresponding to the current level is searched in the sparse road network corresponding to the temporary path of the first segment of the previous level. Similarly, for the end point of path planning, the waypoints that are connected between the road network of the previous level and the road network of the current level can also be searched, and the waypoints are used as the starting point of the temporary path of the last segment corresponding to the current level, and the starting point of the temporary path of the last segment of the previous level is used as the end point of the temporary path of the first segment corresponding to the current level. In the sparse road network corresponding to the temporary path of the last segment of the previous level, the temporary path of the last segment corresponding to the current level is searched. There can be multiple waypoints connected to different levels. For each level except the first level, there may also be multiple temporary paths of the first segment and the temporary path of the last segment. Then, all temporary paths of the first segment searched at each level can be added to the temporary path set of the first segment corresponding to each level, and at the same time, the temporary path set of the first segment corresponding to each level is also added to the temporary path set of the first segment corresponding to the previous level. Similarly, all temporary paths of the last segment searched at each level can be added to the temporary path set of the last segment corresponding to each level, and at the same time, the temporary path set of the last segment corresponding to each level is added to the temporary path set of the last segment corresponding to the previous level. Then, when the current level is updated and does not exceed the highest level, it is determined whether there is connectivity between each starting temporary path in the starting temporary path set of the current level and each last temporary path in the last temporary path set of the current level. Then, when the current level is updated and does not exceed the highest level, it is determined whether there is connectivity between each starting temporary path in the starting temporary path set of the current level and each last temporary path in the last temporary path set of the current level.
[0078] Specifically, since the set of initial temporary paths in the current level includes the initial temporary paths searched by the current level and the set of initial temporary paths searched by the next level. The set of final temporary paths in the current level includes the final temporary paths searched by the current level and the set of final temporary paths searched by the next level. Specifically, each initial temporary path searched by the current level can be spliced with each initial temporary path of the next level, and each final temporary path searched by the current level can be spliced with each final temporary path of the next level, so that when there is connectivity at the current level between any initial temporary path and any final temporary path, the path splicing operation corresponding to the current level can be directly performed on any initial temporary path and any final temporary path to generate alternative paths, and each generated alternative path is added to the set of alternative paths.
[0079] If there is no connectivity at the current level between any of the initial temporary paths and any of the final temporary paths, then the path extension operation corresponding to the current level is performed for any of the initial temporary paths and any of the final temporary paths, that is, based on the end points of each initial temporary path and each of the final temporary paths, a path search is performed in the road network of the previous level. A waypoint is searched for connectivity between the road network of the previous level and the road network of the current level, and the waypoint is used as the end point of the initial temporary path corresponding to the current level, and the end point of the initial temporary path of the previous level is used as the starting point of the initial temporary path corresponding to the current level, and the initial temporary path corresponding to the current level is searched in the sparse road network corresponding to the initial temporary path of the previous level. Similarly, for the end point of path planning, the waypoints that are connected between the road network of the previous level and the road network of the current level can also be searched, and the waypoints are used as the starting point of the temporary path of the last segment corresponding to the current level, and the starting point of the temporary path of the last segment of the previous level is used as the end point of the temporary path of the first segment corresponding to the current level. In the road network corresponding to the temporary path of the last segment of the previous level, the temporary path of the last segment corresponding to the current level is searched. There can be multiple waypoints connected to different levels. For each level except the first level, there may also be multiple temporary paths of the first segment and the temporary path of the last segment. Then, all temporary paths of the first segment searched at each level can be added to the temporary path set of the first segment corresponding to each level, and at the same time, the temporary path set of the first segment corresponding to each level is also added to the temporary path set of the first segment corresponding to the previous level. Similarly, all temporary paths of the last segment searched at each level can be added to the temporary path set of the last segment corresponding to each level, and at the same time, the temporary path set of the last segment corresponding to each level is added to the temporary path set of the last segment corresponding to the previous level.
[0080] Then, when the path splicing operation or path extension operation has been performed for each initial temporary path and each final temporary path, the current level is updated to the corresponding previous level. When the current level is greater than or equal to the highest level, the search task of the cross-level path planning task has ended. At this time, the alternative path with the shortest path length is selected from the generated alternative path set to generate the target path between the path planning starting point and the path planning end point. The above scheme can integrate different transportation vehicles to realize cross-regional long-distance transportation path planning and resource allocation in road networks of different levels.
[0081] In an embodiment of the present application, the connectivity between each starting temporary path in the starting temporary path set of the current level and each last temporary path in the last temporary path set of the current level is determined, including: for any starting temporary path in the starting temporary path set of the current level and any last temporary path in the last temporary path set of the current level, determining whether the end point of any starting temporary path and the starting point of any last temporary path are in the same road network of the current level; if they are in the same road network, determining that any starting temporary path and any last temporary path have connectivity at the current level, otherwise determining that any starting temporary path and any last temporary path do not have connectivity at the current level.
[0082] It should be noted that the connectivity here takes into account two aspects, one is the connectivity of the road network level, and the other is the connectivity of the road network area. For any starting temporary path in the starting temporary path set of the current level, and any last temporary path in the last temporary path set of the current level, determine whether the end point of any starting temporary path and the starting point of any last temporary path are in the same road network of the current level. In the case of being in the same road network, the connectivity between any starting temporary path and any last temporary path is determined to be at the current level, otherwise the connectivity between any starting temporary path and any last temporary path is determined not to be at the current level. In other words, whether there is an end point of a starting temporary path at the current level, and the starting point of a last temporary path at the current level belong to the road network of the same level and the same area, or the road networks corresponding to the two contain the same waypoint, so that they have connectivity.
[0083] In an embodiment of the present application, a path splicing operation corresponding to the current level is performed for any starting temporary path and any last temporary path, and the generated alternative path is added to the set of alternative paths, including: determining the same road network at the current level between the temporary end point of any starting temporary path and the temporary starting point of any last temporary path; determining the shortest path between the temporary end point and the temporary starting point determined according to the same road network and a preset path planning algorithm as the middle connecting path between the temporary end point of any starting temporary path and any last temporary path; and adding the alternative path generated by splicing any starting temporary path, the middle connecting path and any last temporary path to the set of alternative paths.
[0084] It can be understood that when there is connectivity at the current level between any initial temporary path and any final temporary path, the initial temporary path and the final temporary path can be spliced. Specifically, the same road network at the same level where the initial temporary path and the final temporary path are located should be determined first. At this time, the temporary end point corresponding to the initial temporary path and the temporary starting point corresponding to the final temporary path can be path planned. Specifically, the temporary end point can be used as the starting point and the temporary starting point as the end point, and a preset path planning algorithm can be used to search for the shortest path from the temporary end point to the temporary starting point, and the shortest path can be used as the middle connecting path from the temporary end point to the temporary starting point. Then, any initial temporary path, the middle connecting path and any final temporary path are spliced. Among them, each starting temporary path searched at the current level can be spliced with each starting temporary path of the next level, and each last temporary path searched at the current level can be spliced with each last temporary path of the next level, so that when there is connectivity at the current level between any starting temporary path and any last temporary path, the path splicing operation corresponding to the current level can be directly performed on any starting temporary path and any last temporary path to generate an alternative path, and each generated alternative path is added to the alternative path set.
[0085] In an embodiment of the present application, a path extension operation corresponding to the current level is performed for any of the initial temporary path and any of the final temporary path, and the generated initial temporary path is added to the initial temporary path set of the previous level of the current level, and the generated final temporary path is added to the final temporary path set of the previous level of the current level, including: determining a first road network of the current level at which a temporary end point of any of the initial temporary path is located, and a second road network of the current level at which a temporary starting point of any of the final temporary path is located; determining a first road network of the current level at which a temporary end point of any of the initial temporary path is located in the first road network; The first road network includes a temporary waypoint at the current level, and a temporary waypoint at the last segment in the second road network that belongs to the previous level of the current level; the starting temporary path generated by splicing any starting temporary path with the shortest path between the temporary end point determined according to the first road network and the preset path planning algorithm and the starting temporary waypoint is added to the starting temporary path set of the previous level of the current level; the last temporary path generated by splicing any last temporary path with the shortest path between the last temporary waypoint and the temporary starting point determined according to the second road network and the preset path planning algorithm is added to the last temporary path set of the previous level of the current level.
[0086] Specifically, for the current level, the first road network where the temporary end point of any starting temporary path is located, and the second road network where the temporary starting point of any last temporary path is located can be determined. Find the waypoints of the upper level of the first road network that are connected to the waypoints of the first road network, and determine them as the temporary waypoints of the starting segment of the first road network that belong to the previous level of the current level. Similarly, the waypoints of the upper level of the second road network that are connected to the waypoints of the first road network can be found, and determine them as the temporary waypoints of the last segment of the second road network that belong to the previous level of the current level. In the first road network, the shortest path between the temporary end point and the corresponding starting temporary waypoint is determined according to the preset path planning algorithm, and the starting temporary path is spliced with the shortest path to generate the temporary waypoint of the starting segment of the previous level corresponding to the current level. Similarly, in the second road network, the shortest path between the temporary starting point and the corresponding temporary waypoint of the last section is determined according to the preset path planning algorithm, and the temporary path of the last section is spliced with the shortest path to generate the temporary path of the last section of the previous level corresponding to the current level. Among them, the preset path planning algorithm is a path planning algorithm preset by the technician. Specifically, the path planning algorithm includes but is not limited to the Dijkstra algorithm, the A star algorithm, the ant colony algorithm, the genetic algorithm, the neural network algorithm, etc. In the specific implementation of the present application, the Dijkstra algorithm is used as the preset path planning algorithm, which calculates all paths from the path planning starting point to the path planning end point by traversal, and selects the path with the lowest cost.
[0087] It should be noted that, whether for the initial temporary waypoint or the final temporary waypoint, there may be multiple connection points between the road network of the current level and the road network of the previous level. Then, there may be multiple initial temporary paths and final temporary waypoints corresponding to each level. Therefore, the initial temporary path generated at each level can be added to the initial temporary path set corresponding to the level, and the final temporary path generated at each level can be added to the final temporary path set corresponding to the level.
[0088] In an embodiment of the present application, the method further includes: deleting paths with a distance of zero from among the paths included in the target path, so as to update the target path.
[0089] Specifically, the path length of the initial temporary path of the target path is 0, and the path length of the initial temporary path of the final temporary path is 0, and the initial temporary path of the initial temporary path and the initial temporary path of the final temporary path can be deleted. In addition, the path planning starting point, the path planning end point, the starting and ending points of each temporary path of the initial segment, and the starting and ending points of each temporary path of the final segment may be connected points, and these temporary paths of the initial segment and the temporary paths of the final segment with a path length of 0 can be deleted to save the storage space of the target path in the database and speed up the processing efficiency.
[0090] refer to Figure 2 As a specific implementation of the present application, the path planning method is applied to the above multi-level road network scenario, wherein the highway network is the primary network and the railway network is the secondary network. The path planning starting point Q is located in the highway network of M, and the path planning end point V is located in the highway network of K. Through the above path planning algorithm, the sparse network of the highway network of M is obtained. and railway network , and the sparse road network of K and railway network Then, search for the waypoints in the road network of M that are connected to the railway network of M. , it is understandable that this waypoint Usually it is a train station. Similarly, you can search for waypoints in the road network of K that are connected to the railway network of K. . According to the preset path planning algorithm, in the sparse road network Search path planning starting point Q to the passing point The temporary path Q between the initial segment , in the sparse road network Stopover The temporary path V between the end point V of the path planning Furthermore, the initial temporary path Q can be determined by determining whether the railway network in M and the railway network in K have the same passing points. and the final temporary path V Is there connectivity? and the final temporary path V When there is connectivity between them, the waypoints are determined according to the preset path planning algorithm. With waypoints The path between , and the initial temporary path Q , the final temporary path V And the path Splicing is performed to generate an alternative path. Since in the embodiment of the present application, there are no multiple connected waypoints involved, the alternative path is the target path of the path planning starting point and the path planning end point. In this way, path planning and resource allocation for long-distance transportation across regions can be achieved.
[0091] Figure 1 FIG. 1 is a flow chart of a method for path planning in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0092] Figure 3 The structure block diagram of a path planning device according to an embodiment of the present application is schematically shown. Figure 4 As shown, an embodiment of the present application provides a path planning device, which may include:
[0093] The memory 310 is configured to store instructions; and the processor 320 is configured to call the instructions from the memory 310 and implement the above-mentioned path planning method when executing the instructions.
[0094] Specifically, in the embodiment of the present application, the processor 320 may be configured to:
[0095] Acquire map data of a target area, the map data including a plurality of roads, each road being a waypoint sequence consisting of a plurality of waypoints;
[0096] The waypoints included in at least two roads at the same time, the starting waypoints and the ending waypoints on each road are determined as important waypoints;
[0097] For any important waypoint, search for other important waypoints adjacent to the important waypoint in each road containing the important waypoint;
[0098] Add the road section between each important waypoint and any important waypoint among other adjacent important waypoints to the neighborhood road section set corresponding to any important waypoint, where any road section is defined by the two important waypoints at both ends and the distance between the two important waypoints;
[0099] Generate a sparse road network corresponding to the target area based on the set of neighborhood road segments corresponding to each important waypoint, the sparse road network is a road network simplified based on the road network of the target area;
[0100] Obtain a path planning task, which includes a path planning starting point and a path planning end point;
[0101] The target path between the path planning starting point and the path planning end point is determined based on the sparse road network and the preset path planning algorithm.
[0102] In the embodiment of the present application, the processor 320 may also be configured to:
[0103] Determine the waypoints other than the important waypoints as non-important waypoints; obtain a set of non-important waypoints corresponding to each road section, wherein the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between the important waypoints at both ends of any road section.
[0104] In the embodiment of the present application, the processor 320 may also be configured to:
[0105] Determine the current road where each waypoint is located; for each waypoint, if the waypoint is a non-important waypoint, search for two important waypoints closest to the waypoint in the current road; for each waypoint, add the waypoint to the non-important waypoint set corresponding to the road section between the two important waypoints closest to the waypoint, so as to obtain the non-important waypoint set corresponding to each road section.
[0106] In the embodiment of the present application, the processor 320 may also be configured to:
[0107] For each waypoint sequence included in each road, important waypoints in the waypoint sequence are traversed one by one in the order of the waypoint sequence; when any important waypoint is traversed, each waypoint is searched one by one in the order of the waypoint sequence to determine the first important waypoint searched as other important waypoints adjacent to any important waypoint, and determine the searched waypoints that are not important waypoints as non-important waypoints; obtain a non-important waypoint set corresponding to each road section, including: generating a non-important waypoint set corresponding to the road section between any important waypoint and other important waypoints adjacent to any important waypoint based on the non-important waypoints between any important waypoint and other important waypoints adjacent to any important waypoint.
[0108] In the embodiment of the present application, the processor 320 may also be configured to:
[0109] Obtain a set of non-important waypoints corresponding to each section included in the target path; insert the set of non-important waypoints corresponding to each section included in the target path as a sequence into each section included in the target path to generate a detailed target path between the path planning starting point and the path planning end point.
[0110] In the embodiment of the present application, the processor 320 may also be configured to:
[0111] Obtain the latitude and longitude coordinates of each waypoint; traverse each waypoint of each road based on the latitude and longitude coordinates; for each waypoint, if the number of traversals of the waypoint is greater than or equal to a preset threshold, determine that the waypoint is an important waypoint.
[0112] In the embodiment of the present application, the processor 320 may also be configured to:
[0113] For each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not a starting waypoint or an ending waypoint, it is determined that the waypoint is indeed a non-important waypoint.
[0114] In the embodiment of the present application, the processor 320 may also be configured to:
[0115] For any important waypoint, in the waypoint sequence included in each road containing any important waypoint, each waypoint is searched one by one towards the front and back of any important waypoint according to the sequence number of any important waypoint, and the important waypoints searched for the first time in the process of searching one by one are determined as other important waypoints adjacent to any important waypoint.
[0116] In an embodiment of the present application, the method is applied to a multi-level road network scenario including different levels of road networks, wherein each level of road network corresponds to a sparse road network, the highest level of the different levels of road networks is not less than level 2, each waypoint in any N-level road network belongs to an N-level waypoint and there is at least one waypoint belonging to an N+1-level waypoint, any N-level waypoint is in at least one N-level road network, the road sections in different road networks do not overlap, the waypoints in the same road network have connectivity in the same road network, N is an arbitrary positive integer and is less than the highest level; the path planning starting point and the path planning end point are not in the same level 1 road network, and the processor 320 can also be configured as:
[0117] According to the sparse road network and the preset path planning algorithm, an initial temporary path corresponding to the starting point of the path planning and an initial temporary path corresponding to the end point of the path planning are generated; the initial temporary path is added to the first-level temporary path set of the starting segment, the initial temporary path is added to the first-level temporary path set of the last segment, and the current level is updated to the first level; when the current level is updated and does not exceed the highest level, the connectivity between each temporary path in the temporary path set of the starting segment of the current level and each temporary path in the temporary path set of the last segment of the current level is determined; when any temporary path of the starting segment and any temporary path of the last segment have the connectivity of the current level, the path splicing operation corresponding to the current level is performed for any temporary path of the starting segment and any temporary path of the last segment. And add the generated alternative path to the alternative path set; when there is no connectivity between any starting temporary path and any last temporary path at the current level, perform the path extension operation corresponding to the current level for any starting temporary path and any last temporary path, and add the generated starting temporary path to the starting temporary path set of the previous level of the current level, and add the generated last temporary path to the last temporary path set of the previous level of the current level; when the path splicing operation or the path extension operation has been performed on each starting temporary path and each last temporary path, update the current level to the corresponding previous level; when the current level exceeds the highest level, determine the alternative path with the shortest path length in the alternative path set as the target path between the path planning starting point and the path planning end point.
[0118] In the embodiment of the present application, the processor 320 may also be configured to:
[0119] In the case where at least one of the nodes between the path planning starting point and the path planning end point is a non-important waypoint, based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determine the starting transfer waypoint corresponding to the path planning starting point and the final transfer waypoint corresponding to the path planning end point; determine the transfer path and its path length between any starting transfer waypoint and any final transfer waypoint according to the sparse road network and the preset path planning algorithm; determine the preceding path and the succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is the starting transfer waypoint between the path planning starting point and the two end points of any transfer path The path between the waypoints, the subsequent path corresponding to any transit path is the path between the last transit waypoint among the two end points of any transit path and the path planning end point; based on each transit path, the corresponding candidate path and its path length are determined, wherein the candidate path corresponding to any transit path is obtained by splicing the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path; the candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
[0120] Through the above technical scheme, the important waypoints in the map data of the target area are screened out, and other important waypoints near each important waypoint are searched out, and a neighborhood road segment set corresponding to each important waypoint is generated. The neighborhood road segment set is stored in the data format of the adjacency table, and a sparse road network diagram of the target area is generated, so that the data volume of the map data is greatly reduced, saving storage space. Executing the path planning task in the sparse road network can quickly obtain the target path between the path planning starting point and the path planning end point, thereby improving the operation efficiency. The waypoints other than the important waypoints in the map data can be used as non-important waypoints, and the non-important waypoint set in each road segment is stored separately. When performing path planning, the non-important waypoint set of each road segment included in the target path can be called and inserted into each road segment included in the target path as a sequence to generate a detailed target path, so that it becomes an actual passable route. At the same time, the path planning situation when the path planning start and end points are non-important waypoints is also taken into account, and the path with the shortest path length is selected from the generated multiple candidate paths as the target path, thereby optimizing the path planning method. In addition, path planning solutions are provided for multi-level road network scenarios with different levels of road networks. The connectivity of different levels of road networks in different regions is taken into consideration to generate target paths combining different vehicles and improve transportation efficiency.
[0121] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned path planning method.
[0122] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store data of the path planning method. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a path planning method is implemented.
[0123] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0124] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0128] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0129] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0130] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0131] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0132] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A path planning method, characterized in that: The method comprises: Acquire map data of a target area, wherein the map data includes a plurality of roads, each road being a waypoint sequence consisting of a plurality of waypoints; The waypoints included in at least two roads at the same time, the starting waypoints and the ending waypoints on each road are determined as important waypoints; For any important waypoint, searching for other important waypoints adjacent to the important waypoint in each road including the important waypoint; Adding the road section between each important waypoint among the adjacent other important waypoints and the any important waypoint to the neighborhood road section set corresponding to the any important waypoint, wherein any road section is defined by the two important waypoints at its two ends and the distance between the two important waypoints; Generate a sparse road network corresponding to the target area according to a set of neighborhood road segments corresponding to each important waypoint, wherein the sparse road network is a road network simplified based on the road network of the target area; Acquire a path planning task, wherein the path planning task includes a path planning starting point and a path planning end point; A target path between the path planning starting point and the path planning end point is determined according to the sparse road network and a preset path planning algorithm.
2. The path planning method according to claim 1, characterized in that: The method further comprises: Determine waypoints other than important waypoints as non-important waypoints; A set of non-important waypoints corresponding to each road section is obtained, wherein the set of non-important waypoints corresponding to any road section is a waypoint sequence consisting of non-important waypoints between important waypoints at both ends of any road section.
3. The path planning method according to claim 2, characterized in that: The step of obtaining a set of non-important waypoints corresponding to each road section includes: Determine the current road where each waypoint is located; For each waypoint, if the waypoint is the non-important waypoint, searching for two important waypoints closest to the waypoint in the current road; For each waypoint, the waypoint is added to a set of non-important waypoints corresponding to a road segment between two important waypoints closest to the waypoint, so as to obtain a set of non-important waypoints corresponding to each road segment.
4. The path planning method according to claim 2, characterized in that: The step of searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint comprises: For each waypoint sequence included in the road, traverse the important waypoints in the waypoint sequence one by one according to the order of the waypoint sequence; In the case of traversing to any important waypoint, searching each waypoint one by one in the order of the waypoint sequence to determine the first searched important waypoint as another important waypoint adjacent to the any important waypoint, and determining the searched waypoints that are not the important waypoints as non-important waypoints; The step of obtaining a set of non-important waypoints corresponding to each road section includes: Based on the non-important waypoints between any important waypoint and other important waypoints adjacent to the any important waypoint, a set of non-important waypoints corresponding to the road section between any important waypoint and other important waypoints adjacent to the any important waypoint is generated.
5. The path planning method according to claim 2, characterized in that: The method further comprises: Obtain a set of non-important waypoints corresponding to each road segment included in the target path; A set of non-important waypoints corresponding to each road segment included in the target path is inserted into each road segment included in the target path as a sequence to generate a detailed target path between the path planning starting point and the path planning end point.
6. The path planning method according to claim 2, characterized in that: Determining the target path between the path planning starting point and the path planning end point according to the sparse road network and a preset path planning algorithm comprises: In the case where at least one of the path planning starting point and the path planning end point is a non-important waypoint, Based on the path planning starting point, the path planning end point, the sparse road network and the set of non-important waypoints corresponding to each road section, determining the starting transfer waypoint corresponding to the path planning starting point and the last transfer waypoint corresponding to the path planning end point; Determine the transfer path and its path length between any starting transfer waypoint and any ending transfer waypoint according to the thinned road network and the preset path planning algorithm; Determine a preceding path and a succeeding path corresponding to each transfer path, wherein the preceding path corresponding to any transfer path is a path between the path planning starting point and the first transfer waypoint among the two end points of any transfer path, and the succeeding path corresponding to any transfer path is a path between the last transfer waypoint among the two end points of any transfer path and the path planning end point; Determine the corresponding candidate path and its path length based on each transit path, wherein the candidate path corresponding to any transit path is obtained by splicing the any transit path and the preceding path and the succeeding path corresponding to the any transit path, and the path length of the candidate path corresponding to any transit path is the sum of the lengths of the any transit path and the preceding path and the succeeding path corresponding to the any transit path; The candidate path with the shortest path length is determined as the target path between the path planning starting point and the path planning end point.
7. The path planning method according to claim 1, characterized in that: The step of determining the waypoints simultaneously included in at least two roads, the starting waypoints and the ending waypoints on each road as important waypoints comprises: Get the longitude and latitude coordinates of each waypoint; Traversing each waypoint of each road based on the latitude and longitude coordinates; For each waypoint, when the number of traversal times of the waypoint is greater than or equal to a preset threshold, the waypoint is determined to be the important waypoint.
8. The path planning method according to claim 1, characterized in that: The method further comprises: For each waypoint, when the number of traversal times of the waypoint is less than a preset threshold and the waypoint is not the starting waypoint or the ending waypoint, it is determined that the waypoint is indeed a non-important waypoint.
9. The path planning method according to claim 1, characterized in that: The step of searching for other important waypoints adjacent to any important waypoint in each road including any important waypoint comprises: For any important waypoint, in a sequence of waypoints included in each road containing the any important waypoint, each waypoint is searched one by one towards the front and back of the any important waypoint according to the sequence number of the any important waypoint, and the important waypoints that are first searched in the process of searching one by one towards the back and back are determined as other important waypoints adjacent to the any important waypoint.
10. The path planning method according to claim 1, characterized in that: The method is applied to a multi-level road network scenario including different levels of road networks, wherein each level of road network corresponds to a sparse road network, the highest level of the different levels of road networks is not less than level 2, each waypoint in any N-level road network belongs to an N-level waypoint and there is at least one waypoint that belongs to an N+1-level waypoint, any N-level waypoint is in at least one N-level road network, the road sections in different road networks do not overlap, the waypoints in the same road network have connectivity in the same road network, and N is any positive integer and is less than the highest level; The path planning starting point and the path planning end point are not in the same primary road network, and determining the target path between the path planning starting point and the path planning end point according to the sparse road network and a preset path planning algorithm comprises: Generate an initial temporary path corresponding to the starting point of the path planning and an initial temporary path corresponding to the end point of the path planning according to the sparse road network and a preset path planning algorithm; Add the initial start temporary path to the first-level start temporary path set, add the initial end temporary path to the first-level end temporary path set, and update the current level to the first level; In a case where the current level is updated and does not exceed the highest level, determining connectivity between each start-segment temporary path in the start-segment temporary path set of the current level and each end-segment temporary path in the end-segment temporary path set of the current level; In the case that any starting temporary path and any last temporary path have connectivity at the current level, performing a path concatenation operation corresponding to the current level on the any starting temporary path and the any last temporary path, and adding the generated candidate path to the candidate path set; In the case that any starting temporary path and any last temporary path do not have connectivity at the current level, a path extension operation corresponding to the current level is performed on the starting temporary path and the last temporary path, and the generated starting temporary path is added to the starting temporary path set of the previous level of the current level, and the generated last temporary path is added to the last temporary path set of the previous level of the current level; When a path concatenation operation or a path extension operation has been performed on each of the initial temporary paths and each of the final temporary paths, updating the current level to a corresponding previous level; In the case that the current level exceeds the highest level, the candidate path with the shortest path length in the candidate path set is determined as the target path between the path planning starting point and the path planning end point.
11. A path planning device, characterized in that: include: a memory configured to store instructions; and a processor configured to call the instructions from the memory and implement the path planning method according to any one of claims 1 to 10 when executing the instructions.
12. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the path planning method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Route planning method and device for unstructured environment, equipment and medium
CN113741453A
Power transformation equipment inspection robot path planning method, equipment and storage medium
CN115933637A
Path planning method and device, electronic equipment and storage medium
CN116295471A
Unmanned aerial vehicle path planning method and device, and storage medium
CN117590845A
Global path planning method, electronic equipment and storage medium
CN117804474A
