Photovoltaic module alignment method and device, electronic equipment and storage medium

By adjusting the photovoltaic module identifiers through angle and position clustering, the problem of photovoltaic module layout identification error in the existing technology is solved, and a more accurate matching of photovoltaic module layout diagram and physical grid is achieved, thus improving the consistency of layout.

CN121543415APending Publication Date: 2026-02-17SHANGHAI SIGE DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511707546.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

In existing photovoltaic module layouts, the identification of the center coordinates and rotation angles of photovoltaic modules by taking pictures has recognition errors, which makes it impossible for the photovoltaic module layout diagram to accurately reproduce the physical grid, thus affecting the quality of the project.

Method used

Target component identifiers are grouped into angle clusters by angle, and local angle clusters are further subdivided by position information within the angle clusters. The layout information of the component identifiers is adjusted to achieve automatic alignment and reduce recognition errors.

Benefits of technology

It improves the matching degree between the photovoltaic module layout diagram and the original photovoltaic module physical grid, reduces identification errors, and improves the accuracy and consistency of the layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543415A_ABST
    Figure CN121543415A_ABST
Patent Text Reader

Abstract

According to the photovoltaic module alignment method and device, the electronic equipment and the storage medium provided by the invention, the target module identifiers are grouped into the angle clusters according to angles through angle clustering, the local angle clusters are subdivided in the angle clusters according to the position information, alignment is carried out for the local angle clusters, multi-angle target module identifier automatic alignment is realized, and the alignment efficiency is improved. Therefore, the aligned photovoltaic module layout is closer to the physical grid of the original photovoltaic module.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of layout design of photovoltaic modules, and particularly relates to a photovoltaic module alignment method and device, an electronic device, and a storage medium. BACKGROUND

[0002] In photovoltaic module layout, the existing process identifies the center coordinates and rotation angle of a photovoltaic module by photographing the photovoltaic module and collecting the two-dimensional code of the photovoltaic module to generate a preliminary photovoltaic module layout (Layout), and then the user manually edits to correct errors. However, the process has identification errors when using algorithms, such as image quality, shielding, and identification errors of center coordinates and rotation angle, and the user manual editing also has errors, which makes the Layout unable to truly restore the physical grid of the photovoltaic module, affecting subsequent engineering. SUMMARY

[0003] Embodiments of the application provide a photovoltaic module alignment method and device, an electronic device, and a storage medium. The target component identifiers are grouped into angle clusters by angle clustering, and the local angle clusters are subdivided in the angle clusters according to the position information. The local angle clusters are aligned to realize automatic alignment of the multi-angle target component identifiers, so that the aligned photovoltaic module layout is closer to the physical grid of the original photovoltaic module.

[0004] In a first aspect, embodiments of the application provide a photovoltaic module alignment method, comprising: Based on a layout interface of a photovoltaic module, obtaining layout information of target component identifiers in the layout interface, wherein the layout information includes position information and angle; Clustering the target component identifiers based on the angles of the target component identifiers to obtain regional angle clusters; Re-clustering the target component identifiers in each regional angle cluster based on the position information of the target component identifiers in each regional angle cluster to obtain local angle clusters in each regional angle cluster; Adjusting the layout information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster.

[0005] In some embodiments, the adjusting the position information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster comprises: Adjusting the angle of the target component identifiers in each local angle cluster to the average value of the angles of the target component identifiers in the corresponding regional angle cluster; Adjusting the position information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster.

[0006] In some embodiments, the adjusting the position information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster comprises: In a case where an included angle between the average angle corresponding to the target local angle cluster and an axis direction of the X-axis is less than a preset angle threshold, clustering is performed based on the X-coordinate values in the position information of the target component identifiers in the target local angle cluster to obtain X-coordinate clusters, and X-coordinate values of the target component identifiers in the same X-coordinate cluster are adjusted to be the same X-coordinate value. Clustering is performed based on the Y-coordinate values in the position information of the target component identifiers in the target local angle cluster to obtain Y-coordinate clusters, and Y-coordinate values of the target component identifiers in the same Y-coordinate cluster are adjusted to be the same Y-coordinate value.

[0007] In some embodiments, in a case where an included angle between the average angle corresponding to the target local angle cluster and an axis direction of the X-axis is less than a preset angle threshold, after the X-coordinate clusters are obtained, the method comprises: calculating a first mean value of the X-coordinate values of the target component identifiers in each of the X-coordinate clusters, calculating a first distance mean value between the target component identifiers in adjacent X-coordinate clusters in the X-axis direction based on the first mean value, obtaining a first safety distance in the X-axis direction based on the first distance mean value and a width of the target component identifier, and adjusting the spacing of the target component identifiers in the X-axis direction between adjacent X-coordinate clusters by the first safety distance. After the Y-coordinate clusters are obtained, the method further comprises: calculating a second mean value of the Y-coordinate values of the target component identifiers in each of the Y-coordinate clusters, calculating a second distance mean value between the target component identifiers in adjacent Y-coordinate clusters in the Y-axis direction based on the second mean value, obtaining a second safety distance in the Y-axis direction based on the second distance mean value and a height of the target component identifier, and adjusting the spacing of the target component identifiers in the Y-axis direction between adjacent Y-coordinate clusters by the second safety distance.

[0008] In some embodiments, the obtaining the first safety distance in the X-axis direction based on the first distance mean value and the width of the target component identifier comprises: taking a maximum value between the first distance mean value and the width of the target component identifier as the first safety distance in the X-axis direction. The obtaining the second safety distance in the Y-axis direction based on the second distance mean value and the height of the target component identifier comprises: taking a maximum value between the second distance mean value and the height of the target component identifier as the second safety distance in the X-axis direction.

[0009] In a case where an included angle between an average value of a target local angle cluster and a Y-axis direction of a coordinate axis is less than a preset angle threshold, after obtaining the X coordinate cluster, the method comprises: calculating a third average value of X coordinate values of each target component identifier in each of the X coordinate clusters; calculating a third distance average between target component identifiers in adjacent X coordinate clusters in the X-axis direction based on the third average value; obtaining a third safety distance in the X-axis direction based on the third distance average and a height of the target component identifier; adjusting a spacing of the target component identifiers in the X-axis direction between adjacent X coordinate clusters by the third safety distance; After the Y coordinate cluster is obtained, the method further comprises: calculating a fourth average value of Y coordinate values of each target component identifier in each of the Y coordinate clusters; calculating a fourth distance average between target component identifiers in adjacent Y coordinate clusters in the Y-axis direction based on the fourth average value; obtaining a fourth safety distance in the Y-axis direction based on the fourth distance average and a width of the target component identifier; adjusting a spacing of the target component identifiers in the Y-axis direction between adjacent Y coordinate clusters by the fourth safety distance.

[0010] In some embodiments, the obtaining of the third safety distance in the X-axis direction based on the third distance average and the height of the target component identifier comprises: taking a maximum value between the third distance average and the height of the target component identifier as the third safety distance in the X-axis direction; taking a maximum value between the fourth distance average and the width of the target component identifier as the fourth safety distance in the Y-axis direction.

[0011] In some embodiments, the adjusting of the position information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster comprises: In a case where an included angle between an average value of a target local angle cluster and an axis direction of a coordinate axis is greater than a preset angle threshold: determining an angle reference straight line of the target local angle cluster, and calculating a first projection distance of each target component identifier in the target local angle cluster to the angle reference straight line, clustering the target component identifiers in the target local angle cluster based on the first projection distance to obtain a reference angle cluster, and adjusting position information of the target component identifiers in each reference angle cluster to make the projection distances of the target component identifiers in the same reference angle cluster to the angle reference straight line the same, and the spacing of the target component identifiers in the angle reference straight line between adjacent reference angle clusters the same; determining a normal vector reference line of the target local angle cluster, and calculating second projection distances of target component identifiers in the target local angle cluster to the normal vector reference line, clustering the target component identifiers in the target local angle cluster based on the second projection distances to obtain a normal vector angle cluster, and adjusting position information of the target component identifiers in each normal vector angle cluster so that the projection distances of the target component identifiers in the same normal vector angle cluster to the normal vector reference line are the same, and the intervals of the target component identifiers on the normal vector reference line between adjacent normal vector angle clusters are the same, wherein the normal vector reference line is perpendicular to the angle reference straight line.

[0012] In some embodiments, the adjusting of the position information of the target component identifiers in each reference angle cluster so that the projection distances of the target component identifiers in the same reference angle cluster to the angle reference straight line are the same, and the intervals of the target component identifiers on the angle reference straight line between adjacent reference angle clusters are the same, comprises: adjusting the position information of the target component identifiers in each reference angle cluster so that the projection distances of the target component identifiers in the same reference angle cluster to the angle reference straight line after the adjustment of the position information are the same; calculating a fifth distance average between the target component identifiers in adjacent reference angle clusters in the direction of the angle reference straight line, and obtaining a fifth safety distance in the direction of the angle reference straight line based on the fifth distance average and the height of the target component identifiers, and adjusting the intervals of the target component identifiers on the angle reference straight line between adjacent reference angle clusters by the fifth safety distance so that the intervals of the target component identifiers on the angle reference straight line between adjacent reference angle clusters are the same.

[0013] In some embodiments, the adjusting of the position information of the target component identifiers in each normal vector angle cluster so that the projection distances of the target component identifiers in the same normal vector angle cluster to the normal vector reference line are the same, and the intervals of the target component identifiers on the normal vector reference straight line between adjacent normal vector angle clusters are the same, comprises: adjusting the position information of the target component identifiers in each normal vector angle cluster so that the projection distances of the target component identifiers in the same normal vector angle cluster to the normal vector reference line after the adjustment of the position information are the same; calculating a sixth distance average between the target component identifiers in adjacent normal vector angle clusters on the normal vector reference line, and obtaining a sixth safety distance in the direction of the normal vector reference line based on the sixth distance average and the width of the target component identifiers, and adjusting the intervals of the target component identifiers on the normal vector reference line between adjacent normal vector angle clusters by the sixth safety distance so that the intervals of the target component identifiers on the normal vector reference straight line between adjacent normal vector angle clusters are the same.

[0014] In some embodiments, the method further comprises: In the presence of an isolated target component identifier, determining a preliminary target local angle cluster intersecting the isolated target component identifier; Calculating a fifth distance mean between target component identifiers in each of the preliminary target local angle clusters, and determining a first distance between the isolated target component identifier and the nearest target component identifier in the preliminary target local angle cluster; In the presence of the first distance being less than or equal to the fifth distance mean of the target local angle cluster in the preliminary target local angle cluster, incorporating the isolated target component identifier into the target local angle cluster.

[0015] In some embodiments, the method further comprises: Determining component identifiers in the entire region of the layout interface as the target component identifiers, or, Determining component identifiers in a partial region of the layout information as the target component identifiers.

[0016] In some embodiments, the determining component identifiers in a partial region of the layout information as the target component identifiers comprises: In response to a selection operation of a user on a partial region in the layout interface, determining component identifiers in the partial region as the target component identifiers; Or, in response to an operation of the user editing layout information of target component identifiers in a partial region in the layout interface, determining component identifiers in the partial region as the target component identifiers; Or, in the presence of a number of local angle clusters with angle errors of component identifiers greater than an angle error threshold being less than a first preset number, determining component identifiers in a partial region corresponding to the local angle clusters with angle errors greater than the angle error threshold as the target component identifiers.

[0017] In some embodiments, the determining component identifiers in the entire region of the layout interface as the target component identifiers comprises: In the presence of a number of local angle clusters with angle errors of component identifiers greater than an angle error threshold or position errors of component identifiers greater than a position error threshold being greater than a first preset number, determining component identifiers in the entire region of the layout interface as the target component identifiers; Or, in the presence of a determination that the layout interface is an initial layout interface generated based on a photograph, determining component identifiers in the entire region of the layout interface as the target component identifiers; Or, in the presence of a determination that a number of component identifiers edited by the user in the layout interface is greater than a second preset number, determining component identifiers in the entire region of the layout interface as the target component identifiers.

[0018] In some embodiments, the method further includes: Calculate the average angle of the target component identifier in each local angle cluster, and calculate the root mean square error between the angle of the target component identifier in each local angle cluster and the corresponding average angle to obtain the angle error of the target component identifier in each local angle cluster. Alternatively, calculate the location information of the cluster center of each local angle cluster, and calculate the mean square error between the location information of the target component identifier in each local angle cluster and the corresponding cluster center to obtain the location error of the target component identifier in each local angle cluster.

[0019] Secondly, embodiments of this application provide an alignment device for photovoltaic modules, comprising: The acquisition module is used to acquire layout information of the target component identifier in the layout interface based on the layout interface of the photovoltaic module, wherein the layout information includes: position information and angle; The first clustering module is used to cluster the target component identifiers based on the angle of the target component identifiers to obtain region angle clusters; The second clustering module is used to re-cluster the target component identifiers in each region angle cluster based on the location information of the target component identifiers in each region angle cluster, so as to obtain the local angle clusters in each region angle cluster. The adjustment module is used to adjust the layout information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

[0020] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the above-mentioned embodiments.

[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the preceding claims.

[0022] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the electronic device to execute any of the methods described above.

[0023] The beneficial effects of the embodiments in this application compared with the prior art are: This application provides a photovoltaic module alignment method. Based on the photovoltaic module layout interface, layout information of target module identifiers in the layout interface is obtained. This layout information includes position information and angles. The target module identifiers are clustered based on their angles to obtain regional angle clusters. Based on the position information of the target module identifiers in each regional angle cluster, the target module identifiers in each regional angle cluster are further clustered to obtain local angle clusters within each regional angle cluster. The layout information of the target module identifiers in each local angle cluster is adjusted to align the target module identifiers within the same local angle cluster. Target module identifiers are grouped into angle clusters by angle through angle clustering, and local angle clusters are further subdivided within each angle cluster based on position information. Alignment is then performed on the local angle clusters to achieve automatic alignment of target module identifiers from multiple angles, making the aligned photovoltaic module layout diagram closer to the original physical grid of the photovoltaic module. Attached Figure Description

[0024] 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 only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A schematic diagram illustrating the implementation process of a photovoltaic module alignment method provided for the purposes of this application; Figure 2 This application provides a schematic flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters. Figure 3 This application provides a schematic flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters. Figure 4 A schematic diagram illustrating a change in the layout interface provided in an embodiment of this application; Figure 5 This application provides a schematic flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters. Figure 6 A schematic diagram illustrating the center, angular direction, and normal direction of a target component identifier provided in an embodiment of this application; Figure 7 A schematic diagram illustrating a change in the layout interface provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an alignment device for a photovoltaic module provided in an embodiment of this application; Figure 9This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0027] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0028] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0029] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once detected," or "in response to detection."

[0030] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0031] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0032] Based on the problems in related technologies, this application provides an alignment method for photovoltaic modules that can be applied to electronic devices, including: mobile phones, tablets, wearable devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of electronic device. Figure 1 A schematic diagram illustrating the implementation process of a photovoltaic module alignment method provided for the purposes of this application is shown below. Figure 1 As shown, the alignment methods for photovoltaic modules include: Step S101: Based on the layout interface of the photovoltaic module, obtain the layout information of the target module identifier in the layout interface, wherein the layout information includes: position information and angle.

[0033] In this embodiment, the layout interface is a graphical interface for photovoltaic modules. It can be a layout diagram of photovoltaic modules obtained by taking pictures of actual photovoltaic modules and then identifying them in batches. The target component identifier is the photovoltaic module selected for alignment operations in the layout interface, which can be called the component frame. Depending on actual needs, all components in the entire layout interface or components in a specific area can be selected as the target component identifier. The layout information includes the position and angle information of the target component identifier. The position information is usually represented by coordinates (such as X and Y coordinates in a two-dimensional plane) to indicate the specific position of the component in the layout interface; the angle information indicates the rotation angle of the component relative to a reference direction (such as the horizontal direction).

[0034] In this embodiment of the application, the position information and angle information of the target component identifier can be read from the layout interface. Assuming that the layout interface is a two-dimensional graphical interface, the position of each component can be represented by coordinates (x, y) and the angle is represented by θ. The (x, y, θ) data of each target component identifier can be obtained.

[0035] Step S102: Cluster the target component identifiers based on the angles of the target component identifiers to obtain region angle clusters.

[0036] In this embodiment, the regional angle cluster is a group obtained by clustering the angles of the target component identifier. The purpose of clustering is to group components with similar angles into one category. In this way, the components in the same regional angle cluster are similar in angle, which facilitates further classification based on location information.

[0037] In this embodiment of the application, clustering algorithms, such as K-Means algorithm and DBSCAN algorithm, can be used to cluster the angles of the target component identifiers to obtain regional angle clusters.

[0038] Step S103: Based on the position information of the target component identifiers in each region angle cluster, perform re-clustering processing on the target component identifiers in each region angle cluster to obtain the local angle clusters in each region angle cluster.

[0039] In this embodiment, the local angle cluster is a group obtained by re-clustering based on the position information of the target component identifier in each regional angle cluster. The components in the same local angle cluster are not only similar in angle, but also relatively concentrated in position, which is more conducive to performing precise alignment operations.

[0040] In this embodiment, for each regional angle cluster, a clustering algorithm is used again to cluster them based on the location information of the target component identifiers. Similarly, the DBSCAN algorithm can be used to determine the appropriate number of clusters, grouping components with similar locations into the same local angle cluster. For example, the location information can be converted into a form suitable for clustering (e.g., converting two-dimensional coordinates into one-dimensional distance) before performing the clustering operation.

[0041] Step S104: Adjust the layout information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

[0042] In this embodiment, the angle of the target component identifier in each local angle cluster can be adjusted to the average angle of the target component identifier in the corresponding regional angle cluster. This ensures that the components in the same local angle cluster are more consistent in angle. Different adjustment strategies are used to adjust the position information according to the angle between the local angle cluster and the coordinate axis.

[0043] This application provides a photovoltaic module alignment method. Based on the photovoltaic module layout interface, layout information of target module identifiers in the layout interface is obtained. This layout information includes position information and angles. The target module identifiers are clustered based on their angles to obtain regional angle clusters. Based on the position information of the target module identifiers in each regional angle cluster, the target module identifiers in each regional angle cluster are further clustered to obtain local angle clusters within each regional angle cluster. The layout information of the target module identifiers in each local angle cluster is adjusted to align the target module identifiers within the same local angle cluster. Target module identifiers are grouped into angle clusters by angle through angle clustering, and local angle clusters are further subdivided within each angle cluster based on position information. Alignment is then performed on the local angle clusters to achieve automatic alignment of target module identifiers from multiple angles, making the aligned photovoltaic module layout diagram closer to the original physical grid of the photovoltaic module.

[0044] In some embodiments, step S104 can be implemented through the following steps: Step S1041: Adjust the angle of the target component identifier in each local angle cluster to the average angle of the target component identifier in the corresponding regional angle cluster.

[0045] In this embodiment of the application, the average angle of a local angle cluster can be calculated. For each local angle cluster, since it is a subset of the regional angle cluster, the angle values ​​of all target component identifiers in the local angle cluster are updated to the average angle value calculated from the corresponding regional angle cluster.

[0046] Step S1042: Adjust the position information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

[0047] In this embodiment, different strategies can be used to adjust the position information of the target component identifiers in each local angle cluster according to the angle between the local angle cluster and the coordinate axis, so as to align the target component identifiers in the same local angle cluster.

[0048] In some embodiments, step S1042 can be implemented by the following steps: Step S1: When the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is less than a preset angle threshold, clustering is performed based on the X coordinate value in the position information of the target component identifier in the target local angle cluster to obtain an X coordinate cluster, and the X coordinate value of each target component identifier in the same X coordinate cluster is adjusted to the same X coordinate value.

[0049] In this embodiment, the angle between the average angle of the target local angle cluster and the axis of the coordinate system is less than a preset angle threshold can be considered as parallel to the X-axis and parallel to the Y-axis. Here, the average angle of the target local angle cluster can be 0°, 90°, 180°, and 270°. Of course, if direction is not considered, when the angle between the average angle of the target local angle cluster and the axis of the coordinate system is less than the preset angle threshold, the average angle can be considered as 0° and 90°.

[0050] In this embodiment, the preset angle threshold is a pre-set angle value used to determine the angle relationship between the average angle value corresponding to the local angle cluster of the target and the direction of the coordinate axis. The preset angle threshold can be configured; for example, it can be configured to be less than 1°.

[0051] In this embodiment, all target component identifiers in the target local angle cluster can be traversed to obtain their X-coordinate values. The DBSCAN algorithm is then used to cluster these X-coordinate values, resulting in X-coordinate clusters. For each target component identifier within the same X-coordinate cluster, its X-coordinate value is adjusted to the average of all X-coordinate values ​​in that cluster.

[0052] Step S2: Cluster the target component identifiers in the target local angle clusters based on their Y coordinate values ​​to obtain Y coordinate clusters, and adjust the Y coordinate values ​​of each target component identifier in the same Y coordinate cluster to the same Y coordinate value.

[0053] In this embodiment, all target component identifiers in the target local angle cluster can be traversed to obtain their Y coordinate values. The Y coordinate values ​​are then clustered using the DBSCAN algorithm to obtain Y coordinate clusters. For each target component identifier in the same Y coordinate cluster, their Y coordinate values ​​are adjusted to the average value of all Y coordinate values ​​in that cluster.

[0054] The method provided in this application, by clustering and adjusting the Y and Y coordinates respectively, aligns the target component identifiers in the same local angle cluster in both the horizontal and vertical directions, greatly improving the neatness of the component arrangement.

[0055] In some embodiments, when the angle between the average angle value corresponding to the target local angle cluster and the X-axis direction of the coordinate axis is less than a preset angle threshold, i.e., the angle is 0 degrees or 180 degrees, after obtaining the X-coordinate cluster, the method further includes: Step S3: Calculate the first mean of the X coordinate values ​​of each target component identifier in each of the X coordinate clusters.

[0056] In this embodiment, the first mean value refers to the value obtained by averaging the X-coordinate values ​​of all target component identifiers within each X-coordinate cluster. This value represents the center position or average position of the X-coordinate cluster in the X-axis direction.

[0057] In this embodiment of the application, for each X-coordinate cluster, the X-coordinate values ​​of all target component identifiers within the cluster are collected, and the first mean is calculated using the formula for averaging.

[0058] Step S4: Calculate the first average distance between the target component identifiers in adjacent X coordinate clusters along the X-axis direction based on the first average.

[0059] In this embodiment of the application, the first distance mean is the average distance between target component identifiers in adjacent X coordinate clusters along the X-axis direction.

[0060] In this embodiment, among all X-coordinate clusters, adjacent X-coordinate clusters can be determined according to their positional order along the X-axis. For example, if there are three X-coordinate clusters, arranged in order along the X-axis as cluster A, cluster B, and cluster C, then cluster A is adjacent to cluster B, and cluster B is adjacent to cluster C. For two adjacent X-coordinate clusters, the corresponding target component identifiers are selected according to certain rules (such as the order of the target component identifiers in the cluster), and the difference between their X-coordinate values ​​is calculated to obtain the distance. The average distance between all corresponding target component identifiers can be calculated to obtain the first average distance.

[0061] Step S5: Based on the first average distance and the width of the target component identifier, obtain the first safe distance in the X-axis direction.

[0062] In this embodiment, the width of the target component identifier refers to the physical dimension of the target component (such as a photovoltaic module) in the X-axis direction. It is a fixed value used to determine the safety distance to be considered when adjusting the spacing between adjacent X-coordinate clusters. The first safety distance is a distance value calculated based on the average first distance and the width of the target component identifier. This distance is to ensure that the target component identifiers in adjacent X-coordinate clusters do not overlap after the spacing is adjusted, while maintaining a reasonable layout spacing. This avoids installation and maintenance problems caused by excessively small spacing, while also preventing wasted space due to excessively large spacing.

[0063] In this embodiment of the application, the maximum value between the first average distance and the width of the target component identifier can be used as the first safe distance in the X-axis direction.

[0064] Step S6: Adjust the spacing of the target component identifiers in the X-axis direction between adjacent X-coordinate clusters using the first safety distance.

[0065] In this embodiment, an X-coordinate cluster can be selected as the reference cluster, typically the leftmost or rightmost X-coordinate cluster. Starting from the reference cluster, the target distance between adjacent X-coordinate clusters and the reference cluster is calculated sequentially. For two adjacent X-coordinate clusters, the X-coordinate values ​​of all target component identifiers in the latter X-coordinate cluster are adjusted based on a first safety distance and a first average value of the target component identifiers in the current cluster.

[0066] After obtaining the Y coordinate family, the method further includes: Step S7: Calculate the second mean of the Y coordinate values ​​of each target component identifier in each Y coordinate cluster.

[0067] In this embodiment of the application, for all target component identifiers within each Y-coordinate cluster, their Y-coordinate values ​​are extracted and their arithmetic mean is calculated to obtain a second mean.

[0068] Step S8: Calculate the second average distance between target component identifiers in adjacent Y-coordinate clusters along the Y-axis direction based on the second average.

[0069] In this embodiment of the application, in the Y-axis direction, for components at corresponding positions in two adjacent Y-coordinate clusters, the difference in their Y-coordinates is calculated and averaged to obtain the second average distance.

[0070] Step S9: Based on the second average distance and the height of the target component identifier, obtain the second safe distance in the Y-axis direction.

[0071] In this embodiment of the application, the maximum value between the second average distance and the height of the target component identifier can be used as the second safe distance in the Y-axis direction.

[0072] Step S10: Adjust the spacing of the target component identifiers in the adjacent Y-coordinate clusters along the Y-axis direction using the second safety distance.

[0073] In this embodiment of the application, the positions of adjacent clusters are shifted with the second safety distance as the target, so that the spacing between clusters meets the requirements.

[0074] The method provided in this application embodiment can achieve neat arrangement of components in the Y-axis direction, while avoiding overlap and optimizing space utilization.

[0075] The following examples use the average angles of the target's local angle clusters as 0° and 180°. Figure 2 This application provides a flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters, as shown in the embodiments of this application. Figure 2As shown, the X-coordinate values ​​are clustered to obtain different clusters {Cx1, Cx2, ..., Cxk}. The x-coordinate of each bounding box within a cluster is taken as the mean of x. Based on the mean of x, the first mean distance x_dis between target component identifiers in the X-coordinate cluster is calculated, and a first safe distance x_diff = max(x_dis, width), where width is the width of the target component identifier, is taken. Using x_diff as the safe distance, the x-coordinates of each cluster are aligned. Then, the Y-coordinate values ​​are clustered to obtain different clusters {Cy1, Cy2, ..., Cyp}. The y-coordinate of each bounding box within a cluster is taken as the second mean of the Y-coordinate values. The second mean distance y_dis between target component identifiers in adjacent Y-coordinate clusters is calculated, and a second safe distance y_diff = max(y_dis, height), where height is the height of the target component identifier, is taken. Using y_diff as the distance, the y-coordinates of each cluster are aligned.

[0076] In some embodiments, when the angle between the average angle value corresponding to the target local angle cluster and the Y-axis direction of the coordinate axis is less than a preset angle threshold, i.e., when the average angle value corresponding to the target local angle cluster is 90° or 270°, after obtaining the X-coordinate cluster, the method includes: Calculate the third mean of the X coordinate values ​​of each target component identifier in each X coordinate cluster; calculate the third mean of the distance between target component identifiers in adjacent X coordinate clusters in the X-axis direction based on the third mean; obtain the third safety distance in the X-axis direction based on the third mean of the distance and the height of the target component identifier; adjust the spacing of target component identifiers in the X-axis direction between adjacent X coordinate clusters using the third safety distance.

[0077] The processing method in this application embodiment is similar to the processing method after obtaining the X coordinate cluster when the angle between the average angle value corresponding to the target local angle cluster and the X-axis direction of the coordinate axis is less than a preset angle threshold. The only difference is that when calculating the first safety distance, 0° and 180° are calculated using the width, while here, when calculating the third safety distance, 90° and 180° are calculated using the height of the target component identifier.

[0078] After obtaining the Y-coordinate cluster, the method further includes: Calculate the fourth mean of the Y coordinate values ​​of each target component identifier in each Y coordinate cluster; calculate the fourth mean of the distance between target component identifiers in adjacent Y coordinate clusters in the Y-axis direction based on the fourth mean; obtain the fourth safety distance in the Y-axis direction based on the fourth mean of the distance and the width of the target component identifier; adjust the spacing of target component identifiers in adjacent Y coordinate clusters in the Y-axis direction using the fourth safety distance.

[0079] The processing method in this application embodiment is similar to the processing method after obtaining the Y coordinate cluster when the angle between the average angle value corresponding to the target local angle cluster and the X-axis direction of the coordinate axis is less than a preset angle threshold. The only difference is that when calculating the second safety distance, 0° and 180° are calculated using the height of the target component identifier, while here, when calculating the fourth safety distance, 90° and 180° are calculated using the width of the target component identifier.

[0080] Taking the average angles corresponding to the local angle clusters of the target as 90° and 270° as examples, Figure 3 This application provides a flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters, as shown in the embodiments of this application. Figure 3 As shown, clustering is performed based on X-coordinate values ​​to obtain X-coordinate clusters {Cx1, Cx2, ..., Cxq}. The x-coordinate of each target component identifier within an X-coordinate cluster is taken as the mean of x, and the mean of the third distance x_dis between target component identifiers in the X-coordinate cluster is calculated based on the mean of x. A third safe distance x_diff = max(x_dis, height) is taken. Using x_diff as the safe distance, the x-coordinates of each cluster are aligned. Then, clustering is performed based on Y-coordinate values ​​to obtain different clusters {Cy1, Cy2, ..., Cyp}. The y-coordinate of each bounding box within a cluster is taken as the fourth mean of the Y-coordinate values. The mean of the fourth distance y_dis between target component identifiers in adjacent Y-coordinate clusters is calculated, and a safe distance y_diff = max(y_dis, width) is taken. Using y_diff as the distance, the y-coordinates of each cluster are aligned.

[0081] The following describes an alignment method provided in an embodiment of this application, using schematic diagrams illustrating changes in the layout interface. Figure 4 A schematic diagram illustrating a change in a layout interface provided in an embodiment of this application, as shown below. Figure 4 As shown in Figures a to h, Figure a is the layout interface, Figure b is the result of clustering the target component identifiers based on angles to obtain the regional angle cluster Cluster 0, and then the clustering is performed based on the location information to obtain Cluster 0A, Cluster 0B, Cluster 0C and Cluster 0D in Figure c. Then, the isolated target component identifiers are absorbed to obtain Figure d. Then, Cluster 0A is further clustered by X to obtain Figure e, and aligned to obtain Figure f. Cluster 0A is further clustered and aligned by Y to obtain Figure f. Finally, each local angle cluster Cluster 0B, Cluster 0C and Cluster 0D are aligned in the same way to obtain the final Figure h.

[0082] In some embodiments, step S104 may further include the following steps: Step S11: When the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is greater than a preset angle threshold, determine the angle reference line of the target local angle cluster, and calculate the first projection distance from each target component identifier in the target local angle cluster to the angle reference line. Based on the first projection distance, cluster the target component identifiers in the target local angle cluster to obtain reference angle clusters. Adjust the position information of the target component identifiers in each reference angle cluster so that the projection distance from the target component identifiers in the same reference angle cluster to the angle reference line is the same, and the spacing between the target component identifiers in adjacent reference angle clusters on the angle reference line is the same.

[0083] In this embodiment, if the angle between the average angle of the target local angle cluster and the axis of the coordinate system is greater than a preset angle threshold, it can be considered a target local angle cluster that is not 0° / 90°. The angle reference line is a straight line determined based on the average angle of the target local angle cluster, serving as the reference direction for component projection and adjustment. The first projection distance is the vertical distance from the target component identifier to the angle reference line, used to measure the component's offset in the reference direction. The reference angle cluster is a sub-cluster obtained by further clustering the target local angle clusters according to the first projection distance; components within the same reference angle cluster have similar projection positions on the angle reference line.

[0084] In this embodiment, a straight line can be constructed as a reference for projection and adjustment, using the direction of the average angle of the target local angle cluster as a benchmark. The target component identifier is projected onto the angle benchmark line, its vertical distance (first projection distance) is calculated, and clustering is performed based on this distance. To ensure that all components in the same benchmark angle cluster have the same projection distance to the angle benchmark line, and that adjacent clusters are evenly spaced on the benchmark line, the average of the first projection distances of all components in each benchmark angle cluster is calculated as the target projection distance for that cluster. Components within the cluster are translated so that their projection distances equal the target value, and the positions of adjacent clusters are adjusted so that their center-to-center distances on the benchmark line are equal.

[0085] Step S12: Determine the normal vector baseline of the target local angle cluster, and calculate the second projection distance from each target component identifier in the target local angle cluster to the normal vector baseline. Based on the second projection distance, cluster the target component identifiers in the target local angle cluster to obtain normal vector angle clusters. Adjust the position information of the target component identifiers in each normal vector angle cluster so that the projection distance from the target component identifiers in the same normal vector angle cluster to the normal vector baseline is the same, and the spacing between the target component identifiers in adjacent normal vector angle clusters on the normal vector baseline line is the same, wherein the normal vector baseline line is perpendicular to the angle baseline line.

[0086] In this embodiment, the normal vector reference line is a straight line perpendicular to the angle reference line, used to define the projection reference of the component in the vertical direction. The second projection distance is the vertical distance from the target component identifier to the normal vector reference line, used to measure the offset of the component in the normal direction. The normal vector angle cluster is a sub-cluster obtained by clustering the local angle clusters of the target according to the second projection distance. Components in the same normal vector angle cluster have similar projection positions in the normal direction.

[0087] In this embodiment of the application, the target component identifier is projected onto the normal vector baseline, its vertical distance (second projection distance) is calculated, and clustering is performed based on this distance.

[0088] In this embodiment, the positional information of the target component identifiers in each normal vector angle cluster is adjusted to ensure that the projection distance of the target component identifiers to the normal vector baseline is the same within the same normal vector angle cluster. This includes: for each normal vector angle cluster, calculating the average of the second projection distances of all its components as the target projection distance for that cluster; translating the components within the cluster so that their projection distances equal the target value; and adjusting the positions of adjacent clusters so that their center-to-center distances in the normal direction are equal.

[0089] The method provided in this application embodiment ensures that components are aligned in the tilt direction by performing two projection clustering operations (angular reference and normal vector reference), thereby eliminating local misalignment.

[0090] In some embodiments, step S11 can be implemented through the following steps: Step S111: Adjust the position information of the target component identifier in each of the reference angle clusters so that the adjusted position information of the target component identifier in the same reference angle cluster is the same as the projection distance of the angle reference line.

[0091] In this embodiment of the application, for each component, the vertical distance to the angular reference line is calculated. For all components within the same reference angle cluster, the average value of their projected distances is calculated. For each component, it is translated along a direction perpendicular to the angular reference line so that its projected distance is equal to the average value.

[0092] Step S112: Calculate the average fifth distance between target component identifiers in adjacent reference angle clusters along the angular reference line direction, and obtain the fifth safety distance along the angular reference line direction based on the average fifth distance and the height of the target component identifiers. Adjust the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters with the fifth safety distance so that the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters is the same.

[0093] In this embodiment, for each pair of adjacent reference angle clusters, the edge component of the cluster (such as the component closest to the other) is selected, the Euclidean distance between their projection points is calculated, and the average distance between all adjacent cluster pairs is calculated to obtain the fifth distance mean. The maximum value between the fifth distance mean and the height of the target component identifier can be determined as the fifth safety distance. Based on the fifth safety distance, the distance between the target component identifiers of adjacent reference angle clusters on the angle reference line is adjusted so that the distance between the target component identifiers of adjacent reference angle clusters on the angle reference line is the same.

[0094] The method provided in this application embodiment can adjust the position and distance based on a reference angle cluster to achieve layout alignment.

[0095] In some embodiments, step S12 can be implemented through the following steps: Step S121: Adjust the position information of the target component identifier in each of the normal vector angle clusters so that the adjusted position information of the target component identifier in the same normal vector angle cluster is the same as the projection distance of the normal vector baseline.

[0096] In this embodiment, for each component, the vertical distance from it to the normal vector baseline is calculated. For all components within the same normal vector angle cluster, the average value of their projected distances is calculated. For each component, it is translated along a direction perpendicular to the normal vector baseline so that its projected distance is equal to the average value.

[0097] Step S122: Calculate the average sixth distance between target component identifiers in adjacent normal vector angle clusters on the normal vector baseline, and obtain the sixth safety distance in the direction of the normal vector baseline based on the average sixth distance and the width of the target component identifier. Adjust the spacing of target component identifiers in the direction of the normal vector baseline between adjacent normal vector angle clusters with the sixth safety distance so that the spacing of target component identifiers in the normal vector baseline between adjacent normal vector angle clusters is the same.

[0098] In this embodiment, for each pair of adjacent normal vector angle clusters, the cluster edge component (such as the component closest to the other) is selected, and the Euclidean distance between their projection points is calculated. The average distance between all adjacent cluster pairs is calculated to obtain the fourth distance mean. The minimum value between the fourth distance mean and the width of the target component identifier can be determined as the fourth safety distance. Based on the fourth safety distance, the spacing of the target component identifiers on the angle reference line between adjacent reference angle clusters is adjusted so that the spacing of the target component identifiers on the angle reference line between adjacent reference angle clusters is the same.

[0099] In this embodiment, the position and distance can be adjusted based on the normal vector baseline to achieve layout alignment.

[0100] The following example illustrates how the angle between the average angle of a local angle cluster and the axis of the coordinate system is greater than a preset angle threshold, while other angles are illustrated in detail: Figure 5 This application provides a flowchart illustrating the process of adjusting the position information of target component identifiers in various local angle clusters, as shown in the embodiments of this application. Figure 5 As shown, calculate the angular reference line vector (cos_a, sin_a) of the angle cluster, where a is the angle of the angle cluster. Calculate the first projected distance from the center of the bounding box in each group of the cluster to the reference line. The formula for calculating the projected distance is as follows: , Figure 6 A schematic diagram illustrating the center, angular direction, and normal direction of a target component as provided in this application embodiment, as shown below. Figure 6 As shown in the figure, (x0, y0) is the center position of the target component, and the component angle is 'a'. The unit vector along the angular direction is (cos a, sin a), and the unit vector along the normal direction is (-sin a, cos a). The distance from (x0, y0) to the line containing the angular direction vector (cos a, sin a) is the projection of vector (x0, y0) onto its normal direction. According to the vector dot product formula, the formula for calculating the first projection distance is: The distance from point (x0, y0) to the line containing the normal vector (-sin a, cos a) is its projection in the angular direction. According to the vector dot product formula, it is as follows: ; in this way Distance clustering yields clusters of different baseline angles. Correct the x and y coordinates in the cluster to ensure that each box in the cluster is equidistant from the line (cos_a, sin_a).

[0101] After further clustering and alignment of the normal direction, according to the formula above, the second projection distance from the center of each component to the line containing the normal vector baseline is: ; according to After sorting, we get:

[0102] `current_dis` refers to the distance from the center of a component to the straight line. The distance from the secondary cluster to the straight line containing the angular direction (reference line) is then used to sort the components, obtaining the sorted component order and their distances to the reference line. This sorting yields the average fifth distance between target component identifiers in adjacent reference angular clusters. Based on this average fifth distance and the height of the target component identifier, the fifth safety distance in the angular reference line direction is obtained, i.e., updated along the normal direction, and the component center coordinates are... renew.

[0103] In this application, the fifth safety distance in the angular reference line direction is obtained based on the average fifth distance and the height of the target component identifier. This can be expressed as: s_diff = max(s_dis, height), where height is the height of the target component identifier. Using s_diff as the distance, the distance is aligned with the oblique angle cluster.

[0104] For the normal vector baseline, the normal vector baseline (sin a, cos a) of each cluster is calculated. The second projection distance from the center of each box to the normal vector baseline is calculated. Clustering is performed using the second projection distance, and n_dis is calculated. The sixth safety distance n_diff = max(n_dis, width), where width is the width of the target component identifier, is obtained. Using n_diff as the distance, the distance is aligned with the normal vector direction of the diagonal angle cluster.

[0105] The following section uses the identification of target components that are not at 0° and 90° as examples, and combines this with changes in the layout interface to introduce an alignment method provided in this application embodiment. Figure 7 A schematic diagram illustrating a change in a layout interface provided in an embodiment of this application, as shown below. Figure 7 As shown in Figures a to h, Figure a is the layout interface, Figure b is the clustering of target component identifiers based on angles to obtain the region angle cluster Cluster 0, and then the clustering is performed based on the location information to obtain Cluster 0A in Figure c. Then, the isolated target component identifiers are absorbed to obtain Figure d, and after absorption, Figure e is obtained. Then, Cluster 0A is aligned with the angle reference line to obtain Figure f, and then the normal vector reference line of Cluster 0A is aligned to obtain Figure g, and finally Figure h is obtained.

[0106] In some embodiments, after step S102, the method further includes: Step S105: If there is an isolated target component identifier, determine the initial target local angle cluster that intersects with the isolated target component identifier.

[0107] In this embodiment, an isolated target component is identified as an independent component that is not included in any local angle cluster (such as the orientation grouping of a photovoltaic module array) in the spatial layout. The initial target local angle cluster is a set of candidate clusters that have spatial intersection with the isolated component (such as projection overlap or proximity).

[0108] In this embodiment of the application, for each angle cluster, it is checked whether its bounding box (defined by the minimum / maximum coordinates of the components within the cluster) overlaps with the bounding box of the isolated component: if they overlap, the initial target angle cluster is obtained.

[0109] Step S106: Calculate the average value of the fifth distances between the target component identifiers in each of the initially selected target local angle clusters, and determine the first distance between the isolated target component identifier and the nearest target component identifier within the initially selected target local angle cluster.

[0110] In the embodiments of the present application, the average value of the fifth distances is the average of the distances between all pairs of components within the initially selected cluster, reflecting the compactness of the cluster. The first distance is the Euclidean distance between the isolated component and the nearest component within the initially selected cluster.

[0111] In the embodiments of the present application, for each initially selected cluster, traverse all pairs of components, calculate the distances and find the average, so as to obtain the average value of the fifth distances. For each initially selected cluster, use a spatial index (such as an R-tree) to quickly find the nearest component, and calculate the average value of the fifth distances between the isolated component and the nearest component. If the number of initially selected clusters is large, parallel processing can be used to improve efficiency.

[0112] Step S107: In the case where the first distance is less than or equal to the average value of the fifth distances of the target local angle clusters in the initially selected target local angle cluster, incorporate the isolated target component identifier into the target local angle cluster.

[0113] The method provided by the embodiments of the present application reduces the "holes" in the array by merging isolated components, making the component arrangement more compact. By reducing the independent processing of isolated components, subsequent layout optimization (such as spacing adjustment) can be performed on fewer clusters, improving the algorithm efficiency.

[0114] In the embodiments of the present application, the average distance of the target component identifiers in each angle cluster can be calculated. For each isolated target component identifier, check which angle clusters intersect within the neighborhood of the isolated target component identifier, calculate the distances d respectively, sort the distances from small to large to obtain {d1, d2,..., dk}. Calculate the average value dmin of the shortest distances between each target component identifier of the cluster to which the target component identifier belongs and other target component identifiers. Traverse {d1, d2,..., dk} and compare the distance d of each cluster with the dmin of each cluster. If d < dmin, then it belongs to this cluster Cj. If there is no matching situation, this isolated box still remains in the isolated box state, and the angle of the isolated box is set to the average angle of the cluster Cj.

[0115] In some embodiments, before step S101, the method further includes: Step S1011: Determine the component identifiers in the entire area of the layout interface as the target component identifiers, or Step S1012: Use the component identifiers in a partial area of the layout information as the target component identifiers.

[0116] In this embodiment of the application, step S1012 can be implemented through the following steps: in response to a user's selection operation on a portion of the layout interface, the component identifier in the portion of the interface is used as the target component identifier; or, in response to a user's operation to edit the layout information of the target component identifier in a portion of the layout interface, the component identifier in the portion of the interface is used as the target component identifier; or, when the number of local angle clusters with angle errors greater than the angle error threshold is less than a first preset number, the component identifier in the portion of the local angle clusters with angle errors greater than the angle error threshold is used as the target component identifier.

[0117] In this embodiment, using component identifiers in a portion of the layout information as target component identifiers can be considered local alignment optimization. This involves fine-tuning the alignment of only the user-selected area or local clusters without affecting the overall layout structure. In the layout, after the user drags or shifts a block, only that local area is aligned using a single click. Applicable scenarios: When a user edits some components and needs further alignment; or when a region has a large identification error and requires separate correction. The user-selected area forms a local cluster, and only angle and spatial clustering is performed on that cluster to rearrange the sub-region without affecting the global layout.

[0118] In some embodiments, step S1011 can be implemented by the following steps: If the number of local angle clusters where the angular error of a component identifier is greater than the angular error threshold or the position error is greater than the position error threshold is greater than a first preset number, the component identifiers in the entire area of ​​the layout interface are used as the target component identifiers; or, if the layout interface is determined to be an initial layout interface generated based on a photograph, the component identifiers in the entire area of ​​the layout interface are used as the target component identifiers; or, if the number of component identifiers edited by the user in the layout interface is greater than a second preset number, the component identifiers in the entire area of ​​the layout interface are used as the target component identifiers.

[0119] In this embodiment, if the component identifier in the entire area of ​​the layout interface is determined as the target component identifier, it can be considered as global alignment optimization. Global alignment optimization involves uniformly correcting the entire component layout to ensure consistent overall direction, row and column spacing, angles, and no misalignment. In the layout, all components are treated as a whole, and angle clustering, horizontal and vertical axis spacing correction, and position rearrangement are performed uniformly. Use cases include: after the initial layout is generated, global alignment needs to be completed in one go; maintaining overall consistency when the user does not perform extensive manual editing.

[0120] In some embodiments, the method further includes: calculating the average angle of the target component identifier in each local angle cluster, and calculating the root mean square error between the angle of the target component identifier in each local angle cluster and the corresponding average angle, to obtain the angle error of the target component identifier in each local angle cluster; or, calculating the location information of the cluster center of each local angle cluster, and calculating the root mean square error between the location information of the target component identifier in each local angle cluster and the corresponding cluster center, to obtain the location error of the target component identifier in each local angle cluster.

[0121] In this embodiment, the error is calculated for each cluster (a set of components distributed at the same angle and adjacent to each other, i.e., the local angle clusters obtained after angle clustering and distance clustering as described below), using the following two types of error indices: Angle error = the root mean square error between the angles of each component in the local angle cluster and the average angle of the local angle cluster, calculated as follows: ; Position error = the offset of the component center point relative to the theoretical reference line (px or mm).

[0122] The global alignment trigger condition can be expressed as: multiple clusters have significant angular differences (such as exceeding the preset angle threshold θ_global, for example, 5°); the position error of most clusters exceeds the threshold at the same time (such as Δpos_global ≥ 10); applicable scenarios: the initial layout generated by photo recognition, and after a large number of users drag and drop.

[0123] Local alignment is triggered when only a few clusters have angular or positional errors exceeding a threshold, or when the user actively selects / clicks a specified area for adjustment. Applicable scenarios: When the user's local editing or local detection error is large, but the overall layout is generally correct.

[0124] The method provided in this application embodiment can use DBSCAN to cluster all components according to the detected rotation angle, dividing them into 0°, 90° and other angle clusters, and processing them independently. This can effectively isolate components in different directions, avoid erroneous adjustment of objects with different angles by global alignment operations, and ensure that each cluster is optimized independently.

[0125] The method provided in this application performs DBSCAN clustering again on the X and Y axes for 0° and 90° clusters, respectively. The mean coordinates are calculated according to the cluster order, and the clusters are rearranged after setting the optimal interval based on the component board width / height and the distance between adjacent clusters. Clusters with spacing exceeding a threshold remain unchanged. This achieves equidistant alignment and non-overlapping in the row and column directions, allowing for both global one-click correction and rapid local fine-tuning. For non-0° / 90° clusters, they are first clustered and rearranged along their angular direction (baseline) using normal projection (–x·sinα + y·cosα), and then the process is repeated along the tangent direction (x·cosα + y·sinα). This ensures precise alignment even with arbitrary diagonal arrangements, achieving a height consistency with the "grid-like" or "linear" layout on the physical board.

[0126] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0127] According to the foregoing embodiments, this application provides an alignment device for photovoltaic modules. The various modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0128] This application provides an alignment device for photovoltaic modules. Figure 8 This is a schematic diagram of the structure of a photovoltaic module alignment device provided in an embodiment of this application, as shown below. Figure 8 As shown, the photovoltaic module alignment device 700 includes: The acquisition module 701 is used to acquire layout information of the target component identifier in the layout interface based on the layout interface of the photovoltaic module, wherein the layout information includes: position information and angle; The first clustering module 702 is used to perform clustering processing on the target component identifiers based on the angles of the target component identifiers to obtain region angle clusters; The second clustering module 703 is used to perform re-clustering processing on the target component identifiers in each region angle cluster based on the position information of the target component identifiers in each region angle cluster, so as to obtain the local angle clusters in each region angle cluster. The adjustment module 704 is used to adjust the layout information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

[0129] In some embodiments, the adjustment module 704 includes: The first adjustment unit is used to adjust the angle of the target component in each local angle cluster to the average angle of the target component in the corresponding regional angle cluster. The second adjustment unit is used to adjust the position information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

[0130] In some embodiments, the second adjustment unit includes: The first adjustment subunit is used to cluster the X coordinate values ​​based on the position information of the target component identifiers in the target local angle cluster when the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is less than a preset angle threshold, to obtain an X coordinate cluster, and to adjust the X coordinate values ​​of the target component identifiers in the same X coordinate cluster to the same X coordinate value. The second adjustment subunit is used to cluster based on the Y coordinate value of the target component identifier in the target local angle cluster to obtain a Y coordinate cluster, and adjust the Y coordinate value of each target component identifier in the same Y coordinate cluster to the same Y coordinate value.

[0131] In some embodiments, when the angle between the average angle value corresponding to the target local angle cluster and the X-axis direction of the coordinate axis is less than a preset angle threshold, after obtaining the X-coordinate cluster, the second adjustment unit further includes: The third adjustment subunit is used to calculate the first average value of the X coordinate values ​​of each target component identifier in each X coordinate cluster; calculate the first average distance between target component identifiers in adjacent X coordinate clusters in the X-axis direction based on the first average value; obtain a first safe distance in the X-axis direction based on the first average distance and the width of the target component identifier; and adjust the spacing of target component identifiers in the X-axis direction between adjacent X coordinate clusters with the first safe distance.

[0132] In some embodiments, after obtaining the Y-coordinate cluster, the second adjustment unit further includes: The fourth adjustment subunit is used to calculate the second average value of the Y coordinate value of each target component identifier in each Y coordinate cluster; calculate the second average distance between target component identifiers in adjacent Y coordinate clusters in the Y axis direction based on the second average value; obtain the second safety distance in the Y axis direction based on the second average distance and the height of the target component identifier; and adjust the spacing of target component identifiers in adjacent Y coordinate clusters in the Y axis direction with the second safety distance.

[0133] In some embodiments, obtaining the first safe distance in the X-axis direction based on the first average distance and the width of the target component identifier includes: The maximum value between the first average distance and the width of the target component identifier is used as the first safe distance in the X-axis direction.

[0134] In some embodiments, obtaining the second safe distance in the Y-axis direction based on the second average distance and the height of the target component identifier includes: The maximum value between the average of the second distance and the height of the target component identifier is taken as the second safe distance in the X-axis direction.

[0135] In some embodiments, when the angle between the average angle value corresponding to the target local angle cluster and the Y-axis direction of the coordinate axis is less than a preset angle threshold, after obtaining the X-coordinate cluster, the second adjustment unit further includes: The fifth adjustment subunit is used to calculate the third average value of the X coordinate values ​​of each target component identifier in each X coordinate cluster; calculate the third average distance between target component identifiers in adjacent X coordinate clusters in the X-axis direction based on the third average value; obtain the third safety distance in the X-axis direction based on the third average distance and the height of the target component identifier; and adjust the spacing of target component identifiers in the X-axis direction between adjacent X coordinate clusters using the third safety distance. After obtaining the Y-coordinate cluster, the second adjustment unit further includes: The sixth adjustment subunit is used to calculate the fourth mean value of the Y coordinate values ​​of each target component identifier in each Y coordinate cluster; calculate the fourth mean value of the distance between target component identifiers in adjacent Y coordinate clusters in the Y axis direction based on the fourth mean value; obtain the fourth safety distance in the Y axis direction based on the fourth mean value and the width of the target component identifier; and adjust the spacing of target component identifiers in adjacent Y coordinate clusters in the Y axis direction with the fourth safety distance.

[0136] In some embodiments, obtaining the third safety distance in the X-axis direction based on the third distance mean and the height of the target component identifier includes: The maximum value between the average third distance and the height of the target component identifier is taken as the third safety distance in the X-axis direction; The maximum value between the average of the fourth distance and the width of the target component identifier is taken as the fourth safety distance in the Y-axis direction.

[0137] In some embodiments, the second adjustment unit includes: The fifth adjustment subunit is used to determine the angle reference line of the target local angle cluster when the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is greater than a preset angle threshold, and to calculate the first projection distance from each target component identifier in the target local angle cluster to the angle reference line. Based on the first projection distance, the target component identifiers in the target local angle cluster are clustered to obtain reference angle clusters. The position information of the target component identifiers in each reference angle cluster is adjusted so that the projection distance from the target component identifiers in the same reference angle cluster to the angle reference line is the same, and the spacing between the target component identifiers in adjacent reference angle clusters on the angle reference line is the same. The sixth adjustment subunit is used to determine the normal vector baseline of the target local angle cluster, calculate the second projection distance from each target component identifier in the target local angle cluster to the normal vector baseline, cluster the target component identifiers in the target local angle cluster based on the second projection distance to obtain normal vector angle clusters, and adjust the position information of the target component identifiers in each normal vector angle cluster so that the projection distance from the target component identifiers in the same normal vector angle cluster to the normal vector baseline is the same, and the spacing between the target component identifiers in adjacent normal vector angle clusters on the normal vector baseline line is the same, wherein the normal vector baseline line is perpendicular to the angle baseline line.

[0138] In some embodiments, adjusting the position information of the target component identifiers in each reference angle cluster to ensure that the projection distance of the target component identifiers in the same reference angle cluster to the angle reference line is the same, and the spacing between the target component identifiers in adjacent reference angle clusters on the angle reference line is the same, includes: Adjust the position information of the target component identifier in each of the reference angle clusters so that the adjusted position information of the target component identifier in the same reference angle cluster is the same as the projection distance of the angle reference line; Calculate the average fifth distance between target component identifiers in adjacent reference angle clusters along the angular reference line direction, and obtain a fifth safety distance along the angular reference line direction based on the average fifth distance and the height of the target component identifiers. Adjust the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters with the fifth safety distance so that the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters is the same.

[0139] In some embodiments, adjusting the position information of the target component identifiers in each normal vector angle cluster to ensure that the projection distance of the target component identifiers in the same normal vector angle cluster to the normal vector reference line is the same, and the spacing of the target component identifiers on the normal vector reference line between adjacent normal vector angle clusters is the same, includes: Adjust the position information of the target component identifier in each of the normal vector angle clusters so that the adjusted position information of the target component identifier in the same normal vector angle cluster is the same as the projection distance of the normal vector baseline. Calculate the average sixth distance between target component identifiers in adjacent normal vector angle clusters on the normal vector baseline, and obtain a sixth safety distance in the direction of the normal vector baseline based on the average sixth distance and the width of the target component identifier. Adjust the spacing of target component identifiers in the direction of the normal vector baseline between adjacent normal vector angle clusters with the sixth safety distance so that the spacing of target component identifiers in the normal vector baseline between adjacent normal vector angle clusters is the same.

[0140] In some embodiments, the photovoltaic module alignment device further includes: An adsorption mode is used to determine, in the presence of isolated target component identifiers, a preliminary target local angle cluster intersecting with the isolated target component identifier; calculate the average fifth distance between target component identifiers in each of the preliminary target local angle clusters, and determine a first distance between the isolated target component identifier and the nearest target component identifier in the preliminary target local angle cluster; if the first distance is less than or equal to the average fifth distance of the target local angle clusters in the preliminary target local angle clusters, the isolated target component identifier is incorporated into the target local angle cluster.

[0141] In some embodiments, the photovoltaic module alignment device further includes: The first determining module is used to determine the component identifiers in the entire area of ​​the layout interface as the target component identifier, or... The second determining module is used to use the component identifier in a certain area of ​​the layout information as the target component identifier.

[0142] In some embodiments, the second determining module includes: In response to a user's selection operation on a portion of the layout interface, the component identifier in the portion of the interface is used as the target component identifier; Alternatively, in response to a user's operation of editing the layout information of the target component identifier in a certain area of ​​the layout interface, the component identifier in the certain area is used as the target component identifier; Alternatively, if the number of local angle clusters with angle errors greater than the angle error threshold is less than a first preset number, the component identifier in the part of the area corresponding to the local angle cluster with angle errors greater than the angle error threshold shall be used as the target component identifier.

[0143] In some embodiments, the first determining module includes: If the number of local angle clusters in which the angular error of the component identifier is greater than the angular error threshold or the position error is greater than the position error threshold is greater than the first preset number, the component identifier in the entire area of ​​the layout interface shall be used as the target component identifier. Alternatively, if it is determined that the layout interface is an initial layout interface generated based on a photograph, the component identifiers in the entire area of ​​the layout interface are used as the target component identifiers. Alternatively, if it is determined that the number of component identifiers edited by the user in the layout interface is greater than a second preset number, the component identifiers in the entire area of ​​the layout interface shall be used as the target component identifiers.

[0144] In some embodiments, the photovoltaic module alignment device further includes: The error calculation mode is used to calculate the average angle of the target component identifier in each local angle cluster, and calculate the root mean square error between the angle of the target component identifier in each local angle cluster and the corresponding average angle, so as to obtain the angle error of the target component identifier in each local angle cluster; or, calculate the position information of the cluster center of each local angle cluster, and calculate the root mean square error between the position information of the target component identifier in each local angle cluster and the corresponding cluster center, so as to obtain the position error of the target component identifier in each local angle cluster.

[0145] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0146] In addition, the photovoltaic module alignment device shown above can be a software unit, a hardware unit, or a combination of software and hardware. It can also be integrated into electronic devices as an independent mount, or exist as an independent terminal device.

[0147] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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 as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0148] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device 3 in this embodiment may include: at least one processor 30 ( Figure 9 Only one processor 30, memory 31, and computer program 32 stored in memory 31 and executable on at least one processor 30 are shown. When the processor 30 executes the computer program 32, it implements the steps in any of the above method embodiments, or the processor 30 executes the computer program 32 to implement the functions of each module / unit in the above device or system embodiments.

[0149] For example, computer program 32 may be divided into one or more modules / units, one or more of which are stored in memory 31 and executed by processor 30 to complete this application. One or more modules / units may be a series of computer program 32 instruction segments capable of performing a specific function, which describe the execution process of computer program 32 in electronic device 3.

[0150] This application also provides a computer-readable storage medium storing a computer program 32, which, when executed by a processor 30, implements the steps described in the above-described method embodiments.

[0151] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0152] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program 32 instructing related hardware. The computer program 32 can be stored in a computer-readable storage medium, and when executed by the processor 30, it can implement the steps of the various method embodiments described above. The computer program 32 includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0153] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0154] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0155] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or 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 through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0156] 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.

[0157] The above-described 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, and should all be included within the protection scope of this application.

Claims

1. A method for aligning photovoltaic modules, characterized in that, include: Based on the layout interface of photovoltaic modules, obtain the layout information of the target module identifier in the layout interface, wherein the layout information includes: position information and angle; Based on the angle of the target component identifier, clustering is performed on the target component identifier to obtain region angle clusters; Based on the location information of the target component identifiers in each region angle cluster, the target component identifiers in each region angle cluster are re-clustered to obtain the local angle clusters in each region angle cluster. Adjust the layout information of the target component identifiers in each local angle cluster to align the target component identifiers within the same local angle cluster.

2. The method according to claim 1, characterized in that, The step of adjusting the layout information of the target component identifiers in each local angle cluster to align the target component identifiers within the same local angle cluster includes: Adjust the angle of the target component in each local angle cluster to the average angle of the target component in the corresponding regional angle cluster; Adjust the position information of the target component identifiers in each local angle cluster to align the target component identifiers in the same local angle cluster.

3. The method according to claim 2, characterized in that, The step of adjusting the position information of the target component identifiers in each local angle cluster to align the target component identifiers within the same local angle cluster includes: When the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is less than a preset angle threshold, clustering is performed based on the X coordinate value in the position information of the target component identifier in the target local angle cluster to obtain an X coordinate cluster, and the X coordinate value of each target component identifier in the same X coordinate cluster is adjusted to the same X coordinate value. Clustering is performed based on the Y-coordinate values ​​of the target component identifiers in the target local angle cluster to obtain Y-coordinate clusters. The Y-coordinate values ​​of the target component identifiers in the same Y-coordinate cluster are then adjusted to the same Y-coordinate value.

4. The method according to claim 3, characterized in that, When the angle between the average angle value corresponding to the target local angle cluster and the X-axis direction of the coordinate axis is less than a preset angle threshold, after obtaining the X-coordinate cluster, the method includes: Calculate the first mean of the X-coordinate values ​​of each target component identifier in each X-coordinate cluster; calculate the first mean of the distances between target component identifiers in adjacent X-coordinate clusters in the X-axis direction based on the first mean; obtain a first safe distance in the X-axis direction based on the first mean of the distances and the width of the target component identifiers; adjust the spacing of target component identifiers in the X-axis direction between adjacent X-coordinate clusters using the first safe distance; After obtaining the Y-coordinate cluster, the method further includes: Calculate the second mean of the Y coordinate values ​​of each target component identifier in each Y coordinate cluster; calculate the second mean of the distance between target component identifiers in adjacent Y coordinate clusters in the Y axis direction based on the second mean; obtain the second safety distance in the Y axis direction based on the second mean of the distance and the height of the target component identifier; adjust the spacing of target component identifiers in adjacent Y coordinate clusters in the Y axis direction with the second safety distance.

5. The method according to claim 4, characterized in that, The step of obtaining the first safe distance in the X-axis direction based on the first average distance and the width of the target component identifier includes: The maximum value between the first average distance and the width of the target component identifier is taken as the first safe distance in the X-axis direction; The process of obtaining the second safe distance in the Y-axis direction based on the second average distance and the height of the target component identifier includes: The maximum value between the average of the second distance and the height of the target component identifier is taken as the second safe distance in the X-axis direction.

6. The method according to claim 3, characterized in that, When the angle between the average angle value corresponding to the target local angle cluster and the Y-axis direction of the coordinate axis is less than a preset angle threshold, after obtaining the X-coordinate cluster, the method includes: Calculate the third mean of the X coordinate values ​​of each target component identifier in each X coordinate cluster; calculate the third mean of the distance between target component identifiers in adjacent X coordinate clusters in the X-axis direction based on the third mean; obtain the third safety distance in the X-axis direction based on the third mean of the distance and the height of the target component identifier; adjust the spacing of target component identifiers in the X-axis direction between adjacent X coordinate clusters using the third safety distance; After obtaining the Y-coordinate cluster, the method further includes: Calculate the fourth mean of the Y coordinate values ​​of each target component identifier in each Y coordinate cluster; calculate the fourth mean of the distance between target component identifiers in adjacent Y coordinate clusters in the Y-axis direction based on the fourth mean; obtain the fourth safety distance in the Y-axis direction based on the fourth mean of the distance and the width of the target component identifier; adjust the spacing of target component identifiers in adjacent Y coordinate clusters in the Y-axis direction using the fourth safety distance.

7. The method according to claim 6, characterized in that, The process of obtaining the third safe distance in the X-axis direction based on the average third distance and the height of the target component identifier includes: The maximum value between the average third distance and the height of the target component identifier is taken as the third safety distance in the X-axis direction; The maximum value between the average of the fourth distance and the width of the target component identifier is taken as the fourth safety distance in the Y-axis direction.

8. The method according to any one of claims 2 to 7, characterized in that, The step of adjusting the layout information of the target component identifiers in each local angle cluster to align the target component identifiers within the same local angle cluster includes: When the angle between the average angle value corresponding to the target local angle cluster and the axis direction of the coordinate axis is greater than a preset angle threshold, the angle reference line of the target local angle cluster is determined, and the first projection distance from each target component identifier in the target local angle cluster to the angle reference line is calculated. Based on the first projection distance, the target component identifiers in the target local angle cluster are clustered to obtain reference angle clusters. The position information of the target component identifiers in each reference angle cluster is adjusted so that the projection distance from the target component identifiers in the same reference angle cluster to the angle reference line is the same, and the spacing between the target component identifiers in adjacent reference angle clusters on the angle reference line is the same. The normal vector baseline of the target local angle cluster is determined, and the second projection distance from each target component identifier in the target local angle cluster to the normal vector baseline is calculated. Based on the second projection distance, the target component identifiers in the target local angle cluster are clustered to obtain normal vector angle clusters. The position information of the target component identifiers in each normal vector angle cluster is adjusted so that the projection distance from the target component identifiers in the same normal vector angle cluster to the normal vector baseline is the same, and the spacing between the target component identifiers in adjacent normal vector angle clusters on the normal vector baseline line is the same, wherein the normal vector baseline line is perpendicular to the angle baseline line.

9. The method according to claim 8, characterized in that, The step of adjusting the position information of the target component identifiers in each reference angle cluster to ensure that the projection distance of the target component identifiers in the same reference angle cluster to the angle reference line is the same, and the spacing of the target component identifiers on the angle reference line between adjacent reference angle clusters is the same, includes: Adjust the position information of the target component identifier in each of the reference angle clusters so that the adjusted position information of the target component identifier in the same reference angle cluster is the same as the projection distance of the angle reference line; Calculate the average fifth distance between target component identifiers in adjacent reference angle clusters along the angular reference line direction, and obtain a fifth safety distance along the angular reference line direction based on the average fifth distance and the height of the target component identifiers. Adjust the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters with the fifth safety distance so that the spacing of target component identifiers on the angular reference line between adjacent reference angle clusters is the same.

10. The method according to claim 8, characterized in that, The adjustment of the position information of the target component identifiers in each normal vector angle cluster, so that the projection distance of the target component identifiers in the same normal vector angle cluster to the normal vector reference line is the same, and the spacing of the target component identifiers on the normal vector reference line between adjacent normal vector angle clusters is the same, includes: Adjust the position information of the target component identifier in each of the normal vector angle clusters so that the adjusted position information of the target component identifier in the same normal vector angle cluster is the same as the projection distance of the normal vector baseline. Calculate the average sixth distance between target component identifiers in adjacent normal vector angle clusters on the normal vector baseline, and obtain a sixth safety distance in the direction of the normal vector baseline based on the average sixth distance and the width of the target component identifier. Adjust the spacing of target component identifiers in the direction of the normal vector baseline between adjacent normal vector angle clusters with the sixth safety distance so that the spacing of target component identifiers in the normal vector baseline between adjacent normal vector angle clusters is the same.

11. The method according to any one of claims 1 to 7, characterized in that, The method further includes: In the case of isolated target component identifiers, determine the initial target local angle clusters that intersect with the isolated target component identifiers; Calculate the average fifth distance between target component identifiers in each of the initial target local angle clusters, and determine the first distance between the isolated target component identifier and the nearest target component identifier in the initial target local angle cluster; If the first distance is less than or equal to the average fifth distance of the target local angle cluster in the initially selected target local angle cluster, the isolated target component is identified and incorporated into the target local angle cluster.

12. The method according to any one of claims 1 to 7, characterized in that, The method further includes: The component identifiers in the entire area of ​​the layout interface are determined as the target component identifiers, or... The component identifier in a portion of the layout information is used as the target component identifier.

13. The method according to claim 12, characterized in that, The step of using the component identifier in a portion of the layout information as the target component identifier includes: In response to a user's selection operation on a portion of the layout interface, the component identifier in the portion of the interface is used as the target component identifier; Alternatively, in response to a user's operation of editing the layout information of the target component identifier in a certain area of ​​the layout interface, the component identifier in the certain area is used as the target component identifier; Alternatively, if the number of local angle clusters with angle errors greater than the angle error threshold is less than a first preset number, the component identifier in the part of the area corresponding to the local angle cluster with angle errors greater than the angle error threshold shall be used as the target component identifier.

14. The method according to claim 12, characterized in that, The step of determining the component identifier in the entire area of ​​the layout interface as the target component identifier includes: If the number of local angle clusters in which the angular error of the component identifier is greater than the angular error threshold or the position error is greater than the position error threshold is greater than the first preset number, the component identifier in the entire area of ​​the layout interface shall be used as the target component identifier. Alternatively, if it is determined that the layout interface is an initial layout interface generated based on a photograph, the component identifiers in the entire area of ​​the layout interface are used as the target component identifiers. Alternatively, if it is determined that the number of component identifiers edited by the user in the layout interface is greater than a second preset number, the component identifiers in the entire area of ​​the layout interface shall be used as the target component identifiers.

15. The method according to claim 14, characterized in that, The method further includes: Calculate the average angle of the target component identifier in each local angle cluster, and calculate the root mean square error between the angle of the target component identifier in each local angle cluster and the corresponding average angle to obtain the angle error of the target component identifier in each local angle cluster. Alternatively, calculate the location information of the cluster center of each local angle cluster, and calculate the mean square error between the location information of the target component identifier in each local angle cluster and the corresponding cluster center to obtain the location error of the target component identifier in each local angle cluster.

16. An alignment device for photovoltaic modules, characterized in that, include: The acquisition module is used to acquire layout information of the target component identifier in the layout interface based on the layout interface of the photovoltaic module, wherein the layout information includes: position information and angle; The first clustering module is used to cluster the target component identifiers based on the angle of the target component identifiers to obtain region angle clusters; The second clustering module is used to re-cluster the target component identifiers in each region angle cluster based on the location information of the target component identifiers in each region angle cluster, so as to obtain the local angle clusters in each region angle cluster. The adjustment module is used to adjust the layout information of the target component identifiers in each local angle cluster so that the target component identifiers in the same local angle cluster are aligned.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 16.

18. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 16.