Photovoltaic unmanned aerial vehicle cleaning path generation method based on heuristic and local search
By employing heuristic and local search-based path planning methods, the real-time and multi-constraint issues in path planning for photovoltaic array cleaning were resolved. This resulted in the generation of efficient UAV cleaning paths that are adaptable to different power plant layouts, thereby improving the diversity and quality of the paths.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SUZHOU UNIV
- Filing Date
- 2025-12-05
- Publication Date
- 2026-05-08
AI Technical Summary
Under the constraint of prioritizing cleaning of photovoltaic arrays, existing technologies make it difficult for traditional path planning algorithms to solve in real time with a large number of array clusters, and they cannot simultaneously take into account the three constraints of prioritizing arrays, prioritizing dirt weight, and short flight paths.
A path planning method based on heuristics and local search is adopted. Through target detection, component set construction, dirt ratio and array cluster construction, path planning, intra-cluster starting point definition and intra-cluster component access order planning, candidate paths that meet the weighted delay target are generated.
In a short time, candidate drone cleaning paths were generated that take into account array priority, dirt weight priority and short flight path, adapting to different power plant scales and layout densities, and significantly improving the diversity and quality of the paths.
Smart Images

Figure CN121995928A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of UAV path optimization and intelligent scheduling technology, specifically to candidate path generation guided by the weighted minimum delay target in array priority cleaning scenarios. Background Technology
[0002] Under the constraint of prioritizing cleaning arrays in photovoltaic scenarios, simple nearest neighbor or shortest path algorithms often ignore the temporal benefits of dirt weights; while purely prioritizing heavily contaminated cleaning methods may result in excessively long travel distances. Traditional path planning algorithms are difficult to solve in real time with a large number of array clusters. Therefore, a heuristic algorithm that generates candidate paths based on the principles of weight priority and travel distance suppression is needed and can be continuously improved within a finite time.
[0003] To address the aforementioned issues, this invention proposes a photovoltaic cleaning path planning algorithm dominated by weighted delay, which generates candidate UAV cleaning paths in a short time that take into account three constraints: array priority, dirt weight priority, and short flight path. Summary of the Invention
[0004] The purpose of this invention is to overcome the problems existing in the prior art and provide a photovoltaic drone cleaning path generation method based on heuristics and local search.
[0005] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution:
[0006] A method for generating cleaning paths for photovoltaic drones based on heuristics and local search, comprising the following steps:
[0007] Step S1: Object Detection and Component Set Construction
[0008] Perform component target detection on the input orthophoto image to obtain the set of component bounding rectangles:
[0009] Step S2: Dirt Ratio and Array Cluster Construction
[0010] Obtain the dirt ratio r within the component. k The components are aggregated into array clusters according to the array polygons; where:
[0011] The smallest particle unit corresponding to a single photovoltaic panel or the detection output is denoted as the kth component, and the dirt ratio r inside the component is obtained by detection. k ∈[0,1], the component is accompanied by a non-negative weight w module This is used to reflect the importance of the component to the cleaning decision;
[0012] Generation of array cluster boundary Cj:
[0013] Use YOLOv8 to detect all component boxes and write all component boxes onto a binary mask M on the entire image;
[0014] A single expansion of M with a rectangular core K is used to connect adjacent / nearest neighbor components;
[0015] The outer contour of the dilation result is extracted, and the array cluster boundary Cj is obtained by the polygon approximation method RDP.
[0016] Each cluster contains several photovoltaic modules and their weights:
[0017]
[0018] w module =Tier(r) k )∈{1,2,3};
[0019] Step S3: Path Planning
[0020] Step S3.1: Constructing a solution: Starting with the heaviest cluster, let the current cluster be i, and the set of candidate unvisited clusters be U. Define a local cost for any j∈U: cost(j)=λd(i,j)-Wj, that is, the point with the minimum cost is set as the next point, and so on. In the formula, d(i,j) is the Euclidean distance between the centroids of the two array clusters i and j, and Wj is the Euclidean distance between the centroids of the two array clusters i and j. j For array cluster weights, W0 is the median cluster weight, and d0 is the median distance between common neighboring clusters;
[0021] Step S3.2: Local search: Perform 2-opt and relocation on a single route to achieve the best improvement at the aforementioned cost:
[0022] Relocation is used as a local search operation: without changing the starting point, any non-starting point node in the path is removed from its original position and inserted into another position in the same path. The incremental cost Δ is used as the evaluation criterion, and the best improvement principle is adopted to choose whether to accept the move.
[0023] Movable object: Any node v except the starting point;
[0024] Allowed insertion positions: all insertion gaps in the route, but not allowing 'v' to be inserted as the first position;
[0025] Objective: Calculate the incremental cost Δ for each candidate insertion position using the defined cost formula: Δ = Cost(new) - Cost(old), select the optimal path, and execute the move if Δ < 0; repeat until no improvement is achieved.
[0026] Step S3.3: Perturbation restart: Randomly remove non-starting nodes of p, and then re-insert them one by one with the minimum incremental cost, in order to break out of the local search and find a better solution;
[0027] Step S3.4: Repeat until the number of iterations is reached or there is no upper limit to improvement, then output the optimal cluster order;
[0028] Step S3.5: Merge and deduplicate the generated cluster sequences;
[0029] Step S4: Define the intra-cluster starting point
[0030] The starting point for the first array cluster: select the percentage of dirt r within this cluster. k The highest-level component serves as the starting point;
[0031] The starting point of components in subsequent clusters: Let P be the exit component of the previous cluster. out Within the current cluster, the starting point is selected according to the following priority:
[0032] In the component set with weight = 3, select P. out The closest to Euclidean distance;
[0033] If there is no weight = 3, then select in the same way if there is no weight = 2; if there is still no weight = 1, then select in the same way.
[0034] If any of the above points are in the same order, all of them will be included in the candidate paths;
[0035] Step S5: Intra-cluster component access order and endpoint definition
[0036] For cluster c i The k-th component box Take its left midpoint / right midpoint as the cleaning endpoint:
[0037]
[0038] Lateral crossing cleaning time t of a single component k Defined as:
[0039] In the formula, v clean Component cleaning speed, unit: pixels / second, t over Fixed preparation / triggering overhead time for each component, in seconds;
[0040] The initial order within a cluster can be chosen from one of the following three heuristics:
[0041] 1) Press w module Decreasing;
[0042] 2) Nearest neighbor + 2-opt;
[0043] 3) greedy_weighted: maximizes the greedy algorithm w-β·d, where w is the weight of the component, d is the straight-line distance from the current point to the centroid of the component, and β is the distance penalty coefficient. The larger β is, the more inclined to select the closer component first; the smaller β is, the more inclined to select the dirtier component first.
[0044] Step S6: Dynamic programming for intra-cluster orientation selection
[0045] Let the access order be p1, p2, ..., p n Each component board has two orientations:
[0046] 1) d = 0, clean L from left to right k →R k Enter point S k (0)=L k ;
[0047] 2) d = 1 Clean R from right to left k →L k Enter point S k (1) = R k ;
[0048] Let the cross-plate displacement velocity v move Define dp:
[0049] dp[k][d] = the minimum cumulative time to complete the cleaning of the k-th component with the cleaning direction of the k-th component being d;
[0050] When performing the recursion, consider the displacement time from the end point of the previous block to the start point of the current block:
[0051] In the formula, ||·|| is the Euclidean distance. The initial value of dp considers the distance between the take-off point and the starting point of the first cleaning block. Backtracking is used to obtain the optimal direction sequence of the entire cluster and the endpoint sequence of entering / leaving on the k-th block.
[0052] Furthermore, in step S2, C1 is set to 5%, C2 to 15%, and C3 to 30%, for cases where the dirt ratio is below the threshold r. k Components in C1 are skipped and will not participate in cleaning and planning.
[0053] Furthermore, in step S3.1, the specific method for determining the value of d0 is as follows:
[0054] Given a list of cluster centroids P = [(x1,y1),...,(x...y1)...y2)...y3)...y4)...y5)...y6)...y7)...y8)...y9)...y1 ... N ,y N )]:
[0055] 1) For each i: calculate That is, traverse all other clusters, and j ≠ i;
[0056] 2) Collect all d i ;
[0057] 3) Take the median as d0.
[0058] The beneficial effects of this invention are:
[0059] 1. Triple Constraint Self-Consistency: Within the framework of "array first, component later", using "weight-distance"... A solution that can be applied to engineering projects.
[0060] 2. Adaptive scaling: λ is calculated using "cluster weight and median neighbor distance".
[0061] Normalization adapts to different power plant sizes and layout densities, eliminating the need for repeated manual parameter adjustments.
[0062] 3. Escaping Local Optimum: Perturbation restart and minimum incremental reinsertion will help some paths...
[0063] By shuffling and rearranging the paths, the diversity and quality of solutions are significantly improved, providing a stronger upper limit for candidate paths in subsequent scoring.
[0064] 4. Computationally friendly: The entire process relies only on cluster centroid coordinates and cluster weights.
[0065] It has a low base quantity and controllable complexity, making it suitable for quickly generating multiple candidate paths. Attached Figure Description
[0066] Figure 1 This is a schematic diagram of the outer rectangular frame of the component of the present invention;
[0067] Figure 2 This is a schematic diagram of the components of the present invention being aggregated into an array cluster;
[0068] Figure 3 This is a schematic diagram of the components and array clusters of the present invention;
[0069] Figure 4 This is a flowchart of the path planning algorithm of the present invention;
[0070] Figure 5 This is a schematic diagram of the component cleaning direction of the present invention;
[0071] Figure 6 This diagram illustrates two cases, a and b, where the component cleaning direction of the present invention is d=0.
[0072] Figure 7 This diagram illustrates two cases, a and b, where the component cleaning direction of the present invention is d=1. Detailed Implementation
[0073] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0074] A method for generating cleaning paths for photovoltaic drones based on heuristics and local search, comprising the following steps:
[0075] Step S1: Object Detection and Component Set Construction
[0076] Perform component target detection on the input orthophoto image, such as... Figure 1 As shown, the set of bounding rectangles of the component is obtained:
[0077] Step S2: Dirt Ratio and Array Cluster Construction
[0078] Obtain the dirt ratio r within the component. k The components are aggregated into clusters based on their array polygons; where:
[0079] The smallest particle unit corresponding to a single photovoltaic panel or the detection output is denoted as the kth component, and the dirt ratio r inside the component is obtained by detection. k ∈[0,1], the component is accompanied by a non-negative weight w module This is used to reflect the importance of the component to the cleaning decision;
[0080] Generation of array cluster boundary Cj:
[0081] Use YOLOv8 to detect all component boxes and write all component boxes onto a binary mask M on the entire image;
[0082] A single expansion of M with a rectangular core K is used to connect adjacent / near neighbor components (by "sticking" the component blocks that are close to each other together, the internal array will be connected into a whole block, and different arrays will not be mistakenly connected due to the large spacing).
[0083] Extract the outer contour of the dilation result, such as Figure 2 and Figure 3 As shown, the array cluster boundary Cj is obtained using the polygon approximation method RDP;
[0084] Each cluster contains several photovoltaic modules and their weights (the weight generation logic for array contamination is the same as that for modules):
[0085]
[0086] w module =Tier(r) k )∈{1,2,3};
[0087] Step S3: Path Planning
[0088] Step S3.1: Constructing a solution: Starting with the heaviest cluster, let the current cluster be i, and the set of candidate unvisited clusters be U. Define the local cost for any j∈U: cost(j)=λd(i,j)-W j That is, the heaviest cluster is set as the starting point, and the cluster with the lowest cost is set as the next point, and so on. In the formula, d(i,j) is the Euclidean distance between the centroids of the two array clusters i and j, and W j For array cluster weights, W0 is the median cluster weight, and d0 is the median distance between common neighboring clusters;
[0089] Step S3.2: Local search: Perform 2-opt and relocation (without changing the starting point) on a single route to achieve the best improvement at the aforementioned cost:
[0090] Relocation is used as a local search operation: without changing the starting point, any non-starting point node in the path is removed from its original position and inserted into another position in the same path. The incremental cost Δ is used as the evaluation criterion, and the best improvement principle is adopted to choose whether to accept the move. This operation can be used in conjunction with the 2-opt operator to refine and optimize the initial constructed solution.
[0091] Movable object: Any node v except the starting point;
[0092] Allowed insertion positions: all insertion gaps in the route, but not allowing 'v' to be inserted as the first position (i.e., insertion is not allowed before the starting point);
[0093] Objective: Calculate the incremental cost Δ for each candidate insertion position using the defined cost formula: Δ = Cost(new) - Cost(old), select the optimal path (by scanning all paths once), and execute the move if Δ < 0; repeat until no improvement is found.
[0094] Step S3.3: Perturbation restart: Randomly remove p non-starting node. In this embodiment, p≈15%, and then re-insert them one by one with the minimum incremental cost to escape the local search and find a better solution.
[0095] Step S3.4: Repeat until the number of iterations is reached or there is no upper limit to improvement, and output the optimal cluster order (take the cluster order with the minimum total cost);
[0096] Step S3.5: Merge and deduplicate the generated cluster sequences, as follows: Figure 4 As shown;
[0097] Step S4: Define the intra-cluster starting point
[0098] The component starting point of the first array cluster (the component starting point of the first cluster in the cluster sequence): Select the percentage of dirt r within this cluster. k The highest-level component serves as the starting point;
[0099] The starting point of components in subsequent clusters: Let P be the exit component of the previous cluster. out Within the current cluster, the starting point is selected according to the following priority:
[0100] In the component set with weight = 3, select P. out The closest to Euclidean distance;
[0101] If there is no weight = 3, then select in the same way if there is no weight = 2; if there is still no weight = 1, then select in the same way.
[0102] If any of the above points are in the same order, all of them will be included in the candidate paths;
[0103] Step S5: Intra-cluster component access order and endpoint definition
[0104] For cluster c i The k-th component box Take its left midpoint / right midpoint as the cleaning endpoint:
[0105]
[0106] Lateral crossing cleaning time t of a single component k Defined as:
[0107] In the formula, v clean Component cleaning speed, unit: pixels / second, t over Fixed preparation / triggering overhead time for each component, in seconds;
[0108] The initial order within a cluster can be chosen from one of the following three heuristics:
[0109] 1) Press w module Decreasing;
[0110] 2) Nearest neighbor + 2-opt;
[0111] 3) greedy_weighted: maximizes the greedy algorithm w-β·d, where w is the weight of the component (e.g., obtained by classifying it as dirty 0 / 1 / 2 / 3), d is the straight-line distance from the current point to the centroid of the component, and β is the distance penalty coefficient. The larger β is, the more inclined to select the closer component first; the smaller β is, the more inclined to select the dirtier component first.
[0112] This initial order only determines the access order of components; the left and right directions of each board are further optimized by dp in step S6.
[0113] Step S6: Dynamic programming for intra-cluster orientation selection
[0114] Let the access order be p1, p2, ..., p n ,like Figure 5As shown, each component board has two orientations:
[0115] 1) d = 0, clean L from left to right k →R k Enter point S k (0)=L k ;
[0116] 2) d = 1 Clean R from right to left k →L k Enter point S k (1) = R k ;
[0117] Let the cross-plate displacement velocity v move Define dp:
[0118] dp[k][d] = the minimum cumulative time to complete the cleaning of the k-th component with the cleaning direction of the k-th component being d;
[0119] When performing the recursion, consider the displacement time from the end point of the previous block to the start point of the current block:
[0120] In the formula, ||·|| is the Euclidean distance, such as Figure 6 and Figure 7 As shown, the initial value of dp considers the distance between the take-off point and the starting point of the first cleaning block, and backtracks to obtain the optimal direction sequence of the entire cluster and the endpoint sequence of entering / leaving on the k-th block.
[0121] In step S2, C1 is set to 5%, C2 to 15%, and C3 to 30%, for cases where the dirt ratio is below the threshold r. k Components in C1 are skipped and will not participate in cleaning and planning.
[0122] In step S3.1, the specific method for determining the value of d0 is as follows:
[0123] Given a list of cluster centroids P = [(x1, y1), ..., (x... N y N )]:
[0124] 1) For each i: calculate That is, traverse all other clusters, and j ≠ i;
[0125] 2) Collect all d i ;
[0126] 3) Take the median as d0.
[0127] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating cleaning paths for photovoltaic drones based on heuristics and local search, characterized in that, The method includes the following steps: Step S1: Object Detection and Component Set Construction Perform component target detection on the input orthophoto image to obtain the set of component bounding rectangles: Step S2: Dirt Ratio and Array Cluster Construction Obtain the dirt ratio r within the component. k The components are aggregated into array clusters according to the array polygons; where: The smallest particle unit corresponding to a single photovoltaic panel or the detection output is denoted as the kth component, and the dirt ratio r inside the component is obtained by detection. k ∈[0,1], the component is accompanied by a non-negative weight W. module This is used to reflect the importance of the component to the cleaning decision; Generation of array cluster boundary Cj: Use YOLOv8 to detect all component boxes and write all component boxes onto a binary mask M on the entire image; A single expansion of M with a rectangular core K is used to connect adjacent / nearest neighbor components; The outer contour of the dilation result is extracted, and the array cluster boundary Cj is obtained by the polygon approximation method RDP. Each cluster contains several photovoltaic modules and their weights: w module =Tier(r k )∈{1,2,3}; Step S3: Path Planning Step S3.1: Constructing a solution: Starting with the heaviest cluster, let the current cluster be i, and the set of candidate unvisited clusters be U. Define the local cost for any j∈U: cost(j)=λd(i,j)-W j That is, the point with the minimum cost is set as the next point, and so on. In the formula, d(i,j) is the Euclidean distance between the centroids of the two array clusters i and j, and W j For array cluster weights, W0 is the median cluster weight, and d0 is the median distance between common neighboring clusters; Step S3.2: Local search: Perform 2-opt and relocation on a single route to achieve the best improvement at the aforementioned cost: Relocation is used as a local search operation: without changing the starting point, any non-starting point node in the path is removed from its original position and inserted into another position in the same path. The incremental cost Δ is used as the evaluation criterion, and the best improvement principle is adopted to choose whether to accept the move. Movable object: Any node v except the starting point; Allowed insertion positions: all insertion gaps in the route, but not allowing 'v' to be inserted as the first position; Objective: Calculate the incremental cost Δ for each candidate insertion position using the defined cost formula: Δ = Cost(new) - Cost(old), select the optimal path, and execute the move if Δ < 0; repeat until no improvement is achieved. Step S3.3: Perturbation restart: Randomly remove non-starting nodes of p, and then re-insert them one by one with the minimum incremental cost, in order to break out of the local search and find a better solution; Step S3.4: Repeat until the number of iterations is reached or there is no upper limit to improvement, then output the optimal cluster order; Step S3.5: Merge and deduplicate the generated cluster sequences; Step S4: Define the intra-cluster starting point The starting point for the first array cluster: select the percentage of dirt r within this cluster. k The highest-level component serves as the starting point; The starting point of components in subsequent clusters: Let P be the exit component of the previous cluster. out Within the current cluster, the starting point is selected according to the following priority: In the component set with weight = 3, select P. out The closest to Euclidean distance; If there is no weight = 3, then select in the same way if there is no weight = 2; if there is still no weight = 1, then select in the same way. If any of the above points are in the same order, all of them will be included in the candidate paths; Step S5: Intra-cluster component access order and endpoint definition For cluster c i The k-th component box Take its left midpoint / right midpoint as the cleaning endpoint: Lateral crossing cleaning time t of a single component k Defined as: In the formula, v clean Component cleaning speed, unit: pixels / second, t over Fixed preparation / triggering overhead time for each component, in seconds; The initial order within a cluster can be chosen from one of the following three heuristics: 1) Press w module Decreasing; 2) Nearest neighbor + 2-opt; 3) greedy_weighted: maximizes W-β·d, where w is the weight of the component, d is the straight-line distance from the current point to the centroid of the component, and β is the distance penalty coefficient. The larger β is, the more inclined to select the closer one first; the smaller β is, the more inclined to select the dirtier one first. Step S6: Dynamic programming for intra-cluster orientation selection Let the access order be p1, p2, ..., p n Each component board has two orientations: 1) d = 0, clean L from left to right k →R k Enter point S k (0)=L k ; 2) d = 1 Clean R from right to left k →L k Enter point S k (1) = R k ; Let the cross-plate displacement velocity v move Define dp: dp[k][d] = the minimum cumulative time to complete the cleaning of the k-th component with the cleaning direction of the k-th component being d; When performing the recursion, consider the displacement time from the end point of the previous block to the start point of the current block: In the formula, ||·|| is the Euclidean distance. The initial value of dp considers the distance between the take-off point and the starting point of the first cleaning block. Backtracking is used to obtain the optimal direction sequence of the entire cluster and the endpoint sequence of entering / leaving on the k-th block.
2. The photovoltaic UAV cleaning path generation method based on heuristics and local search according to claim 1, characterized in that, In step S2, C1 is set to 5%, C2 to 15%, and C3 to 30%, for cases where the dirt ratio is below the threshold r. k Components in C1 are skipped and will not participate in cleaning and planning.
3. The photovoltaic drone cleaning path generation method based on heuristics and local search according to claim 1, characterized in that, In step S3.1, the specific method for determining the value of d0 is as follows: Given a list of cluster centroids P = [(x1, y1), ..., (x... N y N )]: 1) For each i: calculate That is, traverse all other clusters, and j ≠ i; 2) Collect all d i ; 3) Take the median as d0.