Regional full-coverage path searching method

By combining map rasters and using DFS to search 2×2 raster paths, the problem of traditional path planning algorithms being too long searched in complex environments is solved, and more efficient path planning is achieved.

CN119642837APending Publication Date: 2025-03-18HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411678861.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In complex operation environments, traditional path planning algorithms such as DFS and BFS are prone to problems such as too long search time and excessive resource consumption when dealing with large-scale maps or complex environments, especially in environments with dynamic changes.

Method used

By merging and layering the map rasters, searching for the full coverage path of 2×2 grids with DFS multiple times, and merging all 2×2 grid paths of the current layer according to the coverage path of the previous layer, reducing the search time.

Benefits of technology

It significantly reduces the search time, improves the reliability and stability of path planning, and effectively solves the time-insoluble problem of DFS algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119642837A_ABST
    Figure CN119642837A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer science and control, and particularly relates to a region full-coverage path searching method which comprises the following steps: S1, defining a grid information coding rule; s2, defining a grid division rule of the map; s3, defining a grid merging rule; s4, according to the rules in the step S1, the step S2 and the step S3, performing grid division and merging on the map; s5, searching an optimal path of the 2 * 2 grids by using a depth-first search method, and combining the optimal path with other 2 * 2 grid paths of the current layer; and S6, according to the coverage path of the previous layer, carrying out starting point and end point division on each group of 2 * 2 grids of the current layer, and repeating the step S5. According to the method, the search time can be remarkably shortened, the reliability and the stability of the planned path are improved while full coverage is ensured, and the problem that the DFS algorithm cannot be solved in time can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer science and control, and in particular relates to a method for searching a path for full regional coverage. Background Art

[0002] In complex operating environments, such as agricultural production, cleaning services, drone inspections, etc., equipment or robots need to complete full coverage path planning to ensure that every part of the mission area can be effectively covered. However, the actual working area often has complex and changeable terrain features, such as obstacles, irregular boundaries, and dynamically changing environments. This requires path planning to not only ensure coverage, but also consider the optimality of the path and equipment energy consumption.

[0003] Traditional path planning algorithms, such as depth-first search (DFS) and breadth-first search (BFS), can achieve full coverage path search, but when dealing with large-scale maps or complex environments, they are prone to problems such as long search time and excessive resource consumption, especially in dynamically changing environments.

[0004] like

[0005] In addition, obstacles and irregular areas in the terrain may reduce the efficiency of path planning and increase the computational burden of the system. For large-scale areas, due to the high resolution of the map, the amount of path data generated during the search process is large and it is easy to generate redundant information, which increases the computational complexity and prolongs the time of path planning. Summary of the invention

[0006] In order to overcome the shortcomings of the prior art, the present invention proposes a method for searching a path with full regional coverage, which merges map grids into layers, uses DFS to search for 2×2 grid full coverage paths multiple times, and merges all 2×2 grid paths of the current layer according to the coverage path of the previous layer, thereby effectively reducing the search time.

[0007] In order to achieve the above object, the technical solution specifically adopted by the present invention is as follows:

[0008] A method for searching a path for full coverage of an area comprises the following steps:

[0009] S1. Define raster information encoding rules;

[0010] S2, define the grid division rules of the map;

[0011] S3, define grid merging rules;

[0012] S4, according to the rules described in step S1, step S2, and step S3, the map is grid-divided and merged;

[0013] S5. Use the depth-first search (DFS) method to find the optimal path of the 2×2 grid and merge it with other 2×2 grid paths of the current layer;

[0014] S6. According to the coverage path of the previous layer, divide the starting point and the end point of each group of 2×2 grids of the current layer, and repeat step S5.

[0015] Furthermore, in the step S1, 8-bit integer data is used to store the information of each grid, the encoding of each bit represents a specific grid attribute, and the value of each bit represents the state of the attribute.

[0016] Furthermore, in the step S2, it is assumed that the size of the smallest map unit is a, the radius of the AGV is r, and the coverage radius is R; starting from the coordinate origin, the map units are traversed, and if a unit is an obstacle, all units within its radius r are set as obstacles; then, starting from the origin, the expanded map units are divided into grids according to (2R / a)×(2R / a); if there are no passable units in the up, down, left, and right directions of the grid (that is, there are obstacles), the grid information is encoded according to the rules of step S1.

[0017] Furthermore, in the step S2, if the remaining map units are insufficient to be merged into a complete large grid, virtual map units are added and these virtual units are set as obstacles.

[0018] Furthermore, in step S3, the 2×2 grids are merged into a grid of the previous layer, and the merged grid information is re-encoded according to the rules in step S1.

[0019] Furthermore, in step S3, if the remaining grids are insufficient to form a complete 2×2 area, virtual barrier grids are added for filling.

[0020] Furthermore, in step S3, when a grid of the previous layer needs to move in a certain direction (i.e., there is no obstacle in that direction), then in the current layer, among the four sub-grids (2×2 area) corresponding to the grid, there is at least one optimal coverage path ending in that direction.

[0021] Furthermore, in the step S4, assuming that the map size is m×n and the coverage radius of the AGV is R, the map is grid-divided according to the rules in steps S1 and S2, and the size of the grid map after division is (m / 2R)×(n / 2R); then, the rasterized maps are merged according to the rules in step S3; the map merged for the first time is called the second layer map, and its size is (m / 4R)×(n / 4R). If the size of the merged map is less than or equal to 2×2 at this time, the merging is terminated; otherwise, the merging is continued.

[0022] Furthermore, in step S5, the depth-first search (DFS) method is used to find the optimal path of the 2×2 grid, obtain the global coordinates of the 2×2 grid, and merge the global coordinates of all 2×2 grids of the current layer into a complete path according to the path order of the previous layer.

[0023] The present invention has the following characteristics and beneficial effects:

[0024] The present invention introduces a rasterized map and a layered-based path planning method, which can significantly reduce the search time and improve the reliability and stability of the planned path while ensuring full coverage, and can effectively solve the time-insoluble problem of the DFS algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0026] Figure 1 Merge raster for maps;

[0027] In the figure: (a) first layer; (b) second layer; (c) third layer.

[0028] Figure 2 Schematic diagram of map information encoding.

[0029] Figure 3 This is a comparison chart of the travel direction;

[0030] In the figure: (a) 2*2 grid path 1; (b) 2*2 grid path 2; (c) merged grid path direction.

[0031] Figure 4 It is a 2×2 grid starting point and ending point division map;

[0032] In the figure: (a) previous layer map; (b) current layer map.

[0033] Figure 5 This is the first full coverage simulation experiment;

[0034] In the figure: (a) coverage starts; (b) coverage is completed.

[0035] Figure 6 This is the second full coverage simulation experiment;

[0036] In the figure: (a) coverage starts; (b) coverage is completed.

[0037] Figure 7 This is the third full coverage simulation experiment;

[0038] In the figure: (a) coverage starts; (b) coverage is completed.

[0039] Figure 8 This is the fourth full coverage simulation experiment;

[0040] In the figure: (a) coverage starts; (b) coverage is completed.

[0041] Fig. 9 Search flowchart for full coverage path.

[0042] Fig.10 Search flowchart for raster merging.

[0043] Fig.11 Schematic diagram for layer merging;

[0044] In the figure: (a) first layer; (b) second layer.

[0045] Fig.12 Schematic diagram of the paths of each layer;

[0046] In the figure: (a) second layer path; (b) first layer path.

[0047] Fig.13 A schematic diagram of the search path for the first grid of the first layer;

[0048] In the figure: (a) starting point and end point division; (b) coverage path.

[0049] Fig.14 Search path diagram for the first layer and second grid;

[0050] In the figure: (a) starting point and end point division; (b) coverage path.

[0051] Fig.15 Schematic diagram of searching path for the third grid of the first layer;

[0052] In the figure: (a) starting point and end point division; (b) coverage path.

[0053] Fig.16 Schematic diagram of the search path for the fourth grid of the first layer;

[0054] In the figure: (a) starting point and end point division; (b) coverage path. DETAILED DESCRIPTION

[0055] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

[0056] In view of the complex environment and large amount of information in the coverage area, the embodiment of the present invention provides a method for searching a path with full coverage of the area. The method can effectively reduce the computing resource overhead and improve the efficiency and accuracy of path planning by dividing a large-scale map into small grid units and combining strategies such as area merging and hierarchical path search. Specifically, the method includes the following steps:

[0057] Step 1: Define the encoding rules for grid information. Use 8-bit integer data to store the information of each grid. Each bit of encoding represents a specific grid attribute, and the value of each bit (0 or 1) represents the state of the attribute. By combining these 8 bits, the state of the grid can be uniquely determined, which is convenient for quick judgment and processing in path planning. The specific encoding rules are as follows:

[0058]

[0059] Step 2: Define the grid division rules of the map. Assume that the size of the smallest map unit is a, the radius of the AGV is r, and the coverage radius is R. Starting from the coordinate origin, traverse the map units. If a unit is an obstacle, all units within its radius r are set as obstacles. Then, starting from the origin, the expanded map units are divided into grids according to (2R / a)×(2R / a). If there are no passable units in the up, down, left, and right directions of the grid (that is, there are obstacles), encode the grid information according to the rules in step one. If the remaining map units are not enough to merge into a complete large grid, virtual map units are added and these virtual units are set as obstacles.

[0060] Step 3: Define the merging rules for the grids. Merge the 2×2 grids into one grid of the previous layer. If the remaining grids are not enough to form a complete 2×2 area, add virtual obstacle grids to fill it. The merged grid information is re-encoded according to the rules in step 1. When a grid of the previous layer needs to move in a certain direction (that is, there is no obstacle in that direction), then in the current layer, among the four sub-grids (2×2 areas) corresponding to the grid, there is at least one optimal coverage path that ends in that direction. This rule ensures that the coverage path of the previous layer has a corresponding coverage path in the current layer.

[0061] Step 4: Assuming the map size is m×n and the AGV coverage radius is R, divide the map into grids according to the rules of steps 1 and 2. The size of the grid map after division is (m / 2R)×(n / 2R). Then, merge the rasterized maps according to the rules of step 3. The first merged map is called the second layer map, and its size is (m / 4R)×(n / 4R). If the size of the merged map is less than or equal to 2×2, the merge is terminated. Otherwise, continue merging. Assuming that after k merges, the size of the k+1th layer map is less than or equal to 2×2. At this time, the map size is (m / 2 k+1 R)×(n / 2 k+1 R).

[0062] Step 5: Use the depth-first search (DFS) algorithm to perform a full coverage path search on the 2×2 grid map to traverse all possible paths and find the optimal solution. If the coordinates of the upper grid are (x, y), the corresponding four grid coverage paths in the current layer are (x1, y1)-(x2, y2)-(x3, y3)-(x4, y4). Therefore, the global coordinates of the 2×2 grid of the current layer can be calculated as (2x+x1, 2y+y1)-(2x+x2, 2y+y2)-(2x+x3, 2y+y3)-(2x+x4, 2y+y4). Finally, the global coordinates of all 2×2 grids in the current layer are merged into a complete path according to the path order of the previous layer. When merging, the map size is set to 4×4, and the initial position of the agent is (1, 1). First, we rasterize the map and construct a multi-layer map structure through the layered idea (see Fig.12 ).like Figure 2 As shown in the figure, the starting point of the second layer map is (0, 0). On the top layer map, the depth-first search (DFS) algorithm is used to implement a full coverage path search, and the resulting path is represented as (0, 0) → (0, 1) → (1, 1) → (1, 0). After obtaining the path of the second layer map, we define the starting point and end point of two specific 2×2 grids in the first layer map based on the path. After completing the division of the starting point and the end point, we perform a full coverage path search on the first grid, and the path is (1, 1) → (0, 1) → (0, 0) → (1, 0), as shown in the schematic diagram. Fig.13. After the path search of the first grid is completed, we can determine the starting point of the second grid, and divide the second grid into the end point and the starting point of the third grid based on this. Subsequently, we perform a path search on the second grid and obtain the path of (0, 0) → (0, 1) → (1, 1) → (1, 0). The path search process for the third and fourth grids is similar to the above, and their paths are (0, 0) → (0, 1) → (1, 1) → (1, 0) (1, 1) → (0, 1) → (0, 0) → (1, 0). After completing the path search for all grids, the paths of each grid unit in the first-level map are integrated according to the path information provided by the second-layer map, and the grid coordinates are converted into the global path of the current layer. The integrated path is displayed in Fig.12 , and a schematic diagram of the integration process is presented in detail in Figures 13 to 16 .

[0063] Step 6: According to the coverage path of the previous layer, divide the starting point and end point of every four grids of the current layer, and repeat step 5. Assuming that the path of the previous layer is (x,y)-(x+1,y), set the previous layer coordinates (x,y) corresponding to the end points of the current layer's 2×2 grid to (2x+1,2y) and (2x+1,2y+1), and the previous layer coordinates (x+1,y) corresponding to the starting point of the current layer's 2×2 grid to (2x+2,2y) and (2x+2,2y+1).

[0064] Under the conditions of known maps and random starting points, in order to solve the problem of long search time faced by the depth-first search (DFS) algorithm in the full coverage path search, this specific implementation of a regional full coverage path search method merges the map grids into layers, uses DFS to search for 2×2 grid full coverage paths multiple times, and merges all 2×2 grid paths of the current layer according to the coverage path of the upper layer. Compared with directly using DFS to search for paths, this method significantly reduces the search time. Specifically, the present invention merges the grids of the map, adds virtual obstacle grids to insufficient grid areas, to simplify the map structure, and continues to merge if the size of the merged map is still too large; after the merger is completed, first perform a path search on the upper map, and then perform a path search on the lower map layer by layer according to the search results of the upper layer, thereby effectively reducing the search time.

[0065] It is well known that when using the DFS algorithm to search for non-repeated paths, there may be no solution in time. Now assume that the grid size of the map is 4×4, and the maximum number of searches using DFS to search for paths is 4 (4×4)=4294967296, where 4×4 is the total number of grids in the map. The computing speed of current personal computers is between 20 billion and 100 billion times per second. Under this condition, when searching for a path, a solution can still exist within the specified time. However, when the map size continues to increase, the time required for path searching using the DFS method will increase exponentially, resulting in no solution within the specified time. If the map size is 8×8, the maximum number of DFS path searches is 4 (8×8) , whose search time is 4 (8×8) ÷100000000000÷60÷60÷24≈39384533208441951789742 days. The DFS search method has no solution in terms of time. In order to solve the problem that there is no effective solution in DFS in the search for non-repeated paths due to time constraints, a method based on grid merging and hierarchical search is proposed in the present invention. When the method of grid merging and hierarchical search is used, the maximum number of searches is 4. (2×2) ×(1+4+16)=5376 times, using a personal computer to search, the search time is less than one second. Among them, 2×2 is the minimum unit of grid merging search, and the 8×8 grid needs to be merged twice. The first layer has 16 2×2 grids, the second layer has 4 2×2 grids, and the third layer has 1 2×2 grid, so 16+4+1 searches are required. Obviously, grid merging search can greatly reduce the search time.

[0066] When there are obstacles in the map and there is no non-repeated full coverage path, the DFS algorithm needs to traverse all results before performing a second repeatable path search. Now assume that each grid can be reached repeatedly once. When the map size is 4×4, the maximum number of searches using DFS to search for a path is 4 (4×4)×2 =18446744073709551616, if the computer's computing speed is 100 billion times per second, the search time is 4 (4×4)×2 ÷100000000000÷60÷60÷24≈2135 days. When searching for a repeatable path, when the map size is 4×4, the DFS search method is almost unsolvable in terms of time. The method based on grid merging and hierarchical search of the present invention also has its time advantage when facing the search for a repeatable full coverage path. Now assume that each grid can be reached once repeatedly. When the map size is 4×4, the maximum number of searches using DFS to search for a path is 4 (2×2)×2 ×(1+4)=327680. The search time is less than one second when using a personal computer. This shows that the grid merging method can effectively solve the time-insoluble problem of the DFS algorithm.

[0067] Example 1

[0068] Taking the rasterized map as an example, the map size is set to 15×15, the maximum number of searches is set to two million times, and the map contains three square obstacles. The system will randomly generate a starting point, and after each grid is covered, it will immediately search for the path covering the entire map again. If the DFS search does not find a solution within the specified time, the search is stopped and the coverage path of the merged grid search is used. If a solution is found within the specified time, the coverage path of the DFS search is used. In the simulation results, the path with more straight lines indicates the path searched using DFS, and the path with more curves indicates the path using the merged grid. According to the simulation experiment figure ( Figures 5 to 8 ), at the beginning of coverage, there is a situation where the DFS search cannot find a solution within the specified time. At this time, the path of raster merging and hierarchical search is used for coverage. As the size of the map that can be covered gradually decreases, DFS has a solution within the specified time, and the full coverage path of the DFS search is used for coverage.

[0069] Note: In the simulation experiment diagram, the route shown at the beginning of coverage is the global planning route of the starting point, not the actual coverage route. The route shown after the coverage is completed is the actual coverage route map. After each grid is covered, the full coverage path search will be performed again. Therefore, there may be inconsistencies between the routes at the beginning and the end of coverage.

[0070] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for searching a path for full coverage of an area, characterized in that: The following steps are involved: S1. Define raster information encoding rules; S2, define the grid division rules of the map; S3, define grid merging rules; S4, according to the rules described in step S1, step S2, and step S3, the map is grid-divided and merged; S5. Use the depth-first search (DFS) method to find the optimal path of the 2×2 grid and merge it with other 2×2 grid paths of the current layer; S6. According to the coverage path of the previous layer, divide the starting point and the end point of each group of 2×2 grids of the current layer, and repeat step S5.

2. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In the step S1, 8-bit integer data is used to store the information of each grid, each bit of the code represents a specific grid attribute, and each bit value represents the state of the attribute.

3. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In step S2, it is assumed that the size of the smallest map unit is a, the radius of the AGV is r, and the coverage radius is R; starting from the coordinate origin, the map units are traversed, and if a unit is an obstacle, all units within its radius r are set as obstacles; then, starting from the origin, the expanded map unit is divided into a grid according to (2R / a)×(2R / a); if there is no passable unit in the up, down, left, and right directions of the grid, the grid information is encoded according to the rules of step S1.

4. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In the step S2, if the remaining map units are insufficient to be merged into a complete large grid, virtual map units are added and these virtual units are set as obstacles.

5. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In step S3, the 2×2 grids are merged into a grid of the previous layer, and the merged grid information is re-encoded according to the rules in step S1.

6. A method for searching a path for full coverage of an area as claimed in claim 5, characterized in that: In step S3, if the remaining grids are insufficient to form a complete 2×2 area, virtual barrier grids are added for filling.

7. A method for searching a path for full coverage of an area as claimed in claim 5, characterized in that: In step S3, when a grid of the previous layer needs to move in a certain direction, in the current layer, among the four sub-grids corresponding to the grid, there is at least one optimal coverage path with the direction as the end point.

8. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In the step S4, assuming that the map size is m×n and the coverage radius of the AGV is R, the map is grid-divided according to the rules in steps S1 and S2, and the size of the grid map after division is (m / 2R)×(n / 2R); then, the rasterized maps are merged according to the rules in step S3; the map merged for the first time is called the second layer map, and its size is (m / 4R)×(n / 4R). If the size of the merged map is less than or equal to 2×2 at this time, the merging is terminated; otherwise, the merging is continued.

9. A method for searching a path for full coverage of an area as claimed in claim 1, characterized in that: In step S5, the depth-first search (DFS) method is used to find the optimal path of the 2×2 grid, obtain the global coordinates of the 2×2 grid, and merge the global coordinates of all 2×2 grids of the current layer into a complete path according to the path order of the previous layer.