Fault detection method and device, electronic equipment and storage medium

By combining the state space model unit with the residual structure, the global feature extraction ability of photovoltaic component fault detection methods is improved, and the problem of poor generalization performance in the existing methods in multi -class category tasks has been solved, and more efficient and reliable fault detection has Essence

CN119339153APending Publication Date: 2025-01-21GOODWE TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411517158.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing photovoltaic module fault detection methods have poor generalization performance in multi-classification tasks and are difficult to effectively extract global features of the data set, resulting in frequent misclassification.

Method used

Combined with the state space model unit and the residual structure, the model improves the global feature extraction capacity of photovoltaic component-voltage curve image, and the type of faulty type is performed through the preset classification model.

Benefits of technology

Improved the reliability of photovoltaic component failure detection, enhanced the generalized performance of multi -classification tasks, and reduced the situation of wrong classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339153A_ABST
    Figure CN119339153A_ABST
Patent Text Reader

Abstract

The invention provides a fault detection method and device, electronic equipment and a storage medium, and relates to the field of artificial intelligence, and the method comprises the steps: converting the current-voltage data of a photovoltaic module into a current-voltage curve image; performing classification processing on the current-voltage curve image by using a preset classification model, and determining prediction probabilities of the current-voltage curve image corresponding to various preset fault types; wherein the preset classification model comprises a preset residual module, the preset residual module is formed by connecting a first convolution unit, a state space model unit and a second convolution unit in series, and the input end of the preset residual module is connected with the first convolution unit and the second convolution unit; the state space model unit is used for performing global feature extraction on the multiple groups of local features extracted by the first convolution unit; determining a target preset fault type corresponding to the current-voltage curve image according to the prediction probability; and the reliability of photovoltaic module fault detection can be improved based on the good global feature extraction capability of the state space model unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a fault detection method, device, electronic equipment and storage medium. Background Art

[0002] With the continuous development of new energy technologies, large-scale ground photovoltaic power stations have been rapidly expanded. However, since photovoltaic arrays and power stations are installed and work in harsh outdoor environments, and are easily affected by various environmental factors such as thermal cycles, humidity, ultraviolet rays, wind vibration, etc., they can cause local aging of materials, performance degradation, cracks and other failures, which greatly affect the electrical characteristics of photovoltaic arrays and further affect the power generation efficiency of photovoltaic power stations. Therefore, it is particularly important to provide an accurate, efficient and reliable fault detection method for photovoltaic modules / arrays.

[0003] In the related technologies, photovoltaic fault classification methods can be roughly divided into two categories: one is based on the physical modeling of photovoltaic components, and the other is based on traditional machine learning. The fault classification method based on the physical modeling of photovoltaic components is easily affected by different environments and has poor generalization performance; although the traditional machine learning method can achieve good generalization performance, it often misclassifies in multi-classification tasks because it does not learn the subtle differences in the global features of the data set. Summary of the invention

[0004] The purpose of the present invention is to provide a fault detection method, device, electronic device and storage medium, which can combine a state-space model unit with a residual structure, and use the state-space model unit to enhance the model's global feature extraction capability for a current-voltage curve image corresponding to a photovoltaic component, thereby improving the reliability of fault detection of the photovoltaic component.

[0005] In order to solve the above technical problems, the present invention provides a fault detection method, comprising:

[0006] Convert the current-voltage data of the photovoltaic module into a current-voltage curve image;

[0007] Using a preset classification model to classify the current-voltage curve image, and determine the predicted probability of the current-voltage curve image corresponding to various preset fault types;

[0008] The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series. The input end of the preset residual module is connected to the first convolution unit and the second convolution unit. The state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit.

[0009] A target preset fault type corresponding to the current-voltage curve image is determined according to the predicted probability.

[0010] Optionally, the preset classification model is composed of an entry module, the preset residual module, and an exit module connected in series;

[0011] The classifying process of the current-voltage curve image by using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types includes:

[0012] Using the entry module, sequentially performing convolution processing, batch normalization processing, activation processing, and maximum pooling processing on the embedding matrix corresponding to the current-voltage curve image to obtain a first feature matrix;

[0013] Using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix;

[0014] The export module is used to sequentially perform global average pooling processing and normalized index processing on the second characteristic matrix to obtain the predicted probability of the current-voltage curve image corresponding to various preset fault types.

[0015] Optionally, the using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix includes:

[0016] Using the first convolution unit to perform convolution processing, batch normalization processing, and activation processing on the first feature matrix to extract multiple groups of local features in the first feature matrix to obtain a first intermediate matrix;

[0017] Using the state space model unit to perform feature extraction processing on the first intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix;

[0018] The second convolution unit is used to perform convolution processing and batch normalization processing on the second intermediate matrix to obtain a third intermediate matrix, the third intermediate matrix is ​​concatenated with the first feature matrix, and activation processing is performed on the concatenated result to obtain a second feature matrix.

[0019] Optionally, the state space model unit is composed of a first deformation layer, a layer normalization layer, a Mamba-2 layer, and a second deformation layer connected in series;

[0020] The using the state space model unit to perform feature extraction processing on the first intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix includes:

[0021] Performing matrix transformation processing on the first intermediate matrix by using the first deformation layer to transform the matrix size of the first intermediate matrix into a preset size, thereby obtaining a fourth intermediate matrix;

[0022] Performing layer normalization processing on the fourth intermediate matrix using a layer normalization layer to obtain a fifth intermediate matrix;

[0023] Performing feature extraction processing on the fifth intermediate matrix by using the Mamba-2 layer to uniformly extract global features of the multiple groups of local features, thereby obtaining a sixth intermediate matrix;

[0024] The second deformation layer is used to perform matrix transformation processing on the sixth intermediate matrix to transform the matrix size of the sixth intermediate matrix into the original size of the first intermediate matrix, thereby obtaining the second intermediate matrix.

[0025] Optionally, the using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix includes:

[0026] The first feature matrix is ​​subjected to feature extraction processing by using a plurality of preset residual modules to obtain the second feature matrix; wherein the plurality of preset residual modules are connected in series in order, and the number of network layer channels set by a former preset residual module is less than the number of network layer channels set by a latter preset residual module.

[0027] Optionally, the training process of the preset classification model includes:

[0028] Acquire an image data set, and extract a corresponding number of image data from the image data set according to a preset number ratio as training data; wherein the image data is a current-voltage curve image and a preset fault type annotated therewith;

[0029] The initial classification model is trained for multiple rounds using the training data and the loss function, and the training is stopped when the loss value generated by the initial classification model is less than a preset threshold, thereby obtaining the preset classification model; wherein the loss value is calculated using the preset fault type marked by the training data, the preset fault type determined by the initial classification model for the training data, and the loss function.

[0030] Optionally, after acquiring the image dataset, the method further includes:

[0031] Extracting a corresponding number of image data from the image data set as test data according to a preset number ratio;

[0032] The initial classification model is trained multiple times using the training data and the loss function until the loss value generated by the initial classification model is less than a preset threshold, and the training is stopped to obtain the preset classification model, including:

[0033] Using the training data and the loss function, multiple rounds of training are performed on different initial classification models until the loss values ​​generated by each of the initial classification models are less than a preset threshold, and the training is stopped to obtain different candidate classification models; wherein different initial classification models correspond to different initial model parameters;

[0034] The test data is used to perform verification processing on different candidate classification models to obtain a verification value for each candidate classification model, and a preset classification model is selected from the candidate classification models based on the verification value; wherein the verification value is obtained by using the preset fault type marked by the test data and the preset fault type determined by the candidate classification model for the test data.

[0035] The present invention also provides a fault detection device, comprising:

[0036] A conversion module, used for converting the current-voltage data of the photovoltaic module into a current-voltage curve image;

[0037] A classification module, used to classify the current-voltage curve image using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types;

[0038] The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series. The input end of the preset residual module is connected to the first convolution unit and the second convolution unit. The state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit.

[0039] The type determination module is used to determine the target preset fault type corresponding to the current-voltage curve image according to the predicted probability.

[0040] The present invention also provides an electronic device, comprising:

[0041] Memory for storing computer programs;

[0042] A processor is used to implement the fault detection method as described above when executing the computer program.

[0043] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the fault detection method as described above is implemented.

[0044] The present invention provides a fault detection method, comprising: converting current-voltage data of a photovoltaic component into a current-voltage curve image; classifying the current-voltage curve image using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types; wherein the preset classification model comprises a preset residual module, the preset residual module is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series, the input end of the preset residual module is connected to the first convolution unit and the second convolution unit, the state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit; and determining the target preset fault type corresponding to the current-voltage curve image according to the predicted probability.

[0045] It can be seen that the present invention can first convert the current and voltage of the photovoltaic module into a current-voltage curve image, and then use the preset classification model to classify the current-voltage curve image, determine the predicted probability of the current-voltage curve image corresponding to various preset fault types, and determine the target preset fault type corresponding to the current-voltage curve image according to the predicted probability. Among them, the preset classification model includes a preset residual module, the preset residual module is composed of a first convolution unit, a state space model unit, and a second convolution unit in series, the input end of the preset residual module is connected to the first convolution unit and the second convolution unit, and the state space model unit is used to extract global features from multiple groups of local features extracted by the first convolution unit. In other words, the present invention can combine the state space model unit with the residual structure, use the state space model unit to extract global features from multiple groups of local features extracted by the convolution unit, and then improve the global feature extraction performance of the model based on the better global feature extraction performance of the state space model unit, so as to improve the reliability of fault detection of photovoltaic modules. The present invention also provides a fault detection device, an electronic device, and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0047] Figure 1 A flowchart of a fault detection method provided by an embodiment of the present invention;

[0048] Figure 2 A schematic diagram of a preset residual module provided by an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of another preset residual module provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of a preset classification model provided by an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of a state space model unit provided by an embodiment of the present invention;

[0052] Figure 6 A structural block diagram of a fault detection device provided by an embodiment of the present invention;

[0053] Figure 7 The present invention provides a structural block diagram of an electronic device. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] With the continuous development of new energy technologies, large-scale ground photovoltaic power stations have been rapidly expanded. However, since photovoltaic arrays and power stations are installed and work in harsh outdoor environments, and are easily affected by various environmental factors such as thermal cycles, humidity, ultraviolet rays, wind vibration, etc., they can cause local aging of materials, performance degradation, cracks and other failures, which greatly affect the electrical characteristics of photovoltaic arrays and further affect the power generation efficiency of photovoltaic power stations. Therefore, it is particularly important to provide an accurate, efficient and reliable fault detection method for photovoltaic modules / arrays.

[0056] In the related technologies, photovoltaic fault classification methods can be roughly divided into two categories: one is based on the physical modeling of photovoltaic components, and the other is based on traditional machine learning. The fault classification method based on the physical modeling of photovoltaic components is easily affected by different environments and has poor generalization performance; although the traditional machine learning method can achieve good generalization performance, it often misclassifies in multi-classification tasks because it does not learn the subtle differences in the global features of the data set.

[0057] In view of this, in order to solve the technical problem of how to detect faults in photovoltaic modules, the present invention can provide a fault detection method, which can combine the state-space model unit with the residual structure, and use the state-space model unit to enhance the model's global feature extraction capability for the current-voltage curve image corresponding to the photovoltaic module, thereby improving the reliability of photovoltaic module fault detection.

[0058] Please refer to Figure 1 , Figure 1 A flowchart of a fault detection method provided by an embodiment of the present invention, the method may include:

[0059] S101, converting the current-voltage data of the photovoltaic module into a current-voltage curve image.

[0060] In this step, the current-voltage data of the photovoltaic module can be converted into a current-voltage curve image (IV curve image) to detect faults of the photovoltaic module based on the current-voltage curve image. The current-voltage curve image can reflect the volt-ampere characteristics of the photovoltaic module in a normal state and a fault state, so the faults of the photovoltaic module can be detected by classifying the current-voltage curve image.

[0061] S102, classify the current-voltage curve image using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types. The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series, and the input end of the preset residual module is connected to the first convolution unit and the second convolution unit, and the state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit.

[0062] In this step, the preset classification model will be used to classify the above current-voltage curve image to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types. Among them, the preset classification model is a trained neural network model used to perform image multi-classification tasks. There can be multiple preset fault types, such as material aging, performance degradation, etc., which can be set according to actual application requirements.

[0063] Furthermore, in view of the fact that the traditional machine learning model adopted by the related technology does not have a strong global feature extraction capability, the present embodiment may set an improved preset residual module in the preset classification model, in which a state space model unit (SSM, State Space Model) is provided, which can enhance the global feature extraction capability of the model. Among them, the state space model is a model used to describe the state representation of a sequence at each time step, and predict its next state based on the input. Introducing the state space model into the traditional convolutional network model (CNN, Convolutional Neural Networks) can enhance the global feature extraction capability of the convolutional network model, especially the model's ability to extract subtle features in the current-voltage curve image, and ensure that the model can effectively distinguish subtle differences between the global features of the current-voltage curve image. For ease of understanding, please refer to Figure 2 , Figure 2 A schematic diagram of a preset residual module provided by an embodiment of the present invention. The module includes a first convolution unit, a state space model unit and a second convolution unit, and the three units are connected in series in sequence. In addition, the input end of the preset residual module is connected to the first convolution unit and the second convolution unit, and the output end of the preset residual module is connected to the second convolution unit. The specific uses of these three units are: the first convolution unit is used to perform convolution processing on the input of the preset residual module to extract multiple groups of local features; the state space model unit is used to perform global feature extraction on the multiple groups of local features extracted by the first convolution unit; the second convolution unit is used to perform convolution processing on the global features, and splice the convolution processing results with the input of the preset residual module to obtain the output of the preset residual module, so as to retain the gradient information in the output. In other words, this embodiment can combine the traditional convolution network model with the state space model, and set the state space model unit after the first convolution unit of the preset residual module, so as to use the state space model unit to uniformly perform global feature extraction on the multiple groups of local features extracted by the first convolution unit, thereby improving the overall feature extraction capability of the model, and further improving the overall classification capability of the model.

[0064] It should be noted that the present embodiment does not limit the specific structure of the above-mentioned first convolution unit and the second convolution unit, which can be set according to actual application requirements. For example, in order to retain gradient information and speed up the training convergence speed of the model, each convolution unit may include a two-dimensional batch normalization layer (BatchNorm2d) and an activation function (ReLU, Rectified Linear Unit, linear rectification function) in addition to a two-dimensional convolution layer (Conv2d). Among them, the two-dimensional convolution layer is used to perform convolution processing to extract features; the two-dimensional batch normalization layer is used to perform batch normalization processing to reduce the difference between data and speed up the model convergence speed during model training; the activation function is used to perform activation processing to retain gradient information. In addition, in the second convolution unit, the output of the state space model unit can be first convolved and batch normalized using a two-dimensional convolution layer and a two-dimensional batch normalization layer to obtain an intermediate result, and then the intermediate result is spliced ​​with the input of the preset residual module, and finally the spliced ​​result is activated. For ease of understanding, please refer to Figure 3 , Figure 3 A schematic diagram of another preset residual module provided by an embodiment of the present invention. In this schematic diagram, the first convolution unit and the second convolution unit are both composed of a two-dimensional convolution layer, a two-dimensional batch normalization layer, and an activation function; in addition, the input end of the preset residual module is also connected between the two-dimensional batch normalization layer and the activation function of the second convolution unit.

[0065] The specific structure of the preset classification model is introduced below. In one possible case, the preset classification model is composed of an entry module, the preset residual module, and an exit module connected in series. The classification processing of the current-voltage curve image using the preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types may include:

[0066] Step 11: Use the entry module to perform convolution processing, batch normalization processing, activation processing and maximum pooling processing on the embedding matrix corresponding to the current-voltage curve image in sequence to obtain a first feature matrix.

[0067] In this step, the current-voltage curve image can first be converted into an encoding form that can be processed by the preset classification model to obtain an embedding matrix. The embedding matrix can then be input into the entry module, so that the embedding matrix corresponding to the current-voltage curve image can be sequentially subjected to convolution processing, batch normalization processing, activation processing, and maximum pooling processing using the entry module, that is, the first round of feature extraction is performed on the embedding matrix to obtain a first feature matrix containing low-dimensional features of the embedding matrix. In other words, the entry module can be composed of a convolution layer, a batch normalization layer, an activation function, and a maximum pooling layer (MaxPool).

[0068] Step 12: Use the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix.

[0069] It is worth pointing out that, in order to improve the feature extraction capability, the preset classification model may include multiple preset residual modules, which are sequentially connected in series, the number of network layer channels set by the former preset residual module is less than the number of network layer channels set by the latter preset residual module, and each preset residual module may have multiple. Furthermore, the first feature matrix may be subjected to feature extraction processing using multiple serially connected preset residual modules to obtain the second feature matrix.

[0070] Step 13: Use the export module to perform global average pooling processing and normalized index processing on the second feature matrix in sequence to obtain the predicted probability of the current-voltage curve image corresponding to various preset fault types.

[0071] In this step, after the feature extraction of the entry module and the preset residual module, the exit module can be used to perform global average pooling and normalized exponential processing on the second feature matrix to reduce the dimension and convert the probability value of the second feature matrix to obtain the predicted probability of the current-voltage curve image corresponding to various preset fault types. In other words, the exit module can be composed of a global average pooling layer (Global Average Pooling) and a normalized exponential function (Softmax).

[0072] The workflow of each component in the preset residual module is introduced below. In one possible case, the using the preset residual module to perform feature extraction processing on the first feature matrix to obtain the second feature matrix may include:

[0073] Step 21: Use the first convolution unit to perform convolution processing, batch normalization processing and activation processing on the first feature matrix to extract multiple groups of local features in the first feature matrix to obtain a first intermediate matrix.

[0074] In this step, as described above, the first convolution unit can be composed of a two-dimensional convolution layer, a two-dimensional batch normalization layer and an activation function. Therefore, the first convolution unit can be used to perform convolution processing, batch normalization processing and activation processing on the first feature matrix in sequence to extract multiple groups of local features from the first feature matrix and obtain a first intermediate matrix containing these multiple groups of local features.

[0075] Step 22: Using the state space model unit to perform feature extraction processing on the first intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix.

[0076] In this step, in order to query the correlation between the local features, the state space model unit can be used to perform feature extraction processing on the first intermediate matrix to extract the global features shared by the multiple groups of local features to obtain the second intermediate matrix.

[0077] Step 23: Use the second convolution unit to perform convolution processing and batch normalization processing on the second intermediate matrix to obtain a third intermediate matrix, splice the third intermediate matrix with the first feature matrix, and activate the splicing result to obtain a second feature matrix.

[0078] In this step, as described above, the second convolution unit can be composed of a two-dimensional convolution layer, a two-dimensional batch normalization layer and an activation function, and the matrix splicing operation occurs before the activation process. Therefore, the second convolution unit can first be used to perform convolution processing and batch normalization processing on the second intermediate matrix in sequence to obtain a third intermediate matrix, and then the third intermediate matrix is ​​spliced ​​with the first feature matrix, and the splicing result is activated to obtain the second feature matrix, so as to complete the feature extraction processing of the preset residual module.

[0079] For easier understanding, please refer to Figure 4 , Figure 4 A schematic diagram of a preset classification model provided by an embodiment of the present invention. The model may be composed of an entry module, multiple residual modules and an exit module connected in series. The entry module may be composed of a two-dimensional convolutional layer, a two-dimensional batch normalization layer, an activation function and a two-dimensional maximum pooling layer (MaxPool2d) connected in series. The exit module may be composed of a global average pooling layer (Global Average Pooling) and a normalized exponential function (Softmax). Multiple residual modules can be connected in series in order, the number of network layer channels set by the former preset residual module is less than the number of network layer channels set by the latter preset residual module, and each residual module may have multiple. For example, in Figure 4 There are four types of residual modules, namely residual modules 1, 2, 3 and 4. The number of channels of the first convolutional layer, the state space model unit and the second convolutional layer in residual module 1 are 64, 64 and 256 respectively, the number of channels of the first convolutional layer, the state space model unit and the second convolutional layer in residual module 2 are 128, 128 and 512 respectively, the number of channels of the first convolutional layer, the state space model unit and the second convolutional layer in residual module 3 are 256, 256 and 1024 respectively, the number of channels of the first convolutional layer, the state space model unit and the second convolutional layer in residual module 4 are 512, 512 and 2048 respectively, that is, the number of channels of each network layer in the former residual module is smaller than the number of channels of the corresponding network layer in the latter residual module, so that the feature extraction dimension can be improved layer by layer.

[0080] Based on the model structure, after obtaining the current-voltage curve image, it can first be converted into an embedding matrix with dimensions (B, C, H, W), where H (Height) and W (Width) represent the height and width of the image, C (Channel) represents the number of color channels of the image, and B (Batch) represents the image batch size. Subsequently, the embedding matrix can be input into the entry module, so that the embedding matrix corresponding to the current-voltage curve image can be processed by the entry module in sequence through convolution, batch normalization, activation, and maximum pooling to obtain the first feature matrix. Subsequently, multiple preset residual modules connected in series can be used to perform multiple rounds of feature extraction on the first feature matrix to obtain the second feature matrix. Finally, the exit module can be used to perform global average pooling and normalized index processing on the second feature matrix in sequence to obtain the predicted probability of various preset fault types corresponding to the current-voltage curve image.

[0081] The following is an introduction to the specific structure of the state space model unit. Figure 5 , Figure 5 A schematic diagram of a state space model unit provided by an embodiment of the present invention, wherein the state space model unit is composed of a first deformation layer, a layer normalization layer, a Mamba-2 layer, and a second deformation layer connected in series;

[0082] The step of performing feature extraction processing on the first intermediate matrix by using the state space model unit to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix may include:

[0083] Step 31: using the first deformation layer to perform matrix transformation processing on the first intermediate matrix, so as to transform the matrix size of the first intermediate matrix into a preset size, thereby obtaining a fourth intermediate matrix.

[0084] In this step, to ensure that the Mamba-2 layer can perform feature extraction, the first deformation layer can be used to transform the matrix size of the first intermediate matrix to obtain a fourth intermediate matrix. For example, the matrix size of the first intermediate matrix is ​​transformed from (B, C, H, W) to (B, H×W, C).

[0085] Step 32: Use a layer normalization layer to perform layer normalization processing on the fourth intermediate matrix to obtain a fifth intermediate matrix.

[0086] In this step, in order to reduce data differences, a layer normalization layer (Layer Norm) may be used to perform layer normalization processing on the fourth intermediate matrix to obtain a fifth intermediate matrix.

[0087] Step 33: Use the Mamba-2 layer to perform feature extraction processing on the fifth intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a sixth intermediate matrix.

[0088] In this embodiment, the Mamba-2 layer can be used as the core of the state-space model unit, wherein the Mamba-2 layer has a smaller size, lower resource consumption and faster execution speed based on a stronger global feature extraction capability, thus helping to improve the overall performance of the model.

[0089] Step 34: Use the second deformation layer to perform matrix transformation processing on the sixth intermediate matrix to transform the matrix size of the sixth intermediate matrix into the original size of the first intermediate matrix, thereby obtaining the second intermediate matrix.

[0090] In this step, to ensure that the subsequent convolutional layer can perform feature extraction, the second deformation layer can be used to transform the matrix size of the sixth intermediate matrix back to the original size of the first intermediate matrix to obtain the second intermediate matrix. For example, the matrix size of the sixth intermediate matrix is ​​restored from (B, H×W, C) to (B, C, H, W).

[0091] S103: Determine a target preset fault type corresponding to the current-voltage curve image according to the predicted probability.

[0092] In this step, after being processed by the preset classification model, the predicted probabilities of the current-voltage curve image corresponding to various preset fault types can be obtained, and then the target preset fault type corresponding to the current-voltage curve image can be determined according to the predicted probability. For example, the preset fault type corresponding to the maximum predicted probability can be determined as the target preset fault type, and the preset fault type with a predicted probability value greater than a preset threshold can also be determined as the target preset fault type, which can be set according to actual application requirements.

[0093] Based on the above embodiments, the present invention can first convert the current and voltage of the photovoltaic module into a current-voltage curve image, and then use the preset classification model to classify the current-voltage curve image, determine the predicted probability of the current-voltage curve image corresponding to various preset fault types, and determine the target preset fault type corresponding to the current-voltage curve image according to the predicted probability. Among them, the preset classification model includes a preset residual module, the preset residual module is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series, the input end of the preset residual module is connected to the first convolution unit and the second convolution unit, and the state space model unit is used to extract global features from multiple groups of local features extracted by the first convolution unit. In other words, the present invention can combine the state space model unit with the residual structure, use the state space model unit to extract global features from multiple groups of local features extracted by the convolution unit, and then improve the global feature extraction performance of the model based on the better global feature extraction performance of the state space model unit, thereby improving the reliability of fault detection of photovoltaic modules.

[0094] Based on the above embodiment, the training process of the preset classification model is introduced below. In one possible case, the training process of the preset classification model may include:

[0095] S201, acquiring an image data set, and extracting a corresponding number of image data from the image data set according to a preset number ratio as training data; wherein the image data is a current-voltage curve image and a preset fault type annotated therewith.

[0096] In this step, firstly, a corresponding number of image data can be extracted from the image data set according to a preset number ratio as training data, so as to train the model using the training data. The image data is a current-voltage curve image and its annotated preset fault type, that is, the image data consists of a current-voltage curve image and its corresponding preset fault type label.

[0097] In addition, a corresponding number of image data may be extracted from the image data set according to a preset number ratio as test data, so as to use the test data to test the model performance.

[0098] Based on this, after obtaining the image dataset, the following can also be included:

[0099] Step 41: extracting a corresponding number of image data from the image data set as test data according to a preset number ratio.

[0100] S202. Perform multiple rounds of training on the initial classification model using the training data and the loss function, and stop the training when the loss value generated by the initial classification model is less than a preset threshold, thereby obtaining the preset classification model; wherein the loss value is calculated using the preset fault type marked by the training data, the preset fault type determined by the initial classification model for the training data, and the loss function.

[0101] In this step, the initial classification model refers to a preset classification model that has not been trained. In this step, the initial classification model will be trained multiple times using the training data and the loss function to optimize the model parameters of the initial classification model, until the loss value generated by the initial classification model is less than the preset threshold, and the training is stopped to obtain the preset classification model. Specifically, in this embodiment, the training data can be input into the initial classification model to use the initial classification model to determine the preset fault type for the training data; then, the preset fault type marked by the training data, the preset fault type determined by the initial classification model for the training data, and the loss function can be used to calculate the loss value, which represents the difference between the preset fault type marked by the training data and the preset fault type determined by the initial classification model for the training data. Furthermore, if the loss value is greater than the preset threshold, it means that the model has not converged, and the loss value can be used to optimize the model parameters of the model, and the training data can be used to continue to train the model; if the loss value is not greater than the preset threshold, it means that the model converges and the preset classification model is obtained.

[0102] It is worth pointing out that since the present invention can set a state-space model unit in the classification model, and also sets a batch normalization layer, a layer normalization layer, and a global average normalization layer, it can speed up the convergence speed of the model. Therefore, this embodiment can use a small amount of training data to achieve better training effects, which can also reduce the cost of collecting training data.

[0103] It should be noted that this embodiment does not limit the specific loss function, for example, it can be a cross entropy loss function.

[0104] Furthermore, since the model parameters need to be randomly initialized before the first round of training, and different initial model parameters may affect the training effect of the model, in order to test the impact of different initial model parameters on model performance and then select a better model, the present embodiment can also use training data and loss functions to perform multiple rounds of training on different initial classification models to obtain multiple candidate classification models, and then use test data to verify the different candidate classification models, and finally select the better model from these multiple candidate classification models as the preset classification model based on the verification results.

[0105] Based on this, the initial classification model is trained multiple times using the training data and the loss function until the loss value generated by the initial classification model is less than a preset threshold, and the training is stopped to obtain the preset classification model, which may include:

[0106] Step 51: Perform multiple rounds of training on different initial classification models using the training data and the loss function until the loss values ​​generated by each of the initial classification models are all less than a preset threshold, and then stop the training to obtain different candidate classification models; wherein different initial classification models correspond to different initial model parameters;

[0107] Step 52: Use the test data to verify different candidate classification models, obtain a verification value for each candidate classification model, and select a preset classification model from the candidate classification models based on the verification value; wherein the verification value is determined by using the preset fault type marked by the test data and the preset fault type determined by the candidate classification model for the test data.

[0108] It should be noted that the present embodiment does not limit specific verification values, and may be, for example, accuracy, precision, recall, F1 value, etc., which may be set according to actual application requirements.

[0109] Based on the above embodiment, the above fault detection method is fully introduced below based on specific model structure parameters. The present invention provides an IV curve image classification method based on the U-Mamba-2 architecture (i.e., the state space model unit provided in this embodiment) and a convolutional network. The principle of this method is: first, IV curve data of different typical faults are obtained in an actual power station, and 2857 valid data are obtained. A total of 33 types of fault data are included, and each group of data has 2 columns and 256 rows, and each column represents current and voltage. Then the 2857 data are converted into picture form, and a total of 2857 pictures are generated, and the size of the picture is 330*330. 60% of the picture data set is randomly selected as training, 20% as verification, and 20% as testing. The picture data is input into the network.

[0110] The entire neural network consists of six modules, including: Figure 4As shown in the figure, the first module res1 (entry module) includes a 7×7 two-dimensional convolution, a 2d BatchNorm, a ReLu activation function and a 3×3 2d maximum pooling; the second module consists of 3 res2 (residual modules 1), each res2 includes a 1×1 convolution, a 2d BatchNorm, a ReLu activation function, U-Mamba-2, a 1×1 convolution, a 2d BatchNorm and a ReLu activation function, and the construction of the calculation graph is executed in sequence, by adding the data input to the current module and the data calculated by the last 2d BatchNorm of the current module according to each dimension to form a residual structure, and then the feature map calculated after the addition is activated by ReLu to enter the next module for calculation; the third module consists of 4 res3 (residual modules 2), the fourth module consists of 6 res4 (residual modules 3), and the fifth module consists of 3 res5 (residual modules 4), among which the structures of each calculation module in res2, res3, res4 and res5 are consistent. The sixth module is the export module, which consists of a global average pooling layer and a normalized exponential function (Softmax). The export module converts the feature maps calculated by the three res5 modules into feature vectors through the global average pooling layer, and sends them to SoftMax to calculate the classification results.

[0111] The structure of U-Mamba-2 mentioned in the present invention is as follows Figure 5 As shown in the figure, the data of (B, C, H, W) dimension is input, and then the data is reduced in dimension and transposed to form data of (B, H×W, C) dimension. The data is then sent to the LayerNorm structure and calculated with the Mamba-2 structure. Finally, the calculated data is increased in dimension and transposed, and the result with the same dimension as the input data is output.

[0112] The learning of the model uses the cross entropy loss function to calculate the error between the label and the prediction result, and updates the learnable parameters of the current layer step by step from the last layer of the network to the front according to the chain derivation rule. The mean square error between the next round of training data and the network prediction value is used to verify whether the adjustment of the current learnable parameters is effective. If the root mean square error between the current network prediction value and the label is minimized, the model training is considered complete. The K-fold cross-validation training mode is used for verification to save the optimal model parameters and avoid the dilemma of only learning the local optimum due to random initialization of network parameters. The training prediction results can then be used to predict IV curves under different working conditions, temperatures, and irradiances.

[0113] The fault detection device, electronic device, computer program product, and computer-readable storage medium provided in the embodiments of the present invention are introduced below. The fault detection device, electronic device, computer program product, and computer-readable storage medium described below can be referenced to each other with the fault detection method described above.

[0114] Please refer to Figure 6 , Figure 6 A structural block diagram of a fault detection device provided by an embodiment of the present invention, the device may include:

[0115] A conversion module 601, used to convert the current-voltage data of the photovoltaic module into a current-voltage curve image;

[0116] A classification module 602 is used to classify the current-voltage curve image using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types;

[0117] The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series. The input end of the preset residual module is connected to the first convolution unit and the second convolution unit. The state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit.

[0118] The type determination module 603 is used to determine the target preset fault type corresponding to the current-voltage curve image according to the predicted probability.

[0119] Optionally, the preset classification model is composed of an entry module, the preset residual module, and an exit module connected in series;

[0120] The classification module 602 includes:

[0121] An entry module processing submodule, used to use the entry module to sequentially perform convolution processing, batch normalization processing, activation processing and maximum pooling processing on the embedding matrix corresponding to the current-voltage curve image to obtain a first feature matrix;

[0122] A residual module processing submodule, used for performing feature extraction processing on the first feature matrix using the preset residual module to obtain a second feature matrix;

[0123] The export module processing submodule is used to use the export module to perform global average pooling processing and normalized index processing on the second feature matrix in sequence to obtain the predicted probability of the current-voltage curve image corresponding to various preset fault types.

[0124] Optionally, the second processing submodule includes:

[0125] a first processing unit, configured to perform convolution processing, batch normalization processing, and activation processing on the first feature matrix using the first convolution unit, so as to extract multiple groups of local features in the first feature matrix to obtain a first intermediate matrix;

[0126] A second processing unit is used to perform feature extraction processing on the first intermediate matrix using the state space model unit to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix;

[0127] The third processing unit is used to use the second convolution unit to perform convolution processing and batch normalization processing on the second intermediate matrix to obtain a third intermediate matrix, splice the third intermediate matrix with the first feature matrix, and activate the splicing result to obtain a second feature matrix.

[0128] Optionally, the state space model unit is composed of a first deformation layer, a layer normalization layer, a Mamba-2 layer, and a second deformation layer connected in series;

[0129] The second processing unit may include:

[0130] a first processing sub-unit, configured to perform matrix transformation processing on the first intermediate matrix by using the first deformation layer, so as to transform the matrix size of the first intermediate matrix into a preset size, and obtain a fourth intermediate matrix;

[0131] A second processing subunit is used to perform layer normalization processing on the fourth intermediate matrix by using a layer normalization layer to obtain a fifth intermediate matrix;

[0132] A third processing subunit is used to perform feature extraction processing on the fifth intermediate matrix by using a Mamba-2 layer to uniformly extract global features of the multiple groups of local features to obtain a sixth intermediate matrix;

[0133] The fourth processing sub-unit is used to perform matrix transformation processing on the sixth intermediate matrix by using the second deformation layer to transform the matrix size of the sixth intermediate matrix into the original size of the first intermediate matrix to obtain the second intermediate matrix.

[0134] Optionally, the residual module processing submodule may be used to:

[0135] The first feature matrix is ​​subjected to feature extraction processing by using a plurality of preset residual modules to obtain the second feature matrix; wherein the plurality of preset residual modules are connected in series in order, and the number of network layer channels set by a former preset residual module is less than the number of network layer channels set by a latter preset residual module.

[0136] Optionally, the device may further include:

[0137] A training data acquisition module, used to acquire an image data set, and extract a corresponding number of image data from the image data set according to a preset number ratio as training data; wherein the image data is a current-voltage curve image and a preset fault type annotated thereon;

[0138] A training module is used to perform multiple rounds of training on the initial classification model using the training data and the loss function, and the training is stopped when the loss value generated by the initial classification model is less than a preset threshold, so as to obtain the preset classification model; wherein the loss value is calculated using the preset fault type marked by the training data, the preset fault type determined by the initial classification model for the training data, and the loss function.

[0139] Optionally, the device may further include:

[0140] A test data acquisition module, used to extract a corresponding number of image data from the image data set as test data according to a preset number ratio;

[0141] The training module may include:

[0142] A training submodule is used to perform multiple rounds of training on different initial classification models using the training data and the loss function, until the loss values ​​generated by each of the initial classification models are all less than a preset threshold, and the training is stopped to obtain different candidate classification models; wherein different initial classification models correspond to different initial model parameters;

[0143] A verification submodule is used to use the test data to verify different candidate classification models, obtain a verification value for each candidate classification model, and select a preset classification model from the candidate classification models based on the verification value; wherein the verification value is obtained by using the preset fault type marked by the test data and the preset fault type determined by the candidate classification model for the test data.

[0144] Please refer to Figure 7 , Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The embodiment of the present invention provides an electronic device 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store a computer program; and the processor 11 is used to execute the fault detection method provided in the aforementioned embodiment when executing the computer program.

[0145] For the specific process of the above fault detection method, reference may be made to the corresponding contents provided in the aforementioned embodiments, which will not be described in detail here.

[0146] Furthermore, the memory 12 as a carrier for storing resources may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0147] In addition, the electronic device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide working voltage for each hardware device on the electronic device 10; the communication interface 14 can create a data transmission channel between the electronic device 10 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0148] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein the computer program / instruction implements the fault detection method described in the above embodiment when executed by a processor.

[0149] Since the embodiments of the computer program product part correspond to the embodiments of the fault detection method part, please refer to the description of the embodiments of the fault detection method part for the embodiments of the computer program product part, which will not be repeated here.

[0150] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the fault detection method described in the above embodiment is implemented.

[0151] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the fault detection method part, please refer to the description of the embodiments of the fault detection method part for the embodiments of the storage medium part, which will not be repeated here.

[0152] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0153] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0154] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0155] The above is a detailed introduction to a fault detection method, device, electronic device and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A fault detection method, characterized in that: include: Convert the current-voltage data of the photovoltaic module into a current-voltage curve image; Using a preset classification model to classify the current-voltage curve image, and determine the predicted probability of the current-voltage curve image corresponding to various preset fault types; The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series. The input end of the preset residual module is connected to the first convolution unit and the second convolution unit. The state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit. A target preset fault type corresponding to the current-voltage curve image is determined according to the predicted probability.

2. The fault detection method according to claim 1, characterized in that: The preset classification model is composed of an entry module, the preset residual module, and an exit module in series; The classifying process of the current-voltage curve image by using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types includes: Using the entry module, sequentially performing convolution processing, batch normalization processing, activation processing, and maximum pooling processing on the embedding matrix corresponding to the current-voltage curve image to obtain a first feature matrix; Using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix; The export module is used to sequentially perform global average pooling processing and normalized index processing on the second characteristic matrix to obtain the predicted probability of the current-voltage curve image corresponding to various preset fault types.

3. The fault detection method according to claim 2, characterized in that: The using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix includes: Using the first convolution unit to perform convolution processing, batch normalization processing, and activation processing on the first feature matrix to extract multiple groups of local features in the first feature matrix to obtain a first intermediate matrix; Using the state space model unit to perform feature extraction processing on the first intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix; The second convolution unit is used to perform convolution processing and batch normalization processing on the second intermediate matrix to obtain a third intermediate matrix, the third intermediate matrix is ​​concatenated with the first feature matrix, and activation processing is performed on the concatenated result to obtain a second feature matrix.

4. The fault detection method according to claim 3, characterized in that: The state space model unit is composed of a first deformation layer, a layer normalization layer, a Mamba-2 layer, and a second deformation layer connected in series; The using the state space model unit to perform feature extraction processing on the first intermediate matrix to uniformly extract global features of the multiple groups of local features to obtain a second intermediate matrix includes: Performing matrix transformation processing on the first intermediate matrix by using the first deformation layer to transform the matrix size of the first intermediate matrix into a preset size, thereby obtaining a fourth intermediate matrix; Performing layer normalization processing on the fourth intermediate matrix using a layer normalization layer to obtain a fifth intermediate matrix; Performing feature extraction processing on the fifth intermediate matrix by using the Mamba-2 layer to uniformly extract global features of the multiple groups of local features, thereby obtaining a sixth intermediate matrix; The second deformation layer is used to perform matrix transformation processing on the sixth intermediate matrix to transform the matrix size of the sixth intermediate matrix into the original size of the first intermediate matrix, thereby obtaining the second intermediate matrix.

5. The fault detection method according to claim 2, characterized in that: The using the preset residual module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix includes: The first feature matrix is ​​subjected to feature extraction processing by using a plurality of preset residual modules to obtain the second feature matrix; wherein the plurality of preset residual modules are connected in series in order, and the number of network layer channels set by a former preset residual module is less than the number of network layer channels set by a latter preset residual module.

6. The fault detection method according to any one of claims 1 to 5, characterized in that: The training process of the preset classification model includes: Acquire an image data set, and extract a corresponding number of image data from the image data set according to a preset number ratio as training data; wherein the image data is a current-voltage curve image and a preset fault type annotated therewith; The initial classification model is trained for multiple rounds using the training data and the loss function, and the training is stopped when the loss value generated by the initial classification model is less than a preset threshold, thereby obtaining the preset classification model; wherein the loss value is calculated using the preset fault type marked by the training data, the preset fault type determined by the initial classification model for the training data, and the loss function.

7. The fault detection method according to claim 6, characterized in that: After obtaining the image dataset, it also includes: Extracting a corresponding number of image data from the image data set as test data according to a preset number ratio; The initial classification model is trained multiple times using the training data and the loss function until the loss value generated by the initial classification model is less than a preset threshold, and the training is stopped to obtain the preset classification model, including: Using the training data and the loss function, multiple rounds of training are performed on different initial classification models until the loss values ​​generated by each of the initial classification models are less than a preset threshold, and the training is stopped to obtain different candidate classification models; wherein different initial classification models correspond to different initial model parameters; The test data is used to perform verification processing on different candidate classification models to obtain a verification value for each candidate classification model, and a preset classification model is selected from the candidate classification models based on the verification value; wherein the verification value is obtained by using the preset fault type marked by the test data and the preset fault type determined by the candidate classification model for the test data.

8. A fault detection device, characterized in that: include: A conversion module, used for converting the current-voltage data of the photovoltaic module into a current-voltage curve image; A classification module, used to classify the current-voltage curve image using a preset classification model to determine the predicted probability of the current-voltage curve image corresponding to various preset fault types; The preset classification model includes a preset residual module, which is composed of a first convolution unit, a state space model unit, and a second convolution unit connected in series. The input end of the preset residual module is connected to the first convolution unit and the second convolution unit. The state space model unit is used to perform global feature extraction on multiple groups of local features extracted by the first convolution unit. The type determination module is used to determine the target preset fault type corresponding to the current-voltage curve image according to the predicted probability.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the fault detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the fault detection method according to any one of claims 1 to 7 is implemented.