A photovoltaic unit outer package line generation method based on swarm intelligence division and dynamic bridging

By using a cluster-based intelligent partitioning and dynamic bridging method, high-precision photovoltaic unit envelopes are generated, solving the problems of low efficiency, poor accuracy, and weak adaptability in existing technologies, and realizing high efficiency and precision in photovoltaic system design.

CN122197120APending Publication Date: 2026-06-12POWERCHINA HEBEI ELECTRIC POWER SURVEY & DESIGN INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
POWERCHINA HEBEI ELECTRIC POWER SURVEY & DESIGN INST CO LTD
Filing Date
2026-01-26
Publication Date
2026-06-12
Patent Text Reader

Abstract

The application discloses a photovoltaic unit outer package line generation method based on cluster group intelligent division and dynamic bridging, and belongs to the photovoltaic system design field, and comprises the following steps: S1, identifying a photovoltaic panel set in a CAD drawing and obtaining a boundary coordinate set Pxl, calculating the number of photovoltaic panels Cx and the size parameters of each photovoltaic panel; S2, determining the minimum value of the cluster group distance threshold based on the size parameters of the photovoltaic panels, automatically calculating the optimal cluster group distance threshold in combination with statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution and density analysis, performing cluster analysis on the photovoltaic panels according to the threshold, and completing photovoltaic panel cluster group division; S3, generating an equidistant outer package line for each photovoltaic panel cluster group; S4, connecting all the offset cluster group outer package lines into a single closed photovoltaic unit line through a dynamic bridging algorithm based on the minimum distance path. The adaptive intelligent division of the photovoltaic panel cluster group is realized, and the high-precision, boundary-fitting and smoothly connected photovoltaic unit outer package line is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of photovoltaic system design technology, and in particular to the field of photovoltaic panel unit partitioning design technology, specifically to a method for generating the outer envelope of photovoltaic units based on intelligent cluster partitioning and dynamic bridging. Background Technology

[0002] In the engineering design of photovoltaic power plants, a large number of photovoltaic panels need to be divided into several photovoltaic units according to electrical connection rules and operation and maintenance management requirements. To clearly identify the boundary range of each photovoltaic unit, a corresponding outer casing line needs to be generated. The outer casing line is not only a visual representation of the physical boundary of the photovoltaic unit, but also an important basis for subsequent design stages such as cable laying, equipment layout, and safety distance verification.

[0003] Currently, the generation methods for photovoltaic unit envelopes are mainly divided into two categories: manual drawing and automatic generation. The manual drawing method relies on designers to manually outline the boundaries, which has obvious drawbacks: on the one hand, when the number of photovoltaic panels is large (such as thousands or even tens of thousands of photovoltaic panels in a large photovoltaic power station), the efficiency of manual operation is extremely low, which seriously affects the overall design progress; on the other hand, the accuracy of manual drawing is greatly affected by the designer's experience and operating skills, and is prone to problems such as boundary offset and discontinuous connection, which cannot meet the requirements of refined design.

[0004] While existing automatic generation methods have improved efficiency to some extent, they still suffer from technical bottlenecks: most methods use simple rectangular bounding boxes or convex hull algorithms to generate the outer envelope. The rectangular bounding box algorithm uses the bounding rectangle of the photovoltaic panel distribution area as the outer envelope, resulting in a large amount of invalid space within the outer envelope, failing to accurately reflect the actual boundaries of the photovoltaic units. While the convex hull algorithm can fit the outer contour of the photovoltaic panel, for irregularly distributed photovoltaic panels (such as discontinuous distributions caused by terrain constraints or equipment avoidance), the generated outer envelope exhibits excessive "wrapping," and the connections between outer envelopes of adjacent clusters are abrupt, with sharp corners and broken lines, affecting the applicability of subsequent design stages. Furthermore, the cluster division thresholds of existing automatic methods are mostly manually preset, unable to adapt to the different sizes and spacing distribution characteristics of photovoltaic panels, leading to unreasonable cluster division and consequently affecting the accuracy of the outer envelope.

[0005] Therefore, there is an urgent need for a photovoltaic unit envelope generation method that can adapt to the distribution characteristics of photovoltaic panels, realize intelligent cluster division, and generate high-precision, smoothly fitting boundaries, so as to solve the problems of low efficiency, poor accuracy and weak adaptability in the existing technology. Summary of the Invention

[0006] To address the problems of low efficiency and poor precision in manually drawing photovoltaic (PV) unit envelope lines, and unreasonable cluster division in automatically generated PV unit envelope line generation technologies, this invention provides a PV unit envelope line generation method based on intelligent cluster division and dynamic bridging. This method achieves adaptive intelligent division of PV panel clusters, generating high-precision, boundary-fitting, and smoothly connected PV unit envelope lines, thereby improving the efficiency and precision of PV system design.

[0007] The technical solution adopted in this invention, a method for generating the outer envelope of photovoltaic units based on intelligent cluster partitioning and dynamic bridging, is as follows:

[0008] A method for generating the envelope of photovoltaic units based on intelligent cluster partitioning and dynamic bridging includes the following steps:

[0009] S1. Identify the set of photovoltaic panels in the CAD drawing and obtain the boundary coordinate set Pxl. Calculate the number of photovoltaic panels Cx and the size parameters of each photovoltaic panel.

[0010] S2. Determine the minimum value of the cluster distance threshold based on the photovoltaic panel size parameters. Combine statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution, and density analysis to automatically calculate the optimal cluster distance threshold. Perform cluster analysis on the photovoltaic panels according to the threshold to complete the photovoltaic panel cluster division.

[0011] S3. Generate equidistant outer envelope lines for each photovoltaic panel cluster;

[0012] S4. Connect all offset cluster envelopes into a single closed photovoltaic unit line using a dynamic bridging algorithm based on the minimum distance path.

[0013] A further improvement to the technical solution of this invention lies in the following: Determining the minimum value of the cluster distance threshold based on the photovoltaic panel size parameters in step S2 includes the following steps:

[0014] S2.1. Traverse each photovoltaic panel polyline object in the photovoltaic panel boundary coordinate set Pxl, calculate its length L and width W by obtaining the coordinates of the four vertices, and obtain the average length and width D_avg = (L + W) / 2;

[0015] S2.2 Compare the average length and width of all photovoltaic panels, D_avg, and determine the maximum value, D_max, as the minimum value, T_min, of the cluster distance threshold T.

[0016] A further improvement to the technical solution of this invention lies in the following: step S2 combines statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution, and density analysis, including the following steps:

[0017] S2.3 Calculate the minimum distance between any two photovoltaic panels in the photovoltaic panel set Pxl, including the distance between vertices and the distance between edges, and construct the distance matrix D_matrix between photovoltaic panels;

[0018] S2.4 Perform statistical analysis on the distance matrix D_matrix, calculate the average distance Mean_dist = ΣD_matrix / N, the standard deviation Std_dev = √(Σ(D_i - Mean_dist)² / N), and the median Median_dist, where N is the total number of distances;

[0019] S2.5. Perform cluster analysis on the distance matrix D_matrix. Specifically, sort the distances in ascending order to generate a distance sequence D_sorted. Scan along the sequence to find the maximum value of the difference between adjacent distances. Determine the distance corresponding to the maximum value as the jump point T_jump in the distance distribution.

[0020] S2.6 Perform density analysis on the distance matrix D_matrix, specifically: divide the distance range into multiple intervals, count the number of distances in each interval, calculate the density of each interval, find the position with the largest density change rate, and determine the distance corresponding to this position as the density change point T_density.

[0021] A further improvement to the technical solution of the present invention is that: the automatic calculation of the optimal cluster distance threshold in step S2 includes the following steps:

[0022] S2.7. Based on the results of combined statistical analysis, cluster analysis, and density analysis, a candidate threshold set {Mean_dist +Std_dev} is generated. 0.5, Median_dist + Std_dev 0.3, T_jump, T_density}, filter and sort the set, and determine the median of the set as the candidate threshold T_candidate;

[0023] S2.8. Take the larger value between the candidate threshold T_candidate and the minimum threshold T_min as the final optimal cluster distance threshold T_optimal;

[0024] S2.9. Based on the optimal cluster distance threshold T_optimal, a distance-based clustering algorithm is used to divide the photovoltaic panel set Pxl. That is, all unassigned photovoltaic panels are traversed, and photovoltaic panels whose distance to any photovoltaic panel in the current cluster is less than T_optimal are assigned to the same cluster, generating a photovoltaic panel cluster set C_cluster.

[0025] A further improvement to the technical solution of the present invention is that step S3 includes the following steps:

[0026] S3.1, Traverse each cluster C_i in the photovoltaic panel cluster set C_cluster;

[0027] S3.2 For cluster C_i, traverse all photovoltaic panels it contains, collect all vertex coordinates, and generate a bounding box containing all vertices;

[0028] S3.3 Based on all photovoltaic panels in the cluster C_i, an incremental fusion algorithm based on spatial bounding boxes is used to treat each photovoltaic panel as an independent unit, and adjacent units are gradually merged to generate an irregular polygonal outer envelope R_i_unoffset that is close to the outer photovoltaic panel;

[0029] S3.4 Call the GetOffsetCurves method of the CAD API to offset the outer envelope R_i_unoffset of the irregular polygon by a preset offset distance, and generate the offset cluster outer envelope P_outline_i.

[0030] S3.5 Add the offset cluster envelope P_outline_i to the offset envelope set C_outline.

[0031] A further improvement to the technical solution of the present invention is that the incremental fusion algorithm based on spatial bounding boxes in step S3.3 includes the following steps:

[0032] S3.3.1 Initialization: Each photovoltaic panel P_j in the cluster C_i is regarded as an independent "fusion unit", and its initial state is its own geometric boundary. A list of units to be fused, L_initial, is established, which contains all photovoltaic panels.

[0033] S3.3.2 Iterative fusion: Select a unit U_i that is not marked as "fused" from L_initial, and calculate the distance D_ij between it and all other unmarked units U_j in the list;

[0034] S3.3.3 Repeat step S3.3.2 until there are no more unit pairs in L_initial that satisfy the fusion condition;

[0035] S3.3.4 Final Processing: The remaining cells in L_initial are the irregular polygons representing the entire cluster C_i after multiple fusions. If only one cell remains, that cell is R_i_unoffset; if multiple cells remain, a union operation is performed on these cells again to generate the final single irregular polygon envelope R_i_unoffset.

[0036] A further improvement to the technical solution of the present invention is that step S3.3.2 includes the following steps:

[0037] S3.3.2.1 If there exists a cell U_j whose distance from D_ij is less than or equal to the preset fusion distance threshold T_fuse, then the closest U_j is selected;

[0038] S3.3.2.2, Geometrically merge elements U_i and U_j: Calculate the union of U_i and U_j to generate a new merged polygon P_fused that contains U_i and U_j;

[0039] S3.3.2.3 Remove U_i and U_j from L_initial, and add the newly generated fused polygon P_fused to L_initial;

[0040] S3.3.2.4, Mark U_i and U_j as "fused".

[0041] A further improvement to the technical solution of the present invention is that: the step S4 of connecting the offset cluster outer envelopes into photovoltaic unit lines includes the following steps:

[0042] S4.1 Obtain the set of all offset cluster outlines C_outline;

[0043] S4.2 When there is only one outer line P_single in the set C_outline, P_single is directly used as the final photovoltaic unit line P_final;

[0044] S4.3 When the set C_outline contains multiple outer envelopes, execute the dynamic bridging algorithm based on the minimum distance path.

[0045] A further improvement to the technical solution of the present invention is that step S4.3 includes the following steps:

[0046] S4.3.1 Dynamic bridging algorithm initialization: Treat all offset outer envelopes in the set C_outline as independent "units to be bridged";

[0047] S4.3.2 Minimum Distance Path Calculation: Calculate the minimum distance between any two outer envelopes in the set C_outline, and determine the closest vertex pair or edge pair (P1, P2) between each pair of lines.

[0048] S4.3.3 Dynamic bridging curve generation: For each pair of closest points (P1, P2), a dynamic bridging curve C_bridge is generated. This curve dynamically adjusts its shape by analyzing the local geometric features of P1 and P2. It can be a straight line, an arc, or a spline curve that satisfies curvature continuity, ensuring the smoothness and naturalness of the bridging process.

[0049] S4.3.4, Fusion Processing: Treat all offset outer envelopes and the generated dynamic bridging curve C_bridge as a whole, and form a single, continuous, closed polygon, namely the final photovoltaic unit line P_final, through Boolean union operation or direct connection of vertices.

[0050] The technological advancements achieved by this invention due to the adoption of the above technical solutions are as follows:

[0051] This invention determines the basic threshold based on the size parameters of the photovoltaic panel itself, and calculates the optimal cluster distance threshold by combining statistical, clustering, and density multi-dimensional distance analysis. It requires no manual intervention and can adapt to photovoltaic panel sets of different sizes and distribution densities, ensuring the rationality and accuracy of cluster division.

[0052] This invention uses an incremental fusion algorithm based on spatial bounding boxes to generate an initial outer envelope. By iteratively fusing adjacent photovoltaic panel units, it avoids the invalid space problem of traditional bounding box algorithms and the over-wrapping problem of convex hull algorithms. The generated outer envelope can accurately fit the actual boundary of the photovoltaic cluster.

[0053] This invention employs a dynamic bridging algorithm based on the minimum distance path. By analyzing local geometric features such as the tangent direction and curvature of the connection points, it dynamically generates straight lines, arcs, or spline curves to ensure smooth and continuous connection of adjacent offset envelopes, thus meeting the requirements of refined design for boundary morphology. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. In the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concepts of this invention.

[0055] This embodiment provides a method for generating the outer envelope of photovoltaic units based on intelligent cluster partitioning and dynamic bridging, including the following steps:

[0056] S1. Identify the set of photovoltaic panels in the CAD drawing and obtain the boundary coordinate set Pxl. Calculate the number of photovoltaic panels Cx and the size parameters of each photovoltaic panel.

[0057] S2. Determine the minimum value of the cluster distance threshold based on the photovoltaic panel size parameters. Combine statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution, and density analysis to automatically calculate the optimal cluster distance threshold. Perform cluster analysis on the photovoltaic panels according to the threshold to complete the photovoltaic panel cluster division.

[0058] S2.1. Traverse each photovoltaic panel polyline object in the photovoltaic panel boundary coordinate set Pxl, calculate its length L and width W by obtaining the coordinates of the four vertices, and obtain the average length and width D_avg = (L + W) / 2.

[0059] S2.2 Compare the average length and width of all photovoltaic panels, D_avg, and determine the maximum value, D_max, as the minimum value, T_min, of the cluster distance threshold T.

[0060] S2.3 Calculate the minimum distance between any two photovoltaic panels in the photovoltaic panel set Pxl, including the distance between vertices and the distance between edges, and construct the distance matrix D_matrix between photovoltaic panels.

[0061] S2.4 Perform statistical analysis on the distance matrix D_matrix, calculate the average distance Mean_dist = ΣD_matrix / N, the standard deviation Std_dev = √(Σ(D_i - Mean_dist)² / N), and the median Median_dist, where N is the total number of distances.

[0062] S2.5. Perform cluster analysis on the distance matrix D_matrix. Specifically, sort the distances in ascending order to generate a distance sequence D_sorted. Scan along the sequence to find the maximum value of the difference between adjacent distances, and determine the distance corresponding to the maximum value as the jump point T_jump in the distance distribution.

[0063] S2.6 Perform density analysis on the distance matrix D_matrix, specifically: divide the distance range into multiple intervals, count the number of distances in each interval, calculate the density of each interval, find the position with the largest density change rate, and determine the distance corresponding to this position as the density change point T_density.

[0064] S2.7. Based on the results of combined statistical analysis, cluster analysis, and density analysis, a candidate threshold set {Mean_dist +Std_dev} is generated. 0.5, Median_dist + Std_dev 0.3, T_jump, T_density}, filter and sort the set, and determine the median of the set as the candidate threshold T_candidate.

[0065] S2.8. Take the larger value between the candidate threshold T_candidate and the minimum threshold T_min as the final optimal cluster distance threshold T_optimal.

[0066] S2.9. Based on the optimal cluster distance threshold T_optimal, a distance-based clustering algorithm is used to divide the photovoltaic panel set Pxl. That is, all unassigned photovoltaic panels are traversed, and photovoltaic panels whose distance to any photovoltaic panel in the current cluster is less than T_optimal are assigned to the same cluster, generating a photovoltaic panel cluster set C_cluster.

[0067] S3. Generate equidistant outer envelopes for each photovoltaic panel cluster.

[0068] S3.1. Traverse each cluster C_i in the photovoltaic panel cluster set C_cluster.

[0069] S3.2 For cluster C_i, traverse all photovoltaic panels it contains, collect all vertex coordinates, and generate a bounding box containing all vertices.

[0070] S3.3. Based on all photovoltaic panels in the cluster C_i, an incremental fusion algorithm based on spatial bounding boxes is used to treat each photovoltaic panel as an independent unit, and adjacent units are gradually merged to generate an irregular polygonal outer envelope R_i_unoffset that is close to the outer photovoltaic panel.

[0071] S3.3.1 Initialization: Each photovoltaic panel P_j in the cluster C_i is regarded as an independent "fusion unit" with its initial state being its own geometric boundary, and a list of units to be fused L_initial is established, containing all photovoltaic panels.

[0072] S3.3.2 Iterative fusion: Select a unit U_i that is not marked as "fused" from L_initial, and calculate the distance D_ij between it and all other unmarked units U_j in the list.

[0073] S3.3.2.1 If there exists a unit U_j whose distance from D_ij is less than or equal to the preset fusion distance threshold T_fuse, then the closest U_j is selected.

[0074] S3.3.2.2, Geometrically merge elements U_i and U_j: Calculate the union of U_i and U_j to generate a new merged polygon P_fused that contains U_i and U_j.

[0075] S3.3.2.3 Remove U_i and U_j from L_initial, and add the newly generated fused polygon P_fused to L_initial;

[0076] S3.3.2.4, Mark U_i and U_j as "fused".

[0077] S3.3.3 Repeat step S3.3.2 until there are no more unit pairs in L_initial that satisfy the fusion conditions.

[0078] S3.3.4 Final Processing: The remaining cells in L_initial are the irregular polygons representing the entire cluster C_i after multiple fusions. If only one cell remains, that cell is R_i_unoffset; if multiple cells remain, a union operation is performed on these cells again to generate the final single irregular polygon envelope R_i_unoffset.

[0079] S3.4 Call the GetOffsetCurves method of the CAD API to offset the outer envelope R_i_unoffset of the irregular polygon by a preset offset distance, and generate the offset cluster outer envelope P_outline_i.

[0080] S3.5 Add the offset cluster envelope P_outline_i to the offset envelope set C_outline.

[0081] S4. Connect all offset cluster envelopes into a single closed photovoltaic unit line using a dynamic bridging algorithm based on the minimum distance path.

[0082] S4.1 Obtain the set of all offset cluster outlines C_outline;

[0083] S4.2 When there is only one outer line P_single in the set C_outline, P_single is directly used as the final photovoltaic unit line P_final;

[0084] S4.3 When the set C_outline contains multiple outer envelopes, execute the dynamic bridging algorithm based on the minimum distance path.

[0085] S4.3.1 Dynamic bridging algorithm initialization: Treat all offset outer envelopes in the set C_outline as independent "units to be bridged";

[0086] S4.3.2 Minimum Distance Path Calculation: Calculate the minimum distance between any two outer envelopes in the set C_outline, and determine the closest vertex pair or edge pair (P1, P2) between each pair of lines.

[0087] S4.3.3 Dynamic bridging curve generation: For each pair of closest points (P1, P2), a dynamic bridging curve C_bridge is generated. This curve dynamically adjusts its shape by analyzing the local geometric features of P1 and P2. It can be a straight line, an arc, or a spline curve that satisfies curvature continuity, ensuring the smoothness and naturalness of the bridging process.

[0088] S4.3.4, Fusion Processing: Treat all offset outer envelopes and the generated dynamic bridging curve C_bridge as a whole, and form a single, continuous, closed polygon, namely the final photovoltaic unit line P_final, through Boolean union operation or direct connection of vertices.

[0089] In the above embodiments, a method for generating the outer envelope of photovoltaic units based on intelligent cluster partitioning and dynamic bridging is provided. This invention determines the basic threshold based on the photovoltaic panel's own size parameters, and calculates the optimal cluster distance threshold by combining statistical, clustering, and density multi-dimensional distance analysis. It requires no manual intervention and can adapt to photovoltaic panel sets of different sizes and distribution densities, ensuring the rationality and accuracy of cluster partitioning. This invention uses an incremental fusion algorithm based on spatial bounding boxes to generate the initial outer envelope. By iteratively fusing adjacent photovoltaic panel units, it avoids the invalid space of traditional bounding box algorithms and the over-wrapping problem of convex hull algorithms. The generated outer envelope can accurately fit the actual boundary of the photovoltaic cluster. This invention uses a dynamic bridging algorithm based on the minimum distance path. By analyzing the tangent direction, curvature, and other local geometric features of the connection points, it dynamically generates straight lines, arcs, or spline curves, ensuring smooth and continuous connection of adjacent offset outer envelopes, meeting the requirements of refined design for boundary morphology.

[0090] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the concept and scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the inventive concept should fall within the protection scope of the present invention. All technical contents for which protection is sought in this invention are fully described in the claims.

Claims

1. A method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging, characterized in that, Includes the following steps: S1. Identify the set of photovoltaic panels in the CAD drawing and obtain the boundary coordinate set Pxl. Calculate the number of photovoltaic panels Cx and the size parameters of each photovoltaic panel. S2. Determine the minimum value of the cluster distance threshold based on the photovoltaic panel size parameters. Combine statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution, and density analysis to automatically calculate the optimal cluster distance threshold. Perform cluster analysis on the photovoltaic panels according to the threshold to complete the photovoltaic panel cluster division. S3. Generate equidistant outer envelope lines for each photovoltaic panel cluster; S4. Connect all offset cluster envelopes into a single closed photovoltaic unit line using a dynamic bridging algorithm based on the minimum distance path.

2. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 1, characterized in that, The step S2, which determines the minimum value of the cluster distance threshold based on the photovoltaic panel size parameters, includes the following steps: S2.

1. Traverse each photovoltaic panel polyline object in the photovoltaic panel boundary coordinate set Pxl, calculate its length L and width W by obtaining the coordinates of the four vertices, and obtain the average length and width D_avg = (L + W) / 2; S2.2 Compare the average length and width of all photovoltaic panels, D_avg, and determine the maximum value, D_max, as the minimum value, T_min, of the cluster distance threshold T.

3. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 2, characterized in that, Step S2, which combines statistical analysis based on the distance between all photovoltaic panels, cluster analysis based on distance distribution, and density analysis, includes the following steps: S2.3 Calculate the minimum distance between any two photovoltaic panels in the photovoltaic panel set Pxl, including the distance between vertices and the distance between edges, and construct the distance matrix D_matrix between photovoltaic panels; S2.4 Perform statistical analysis on the distance matrix D_matrix, calculate the average distance Mean_dist = ΣD_matrix / N, the standard deviation Std_dev = √(Σ(D_i - Mean_dist)² / N), and the median Median_dist, where N is the total number of distances; S2.

5. Perform cluster analysis on the distance matrix D_matrix. Specifically, sort the distances in ascending order to generate a distance sequence D_sorted. Scan along the sequence to find the maximum value of the difference between adjacent distances. Determine the distance corresponding to the maximum value as the jump point T_jump in the distance distribution. S2.6 Perform density analysis on the distance matrix D_matrix, specifically: divide the distance range into multiple intervals, count the number of distances in each interval, calculate the density of each interval, find the position with the largest density change rate, and determine the distance corresponding to this position as the density change point T_density.

4. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 3, characterized in that, The automatic calculation of the optimal cluster distance threshold in step S2 includes the following steps: S2.

7. Based on the results of combined statistical analysis, cluster analysis, and density analysis, a candidate threshold set {Mean_dist +Std_dev} is generated. 0.5, Median_dist + Std_dev 0.3, T_jump, T_density}, filter and sort the set, and determine the median of the set as the candidate threshold T_candidate; S2.

8. Take the larger value between the candidate threshold T_candidate and the minimum threshold T_min as the final optimal cluster distance threshold T_optimal; S2.

9. Based on the optimal cluster distance threshold T_optimal, a distance-based clustering algorithm is used to divide the photovoltaic panel set Pxl. That is, all unassigned photovoltaic panels are traversed, and photovoltaic panels whose distance to any photovoltaic panel in the current cluster is less than T_optimal are assigned to the same cluster, generating a photovoltaic panel cluster set C_cluster.

5. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 1, characterized in that, Step S3 includes the following steps: S3.1, Traverse each cluster C_i in the photovoltaic panel cluster set C_cluster; S3.2 For cluster C_i, traverse all photovoltaic panels it contains, collect all vertex coordinates, and generate a bounding box containing all vertices; S3.3 Based on all photovoltaic panels in the cluster C_i, an incremental fusion algorithm based on spatial bounding boxes is used to treat each photovoltaic panel as an independent unit, and adjacent units are gradually merged to generate an irregular polygonal outer envelope R_i_unoffset that is close to the outer photovoltaic panel; S3.4 Call the GetOffsetCurves method of the CAD API to offset the outer envelope R_i_unoffset of the irregular polygon by a preset offset distance, and generate the offset cluster outer envelope P_outline_i. S3.5 Add the offset cluster envelope P_outline_i to the offset envelope set C_outline.

6. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 5, characterized in that, The incremental fusion algorithm based on spatial bounding boxes in step S3.3 includes the following steps: S3.3.1 Initialization: Each photovoltaic panel P_j in the cluster C_i is regarded as an independent "fusion unit", and its initial state is its own geometric boundary. A list of units to be fused, L_initial, is established, which contains all photovoltaic panels. S3.3.2 Iterative fusion: Select a unit U_i that is not marked as "fused" from L_initial, and calculate the distance D_ij between it and all other unmarked units U_j in the list; S3.3.3 Repeat step S3.3.2 until there are no more unit pairs in L_initial that satisfy the fusion condition; S3.3.4 Final Processing: The remaining cells in L_initial are the irregular polygons representing the entire cluster C_i after multiple fusions. If only one cell remains, that cell is R_i_unoffset; if multiple cells remain, a union operation is performed on these cells again to generate the final single irregular polygon envelope R_i_unoffset.

7. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 6, characterized in that, Step S3.3.2 includes the following steps: S3.3.2.1 If there exists a cell U_j whose distance from D_ij is less than or equal to the preset fusion distance threshold T_fuse, then the closest U_j is selected; S3.3.2.2, Geometrically merge elements U_i and U_j: Calculate the union of U_i and U_j to generate a new merged polygon P_fused that contains U_i and U_j; S3.3.2.3 Remove U_i and U_j from L_initial, and add the newly generated fused polygon P_fused to L_initial; S3.3.2.4, Mark U_i and U_j as "fused".

8. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 1, characterized in that: The step S4 of connecting the offset cluster envelopes into photovoltaic unit lines includes the following steps: S4.1 Obtain the set of all offset cluster outlines C_outline; S4.2 When there is only one outer line P_single in the set C_outline, P_single is directly used as the final photovoltaic unit line P_final; S4.3 When the set C_outline contains multiple outer envelopes, execute the dynamic bridging algorithm based on the minimum distance path.

9. The method for generating the outer envelope of a photovoltaic unit based on intelligent cluster partitioning and dynamic bridging according to claim 8, characterized in that, Step S4.3 includes the following steps: S4.3.1 Dynamic bridging algorithm initialization: Treat all offset outer envelopes in the set C_outline as independent "units to be bridged"; S4.3.2 Minimum Distance Path Calculation: Calculate the minimum distance between any two outer envelopes in the set C_outline, and determine the closest vertex pair or edge pair (P1, P2) between each pair of lines. S4.3.3 Dynamic bridging curve generation: For each pair of closest points (P1, P2), a dynamic bridging curve C_bridge is generated. This curve dynamically adjusts its shape by analyzing the local geometric features of P1 and P2. It can be a straight line, an arc, or a spline curve that satisfies curvature continuity, ensuring the smoothness and naturalness of the bridging process. S4.3.4, Fusion Processing: Treat all offset outer envelopes and the generated dynamic bridging curve C_bridge as a whole, and form a single, continuous, closed polygon, namely the final photovoltaic unit line P_final, through Boolean union operation or direct connection of vertices.