Photovoltaic power generation anomaly detection method, device and storage medium

By fusing time series and image visual features through a multimodal network structure, the data integrity and robustness issues of the photovoltaic power generation prediction model are solved, and high-accuracy and stable photovoltaic power generation anomaly detection in complex environments is achieved.

CN120354315BActive Publication Date: 2025-09-12SHENZHEN POWEROAK NEWENER CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510828278.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-12
Estimated Expiration
2045-06-20

Smart Images

  • Figure CN120354315B_ABST
    Figure CN120354315B_ABST
Patent Text Reader

Abstract

The present application relates to the field of photovoltaic power generation detection, and in particular to a photovoltaic power generation anomaly detection method, device and storage medium. The photovoltaic power generation anomaly detection method includes: obtaining input feature data, preprocessing the input feature data to obtain time series data, and visualizing the input feature data to obtain two-dimensional image data; inputting the time series data into a pre-trained time series one-dimensional model to extract time dimension features, and inputting the two-dimensional image data into a pre-trained image vision two-dimensional model to extract image dimension features; fusing the time dimension features and the image dimension features, outputting bimodal fusion features, and outputting photovoltaic power generation anomaly detection results based on the bimodal fusion features. The method of the present application proposes a multimodal network structure that fuses time series features and visual features. With a small amount of sample training, it has strong generalization capabilities in cross-domain data sets, greatly improving the accuracy and robustness of anomaly detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of photovoltaic power generation detection, and in particular to a photovoltaic power generation anomaly detection method, device and storage medium. Background Art

[0002] Accurately predicting photovoltaic power generation can significantly improve the overall performance and user experience of photovoltaic energy storage systems. Existing photovoltaic power generation prediction models mostly utilize deep learning technology, which relies heavily on high-quality data. In reality, the widespread distribution and complex installation locations of energy storage devices can easily lead to delays, packet loss, and interruptions in data collection and transmission. This can result in missing data after updates, compromising data integrity. Furthermore, hardware failures, component aging, and sensor anomalies can also cause data collection errors or omissions, reducing data reliability. All of these factors can reduce data reliability and accuracy, thereby impacting the accuracy of photovoltaic power generation forecasts.

[0003] Therefore, it's necessary to perform anomaly detection on this data before building a photovoltaic power generation prediction model based on it. Currently, deep learning methods are commonly used for anomaly detection. Mainstream approaches use RNNs (Recurrent Neural Networks) and their variants, LSTMs (Long Short-Term Memory), or GRUs (Gated Recurrent Units) to learn long-term dependencies in time series. Alternatively, convolutional neural networks extract local features or transformer structures capture global dependencies. These methods all directly model time series data, ignoring expert knowledge and prior knowledge. Due to the small number of anomaly data samples, the models suffer from low robustness. Summary of the Invention

[0004] The embodiments of the present application aim to provide a photovoltaic power generation anomaly detection method, device, and storage medium to solve the problem of low model robustness caused by modeling based only on time series data in the prior art.

[0005] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0006] According to a first aspect of the present application, a method for detecting abnormal photovoltaic power generation is provided, the method comprising:

[0007] Acquiring input characteristic data, wherein the input characteristic data includes photovoltaic power generation characteristic data and weather radiation characteristic data;

[0008] Preprocessing the input feature data to obtain time series data, and visualizing the input feature data to obtain two-dimensional image data;

[0009] Input the time series data into a pre-trained one-dimensional time series model to extract time dimension features, and input the two-dimensional image data into a pre-trained two-dimensional image vision model to extract image dimension features;

[0010] Fusing the time dimension feature and the image dimension feature to output a bimodal fusion feature;

[0011] The photovoltaic power generation anomaly detection result is output based on the bimodal fusion feature.

[0012] Optionally, the preprocessing of the input feature data includes: merging channel features in the input feature data according to a preset time interval scale and normalizing the channel features.

[0013] Optionally, performing visualization processing on the input feature data to obtain two-dimensional image data includes:

[0014] Performing a first scaling process on the features of each channel in the input feature data so that the feature values ​​of each channel are in the same numerical range;

[0015] The channel features after the first scaling process are visualized with time as the X-axis and feature value as the Y-axis to obtain basic image data;

[0016] The basic image data is subjected to a second scaling process according to an input image size supported by the image visual two-dimensional model to obtain the two-dimensional image data.

[0017] Optionally, the weather radiation characteristic data includes first radiation characteristic data and second radiation characteristic data, the first radiation characteristic data is ground solar radiation data collected at a first time interval, and the second radiation characteristic data is shortwave total solar radiation level data collected at a second time interval.

[0018] Optionally, the fusing the time dimension feature and the image dimension feature to output a bimodal fusion feature includes:

[0019] The time dimension features and the image dimension features are fused using a late cross attention mechanism to output a bimodal fusion feature.

[0020] Optionally, the one-dimensional time series model includes a time feature branch and a channel relationship branch, the time feature branch includes a convolutional neural network module, a time and channel attention module, and a long short-term memory network timing module, and the channel relationship branch includes a channel interaction feature module.

[0021] Optionally, inputting the time series data into a pre-trained one-dimensional time series model to extract time dimension features includes:

[0022] Inputting the time series data into the time feature branch to extract time branch features;

[0023] Inputting the time series data into the channel relationship branch to extract channel branch features;

[0024] The time branch feature and the channel branch feature are concatenated according to the first dimension to obtain the time dimension feature.

[0025] Optionally, the image vision two-dimensional model is a GCViT model pre-trained based on the ImageNet image dataset.

[0026] According to a second aspect of the present application, an electronic device is provided, comprising at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the photovoltaic power generation anomaly detection method described above.

[0027] According to a third aspect of the present application, a computer storage medium is provided, which stores instructions or programs. When the instructions or programs are executed by at least one processor, the at least one processor executes the photovoltaic power generation anomaly detection method described above.

[0028] The beneficial effects of the embodiments of the present application are as follows: Different from the prior art, in the embodiments of the present application, a method for detecting photovoltaic power generation anomalies is provided, which first obtains input feature data, pre-processes the input feature data to obtain time series data, and visualizes the input feature data to obtain two-dimensional image data; then, the time series data is input into a pre-trained one-dimensional time series model to extract time dimension features, and the two-dimensional image data is input into a pre-trained two-dimensional image vision model to extract image dimension features; finally, the time dimension features and the image dimension features are fused to output bimodal fusion features, and the photovoltaic power generation anomaly detection results are output based on the bimodal fusion features. The method of the present application proposes a multimodal network structure that fuses time series features and visual features based on the abnormal characteristics of photovoltaic power generation. With a small amount of sample training, it has strong generalization capabilities in cross-domain data sets, which greatly improves the accuracy and robustness of anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0030] Figure 1 This is a schematic diagram of an algorithm framework of a photovoltaic power generation anomaly detection model provided in an embodiment of the present application;

[0031] Figure 2 is a structural diagram of a one-dimensional time series model 40 provided in an embodiment of the present application;

[0032] Figure 3 4011 is a structural diagram of the CNN module provided in an embodiment of the present application;

[0033] Figure 4 4012 is a structural diagram of the time and channel attention module 4012 provided in an embodiment of the present application;

[0034] Figure 5 4021 is a structural diagram of the channel interaction feature module 4021 provided in an embodiment of the present application;

[0035] Figure 6 is a structural diagram of the cross attention fusion module 60 provided in an embodiment of the present application;

[0036] Figure 7 This is a flow chart of a photovoltaic power generation anomaly detection method provided in an embodiment of the present application;

[0037] Figure 8 is a schematic diagram of normal two-dimensional image data provided by an embodiment of the present application;

[0038] Figure 9 is a schematic diagram of abnormal two-dimensional image data provided by an embodiment of the present application;

[0039] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0041] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0042] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0043] The relevant professional terms in this application are explained as follows:

[0044] 1. Time Series Data: A sequence of data points arranged in chronological order, often used to analyze trends and patterns over time.

[0045] 2. RNN (Recurrent Neural Network): A neural network used to process sequential data and can capture temporal dependencies.

[0046] 3. LSTM (Long Short-Term Memory): A variant of RNN that better captures long-term dependencies by introducing memory units.

[0047] 4. GRU (Gated Recurrent Unit): Another variant of RNN, with a simpler structure than LSTM but similar performance.

[0048] 5. CNN (Convolutional Neural Network): A neural network used for image and time series data processing that extracts local features through convolutional layers.

[0049] 6. Transformer: A neural network architecture based on the self-attention mechanism, widely used in natural language processing and time series analysis.

[0050] 7. Multimodal Network Structure: A neural network architecture that can process multiple types of data simultaneously, such as time series and image data.

[0051] 8. Visual Representation: Visually represent data through images or graphics to facilitate human understanding and analysis.

[0052] 9. Max Pooling: A downsampling operation that retains salient features by selecting the maximum value in a local area.

[0053] 10. Temporal Attention: Used in time series data, it can dynamically focus on the importance of features at different time steps.

[0054] 11. Channel Attention: Used to analyze the importance of different channels (feature dimensions) and strengthen key features.

[0055] 12. Bidirectional LSTM: An extension of LSTM that can handle both forward and backward dependencies of time series data

[0056] 13. einsum (Einstein summation convention): A symbolic representation method for efficient computation of tensor operations.

[0057] 14. GCViT (Global Context Vision Transformer): A Transformer-based image processing model that can capture the global context information of an image.

[0058] 15. ImageNet: A large-scale image dataset commonly used for training and evaluating deep learning models.

[0059] 16. Cross-Domain Dataset: A dataset containing data from different domains or scenarios, used to test the generalization ability of the model.

[0060] 17. Robustness: The stability and reliability of the model in the face of noise, anomalies, or small number of samples.

[0061] 18. Generalization Ability: The ability of a model to perform well on unseen data.

[0062] 19. Local Waveform Fluctuation Feature: The local fluctuation pattern in time series data that changes over time.

[0063] 20. Statistical Time Deviation: Deviation in statistical characteristics of time series data due to delay or misalignment.

[0064] 21. Channel-wise Abnormal Correlation: Abnormal correlation between different channels (feature dimensions) caused by time misalignment.

[0065] 22. Rule (Rectified Linear Unit with Learnable parameters) activation function: It is an improved ReLU-type activation function that enhances the expressive power of the neural network by introducing learnable parameters.

[0066] 23. Dropout (random inactivation): It is a regularization technique that prevents overfitting by randomly blocking (setting to zero) the output of some neurons during training.

[0067] 24. Softmax (normalized exponential function): It is an activation function commonly used in multi-classification problems. It converts the original output of the neural network into a probability distribution so that the predicted probability of each category is in the range of [0,1] and the sum of the probabilities of all categories is 1.

[0068] 25. Adam (Adaptive Moment Estimation): A widely used deep learning optimization algorithm that dynamically adjusts the learning rate of each parameter by calculating the first-order moment (mean) and second-order moment (variance) of the gradient. AdamW is an improved version of Adam that modifies the weight decay implementation in the traditional Adam optimizer, providing better generalization performance in deep learning training.

[0069] Please refer to Figure 1 , Figure 1 This is a schematic diagram of the algorithm framework of a photovoltaic power generation anomaly detection model provided in the embodiment of the present application. Figure 1 As shown, the photovoltaic power generation anomaly detection model includes a data acquisition module 10, a data preprocessing module 20, a data visualization module 30, a time series one-dimensional model 40, an image vision two-dimensional model 50, a cross-attention fusion module 60 and an output module 70.

[0070] The data acquisition module 10 is used to acquire input characteristic data, which includes photovoltaic power generation characteristic data and weather radiation characteristic data.

[0071] The weather radiation characteristic data includes first radiation characteristic data and second radiation characteristic data. The first radiation characteristic data is ground solar radiation data collected at a first time interval, measured in watts per square meter; the second radiation characteristic data is shortwave global solar radiation level data collected at a second time interval, measured in watts per square meter; and the photovoltaic power generation characteristic data is actual photovoltaic power generation data collected at the first time interval, measured in watts per minute. Specifically, the weather radiation characteristic data is provided by a weather forecast app service. The first radiation characteristic data is predicted weather radiation data (with finer granularity), the second radiation characteristic data is actual weather radiation data (with greater accuracy), and the photovoltaic power generation characteristic data is actual power generation data reported by the energy storage device. In one embodiment, the first time interval is shorter than the second time interval. For example, the first time interval is 15 minutes, and the second time interval is 1 hour.

[0072] The data preprocessing module 20 is used to preprocess the input feature data to obtain time series data. Specifically, the channel features in the input feature data are merged according to a preset time interval scale and normalized. In this embodiment of the present application, the three feature data are preprocessed on a daily basis. The preset time interval scale can be set as needed. For simplicity, it can be set to the first time interval. In this case, the missing intervals in the second radiation feature data can be padded upwards and then merged with the first radiation feature data and photovoltaic power generation feature data at the same time interval. For example, the feature data of the first radiation feature data at a 15-minute interval, the photovoltaic power generation feature data at a 15-minute interval, and the second radiation feature data at a 1-hour interval are merged at a 15-minute scale to form the shape of (B, 3, 96). Where B represents the number of days, 3 represents the three channel features, and 96 is the granularity, which is obtained by dividing the 24 hours of a day into 15-minute intervals.

[0073] In one embodiment, the maximum and minimum method is used to normalize the characteristics of each channel, and the calculation formula is:

[0074]

[0075] in, is the input sample, is the number of channels, For the Channel samples, For the The minimum value of the channels, For the The maximum value of the channels, For the The normalized value of the samples of the channels.

[0076] It should be noted that there are many methods for normalizing the characteristics of each channel, and those skilled in the art can use other normalization methods for seamless replacement.

[0077] The data visualization module 30 is used to visualize the input feature data to obtain two-dimensional image data. Specifically, since the meanings of the channel features in the input feature data differ, in order to display the channel features on the same coordinate axis, each channel feature in the input feature data needs to be first scaled so that the feature values ​​of each channel are within approximately the same numerical range. The first scaling process can be performed using different scaling ratios for each channel feature. Then, the channel features after the first scaling process are visualized with time as the X-axis and feature value as the Y-axis to obtain basic image data. Finally, the basic image data is second scaled according to the input image size supported by the image visual two-dimensional model to obtain two-dimensional image data. In one embodiment, before performing the first scaling process, the channel features in the input feature data are also unified to the same time interval scale. For example, when all channel features in the input feature data are unified to the first time interval scale, missing intervals in the second radiation feature data can be simply padded upwards.

[0078] The time series one-dimensional model 40 is used to extract time dimension features based on time series data. For its specific network structure, please refer to the following based on Figure 2-Figure 5 Description.

[0079] The image vision 2D model 50 is used to extract image dimensional features based on 2D image data. In one embodiment, the image vision 2D model 50 is a GCViT model pre-trained on the ImageNet image dataset. This model can quickly extract efficient image features, reducing the computational cost of training from scratch while improving feature extraction. The input image size of the GCViT model is typically 3*224*224, where 3 represents the number of channels in the image and 224 represents the image's height and width. Therefore, the shape of the 2D image data is typically (B, 3, 224, 224), where B represents the number of days.

[0080] Cross attention fusion module 60 is used to fuse the time dimension features and image dimension features using the late cross attention mechanism and output the bimodal fusion features. For its specific network structure, please refer to the following based on Figure 6 Description.

[0081] Output module 70 is used to output photovoltaic power generation anomaly detection results based on the bimodal fusion features. Specifically, output module 70 first maps the bimodal fusion features to the final classification through a fully connected layer, and then outputs the probability distribution of each classification through a softmax activation function. The final classification can be binary or multi-class. When the final classification is binary, the photovoltaic power generation anomaly detection result is the probability of normal photovoltaic power generation and the probability of photovoltaic power generation anomaly. When the final classification is multi-class, the photovoltaic power generation anomaly detection result is the probability of normal photovoltaic power generation and the probability of various photovoltaic power generation anomaly categories.

[0082] Please refer to Figure 2 , Figure 2 4 is a structural diagram of the time series one-dimensional model 40 provided in the embodiment of the present application. Figure 2 As shown, the one-dimensional time series model 40 includes a time feature branch 401, a channel relationship branch 402, and a feature fusion module 403. The time feature branch 401 includes a CNN module 4011, a time and channel attention module 4012, and an LSTM timing module 4013. The channel relationship branch 402 includes a channel interaction feature module 4021. The CNN module 4011 primarily captures local waveform fluctuations through convolutional layers and uses max pooling to retain significant abnormal patterns. The time and channel attention module 4012 primarily learns cross-channel relationships at different time steps and analyzes the importance of the temporal dimension of each channel, thereby highlighting abnormal time points and capturing sudden fluctuations. Based on this, the LSTM timing module 4013 performs bidirectional LSTM processing to capture long-term dependencies and address delay alignment issues caused by statistical time deviations. The channel interaction feature module 4021 primarily detects abnormal inter-channel correlations caused by time misalignment by calculating inter-channel interactions (for example, by generating a correlation matrix using einsum).

[0083] The processing process of the one-dimensional time series model 40 is as follows: time series data is input into the time feature branch 401, and then passes through the CNN module 4011, the time and channel attention module 4012, and the LSTM timing module 4013 to extract the time branch features. Time series data is input into the channel relationship branch 402, and then passes through the channel interaction feature module 4021 to extract the channel branch features. The feature fusion module 403 then splices the time branch features and channel branch features along the first dimension and outputs the time dimension features.

[0084] Please refer to Figure 3 , Figure 3 4011 is a structural diagram of the CNN module 4011 provided in the embodiment of the present application. Figure 3As shown, the CNN module 4011 is a two-layer stacked convolution structure. Each convolution block includes a convolution layer, a normalization layer, an activation function, and a maximum pooling layer. The convolution kernel of the first convolution block is 5 and the padding is 2. The pooling kernel of the maximum pooling layer is 2. The convolution kernel of the second convolution block is 3 and the padding is 1. The pooling kernel of the maximum pooling layer is also 2.

[0085] Please refer to Figure 4 , Figure 4 4012 is a structural diagram of the time and channel attention module 4012 provided in the embodiment of the present application. Figure 4 As shown, the time and channel attention module 4012 includes a channel attention mechanism branch and a time attention mechanism branch. Among them, the channel attention mechanism branch includes processing mechanisms such as data transformation, the first fully connected layer, activation function, the second fully connected layer, sigmoid normalization and data restoration in sequence. The time attention mechanism branch includes processing mechanisms such as the first convolution, activation function, the second convolution and sigmoid normalization in sequence. Figure 3 The output features of the CNN module are input as input features to the channel attention mechanism branch and the time attention mechanism branch respectively to obtain the channel attention features and the time attention features. Then the output features, channel attention features and time attention features of the CNN module 4011 are multiplied element by element to obtain the output of the time and channel attention module 4012.

[0086] Please refer to Figure 5 , Figure 5 4021 is a structural diagram of the channel interaction feature module 4021 provided in the embodiment of the present application. Figure 5 As shown, channel interaction feature module 4021 first calculates channel interactions based on input features, then extracts channel features through a convolution module. Finally, through processing mechanisms such as activation functions, flattening layers, and fully connected layers, it outputs channel interaction features. By calculating inter-channel interactions, channel interaction feature module 4021 extracts temporal correlation features across different channels, effectively capturing data anomalies caused by temporal misalignment, enhancing the model's robustness in complex environments, and reducing false positives and false negatives.

[0087] Please refer to Figure 6 , Figure 6 : is a structural diagram of the cross attention fusion module 60 provided in the embodiment of the present application. Figure 6As shown, the cross-attention fusion module 60 includes a time-dimensional feature fusion branch 601 and an image-dimensional feature fusion branch 602. The time-dimensional feature fusion branch 601 takes as input the time-dimensional features extracted by the one-dimensional time series model 40 and includes processing mechanisms such as fully connected layers, activation functions, random dropout, and data transformation, with the output being time-series features. The image-dimensional feature fusion branch 602 takes as input the image-dimensional features extracted by the two-dimensional image vision model 50 and also includes processing mechanisms such as fully connected layers, activation functions, random dropout, and data transformation, with the output being first image features (output after random dropout) and second image features (output after data transformation). After obtaining the time-series features, first image features, and second image features, an encoder-decoder cross-attention mechanism is employed, using the second image features as query data and the time-series features as keys and values, to output the resulting value features. The value features are then transformed and concatenated with the first image features, outputting a bimodal fusion feature that fuses the time-series modality and the image vision modality. This late cross-fusion method enables the features of the two modalities to learn and complement each other, ensuring that the final feature vector can fully express multi-faceted information and improve the accuracy and robustness of the final anomaly detection.

[0088] Please refer to Figure 7 , Figure 7 : This is a flow chart of a photovoltaic power generation anomaly detection method provided by an embodiment of the present application, the method comprising:

[0089] Step S701: acquiring input characteristic data, wherein the input characteristic data includes photovoltaic power generation characteristic data and weather radiation characteristic data.

[0090] In one embodiment, the weather radiation characteristic data includes first radiation characteristic data and second radiation characteristic data. The first radiation characteristic data is the ground solar radiation data collected according to the first time interval, in units of watts per square meter; the second radiation characteristic data is the shortwave total solar radiation level data collected according to the second time interval, in units of watts per square meter; the photovoltaic power generation characteristic data is the actual photovoltaic power generation data collected according to the first time interval, in units of watts per minute. Specifically, the weather radiation characteristic data is provided by the weather forecast APP service, the first radiation characteristic data is the predicted weather radiation data, the second radiation characteristic data is the actual weather radiation data, and the photovoltaic power generation characteristic data is the actual power generation data reported by the energy storage device. In one embodiment, the first time interval is less than the second time interval. For example, the first time interval is 15 minutes and the second time interval is 1 hour.

[0091] Step S702 : pre-processing the input feature data to obtain time series data, and visualizing the input feature data to obtain two-dimensional image data.

[0092] In one embodiment, preprocessing the input feature data includes merging the channel features in the input feature data according to a preset time interval scale and normalizing the channel features. The specific processing process is described above.

[0093] In one embodiment, visualizing input feature data to obtain two-dimensional image data includes: first performing a first scaling process on each channel feature in the input feature data so that the feature values ​​of each channel are within the same numerical range; then visualizing each channel feature after the first scaling process with time as the X-axis and the feature value as the Y-axis to obtain basic image data; and then performing a second scaling process on the basic image data according to the input image size supported by the image visual two-dimensional model to obtain two-dimensional image data. In one embodiment, before performing the first scaling process, each channel feature in the input feature data is also unified to the same time interval scale. For example, when all channel features in the input feature data are unified to the first time interval scale, it is sufficient to simply fill in the missing intervals in the second radiation feature data.

[0094] Please refer to Figure 8 and Figure 9 , Figure 8 This is a schematic diagram of normal two-dimensional image data provided in an embodiment of the present application. Figure 9 This is a schematic diagram of abnormal two-dimensional image data provided in an embodiment of the present application. Figure 8 and Figure 9 As shown, the blue curve represents photovoltaic power generation characteristic data, the green curve represents the first radiation characteristic data, and the red curve represents the second radiation characteristic data. Because the Y values ​​of photovoltaic power generation characteristic data and weather radiation characteristic data have different meanings, after mapping the three curves to the same X-axis, they correspond to two Y axes. Specifically, the photovoltaic power generation characteristic data corresponds to the Y-axis on the left, and the first and second radiation characteristic data correspond to the Y-axis on the right.

[0095] Since photovoltaic power generation is highly correlated with solar radiation, visualizing the input feature data to the same dimension makes it easier for experts to use the visual representation of image data to understand the data and label the data in combination with expert knowledge, thereby enhancing the model's ability to understand complex data patterns.

[0096] Step S703: input the time series data into a pre-trained one-dimensional time series model to extract time dimension features, and input the two-dimensional image data into a pre-trained two-dimensional image vision model to extract image dimension features.

[0097] In this application, the photovoltaic power generation anomaly detection model includes a one-dimensional time series model and a two-dimensional image vision model. Its training data includes two modalities: time series data and two-dimensional image data. When training the photovoltaic power generation anomaly detection model, the optimizer uses the AdamW optimization algorithm, adaptively adjusting the learning rate during training to accelerate model convergence. In one embodiment, the two-dimensional image vision model uses the GCViT model pre-trained on the ImageNet image dataset and can be learned using a small learning rate (e.g., 0.0001). The GCViT model combines a global contextual self-attention module with local self-attention, effectively and efficiently capturing long-range and short-range dependencies in images without performing expensive operations. The one-dimensional time series model is a completely new model and must be trained from scratch using a higher learning rate (e.g., 0.001). The training loss function can use the classic cross-entropy loss function.

[0098] After training the photovoltaic power generation anomaly detection model using the aforementioned training method, a pretrained one-dimensional time series model and a pretrained two-dimensional image vision model are obtained. The specific process of inputting time series data into the pretrained one-dimensional time series model to extract time dimension features and inputting two-dimensional image data into the pretrained two-dimensional image vision model to extract image dimension features is described above.

[0099] Step S704: Fusing the time dimension features and the image dimension features to output a bimodal fusion feature.

[0100] In one embodiment, the time dimension features and the image dimension features are fused using a late cross attention mechanism to output a bimodal fusion feature. Specifically, the time dimension features are processed by a time dimension feature fusion branch to obtain a time fusion feature, and the time dimension feature fusion branch includes a fully connected layer, an activation function, random dropout, a data transformation and other processing mechanisms. The image dimension features are processed by an image dimension feature fusion branch to obtain an image fusion feature, and the image dimension feature fusion branch also includes a fully connected layer, an activation function, random dropout, a data transformation and other processing mechanisms. After obtaining the time fusion feature and the image fusion feature, the image fusion feature is used as the query data, and the time fusion feature is used as the key and value to output the corresponding time fusion feature. After the corresponding time fusion feature is subjected to data transformation, it is spliced ​​with the image fusion feature as the query data to output a bimodal fusion feature that fuses the time series modality and the image visual modality.

[0101] Step S705: Outputting photovoltaic power generation anomaly detection results based on the bimodal fusion features.

[0102] Specifically, the bimodal fusion features are mapped to the final classification through a fully connected layer mechanism, and the probability distribution of each classification is then output using the Softmax activation function. The final classification can be binary or multi-class. When the final classification is binary, the PV power generation anomaly detection result is the probability of normal PV power generation and the probability of abnormal PV power generation. When the final classification is multi-class, the PV power generation anomaly detection result is the probability of normal PV power generation and the probability of various PV power generation anomaly categories.

[0103] The following is an example to illustrate the specific process of photovoltaic power generation anomaly detection method:

[0104] Step 1: Obtain corresponding weather radiation characteristic data based on the photovoltaic power generation characteristic data recorded by the energy storage photovoltaic device and the corresponding longitude, latitude, date and other information to obtain input characteristic data.

[0105] Step 2: Preprocess the input feature data in days to obtain time series data with a shape of (B, 3, 96), where B represents the number of days, 3 represents the three channel features, and 96 represents the granularity; visualize the input feature data to obtain two-dimensional image data with a shape of (B, 3, 224, 224), where B represents the number of days, 3 represents the three channel features, 224 represents the length of the image, and 224 represents the width of the image.

[0106] Step 3: Input the time series data into the time series 1D model to extract time dimension features, including:

[0107] Temporal feature branch This branch is mainly divided into CNN module, time and channel attention module and LSTM timing module.

[0108] 1) CNN module

[0109] a. Input is time series data (B, 3, 96)

[0110] b. Convolution C (kernel size: 5, padding: 2)

[0111] c. Batch Normalization Layer

[0112] d.Rule activation function

[0113] e. Convolution C (kernel size: 3, padding: 1)

[0114] f. Batch Normalization Layer

[0115] g. ReLu activation function

[0116] h. Max pooling (kernel size: 2)

[0117] i. Output feature shape is (B, 32, 24)

[0118] Among them, in the output feature (B, 32, 24), 32 represents the number of channels of the feature, and 24 represents the length of the feature.

[0119] 2) Temporal and channel attention modules

[0120] The input is the features extracted by the CNN module (B, 32, 24), which are given to the temporal attention mechanism branch and the channel attention mechanism branch respectively.

[0121] ① Temporal attention mechanism branch

[0122] a. Convolution C (kernel size: 1, output channels: 16)

[0123] b.Rule activation function

[0124] c. Convolution C (kernel size: 1, output channels: 32)

[0125] d.sigmoid normalization

[0126] e. Output feature shape is (B, 32, 24)

[0127] Among them, in the output feature (B, 32, 24), 32 represents the number of channels of the feature, and 24 represents the length of the feature.

[0128] ②Channel attention mechanism branch

[0129] a. Transform the output features of the CNN module into (B*24,32)

[0130] This step is to reduce the dimensionality of the data, and the first dimension B (number of days) and the third dimension 24 (24 hours in a day) of the original three dimensions (B, 32, 24) are spliced ​​together to form (B*24, 32).

[0131] b. Fully connected layer (input is 32, output is 16)

[0132] c.Rule activation function

[0133] d. Fully connected layer (input is 16, output is 32)

[0134] e.Sigmoid normalization

[0135] f. Data restoration (B, 32, 24)

[0136] ③ Multiply the extracted features of the CNN module, the extracted features of the temporal attention mechanism branch, and the extracted features of the channel attention mechanism branch by elements, and the output feature shape is (B, 32, 24).

[0137] 3) LSTM Timing Module

[0138] a. The shape of the fused features after transformation is (B, 24, 32)

[0139] b. Input to the LSTM timing module, the output feature shape is (B, 128)

[0140] Among them, the output feature (B, 128) is the extracted time feature information, and 128 represents the feature length, which comes from the number of output layers defined in LSTM.

[0141] Channel relationship branch This branch mainly detects abnormal correlations caused by the misalignment of photovoltaic power generation characteristics and weather characteristics by calculating the interaction between channels.

[0142] a. Input is time series data (B, 3, 96)

[0143] b. Calculate channel interaction and output feature shape (B, 9, 96)

[0144] c. Convolution C (kernel size: 1, output channel: 16)

[0145] d.Rule activation function

[0146] e. Flatten the data and output (B, 16*96)

[0147] f. Fully connected layer (input is 16*96, output is 32)

[0148] g. Output feature shape is (B, 32)

[0149] (3) Concatenate the output features of the time feature branch and the channel relationship branch according to the first dimension, and output the time dimension feature with a shape of (B, 160)

[0150] Among them, the time dimension feature (B, 160) is obtained by concatenating the output of the time feature branch (B, 128) and the feature output of the channel relationship branch (B, 32).

[0151] Step 4: Input the 2D image data into the image vision 2D model to extract image dimensional features, including:

[0152] a. Input is 2D image data (B, 3, 224, 224)

[0153] b. GCViT extracts features and outputs image dimension features with a shape of (B, 320)

[0154] Among them, the 320 in the image dimension feature (B, 320) represents the image extraction feature length. Similar to the previous LSTM, it also comes from the output layer parameters defined for the neural network.

[0155] Step 5: Fuse the time dimension features and image dimension features to output the bimodal fusion features, which specifically includes:

[0156] (1) Time dimension feature fusion branch

[0157] a. Input time dimension features, shape is (B, 160)

[0158] b. Fully connected layer (input is 160, output is 512)

[0159] c.Rule activation function

[0160] d. Dropout random inactivation (inactivation probability is 0.5)

[0161] e. Transform the data and output time series features (B, 1, 512)

[0162] (2) Image dimension feature fusion branch

[0163] a. Input is image dimension feature, shape is (B, 320)

[0164] b. Fully connected layer (input is 320, output is 512)

[0165] c.Rule activation function

[0166] d. Dropout random inactivation (inactivation probability is 0.5)

[0167] e. Output the first image feature (B, 512)

[0168] f. Transform the data and output the second image feature (B, 1, 512)

[0169] (3) Cross-Attention Fusion

[0170] a. Use the second image feature as the query, the time series feature as the key and value, and output the value feature (B, 1, 512)

[0171] b. Transform the value feature and output the time fusion feature (B, 512)

[0172] (4) Concatenate the temporal fusion feature and the first image feature to output the bimodal fusion feature (B, 1024)

[0173] Among them, in the bimodal fusion feature (B,1024), 1024=512*2, 2 represents the two modalities of time and image, and 512 represents the dimension of time feature and the dimension of image feature.

[0174] Step 6: Output photovoltaic power generation anomaly detection results based on the bimodal fusion features.

[0175] The bimodal fusion feature (B, 1024) is input into a fully connected layer and mapped to the final classification. The Softmax activation function then outputs the probability distribution for each classification, resulting in the photovoltaic power generation anomaly detection result. If the final classification is binary, the shape of the photovoltaic power generation anomaly detection result is (B, 2). Because the final classification is binary, it has two dimensions, each of which is a real number between 0 and 1. The first dimension represents the probability of normality, and the second represents the probability of anomaly.

[0176] The photovoltaic power generation anomaly detection method provided in the embodiment of the present application first obtains input feature data, preprocesses the input feature data to obtain time series data, and visualizes the input feature data to obtain two-dimensional image data; then, the time series data is input into a pre-trained one-dimensional time series model to extract time dimension features, and the two-dimensional image data is input into a pre-trained two-dimensional image vision model to extract image dimension features; finally, the time dimension features and the image dimension features are fused to output a bimodal fusion feature, and the photovoltaic power generation anomaly detection result is output based on the bimodal fusion feature. The method of the present application proposes a multimodal network structure that fuses time series features and visual features based on the abnormal characteristics of photovoltaic power generation. With a small amount of sample training, it has strong generalization ability in cross-domain data sets, greatly improving the accuracy and robustness of anomaly detection.

[0177] According to an embodiment of the present application, an electronic device is provided, such as Figure 10 , is a schematic structural diagram of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004. The processor 1001, the communication interface 1002, and the memory 1003 communicate with each other via the communication bus 1004. The processor 1001 may call logic instructions in the memory 1003 to execute the above-mentioned photovoltaic power generation anomaly detection method.

[0178] In addition, the logical instructions in the above-mentioned memory 1003 can be implemented in the form of a software functional unit and can be stored in several computer-readable storage media when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the photovoltaic power generation anomaly detection method mentioned above in the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0179] According to an embodiment of the present application, a computer-readable storage medium is provided, the type of which is as described above, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor performs the steps of the photovoltaic power generation anomaly detection method described above.

[0180] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the relevant technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or certain portions of the embodiments.

[0181] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of variations or substitutions within the technical scope disclosed in the present application. Therefore, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A photovoltaic power generation anomaly detection method, characterized in that: The method comprises: Acquiring input characteristic data, wherein the input characteristic data includes photovoltaic power generation characteristic data and weather radiation characteristic data; Preprocessing the input feature data to obtain time series data, and visualizing the input feature data to obtain two-dimensional image data; Input the time series data into a pre-trained one-dimensional time series model to extract time dimension features, and input the two-dimensional image data into a pre-trained two-dimensional image vision model to extract image dimension features; Fusing the time dimension feature and the image dimension feature to output a bimodal fusion feature; Outputting photovoltaic power generation anomaly detection results based on the bimodal fusion features; The visualizing the input feature data to obtain two-dimensional image data includes: Performing a first scaling process on the features of each channel in the input feature data so that the feature values ​​of each channel are in the same numerical range; The channel features after the first scaling process are visualized with time as the X-axis and feature value as the Y-axis to obtain basic image data; The basic image data is subjected to a second scaling process according to an input image size supported by the image visual two-dimensional model to obtain the two-dimensional image data.

2. The method according to claim 1, characterized in that The preprocessing of the input feature data includes: merging the channel features in the input feature data according to a preset time interval scale and normalizing the channel features.

3. The method according to claim 1, characterized in that The weather radiation characteristic data includes first radiation characteristic data and second radiation characteristic data, the first radiation characteristic data is ground solar radiation data collected according to a first time interval, and the second radiation characteristic data is shortwave total solar radiation level data collected according to a second time interval.

4. The method according to claim 1, wherein The step of fusing the time dimension feature and the image dimension feature to output a bimodal fusion feature includes: The time dimension features and the image dimension features are fused using a late cross attention mechanism to output a bimodal fusion feature.

5. The method according to any one of claims 1 to 4, characterized in that The one-dimensional time series model includes a time feature branch and a channel relationship branch. The time feature branch includes a convolutional neural network module, a time and channel attention module, and a long short-term memory network timing module. The channel relationship branch includes a channel interaction feature module.

6. The method according to claim 5, characterized in that Inputting the time series data into a pre-trained one-dimensional time series model to extract time dimension features includes: Inputting the time series data into the time feature branch to extract time branch features; Inputting the time series data into the channel relationship branch to extract channel branch features; The time branch feature and the channel branch feature are concatenated according to the first dimension to obtain the time dimension feature.

7. The method according to any one of claims 1 to 4, characterized in that The image vision two-dimensional model is a GCViT model pre-trained based on the ImageNet image dataset.

8. An electronic device, characterized in that: The method comprises at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so as to enable the at least one processor to execute the method according to any one of claims 1 to 7.

9. A computer storage medium, characterized in that The computer storage medium stores instructions or programs, and when the instructions or programs are executed by at least one processor, the at least one processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Model fusion-based photovoltaic power generation power prediction method and system

    CN116502074A