Fault detection model construction method and device, fault detection method and device and electronic equipment

By introducing the status space model unit and context transformation unit in the neural network model, and conducting multiple rounds of training, the shortcomings of photovoltaic components in existing technologies in environmental impact and multi -classification tasks have been solved. Type classification.

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

Patent Information

Application Number
CN202411516969.4
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

In the detection of photovoltaic module failures, physical models are susceptible to environmental impact and have poor generalization performance, while traditional machine learning models are difficult to effectively distinguish the nuances of the global characteristics of the data set in multi-classification tasks, resulting in misclassification.

Method used

A method of fault detection model construction method is proposed to introduce the status space model unit and context transformation unit in the neural network model, and conduct multiple rounds of training to enhance the model classification of the model of photovoltaic components-voltage curve image.

Benefits of technology

By introducing the state space model unit and context transformation unit, the query ability of the model's extraction of global characteristics and the relationship between local characteristics and global characteristics has been improved, which significantly improves the classification performance of photovoltaic component failure detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339152A_ABST
    Figure CN119339152A_ABST
Patent Text Reader

Abstract

The invention provides a fault detection model construction method, a fault detection method, a fault detection device and electronic equipment, and relates to the field of artificial intelligence, a state space model unit and a context transformation unit can be added in a residual structure, the state space model unit can enhance the extraction capability of global features, and the context transformation unit can improve the extraction capability of the global features. The context transformation unit can enhance the searching capability of the correlation degree between the local features and the global features, and the residual structure comprising the state space model unit and the context transformation unit is added to the fault detection model, so that the classification performance of the model on the current-voltage curve image of the photovoltaic module can be remarkably improved. After the fault detection model is trained, it can be ensured that the model has the good current-voltage curve image classification capacity, and therefore photovoltaic module fault detection can be well carried out.
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 model building method, a fault detection method, a device and an electronic device. Background Art

[0002] With the continuous development of new energy technologies, large-scale ground photovoltaic power stations have been rapidly expanded. However, due to the harsh working environment, photovoltaic module materials are prone to local aging, performance degradation, cracks and other faults, which greatly affect the electrical characteristics of photovoltaic modules and thus affect the power generation efficiency of photovoltaic power stations. Therefore, how to effectively detect photovoltaic module faults is an important part of ensuring the normal operation of photovoltaic power stations.

[0003] In related technologies, physical models of photovoltaic modules or traditional machine learning models can be constructed to use these models to detect faults in photovoltaic modules. However, physical models are easily affected by different environments and have poor generalization performance; although traditional machine learning models can achieve good generalization performance, they often misclassify in multi-classification tasks because they do not learn the subtle differences in the global features of the data set.

[0004] Therefore, how to construct a model that can effectively detect photovoltaic module failures is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a fault detection model construction method, a fault detection method, a device and an electronic device, which can add both a state space model unit and a context transformation unit to the fault detection model, and can perform multiple rounds of training on the model to ensure that the model can effectively classify the fault type corresponding to the current-voltage curve image of the photovoltaic component, so as to better perform photovoltaic component fault detection.

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

[0007] Acquire a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to current-voltage data of a photovoltaic module;

[0008] Inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among the multiple preset fault types;

[0009] Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit and a second convolution unit, the first convolution unit, the context transformation unit and the second convolution unit are connected in series, the state space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module;

[0010] The parameters of the neural network model are updated using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain a fault detection model.

[0011] Optionally, the neural network model is composed of an entry module, the preset network module, and an exit module connected in series;

[0012] The step of inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image from a plurality of preset fault types includes:

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

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

[0015] The export module is used to sequentially perform global average pooling processing and normalized index processing on the second feature matrix to obtain the predicted probability of the training image corresponding to various preset fault types, and the predicted fault type is determined according to the predicted probability.

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

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

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

[0019] Using the state space model unit to perform feature extraction processing on the first feature matrix to extract global features of the first feature matrix to obtain a first intermediate matrix;

[0020] Using the first convolution unit to perform feature extraction processing on the first feature matrix to extract multiple groups of local features of the first feature matrix to obtain a second intermediate matrix;

[0021] Using the first convolution unit to concatenate the first intermediate matrix and the second intermediate matrix, and sequentially performing batch normalization processing and activation processing on the concatenated results to obtain a third intermediate matrix;

[0022] Using the context transformation unit to perform context attention processing on the third intermediate matrix to obtain a fourth intermediate matrix;

[0023] The fourth intermediate matrix is ​​sequentially convolved and batch normalized using the second convolution unit to obtain a fifth intermediate matrix, the fifth intermediate matrix is ​​concatenated with the first feature matrix, and the concatenated result is activated to obtain the second feature matrix.

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

[0025] The step of performing feature extraction processing on the first feature matrix by using the state space model unit to uniformly extract global features of the first feature matrix to obtain a first intermediate matrix includes:

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

[0027] Performing layer normalization processing on the sixth intermediate matrix using a layer normalization layer to obtain a seventh intermediate matrix;

[0028] Performing feature extraction processing on the seventh intermediate matrix by using the Mamba-2 layer to extract global features of the seventh intermediate matrix to obtain an eighth intermediate matrix;

[0029] Performing matrix transformation processing on the eighth intermediate matrix by using the second deformation layer to transform the matrix size of the eighth intermediate matrix into the original size of the first characteristic matrix, thereby obtaining the ninth intermediate matrix;

[0030] The convolution layer is used to perform convolution processing on the ninth intermediate matrix to obtain the first intermediate matrix.

[0031] The present invention also provides a fault detection method, comprising:

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

[0033] The current-voltage curve image is classified and processed using a fault detection model to determine a target fault type corresponding to the current-voltage curve image among a plurality of preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method as described above.

[0034] The present invention also provides a fault detection model building device, comprising:

[0035] An acquisition module, used to acquire a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of the photovoltaic module;

[0036] A classification module, used for inputting the training image into a preset neural network model for multiple rounds of classification processing, so as to determine the predicted fault type corresponding to the training image from a plurality of preset fault types;

[0037] Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit and a second convolution unit, the first convolution unit, the context transformation unit and the second convolution unit are connected in series, the state space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module;

[0038] The model updating module is used to update the parameters of the neural network model using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain a fault detection model.

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

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

[0041] A detection module is used to classify the current-voltage curve image using a fault detection model to determine a target fault type corresponding to the current-voltage curve image among a plurality of preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method as described above.

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

[0043] Memory for storing computer programs;

[0044] A processor is used to implement the fault detection model construction method and / or the fault detection method as described above when executing the computer program.

[0045] 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 model construction method and / or the fault detection method as described above are implemented.

[0046] The present invention provides a method for constructing a fault detection model, comprising: obtaining a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of a photovoltaic module; inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among a plurality of preset fault types; wherein the neural network model comprises a preset network module, and the preset network module comprises a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit, wherein the first convolution unit, the context transformation unit The first convolution unit and the second convolution unit are connected in series, the state-space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state-space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit concatenates the convolution result of the context attention processing result with the input of the preset network module; the parameters of the neural network model are updated by using the preset fault type annotated by the training image and the predicted fault type corresponding to it in each round of classification processing to obtain a fault detection model.

[0047] It can be seen that the present invention can first obtain a training image and a preset fault type annotated therein; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of the photovoltaic module. Subsequently, the training image can be input into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among multiple preset fault types, and the preset fault type annotated by the training image and the predicted fault type corresponding to it in each round of classification processing can be used to update the parameters of the neural network model to obtain a fault detection model. Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit. The first convolution unit, the context transformation unit, and the second convolution unit are connected in series, and the state space model unit is connected in parallel with the first convolution unit. The first convolution unit extracts the local features of the input of the preset network module, and the state space model unit extracts the global features of the input of the preset network module. The context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module. In other words, the present invention can add a state space model unit and a context transformation unit to the residual structure. The state space model unit can enhance the ability to extract global features, and the context transformation unit can enhance the ability to find the correlation between local features and global features. Adding the residual structure including the state space model unit and the context transformation unit to the model can significantly improve the model's classification performance for current-voltage curve images. After training, the present invention can ensure that the fault detection model has a good current-voltage curve image classification capability, so that photovoltaic module fault detection can be performed better. The present invention also provides a fault detection method, device, electronic device and computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

[0052] Figure 4 A schematic diagram of a fault detection model provided by an embodiment of the present invention;

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

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

[0055] Figure 7 A structural block diagram of a fault detection model building device provided by an embodiment of the present invention;

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

[0057] Fig. 9 The present invention provides a structural block diagram of an electronic device. DETAILED DESCRIPTION

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

[0059] With the continuous development of new energy technologies, large-scale ground photovoltaic power stations have been rapidly expanded. However, due to the harsh working environment, photovoltaic module materials are prone to local aging, performance degradation, cracks and other faults, which greatly affect the electrical characteristics of photovoltaic modules and thus affect the power generation efficiency of photovoltaic power stations. Therefore, how to effectively detect photovoltaic module faults is an important part of ensuring the normal operation of photovoltaic power stations.

[0060] In related technologies, physical models of photovoltaic modules or traditional machine learning models can be constructed to use these models to detect faults in photovoltaic modules. However, physical models are easily affected by different environments and have poor generalization performance; although traditional machine learning models can achieve good generalization performance, they often misclassify in multi-classification tasks because they do not learn the subtle differences in the global features of the data set.

[0061] In view of this, in order to solve the technical problem of how to construct a model that can effectively detect photovoltaic module faults, the present invention can provide a fault detection model construction method, which can add both a state space model unit and a context transformation unit to the fault detection model, and can perform multiple rounds of training on the model to ensure that the model can effectively classify the fault types corresponding to the current-voltage curve images of the photovoltaic modules, so as to better perform photovoltaic module fault detection.

[0062] For easier understanding, please refer to Figure 1 , Figure 1 A flowchart of a fault detection model construction method provided by an embodiment of the present invention, the method may include:

[0063] S101, obtaining a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated based on current-voltage data of a photovoltaic module.

[0064] In this step, the current-voltage data generated by the photovoltaic module under various preset fault types can be collected in advance, and the data can be converted into a current-voltage curve image, and then the image can be labeled with the corresponding preset fault type to form a training image. Among them, the current-voltage curve image can reflect the volt-ampere characteristics of the photovoltaic module under normal conditions and various fault conditions, so the photovoltaic module fault detection can be performed by classifying the current-voltage curve image.

[0065] It should be noted that this embodiment does not limit the number of training images, nor does it limit the types of preset fault types, which can be set according to actual application requirements.

[0066] Furthermore, in order to verify the classification performance of the neural network model when determining its convergence, the present embodiment can also obtain a test image and a preset fault type annotated therein. The test image is also a current-voltage curve image. The present embodiment also does not limit the number of training images, which can be set according to actual application requirements.

[0067] S102, input the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among the multiple preset fault types. Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit. The first convolution unit, the context transformation unit, and the second convolution unit are connected in series, and the state space model unit is connected in parallel with the first convolution unit. The first convolution unit extracts local features of the input of the preset network module, and the state space model unit extracts global features of the input of the preset network module. The context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module.

[0068] In this step, the neural network model is an untrained fault detection model and can only be called the fault detection model after multiple rounds of model parameter optimization. Therefore, this embodiment needs to input the training image into the preset neural network model for multiple rounds of classification processing, so that the model can determine the predicted fault type corresponding to the training image from multiple preset fault types in each round of classification processing; this embodiment also needs to optimize the model parameters of the neural network model according to the difference between the preset fault type marked by the training image and the corresponding predicted fault type in each round of classification processing. In this way, after multiple rounds of classification processing and multiple rounds of parameter optimization, this embodiment can finally obtain a fault detection model.

[0069] Furthermore, in view of the fact that the traditional machine learning model adopted by the related art does not have a strong global feature extraction capability, and the query capability of the correlation between local features and global features is weak, the present embodiment may set an improved preset network module in the above-mentioned neural network model. Among them, the module is provided with a state space model unit (SSM, StateSpace Model) and a contextual transformation unit (CoT, Contextual Transformer). 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. The addition of a state space model unit can improve the global feature extraction capability. The context transformation unit is improved on the basis of the existing Transformer unit, and can make full use of the contextual information between keys to guide the learning of the dynamic attention matrix, thereby enhancing the visual representation capability, and introducing it into the neural network model in the embodiment can improve the query capability of the correlation between local features and global features. By introducing the above two units, the present embodiment can ensure that the model can effectively extract and distinguish the subtle differences in the current-voltage curve image.

[0070] For easier understanding, please refer to Figure 2 , Figure 2 A schematic diagram of a preset network module provided by an embodiment of the present invention. The module includes a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit. The first convolution unit, the context transformation unit, and the second convolution unit are connected in series, and the state space model unit is connected in parallel with the first convolution unit. The input end of the preset network module is connected to the first convolution unit, the state space model unit, and the second convolution unit, and the output end of the preset network module is connected to the second convolution unit. That is, the first convolution unit, the context transformation unit, and the second convolution unit can form a residual structure, and the state space model unit can be further added to the residual structure. The specific uses of these four units are: the first convolution unit performs convolution processing on the input of the preset network module to extract local features of the input of the preset network module; the state space model unit performs feature extraction on the input of the preset network module to extract global features of the input of the preset network module; the context transformation unit performs context attention processing on the above local features and global features to determine the correlation between local features and global features; the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module to retain gradient information in the output. It can be seen that by setting this preset network module, the model's ability to extract global features can be improved, and the model's ability to query the correlation between local features and global features can also be improved, thereby ensuring that the model can effectively extract and distinguish subtle differences in the current-voltage curve image, thereby improving the overall classification ability of the model.

[0071] It should be noted that the present embodiment does not limit the specific structure of the first convolution unit and the second convolution unit, and 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 rectifier function) in addition to a two-dimensional convolution layer (Conv2d). Among them, the two-dimensional convolution layer is used for convolution processing to extract features; the two-dimensional batch normalization layer is used for batch normalization processing to reduce the difference between data and speed up the convergence speed of the model during model training; the activation function is used for activation processing to retain gradient information. In addition, in the first convolution unit, the two-dimensional convolution layer can be used to perform convolution processing on the input of the preset network module, and the convolution processing result can be spliced ​​with the output of the state space model unit, and then the spliced ​​result can be batch normalized and activated. In addition, in the second convolution unit, the output of the context transformation unit can be 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 concatenated with the input of the preset network module, and finally the concatenated result is activated. For easy understanding, please refer to Figure 3 , Figure 3 A schematic diagram of another preset network 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 output end of the state space model unit is also connected between the two-dimensional convolution layer and the two-dimensional batch normalization layer of the first convolution unit; in addition, the input end of the preset network module is also connected between the two-dimensional batch normalization layer and the activation function of the second convolution unit.

[0072] The specific structure of the neural network model is introduced below. In one possible scenario, the neural network model is composed of an entry module, the preset network module, and an exit module connected in series. The training image is input into the preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image from a plurality of preset fault types, including:

[0073] 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 training image in sequence to obtain a first feature matrix.

[0074] In this step, the training image can first be converted into an encoding form that can be processed by the neural network model to obtain an embedding matrix, and then 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, that is, the first round of feature extraction is performed on the embedding matrix to obtain the first feature matrix containing the 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).

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

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

[0077] 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 training image corresponding to various preset fault types, and determine the predicted fault type according to the predicted probability.

[0078] In this step, after the feature extraction of the entry module and the preset network 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 various preset fault types corresponding to the training image. In other words, the exit module can be composed of a global average pooling layer (Global Average Pooling) and a normalized exponential function (Softmax).

[0079] The following describes the workflow of each component in the preset network module. In one possible scenario, the using the preset network module to perform feature extraction processing on the first feature matrix to obtain the second feature matrix may include:

[0080] Step 21: Using the state space model unit to perform feature extraction processing on the first feature matrix to extract global features of the first feature matrix to obtain a first intermediate matrix.

[0081] In this step, the state space model unit may be used to perform feature extraction on the first feature matrix to extract the global features of the original input of the preset network module and obtain the first intermediate matrix.

[0082] Step 22: Use the first convolution unit to perform feature extraction processing on the first feature matrix to extract multiple groups of local features of the first feature matrix to obtain a second intermediate matrix.

[0083] Step 23: Use the first convolution unit to concatenate the first intermediate matrix and the second intermediate matrix, and perform batch normalization and activation processing on the concatenated results in sequence to obtain a third intermediate matrix.

[0084] In steps 22 and 23, as described above, the first convolution unit may be composed of a two-dimensional convolution layer, a two-dimensional batch normalization layer, and an activation function, and the output end of the state space model unit is connected between the two-dimensional convolution layer and the two-dimensional batch normalization layer of the first convolution unit. Therefore, the first convolution unit may firstly be used to perform convolution processing on the first feature matrix to extract the local features of the original input of the preset network module to obtain a second intermediate matrix, and then the first intermediate matrix and the second intermediate matrix are spliced, and the spliced ​​results are batch normalized and activated in turn to obtain a third intermediate matrix.

[0085] Step 24: Use the context transformation unit to perform context attention processing on the third intermediate matrix to obtain a fourth intermediate matrix.

[0086] In this step, since the third intermediate matrix includes both the local features extracted by the first convolution unit and the global features extracted by the state space model unit, the context transformation unit can be used to perform context attention processing on the third intermediate matrix to query the correlation between the local features and the global features to obtain the fourth intermediate matrix.

[0087] It should be noted that this embodiment does not limit the specific structure of the context change unit, and reference may be made to related technologies.

[0088] Step 25: Use the second convolution unit to perform convolution processing and batch normalization processing on the fourth intermediate matrix in sequence to obtain a fifth intermediate matrix, concatenate the fifth intermediate matrix with the first feature matrix, and activate the concatenated result to obtain the second feature matrix.

[0089] 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 fourth intermediate matrix in sequence to obtain the fifth intermediate matrix, and then the fifth 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 network module.

[0090] For easier understanding, please refer to Figure 4 , Figure 4 A schematic diagram of a fault detection model provided by an embodiment of the present invention. The model may be composed of an entry module, multiple network 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 network modules can be connected in series in order, the number of network layer channels set by the former preset network module is less than the number of network layer channels set by the latter preset network module, and each network module may have multiple. For example, in Figure 4 In the figure, there are four network modules, namely, network modules 1, 2, 3, and 4. The number of channels of the first convolutional layer and the second convolutional layer in network module 1 are 64 and 256 respectively, the number of channels of the first convolutional layer and the second convolutional layer in network module 2 are 128 and 512 respectively, the number of channels of the first convolutional layer and the second convolutional layer in network module 3 are 256 and 1024 respectively, and the number of channels of the first convolutional layer and the second convolutional layer in network module 4 are 512 and 2048 respectively, that is, the number of channels of each network layer in the former network module is smaller than the number of channels of the corresponding network layer in the latter network module, so that the feature extraction dimension can be improved layer by layer.

[0091] Based on the model structure, after obtaining the training 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 entry module can be used to perform convolution processing, batch normalization processing, activation processing and maximum pooling processing on the embedding matrix in sequence to obtain the first feature matrix. Subsequently, multiple preset network modules in series can be used to perform multiple rounds of feature extraction processing on the first feature matrix to obtain the second feature matrix. Finally, the exit module can be used to perform global average pooling processing and normalized index processing on the second feature matrix in sequence to obtain the predicted probability of various preset fault types corresponding to the training image.

[0092] 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, a second deformation layer, and a convolutional layer connected in series;

[0093] The using the state space model unit to perform feature extraction processing on the first feature matrix to uniformly extract global features of the first feature matrix to obtain a first intermediate matrix may include:

[0094] Step 31: using the first deformation layer to perform matrix transformation processing on the first characteristic matrix, so as to transform the matrix size of the first characteristic matrix into a preset size, and obtain a sixth intermediate matrix.

[0095] 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 the sixth intermediate matrix. For example, the matrix size of the first intermediate matrix is ​​transformed from (B, C, H, W) to (B, H×W, C).

[0096] Step 32: Use a layer normalization layer to perform layer normalization processing on the sixth intermediate matrix to obtain a seventh intermediate matrix.

[0097] 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 sixth intermediate matrix to obtain a seventh intermediate matrix.

[0098] Step 33: Perform feature extraction processing on the seventh intermediate matrix using the Mamba-2 layer to extract global features of the seventh intermediate matrix to obtain an eighth intermediate matrix.

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

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

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

[0102] Step 35: Use the convolution layer to perform convolution processing on the ninth intermediate matrix to obtain the first intermediate matrix.

[0103] In this step, in order to ensure that the subsequent network layer can jointly process the local features and the global features, a convolution layer can also be used to convolve the ninth intermediate matrix to obtain the first intermediate matrix. It should be noted that the dimension of the first intermediate matrix output by the convolution layer can be (B, outdim, H, W), where outdim refers to the preset output dimension value.

[0104] S103, updating the parameters of the neural network model using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing, to obtain a fault detection model.

[0105] In this step, the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing can be used to update the parameters of the neural network model to obtain a fault detection model. Specifically, after each round of classification processing, the preset fault types annotated by the training images and the predicted fault types corresponding to them in the current round of classification processing can be used to determine the loss value, and the loss value can be used to update the parameters of the neural network model until the neural network model converges to obtain a fault detection model. For the judgment of convergence, if it is determined that 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 it is determined that the loss value is not greater than the preset threshold, it means that the model has converged and a fault detection model is obtained.

[0106] It is worth pointing out that since the present invention can set a state space model unit in the neural network 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.

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

[0108] 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 the model performance and then select a better model, the present embodiment can also use training images to perform multiple rounds of training on different neural network models to obtain multiple candidate neural network models, and then use test images to verify the different candidate neural network models, and finally select the better model from these multiple candidate neural network models as the fault detection model based on the verification results.

[0109] Based on this, the step of inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image from a plurality of preset fault types may include:

[0110] Step 41: Input the training image into different neural network models for multiple rounds of classification processing, so as to use various neural network models to determine the predicted fault type corresponding to the training image among the multiple preset fault types; wherein different neural network models correspond to different initial model parameters.

[0111] The method of updating the parameters of the neural network model using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain the fault detection model may include:

[0112] Step 51: Determine loss values ​​for different neural network models using the preset fault types annotated by the training images and the predicted fault types determined by different neural network models in each round of classification processing, and use the loss values ​​to update parameters of different neural network models after each round of classification processing until each of the neural network models converges, thereby obtaining multiple candidate neural network models.

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

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

[0115] Based on the above embodiment, the present invention can first obtain a training image and a preset fault type annotated therein; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of the photovoltaic module. Subsequently, the training image can be input into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among multiple preset fault types, and the preset fault type annotated by the training image and the predicted fault type corresponding to it in each round of classification processing can be used to update the parameters of the neural network model to obtain a fault detection model. Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit. The first convolution unit, the context transformation unit, and the second convolution unit are connected in series, and the state space model unit is connected in parallel with the first convolution unit. The first convolution unit extracts the local features of the input of the preset network module, and the state space model unit extracts the global features of the input of the preset network module. The context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module. In other words, the present invention can add a state space model unit and a context transformation unit to the residual structure. The state space model unit can enhance the ability to extract global features, and the context transformation unit can enhance the ability to find the correlation between local features and global features. Adding the two to the model can significantly improve the model's classification performance for current-voltage curve images. After training, the present invention can ensure that the fault detection model has a good current-voltage curve image classification capability, so that it can better perform photovoltaic module fault detection.

[0116] Based on the above embodiments, the fault detection method provided by the embodiments of the present invention is introduced below. Figure 6 , Figure 6 A flowchart of a fault detection method provided by an embodiment of the present invention. The method may include:

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

[0118] In this step, the current-voltage data actually measured from the photovoltaic module can be converted into a current-voltage curve image to be measured for processing by the fault detection model.

[0119] S602. Classify the current-voltage curve image using a fault detection model to determine a target fault type corresponding to the current-voltage curve image among a plurality of preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method as described above.

[0120] In this step, the fault detection model can be used to classify the current-voltage curve image to determine the target fault type corresponding to the current-voltage curve image among multiple preset fault types. Since the fault detection model is provided with the preset network module as described above, and the preset network module is provided with a state space model unit and a context transformation unit, the current-voltage curve image can be better feature extracted and classified, thereby achieving a better fault detection effect.

[0121] Based on the above embodiments, the above fault detection model construction method is introduced based on specific examples. The present invention provides an IV curve image classification algorithm based on the V-Mamba-2 architecture (i.e., the state space model unit) combined with the CoT architecture. The principle of the method is: first, the IV curve data of different typical faults are obtained in the 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.

[0122] The entire neural network model 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 (network modules 1), each res2 includes a 1×1 convolution, a V-Mamba-2 module, a 2d BatchNorm, a ReLu activation function, a CoT module, a 1×1 convolution, a 2d BatchNorm and a ReLu activation function. The calculation order is to first calculate the three branches based on the output of res1, the first branch enters the 1×1 convolution, and the second branch enters the V-Mamba-2 module. The calculation graphs of the first branch and the second branch are merged into the main branch by dimension fusion. The subsequent operations such as 2d BatchNorm and ReLu activation function are performed. The third branch merges the result of res1 and the second 1×1 convolution of res2 and the result of 2d BatchNorm into the main branch according to the dimension, and enters the next module after calculation through the ReLu activation function; the third module consists of 4 res3 (network module 2), the fourth module consists of 6 res4 (network module 3), and the fifth module consists of 3 res5 (network module 4), among which the calculation modules in res2, res3, res4, and res5 are consistent. The sixth module is the export module, which consists of a global average pooling layer (Global Average Pooling) 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 calculates the classification results after sending them to SoftMax.

[0123] The structure of V-Mamba-2 mentioned in the present invention is as follows Figure 3 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. Then the data is sent to the LayerNorm structure and calculated with the Mamba-2 structure, and then the calculated data is increased in dimension and transposed. Finally, 1×1 convolution is used to increase the data channel dimension to the set outdim to form data of (B, outdim, H, W) dimension.

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

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

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

[0127] The acquisition module 701 is used to acquire a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of the photovoltaic module;

[0128] The classification module 702 is used to input the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among the multiple preset fault types; wherein the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit, and a second convolution unit, the first convolution unit, the context transformation unit, and the second convolution unit are connected in series, the state space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit concatenates the convolution result of the context attention processing result with the input of the preset network module;

[0129] The model updating module 703 is used to update the parameters of the neural network model using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain a fault detection model.

[0130] Optionally, the neural network model is composed of an entry module, the preset network module, and an exit module connected in series;

[0131] The classification module 702 includes:

[0132] 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 training image to obtain a first feature matrix;

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

[0134] 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, obtain the predicted probability of the training image corresponding to various preset fault types, and determine the predicted fault type according to the predicted probability.

[0135] Optionally, the network module processing submodule may be used to:

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

[0137] Optionally, the network module processing submodule may include:

[0138] a first processing unit, configured to perform feature extraction processing on the first feature matrix using the state space model unit to extract global features of the first feature matrix and obtain a first intermediate matrix;

[0139] a second processing unit, configured to perform feature extraction processing on the first feature matrix using the first convolution unit to extract multiple groups of local features of the first feature matrix to obtain a second intermediate matrix;

[0140] a third processing unit, configured to concatenate the first intermediate matrix and the second intermediate matrix by using the first convolution unit, and sequentially perform batch normalization processing and activation processing on the concatenated results to obtain a third intermediate matrix;

[0141] a fourth processing unit, configured to perform context attention processing on the third intermediate matrix using the context transformation unit to obtain a fourth intermediate matrix;

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

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

[0144] The first processing unit comprises:

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

[0146] a second processing subunit, configured to perform layer normalization processing on the sixth intermediate matrix by using a layer normalization layer to obtain a seventh intermediate matrix;

[0147] The third processing subunit is used to perform feature extraction processing on the seventh intermediate matrix by using the Mamba-2 layer to extract global features of the seventh intermediate matrix to obtain an eighth intermediate matrix;

[0148] a fourth processing sub-unit, configured to perform matrix transformation processing on the eighth intermediate matrix by using the second deformation layer, so as to transform the matrix size of the eighth intermediate matrix into the original size of the first characteristic matrix, so as to obtain the ninth intermediate matrix;

[0149] The fifth processing subunit is used to use the convolution layer to perform convolution processing on the ninth intermediate matrix to obtain the first intermediate matrix.

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

[0151] A conversion module 801 is used to convert the current-voltage data of the photovoltaic module into a current-voltage curve image;

[0152] The detection module 802 is used to classify the current-voltage curve image using a fault detection model to determine the target fault type corresponding to the current-voltage curve image among the multiple preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method as described above.

[0153] Please refer to Fig. 9 , Fig. 9 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 model construction method and / or the fault detection method provided in the above-mentioned embodiment when executing the computer program.

[0154] For the specific process of the above-mentioned fault detection model construction method and fault detection method, reference may be made to the corresponding contents provided in the aforementioned embodiments, which will not be elaborated here.

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

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

[0157] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the fault detection model construction method and / or the fault detection method as described in the above embodiments.

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

[0159] 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 model construction method and / or the fault detection method described in the above embodiment is implemented.

[0160] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the fault detection model construction method and the fault detection method part, the embodiments of the storage medium part refer to the description of the above embodiments and will not be repeated here.

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

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

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

[0164] The fault detection model construction method, fault detection method, device and electronic device provided by the present invention are introduced in detail above. Specific examples are used in this article 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 principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A method for constructing a fault detection model, characterized in that: include: Acquire a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to current-voltage data of a photovoltaic module; Inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image among the multiple preset fault types; Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit and a second convolution unit, the first convolution unit, the context transformation unit and the second convolution unit are connected in series, the state space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module; The parameters of the neural network model are updated using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain a fault detection model.

2. The fault detection model construction method according to claim 1, characterized in that: The neural network model is composed of an entry module, the preset network module, and an exit module in series; The step of inputting the training image into a preset neural network model for multiple rounds of classification processing to determine the predicted fault type corresponding to the training image from a plurality of 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 training image to obtain a first feature matrix; Using the preset network module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix; The export module is used to perform global average pooling processing and normalized index processing on the second feature matrix in sequence to obtain the predicted probability of the training image corresponding to various preset fault types, and the predicted fault type is determined according to the predicted probability.

3. The fault detection model construction method according to claim 2, characterized in that: The using the preset network 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 network modules to obtain the second feature matrix; wherein the plurality of preset network modules are connected in series in an orderly manner, and the number of network layer channels set by a former preset network module is less than the number of network layer channels set by a latter preset network module.

4. The fault detection model construction method according to claim 2, characterized in that: The using the preset network module to perform feature extraction processing on the first feature matrix to obtain a second feature matrix includes: Using the state space model unit to perform feature extraction processing on the first feature matrix to extract global features of the first feature matrix to obtain a first intermediate matrix; Using the first convolution unit to perform feature extraction processing on the first feature matrix to extract multiple groups of local features of the first feature matrix to obtain a second intermediate matrix; Using the first convolution unit to concatenate the first intermediate matrix and the second intermediate matrix, and sequentially performing batch normalization processing and activation processing on the concatenated results to obtain a third intermediate matrix; Using the context transformation unit to perform context attention processing on the third intermediate matrix to obtain a fourth intermediate matrix; The fourth intermediate matrix is ​​sequentially convolved and batch normalized using the second convolution unit to obtain a fifth intermediate matrix, the fifth intermediate matrix is ​​concatenated with the first feature matrix, and the concatenated result is activated to obtain the second feature matrix.

5. The fault detection model construction method according to claim 4, characterized in that: The state space model unit is composed of a first deformation layer, a layer normalization layer, a Mamba-2 layer, a second deformation layer, and a convolutional layer connected in series; The step of performing feature extraction processing on the first feature matrix by using the state space model unit to uniformly extract global features of the first feature matrix to obtain a first intermediate matrix includes: Performing matrix transformation processing on the first characteristic matrix by using the first deformation layer to transform the matrix size of the first characteristic matrix into a preset size, thereby obtaining a sixth intermediate matrix; Performing layer normalization processing on the sixth intermediate matrix using a layer normalization layer to obtain a seventh intermediate matrix; Performing feature extraction processing on the seventh intermediate matrix by using the Mamba-2 layer to extract global features of the seventh intermediate matrix to obtain an eighth intermediate matrix; Performing matrix transformation processing on the eighth intermediate matrix by using the second deformation layer to transform the matrix size of the eighth intermediate matrix into the original size of the first characteristic matrix, thereby obtaining the ninth intermediate matrix; The convolution layer is used to perform convolution processing on the ninth intermediate matrix to obtain the first intermediate matrix.

6. A fault detection method, characterized in that: include: Convert the current-voltage data of the photovoltaic module into a current-voltage curve image; The current-voltage curve image is classified and processed using a fault detection model to determine a target fault type corresponding to the current-voltage curve image among a plurality of preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method according to any one of claims 1 to 5.

7. A fault detection model building device, characterized in that: include: An acquisition module, used to acquire a training image and a preset fault type annotated thereon; wherein the training image is a current-voltage curve image, and the current-voltage curve image is generated according to the current-voltage data of the photovoltaic module; A classification module, used for inputting the training image into a preset neural network model for multiple rounds of classification processing, so as to determine the predicted fault type corresponding to the training image from a plurality of preset fault types; Wherein, the neural network model includes a preset network module, and the preset network module includes a first convolution unit, a state space model unit, a context transformation unit and a second convolution unit, the first convolution unit, the context transformation unit and the second convolution unit are connected in series, the state space model unit is connected in parallel with the first convolution unit, the first convolution unit extracts local features of the input of the preset network module, the state space model unit extracts global features of the input of the preset network module, the context transformation unit performs context attention processing on the local features and the global features, and the second convolution unit splices the convolution result of the context attention processing result with the input of the preset network module; The model updating module is used to update the parameters of the neural network model using the preset fault types annotated by the training images and the predicted fault types corresponding to them in each round of classification processing to obtain a fault detection model.

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 detection module, used to classify the current-voltage curve image using a fault detection model to determine a target fault type corresponding to the current-voltage curve image among a plurality of preset fault types; wherein the fault detection model is constructed according to the fault detection model construction method according to any one of claims 1 to 5.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the fault detection model construction method according to any one of claims 1 to 5 and / or the fault detection method according to claim 6 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 the processor, the fault detection model construction method according to any one of claims 1 to 5 and / or the fault detection method according to claim 6 are implemented.