Photovoltaic string shadow shielding detection method, device, equipment, medium and product

By acquiring string data of photovoltaic (PV) modules, especially orientation information, and utilizing the axial attention layer in the target shading detection model, the accuracy problem of PV module shading detection is solved, improving the accuracy and adaptability of detection, and making it suitable for various complex installation environments.

CN121744035APending Publication Date: 2026-03-27四川智链信达数字能源科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In distributed photovoltaic power generation systems, the shading problem of photovoltaic strings is complex and hidden, affecting power generation performance, potentially causing hot spot effects and threatening string safety. Existing technologies struggle to accurately detect shading.

Method used

By acquiring string data of photovoltaic modules, especially orientation information, a target occlusion detection model is used to detect shading. The model includes a target axis attention layer to improve detection accuracy.

Benefits of technology

It improves the accuracy of shading detection for photovoltaic strings, avoids the degradation of power generation performance and potential damage caused by shading, and is suitable for a variety of complex installation environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121744035A_ABST
    Figure CN121744035A_ABST
Patent Text Reader

Abstract

The invention relates to a photovoltaic string shadow shielding detection method, device and equipment, a medium and a product. The method comprises the following steps: acquiring string data of a target photovoltaic string, wherein the string data comprises the orientation of the target photovoltaic string; and inputting the string data of the target photovoltaic string into a target shielding detection model to obtain a shadow shielding result of the target photovoltaic string, the target shielding detection model comprising the target axial attention layer. By adopting the method, the accuracy of the shadow shielding result of the target photovoltaic string can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of photovoltaic power generation technology, and in particular to a method, apparatus, equipment, medium and product for detecting shading of photovoltaic strings. Background Technology

[0002] Photovoltaic power generation is a renewable energy method that converts solar energy into electrical energy based on the photovoltaic effect. The power generation efficiency of photovoltaic strings in a distributed photovoltaic power generation system is mainly affected by solar irradiance; higher irradiance results in a larger operating current, and consequently, higher power generation performance. However, shading of the photovoltaic strings significantly impacts the solar irradiance received by them, thus affecting their power generation performance.

[0003] Because the installation environment of distributed photovoltaic power generation systems is not uniform, the problem of shading of photovoltaic strings is more complex and hidden than that of centralized photovoltaic systems. This is one of the core reasons that restricts the photovoltaic power generation performance of photovoltaic strings. This will not only have a long-term impact on the operating current of photovoltaic strings, but may even cause a "hot spot effect" in severe cases, which may burn out the photovoltaic strings and cause irreversible losses. Summary of the Invention

[0004] Therefore, it is necessary to provide a photovoltaic string shading detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of shading results for target photovoltaic strings in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for detecting shading of photovoltaic strings, including:

[0006] Obtain string data of the target photovoltaic string, including the orientation of the target photovoltaic string;

[0007] The string data of the target photovoltaic string is input into the target shading detection model to obtain the shadow shading result of the target photovoltaic string. The target shading detection model includes a target axial attention layer.

[0008] Secondly, this application also provides a photovoltaic string shading detection device, comprising:

[0009] The acquisition module is used to acquire string data of the target photovoltaic string, including the orientation of the target photovoltaic string;

[0010] The input module is used to input the string data of the target photovoltaic string into the target shading detection model to obtain the shading result of the target photovoltaic string. The target shading detection model includes a target axial attention layer.

[0011] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement some or all of the steps described in any method of the first aspect of the embodiments of this application.

[0012] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements some or all of the steps described in any method of the first aspect of the embodiments of this application.

[0013] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements some or all of the steps described in any method of the first aspect of the embodiments of this application.

[0014] The aforementioned photovoltaic (PV) string shading detection method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire string data of a target PV string, including the orientation of the target PV string; input the string data of the target PV string into a target shading detection model to obtain the shading result of the target PV string, the target shading detection model including a target axial attention layer. By employing the PV string shading detection method provided in this application embodiment, since the string data includes the orientation of the target PV string and the target shading detection model includes a target axial attention layer, the accuracy of the shading result of the target PV string can be improved. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is an application environment diagram of a photovoltaic string shading detection method in one embodiment;

[0017] Figure 2 This is a flowchart illustrating a photovoltaic string shading detection method in one embodiment;

[0018] Figure 3 This is a schematic diagram of the structure of the initial gated loop layer in one embodiment;

[0019] Figure 4 This is a flowchart illustrating a photovoltaic string shading detection method in another embodiment;

[0020] Figure 5 This is a structural block diagram of a photovoltaic string shading detection device in one embodiment;

[0021] Figure 6 This is an internal structural diagram of a computer device in one embodiment;

[0022] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0024] The photovoltaic string shading detection method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0025] In one exemplary embodiment, such as Figure 2 As shown, a method for detecting shading of photovoltaic strings is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps 202 to 204. Wherein:

[0026] Step 202: Obtain string data of the target photovoltaic string, including the orientation of the target photovoltaic string.

[0027] A photovoltaic (PV) string is the smallest DC electrical unit in a photovoltaic (PV) power generation system, consisting of multiple PV modules connected in series. The output voltage across the PV string is the sum of the voltages of each PV module, and the current across the PV string is the same as the current of the PV module with the smallest output capacity among the multiple PV modules.

[0028] The target photovoltaic string refers to a photovoltaic string that needs to be detected by the target shading detection model to determine whether it is shaded by a shadow.

[0029] The orientation of the target photovoltaic (PV) string is determined by the time deviation between the target PV string's maximum power point time and 12:00 noon. The maximum power point time of the target PV string refers to the Beijing time or the local true solar time at the location where the target PV string is installed, corresponding to the time when the output power of the target PV string reaches its maximum value within a day.

[0030] Orientation, including east, west, and south, is a core scene feature indicating the location of the target photovoltaic (PV) string. The patterns of illumination variation differ significantly depending on the orientation of the target PV string. Therefore, by learning the correlation between orientation and shadow occlusion results, the target occlusion detection model can be adapted to shadow occlusion judgment in various complex scenes.

[0031] For example, on the same day, the impact of shading on a west-facing photovoltaic string is less during midday and more during the evening. Therefore, incorporating orientation into the string data allows the target shading detection model to specifically learn based on the correlation between orientation and shading results, thus obtaining more accurate shading results.

[0032] For example, the time deviation between the maximum power point time of the target photovoltaic string and 12:00 noon can be expressed as:

[0033] (1)

[0034] Where Δt represents the time deviation, MPP t This indicates the time of maximum power point of the target photovoltaic string; when Δt < -15min, the target photovoltaic string faces east; when Δt > 15min, the target photovoltaic string faces west; when -15min < Δt < 15min, the target photovoltaic string faces south.

[0035] Optionally, the orientation of the target photovoltaic string can be marked using an encoding method, such as one-hot encoding. For example, an orientation of 0 or 001 indicates an east-facing orientation, 1 or 010 indicates a west-facing orientation, and 2 or 100 indicates a south-facing orientation.

[0036] Optionally, the string data of the target photovoltaic string is obtained by detecting at fixed time intervals within a preset time window. That is, the string data of the target photovoltaic string may include data from a first target number of consecutive time steps within the preset time window. For example, if the string data of the target photovoltaic string is obtained by detecting every 5 minutes within 30 minutes, the preset time window length can be 30 minutes, and the first target number can be 6.

[0037] Optionally, the last time step of the string data of the target photovoltaic string can be the time step closest to the current time node. For example, if the preset time window length is 30 minutes and the current time node is 15:00, then the string data of the target photovoltaic string is collected from 14:30 to 15:00.

[0038] With a preset time window length of 30 minutes, the impact of short-term fluctuations caused by a short preset time window length can be avoided. At the same time, it can adapt to objects that only cause shadow occlusion for a specific period of time and for a short duration, such as utility poles.

[0039] Step 204: Input the string data of the target photovoltaic string into the target shading detection model to obtain the shadow shading result of the target photovoltaic string. The target shading detection model includes a target axial attention layer.

[0040] The target shading detection model refers to a model that can determine whether a target photovoltaic (PV) string is shaded based on its string data. Its input is the string data of the target PV string, and its output is the shading result of the target PV string. This target shading detection model is a pre-optimized shading detection model.

[0041] The shading result of the target photovoltaic string indicates whether the target photovoltaic string is shaded or not.

[0042] Optionally, the output of the target occlusion detection model can be 0 or 1. An output of 0 indicates that the target photovoltaic string is not occluded by shadows, while an output of 1 indicates that the target photovoltaic string is occluded by shadows.

[0043] When the string data of the target photovoltaic string corresponds to a preset time window length, "the target photovoltaic string is not shaded" means that the target photovoltaic string is not shaded within the preset time window length, and "the target photovoltaic string is shaded" means that the target photovoltaic string is shaded within the preset time window length.

[0044] Optionally, the target photovoltaic string being shaded means that the target photovoltaic string is continuously shaded within a preset time window. That is to say, if it is not continuously shaded within the preset time window, it is considered not to be shaded.

[0045] The target axis attention layer refers to the self-attention calculation mechanism performed on a single designated axis of the string data of the target photovoltaic string in the target occlusion detection model, while the data corresponding to other axes not on this designated axis are all folded into a batch-dimensional composition structure.

[0046] It should be noted that there is only one target photovoltaic string. Therefore, when it is necessary to determine the shading result of the target photovoltaic string, the only input to the target shading detection model is the string data of the target photovoltaic string.

[0047] In the aforementioned photovoltaic string shading detection method, string data of the target photovoltaic string is acquired, including the orientation of the target photovoltaic string; the string data of the target photovoltaic string is input into a target shading detection model to obtain the shading result of the target photovoltaic string, and the target shading detection model includes a target axial attention layer. By employing the photovoltaic string shading detection method provided in this application embodiment, since the string data includes the orientation of the target photovoltaic string and the target shading detection model includes a target axial attention layer, the accuracy of the shading result of the target photovoltaic string can be improved.

[0048] In one exemplary embodiment, obtaining training data as described above includes:

[0049] Obtain initial training data, which includes initial string data of multiple photovoltaic strings;

[0050] The initial string data of multiple photovoltaic strings are standardized to obtain training data.

[0051] The initial string data, string data, and target string data of the photovoltaic (PV) module all include data with the same feature dimension, meaning that they all include the orientation of the corresponding PV module (PV module or target PV module).

[0052] Optionally, the initial training data (or training data) can be obtained from the operation log of a photovoltaic power generation system that includes multiple photovoltaic strings, and the operation log can be stored on a server.

[0053] In an exemplary embodiment, the above-mentioned acquisition of initial training data includes: generating power curves for each photovoltaic power generation system in multiple photovoltaic power generation systems to obtain multiple standard power curves; calculating the DTW value between the historical power curve and the corresponding standard power curve of each photovoltaic power generation system in a historical time period on a weekly basis based on the Dynamic Time Warping (DTW) algorithm to obtain multiple DTW values; selecting two days in each week with DTW values ​​less than a preset DTW threshold and the smallest DTW value as candidate days based on the multiple weekly DTW values ​​to obtain multiple candidate days; and acquiring initial training data based on the running logs of the multiple candidate days.

[0054] To ensure the validity of the initial training data and minimize interference from non-occlusion factors during the training process, the initial training data (or training data) can be data from the period between 8:30 and 15:30, i.e., the time period during which shadow occlusion may occur. Similarly, after obtaining the target occlusion detection model, the string data input to the target occlusion detection model can also be data from the period between 8:30 and 15:30.

[0055] Optionally, 80% of the data in the running log of multiple candidate days can be selected as the initial training data, and 20% of the data can be selected as the validation set data for the initial occlusion detection model.

[0056] The standard power curve refers to the expected power-time output curve of the corresponding photovoltaic string under the standard test conditions (STC).

[0057] Optionally, the preset DTW threshold can be set manually based on experience. Based on the principle of DTW, when the DTW value is less than the preset DTW threshold, it indicates that the power generation on that candidate day is relatively high, and the power curve on that candidate day is relatively flat.

[0058] Optionally, the number of photovoltaic power generation systems used to obtain initial training data can be 100, and the historical time can be the past 3 months. There are 24 candidate days in the past 3 months. Thus, 100 photovoltaic power generation systems can collect 100*24=2400 sample data, which can obtain initial training data with rich information.

[0059] In an exemplary embodiment, the above-mentioned standardization processing of the initial string data of multiple photovoltaic strings to obtain training data includes: filtering the initial string data of multiple photovoltaic strings to obtain filtered initial string data; and standardizing the filtered initial string data to obtain training data.

[0060] In another exemplary embodiment, the above-described filtering of the initial string data of multiple photovoltaic strings to obtain filtered initial string data includes: determining the mean of preceding data and the mean of following data of the target initial string data at the target time step; if the data of the target initial string data at the target time step is less than the mean of preceding data and the mean of following data, respectively, determining the data of the target initial string data at the target time step as the target abnormal drop point; determining the mean of the data at the time step before and after the target abnormal drop point; and using the mean of the time step before and after the target abnormal drop point to replace the target abnormal drop point, thereby obtaining the filtered initial string data.

[0061] The target time step is any time step of the initial group data, which can be any time step between 8:30 and 15:30.

[0062] The mean of preceding data can be the mean of the data in the five time steps preceding the target time step; the mean of subsequent data can be the mean of the data in the five time steps following the target time step.

[0063] Considering the differences in data upload times between each photovoltaic inverter in a photovoltaic power generation system, it is necessary to normalize the initial string data collection time to the same dimension. Based on this, the string data for each photovoltaic string is collected at equal intervals, optionally at 5-minute intervals.

[0064] For example, if the first data in a certain string of data was collected at 7:00, then the next data should be collected at 7:05. If no data was collected at 7:05, then the data collected at the time closest to 7:05 should be collected.

[0065] As a further example, if a data string is not collected within a preset time range of a specified time step, it is necessary to determine the preceding and following data points of the specified time step, and calculate the average of the preceding and following data points as replacement data for the specified time step. Based on this, the filtered initial data string can be obtained. For example, if the specified time step is 7:05, the preset time range can be 2.5 minutes. Thus, the data closest to 7:02:30 can be found as the preceding data, and the data closest to 7:07:30 can be found as the following data. The average of these two data points is then used as the data collected at 7:05.

[0066] In this embodiment, by filtering the initial string data, abnormal drop points in the initial string data can be removed, and the initial string data of different photovoltaic strings can be aligned in time. Thus, the initial shading detection model can better learn the temporal dependency of the shading results from the initial training data.

[0067] In one exemplary embodiment, the initial string data of the photovoltaic string includes the orientation of the photovoltaic string, hourly information, minute information, original voltage value, original current value, voltage change rate, current change rate, synchronous voltage difference value, and synchronous current difference value.

[0068] The hourly information can be the hour extracted from the timestamp information, with a value ranging from 8 to 15 (corresponding to the detection time of the shading results of the photovoltaic string from 8:30 to 15:30), and the hour must be an integer. This hourly information helps analyze the variation patterns of the initial string data at different times of the day. For example, it enables the initial shading detection model to determine the voltage and current change rates of the initial photovoltaic string during peak electricity consumption periods, or to determine the differences in power generation performance of initial photovoltaic strings with different orientations at different times.

[0069] Minute information can be the number of minutes extracted from the timestamp, and the number of minutes must be an integer, ranging from 0 to 59. Minute information is used to pinpoint the exact time.

[0070] Timestamp information refers to the specific time point at which the initial string data of the corresponding photovoltaic string is collected at a certain time step, accurate to the second. Timestamp information is represented in string format. Based on timestamp information, the collection time points of each initial string data can be distinguished, as well as the data corresponding to different time steps of the same initial string data. Therefore, timestamp information is used to determine the chronological order of the initial string data, assisting in the analysis of the changing trends of temporal characteristics over time. It is the foundation for constructing temporal characteristics and understanding the temporal correlation of data in the initial shading detection model.

[0071] For example, the timestamp information can be represented as "2025-07-28 10:30:00". The timestamp information is only used for data alignment and data traceability, and it will not be input into the initial occlusion detection model.

[0072] For example, if the timestamp information is "2025-07-28 10:30:00", then the hour information is "10" and the minute information is "30".

[0073] The raw voltage value refers to the DC-side voltage value of the corresponding photovoltaic string, used to characterize the voltage level of the corresponding photovoltaic string at a given time step. The raw voltage value can be a floating-point number; for example, the raw voltage value could be 675.31.

[0074] The raw current value refers to the DC-side current value of the corresponding photovoltaic string, used to characterize the current level of the corresponding photovoltaic string at a given time step. The raw current value can be a floating-point number; for example, the raw current value could be 10.75.

[0075] The original voltage and original current values ​​of the corresponding photovoltaic string are the DC-side voltage and DC-side current values ​​of the corresponding photovoltaic string at the first target number of time steps, respectively.

[0076] The voltage change rate refers to the slope of the straight line corresponding to the DC-side voltage value of the photovoltaic string at the first target number of time steps. The voltage change rate measures whether the original voltage value shows a significant upward or downward trend within a preset time window. The voltage change rate can be a floating-point number; for example, it can be -1.2 or +1.2.

[0077] Optionally, the voltage change rate of the corresponding photovoltaic string can be the slope of a straight line obtained by linearly fitting the DC-side voltage value of the corresponding photovoltaic string at the first target number of time steps using the least squares method.

[0078] For example, the rate of change of voltage can be expressed as:

[0079] (2)

[0080] Among them, K v Let t represent the voltage change rate, n represent the number of the first target, i=1,…,n, and t. i V represents the i-th time step. i This represents the initial voltage value at the i-th time step. It can be seen that the voltage change rate corresponds to the preset time window length.

[0081] The rate of change of current refers to the slope of the straight line corresponding to the DC-side current value of the photovoltaic string at the first target number of time steps. The rate of change of current is used to measure whether the original current value shows a significant upward or downward trend within a preset time window. The rate of change of current can be a floating-point number; for example, it can be -0.8 or +0.8.

[0082] Optionally, the rate of change of current corresponding to the photovoltaic string can be the slope of a straight line obtained by linearly fitting the DC-side current value of the corresponding photovoltaic string at the first target number of time steps using the least squares method.

[0083] For example, the rate of change of current can be expressed as:

[0084] (3)

[0085] Among them, K I Let t represent the voltage change rate, n represent the number of the first target, i=1,…,n, and t. i Let I represent the i-th time step. i This represents the initial current value at the i-th time step. It can be seen that the rate of change of current corresponds to the preset time window length.

[0086] The synchronous voltage difference value refers to an indicator that characterizes the degree of deviation of the original voltage value of the corresponding photovoltaic string from the historical average voltage value. The synchronous voltage difference value can be a floating-point number; for example, it can be -0.3 or +0.3.

[0087] Optionally, the synchronous voltage difference value of the corresponding photovoltaic string can be determined by first calculating the voltage difference between the original voltage value and the historical average voltage value of the corresponding photovoltaic string, and then calculating the ratio between the voltage difference and the standard deviation of the historical voltage value.

[0088] For example, the voltage difference during the same period can be expressed as:

[0089] (4)

[0090] Where ΔV' represents the voltage difference during the same period, V n V represents the average value of the original voltage at the first target number of time steps in the string data of the corresponding photovoltaic string. p This represents the average standard voltage value of the first target number of time steps in the standard voltage curve of the corresponding photovoltaic string.

[0091] The standard voltage curve refers to the expected voltage-time output curve of the corresponding photovoltaic string under standard test conditions (STC).

[0092] The synchronous current difference value refers to an indicator that characterizes the degree of deviation of the original current value of the corresponding photovoltaic string from the historical voltage average value. The synchronous current difference value can be a floating-point number; for example, it can be -0.5 or +0.5.

[0093] Optionally, the synchronous current difference value of the corresponding photovoltaic string can be determined by first calculating the current difference between the original current value and the historical average current value of the corresponding photovoltaic string, and then calculating the ratio between the current difference and the standard deviation of the historical current value.

[0094] For example, the difference in current during the same period can be expressed as:

[0095] (5)

[0096] Where ΔI' represents the difference in current during the same period, I n I represents the average value of the raw current at the first target number of time steps in the string data of the corresponding photovoltaic string. p This represents the average value of the standard current at the first target time step in the standard current curve of the corresponding photovoltaic string.

[0097] The standard current curve refers to the expected current-time output curve of the corresponding photovoltaic string under the standard test condition (STC).

[0098] In a straightforward manner, orientation, hourly information, minutely information, original voltage value, original current value, voltage change rate, current change rate, synchronous voltage difference value, and synchronous current difference value are all different feature dimensions. That is to say, when the initial string data of a photovoltaic string includes the orientation, hourly information, minutely information, original voltage value, original current value, voltage change rate, current change rate, synchronous voltage difference value, and synchronous current difference value of the photovoltaic string, the initial string data of the photovoltaic string includes 9 feature dimensions.

[0099] In this embodiment, since the string data includes not only the instantaneous static original voltage and current values, but also the voltage change rate and current change rate with dynamic characteristics within a preset time window, the target shading detection model optimized from the initial shading detection model can capture the sudden shading signal of the corresponding photovoltaic string at the corresponding time step (for example, a sudden drop in instantaneous voltage), and can also reflect the continuous impact of shading through the voltage change rate and current change rate within the preset time window (for example, shading causes the original voltage value to continuously decrease within the preset time window). This avoids the deviation between the shading result and the actual shading situation due to the ambiguous definition of the short-term fluctuation characteristics of the string data.

[0100] Based on this, since the string data includes a relatively rich set of feature dimensions and the string data packet orientation, the final optimized target shading detection model can distinguish the impact of different installation orientations of the corresponding photovoltaic string on shading detection. Orientation can form a multi-dimensional linkage with voltage data, current data, and related derived feature dimensions. Therefore, the final optimized target shading detection model can detect shading problems from all angles and in all directions. It has significant advantages in complex environments (for example, photovoltaic arrays with multiple orientations, dynamic shading objects, etc.) and significantly improves the accuracy of the shading results of the final optimized target shading detection model.

[0101] Furthermore, in this embodiment, the string data includes multiple different feature dimensions in addition to the synchronous voltage and current differences. This avoids the situation where the voltage or current data shows a slow, cumulative decline due to trees or other similar gradual dynamic shading that may grow taller over several months, potentially being mistaken for natural fluctuations in the synchronous data and leading to misjudgments of shading results. Therefore, this embodiment is applicable to various installation environments.

[0102] Incorporating the voltage change rate, current change rate, and orientation of the corresponding photovoltaic string into the string data allows the target shading detection model to learn more specifically based on the correlation between orientation and shading results, thus obtaining more accurate shading results. For example, for the same voltage or current change rate causing a sudden drop in rate of change, a sudden drop in rate of change facing east is more likely caused by shading, while a sudden drop in rate of change facing south is more likely caused by passing cloud shadows.

[0103] Since different types of data in the initial string data have different dimensions, they need to be standardized to form a data format that can be input into the initial shading detection model for training. Specifically, the hourly and minute information, raw voltage values, raw current values, voltage change rate, and current change rate of the initial string data are the feature dimensions that need to be standardized in terms of format. In other words, by standardizing the feature dimensions that need to be standardized in the initial string data of multiple photovoltaic strings, training data can be obtained.

[0104] Based on this, in an exemplary embodiment, the above-mentioned standardization processing of the initial string data of multiple photovoltaic strings to obtain training data includes: standardizing the hourly information, minute information, original voltage value, original current value, voltage change rate, and current change rate of multiple photovoltaic strings respectively to obtain standardized data; the standardized data includes standardized hourly information, standardized minute information, standardized original voltage value, standardized original current value, standardized voltage change rate, and standardized current change rate; training data is obtained based on the orientation of multiple photovoltaic strings, synchronous voltage difference value, synchronous current difference value, and standardized data.

[0105] Optionally, the standardized data format can be a data format that the initial gated recurrent layer can recognize and learn.

[0106] Since hourly information has a periodic pattern, it cannot be directly normalized to the range [0, 1] (for example, this would cause the numerical differences between similar points, such as 23 and 0, to be greater after normalization). Therefore, hourly information is represented by sine and cosine transformation results. Based on this, the value range of hourly information is also between [-1, 1], which can meet the input requirements of the initial occlusion detection model.

[0107] For example, standardized hour information can be represented as:

[0108] (6)

[0109] Here, hour represents hourly information.

[0110] Since both the cosine and sine functions are symmetric, using only one could lead to inconsistent values ​​at different times. Therefore, using both the cosine and sine transformation results to represent a single time step is more accurate. This is equivalent to mapping the time step to coordinates on a unit circle, ensuring that each time step has one and only one unique coordinate. For example, when hour=12, the standardized hour information is represented as (sin0, cos=-1), corresponding to the point (-1, 0).

[0111] Because minute information has a periodic pattern, it cannot be directly normalized to the range [0, 1] (for example, the sine function values ​​for 15 minutes and 45 minutes are the same, both being 1, but the actual minutes are different; while the pre-function values ​​for 0 minutes and 30 minutes are 1 and -1 respectively, which will cause the numerical differences between 23:00 and 0:00, which are already close, to be even greater after normalization). Therefore, minute information is represented by sine and cosine transformation results. Based on this, the value range of minute information is also between [-1, 1], which can also meet the input requirements of the initial occlusion detection model.

[0112] For example, standardized minute information can be represented as:

[0113] (7)

[0114] Wherein, min represents minute information.

[0115] Similar to clock information, using cosine and sine transformation results can improve the accuracy of representing individual time steps. For example, with min=15, the normalized minute information is represented as (sin=1, cos=0), corresponding to the point (1, 0).

[0116] For example, the standardized raw voltage value can be expressed as:

[0117] (8)

[0118] Where Norm_V represents the normalized raw voltage value, V represents the raw voltage value, and μ V σ represents the calculated mean voltage of the standard voltage curve. V This represents the calculated variance of the voltage on the standard voltage curve.

[0119] For example, the standardized raw current value can be expressed as:

[0120] (9)

[0121] Where Norm_I represents the normalized raw current value, I represents the raw current value, and μ I σ represents the calculated mean current of the standard current curve. I This represents the variance of the current calculation for the standard current curve.

[0122] For example, the standardized rate of change of voltage can be expressed as:

[0123] (10)

[0124] Where Norm_k_V represents the standardized rate of change of voltage, K v This represents the rate of change of voltage, where kmax_V represents the maximum rate of change in the standard voltage curve.

[0125] For example, the standardized rate of change of current can be expressed as:

[0126] (11)

[0127] Where Norm_k_I represents the standardized rate of change of current, K I k represents the rate of change of current. max_I This represents the maximum rate of change in the standard current curve.

[0128] Within the same corresponding string of data, standardized hour information, standardized minute information, standardized raw voltage values, and standardized raw current values ​​are included for a first target number of time steps. For example, when the first target number is 6, the string of data includes standardized raw voltage values ​​for 6 different time steps, and the same applies to other feature dimensions. The standardized voltage change rate and standardized current change rate are relative to the preset time window length; that is, there will only be one standardized voltage change rate value and one standardized current change rate value within the same preset time window. Alternatively, it can be understood that the first target number of standardized voltage change rates and standardized current change rates in the same corresponding string of data are all the same.

[0129] Optionally, the number of the first target can be 6, 7, 8, or other numbers. The interval between each time step is the same, and the interval between each time step can be 5 minutes, 6 minutes, 7 minutes, or other durations.

[0130] In this embodiment, by standardizing the string data, the dimensions of different types of data in the string data can be eliminated, enabling the initial occlusion detection model to recognize and learn the standardized training data.

[0131] It should be noted that the number and content of feature dimensions included in the photovoltaic string data (or initial string data) and the target photovoltaic string data in the training data are the same, and the filtering and standardization processes for the corresponding string data are also the same and universal. Therefore, the relevant processes can refer to the above-mentioned limitations on the processing of the initial string data, and the processing of the target photovoltaic string data will not be elaborated further below. Accordingly, the photovoltaic string data (or initial string data) and the target photovoltaic string data in the training data each correspond to the same number of time steps.

[0132] In an exemplary embodiment, the initial occlusion detection model includes an initial axial attention layer, and the above method further includes:

[0133] Acquire training data, which includes string data of multiple photovoltaic modules and multiple shading labels, with each photovoltaic module corresponding to one of the multiple shading labels;

[0134] The string data of the first photovoltaic string is input into the initial axial attention layer to determine the shading result of the first photovoltaic string; the first photovoltaic string is at least one of multiple photovoltaic strings.

[0135] The loss value is determined based on the shading results of the first photovoltaic string and the first shading label; the first shading label is the shading label corresponding to the first photovoltaic string among multiple shading labels;

[0136] The parameters of the initial occlusion detection model are optimized based on the loss value to obtain the target occlusion detection model.

[0137] The first photovoltaic string can be a third target number of photovoltaic strings among multiple photovoltaic strings. The number of photovoltaic strings included in the first photovoltaic string can be understood as the number of sample data input to the initial shading detection model. For example, the third target number can be 28, 32, 36 or other numbers. Inputting multiple sample data at once can improve the stability and optimization efficiency of the initial shading detection model.

[0138] When the first photovoltaic string is a third target number of photovoltaic strings among multiple photovoltaic strings, that is, the string data of the first photovoltaic string includes the third target number of sample data, and each sample data in the third target number of sample data includes the data of the first target number of time steps.

[0139] In a straightforward manner, during the parameter optimization process of the initial occlusion detection model, the parameters of the initial axial attention layer are also optimized. Once the optimized target occlusion detection model is obtained, the parameters of the initial axial attention layer are also optimized and become the target axial attention layer.

[0140] Optionally, the shading label can be 0 or 1. When the shading label is 0, it indicates that the corresponding photovoltaic string is not shaded by the shadow. When the shading label is 1, it indicates that the corresponding photovoltaic string is shaded by the shadow.

[0141] When the string data of a photovoltaic (PV) module corresponds to the historical time window length, "PV string not shaded" means that the PV string is not shaded within the historical time window length, while "PV string shaded" means that the PV string is shaded within the historical time window. The historical time window length is the same as the preset time window length in terms of time duration.

[0142] Alternatively, the parameters of the initial occlusion detection model can be optimized based on the loss value using the corrected linear unit (ReLU), mean squared error (MSE), or other loss functions to obtain the target occlusion detection model.

[0143] Optionally, in the process of optimizing the parameters of the initial occlusion detection model based on the loss value to obtain the target occlusion detection model, an Adaptive Moment Estimation (Adam) optimizer can be selected to adaptively adjust the learning rate during the optimization of the initial occlusion detection model; the initial learning rate of the initial occlusion detection model can be set to 1×10. -3 To ensure stable convergence of the initial shading detection model, the number of sample data points (i.e., the number of third objectives) in the string data of the first photovoltaic string input to the initial shading detection model during a single optimization process can be set to 32 to improve the stability and optimization efficiency of the initial shading detection model. The total number of optimization iterations can be set to 300, and the model can be terminated early even if the number of iterations has not reached 300 to improve the generalization ability of the initial shading detection model. An L2 regularization method can be introduced into the loss function to avoid overfitting of the initial shading detection model, and the weight decay coefficient of the L2 regularization method can be set to 5 × 10⁻⁶.-5 This balances the fitting ability and regularization strength of the initial occlusion detection model. Based on this, it can be ensured that the final optimized target occlusion detection model has high generalization ability and stability.

[0144] Optionally, during the process of optimizing the parameters of the initial occlusion detection model based on the loss value, the gradient of the loss function with respect to all parameters of the initial occlusion detection model can be calculated based on the backpropagation algorithm, and a gradient pruning strategy can be used to restrict the gradient. Specifically, the L2 norm of the gradient can be restricted to not exceed 1.0 to prevent the undesirable situation of gradient explosion during the optimization process.

[0145] Optionally, during the process of optimizing the parameters of the initial occlusion detection model based on the loss value, the loss value of each iteration can be recorded. If the loss value of the fourth consecutive target number of rounds is greater than or equal to the historical minimum loss value, the parameter optimization of the initial occlusion detection model is considered to be completed, and the parameter optimization process is stopped. Thus, the target occlusion detection model is obtained.

[0146] Optionally, the fourth target quantity can be 4, 5, 6, or other quantities.

[0147] Alternatively, the parameters whose loss value is the historical minimum loss value can be considered as the optimal parameters, that is, the parameters with the loss value being the historical minimum loss value can be used as the parameters of the target occlusion detection model.

[0148] Optionally, in the process of optimizing the parameters of the initial occlusion detection model based on the loss value, the optimized parameters may include parameters of all hierarchical structures. For example, the optimized parameters may include the parameters of the initial axial attention layer and the parameters of the initial gated recurrent layer. Further, the parameters of the initial axial attention layer may include the parameters of the time axis attention module and the parameters of the feature axis attention module.

[0149] In this embodiment, the initial shading detection model includes an initial axial attention layer. Thus, during the iterative optimization of the initial shading detection model, the string data of the first photovoltaic string is input into the initial axial attention layer of the initial shading detection model to obtain the shading result of the photovoltaic string. Based on this, since the initial axial attention layer can capture the long-range dependency of the string data of the photovoltaic string on a specified axis, the target shading detection model obtained after parameter optimization can have high accuracy and reliability in shading detection.

[0150] In an exemplary embodiment, the above-mentioned inputting the string data of the first photovoltaic string into the initial axial attention layer of the initial shading detection model to determine the shading result of the first photovoltaic string includes:

[0151] Based on the string data of the first photovoltaic string, the time axis attention result and feature axis attention result of the first photovoltaic string are determined using the initial axial attention layer;

[0152] The time axis attention results and feature axis attention results are fused using an initial axial attention layer to obtain the attention fusion result;

[0153] Based on the attention fusion results, the shading results of the first photovoltaic string are determined.

[0154] The time-axis attention result refers to the weighted feature sequence obtained after the first photovoltaic string performs a self-attention mechanism at the first target number of consecutive time steps.

[0155] For example, in the process of detecting shading of photovoltaic strings, the time axis attention results can capture time-series dependencies such as voltage and current changes at the location of the first photovoltaic string. Based on these time-series dependencies in the string data, it is possible to accurately detect whether the photovoltaic string is shading.

[0156] The feature axis attention result refers to the weighted feature sequence obtained after the first photovoltaic string performs a self-attention mechanism on the second target number of feature dimensions.

[0157] Optionally, the second target number is determined by the number of feature dimensions included in the string data of the first photovoltaic string. For example, if the string data of the first photovoltaic string includes the orientation, hour information, minute information, original voltage value, original current value, voltage change rate, current change rate, synchronous voltage difference value, and synchronous current difference value of at least one photovoltaic string, then the second target number is 9.

[0158] For example, in the process of detecting shading of photovoltaic strings, the feature axis attention result can capture the feature correlation between the second target number of feature dimensions of the first photovoltaic string, and based on the feature correlation in these string data, it is possible to accurately detect whether the photovoltaic string is shading.

[0159] Alternatively, the attention fusion result can be obtained by residual fusion of the time axis attention result and the feature axis attention result using the initial axial attention layer.

[0160] In this embodiment, the attention fusion result is obtained by fusing the time axis attention result and the feature axis attention result of the initial axial attention layer output. Then, based on the attention fusion result, the shadow occlusion result of the first photovoltaic string is determined. Thus, the attention fusion result not only retains the dynamic temporal dependencies on the time axis (e.g., voltage change, current change, etc.), but also retains the feature correlations of different feature dimensions on the feature axis (e.g., the relationship between orientation and shadow occlusion, etc.). Based on this, the attention fusion result can more comprehensively characterize the operating state of the first photovoltaic string. Furthermore, the attention fusion result can more accurately highlight the key feature information related to the shadow occlusion result. Therefore, based on the attention fusion result, a more accurate and reliable shadow occlusion result for the first photovoltaic string can be obtained.

[0161] In an exemplary embodiment, the initial occlusion detection model further includes an initial fully connected layer. The above-mentioned determination of the shadow occlusion result of the first photovoltaic string based on the attention fusion result includes: using the initial fully connected layer to determine the shadow occlusion result of the first photovoltaic string based on the attention fusion result.

[0162] In another exemplary embodiment, the initial fully connected layer includes a fully connected module, a classifier module, and a result judgment module. The method of using the initial fully connected layer to determine the shadow occlusion result of the first photovoltaic string based on the attention fusion result includes: using the fully connected module to perform a nonlinear transformation and dimensionality mapping on the attention fusion result to obtain a final feature vector including two classification categories; using the classifier module to calculate the probability of each classification category in the final feature vector to obtain the shadow occlusion probability of the first photovoltaic string; and using the result judgment module to determine the shadow occlusion result of the first photovoltaic string based on the shadow occlusion probability of the first photovoltaic string.

[0163] The classifier module may include a softmax classifier.

[0164] Optionally, if the shading probability of the first photovoltaic string is greater than or equal to a preset probability threshold, the shading result of the first photovoltaic string is that the first photovoltaic string is shaded; otherwise, if the shading probability of the first photovoltaic string is less than the preset probability threshold, the shading result of the first photovoltaic string is that the first photovoltaic string is not shaded.

[0165] Optionally, a preset probability threshold can be set to 70%, 80%, 85%, or other thresholds.

[0166] In an exemplary embodiment, the initial prediction model further includes an initial gated recurrent layer; based on the string data of the first photovoltaic string, the initial axial attention layer is used to determine the time axis attention result and feature axis attention result of the first photovoltaic string, including:

[0167] Input the string data of the first photovoltaic string into the initial gated recurrent layer to obtain the time series features of the target dimension;

[0168] Based on the time series features of the target dimension, the time axis attention result and feature axis attention result of the first photovoltaic string are determined using an initial axial attention layer;

[0169] The above-mentioned initial axial attention layer is used to fuse the time axis attention results and the feature axis attention results to obtain the attention fusion result, including:

[0170] The initial axial attention layer is used to fuse the time axis attention results, the feature axis attention results, and the time series features of the target dimension to obtain the attention fusion result.

[0171] The initial gated loop layer refers to the string structure in the initial shading detection model that is used to scan the string data of the first photovoltaic string step by step according to the time sequence in order to output the higher-order hidden state of the string data of the first photovoltaic string.

[0172] The initial gated recurrent layer retains the core gating logic based on the Long Short-Term Memory (LSTM) network. However, by merging gating functions and simplifying the state structure, it solves the long-term dependency problem in LSTM, reduces computational complexity with fewer parameters, and improves computational efficiency while maintaining similar performance. Based on this, the initial gated recurrent layer can effectively learn the dimensional characteristics between various types of data in the string data of the first photovoltaic string. Specifically, the initial gated recurrent layer can learn the temporal dependency (the data at the current time step is related to the data at multiple past time steps) and dynamic change (for example, the voltage or current data in the string data exhibits a non-linear change trend in the time dimension). Furthermore, while learning the long-term change trend of the string data, the initial gated recurrent layer can also pay attention to the short-term fluctuations of the string data in the short term (for example, 1 hour).

[0173] In the case where the first photovoltaic string includes at least one photovoltaic string, the string data of the first photovoltaic string corresponds to the first target number of time steps, and the string data of the first photovoltaic string includes data of feature dimensions such as orientation, the string data of the first photovoltaic string is a three-dimensional tensor about the number of sample data, the number of time steps, and the number of feature dimensions. Thus, the initial gated recurrent layer can receive, identify, and process the string data of the first photovoltaic string.

[0174] Since the string data of the first photovoltaic string is input into the initial gated loop layer, the initial gated loop layer can extract the hidden state of the string data of the first photovoltaic string at each time step. That is, the string data of the first photovoltaic string will be converted into a higher-level target dimension time series feature. Therefore, the number of feature dimensions of the target dimension time series feature is greater than the number of feature dimensions of the string data of the first photovoltaic string.

[0175] The initial gated loop layer includes update gates and reset gates. That is, the hidden state at time step t is determined by the hidden candidate state at time step t and the hidden state at time step (t-1).

[0176] In an exemplary embodiment, the above-mentioned inputting the string data of the first photovoltaic string into the initial gated recurrent layer to obtain the time series features of the target dimension includes: inputting the string data of the first photovoltaic string into the initial gated recurrent layer, and obtaining the time series features of the target dimension at the t-th time step through the output of the update gate of the initial gated recurrent layer at the t-th time step, the hidden state at the (t-1)-th time step, and the candidate hidden state at the t-th time step.

[0177] For example, after inputting the string data of the first photovoltaic string into the initial gated recurrent layer, the process by which the initial gated recurrent layer processes the string data of the first photovoltaic string to obtain the time series features of the target dimension can be represented as follows:

[0178] (12)

[0179] Among them, h t Let z represent the hidden state at time step t. t h represents the output of the update gate at time step t. t-1 Let h' represent the hidden state at time step t-1. t This represents the candidate hidden state at time step t (i.e., the possible new state at time step t).

[0180] It is easy to understand that, when t is the latest time step, h t The time series features are the target dimension.

[0181] For example, the candidate hidden state at time step t can be represented as:

[0182] (13)

[0183] Among them, W c The input data weight matrix representing the candidate hidden state, x t U represents the string data of the first photovoltaic string at time step t. c The hidden state weight matrix, r, represents the candidate hidden state. t This indicates the output of the reset gate at time step t.

[0184] For example, the output of the update gate at time step t can be represented as:

[0185] (14)

[0186] Where σ represents the Sigmoid activation function, W z This represents the input data weight matrix of the update gate, x. t U represents the string data of the first photovoltaic string at time step t. z Let b represent the hidden state weight matrix of the update gate. z This indicates that the bias term of the updated gate is being updated.

[0187] For example, the output of the reset door can be represented as:

[0188] (15)

[0189] Among them, W r This represents the input data weight matrix of the reset gate, x. t U represents the string data of the first photovoltaic string at time step t. r Let b represent the hidden state weight matrix of the reset gate. r This indicates the option to reset the door's bias.

[0190] In obtaining the time series features of the target dimension, the update gate in the initial gated recurrent layer controls how much of the hidden state output at time step (t-1) and the hidden state input at time step (t) flows into the hidden state at time step (t). A larger output from the update gate at time step (t) indicates more incoming information. This shows that the update gate helps capture long-term dependencies in the time series. Conversely, the reset gate in the initial gated recurrent layer controls how much of the hidden state output at time step (t-1) flows into the candidate hidden state at time step (t). A smaller output from the reset gate at time step (t) indicates less incoming information, or more previously forgotten information. This shows that the reset gate helps capture short-term dependencies in the time series.

[0191] For example, such as Figure 3 As shown, based on the specific structure of the initial gated loop layer, the above formulas (12), (13), (14) and (15) can be obtained.

[0192] For example, the string data of the first photovoltaic string can be represented as [batch_size, n=6, m=9], where batch_size represents the number of photovoltaic strings included in the first photovoltaic string, i.e., the third target number, n represents the first target number, and m represents the number of feature dimensions included in the string data of the first photovoltaic string. Based on this, assuming that the number of feature dimensions included in the time series feature of the target dimension is 32, the time series feature of the target dimension can be represented as [batch_size, 6, 32].

[0193] Optionally, the initial axial attention layer can be used to perform residual fusion on the time axis attention results, feature axis attention results, and time series features of the target dimension to obtain the attention fusion result. This preserves the original key information of the time series features of the target dimension input to the initial axial attention layer and can also alleviate the gradient vanishing problem commonly found in deep learning networks.

[0194] In this embodiment, the initial occlusion detection model also includes an initial gated recurrent layer. The string data of the first photovoltaic string is input into the initial gated recurrent layer to obtain the time series features of the target dimension. Thus, the initial axial attention layer can be used to fuse the time axis attention results, the feature axis attention results, and the time series features of the target dimension. Since the information content of the time series features of the target dimension is richer than that of the string data of the first photovoltaic string, the attention fusion result can more accurately highlight the key feature information related to the shadow occlusion result. Therefore, based on the attention fusion result, a more accurate and reliable shadow occlusion result for the first photovoltaic string can be obtained.

[0195] In an exemplary embodiment, the time series features include a first target number of time steps; the initial axial attention layer includes a time axis attention module and a feature axis attention module; based on the time series features of the target dimension, the initial axial attention layer is used to determine the time axis attention result and feature axis attention result of the first photovoltaic string, including:

[0196] Based on the time series features of the target dimension, the time axis attention module is used to determine the number of queries, keys, and values ​​of the first target on the time axis.

[0197] Based on the number of queries and keys of the first target, the time axis attention module is used to determine the time axis attention weights between each time step and other time steps in the number of time steps of the first target, thus obtaining the number of time axis attention weights of the first target.

[0198] Based on the number of values ​​for the first target and the number of time-axis attention weights for the first target, the time-axis attention module is used to determine the time-axis attention result;

[0199] The time series features of the target dimension are input into the feature axis attention module to determine the feature axis attention calculation result.

[0200] In an exemplary embodiment, the target dimension includes a second target number of feature dimensions; the initial axial attention layer includes a time-axis attention module and a feature-axis attention module; the above-mentioned inputting the time-series features of the target dimension into the initial axial attention layer to obtain the time-axis attention result and feature-axis attention result of the first photovoltaic string includes:

[0201] Based on the time series features of the target dimension, the feature axis attention calculation unit is used to determine the number of queries, keys, and values ​​of the second target on the feature axis.

[0202] Based on the number of queries and keys of the second target, the feature axis attention calculation unit is used to determine the feature axis attention weights between each feature dimension and other feature dimensions in the number of feature dimensions of the second target, thus obtaining the number of feature axis attention weights of the second target.

[0203] Based on the number of values ​​of the second target and the number of feature axis attention weights of the second target, the feature axis attention calculation unit is used to determine the feature axis attention calculation result;

[0204] The time series features of the target dimension are input into the time axis attention calculation module to obtain the time axis attention calculation results.

[0205] The time axis attention module is used to capture temporal dependencies at the first target number of time steps.

[0206] The feature axis attention module is used to capture feature relationships across the second target number of feature dimensions.

[0207] Each query on the timeline represents the information of interest at each time step. Each key on the timeline represents the characteristic of the time series feature of the target dimension at each time step. Each value on the timeline represents the actual feature of the time series feature of the target dimension, used for the final weighted summation to generate the timeline attention result.

[0208] In the timeline attention module, queries are used to compare against corresponding keys to determine the correlation between different time steps.

[0209] For example, the time axis attention weights between each time step and each other time step can be expressed as:

[0210] (16)

[0211] Among them, Attention s (b, t, t') represents the time axis attention weight between the t-th time step and the t'-th time step, Q s (b, t, :) represents the query of the b-th sample data of the first photovoltaic string at the t-th time step on the time axis, where K s (b, t', :) represents the key of the b-th sample data of the first photovoltaic string at the t-th time step on the time axis, n represents the first target quantity, m represents the second target quantity, t=1,…,n, b=1,…,batch_size.

[0212] In formula (16), the numerator represents the similarity between the t-th time step and the t'-th time step, the denominator represents the normalized representation of the weighted sum of the similarities between the t-th time step and all other time steps, and t'' represents any one of the time steps. Therefore, t'' = 1, ..., n.

[0213] For example, the time-axis attention result can be represented as:

[0214] (17)

[0215] Among them, Out s (b, t, :) represents the time-axis attention result, V s (b, t', :) represents the value of the b-th sample data of the first photovoltaic string at the t-th time step on the time axis.

[0216] Each query on the feature axis represents the information of interest at each feature step. Each key on the feature axis represents the feature characteristics of the target dimension's feature sequence at each feature step. Each value on the feature axis represents the actual feature in the target dimension's feature sequence, used for the final weighted sum to generate the feature axis attention result.

[0217] In the feature axis attention module, the query is used to compare with the corresponding key to determine the correlation between different feature steps.

[0218] For example, the feature axis attention weights between each feature dimension and each of the other feature dimensions can be expressed as:

[0219] (18)

[0220] Among them, Attention f (b, t, t') represents the feature axis attention weights between the d-th feature dimension and the d'-th feature dimension, Q s (b, d, :) represents the query for the b-th sample data of the first photovoltaic string on the feature axis in the d-th feature dimension, where K s (b, t', :) represents the key of the b-th sample data in the d-th feature dimension of the first photovoltaic string data on the feature axis, n represents the number of the first target, m represents the number of the second target, and d=1,…,m.

[0221] In formula (18), the numerator represents the similarity between the d-th feature dimension and the d'-th feature dimension, the denominator represents the normalized representation of the weighted sum of the similarities between the d-th feature dimension and each of the other feature dimensions, and d'' represents any one of the feature dimensions. Therefore, d'=1,…,m.

[0222] For example, the transpose of the feature axis attention result can be expressed as:

[0223] (19)

[0224] Among them, Out f (b, d, :) represents the feature axis attention result, (Out f (b, d, :)) T V represents the transpose of the feature axis attention result. f (b, d', :) represents the value of the b-th sample data in the d-th feature dimension of the first photovoltaic string data on the feature axis.

[0225] For example, the attention fusion result can be represented as:

[0226] (20)

[0227] Among them, Out s (b, t, :) represents time-axis attention, (Out f (b, d, :)) T This represents the transpose of the attention result along the feature axis, where X(b, t, :) represents the time-series feature of the target dimension, and W... out Indicates the output weight, b out This indicates the output bias.

[0228] In this embodiment, after determining the time axis attention result and the feature axis attention result, the time axis attention result and the feature axis attention result are fused to obtain the attention fusion result. Thus, based on the attention fusion result, the shadow occlusion result of the first photovoltaic string can be determined to achieve high-precision and adaptive shadow occlusion detection without additional hardware or a large amount of historical data. Therefore, a target occlusion detection model with high generalization, high robustness and high accuracy can be obtained.

[0229] In an exemplary embodiment, the method further includes: initializing the input data weight matrix of the candidate hidden state of the initial gated loop layer, the input data weight matrix of the update gate, and the input data weight matrix of the reset gate, such that the initial input data weight matrix of the candidate hidden state, the initial input data weight matrix of the update gate, and the initial input data weight matrix of the reset gate respectively satisfy the following: the mean is 0, the variance is 2, and the ratio between the number of feature dimensions of the string data of the first photovoltaic string and the number of feature dimensions of the time series features of the target dimension.

[0230] This can be achieved through Xavier to initialize the input data weight matrix of the candidate hidden state of the initial gated loop layer, the input data weight matrix of the update gate, and the input data weight matrix of the reset gate.

[0231] In one exemplary embodiment, the initial value of the door's bias term is updated and the initial value of the door's bias term is reset to 0, respectively.

[0232] In an exemplary embodiment, the output weights of the initial axial attention layer are initialized in the same manner as the input data weight matrix of the candidate hidden states of the initial gated recurrent layer, with the initial values ​​of the output biases being 0.

[0233] In an exemplary embodiment, the initial values ​​of the candidate hidden states are randomly initialized, and the result of the random initialization is a non-zero vector; during the random initialization process, the vectors need to follow a normal distribution with a mean of 0 and a variance of 0.01.

[0234] It should be noted that before optimizing the initial shading detection model, the initial values ​​of various model parameters (for example, the parameters of the initial axial attention layer, the parameters of the initial gating loop layer, etc.) can be adjusted according to the distribution of string data of the first photovoltaic string.

[0235] like Figure 4 As shown, the application process of the above-mentioned photovoltaic string shading detection method will be illustrated below with a detailed embodiment:

[0236] Step 402: Obtain initial training data. Standardize the initial string data of multiple photovoltaic strings to obtain training data. The initial training data includes the initial string data of multiple photovoltaic strings and the training data includes the string data of multiple photovoltaic strings and multiple shading labels. Multiple photovoltaic strings correspond one-to-one with multiple shading labels.

[0237] The string data of the photovoltaic string includes the orientation of the photovoltaic string, hourly information, minute information, original voltage value, original current value, voltage change rate, current change rate, voltage difference value during the same period, and current difference value during the same period.

[0238] Step 404: Input the string data of the first photovoltaic string into the initial gated recurrent layer in the initial shading detection model to obtain the time series features of the target dimension; the first photovoltaic string is at least one of multiple photovoltaic strings; the time series features include the first target number of time steps.

[0239] Step 406: First, ① using the time-axis attention module, determine the first number of queries, the first number of keys, and the first number of values ​​on the time axis based on the time-series features of the target dimension; then, ② using the time-axis attention module, determine the time-axis attention weights between each time step and other time steps in the first number of time steps, obtaining the first number of time-axis attention weights; finally, ③ using the time-axis attention module, determine the time-axis attention result based on the first number of values ​​and the first number of time-axis attention weights.

[0240] Step 408: First, ① based on the time series features of the target dimension, use the feature axis attention calculation unit to determine the second target number of queries, the second target number of keys, and the second target number of values ​​on the feature axis; then, ② based on the second target number of queries and the second target number of keys, use the feature axis attention calculation unit to determine the feature axis attention weights between each feature dimension and other feature dimensions in the second target number of feature dimensions, thus obtaining the second target number of feature axis attention weights; finally, ③ based on the second target number of values ​​and the second target number of feature axis attention weights, use the feature axis attention calculation unit to determine the feature axis attention calculation result.

[0241] It should be noted that regarding steps 406 and 408, steps 406 can be executed first and then step 408, or steps 408 can be executed first and then step 406, and they can be executed in parallel. Steps 406 and 408 can also be executed synchronously in parallel, that is, the time series features of the target dimension can be simultaneously input into the time axis attention module and the feature axis attention module, respectively. This application does not limit this.

[0242] Step 410: Use the initial axial attention layer to fuse the time axis attention results, feature axis attention results, and time series features of the target dimension to obtain the attention fusion result.

[0243] Step 412: Based on the attention fusion result, determine the shadow occlusion result of the first photovoltaic string; the first photovoltaic string is at least one of multiple photovoltaic strings.

[0244] Step 414: Determine the loss value based on the shading result of the first photovoltaic string and the first shading label; the first shading label is the shading label corresponding to the first photovoltaic string among multiple shading labels.

[0245] Step 416: Optimize the parameters of the initial occlusion detection model based on the loss value to obtain the target occlusion detection model.

[0246] Step 418: Obtain string data of the target photovoltaic string, input the string data of the target photovoltaic string into the target shading detection model, and obtain the shadow shading result of the target photovoltaic string; the string data includes the orientation of the target photovoltaic string; the target shading detection model includes the target axial attention layer.

[0247] On the one hand, in this embodiment, the string data of the first photovoltaic string includes multiple feature dimensions, which can fully explore the electrical data characteristics of the photovoltaic string in the power generation process from shallow to deep and from low to high. Starting from three levels of feature dimensions, the basic layer includes the original voltage value and the original current value, the middle layer includes the voltage change rate and the current change rate of the first target number of time steps within the preset time window length, and the highest layer includes the synchronous voltage difference value and the synchronous current difference value. In this way, the spatial correlation between the orientation and the electrical data of the photovoltaic string can be fully constructed. By integrating the multi-dimensional features of these three levels, the shading problem can be comprehensively detected.

[0248] On the other hand, in this embodiment, a lightweight initial gated recurrent layer and an initial axial attention layer are fused into a new initial occlusion detection model that enhances data features. First, time-series features of the second target number of feature dimensions of the photovoltaic string are extracted based on the initial gated recurrent layer. Then, the initial axial attention layer is introduced to perform self-attention calculations on the two types of features from both the time axis and feature axis perspectives, further highlighting the proportion of shadow occlusion features. Finally, the time-series features of the target dimension extracted by the initial gated recurrent layer are residually fused with the attention fusion result obtained by the initial axial attention layer. This significantly improves the weight of shadow occlusion while preserving the original characteristics of the time-series features, and also avoids the gradient vanishing problem during optimization training. The target occlusion detection model optimized based on this method can accurately output the shadow occlusion results of the target photovoltaic string.

[0249] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0250] Based on the same inventive concept, this application also provides a photovoltaic string shading detection device for implementing the photovoltaic string shading detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the photovoltaic string shading detection device provided below can be found in the limitations of the photovoltaic string shading detection method described above, and will not be repeated here.

[0251] In one exemplary embodiment, such as Figure 5 As shown, a photovoltaic string shading detection device is provided, including: an acquisition module 502 and an input module 504, wherein:

[0252] The acquisition module 502 is used to acquire string data of the target photovoltaic string, including the orientation of the target photovoltaic string.

[0253] The input module 504 is used to input the string data of the target photovoltaic string into the target shading detection model to obtain the shading result of the target photovoltaic string. The target shading detection model includes a target axial attention layer.

[0254] In one exemplary embodiment, the initial occlusion detection model includes an initial axial attention layer, such as Figure 5 As shown, the above-mentioned device also includes a training module 506, which is used to acquire training data, including string data of multiple photovoltaic strings and multiple occlusion labels, with each photovoltaic string corresponding to one of the multiple occlusion labels; inputting the string data of the first photovoltaic string into the initial axial attention layer to determine the shadow occlusion result of the first photovoltaic string; the first photovoltaic string is at least one of the multiple photovoltaic strings; based on the shadow occlusion result of the first photovoltaic string and the first occlusion label, a loss value is determined; the first occlusion label is the occlusion label corresponding to the first photovoltaic string among the multiple occlusion labels; and the parameters of the initial occlusion detection model are optimized based on the loss value to obtain the target occlusion detection model.

[0255] In an exemplary embodiment, the training module 506 is specifically used to determine the time axis attention result and feature axis attention result of the first photovoltaic string based on the string data of the first photovoltaic string using an initial axial attention layer; to fuse the time axis attention result and feature axis attention result using the initial axial attention layer to obtain an attention fusion result; and to determine the shadow occlusion result of the first photovoltaic string based on the attention fusion result.

[0256] In an exemplary embodiment, the initial prediction model further includes an initial gated recurrent layer; the training module 506 is specifically used to input the string data of the first photovoltaic string into the initial gated recurrent layer to obtain the time series features of the target dimension; based on the time series features of the target dimension, the initial axial attention layer is used to determine the time axis attention result and the feature axis attention result of the first photovoltaic string; the training module 506 is specifically used to use the initial axial attention layer to fuse the time axis attention result, the feature axis attention result and the time series features of the target dimension to obtain the attention fusion result.

[0257] In an exemplary embodiment, the time series features include a first target number of time steps; the initial axial attention layer includes a time axis attention module and a feature axis attention module; the training module 506 is specifically used to determine, based on the target dimension time series features, a first target number of queries, a first target number of keys, and a first target number of values ​​on the time axis using the time axis attention module; based on the first target number of queries and the first target number of keys, the time axis attention module determines the time axis attention weights between each time step and other time steps in the first target number of time steps, obtaining the first target number of time axis attention weights; based on the first target number of values ​​and the first target number of time axis attention weights, the time axis attention module determines the time axis attention result; and the target dimension time series features are input to the feature axis attention module to determine the feature axis attention calculation result.

[0258] In an exemplary embodiment, the target dimension includes a second target number of feature dimensions; the initial axial attention layer includes a time axis attention module and a feature axis attention module; the training module 506 is specifically used to determine, based on the time series features of the target dimension, a second target number of queries, a second target number of keys, and a second target number of values ​​on the feature axis using the feature axis attention calculation unit; based on the second target number of queries and the second target number of keys, using the feature axis attention calculation unit to determine the feature axis attention weights between each feature dimension and each other feature dimension in the second target number of feature dimensions, thereby obtaining the second target number of feature axis attention weights; based on the second target number of values ​​and the second target number of feature axis attention weights, using the feature axis attention calculation unit to determine the feature axis attention calculation result; and inputting the time series features of the target dimension into the time axis attention calculation module to obtain the time axis attention calculation result.

[0259] In an exemplary embodiment, the acquisition module 502 is used to acquire initial training data, which includes initial string data of multiple photovoltaic strings; and to standardize the initial string data of multiple photovoltaic strings to obtain training data.

[0260] Each module in the aforementioned photovoltaic string shading detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0261] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores the data required for implementing a photovoltaic string shading detection method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a photovoltaic string shading detection method.

[0262] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for detecting shading of photovoltaic strings. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0263] Those skilled in the art will understand that Figure 6Alternatively, the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0264] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0265] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.

[0266] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0267] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0268] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0269] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0270] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for detecting shading of photovoltaic strings, characterized in that, include: Obtain string data of the target photovoltaic string, wherein the string data includes the orientation of the target photovoltaic string; The string data of the target photovoltaic string is input into the target occlusion detection model to obtain the shadow occlusion result of the target photovoltaic string. The target occlusion detection model includes a target axial attention layer.

2. The method according to claim 1, characterized in that, The initial occlusion detection model includes an initial axial attention layer, and the method further includes: Acquire training data, which includes string data of multiple photovoltaic strings and multiple shading labels, with each of the multiple photovoltaic strings corresponding to one of the multiple shading labels; The string data of the first photovoltaic string is input into the initial axial attention layer to determine the shading result of the first photovoltaic string; the first photovoltaic string is at least one of the multiple photovoltaic strings. Based on the shading result of the first photovoltaic string and the first shading label, the loss value is determined; the first shading label is the shading label corresponding to the first photovoltaic string among the multiple shading labels; The parameters of the initial occlusion detection model are optimized based on the loss value to obtain the target occlusion detection model.

3. The method according to claim 2, characterized in that, The step of inputting the string data of the first photovoltaic string into the initial axial attention layer to determine the shading result of the first photovoltaic string includes: Based on the string data of the first photovoltaic string, the time axis attention result and feature axis attention result of the first photovoltaic string are determined using the initial axial attention layer; The initial axial attention layer is used to fuse the time axis attention result and the feature axis attention result to obtain the attention fusion result; Based on the attention fusion result, the shadow occlusion result of the first photovoltaic string is determined.

4. The method according to claim 3, characterized in that, The initial prediction model further includes an initial gated recurrent layer; based on the string data of the first photovoltaic string, the initial axial attention layer is used to determine the time axis attention result and feature axis attention result of the first photovoltaic string, including: The string data of the first photovoltaic string is input into the initial gated loop layer to obtain the time series features of the target dimension; Based on the time series features of the target dimension, the time axis attention result and feature axis attention result of the first photovoltaic string are determined using the initial axial attention layer; The initial axial attention layer is used to fuse the time-axis attention result and the feature-axis attention result to obtain an attention fusion result, including: The initial axial attention layer is used to fuse the time axis attention result, the feature axis attention result, and the time series features of the target dimension to obtain the attention fusion result.

5. The method according to claim 4, characterized in that, The time series features include a first target number of time steps; the initial axial attention layer includes a time axis attention module and a feature axis attention module; the determination of the time axis attention result and feature axis attention result of the first photovoltaic string based on the target dimension time series features and using the initial axial attention layer includes: Based on the time series features of the target dimension, the time axis attention module is used to determine the first target number of queries, the first target number of keys, and the first target number of values ​​on the time axis. Based on the first target number of queries and the first target number of keys, the time axis attention module is used to determine the time axis attention weights between each time step and other time steps in the first target number of time steps, thus obtaining the first target number of time axis attention weights. Based on the number of first target values ​​and the number of time axis attention weights for the first target, the time axis attention module is used to determine the time axis attention result. The time series features of the target dimension are input into the feature axis attention module to determine the feature axis attention calculation result.

6. The method according to claim 4, characterized in that, The target dimension includes a second target number of feature dimensions; the initial axial attention layer includes a time axis attention module and a feature axis attention module; The time-series features of the target dimension are input into the initial axial attention layer to obtain the time-axis attention result and feature-axis attention result of the first photovoltaic string, including: Based on the time series features of the target dimension, the feature axis attention calculation unit is used to determine the number of queries, keys, and values ​​of the second target on the feature axis. Based on the second target number of queries and the second target number of keys, the feature axis attention calculation unit is used to determine the feature axis attention weights between each feature dimension and each other feature dimension in the second target number of feature dimensions, and thus obtain the second target number of feature axis attention weights. Based on the number of second target values ​​and the number of feature axis attention weights mentioned above, the feature axis attention calculation unit is used to determine the feature axis attention calculation result. The time series features of the target dimension are input into the time axis attention calculation module to obtain the time axis attention calculation result.

7. The method according to claim 1, characterized in that, The acquisition of training data includes: Acquire initial training data, which includes initial string data of multiple photovoltaic strings; The initial string data of the multiple photovoltaic strings are standardized to obtain the training data.

8. A photovoltaic string shading detection device, characterized in that, include: An acquisition module is used to acquire string data of a target photovoltaic string, the string data including the orientation of the target photovoltaic string; The input module is used to input the string data of the target photovoltaic string into the target shading detection model to obtain the shading result of the target photovoltaic string. The target shading detection model includes a target axial attention layer.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.