Photovoltaic power generation anomaly detection method based on combination of optimization algorithm and deep learning
By adopting an optimization algorithm combined with deep learning method in photovoltaic power generation anomaly detection, and using the improved snow ablation optimization algorithm to optimize the Transformer-BiLSTM model, the problem that existing methods are difficult to capture the complex characteristics of photovoltaic power generation timing data is solved, and more efficient anomaly detection performance and stronger adaptability are achieved.
Patent Information
- Application Number
- CN202510114052.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-23
AI Technical Summary
Existing photovoltaic power generation anomaly detection methods are difficult to effectively capture the complex characteristics of photovoltaic power generation timing data, especially when dealing with nonlinear, non-stationary and noise interference, and are highly dependent on labeled data, making it difficult to adapt to the modeling needs of high-dimensional dynamic data.
Using an optimization algorithm combined deep learning method, the key parameters in the Transformer encoder and BiLSTM decoder model are optimized through the improved snow ablation optimization algorithm, and the Transformer-BiLSTM deep learning model is constructed, and the global dependence characteristics and local features of the time series are captured using multi-headed attention mechanism and bidirectional recurrent neural network, and abnormal detection is performed through reconstruction errors.
It significantly improves the model's adaptability and parameter optimization efficiency for multivariate time series data, improves abnormal detection performance, reduces dependence on labeled data, and can efficiently capture the complex dynamic characteristics of photovoltaic power generation timing data.
Smart Images

Figure CN120030475A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation abnormal data detection, and in particular to a photovoltaic power generation abnormality detection method based on optimization algorithm combined with deep learning. Background Art
[0002] As global energy demand grows and environmental awareness increases, photovoltaic power generation, as a clean and renewable energy source, has been widely used in industrial, commercial and household fields, becoming an important part of achieving carbon neutrality goals. During operation, a large amount of time series data generated by photovoltaic power generation systems contains information such as operating status, power characteristics and external environment. However, due to factors such as equipment failure, environmental changes and human operational errors, outliers often exist in photovoltaic power generation time series data. These outliers not only affect the system performance evaluation, but also amplify the detection model error, thereby reducing power generation efficiency, economic benefits and system safety. Therefore, the development of efficient anomaly detection methods is of great significance to ensure the stable operation of the system and reduce maintenance costs.
[0003] Traditional anomaly detection methods include statistical models and machine learning-based methods. Statistical models usually rely on data distribution assumptions and are difficult to adapt to the nonlinear, non-stationary and noise interference characteristics that are prevalent in photovoltaic power generation time series data. Especially in photovoltaic scenarios, the complex fluctuations caused by environmental factors such as weather changes and equipment aging further limit their application. Machine learning-based methods have certain advantages in processing nonlinear data, but they are usually highly dependent on labeled data and it is difficult to effectively capture the long-term dependencies of photovoltaic power generation time series data. In addition, the performance of machine learning models is heavily dependent on the quality of feature engineering and is difficult to adapt to the modeling needs of high-dimensional dynamic data.
[0004] In recent years, the rapid development of deep learning technology has promoted the research of anomaly detection methods based on unsupervised learning. With its powerful feature representation ability, deep learning models can extract deep information from raw data and provide new ideas for building robust anomaly detection systems. However, existing deep learning methods still have shortcomings when dealing with complex and changeable long-term series data of photovoltaic power generation. On the one hand, these methods have difficulty in capturing global temporal dependencies and local dynamic features; on the other hand, their parameter optimization process usually relies on a lot of manual debugging, and the generalization performance still has room for improvement.
[0005] Therefore, to address the above problems, a photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning was proposed to improve the reconstruction ability and anomaly detection performance of the model. Summary of the invention
[0006] The purpose of the present invention is to provide a photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning, which combines the improved snow melting optimization algorithm and the deep learning model, helps to improve the anomaly detection efficiency of the photovoltaic power generation system, ensure the stable operation of the system, and effectively reduce the operating costs.
[0007] To achieve the above object, the present invention provides a photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning, the steps comprising:
[0008] S1. Acquire photovoltaic power generation data and pre-process the photovoltaic power generation data;
[0009] S2. Build a Transformer-BiLSTM deep learning model, which includes a Transformer encoder, a BiLSTM decoder, and a fully connected layer;
[0010] S3. Improve the snow melting optimization algorithm and use the improved snow melting optimization algorithm to optimize the key parameters in the Transformer encoder and BiLSTM decoder models;
[0011] S4, training the optimized deep learning model, reconstructing the photovoltaic power generation data through the trained model, and realizing anomaly detection based on the reconstruction error;
[0012] S41. Input the photovoltaic power generation data into the optimized deep learning model. The Transformer encoder uses the multi-head attention mechanism to capture the global dependency characteristics of the time series and converts the photovoltaic power generation time series data into encoded feature representations.
[0013] S42,BiLSTM decoder combined with bidirectional recurrent neural network deeply mines local time series features and fully captures the contextual information of photovoltaic data;
[0014] S43, the fully connected layer outputs the reconstructed data and compares it with the original data to achieve anomaly detection based on the reconstruction error.
[0015] Preferably, the photovoltaic power generation data in step S1 includes actual photovoltaic power generation value, predicted value, load factor, meteorological data, photovoltaic power generation performance data, solar radiation, meteorological conditions and power generation characteristics.
[0016] Preferably, in step S2, the Transformer encoder includes an input layer, an encoding layer, a multi-head attention module, a feedforward network module and an output layer, wherein the multi-head attention module and the feedforward network module both introduce a regularization layer, a layer normalization layer and a residual connection; the BiLSTM decoder includes an input layer, a double-layer propagation layer, an activation layer and an output layer, wherein the double-layer propagation layer is a double-layer recurrent neural network.
[0017] Preferably, in step S3, the snow melting optimization algorithm is improved by introducing a good point set strategy and a periodic oscillation mutation strategy, and the improved snow melting optimization algorithm includes:
[0018] S31, good point set initialization, first, the equal spacing method is used to generate uniformly distributed candidate solutions in the solution space; then, based on the candidate solutions generated by the uniform distribution, a small range of random perturbations are added; finally, the candidate solution is obtained by combining the uniform distribution and the perturbation part, and the formula is:
[0019]
[0020] Among them, lb and ub are the upper and lower bounds of the solution space, N is the total number of candidate solutions, δ is the control perturbation amplitude, and rand(N,dim) represents the random perturbation in each dimension, which obeys uniform distribution;
[0021] S32, the exploration phase simulates the sublimation and evaporation process, and describes the random motion of individuals through Brownian motion. The probability density function of Brownian motion is:
[0022]
[0023] The individual's position is updated as:
[0024] Z i (t+1)=Elite(t)+B M ×θ 1 ×(G(t)-Z i (t))+(1-θ 1 )×(Z(t)-Z i (t));
[0025] Among them, Elite(t) represents the set of elite individuals; B M represents the random vector of Brownian motion; G(t) is the global optimal solution in the current population; Z i (t) represents the position of the i-th individual at time t; Z(t) represents the centroid position of the entire population; θ 1 Used to balance the global optimal solution and the population center solution;
[0026] S33, the development phase simulates the melting process, accelerates local optimization through melting rate and degree-day factor, and gradually approaches the optimal solution. The individual position update expression is:
[0027] Z i (t+1)=M×(G(t)-Z i (t))+B M ×θ 2 ×(Z(t)-Z i (t));
[0028] Where M represents the melting rate, which enhances the local search capability; θ 2 represents the weights controlling the local optimum and population center;
[0029] S34, periodically oscillate the current position, and the specific expression of the periodic oscillation mutation strategy is:
[0030]
[0031] Where, X current is the current individual position, Best_pos is the global optimal solution, X new The individual position is updated to gradually approach the global optimal solution; A represents the oscillation amplitude, which controls the intensity of the disturbance, k represents the number of iterations, and T represents the oscillation period.
[0032] Preferably, in step S3, an improved snow melting optimization algorithm is used to optimize two key parameters, namely, learning rate and batch size, in the Transformer encoder and BiLSTM decoder models.
[0033] Preferably, in step S41, the Transformer encoder uses a multi-head attention mechanism to capture the global dependency characteristics of the time series, and converts the photovoltaic power generation time series data into an encoded feature representation including:
[0034] S411, combine the sine and cosine functions to encode each position to ensure that the model understands the relative and absolute position relationship between the data;
[0035] S412. Calculate the weight of the self-attention mechanism to capture the dependency between the data in the input sequence. The formula of the self-attention mechanism is:
[0036]
[0037] Where Q is the query matrix, K is the key matrix, V is the value matrix, and d k is the dimension of the key, QK T represents the dot product between the query and the key, obtains the attention weight through the softmax function, and finally multiplies it with the value matrix V to obtain the weighted sum result;
[0038] S413. Use the multi-head attention mechanism to divide Q, K, and V into multiple subspaces respectively, and calculate their respective attention outputs in parallel. The calculation formula for attention is:
[0039] MultiHead(Q,K,V)=Concat(head 1 ,head 2 ,...,head h )WO ;
[0040] Where h represents the number of heads, and is transformed through a linear weight matrix W O Concatenate and map the outputs of all heads to the final dimension;
[0041] S414: Use a feedforward neural network to perform a nonlinear transformation on the representation of each position. The feedforward neural network includes two linear transformations and an activation function. The nonlinear transformation expression is:
[0042] FFN(x)=max(0,xW 1 +b 1 )W 2 +b 2 ;
[0043] Among them, W 1 and W 2 is the weight matrix, b 1 and b 2 It is a bias term, and the activation function usually uses ReLU to increase the nonlinear expression ability of the model.
[0044] Preferably, step S42 specifically includes: the BiLSTM decoder processes the forward and reverse information of the input sequence in parallel, and obtains richer context information by merging the hidden states in these two directions; the bidirectional hidden state h t The expression is: They represent the forward LSTM hidden state and the reverse LSTM hidden state respectively, and the hidden states of the forward recurrent neural network and the reverse recurrent neural network are connected into a higher-dimensional vector as the final output of the bidirectional recurrent neural network.
[0045] Preferably, in step S43, the fully connected layer outputs the reconstructed data, including: the fully connected layer integrates the input features extracted by the previous layer into a high-dimensional representation of the current task, and outputs the reconstructed data, and the output calculation formula is:
[0046] y=f(Wx+b);
[0047] In the formula, x is the input feature vector; W is the weight matrix, which is used to represent the connection weights between the input node and the output node; b is the bias vector, which is used to adjust the activation threshold; f is the activation function, which is used to introduce nonlinear capabilities so that the network can express more complex feature relationships.
[0048] Therefore, the present invention adopts the above-mentioned photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning, which has the following beneficial effects:
[0049] (1) Improve the snowmelt optimization algorithm by introducing the good point set strategy and the periodic oscillation mutation strategy, significantly enhancing the global search ability and parameter optimization efficiency, and improving the adaptability of the model to multivariate time series data.
[0050] (2) Construct a Transformer encoder, use the multi-head attention mechanism to capture the global dependence characteristics of the time series, and improve the generalization ability of the model through regularization methods;
[0051] (3) Based on the BiLSTM decoder module, deeply mine the local time series features through the bidirectional recurrent neural network, significantly enhancing the detection sensitivity of the model to abnormal patterns;
[0052] (4) The method of the present invention performs anomaly detection through the reconstruction error in an unsupervised learning framework, avoiding the dependence on labeled data, and efficiently capturing the complex dynamic features of photovoltaic power generation time series data.
[0053] The technical solution of the present invention will be further described in detail below with reference to the drawings and embodiments. Description of the Drawings
[0054] Figure 1 It is the flowchart of the method of the embodiment of the present invention;
[0055] Figure 2 It is the structure diagram of the Transformer encoder of the embodiment of the present invention;
[0056] Figure 3 It is the structure diagram of the BiLSTM decoder of the embodiment of the present invention;
[0057] Figure 4 It is the structure diagram of the SAO algorithm of the embodiment of the present invention;
[0058] Figure 5 It is the structure diagram of the good point set strategy of the GVSAO algorithm of the embodiment of the present invention;
[0059] Figure 6 It is the structure diagram of the periodic oscillation mutation strategy of the GVSAO algorithm of the embodiment of the present invention;
[0060] Figure 7 It is the comparison diagram of the original data and the reconstructed data based on the DKASC dataset of the embodiment of the present invention. Detailed Embodiments
[0061] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0062] Example
[0063] The collection of photovoltaic power generation data is affected by many factors such as environmental conditions, equipment performance and weather changes, resulting in heterogeneous data and complex time series characteristics. Figure 1 The present invention provides a photovoltaic power generation anomaly detection method based on an optimization algorithm combined with deep learning, comprising:
[0064] S1. Obtain three public photovoltaic power generation data sets (DKASC data set, ODE data set and REG data set) and preprocess the data sets, including missing value processing, data normalization, feature extraction, sliding window construction and data denoising. Photovoltaic power generation data mainly include actual photovoltaic power generation value, predicted value, load factor, meteorological data, photovoltaic power generation performance data, solar radiation, meteorological conditions and power generation. The above data sets are all sampled at an interval of 15 minutes and divided into 80% training set and 20% test set according to the ratio.
[0065] S2. Build a Transformer-BiLSTM deep learning model. The deep learning model includes a Transformer encoder, a BiLSTM decoder, and a fully connected layer. The Transformer encoder structure is as follows: Figure 2 As shown in Figure 1, it includes input layer, encoding layer, multi-head attention module, feedforward network module and output layer. Both the multi-head attention module and the feedforward network module introduce regularization layer, layer normalization layer and residual connection to prevent overfitting. The BiLSTM decoder structure is shown in Figure 1. Figure 3 As shown, it includes an input layer, a double-layer propagation layer, an activation layer and an output layer, wherein the double-layer propagation layer is a double-layer recurrent neural network.
[0066] S3. Improve the snow melting optimization algorithm (SAO) and use the improved snow melting optimization algorithm (GVSAO) to optimize the two key parameters of learning rate and batch size in the Transformer encoder and BiLSTM decoder models.
[0067] Specifically, the snow melting optimization algorithm is improved by introducing the good point set strategy and the periodic oscillation mutation strategy. The overall structure of the SAO algorithm is as follows: Figure 4 As shown in the figure, the structure of the good point set strategy is as follows Figure 5 As shown, the structure of the periodic oscillation mutation strategy is as follows Figure 6 As shown in Figure 2, the improved snow melting optimization algorithm specifically includes:
[0068] S31, good point set initialization, first, the equal spacing method is used to generate uniformly distributed candidate solutions in the solution space; then, based on the candidate solutions generated by the uniform distribution, a small range of random perturbations are added; finally, the candidate solution is obtained by combining the uniform distribution and the perturbation part, and the formula is:
[0069]
[0070] Among them, lb and ub are the upper and lower bounds of the solution space, N is the total number of candidate solutions, δ is the control perturbation amplitude, and rand(N,dim) represents the random perturbation in each dimension, which obeys uniform distribution;
[0071] S32, the exploration phase simulates the sublimation and evaporation process, and describes the random motion of individuals through Brownian motion. The probability density function of Brownian motion is:
[0072]
[0073] The individual's position is updated as:
[0074] Z i (t+1)=Elite(t)+B M ×θ 1 ×(G(t)-Z i (t))+(1-θ 1 )×(Z(t)-Z i (t));
[0075] Among them, Elite(t) represents the set of elite individuals; B M represents the random vector of Brownian motion; G(t) is the global optimal solution in the current population; Z i (t) represents the position of the i-th individual at time t; Z(t) represents the centroid position of the entire population; θ 1 Used to balance the global optimal solution and the population center solution;
[0076] S33, the development phase simulates the melting process, accelerates local optimization through melting rate and degree-day factor, and gradually approaches the optimal solution. The individual position update expression is:
[0077] Z i(t+1)=M×(G(t)-Z i (t))+B M ×θ 2 ×(Z(t)-Z i (t));
[0078] Where M represents the melting rate, which enhances the local search capability; θ 2 represents the weights controlling the local optimum and population center;
[0079] S34, periodically oscillate the current position, and the specific expression of the periodic oscillation mutation strategy is:
[0080]
[0081] Where, X current is the current individual position, Best_pos is the global optimal solution, X new The individual position is updated to gradually approach the global optimal solution; A represents the oscillation amplitude, which controls the intensity of the disturbance, k represents the number of iterations, and T represents the oscillation period.
[0082] S4. Train the optimized deep learning model, reconstruct the photovoltaic power generation data through the trained model, and implement anomaly detection based on the reconstruction error, specifically including:
[0083] S41. Input the photovoltaic power generation data into the optimized deep learning model. The Transformer encoder uses the multi-head attention mechanism to capture the global dependency characteristics of the time series, converts the pre-processed photovoltaic power generation time series data into encoded feature representation, and improves the processing efficiency through parallel computing. Specifically:
[0084] S411. Combine the sine and cosine functions to encode each position to ensure that the model understands the relative and absolute position relationship between the data.
[0085] S412. Calculate the weight of the self-attention mechanism to capture the dependencies between the data in the input sequence. In the field of photovoltaic power generation, a similar mechanism is used to model the interaction between different features. The formula of the self-attention mechanism is:
[0086]
[0087] Where Q is the query matrix, K is the key matrix, V is the value matrix, and d k is the dimension of the key, QK T represents the dot product between the query and the key, obtains the attention weight through the softmax function, and finally multiplies it with the value matrix V to obtain the weighted sum result;
[0088] S413. Use the multi-head attention mechanism to divide Q, K, and V into multiple subspaces, and calculate their respective attention outputs in parallel, thereby enhancing the expressiveness of the model. The calculation formula for attention is:
[0089] MultiHead(Q,K,V)=Concat(head 1 ,head 2 ,…,head h )W O ;
[0090] Where h represents the number of heads, and is transformed through a linear weight matrix W O Concatenate and map the outputs of all heads to the final dimension;
[0091] S414: Use a feedforward neural network to perform a nonlinear transformation on the representation of each position. The feedforward neural network includes two linear transformations and an activation function. The nonlinear transformation expression is:
[0092] FFN(x)=max(0,xW 1 +b 1 )W 2 +b 2 ;
[0093] Among them, W 1 and W 2 is the weight matrix, b 1 and b 2 It is a bias term, and the activation function usually uses ReLU to increase the nonlinear expression ability of the model.
[0094] S42, BiLSTM decoder combined with bidirectional recurrent neural network deeply mines local time series features and fully captures the context information of photovoltaic data. Specifically, BiLSTM decoder processes the forward and reverse information of the input sequence in parallel, and obtains richer context information by merging the hidden states of these two directions; the bidirectional hidden state h t The expression is: t =[h t fwd ,h t bwd ],h t fwd h t bwd They represent the forward LSTM hidden state and the reverse LSTM hidden state respectively, and the hidden states of the forward recurrent neural network and the reverse recurrent neural network are connected into a higher-dimensional vector as the final output of the bidirectional recurrent neural network.
[0095] S43, the fully connected layer outputs the reconstructed data and compares it with the original data to achieve anomaly detection based on the reconstruction error. Taking the DKASC dataset as an example, the comparison results between the original data and the reconstructed data are as follows: Figure 7 shown.
[0096] Specifically, the fully connected layer outputs reconstructed data including: the fully connected layer integrates the input features extracted by the previous layer into a high-dimensional representation of the current task, and outputs the reconstructed data. The output calculation formula is:
[0097] y=f(Wx+b);
[0098] In the formula, x is the input feature vector; W is the weight matrix, which is used to represent the connection weights between the input node and the output node; b is the bias vector, which is used to adjust the activation threshold; f is the activation function, which is used to introduce nonlinear capabilities so that the network can express more complex feature relationships.
[0099] The reconstruction error is calculated based on the difference between the input sequence and the reconstructed sequence. If the reconstruction error is less than the threshold, it is a normal sample. If it is greater than the threshold, it is an abnormal sample. The reconstruction error calculation formula is:
[0100]
[0101] In the formula, e i is the reconstruction error, X i Represents the original sample, Represents the reconstructed sample.
[0102] It should be noted that the evaluation of model performance in this embodiment is based on the confusion matrix, and is evaluated by precision, recall and F1-Score. The calculation formula is as follows:
[0103]
[0104] Among them, precision measures the proportion of true anomalies among detected anomalies, TP represents the number of samples that are actually outliers and correctly predicted as outliers, FP represents the number of samples that are actually normal values but are incorrectly predicted as outliers, that is, false positives; recall measures the proportion of successful detections among actual anomalies, reflecting the sensitivity of the model to anomalies, FN represents the number of samples that are actually outliers but are incorrectly predicted as normal values, that is, missed reports; the F1 score is the harmonic mean of precision and recall, which is used to comprehensively evaluate model performance. Precision represents precision, and Recall represents recall.
[0105] To ensure the fairness of the embodiment and the effectiveness of the results, the model parameters are fully debugged to obtain the best performance. Table 1 lists the specific parameter settings in detail.
[0106] Table 1 Model parameter setting table
[0107]
[0108]
[0109] This paper presents an example analysis based on three public data sets of photovoltaic power generation from different regions:
[0110] In order to verify the effectiveness and superiority of the present invention in anomaly detection in photovoltaic power generation time series data, comparative experiments and ablation experiments were carried out.
[0111] Comparative experiment
[0112] Based on three photovoltaic power generation data sets, a comparative experiment was conducted with seven anomaly detection methods, where Proposed represents the method of the present invention. The experimental results are shown in Table 2. It can be seen from Table 2 that the anomaly detection performance of the present invention is significantly better than that of other methods.
[0113] Table 2. Anomaly detection results of the comparison methods on three photovoltaic power generation data sets
[0114]
[0115]
[0116] The results of the implementation examples show that the present invention captures global dependencies through the Transformer's multi-head attention mechanism, combines BiLSTM to model local features, and achieves global optimization of parameters through GVSAO, which performs well in anomaly detection tasks. Compared with other models, the present invention shows significant advantages in global dependency modeling, local feature extraction, and generalization capabilities, verifying its effectiveness and superiority in anomaly detection on photovoltaic power generation multivariate time series datasets.
[0117] Ablation experiment
[0118] The ablation experiment aims to analyze the specific contribution of the present invention to the model performance by gradually removing the various modules of the present invention. Table 3 shows the experimental results of the performance indicators of the present invention after gradually removing the modules on three photovoltaic power generation data sets. Among them, Proposed represents the method of the present invention, Transformer-BiLSTM represents the detection method without GVSAO optimization, GVSAO-Transformer represents the detection method without BiLSTM decoder, GVSAO-BiLSTM represents the detection method without Transformer encoder, Transformer represents the detection method detected only by Transformer model, and BiLSTM represents the detection method detected only by BiLSTM model.
[0119] Table 3 Ablation experiment results
[0120]
[0121]
[0122] The results of the implementation examples show that GVSAO optimization, Transformer encoding module and BiLSTM decoding module are crucial to the anomaly detection performance. The evaluation indicators of the present invention on the three datasets of DKASC, ODE and REG are significantly better than other configurations, which verifies its effectiveness and superiority in anomaly detection tasks.
[0123] Therefore, the present invention adopts the above-mentioned photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning, combining the improved snow melting optimization algorithm and the deep learning model, which helps to improve the anomaly detection efficiency of the photovoltaic power generation system, ensure the stable operation of the system, and effectively reduce operating costs.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning, characterized in that the steps include: S1. Acquire photovoltaic power generation data and pre-process the photovoltaic power generation data; S2. Build a Transformer-BiLSTM deep learning model, which includes a Transformer encoder, a BiLSTM decoder, and a fully connected layer; S3. Improve the snow melting optimization algorithm and use the improved snow melting optimization algorithm to optimize the key parameters in the Transformer encoder and BiLSTM decoder models; S4, training the optimized deep learning model, reconstructing the photovoltaic power generation data through the trained model, and realizing anomaly detection based on the reconstruction error; S41. Input the photovoltaic power generation data into the optimized deep learning model. The Transformer encoder uses the multi-head attention mechanism to capture the global dependency characteristics of the time series and converts the photovoltaic power generation time series data into encoded feature representations. S42,BiLSTM decoder combined with bidirectional recurrent neural network deeply mines local time series features and fully captures the contextual information of photovoltaic data; S43, the fully connected layer outputs the reconstructed data and compares it with the original data to achieve anomaly detection based on the reconstruction error.
2. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 1 is characterized in that: The photovoltaic power generation data in step S1 includes actual photovoltaic power generation value, predicted value, load factor, meteorological data, photovoltaic power generation performance data, solar radiation, meteorological conditions and power generation characteristics.
3. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 2 is characterized in that: In step S2, the Transformer encoder includes an input layer, an encoding layer, a multi-head attention module, a feedforward network module and an output layer, wherein the multi-head attention module and the feedforward network module both introduce a regularization layer, a layer normalization layer and a residual connection; the BiLSTM decoder includes an input layer, a double-layer propagation layer, an activation layer and an output layer, wherein the double-layer propagation layer is a double-layer recurrent neural network.
4. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 3 is characterized by: In step S3, the snow melting optimization algorithm is improved by introducing the good point set strategy and the periodic oscillation mutation strategy.
5. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 4 is characterized in that: In step S3, the improved snow melting optimization algorithm is used to optimize the two key parameters of learning rate and batch size in the Transformer encoder and BiLSTM decoder models.
6. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 5 is characterized in that: In step S41, the Transformer encoder uses a multi-head attention mechanism to capture the global dependency characteristics of the time series and converts the photovoltaic power generation time series data into encoded feature representations including: S411, combine the sine and cosine functions to encode each position to ensure that the model understands the relative and absolute position relationship between the data; S412. Calculate the weight of the self-attention mechanism to capture the dependency between the data in the input sequence. The formula of the self-attention mechanism is: Where Q is the query matrix, K is the key matrix, V is the value matrix, and d k is the dimension of the key, QK T represents the dot product between the query and the key, obtains the attention weight through the softmax function, and finally multiplies it with the value matrix V to obtain the weighted sum result; S413. Use the multi-head attention mechanism to divide Q, K, and V into multiple subspaces respectively, and calculate their respective attention outputs in parallel. The calculation formula for attention is: MultiHead(Q,K,V)=Concat(head1,head2,...,head h )W O ; Where h represents the number of heads, and is transformed through a linear weight matrix W O Concatenate and map the outputs of all heads to the final dimension; S414: Use a feedforward neural network to perform a nonlinear transformation on the representation of each position. The feedforward neural network includes two linear transformations and an activation function. The nonlinear transformation expression is: FFN(x)=max(0,xW1+b1)W2+b2; Among them, W1 and W2 are weight matrices, b1 and b2 are bias terms, and the activation function usually uses ReLU to increase the nonlinear expression ability of the model.
7. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 6 is characterized in that: Step S42 specifically includes: the BiLSTM decoder processes the forward and reverse information of the input sequence in parallel, and obtains richer context information by merging the hidden states in these two directions; the bidirectional hidden state h t The expression is: They represent the forward LSTM hidden state and the reverse LSTM hidden state respectively, and the hidden states of the forward recurrent neural network and the reverse recurrent neural network are connected into a higher-dimensional vector as the final output of the bidirectional recurrent neural network.
8. The photovoltaic power generation anomaly detection method based on optimization algorithm combined with deep learning according to claim 7 is characterized in that: In step S43, the fully connected layer outputs the reconstructed data, which includes: the fully connected layer integrates the input features extracted by the previous layer into a high-dimensional representation of the current task, and outputs the reconstructed data. The output calculation formula is: y=f(Wx+b); Where x is the input feature vector; W is the weight matrix, which is used to represent the connection weights between the input node and the output node; b is the bias vector, which is used to adjust the activation threshold; f is the activation function, which is used to introduce nonlinear capabilities so that the network can express more complex feature relationships.
Citation Information
Cited By
Sensor data anomaly detection method in wafer processing process and related equipment
CN120763822A