Indoor unmanned aerial vehicle path planning method and device, medium and program product
By improving the A* algorithm and 4D mesh encoding, and combining the cost function of flight constraints and distance penalties, the node search is optimized, which solves the problem of time-consuming path planning in traditional algorithms with tens of millions of meshes, and realizes fast path planning for indoor UAVs.
Patent Information
- Application Number
- CN202511086340.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-11-28
AI Technical Summary
Existing path planning algorithms struggle to meet real-time path planning requirements with grids of tens of millions. Traditional A* algorithms are too time-consuming and cannot meet the needs of rapid path planning for indoor drones.
An improved A* algorithm is adopted, which combines 4D mesh encoding and directional heuristic pruning strategy. By introducing a cost function with flight constraints and distance penalties, node search is optimized, and path planning is performed using priority queues and open dictionary data structures.
It achieves path planning in the tens of milliseconds range with tens of millions of grids, improving the speed and real-time performance of path planning, and is suitable for indoor path planning of multi-rotor UAVs.
Smart Images

Figure CN121026093A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer-readable medium, and computer program product for indoor drone path planning. Background Technology
[0002] When drones fly in complex indoor spatiotemporal environments, it is necessary to consider factors such as the probability of their flight direction and the cost of turning, depending on the type of drone, in order to more accurately model the drone's flight status. However, when performing fine-grained mesh modeling indoors, the large amount of mesh data brings problems of encoding and storage, as well as computational complexity in path planning algorithms.
[0003] Currently, grid-based modeling of complex indoor spatiotemporal scenes only meets the requirements for second-level dynamic path planning at the tens of thousands of grid points. When the number of grid points increases to the tens of millions, existing path planning algorithms struggle to meet real-time path planning needs. For example, traditional A-satellite (A... The algorithm takes more than 1.2 seconds to plan a path in a grid of tens of millions of cells. Summary of the Invention
[0004] This application provides a method, apparatus, computer-readable medium, and computer program product for indoor unmanned aerial vehicle (UAV) path planning.
[0005] One aspect of this application provides a method for indoor drone path planning, wherein the method includes: In response to the path planning command of the UAV in the indoor environment, the 4D mesh code corresponding to the current position and the destination position of the UAV is obtained, wherein the 4D mesh code is used to uniquely identify the indoor mesh element; Based on the location of the drone and the location of obstacles, the collision risk is calculated and assessed through spatiotemporal relationships, which include spatial relationships and temporal relationships. Based on the evaluation results, an improved A* algorithm and node search strategy are used to plan the path. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy adopts directional heuristic pruning.
[0006] One aspect of this application provides an apparatus for indoor drone path planning, wherein the apparatus includes: The grid code acquisition module is used to acquire the 4D grid code of the grid cell corresponding to the current position and the destination position of the UAV in response to the path planning command of the UAV in the indoor environment. The 4D grid code is used to uniquely identify each grid cell corresponding to the indoor environment. The spatiotemporal relationship calculation module is used to determine the spatiotemporal relationship between the corresponding grid elements based on the current position of the UAV and the positions of one or more target obstacles, thereby assessing whether the UAV will collide with the target obstacles. The spatiotemporal relationship includes spatial relationship and temporal relationship. The path planning execution module is used to plan paths based on the evaluation results using an improved A* algorithm and a node search strategy. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy employs directional heuristic pruning.
[0007] In another aspect of this application, an electronic device is provided, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods of embodiments of this application.
[0008] In another aspect, this application provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor to implement the methods of the embodiments of this application.
[0009] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods of embodiments of this application.
[0010] The solution provided in this application offers an improved A* algorithm for indoor UAV path planning. Based on the traditional A* algorithm, it introduces UAV flight constraints and distance penalties to improve the cost function, adopts a direction-first heuristic pruning strategy, and optimizes the data structure by introducing priority queues and open dictionaries. This fully incorporates the flight characteristics of multi-rotor UAVs into the cost function, making path planning more closely match the actual flight capabilities of UAVs. It achieves millisecond-level path planning on a map with tens of millions of grid cells. During node search, directional heuristic pruning of node expansion solves the problem of large-scale node expansion caused by multi-directional search, reducing the search space and improving search efficiency. Data structure optimization addresses the increased time required for linear list search due to large-scale node storage, further improving the algorithm's operating efficiency. The improved A* algorithm achieves millisecond-level path planning on a map with tens of millions of grid cells, significantly improving the speed and real-time performance of path planning, providing a solid foundation for route planning in indoor UAV last-mile logistics delivery scenarios. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A flowchart illustrating a method for indoor drone path planning provided in an embodiment of this application is shown. Figure 2 A schematic diagram illustrating an exemplary indoor partitioned time 4D mesh coding structure and bit field allocation according to this application is shown; Figure 3 A schematic diagram of a 26-neighborhood of an exemplary drone according to this application and a diagram of grid occupancy after flight are shown. Figure 4 A schematic diagram illustrating an exemplary node search process after data structure optimization according to an embodiment of this application is shown; Figure 5 A schematic diagram of a device for indoor drone path planning provided in an embodiment of this application is shown. Figure 6 A schematic diagram of the structure of a device suitable for implementing the scheme in the embodiments of this application is shown.
[0013] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0016] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0017] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program 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 technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0018] Figure 1 This illustration shows a flowchart of a method for indoor drone path planning according to an embodiment of this application. The method includes at least steps S101, S102, and S103.
[0019] In practical scenarios, the execution entity of this method can be a computer device or an application running on that computer device. The computer device includes user devices or network devices. User devices include, but are not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and smart bands. Network devices include, but are not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud consists of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a loosely coupled set of computers.
[0020] In some embodiments, the method is executed by a terminal or server providing drone route planning services. In some embodiments, the route planning method of this application can be implemented by a computer program or executable instructions running on the terminal or server. These programs or instructions can be native operating system programs (such as dedicated route planning programs), software modules, or modules embedded in other programs (such as instant messaging, photo albums, electronic maps, navigation clients, etc.). They can also be locally installed applications (APPs).
[0021] This application provides an indoor partitioned 4D coding model, defining the spatiotemporal relationship and calculation of the partitioned 4D mesh; then, combining the flight dynamics characteristics of multi-rotor UAVs, which are currently the most widely used in last-mile logistics delivery, it optimizes the overall cost function, and simultaneously adopts a directional heuristic search strategy and optimizes the data structure during node search, proposing an improved A... A path planning algorithm for 3D path planning when the 1D temporal encoding of spatial mesh elements is the same.
[0022] The partitioned 4D coding model in this embodiment is a partitioned 4D mesh coding model designed for complex indoor spatiotemporal environments. The basic unit of the partitioned 4D coding model is a mesh volume element, each containing three-dimensional spatial information and one-dimensional temporal information, which together map the spatiotemporal information of the physical space to the mesh coding of the virtual space.
[0023] In some embodiments, the subdivision 4D coding model employs GeoSOT (Geographical coordinate Subdivision grid with One dimension integral coding on...) The GeoSOT (Geographic Space Grid) framework serves as the basic framework for spatial partitioning, while the BeiDou Distributed Time Code (BDSTime Code) serves as the basic framework for temporal partitioning. It partitions, encodes, and represents both the three-dimensional geographic space and the temporal dimension. GeoSOT is the geographic spatial partitioning framework, and BDSTime Code is the temporal partitioning code for the BeiDou system. This spatial grid system, through octree partitioning and virtual expansion, achieves seamless and non-overlapping full coverage of the entire Earth's space. Similarly, the temporal grid system achieves full coverage at the time scale through virtual expansion. The entire spatiotemporal grid framework features full spatiotemporal coverage, multi-level and multi-scale nested grids, and computable encoding. It can discretize spatiotemporal data through grid encoding, thereby achieving unique encoding for each location coordinate and time node.
[0024] In the scenario of intelligent drone delivery, the spatiotemporal data organization and retrieval in complex indoor dynamic environments pay close attention to the spatial location and temporal attributes of obstacles. At the same time, the drone's positioning, path planning, and obstacle avoidance also require unique spatiotemporal coding support. Therefore, the combination of GeoSOT-3D spatial partitioning framework and BeiDou 1D temporal partitioning framework is very suitable for this scenario, enabling efficient spatiotemporal unification and collaborative computing.
[0025] Reference Figure 1 In step S101, in response to the path planning command of the UAV in the indoor environment, the 4D mesh code corresponding to the current position and the destination position of the UAV is obtained.
[0026] The indoor environment mentioned here includes the indoor environment of various individual buildings. For example, office buildings, shopping malls, airport terminals, hospitals, factory buildings, warehouses, residential buildings, hotels, stadiums and other building structures with indoor spaces.
[0027] The 4D mesh encoding is used to uniquely identify mesh elements within the room. Each mesh element contains three-dimensional spatial information and one-dimensional temporal information, which together map the spatiotemporal information of the physical space to the mesh encoding of the virtual space.
[0028] The grid cell element refers to the smallest addressable spatiotemporal unit obtained through recursive subdivision within an integrated indoor and outdoor coordinate framework. The three-dimensional scale of the grid cell element is determined by the spatial resolution at the centimeter or millimeter level, and the temporal scale is determined by the temporal resolution at the microsecond level. Therefore, each grid cell element has both a unique spatial code and a unique temporal code.
[0029] The method determines the time segmentation range of the indoor spatiotemporal segmentation range based on the characteristics of the building's indoor environment, the indoor positioning accuracy requirements, the maximum flight time of the drone, and the need for immediate delivery.
[0030] The maximum flight time of the drone refers to the longest continuous flight time it can fly on a full charge. Instant delivery demand refers to the requirement to complete goods delivery within a specific timeframe; for example, emergency medical supplies delivery may require completion within a few minutes. Path planning time refers to the time required to plan the optimal path from the origin to the destination. Minimum-scale grid flight time refers to the time required for the drone to fly once within the smallest possible grid. These factors collectively determine the accuracy and coverage of the time grid.
[0031] Currently, indoor path planning for drones can achieve millisecond-level planning. Furthermore, considering that the highest speed of small and medium-sized multi-rotor drones exceeds 40 m / s and the minimum grid size is 3.75 mm, the shortest time for a drone to traverse a single grid is also in the millisecond range. Based on this, this application selects the 25th level (time granularity of 128 microseconds) of the precise time-recording BeiDou subdivided time code as the 26th level grid of the indoor subdivided time 1D grid code.
[0032] The 4D mesh coding structure is a triple, comprising a 3D spatial mesh code, a 1D temporal mesh code, and a passage attribute code. The passage attribute code is used to identify the occupancy status of dynamic obstacles, i.e., whether passage is permitted. According to one embodiment, the passage attribute code is 0 or 1, where 0 indicates passage is permitted and 1 indicates impassable.
[0033] According to one embodiment, the 4D mesh coding structure is designed based on the GeoSOT-3D spatial partitioning framework and the BeiDou 1D temporal partitioning framework, such as... Figure 2 As shown. (Refer to...) Figure 2 An indoor partitioned 4D coding structure is constructed using a triplet structure, with the longest code element being 61 bits. It is stored in the structure "{Indoor Partitioned Spatial 3D Mesh Code, Indoor Partitioned Temporal 1D Mesh Code, Accessibility Attribute Code}", where each mesh element has a unique spatial and temporal code. Simultaneously, simplified 0 / 1 coding records the accessibility attribute information of the mesh, where 0 indicates accessibility and 1 indicates inaccessibility. This structure can efficiently describe the dynamic spatiotemporal environment indoors, while the accessibility attribute code effectively records the mesh occupancy of obstacles, fully reflecting "situational" information and providing a data foundation for real-time path planning of UAVs.
[0034] Based on one example, continue to refer to Figure 2 The mathematical expression for the 4D mesh encoding of each mesh element, as shown in the encoding structure, is as follows: Using a set of mathematical expressions to define 4D mesh elements, the 3D mesh encoding set for an interior space can be represented as follows: (1) in, This represents the complete set of 3D mesh codes for the partitioned interior space of a building. N represents the total number of mesh elements.
[0035] Next, the indoor time 1D grid encoding set can be represented as: (2) in, M represents the complete set of discrete time 1D mesh encodings during the flight of a drone in the indoor space of a building, where M represents the number of discrete time intervals.
[0036] Therefore, the interior partitioned 4D coding can be represented as: (3) in, This represents the spatial 3D encoding of the k-th mesh element. This represents the time 1D encoding of the k-th grid cell at a certain moment (or time period). This indicates the access attribute code (0 indicates that the drone can pass, and 1 indicates that it cannot pass).
[0037] The encoded set of spatiotemporal grid elements within the building is represented as follows: (4) To maintain a consistent format, there are P grid elements, each stored in a binary one-dimensional grid code of up to 61 bits.
[0038] According to one embodiment, the method is based on the 4D mesh encoding of each mesh element and uses time slices to describe the dynamic mesh situation at any given time.
[0039] Based on the aforementioned example, an indoor spatiotemporal slice at a certain moment is obtained, and the dynamic grid situation at time t can be represented as: (5) in, This represents all grid cells that undergo "spatiotemporal changes" and their transit properties at time slice t.
[0040] In step S102, based on the location of the drone and the location of the obstacle, the collision risk is calculated and assessed through spatiotemporal relationships, which include spatial relationships and temporal relationships.
[0041] The spatial relationship refers to the relative positional relationship between two grid elements, including three states: intersecting, adjacent, and disjoint. The temporal relationship refers to whether the time codes of the two grid elements are equal, i.e., whether they are at the same time level.
[0042] According to one embodiment, the rules for calculating and assessing collision risk based on the drone's location and the obstacle's location through spatiotemporal relationships include: If the spatiotemporal relationship between the two is that they intersect in space, then a collision will occur between the drone and the obstacle. If the two are spatially adjacent in terms of time and space, there is a risk of collision between the drone and the obstacle; If the two are spatially separated, the drone can travel safely without needing to avoid obstacles. If two things are at the same fixed time level and intersect spatially, then they are considered to be in a spatiotemporal conflict. Here, being at the same fixed time level means being at the same moment.
[0043] According to one embodiment, the grid element is constructed by recursively bisecting in three dimensions, using an octree encoding order, so that when each octal one-dimensional code is converted into a binary three-dimensional code, the corresponding three codes represent the three directions of longitude (L), latitude (B) and altitude (H).
[0044] Intersection is defined by the parent-child relationship between spatial grid cells. The prefix of the fine-grained grid code is extracted, and its similarity to the coarse-grained grid code is checked to determine if they are identical. When two spatial grid cells are at the same level, the difference between their codes in a single dimension (0, 1, or greater than 1) indicates whether they are identical, adjacent, or disjoint. When two spatial grid cells are not at the same level, the intersection criteria are similar. The fine-grained grid is first extracted, its prefix is transformed to the same parent grid level, and then the difference between the codes at the same level is used for comparison.
[0045] According to one embodiment, step S102 includes steps S1021 to S1024.
[0046] In step S1021, the three-dimensional spatial coordinates and timestamp of the current position of the UAV are obtained.
[0047] The embodiments of this application can obtain the location of a drone in various ways. For example, by using Ultra Wide Band (UWB) positioning technology, by attaching a UWB positioning tag to the drone and deploying multiple UWB positioning base stations in the space, the precise determination of the drone's flight position can be achieved.
[0048] In step S1022, based on the pre-constructed octree mesh index, the three-dimensional spatial coordinates and timestamps are converted into corresponding 4D mesh volumetric codes and time-level codes, respectively.
[0049] In step S1023, the spatiotemporal location information of the obstacle is obtained. The spatiotemporal information of the obstacle includes the three-dimensional spatial coordinates of one or more target obstacles in the indoor environment and the timestamps corresponding to their motion trajectories. The three-dimensional spatial coordinates and timestamps are then converted into corresponding 4D mesh element codes and time-level codes, respectively.
[0050] In step S1024, based on a unified spatial and temporal hierarchy, spatiotemporal relationship calculations are performed on the UAV voxels and the mesh voxels of the one or more target obstacles to obtain their spatial relationship (intersecting / adjacent / separated) and temporal relationship (whether the time codes are equal), thereby assessing the collision risk.
[0051] The following uses exemplary mathematical expressions to express the above spatiotemporal relationships, and defines the unified symbolic representation of grid coding, specifically including: In partitioned spatial 3D encoding, using Representing levels The one-dimensional binary encoding of longitude, latitude, and altitude is used in the partitioned time 1D encoding. Represents 1D time encoding at a fixed time level ν; To express the operation of "taking the prefix", This indicates taking the high-order prefix (1 to 1) of the interior mesh code (representing the interior 3D mesh code of a building) from the partitioned 4D mesh code or the 26-bit MTC code from the partitioned time 1D mesh code. Bit); To determine whether they are adjacent or disjoint, we define ΔL, ΔB, and ΔH to represent the integer differences in the encoding of spatial elements at the same level in each dimension.
[0052] The determination methods for the three spatial positional relationships (spatial intersection, spatial adjacency, and spatial separation) and temporal relationships (equal time) between mesh elements include: 1) Spatial intersection: If there are two levels ,satisfy: and and Then the granular three-dimensional mesh s The 3D encoding of 1 is a fine-grained 3D mesh. s The high-order prefix of the code indicates that the fine mesh is completely contained within the coarse mesh. The two form a "parent-child" relationship, and geometrically, there is a volume element overlap, which needs to be judged as a collision conflict.
[0053] 2) Spatially adjacent; If a hierarchy exists ,and , , If the following conditions are met, then they are considered spatially adjacent: When (Δ L ,Δ B ,Δ H When )∈{(1,0,0),(0,1,0),(0,0,1)}, the two are adjacent faces; When (Δ L ,Δ B ,Δ H When )∈{(1,1,0),(0,1,1),(1,0,1)}, the two are adjacent edges; When (Δ L ,Δ B ,Δ H When ) = (1,1,1), the two points are adjacent.
[0054] 3) Spatially separated; If a hierarchy exists ,satisfy: and and Furthermore, if the equal signs are not removed simultaneously, it means that the three-dimensional codes are at least 2 grid widths apart in longitude, latitude, or altitude, and are therefore judged as spatially separated.
[0055] 4) The time is equal; If the two grid elements are at the same fixed time level ν That is, they occur "at the same moment", and their time codes satisfy... If they are equal in time, then they are considered to have the same time.
[0056] The spatiotemporal relationship calculation in this application includes spatial orientation calculation and spatial distance calculation, which will be explained below.
[0057] 1) Spatial orientation calculation; In the spatial 3D mesh coding system, the coding is inherited from the GeoSOT-3D spatial partitioning framework and adopts an octree Z-order partitioning method. This partitioning method makes the mesh codes inherently ordered, and the orientation relationship between the corresponding mesh elements can be directly derived from the coding order, which greatly facilitates the organization and analysis of three-dimensional spatial data.
[0058] Within the octree Z-order partitioning framework, each bit of the 3D encoding is written cyclically in the order of "longitude L → latitude B → altitude H," following the rule of high-order bits first and low-order bits last. When determining the relative orientation of two voxels, if the two voxels are at the same level s, their corresponding bit encoding values can be compared directly from high to low to accurately determine their relative orientation on the x, y, and z axes. If the two voxels are at different levels, their common prefix level s_min is extracted first, and then bit comparison is performed based on this. This approach is consistent with the cross-level adjacency determination approach mentioned earlier.
[0059] Taking the coding sequence of the Northeast Hemisphere as an example, the mapping relationship between position difference and orientation is as follows: At the longitude (L) position, a coding difference of 0 indicates that the grid cell is located on the west side; a coding difference of 1 indicates that it is located on the east side. At the latitude (B) position, a coding difference of 0 indicates the south side, and a coding difference of 1 indicates the north side. At the altitude (H) position, a coding difference of 0 indicates the lower layer, and a coding difference of 1 indicates the upper layer. This orientation determination method based on coding position difference is simple and efficient, and can quickly and accurately determine the spatial positional relationship between grid cells, providing strong support for the processing and analysis of three-dimensional spatial data.
[0060] 2) Spatial distance calculation; This application selects a multi-rotor drone commonly used in last-mile logistics delivery as the flight modeling object. Multi-rotor drones are flexible and can take off and land vertically. They have six degrees of freedom, including yaw, pitch, roll, surge, sway, and lift.
[0061] To more accurately simulate the movement characteristics of a multi-rotor UAV, this application defines 26 scalable grid neighborhoods for the multi-rotor UAV. These neighborhoods include 8 horizontal directions, 8 upward directions, 8 downward directions, and 2 purely vertical directions.
[0062] The neighborhood is divided into eight horizontal directions: North (N), Northeast (NE), East (E), Southeast (SE), South (S), Southwest (SW), West (W), and Northwest (NW). The eight upward directions are: Up North (UN), Up Northeast (UNE), Up East (UE), Up Southeast (USE), Up South (US), Up Southwest (USW), Up West (UW), and Up Northwest (UNW). The eight downward directions are: Down North (DN), Down Northeast (DNE), Down East (DE), Down Southeast (DSE), Down South (DS), Down Southwest (DSW), Down West (DW), and Down Northwest (DNW). Two purely vertical directions are: Up (U) and Down (D). This neighborhood setup covers all possible movement directions of the UAV in three-dimensional space, making its flight path closer to reality. (See reference...) Figure 3 The drone is located at the central grid cell and has a vertical downward flight tendency. The 26-neighborhood of the drone and its grid occupancy after flight are shown below. Figure 3 As shown.
[0063] Common distances used in spatial computation include Manhattan distance, Euclidean distance, Chebyshev distance, and diagonal distance. In the subsequent algorithms of this application, considering the significant turning cost of the UAV, the algorithm prioritizes keeping the UAV moving in a straight line, which is essentially moving according to the calculation direction of Euclidean distance. However, calculating Euclidean distance involves square and square root operations, which are difficult to express directly using bitwise operations in grid encoding, increasing computational complexity in actual algorithm implementation.
[0064] This application improves the heuristic function by combining diagonal distance and Manhattan distance. Diagonal distance effectively handles diagonal movement, while Manhattan distance is suitable for horizontal and vertical movement. By combining these two distance metrics, this application can more accurately simulate the flight path of a drone while maintaining computational efficiency, thereby optimizing the path planning algorithm for logistics delivery and improving delivery efficiency and accuracy.
[0065] For a point in three-dimensional space , the calculation formulas of its diagonal distance and Manhattan distance are respectively the following formulas (6) and formula (7): ;
[0066] The above formulas only use addition and multiplication operations in mathematical algebra, without involving the square and square root operations of Euclidean distance, and the calculation speed is fast.
[0067] In the spatial grid coding system, in order to efficiently calculate the spatial distance between any two grid voxels, the present application proposes a spatial distance calculation method based on grid coding. This method converts mathematical algebraic calculations into binary bit operations, avoiding the complex square and square root operations in Euclidean distance calculations, thereby significantly improving the calculation speed. This method is particularly applicable to scenarios based on split-type spatial 3D coding and can quickly calculate the diagonal distance and Manhattan distance.
[0068] Specifically, the spatial distance calculation method of any two grid voxels is defined through an algorithm, and the mathematical algebraic calculation of the formula is converted into the single dimension of split-type spatial 3D coding at different levels of binary bit operations, and the calculation speed is much higher than that of floating-point operations, further accelerating the distance calculation speed.
[0069] According to an embodiment, the input parameters of the algorithm include two spatial grid codings and , as well as their corresponding grid scales and . The output of the algorithm is the diagonal distance and the Manhattan distance , and the process of the algorithm includes: First, the algorithm unifies the lengths of the two grid codings. If i < j, then shift left by j i bits; if i > j, then shift left by i j bits. This step ensures that the two codings have the same length in subsequent calculations; Next, the algorithm calculates the number of bits L per layer and sets it to max(i, j). Since each layer of coding consists of 3 bits, L represents the total number of layers; Next, the algorithm splits each grid coding into three single-dimensional codings, corresponding to height (H), latitude (B), and longitude (L) respectively.
[0070] By iterating through each layer, the encoded value of each dimension is extracted and stored in the corresponding variable. The purpose of this step is to decompose the three-dimensional encoding into three independent dimensions, which facilitates subsequent bitwise operations. After completing the encoding split, the algorithm calculates the grid index difference for each dimension. Specifically, it calculates the encoding differences for the longitude, latitude, and altitude dimensions separately. , and These differences are derived through binary operations, ensuring efficient computation. Next, the algorithm selects... and The minimum value in the range is used as the final distance scale. ; Finally, the algorithm calculates the diagonal distance and the Manhattan distance; where the diagonal distance... Take the minimum difference among the three dimensions and multiply it by the scale. Manhattan distance This involves adding the differences between the three dimensions and then multiplying by the scale.
[0071] The following continues to refer to... Figure 1 To explain, in step S103, based on the evaluation results, a path is planned using an improved A* algorithm and a node search strategy. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy employs directional heuristic pruning.
[0072] According to one embodiment, this application embodiment achieves millisecond-level path planning under a multi-million-level grid cell map by using a cost function with flight constraints and distance penalties, performing directional heuristic pruning on node expansion, and adopting a priority queue and open dictionary data structure.
[0073] In the improved A* algorithm of this application embodiment, the nodes correspond to grid volume elements.
[0074] The cost function containing flight constraints and distance penalties, the node search strategy using directional heuristic pruning, and the data structures of priority queues and open dictionaries will be explained separately later.
[0075] Specifically, step S103 further includes steps S1031 to S1034.
[0076] In step S1031, at a certain time slice, starting from the current position of the UAV, 3D path planning is performed according to the improved cost function and node search strategy that incorporates UAV flight constraints and distance penalties. Here, a certain time slice means that the 1D time encodings of the mesh elements are at the same moment.
[0077] In step S1032, the node with the lowest cost is taken from the priority queue as the current node. It is determined whether the current node is the destination. If it is, the search ends and the path is backtracked; otherwise, the neighboring nodes of the current node are expanded.
[0078] In step S1033, for each neighboring node, its cost function value is calculated, and a decision is made on whether to add it to the priority queue and open dictionary based on the directional heuristic search strategy and pruning rules.
[0079] In step S1034, the above steps are repeated until the destination is found or the priority queue is empty.
[0080] The traditional A* algorithm is a heuristic search method that quickly finds a path from the starting point to the ending point by combining the actual cost and the heuristically estimated cost. The overall cost function of the A* algorithm is: (8) in, This represents any node grid encountered by the algorithm during the spatial search process. It is a node The overall cost function represents the cost of the optimal path from the initial grid to the target grid. It is the actual cost function, representing the cost from the starting point to the node. The actual cost, It is a heuristic cost function, representing the cost from node The heuristic minimum estimated cost to the destination. A The algorithm is configured to search continuously from the initial grid; therefore, the cost value of the current grid is continuously less than the cost value of the previous grid, which means... By continuously reducing the value of the cost function, the final grid is eventually reached at the lowest cost, that is, the optimal path is found.
[0081] This application embodiment improves the overall cost function shown in formula (8), in the overall cost function Introducing weighting coefficients and To balance practical and heuristic costs, the improved evaluation function is defined as follows: (9) in, Represents the actual cost function The weight, Representing the heuristic cost function The weight. When In some cases, the algorithm becomes more "greedy," meaning it tends to explore in the direction of the target. This "greedy" behavior helps speed up path planning, but it may sacrifice the optimality of the path to some extent. By adjusting appropriately... and The value of can find the optimal balance between algorithm efficiency and path quality.
[0082] The actual cost functions of the embodiments of this application are described below. and heuristic cost function Please provide an explanation.
[0083] 1) Actual cost function
[0084] Actual cost function The complete expression is:
[0085] in, This indicates the transition from the previous mesh element to the next mesh element. The actual cost, Indicates that the drone is in The spatiotemporal volume element in which the path is located during step planning. Indicates by the first The flight direction is determined by the path planning. It is initialized to 0, representing the actual cost at the starting point. This represents the distance penalty function.
[0086] According to one embodiment, the actual cost from the previous mesh element to the current mesh element i is... Defined as: (11) in, This indicates the cost differences associated with different drone movement patterns. Indicates two adjacent grids and The distance between them. According to the definition of spatiotemporal relationships in embodiments of this application, adjacent surfaces... When edges are adjacent When angles are adjacent Because multi-rotor drones have vertical take-off and landing characteristics, the cost of vertical up-and-down flight and straight flight is the lowest, followed by the cost of horizontal turning, while the cost of climb / dive and diagonal up-and-down flight is the highest.
[0087] Table 1 below lists the directional costs from one mode of motion to another in the embodiments of this application. The corresponding multi-rotor UAV motion direction and its explanation are provided.
[0088] Table 1
[0089] The cost values in Table 1 are based on experiments on the turning energy consumption of multi-rotor UAVs.
[0090] According to one embodiment, the A* algorithm of this application calculates the first... After the actual cost function is calculated following the path planning, the current grid cell element is then calculated. Manhattan distance from the destination The calculation formula between any two mesh elements is shown in formula (7). When If the distance to the destination is greater after moving, a smaller distance penalty term is added to the actual cost function; otherwise, no penalty term is added. The formula for the distance penalty term is:
[0091] 2) Heuristic cost function
[0092] The heuristic cost function in this application embodiment The complete expression is: (13) (14) in, Indicates that the drone is in The spatiotemporal volume element in which the path is located during step planning. and These represent the single-axis distance and diagonal distance of the volume element from the endpoint, respectively. The calculation process involves... for The distance difference between the spatiotemporal volume element and the endpoint volume element in the three dimensions of longitude, latitude, and altitude. This represents the direction penalty function.
[0093] In its actual physical meaning, This is generally used in raster maps or coding systems to represent the minimum number of cells that need to be traversed in each direction. It indicates the number of steps that can be taken simultaneously along the diagonal direction, that is, how many steps can be taken in a way that allows movement in three directions at the same time. This represents the Manhattan distance minus three times the diagonal distance, which can be understood to some extent as the number of steps taken along a single axis. Combined... This is an approximation of the Euclidean distance, when Or, when one or two dimensions are 0 (in the case of a pure plane or a pure line), Equal to the Euclidean distance; in other mixed cases... Slightly larger than the Euclidean distance.
[0094] This algorithm does not use Euclidean distance as the distance calculation reference in the heuristic cost function; instead, it uses diagonal distance. Distance from Manhattan The calculation formulas for the two distances are shown in formulas (6) and (7). These two distances are calculated using only simple addition and subtraction operations and maximum / minimum values, which can be efficiently implemented using bitwise operations of a three-dimensional binary grid encoding (displacement, bit concatenation, binary subtraction). The computational efficiency is far higher than that of Euclidean distance calculations, which require square roots and floating-point numbers. When performing large-scale searches using the improved A* algorithm based on this embodiment, a large number of node expansions are required, and distance calculations are performed for each node expansion. This heuristic cost function design significantly shortens the computation time.
[0095] in, The directional penalty includes altitude change penalty and turning penalty, and the cost of path search caused by changes in flight direction during multi-rotor UAV flight needs to be considered at the same time. The calculation formula is:
[0096]
[0097] in, express The distance difference between the spatiotemporal volume element and the endpoint volume element in the height dimension. Take the actual cost function The weight.
[0098] The orientation penalty term applies a smaller penalty coefficient to the altitude change caused by the vertical take-off and landing of the multi-rotor UAV, and a slightly larger penalty coefficient to the flight orientation change caused by turning. This is consistent with the actual cost function mentioned earlier. The cost of precise direction The design of vertical flight costs and straight flight costs is consistent. This differs from algorithms that calculate actual costs. The more detailed directional weighting system used in this context accurately reflects the actual cost, and the heuristic function... Using simple altitude change penalties and turning penalties is for computational efficiency, to maintain the overall speed of the search, to ensure that heuristic estimates are always applicable and consistent, and to avoid making overly complex or even risky branch decisions when the specific flight direction is unknown.
[0099] During the node search process, considering the flight characteristics of multi-rotor UAVs, a node expansion of 26 neighborhoods was designed. In the search process of tens of millions of grids, a large number of nodes will be expanded. In addition, when a node can be reached through multiple paths, the A* algorithm will update the information of the node multiple times. If the path length of multiple paths is equal to the current optimal path, a lot of redundant calculations will occur. Simply modifying the cost function as described above cannot avoid the explosive node expansion.
[0100] According to one embodiment, in step S103, based on the node search strategy, a directional heuristic pruning strategy is adopted. By comparing the distance difference in the horizontal and vertical directions, the preferred search direction is dynamically determined, and a combined direction expansion node set is generated to obtain the preferred search direction set.
[0101] The set of preferred search directions is used to guide the algorithm to prioritize exploring directions that are more likely to approach the target during path planning, effectively reducing unnecessary node expansion and significantly improving search efficiency.
[0102] Specifically, the horizontal direction of priority for searching is determined by comparing the distance difference between the target node and the current node in the horizontal direction. The horizontal direction includes both east-west and north-south directions. This process utilizes heuristic information to guide the search direction, avoiding wasting computational resources in irrelevant directions.
[0103] Next, if the vertical distance difference is significantly greater than the horizontal distance difference, then expansion in the vertical direction is prioritized. This judgment mechanism, based on a heuristic function design, can dynamically adjust the search direction, ensuring a more efficient search process.
[0104] Next, by combining the horizontal and vertical directions, a combined directional expansion node set is generated to cover a wider search space.
[0105] Finally, these direction sets are merged to form a complete set of priority search directions, which guides the algorithm to prioritize exploring directions that are more likely to approach the target in path planning, effectively reducing unnecessary node expansion and significantly improving search efficiency.
[0106] The above pruning strategy will be explained using mathematical expressions below.
[0107] In the path planning process, to improve search efficiency and reduce unnecessary node expansion, the algorithm in this application defines priority search directions, based on... Determine the preferred search direction to perform directional heuristic pruning for node expansion.
[0108] This algorithm defines a set of preferred search directions. The pruning rules include: 1) Horizontal pruning rules; like Prioritize expansion in the east-west direction:
[0109] In this context, E and W represent the east and west directions, respectively, while EN, ES, WN, and WS represent the directions of east-northeast, east-southeast, west-northwest, and west-southwest.
[0110] like It will then expand primarily in the north-south direction:
[0111] N and S represent the north and south directions, respectively.
[0112] 2) Vertical pruning rules; If the vertical distance is significant, that is Vertical expansion will be prioritized:
[0113] Where U and D represent the upward and downward directions, respectively.
[0114] 3) Expanding the combination direction; Based on the preferred direction, vertical and horizontal movements are further combined to generate a combined direction extended node set. .
[0115] For example, if there are significant vertical differences, prioritize searching for combinations of directions such as {UN, US, UE, UW, UEN, USE, UWN, UWS} or {DN, DS, DE, DW, DEN, DES, DWN, DWS}.
[0116] Ultimately, the complete set of heuristic search priority directions is as follows:
[0117] By applying the pruning rules described above, this algorithm can dynamically adjust the priority search direction during path planning based on the relative positional relationship between the current node and the target node, thereby reducing unnecessary node expansion and improving search efficiency.
[0118] In the node search process based on the classic A* algorithm, in each iteration, the node with the smallest F value is first found in the openList. Then, this node is removed from the openList and added to the closeList. Next, the neighboring nodes of the current node need to be checked. If the neighboring node is in the closeList, it is skipped; if the neighboring node is not in the openList, it is added to the openList, and its G, H, and F values are calculated; if the neighboring node is already in the openList, it is checked whether the new path is better, that is, whether the new path has a smaller G value. If it is smaller, the G value, F value, and parent node of the neighboring node are updated.
[0119] In large-scale, spatiotemporally complex environments, the number of nodes in both the openList and closeList increases continuously as the search progresses. Due to the high time complexity of linear search, the linear search time for these two lists increases significantly during the search process, leading to a gradual decrease in retrieval efficiency.
[0120] To address the issue of low efficiency in linear search, this algorithm optimizes the data structure, including: 1) Replace the open list in the traditional A* algorithm with a priority queue (openList) and an open dictionary (openDict); The priority queue is used to store all nodes to be explored, and together with the open Dict, which stores the key-value pairs of the nodes, it ensures that the node with the smallest F value is obtained quickly.
[0121] Specifically, a priority queue is implemented using a min-heap data structure, transforming a regular list into a priority queue to store all nodes to be explored. Each node in the priority queue is stored as follows: .in, This represents the value of the overall cost function for that node. It uses a continuously incrementing value generated by itertools.count(), which solves the comparison problem in the priority queue. It is responsible for interacting with the open dictionary openDict, storing the "key-value" pairs of node objects. The key is the 4D mesh code of the object, and the value is the node object's attributes (including the previous search node, actual value, heuristic value, search direction, etc.), and keeping it synchronized with the open dictionary.
[0122] In practice, the priority queue openList is maintained by heappush and heappop operations. The time complexity of finding a node in the open list by using the open dictionary openDict is O(1). After using the combination of the priority queue openList and the open dictionary openDict, the time complexity of obtaining the node with the smallest F value is reduced to O(log n).
[0123] The `heappush` operation inserts a new node into the priority queue while maintaining the heap property, ensuring that the root node is always the node with the smallest F value. The `heappop` operation removes and returns the node with the smallest F value from the priority queue, adjusting the queue to maintain the heap property. Both `heappush` and `heappop` operations have a time complexity of O(log n), where n is the number of nodes in the priority queue.
[0124] 2) Use a close set (closeSet) instead of the close list in the traditional A* algorithm; The closed set is used to store nodes that have been fully explored. The key in the set is the subdivision type 4D encoding of the spatiotemporal grid element. The in operation of the set can be used to quickly determine whether a node has been explored. The traditional method requires O(n) time to search for a node in the list. After using the set, the time complexity of checking whether a node has been explored is O(1).
[0125] According to one embodiment, the node search process based on the improved data structure includes: During the node expansion phase, the new node to be expanded is first identified by a 4D mesh code, and then added to the priority queue using the heappush operation, and simultaneously recorded in the open dictionary. When retrieving a node to be expanded from the priority queue, the node with the minimum cost value is extracted through the heappop operation, and the record corresponding to that node is removed from the open dictionary. Once a node has been explored, its 4D mesh code is added to the closed set and marked as visited.
[0126] The following is combined with Figure 4 The following describes the node search process after data structure optimization in the embodiments of this application.
[0127] Reference Figure 4 The section search process includes: Step 1: Add a new node: Use the heappush operation to add the node to the priority queue openList; add the node's 4D mesh code to the open node dictionary openDict; specifically, insert the node's key-value pair into openDict; Step 2: Get the node with the smallest F value: Use the heappop operation to pop the node with the smallest F value from the priority queue openList; delete the corresponding node from the open node dictionary openDict; Step 3: After node exploration is complete: Add the 4D mesh code of the node to the closed set closeSet.
[0128] Step 4: Check node status: Determine if the node is in the closed set `closeSet`; if so, the process proceeds to "No More Exploration"; otherwise, continue to check if the node is in the open node dictionary `openDict`. If it is in `openDict`, the process proceeds to "Node in Pending Expansion State". If not, the process proceeds to "Continue Exploring New Nodes".
[0129] Based on the above node search process, by checking whether a node is in the closed set closeSet or the open node dictionary openDict, a fast state retrieval with constant time complexity can be achieved, thereby significantly improving the efficiency and performance of the algorithm in the process of searching massive 4D meshes.
[0130] According to the method of this application embodiment, the improved A* algorithm is used for indoor UAV path planning. Based on the traditional A* algorithm, it introduces UAV flight constraints and distance penalties to improve the cost function, adopts a direction-first heuristic pruning strategy, and optimizes the data structure by introducing priority queues and open dictionaries. This fully incorporates the flight characteristics of multi-rotor UAVs into the cost function, making the path planning more closely match the actual flight capabilities of the UAV. It achieves millisecond-level path planning on a map with tens of millions of grid cells. During node search, directional heuristic pruning of node expansion solves the problem of large-scale node expansion caused by multi-directional search, reducing the search space and improving search efficiency. Data structure optimization solves the problem of increased list linear search time caused by storing a large number of nodes, further improving the algorithm's operating efficiency. The improved A* algorithm achieves millisecond-level path planning on a map with tens of millions of grid cells, significantly improving the speed and real-time performance of path planning, providing a solid foundation for route planning in indoor UAV last-mile logistics delivery scenarios.
[0131] Figure 5 A schematic diagram of a device for path planning provided in an embodiment of this application is shown.
[0132] The device includes a grid encoding acquisition module 101, a spatiotemporal relationship calculation module 102, and a path planning execution module 103.
[0133] Reference Figure 5 The mesh code acquisition module 101 responds to the path planning instructions of the UAV in the indoor environment and acquires the 4D mesh codes corresponding to the current position and the destination position of the UAV.
[0134] The indoor environment mentioned here includes the indoor environment of various individual buildings. For example, office buildings, shopping malls, airport terminals, hospitals, factory buildings, warehouses, residential buildings, hotels, stadiums and other building structures with indoor spaces.
[0135] The concept, structure, and mathematical expression of the 4D mesh encoding have been described above and will not be repeated here.
[0136] The spatiotemporal relationship calculation module 102 assesses the collision risk based on the drone's position and the obstacle's position through spatiotemporal relationship calculation, which includes spatial relationship and temporal relationship.
[0137] The spatial relationship refers to the relative positional relationship between two grid elements, including three states: intersecting, adjacent, and disjoint. The temporal relationship refers to whether the time codes of the two grid elements are equal, i.e., whether they are at the same time level.
[0138] According to one embodiment, the rules for calculating and assessing collision risk based on the drone's location and the obstacle's location through spatiotemporal relationships include: If the spatiotemporal relationship between the two is that they intersect in space, then a collision will occur between the drone and the obstacle. If the two are spatially adjacent in terms of time and space, there is a risk of collision between the drone and the obstacle; If the two are spatially separated, the drone can travel safely without needing to avoid obstacles. If two things are at the same fixed time level and intersect spatially, then they are considered to be in a spatiotemporal conflict. Here, being at the same fixed time level means being at the same moment.
[0139] According to one embodiment, the grid element is constructed by recursively bisecting in three dimensions, using an octree encoding order, so that when each octal one-dimensional code is converted into a binary three-dimensional code, the corresponding three codes represent the three directions of longitude (L), latitude (B) and altitude (H).
[0140] Intersection is defined by the parent-child relationship between spatial grid cells. The prefix of the fine-grained grid code is extracted, and its similarity to the coarse-grained grid code is checked to determine if they are identical. When two spatial grid cells are at the same level, the difference between their codes in a single dimension (0, 1, or greater than 1) indicates whether they are identical, adjacent, or disjoint. When two spatial grid cells are not at the same level, the intersection criteria are similar. The fine-grained grid is first extracted, its prefix is transformed to the same parent grid level, and then the difference between the codes at the same level is used for comparison.
[0141] According to one embodiment, the spatiotemporal relationship calculation module 102 is used to perform the following operations: The three-dimensional spatial coordinates and timestamp of the drone's current location are obtained. Embodiments of this application can obtain the drone's location in various ways. For example, using Ultra Wide Band (UWB) positioning technology, by attaching a UWB positioning tag to the drone and deploying multiple UWB positioning base stations within a spatial range, the drone's flight position can be accurately determined.
[0142] Next, based on the pre-built octree mesh index, the three-dimensional spatial coordinates and timestamps are converted into the corresponding 4D mesh volumetric codes and time-level codes, respectively.
[0143] Next, the spatiotemporal location information of the obstacle is obtained. The spatiotemporal information of the obstacle includes the three-dimensional spatial coordinates of one or more target obstacles in the indoor environment and the timestamps corresponding to their motion trajectories. The three-dimensional spatial coordinates and timestamps are then converted into corresponding 4D mesh element codes and time-level codes, respectively.
[0144] Next, based on a unified spatial and temporal hierarchy, spatiotemporal relationship calculations are performed on the UAV voxels and the mesh voxels of the one or more target obstacles to obtain their spatial relationship (intersecting / adjacent / separated) and temporal relationship (whether the time codes are equal), thereby assessing the collision risk.
[0145] The determination methods for the three spatial positional relationships (spatial intersection, spatial adjacency, and spatial separation) and temporal relationships (equal time) between grid elements have been described in the previous text and will not be repeated here.
[0146] The spatiotemporal relationship calculation in this application embodiment includes spatial orientation calculation and spatial distance calculation. The methods of spatial orientation calculation and spatial distance calculation have been described above and will not be repeated here.
[0147] Based on the evaluation results, the path planning execution module 103 plans the path using an improved A* algorithm and a node search strategy. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy adopts directional heuristic pruning.
[0148] According to one embodiment, this application embodiment achieves millisecond-level path planning under a multi-million-level grid cell map by using a cost function with flight constraints and distance penalties, performing directional heuristic pruning on node expansion, and adopting a priority queue and open dictionary data structure.
[0149] In the improved A* algorithm of this application embodiment, the nodes correspond to grid volume elements.
[0150] The cost function containing flight constraints and distance penalties, the node search strategy using directional heuristic pruning, and the data structures of priority queues and open dictionaries will be explained separately later.
[0151] Specifically, the path planning execution module 103 is used to perform the following operations: At a given time slice, starting from the UAV's current position, 3D path planning is performed using an improved cost function that incorporates UAV flight constraints and distance penalties, along with a node search strategy. Here, a given time slice means that the 1D time encodings of the mesh elements are at the same moment. Next, the node with the lowest cost is taken from the priority queue as the current node. It is then determined whether the current node is the destination. If it is, the search ends and the path is backtracked; otherwise, the neighboring nodes of the current node are expanded. Next, for each neighboring node, its cost function value is calculated, and a decision is made on whether to add it to the priority queue and open dictionary based on the directional heuristic search strategy and pruning rules. Repeat the above steps until the destination is found or the priority queue is empty.
[0152] Wherein, the actual cost function of the embodiments of this application and heuristic cost function As described above, it will not be repeated here.
[0153] According to one embodiment, the path planning execution module 103, based on the node search strategy, adopts a direction-based heuristic pruning strategy, dynamically determines the preferred search direction by comparing the distance difference in the horizontal and vertical directions, generates a combined direction expansion node set, and obtains the preferred search direction set.
[0154] The set of preferred search directions is used to guide the algorithm to prioritize exploring directions that are more likely to approach the target during path planning, effectively reducing unnecessary node expansion and significantly improving search efficiency.
[0155] Specifically, the horizontal direction of priority for searching is determined by comparing the distance difference between the target node and the current node in the horizontal direction. The horizontal direction includes both east-west and north-south directions. This process utilizes heuristic information to guide the search direction, avoiding wasting computational resources in irrelevant directions.
[0156] Next, if the vertical distance difference is significantly greater than the horizontal distance difference, then expansion in the vertical direction is prioritized. This judgment mechanism, based on a heuristic function design, can dynamically adjust the search direction, ensuring a more efficient search process.
[0157] Next, by combining the horizontal and vertical directions, a combined directional expansion node set is generated to cover a wider search space.
[0158] Finally, these direction sets are merged to form a complete set of priority search directions, which guides the algorithm to prioritize exploring directions that are more likely to approach the target in path planning, effectively reducing unnecessary node expansion and significantly improving search efficiency.
[0159] The mathematical expression for the aforementioned pruning strategy has been explained in the preceding text and will not be repeated here.
[0160] In large-scale, spatiotemporally complex environments, the number of nodes in both the openList and closeList increases continuously as the search progresses. Due to the high time complexity of linear search, the linear search time for these two lists increases significantly during the search process, leading to a gradual decrease in retrieval efficiency.
[0161] To address the issue of low efficiency in linear search, the data structure in this device has been optimized, including: 1) Replace the open list in the traditional A* algorithm with a priority queue (openList) and an open dictionary (openDict); 2) Use a close set instead of the close list in the traditional A* algorithm.
[0162] Priority queues (openList), open dictionaries (openDict), and closed sets (closeSet) have been explained in the previous text and will not be repeated here.
[0163] According to one embodiment, the node search process of the path planning execution module 103 based on the improved data structure includes: During the node expansion phase, the new node to be expanded is first identified by a 4D mesh code, and then added to the priority queue using the heappush operation, and simultaneously recorded in the open dictionary. When retrieving a node to be expanded from the priority queue, the node with the minimum cost value is extracted through the heappop operation, and the record corresponding to that node is removed from the open dictionary. Once a node has been explored, its 4D mesh code is added to the closed set and marked as visited.
[0164] According to the apparatus of this application embodiment, the improved A* algorithm is used for indoor UAV path planning. Based on the traditional A* algorithm, it introduces UAV flight constraints and distance penalties to improve the cost function, adopts a direction-first heuristic pruning strategy, and optimizes the data structure by introducing priority queues and open dictionaries. This fully incorporates the flight characteristics of multi-rotor UAVs into the cost function, making the path planning more closely match the actual flight capabilities of the UAV. It achieves millisecond-level path planning on a map with tens of millions of grid cells. During node search, directional heuristic pruning of node expansion solves the problem of large-scale node expansion caused by multi-directional search, reducing the search space and improving search efficiency. Data structure optimization solves the problem of increased list linear search time caused by storing a large number of nodes, further improving the algorithm's operating efficiency. The improved A* algorithm achieves millisecond-level path planning on a map with tens of millions of grid cells, significantly improving the speed and real-time performance of path planning, providing a solid foundation for route planning in indoor UAV last-mile logistics delivery scenarios.
[0165] Based on the same inventive concept, this application also provides an electronic device. The method corresponding to the electronic device can be the method for indoor drone path planning in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.
[0166] The electronic device can be a user device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0167] Figure 6 The diagram illustrates the structure of an apparatus suitable for implementing the methods and / or technical solutions in the embodiments of this application. The apparatus 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on a program stored in a Read Only Memory (ROM) 1202 or a program loaded from a storage portion 1208 into a Random Access Memory (RAM) 1203. The RAM 1203 also stores various programs and data required for system operation. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An Input / Output (I / O) interface 1205 is also connected to the bus 1204.
[0168] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 1208 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0169] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, it performs the functions defined in the methods of this application.
[0170] The programs include mobile phone programs (APP programs, mini programs, etc.) and smart device programs. Smart devices include watches, bracelets, helmets, smart hardware devices, etc.
[0171] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.
[0172] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0173] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0174] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0175] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0176] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0177] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0178] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or page components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0179] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0180] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0181] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
[0183] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in an apparatus may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A method for indoor drone path planning, wherein, The method includes: In response to the path planning command of the UAV in the indoor environment, the 4D mesh code corresponding to the current position and the destination position of the UAV is obtained, wherein the 4D mesh code is used to uniquely identify the indoor mesh element; Based on the location of the drone and the location of obstacles, the collision risk is calculated and assessed through spatiotemporal relationships, which include spatial relationships and temporal relationships. Based on the evaluation results, an improved A* algorithm and node search strategy are used to plan the path. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy adopts directional heuristic pruning.
2. The method according to claim 1, wherein, The collision risk assessment based on the drone's location and obstacle location, using spatiotemporal relationships, includes: Obtain the three-dimensional spatial coordinates and timestamp of the drone's current location; Based on the pre-built octree mesh index, the three-dimensional spatial coordinates and timestamps are converted into corresponding 4D mesh volumetric codes and time-level codes, respectively; Obtain the spatiotemporal location information of obstacles, which includes the three-dimensional spatial coordinates of one or more target obstacles in the indoor environment and the timestamps corresponding to their motion trajectories, and convert the three-dimensional spatial coordinates and timestamps into corresponding 4D mesh element codes and time-level codes, respectively. Based on a unified spatial and temporal hierarchy, spatiotemporal relationship calculations are performed on the UAV volume elements and the grid volume elements of one or more target obstacles to obtain their spatial and temporal relationships, thereby assessing the collision risk.
3. The method according to claim 1 or 2, wherein, The rules for assessing collision risk based on the drone's location and the location of obstacles, calculated through spatiotemporal relationships, include: If the spatiotemporal relationship between the two is that they intersect in space, then a collision will occur between the drone and the obstacle. If the two are spatially adjacent in terms of time and space, there is a risk of collision between the drone and the obstacle; If the two are spatially separated, the drone can travel safely without needing to avoid obstacles. If the two are at the same fixed time level and intersect in space, then it is determined to be a spatiotemporal conflict.
4. The method according to claim 1 or 2, wherein, The spatiotemporal relationship calculation includes spatial orientation calculation and spatial distance calculation. The spatial orientation relationship is calculated by comparing the octree Z-order partitioning characteristics of the spatial 3D mesh encoding, and the spatial distance relationship is calculated using Manhattan distance or diagonal distance.
5. The method according to claim 1, wherein, Path planning using the improved A* algorithm and node search strategy includes: In a certain time slice, starting from the current position of the drone, 3D path planning is performed according to the sum node search strategy with a cost function including flight constraints and distance penalties; During the node expansion phase, the node with the lowest cost is taken from the priority queue as the current node. It is then determined whether the current node is the destination. If it is, the search ends and the path is backtracked. Otherwise, the neighboring nodes of the current node are expanded. For each neighboring node, calculate its cost function value, and decide whether to add it to the priority queue and open dictionary based on the directional heuristic search strategy and pruning rules; Repeat the above steps until the destination is found or the priority queue is empty.
6. The method according to claim 1 or 5, wherein, Path planning using the improved A* algorithm and node search strategy includes: Based on the node search strategy, the preferred search direction is determined by comparing the distance difference in the horizontal and vertical directions, thereby performing directional heuristic pruning on node expansion.
7. The method according to claim 6, wherein, The step of determining the preferred search direction by comparing the distance difference in the horizontal and vertical directions, thereby performing directional heuristic pruning on node expansion, includes: By comparing the distance difference between the target node and the current node in the horizontal direction, the priority horizontal direction for searching is determined; If the difference in distance in the vertical direction is significantly greater than that in the horizontal direction, then the expansion in the vertical direction should be given priority. By combining the horizontal and vertical directions, a combined directional expansion node set is generated to cover a wider search space; These direction sets are merged to form a complete set of priority search directions. This set of priority search directions guides the algorithm to prioritize exploring directions that are more likely to approach the target during path planning, effectively reducing unnecessary node expansion.
8. The method according to claim 1 or 2, wherein, The proposed method improves the data structure used in the node search process by replacing the open list in the traditional A* algorithm with a priority queue and an open dictionary, and replacing the closed list in the traditional A* algorithm with a closed set.
9. The method according to claim 8, wherein, The node search process based on the improved data structure includes: During the node expansion phase, the new node to be expanded is first identified by a 4D mesh code, and then added to the priority queue using the heappush operation, and simultaneously recorded in the open dictionary. When retrieving nodes to be expanded from the priority queue, the node with the minimum cost value is extracted through the heappop operation, and the record corresponding to that node is removed from the open dictionary. Once a node has been explored, its 4D mesh code is added to the closed set and marked as visited.
10. The method according to claim 1 or 2, wherein, The 4D grid coding structure is a triple, including 3D spatial grid coding, 1D temporal grid coding and access attribute coding. The access attribute coding is used to identify the occupancy status of dynamic obstacles.
11. The method according to claim 10, wherein, The method is based on the 4D mesh encoding of each mesh element and uses time slices to describe the dynamic mesh situation at any time.
12. An apparatus for indoor unmanned aerial vehicle (UAV) path planning, wherein, The device includes: The grid code acquisition module is used to acquire the 4D grid code corresponding to the current position and the destination position of the UAV in response to the path planning command of the UAV in the indoor environment. The 4D grid code is used to uniquely identify the indoor grid cell. The spatiotemporal relationship calculation module is used to assess collision risk based on the location of the UAV and the location of obstacles by calculating spatiotemporal relationships, which include spatial relationships and temporal relationships. The path planning execution module is used to plan paths based on the evaluation results using an improved A* algorithm and a node search strategy. The improved A* algorithm uses a cost function with flight constraints and distance penalties, and the node search strategy employs directional heuristic pruning.
13. An electronic device, the electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 11.
14. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1 to 11.
15. A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1 to 11.
Citation Information
Cited By
Unmanned aerial vehicle low-altitude route drawing method, equipment and medium
CN121877013A
