A photovoltaic power generation system fault diagnosis method based on digital twin technology

By constructing residual vectors and decision tree models using digital twin technology, the problems of high resource investment and poor data quality in fault diagnosis of photovoltaic power generation systems are solved, and efficient fault identification and classification are achieved under small-scale data.

CN119696505BActive Publication Date: 2025-10-03ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411753072.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-10-03
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

Existing fault diagnosis methods for photovoltaic power generation systems rely on manual and machine inspections, which have problems such as high resource investment, poor data quality, and limited sample size. This results in poor training effects of deep learning models and inability to accurately perform fault diagnosis.

Method used

A method based on digital twin technology is adopted to obtain the ambient temperature, solar irradiance, photovoltaic array voltage and current of the photovoltaic power generation system, construct a residual vector and compare it with the preset threshold, and combine the decision tree and softmax layer fault diagnosis model to perform fault judgment and classification.

Benefits of technology

Under small-scale data conditions, it can effectively identify the fault types of photovoltaic power generation systems, improve the accuracy and efficiency of fault diagnosis, and reduce the cost of equipment and data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696505B_ABST
    Figure CN119696505B_ABST
Patent Text Reader

Abstract

The present invention discloses a photovoltaic power generation system fault diagnosis method based on digital twin technology, comprising obtaining the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current of the photovoltaic power generation system to be diagnosed within a preset time period, and calculating the photovoltaic array power at the corresponding moment based on the photovoltaic array voltage and photovoltaic array current of the photovoltaic power generation system to be diagnosed. This photovoltaic power generation system fault diagnosis method based on digital twin technology constructs a residual vector by taking the difference between the actually obtained ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current and the simulated ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current, and then determines whether the photovoltaic power generation system has a fault based on the residual vector, and further diagnoses the fault category through fault diagnosis. This method can effectively discriminate the actual fault category when only small-scale data training is used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of photovoltaic power generation fault diagnosis, and specifically relates to a photovoltaic power generation system fault diagnosis method based on digital twin technology. Background Art

[0002] Photovoltaic power generation systems, based on solar energy and utilizing materials such as crystalline silicon panels, are a crucial component of my country's power generation system. Comprehensive, real-time, and accurate awareness of the operating status of photovoltaic power generation systems is essential for their safe operation. However, most photovoltaic power generation systems still rely primarily on manual inspections, supplemented by machine inspections. While this approach can meet regulatory requirements, it requires significant human resources.

[0003] Therefore, some power plants are using a combination of drone inspection technology and computer vision to perform intelligent inspection and fault diagnosis of photovoltaic power plants. This approach can quickly complete inspection tasks and accurately identify photovoltaic module faults, but the required equipment resources and data acquisition are expensive, making them difficult to meet in practical systems. Advances in digital technology and the rapid development of artificial intelligence have provided new approaches to fault diagnosis in photovoltaic power generation systems. Deep learning, among other approaches, has attracted widespread attention due to its high fault identification accuracy. However, this approach places high demands on data quality, sample size, and hardware. In the early days of photovoltaic power generation system construction, imperfect data acquisition equipment often resulted in data with significant noise and interference, severely impacting data quality. Furthermore, due to factors such as the short operating time of the system, the number of fault samples was extremely limited, making it difficult to achieve the scale required for effective deep learning model training. This resulted in poor model training results and the inability to accurately diagnose photovoltaic power generation system faults. Summary of the Invention

[0004] The purpose of the present invention is to solve the problems raised in the background technology and propose a photovoltaic power generation system fault diagnosis method based on digital twin technology.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] The present invention proposes a photovoltaic power generation system fault diagnosis method based on digital twin technology, comprising:

[0007] Step 1: Obtain the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current of the photovoltaic power generation system to be diagnosed within a preset time period;

[0008] Step 2: Calculate the photovoltaic array power at the corresponding moment based on the photovoltaic array voltage and photovoltaic array current of the photovoltaic power generation system to be diagnosed, and construct a residual vector by subtracting the photovoltaic array voltage, photovoltaic array current, and photovoltaic array power at the corresponding moment from the preset photovoltaic array voltage, photovoltaic array current, and photovoltaic array power of the photovoltaic power generation system to be diagnosed;

[0009] Step 3: Compare each residual vector with a preset threshold vector to determine whether there is a fault in the photovoltaic power generation system to be diagnosed at the corresponding moment;

[0010] Step 4: When a fault occurs, the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current corresponding to the moment when the fault occurs in the photovoltaic power generation system to be diagnosed are input into a trained fault diagnosis model, wherein the fault diagnosis model includes a preset number of decision trees and a softmax layer, and the output of each decision tree is weighted and summed to obtain the output of the fault diagnosis model;

[0011] Step 5: Pass the output of the fault diagnosis model through the softmax layer to obtain the fault category at the corresponding moment when the photovoltaic power generation system to be diagnosed has a fault.

[0012] Preferably, each photovoltaic array voltage includes a photovoltaic array AC voltage and a photovoltaic array DC voltage, each photovoltaic array current includes a photovoltaic array AC current and a photovoltaic array DC current, and each photovoltaic array power includes a photovoltaic array AC power and a photovoltaic array DC power.

[0013] Preferably, the preset photovoltaic array voltage, photovoltaic array current and photovoltaic array power are obtained by simulating a photovoltaic power generation system, and normal data and abnormal data are obtained by simulating the photovoltaic power generation system, and each data is simulated at different times, wherein the normal data and the abnormal data both include ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current, and the preset photovoltaic array voltage and photovoltaic array current are the photovoltaic array voltage and photovoltaic array current in the normal data, and the preset photovoltaic array power is calculated by using the photovoltaic array voltage and photovoltaic array current in the normal data;

[0014] The simulated photovoltaic power generation system includes a photovoltaic array, a DC / DC converter and a DC / AC converter. The photovoltaic array includes at least one string, which includes eight photovoltaic modules PV connected in series. A first switch S1 is provided in the string. After the string is connected to the second switch S2, it is connected to the input end of the DC / DC converter, and the output end of the DC / DC converter is connected to the input end of the DC / AC converter. The input end of the DC / DC converter is connected to a first voltmeter and a first ammeter, and the output end of the DC / AC converter is connected to a second voltmeter and a second ammeter. The first voltmeter is a DC voltmeter, the first ammeter is a DC ammeter, the second voltmeter is an AC voltmeter, and the second ammeter is an AC ammeter.

[0015] Preferably, the photovoltaic assembly includes a photovoltaic cell, a first resistor R1, a second resistor R2, a capacitor C and a diode D. The photovoltaic cell, the second resistor R2, the diode D and the capacitor C are connected in parallel in sequence. One end of the first resistor R1 is connected to one plate of the capacitor C, the negative electrode of the diode D, one end of the second resistor R2 and the positive electrode of the photovoltaic cell in sequence. The other end of the first resistor R1 serves as the positive electrode of the photovoltaic assembly and is connected to the negative electrode of the adjacent photovoltaic assembly in the string. The negative electrode of the photovoltaic cell, the other end of the second resistor R2, the positive electrode of the diode D and the other plate of the capacitor C are connected to the positive electrode of the adjacent photovoltaic assembly in the string, and the ambient temperature and solar irradiance are input into the photovoltaic cell.

[0016] Preferably, the calculation formula of the residual vector is as follows:

[0017] ;

[0018] in, express The residual vector at time , Indicates that the photovoltaic power generation system to be diagnosed is included The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates that it contains simulated photovoltaic power generation system The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array current at the moment, including AC current and DC current, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array power at the moment, including AC power and DC power, Represents a simulated photovoltaic power generation system The photovoltaic array current at the moment, including AC current and DC current, Represents a simulated photovoltaic power generation system The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Represents a simulated photovoltaic power generation system The PV array power at the moment, including AC power and DC power.

[0019] Preferably, the step of comparing each residual vector with a preset threshold vector to determine whether a fault exists in the photovoltaic power generation system to be diagnosed at a corresponding moment includes:

[0020] When the residual vector is larger than the preset threshold vector, a fault exists;

[0021] When the residual vector is less than or equal to the preset threshold vector, there is no fault.

[0022] Preferably, during the training of the fault diagnosis model:

[0023] Step 4.1: The normal data and abnormal data obtained from the simulation of the photovoltaic power generation system are used to form a training data set. The four category features of the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current corresponding to the corresponding time in the training data set are used as a sample. The training data set contains multiple samples, and a category label is set for each sample.

[0024] Step 4.2: Convert the categorical features of each sample into numerical features using the following formula:

[0025] ;

[0026] in,

[0027] ;

[0028] in, Indicates the Sample No. The categorical features are converted into the corresponding values ​​of the numerical features. represents the number of samples in the training dataset, Indicates the The category labels of samples, Indicates the In the sample Category features, Indicates the In the sample Category features, represents the indicator function, represents the regularization strength, represents the prior term;

[0029] Step 4.3: When constructing each decision tree in the fault diagnosis model, use the training dataset as the root node;

[0030] For each non-leaf node of the current decision tree:

[0031] Step 4.4: For each category feature, calculate the average value of the corresponding value of each category feature in all samples of the current non-leaf node, and use the average value of each category feature as the candidate split node. The samples with the corresponding category feature that are less than the average value and greater than or equal to the average value are respectively selected as the left and right candidate child nodes;

[0032] Step 4.5: Calculate the loss function values ​​of the left and right candidate child nodes respectively, and perform a weighted sum of the loss function values ​​of the left and right candidate child nodes as the total loss of the corresponding candidate split node;

[0033] Step 4.6: Compare the total loss of each candidate split node with its parent node, select the candidate split node with the largest total loss reduction as the split node, and split it into the corresponding left and right candidate child nodes;

[0034] Repeat steps 4.4 to 4.6 until the decision tree reaches the preset depth or the total loss of all candidate split nodes remains unchanged relative to their parent nodes, then no further splitting is performed and the current decision tree is obtained;

[0035] Step 4.7: Based on the output of the current decision tree and the minimized loss function, determine the parameters and weights of the next decision tree. The formula is as follows:

[0036] ;

[0037] in,

[0038] ;

[0039] ;

[0040] ;

[0041] ;

[0042] in, Indicates the The output of a decision tree, Indicates the The output of a decision tree, Indicates the The weight of a decision tree, Indicates the The weight of a decision tree, After weighting, The output of a decision tree, After weighting, The output of a decision tree, represents the input of the decision tree, that is, the training data set, Indicates the Decision tree parameters, Indicates the Decision tree parameters, represents the loss function, and is the cross entropy loss function, Indicates the training data set samples, Indicates the training data set The negative gradient of the loss function for each sample, Indicates the The category labels of samples;

[0043] Step 4.8: Perform a weighted summation on the outputs of all current decision trees to obtain the output of the fault diagnosis model. Then, pass the output of the fault diagnosis model through the softmax layer to obtain the predicted fault category, and then use the loss function to calculate the loss.

[0044] Step 4.9: Continue to increase the number of decision trees until the preset number of trees is reached or the loss function value converges, then a trained fault diagnosis model is obtained, and the output of the fault diagnosis model is expressed as follows:

[0045] ;

[0046] in, represents the output of the fault diagnosis model, Represents the number of decision trees in the fault diagnosis model.

[0047] Preferably, the loss function is cross entropy loss, and the calculation formula is as follows:

[0048] ;

[0049] in,

[0050] ;

[0051] in, represents the number of categories of all categories, is an indicator variable, if The true category of the samples is ,but is 1, otherwise it is 0. Indicates the samples belong to the category The probability of represents the exponential function, Indicates the The samples in the category The predicted value on The number of categories representing all categories The serial number in .

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] This photovoltaic power generation system fault diagnosis method based on digital twin technology constructs a residual vector by taking the difference between the actual ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current and the simulated ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current. It then judges whether there is a fault in the photovoltaic power generation system based on the residual vector, and further diagnoses the fault category through fault diagnosis. It can effectively distinguish the actual fault category with only small-scale data training. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is a flow chart of the photovoltaic power generation system fault diagnosis method based on digital twin technology of the present invention;

[0055] Figure 2 A circuit diagram of a simulated photovoltaic power generation system according to the present invention;

[0056] Figure 3 This is a circuit diagram of a photovoltaic module in a simulated photovoltaic power generation system according to the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0058] like Figure 1-Figure 3 As shown, a photovoltaic power generation system fault diagnosis method based on digital twin technology is provided, including:

[0059] Step 1: Obtain the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current of the photovoltaic power generation system to be diagnosed within a preset time period; and then obtain the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current at each moment within the preset time period;

[0060] Each photovoltaic array voltage described in this solution includes the photovoltaic array AC voltage and the photovoltaic array DC voltage, each photovoltaic array current includes the photovoltaic array AC current and the photovoltaic array DC current, and each photovoltaic array power includes the photovoltaic array AC power and the photovoltaic array DC power, which will not be repeated below.

[0061] Step 2: Calculate the photovoltaic array power at the corresponding moment based on the photovoltaic array voltage and photovoltaic array current of the photovoltaic power generation system to be diagnosed, and construct a residual vector by subtracting the photovoltaic array voltage, photovoltaic array current, and photovoltaic array power at the corresponding moment from the preset photovoltaic array voltage, photovoltaic array current, and photovoltaic array power of the photovoltaic power generation system to be diagnosed.

[0062] The photovoltaic array voltage, photovoltaic array current and photovoltaic array power of the photovoltaic power generation system to be diagnosed at the corresponding moment and the preset photovoltaic array voltage, photovoltaic array current and photovoltaic array power are all at the corresponding moment.

[0063] The preset photovoltaic array voltage, photovoltaic array current and photovoltaic array power are obtained by simulating the photovoltaic power generation system, and normal data and abnormal data are obtained by simulating the photovoltaic power generation system, and each data is simulated at different times (that is, all simulated data are at different times), wherein the normal data and abnormal data both include ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current, and the preset photovoltaic array voltage and photovoltaic array current are the photovoltaic array voltage and photovoltaic array current in the normal data, and the preset photovoltaic array power is calculated by using the photovoltaic array voltage and photovoltaic array current in the normal data.

[0064] like Figure 2 As shown, the simulated photovoltaic power generation system includes a photovoltaic array, a DC / DC converter and a DC / AC converter. The photovoltaic array includes at least one string, and the string includes eight photovoltaic modules PV (connected in series) Figure 2 The end of the photovoltaic module PV pointed by the triangle arrow is the positive pole, and the other end is the negative pole), and a first switch S1 is provided in the string. After the string is connected to the second switch S2, it is connected to the input end of the DC / DC converter, and the output end of the DC / DC converter is connected to the input end of the DC / AC converter. The input end of the DC / DC converter is connected to a first voltmeter and a first ammeter, and the output end of the DC / AC converter is connected to a second voltmeter and a second ammeter. The first voltmeter is a DC voltmeter, the first ammeter is a DC ammeter, the second voltmeter is an AC voltmeter, and the second ammeter is an AC ammeter.

[0065] The number of strings is not limited and can be set according to actual needs. In this embodiment, Figure 2The figure shows two strings connected in parallel. Each string includes eight PV modules connected in series. A first switch S1 and a third switch S3 are provided in the two strings in a one-to-one correspondence. The two strings are connected to the second switch S2 and the fourth switch S4 in a one-to-one correspondence, and then connected to the input of a DC / DC converter. The output of the DC / DC converter is connected to the input of a DC / AC converter. The data detected by each voltmeter is the PV array voltage, and the data detected by each ammeter is the PV array current.

[0066] Among them, such as Figure 3 As shown, each photovoltaic module includes a photovoltaic cell, a first resistor R1, a second resistor R2, a capacitor C and a diode D. The photovoltaic cell, the second resistor R2, the diode D and the capacitor C are connected in parallel in sequence. One end of the first resistor R1 is connected to one plate of the capacitor C, the negative electrode of the diode D, one end of the second resistor R2 and the positive electrode of the photovoltaic cell in sequence. The other end of the first resistor R1 serves as the positive electrode of the photovoltaic module and is connected to the negative electrode of the adjacent photovoltaic module in the string. The negative electrode of the photovoltaic cell, the other end of the second resistor R2, the positive electrode of the diode D and the other plate of the capacitor C are connected to the positive electrode of the adjacent photovoltaic module in the string. The ambient temperature and solar irradiance are input to the photovoltaic cell (the photovoltaic cell calculates the photovoltaic array voltage and current based on the ambient temperature and solar irradiance).

[0067] The calculation formula of the residual vector is as follows:

[0068] ;

[0069] in, express The residual vector at time , Indicates that the photovoltaic power generation system to be diagnosed is included The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates that it contains simulated photovoltaic power generation system The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array current at the moment, including AC current and DC current (the photovoltaic power generation system to be diagnosed The combination of AC current and DC current of the photovoltaic array at the moment Similarly, the following photovoltaic array voltage and photovoltaic array power are also the same and will not be described again). Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array power at the moment, including AC power and DC power, Represents a simulated photovoltaic power generation system The photovoltaic array current at the moment, including AC current and DC current, Represents a simulated photovoltaic power generation system The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Represents a simulated photovoltaic power generation system The PV array power at the moment, including AC power and DC power.

[0070] Step 3: Compare each residual vector with a preset threshold vector to determine whether there is a fault in the photovoltaic power generation system to be diagnosed at the corresponding moment, including:

[0071] When the residual vector is larger than the preset threshold vector, a fault exists;

[0072] When the residual vector is less than or equal to the preset threshold vector, there is no fault.

[0073] Step 4. When a fault occurs, the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current at the corresponding moment when the photovoltaic power generation system to be diagnosed has a fault are input into the trained fault diagnosis model, where the fault diagnosis model includes a preset number of decision trees and a softmax layer, and the output of each decision tree is weighted and summed to obtain the output of the fault diagnosis model.

[0074] The process of training the fault diagnosis model is as follows:

[0075] Step 4.1: The normal data (i.e., data without faults) and abnormal data (data with faults) obtained from the simulated photovoltaic power generation system are combined into a training data set. The four category features of ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current corresponding to the corresponding time in the training data set are used as a sample. The training data set contains multiple samples, and a category label is set for each sample (a category label is set for each sample's fault category, represented by a number);

[0076] The abnormal data obtained by simulation include four typical faults: short circuit, partial shadow, aging and open circuit. In this embodiment, Figure 2 and Figure 3 In the simulation, the maximum output power of the PV module is set to 330W, the maximum power point voltage is set to 37.2V, the maximum power point current is set to 8.88A, the open circuit voltage is set to 45.6V, and the short circuit current is set to 9.45A. The implementation methods of simulating four typical faults: short circuit, partial shadow, aging, and open circuit are as follows:

[0077] like Figure 2-Figure 3As shown, the occurrence of a short-circuit fault is simulated by changing the value of the second resistor R2. When short-circuit abnormal data is needed, the value of R2 can be adjusted to zero. At this time, the photovoltaic component is short-circuited and a fault occurs; when aging abnormal data is needed, the aging fault can be simulated by changing the value of the first resistor R1. The value of R1 is adjusted to a very large value. At this time, the resistance of the transmission line becomes larger and the current becomes smaller, and a fault occurs; when open-circuit abnormal data is needed, an open-circuit fault can be simulated by changing the switch S1 or S3 on the transmission line. At this time, the open-circuit power generation power of part of the transmission line is reduced, and a fault occurs; when local shadow abnormal data is needed, the Shadow value is set, and the Shadow value is multiplied by the solar irradiance and input into the photovoltaic cell to simulate a local shadow fault. At this time, the power generation power is reduced and a fault occurs. Figure 3 Where G represents solar irradiance, T represents ambient temperature, and X represents multiplication.

[0078] Step 4.2: Convert the categorical features of each sample into numerical features using the following formula:

[0079] ;

[0080] in,

[0081] ;

[0082] in, Indicates the Sample No. The categorical features are converted into the corresponding values ​​of the numerical features. represents the number of samples in the training dataset, Indicates the The category labels of samples, Indicates the In the sample Category features, Indicates the In the sample Category features, represents the indicator function, represents the regularization strength, Represents the prior term (the prior probability of the category label).

[0083] Step 4.3: When constructing each decision tree in the fault diagnosis model, use the training dataset as the root node.

[0084] For each non-leaf node of the current decision tree:

[0085] Step 4.4. For each category feature, calculate the average value of the corresponding values ​​of each category feature in all samples of the current non-leaf node (that is, calculate the average value of each category feature of the current non-leaf node (a total of four category features) in all samples), and use the average value of each category feature as a candidate split node (each of the four category features corresponds to a candidate split node), and use the samples of the corresponding category features that are less than the average value and greater than or equal to the average value as the left and right candidate child nodes respectively (each of the four category features corresponds to two left and right candidate child nodes).

[0086] Step 4.5: Calculate the loss function values ​​of the left and right candidate child nodes respectively (for each category feature, calculate the loss function values ​​of the left and right candidate child nodes), and take the weighted sum of the loss function values ​​of the left and right candidate child nodes (the weight is the ratio of the number of samples in the candidate child node to the total number of samples in the current non-leaf node) as the total loss of the corresponding candidate split node;

[0087] Step 4.6. Compare the total loss of each candidate split node with its parent node (compare the total loss of the candidate split nodes corresponding to the four features with the total loss of their parent node), select the candidate split node with the largest total loss reduction as the split node, and split it according to the corresponding left and right candidate child nodes.

[0088] Repeat steps 4.4 to 4.6 until the decision tree reaches the preset depth or the total loss of all candidate split nodes remains unchanged relative to their parent nodes, then no further splitting is performed and the current decision tree is obtained.

[0089] Step 4.7: Based on the output of the current decision tree and the minimized loss function, determine the parameters and weights of the next decision tree. The formula is as follows:

[0090] ;

[0091] in,

[0092] ;

[0093] ;

[0094] ;

[0095] ;

[0096] in, Indicates the The output of a decision tree, Indicates the The output of a decision tree, Indicates the The weight of a decision tree, Indicates the The weight of a decision tree, After weighting, The output of a decision tree, After weighting, The output of a decision tree, represents the input of the decision tree, that is, the training data set, Indicates the Decision tree parameters, Indicates the Decision tree parameters, represents the loss function, and is the cross entropy loss function, Indicates the training data set samples, Indicates the training data set The negative gradient of the loss function for each sample, Indicates the The category labels of samples.

[0097] For the weight Update: Initialization For an initial value (e.g. );

[0098] Calculate the loss function about Gradient ;

[0099] Update based on gradient , for example using gradient descent:

[0100] ;

[0101] in is the learning rate;

[0102] Repeat the above weights The update steps are repeated until the loss function converges or the maximum number of iterations is reached.

[0103] Similarly for weights The same is true for updates, which will not be described in detail.

[0104] Step 4.8: Perform weighted summation on the outputs of all current decision trees to obtain the output of the fault diagnosis model. Then, pass the output of the fault diagnosis model through the softmax layer to obtain the predicted fault category, and then use the loss function to calculate the loss.

[0105] Step 4.9: Continue to increase the number of decision trees until the preset number of trees is reached or the loss function value converges, then a trained fault diagnosis model is obtained, and the output of the fault diagnosis model is expressed as follows:

[0106] ;

[0107] in, represents the output of the fault diagnosis model, Represents the number of decision trees in the fault diagnosis model.

[0108] Among them, the loss function is cross entropy loss, and the calculation formula is as follows:

[0109] ;

[0110] in,

[0111] ;

[0112] in, The number of classes representing all classes (including normal classes and classes with failures), is an indicator variable, if The true category of the samples is ,but is 1, otherwise it is 0. Indicates the samples belong to the category The probability of represents the exponential function, Indicates the The samples in the category The predicted value on The number of categories representing all categories The serial number in .

[0113] Step 5: Pass the output of the fault diagnosis model through the softmax layer to obtain the fault category at the corresponding moment when the photovoltaic power generation system to be diagnosed has a fault (such as normal, that is, no fault (this situation occurs because the judgment in step 3 may be wrong), or short circuit, partial shadow, aging and open circuit faults).

[0114] The digital twin technology in this photovoltaic power generation system fault diagnosis method based on digital twin technology is to construct a residual vector by subtracting the actual ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current from the simulated ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current.

[0115] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0116] This photovoltaic power generation system fault diagnosis method based on digital twin technology constructs a residual vector by taking the difference between the actual ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current and the simulated ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current. It then judges whether there is a fault in the photovoltaic power generation system based on the residual vector, and further diagnoses the fault category through fault diagnosis. It can effectively distinguish the actual fault category with only small-scale data training.

[0117] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A photovoltaic power generation system fault diagnosis method based on digital twin technology, characterized by: The photovoltaic power generation system fault diagnosis method based on digital twin technology includes: Step 1: Obtain the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current of the photovoltaic power generation system to be diagnosed within a preset time period; Step 2: Calculate the photovoltaic array power at the corresponding moment based on the photovoltaic array voltage and photovoltaic array current of the photovoltaic power generation system to be diagnosed, and construct a residual vector by subtracting the photovoltaic array voltage, photovoltaic array current, and photovoltaic array power at the corresponding moment from the preset photovoltaic array voltage, photovoltaic array current, and photovoltaic array power of the photovoltaic power generation system to be diagnosed; The preset photovoltaic array voltage, photovoltaic array current and photovoltaic array power are obtained by simulating a photovoltaic power generation system, and normal data and abnormal data are obtained by simulating the photovoltaic power generation system, wherein the normal data and abnormal data both include ambient temperature, solar irradiance, photovoltaic array voltage and photovoltaic array current; Step 3: Compare each residual vector with a preset threshold vector to determine whether there is a fault in the photovoltaic power generation system to be diagnosed at the corresponding moment; Step 4: When a fault occurs, the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current corresponding to the moment when the fault occurs in the photovoltaic power generation system to be diagnosed are input into a trained fault diagnosis model, wherein the fault diagnosis model includes a preset number of decision trees and a softmax layer, and the output of each decision tree is weighted and summed to obtain the output of the fault diagnosis model; Wherein, during the process of training the fault diagnosis model: Step 4.1: The normal data and abnormal data obtained from the simulation of the photovoltaic power generation system are used to form a training data set. The four category features of the ambient temperature, solar irradiance, photovoltaic array voltage, and photovoltaic array current corresponding to the corresponding time in the training data set are used as a sample. The training data set contains multiple samples, and a category label is set for each sample. Step 4.2: Convert the categorical features of each sample into numerical features using the following formula: ; in, ; in, Indicates the Sample No. The categorical features are converted into the corresponding values ​​of the numerical features. represents the number of samples in the training dataset, Indicates the The category labels of samples, Indicates the In the sample Category features, Indicates the In the sample Category features, represents the indicator function, represents the regularization strength, represents the prior term; Step 4.3: When constructing each decision tree in the fault diagnosis model, use the training dataset as the root node; For each non-leaf node of the current decision tree: Step 4.4: For each category feature, calculate the average value of the corresponding value of each category feature in all samples of the current non-leaf node, and use the average value of each category feature as the candidate split node. The samples with the corresponding category feature that are less than the average value and greater than or equal to the average value are respectively selected as the left and right candidate child nodes; Step 4.5: Calculate the loss function values ​​of the left and right candidate child nodes respectively, and perform a weighted sum of the loss function values ​​of the left and right candidate child nodes as the total loss of the corresponding candidate split node; Step 4.6: Compare the total loss of each candidate split node with its parent node, select the candidate split node with the largest total loss reduction as the split node, and split it into the corresponding left and right candidate child nodes; Repeat steps 4.4 to 4.6 until the decision tree reaches the preset depth or the total loss of all candidate split nodes remains unchanged relative to their parent nodes, then no further splitting is performed and the current decision tree is obtained; Step 4.7: Based on the output of the current decision tree and the minimized loss function, determine the parameters and weights of the next decision tree. The formula is as follows: ; in, ; ; ; ; in, Indicates the The output of a decision tree, Indicates the The output of a decision tree, Indicates the The weight of a decision tree, Indicates the The weight of a decision tree, After weighting, The output of a decision tree, After weighting, The output of a decision tree, represents the input of the decision tree, that is, the training data set, Indicates the Decision tree parameters, Indicates the Decision tree parameters, represents the loss function, and is the cross entropy loss function, Indicates the training data set samples, Indicates the training data set The negative gradient of the loss function for each sample, Indicates the The category labels of samples; Step 4.8: Perform a weighted summation on the outputs of all current decision trees to obtain the output of the fault diagnosis model. Then, pass the output of the fault diagnosis model through the softmax layer to obtain the predicted fault category, and then use the loss function to calculate the loss. Step 4.9: Continue to increase the number of decision trees until the preset number of trees is reached or the loss function value converges, then a trained fault diagnosis model is obtained, and the output of the fault diagnosis model is expressed as follows: ; in, represents the output of the fault diagnosis model, Indicates the number of decision trees in the fault diagnosis model; Step 5: Pass the output of the fault diagnosis model through the softmax layer to obtain the fault category at the corresponding moment when the photovoltaic power generation system to be diagnosed has a fault.

2. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 1, characterized in that: Each photovoltaic array voltage includes a photovoltaic array AC voltage and a photovoltaic array DC voltage, each photovoltaic array current includes a photovoltaic array AC current and a photovoltaic array DC current, and each photovoltaic array power includes a photovoltaic array AC power and a photovoltaic array DC power.

3. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 1, characterized in that: Normal data and abnormal data are obtained by simulation at different times, and the preset photovoltaic array voltage and photovoltaic array current are the photovoltaic array voltage and photovoltaic array current in the normal data, and the preset photovoltaic array power is calculated by the photovoltaic array voltage and photovoltaic array current in the normal data; The simulated photovoltaic power generation system includes a photovoltaic array, a DC / DC converter and a DC / AC converter. The photovoltaic array includes at least one string, which includes eight photovoltaic modules PV connected in series. A first switch S1 is provided in the string. After the string is connected to the second switch S2, it is connected to the input end of the DC / DC converter, and the output end of the DC / DC converter is connected to the input end of the DC / AC converter. The input end of the DC / DC converter is connected to a first voltmeter and a first ammeter, and the output end of the DC / AC converter is connected to a second voltmeter and a second ammeter. The first voltmeter is a DC voltmeter, the first ammeter is a DC ammeter, the second voltmeter is an AC voltmeter, and the second ammeter is an AC ammeter.

4. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 3, characterized in that: The photovoltaic assembly includes a photovoltaic cell, a first resistor R1, a second resistor R2, a capacitor C and a diode D. The photovoltaic cell, the second resistor R2, the diode D and the capacitor C are connected in parallel in sequence. One end of the first resistor R1 is connected to one plate of the capacitor C, the negative electrode of the diode D, one end of the second resistor R2 and the positive electrode of the photovoltaic cell in sequence. The other end of the first resistor R1 serves as the positive electrode of the photovoltaic assembly and is connected to the negative electrode of the adjacent photovoltaic assembly in the string. The negative electrode of the photovoltaic cell, the other end of the second resistor R2, the positive electrode of the diode D and the other plate of the capacitor C are connected to the positive electrode of the adjacent photovoltaic assembly in the string. The ambient temperature and solar irradiance are both input into the photovoltaic cell.

5. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 2, characterized in that: The calculation formula of the residual vector is as follows: ; in, express The residual vector at time , Indicates that the photovoltaic power generation system to be diagnosed is included The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates that it contains simulated photovoltaic power generation system The data of photovoltaic array voltage, photovoltaic array current and photovoltaic array power at the moment, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array current at the moment, including AC current and DC current, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Indicates the photovoltaic power generation system to be diagnosed The photovoltaic array power at the moment, including AC power and DC power, Represents a simulated photovoltaic power generation system The photovoltaic array current at the moment, including AC current and DC current, Represents a simulated photovoltaic power generation system The photovoltaic array voltage at the moment, including AC voltage and DC voltage, Represents a simulated photovoltaic power generation system The PV array power at the moment, including AC power and DC power.

6. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 1, characterized in that: The step of comparing each residual vector with a preset threshold vector to determine whether a fault exists in the photovoltaic power generation system to be diagnosed at a corresponding moment includes: When the residual vector is larger than the preset threshold vector, a fault exists; When the residual vector is less than or equal to the preset threshold vector, there is no fault.

7. The photovoltaic power generation system fault diagnosis method based on digital twin technology according to claim 1, characterized in that: The loss function is cross entropy loss, and the calculation formula is as follows: ; in, ; in, represents the number of categories of all categories, is an indicator variable, if The true category of the samples is ,but is 1, otherwise it is 0. Indicates the samples belong to the category The probability of represents the exponential function, Indicates the The samples in the category The predicted value on The number of categories representing all categories The serial number in .

Citation Information

Patent Citations

  • Photovoltaic array area fault diagnosis method and system based on unmanned aerial vehicle

    CN115310351A

  • Method and system for establishing data twin based on photovoltaic flexible support

    CN118504433A