A short-term wind speed forecasting method for wind farms combining VMD and attention mechanism

By combining VMD and attention mechanism methods, wind speed data is decomposed and feature extraction is solved, and the problem of information loss in long-term series predictions of networks such as LSTM and GRU is solved, and the accuracy of wind speed prediction is improved.

CN114912577BActive Publication Date: 2025-04-11NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210425233.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2025-04-11
Estimated Expiration
2042-04-21

AI Technical Summary

Technical Problem

When the input time series is long, networks such as LSTM and GRU are prone to lose sequence information, making it difficult to model the structural information between the data, which affects the accuracy of wind speed prediction.

Method used

A short-term wind speed prediction method for wind farms combined with VMD and attention mechanism is used to decompose wind speed data through VMD to generate relatively stable subsequences, and the space-time features are extracted using the CNN-GRU model and attention mechanism to perform wind speed prediction.

Benefits of technology

It improves the accuracy of wind speed prediction, avoids data sequence information loss, and enhances the model's ability to model spatiotemporal features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114912577B_ABST
    Figure CN114912577B_ABST
Patent Text Reader

Abstract

This invention discloses a short-term wind speed prediction method for wind farms that combines VMD and attention mechanisms. First, spatiotemporal wind speed data of the target site is acquired. A series of wind speed dynamic ranges (SWSMs) are established based on the original dataset. VMD wind speed decomposition is performed on the SWSMs. A CNN model is combined with an attention mechanism. For each sub-SWSM, a low-level SENet model is applied to extract the spatial features of wind speed. Then, a high-level GRU model is used to extract the temporal features of wind speed, and the prediction results are obtained for each. The prediction results are then summed to obtain the final predicted wind speed. This invention fully utilizes the spatiotemporal correlation of wind speed, combines VMD and attention mechanisms to improve the non-stationary characteristics of the original wind speed, and optimizes the CNN-GRU model using the attention mechanism, making it easier for the model to capture long-distance interdependent features in the sequence, effectively improving the accuracy of wind speed prediction and ensuring the reliable operation of the power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of renewable energy power generation technology and deep learning technology, and in particular to a method for short-term wind speed prediction in a wind farm combining VMD and an attention mechanism. Background Art

[0002] At present, the demand for using renewable energy as a solution to future energy shortages is growing, and many traditional power generation systems are being replaced by renewable energy systems. As one of the most potential, practical, abundant and environmentally friendly renewable resources in the world, wind energy has received widespread attention and utilization worldwide. Therefore, wind power generation technology needs to be further developed.

[0003] Accurate prediction of short-term wind speed is of great significance for the operation and control of power systems. It helps to reasonably dispatch wind power grid connection, reduce voltage and frequency fluctuations caused by wind power changes, and improve the reliability of power grid operation. At present, wind speed prediction technology can be divided into three categories: physical model, statistical model and artificial intelligence model. The physical model is represented by the numerical weather forecast model, which uses real-time meteorological conditions for forecasting. However, since the modeling process requires a lot of calculations, it is usually used for long-term wind speed forecasts in specific areas. It is not suitable for short-term and ultra-short-term wind speed forecasts. Statistical methods establish nonlinear mapping relationships between historical wind speed data through learning rules to achieve time series prediction. The basis of artificial intelligence models is machine learning technology. It describes the complex nonlinear relationship between system input and output based on a large amount of wind speed data. With the rapid development of deep learning technology, deep learning technology has also been rapidly applied to short-term wind speed forecasting. These methods combine existing wind speed forecasting technology with hybrid neural network models and have achieved good prediction results.

[0004] Because wind power generation has the characteristics of intermittency, volatility and uncertainty. In practical applications, certain processing methods are usually combined to obtain relatively stable subsequences. Through reasonable control of convergence conditions. In addition, when the input time series is long, networks such as LSTM and GRU are prone to lose sequence information and it is difficult to model the structural information between data, which also affects the accuracy of wind speed prediction. Summary of the invention

[0005] The present invention discloses a method for short-term wind speed prediction in a wind farm combining VMD and an attention mechanism, aiming to solve the technical problem proposed in the background technology that when the input time series is long, networks such as LSTM and GRU are prone to lose sequence information and it is difficult to model the structural information between data, which also affects the accuracy of wind speed prediction.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism, specifically comprising the following steps:

[0008] Step 1: Establish a wind speed dataset in both time and space dimensions;

[0009] Step 2: Establish a series of SWSMs based on the original data, which contain the temporal and spatial characteristics of the wind speed dataset;

[0010] Step 3: Use VMD to decompose the wind speed of the SWSM in each time series to obtain the sub-SWSM composed of various IMFs;

[0011] Step 4: Combine the CNN model with the attention mechanism to obtain the SENet model;

[0012] Step 5: For each sub-SWSM, apply step 4 to obtain the SENet model and extract the spatial characteristics of wind speed;

[0013] Step 6: Apply the GRU model to process the spatial domain features obtained in step 5, extract the temporal domain features and obtain the predicted components of wind speed;

[0014] Step 7: Assign different weights to the input features through the attention layer based on the attention mechanism;

[0015] Step 8: Combine the individual forecast results and obtain the final forecast wind speed.

[0016] In a preferred scheme, in step 1, a wind speed data set is established including two dimensions of time and space. For the original wind speed data set, the wind speed at the predicted time and location is set as the label wind speed, and then the data set and the label wind speed are divided into a training set, a validation set and a test set in proportion in the time series.

[0017] In a preferred solution, in step 2, the establishment of SWSM includes the following process:

[0018] Assume that the research object is an array consisting of M rows and N columns in the spatial area. The array can be represented by an M×N grid. In this array, the position of each station can be indexed by a two-dimensional rectangular coordinate (i, j) (1≤i≤M, 1≤j≤N). For each station, the wind speed is a one-dimensional time series. At time t, the spatial wind speed matrix SWSM of the station (M, N) can be defined as x(i, j) t ∈R M×N :

[0019]

[0020] The wind speed series are converted into SWSM by the above method.

[0021] In a preferred solution, in step 3, the main steps of VMD decomposition are as follows:

[0022] S21: First, construct a variational problem to ensure that the decomposition sequence is a modal component with a finite bandwidth and a center frequency, and at the same time minimize the sum of the estimated bandwidths of each mode. The wind speed data after preprocessing is The corresponding constrained variational expression is

[0023]

[0024]

[0025] Where K is the number of patterns to be decomposed, a positive integer, {u k}、{ω k} respectively correspond to the kth modal component and center frequency after decomposition, δ(t) is the Dirac function, and * is the convolution operation;

[0026] S22: To solve S21, the Lagrange multiplier λ is introduced to transform the constrained problem into an unconstrained problem, and the augmented Lagrangian expression is obtained:

[0027]

[0028] In the formula, α is the penalty factor, which is used to reduce the impact of Gaussian noise;

[0029] S23: Finally, the alternating direction multiplier ADMM iterative algorithm is used to solve the unconstrained variational problem, optimize the modal components and center frequencies, search for the saddle point of the augmented Lagrangian function, and iteratively update the parameters {u k},{ω k} and λ; the formula is as follows:

[0030]

[0031]

[0032]

[0033] In the formula and They represent f(ω) and u respectively. i (ω), λ(ω), and Fourier transform of ; n is the number of iterations; γ is the noise tolerance, which is used to meet the fidelity requirements of signal decomposition;

[0034] S24: Finally, for a given judgment accuracy e>0, when When , the iteration stops, otherwise it returns to step S3. Finally, k decomposed IMF components can be obtained; the VMD method is used to decompose the SWSM to obtain the sub-SWSM composed of each IMF. When the time is t, the component IMF of the station (M, N) k The composed sub-SWSM can be defined as

[0035]

[0036] In a preferred solution, the core idea of ​​combining CNN and attention used in SENet in step 4 is to automatically obtain the importance of each feature channel by learning, and then enhance useful features and suppress features that are not very useful for the current task according to this importance. This function is implemented by SE blocks, and the SENet layer includes a convolution layer, two SE block layers, and then another convolution layer. In each SE block, a convolution layer, a global average pooling layer, two activation layers and a fusion layer are set; the following are the steps of SENet layer construction:

[0037] S41: First F tr It is a conversion operation, which is a standard convolution operation, with input X and output U. The following is its definition formula:

[0038]

[0039] Where Vc represents the cth convolution kernel, X s represents the sth input, * represents the convolution operation, u c represents the cth 2D matrix in the 3D matrix U, is the 2D spatial kernel of the channel corresponding to X, which represents v c A single channel.

[0040] S42: Then comes the Squeeze operation, which is actually a global average pooling operation used to compress spatial features and convert the W×H×C input into a 1×1×C output, where W represents the width of the channel and H represents the height of the channel. There are C channels in total. The Squeeze operation formula is as follows:

[0041]

[0042] S43: Next is the Excitation operation. The formula for this operation is as follows:

[0043] s=σ(g(z,W))=σ(W2δ(W1z))

[0044] In the formula, W1z is a fully connected layer operation, the dimension of W1 is C / r*C, where r is a scaling parameter, and because the dimension of z is 1*1*C, the result of W1z is 1*1*C / r; δ is the ReLU function, which does not change the output dimension; then multiply it with W2, and the multiplication process of W2 is also a fully connected layer process, the dimension of W2 is C*C / r, so the output dimension is 1*1*C; finally, use σ, that is, the sigmoid function, to get the weight matrix s;

[0045] (4) Finally, the 3D matrix U is assigned by the weight matrix s, and the formula is as follows:

[0046] H S =s c ·u c

[0047] In the formula, u c is a two-dimensional matrix, s c is the weight, which is equivalent to u c Each value in the matrix is ​​multiplied by s c .

[0048] In a preferred solution, this model is used to extract the spatial domain features of wind speed, the sub-SWSM matrix obtained by VMD decomposition is input into the SENet layer, the convolution kernel in the convolution layer is used to perform convolution activation on the input image to obtain the feature map of the convolution block, and then the feature map of the convolution block is input into the convolution layer in the SE block, and two activation layers are used to assign weights to the channels of the convolution kernel in the convolution layer, and then a new feature map is obtained through global average pooling, and the new feature map is flattened to reduce the dimension while retaining the spatial features. The feature map after dimensionality reduction can be used as the input of the GRU layer.

[0049] In a preferred solution, in step 6, feature extraction on the time series is implemented through the GRU layer. The GRU has two gates, one is a reset gate and the other is an update gate. The reset gate determines how to combine the new input information with the previous memory, and the update gate defines the amount of the previous memory saved to the current time step. The two gate vectors determine which information can eventually be used as the output of the gated recurrent unit. They can save information in long-term sequences and will not be cleared over time or removed because it is irrelevant to the prediction;

[0050] The calculation formula of GRU's gate and activation function is as follows:

[0051] S61: Activation function Sigmoid:

[0052] S62: Activation function tanh:

[0053] S63: Update gate: z t =σ(W z ·[h t-1 , x t ])

[0054] S64: Reset Gate: r t =σ(W r ·[h t-1 , x t ])

[0055] S65: New memory content (reset gate input):

[0056]

[0057] S66: Output value:

[0058] Where σ is the activation function Sigmoid, tanh is the activation function tanh, and the update gate and reset gate are z t and r t , x t is the input, h t is the output of the hidden layer, is the input x t and the past hidden layer state h t-1 Summary of W z , W r and W are the weights of the update gate, reset gate, and candidate output, respectively.

[0059] In a preferred solution, in step 7, an attention layer is added after the GRU layer. By assigning different weights to the model input features, the influence of important information is strengthened to avoid the problem of information loss in a sequence that is too long, so that the model can more easily capture the long-distance interdependent features in the sequence. The input of the attention layer is the output vector h after the GRU layer activation processing. t , according to the principle of weight distribution, the probabilities corresponding to different feature vectors are calculated, and the optimal weight parameter matrix is ​​continuously updated and iterated. The weight coefficient calculation formula of the attention layer is as follows:

[0060] e t =utanh(wh t +b)

[0061]

[0062]

[0063] In the formula, e t Indicates the output vector h from the GRU network layer at time t tThe attention probability distribution value determined by ; u and w are weight coefficients; b is the bias coefficient; the output of the attention layer at time t is given by s t express.

[0064] In a preferred solution, in step 8, each prediction result is merged in the output layer, and the prediction is performed through the fully connected layer to predict the output Y=[y1, y2, ·····, y m ] T When predicting, the early stopping mechanism is used to monitor the model. When the training error is no longer optimized within a certain number of training times, the training is stopped. Otherwise, the training continues until the originally set number of times is completed. The prediction formula is as follows:

[0065] y t =Sigmoid(w o s t +b o )

[0066] In the formula, y t Represents the predicted output value at time t; w0 is the weight matrix; b0 is the bias vector, and the activation function is the Sigmoid function.

[0067] Compared with the prior art, the present invention has the following advantages:

[0068] (1) The VMD method is used to process wind speed data. The unstable wind speed sequence is converted into a relatively stable subsequence, which improves the accuracy of wind speed prediction.

[0069] (2) Considering that irrelevant features in the data will lead to a decline in model performance, we use the attention mechanism to reallocate feature weights and improve model performance.

[0070] (3) The underlying architecture of the algorithm uses the CNN-GRU model. This model can process the spatiotemporal characteristics of wind speed and use spatiotemporal correlation to predict wind speed, thereby improving the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 This is a wind speed prediction flow chart of a wind farm short-term wind speed prediction method combining VMD and attention mechanism proposed in the present invention.

[0072] Figure 2 A schematic diagram of converting a wind speed sequence into a SWSM for a short-term wind speed prediction method for a wind farm combining VMD and an attention mechanism proposed in the present invention.

[0073] Figure 3 Schematic diagram of VMD decomposition SWSM of a wind farm short-term wind speed prediction method combining VMD and attention mechanism proposed in the present invention.

[0074] Figure 4 This is an architecture diagram of a GRU network for a wind farm short-term wind speed prediction method combining VMD and attention mechanism proposed in the present invention.

[0075] Figure 5 This is a structural diagram of the SENet proposed in the present invention for a method of short-term wind speed prediction in a wind farm that combines VMD and attention mechanism.

[0076] Figure 6 This is a schematic diagram of wind speed prediction results with a prediction time of 20 minutes for a short-term wind speed prediction method for a wind farm combining VMD and an attention mechanism proposed in the present invention.

[0077] Figure 7 This is a comparison chart of the prediction error RMSE (m / s) of different models of a wind farm short-term wind speed prediction method combining VMD and attention mechanism proposed in the present invention.

[0078] Figure 8 This is a comparison chart of prediction errors MAPE (m / s) of different models of a short-term wind speed prediction method for wind farms that combines VMD and attention mechanism proposed in the present invention. DETAILED DESCRIPTION

[0079] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0080] like Figure 1-8 As shown in the figure, a method for short-term wind speed prediction in a wind farm that combines VMD and an attention mechanism is used, and variational mode decomposition and an attention mechanism are used to improve the accuracy of wind speed prediction. First, the variational mode decomposition technique is used to reduce the noise of the wind speed to obtain an optimized wind speed matrix; then the wind speed at the same time in the wind farm is converted into visual information through a grayscale image, and then a deep convolutional neural network that is more suitable for processing visual information is used to process it, and the SENet layer formed by combining CNN and an attention mechanism is used as a method to strengthen the network to extract spatial features; then the GRU and the attention mechanism are combined to extract temporal features; finally, the wind speed prediction result is obtained; it includes the following steps:

[0081] Step 1: Create a wind speed dataset in both time and space dimensions.

[0082] Step 2: A series of SWSMs are established based on the original data. These SWSMs contain the temporal and spatial characteristics of the wind speed dataset.

[0083] Step 3: Use VMD to decompose the wind speed of the SWSM in each time series to obtain a sub-SWSM composed of various IMFs.

[0084] Step 4: Combine the CNN model with the attention mechanism to obtain the SENet model.

[0085] Step 5: For each sub-SWSM, apply step 4 to obtain the SENet model and extract the spatial characteristics of wind speed.

[0086] Step 6: Apply the GRU model to process the spatial domain features obtained in step 5, extract the temporal domain features and obtain the predicted components of wind speed.

[0087] Step 7: Assign different weights to the input features through the attention layer based on the attention mechanism.

[0088] Step 8: Combine the individual forecast results and obtain the final forecast wind speed.

[0089] In a preferred embodiment, in step 1, the wind speed data set established includes two dimensions, time and space. For the original wind speed data set, the wind speed at the predicted time and location is set as the label wind speed, and then the data set and the label wind speed are divided into a training set, a validation set, and a test set in proportion in the time series.

[0090] Specific as Figure 3 As shown, in a preferred embodiment, in step 2, the SWSM is established by the following method: Assume that the research object is an array consisting of M rows and N columns in a spatial region, and the array can be represented by an M×N grid. In this array, the position of each station can be indexed by a two-dimensional rectangular coordinate (i, j) (1≤i≤M, 1≤j≤N), and for each station, the wind speed is a one-dimensional time series. Therefore, when the time is t, the spatial wind speed matrix (SWSM) of the station (M, N) can be defined as x(i, j) t ∈R M×N :

[0091]

[0092] In a preferred embodiment, in step 3, the main steps of VMD decomposition are as follows:

[0093] (1) First, the variational problem is constructed to ensure that the decomposition sequence is a modal component with a finite bandwidth and a center frequency, and at the same time, the sum of the estimated bandwidths of each mode is minimized. The wind speed data after preprocessing is The corresponding constrained variational expression is

[0094]

[0095]

[0096] Where K is the number of patterns to be decomposed (a positive integer), {u k}、{ω k} respectively correspond to the kth modal component and center frequency after decomposition, δ(t) is the Dirac function, and * is the convolution operation;

[0097] (2) To solve (1), the Lagrangian multiplier λ is introduced to transform the constrained problem into an unconstrained problem, and the augmented Lagrangian expression is obtained:

[0098]

[0099] Where α is the penalty factor, which is used to reduce the impact of Gaussian noise.

[0100] (3) Finally, the alternating direction multiplier (ADMM) iterative algorithm is used to solve the unconstrained variational problem, optimize the modal components and center frequencies, search for the saddle point of the augmented Lagrangian function, and iteratively update the parameters {u k},{ω k} and λ. The formula is as follows:

[0101]

[0102]

[0103]

[0104] In the formula and They represent f(ω) and u respectively. i (ω), λ(ω), and is the Fourier transform of ; n is the number of iterations; γ is the noise tolerance, which is used to meet the fidelity requirements of signal decomposition.

[0105] (4) Finally, for a given judgment accuracy e>0, if Then stop the iteration, otherwise return to step (3). Finally, k decomposed IMF components can be obtained.

[0106] The VMD method is used to decompose the SWSM to obtain the sub-SWSM composed of each IMF. When time is t, the component IMF of station (M, N) k The composed sub-SWSM can be defined as

[0107]

[0108] In a preferred embodiment, in step 4, the core idea of ​​the combination of CNN and attention used in the SENet model is to automatically obtain the importance of each feature channel through learning, and then enhance the useful features and suppress the features that are not very useful for the current task according to this importance. This function is implemented by the SE block. The SENet layer includes a convolution layer, two SE block layers, and then another convolution layer. In each SE block, a convolution layer, a global average pooling layer, two activation layers and a fusion layer are set. The structure of the SE block is as follows Figure 4 shown.

[0109] The following are the steps of SENet layer composition:

[0110] (1) First, F tr It is a conversion operation, which is a standard convolution operation, with input X and output U. The following is its definition formula:

[0111]

[0112] In the formula, v c represents the cth convolution kernel, X s represents the sth input, and * represents the convolution operation. c represents the cth 2D matrix in the 3D matrix U, is the 2D spatial kernel of the channel corresponding to X, which represents v c A single channel.

[0113] (2) Then comes the Squeeze operation, which is actually a global average pooling operation used to compress spatial features and convert the W×H×C input into a 1×1×C output, where W represents the width of the channel and H represents the height of the channel, with a total of C channels. The Squeeze operation formula is as follows:

[0114]

[0115] (3) Next is the Excitation operation. The formula for this operation is as follows:

[0116] s=σ(g(z,W))=σ(W2δ(W1z))

[0117] In the formula, W1z is a fully connected layer operation, the dimension of W1 is C / r*C, where r is a scaling parameter, and because the dimension of z is 1*1*C, the result of W1z is 1*1*C / r; δ is the ReLU function and does not change the output dimension; then it is multiplied by W2, and the process of multiplying with W2 is also a fully connected layer process. The dimension of W2 is C*C / r, so the output dimension is 1*1*C; finally, σ, that is, the sigmoid function, is used to obtain the weight matrix s.

[0118] (4) Finally, the 3D matrix U is assigned by the weight matrix s, and the formula is as follows:

[0119] H S =s c ·u c

[0120] In the formula, u c is a two-dimensional matrix, s c is the weight, which is equivalent to u c Each value in the matrix is ​​multiplied by s c .

[0121] According to the SENet model described in step 4, use this model to extract the spatial features of wind speed. Input the sub-SWSM matrix obtained by VMD decomposition into the SENet layer, use the convolution kernel in the convolution layer to convolve the input image to activate it, and obtain the feature map of the convolution block. Then input the feature map of the convolution block into the convolution layer in the SE block, use two activation layers to assign weights to the channels of the convolution kernel in the convolution layer, and then obtain a new feature map through global average pooling. Flatten the new feature map to reduce the dimension while retaining the spatial features. The reduced feature map can be used as the input of the GRU layer.

[0122] In a preferred embodiment, in step 6, feature extraction on the time series is implemented through the GRU layer. GRU has two gates, namely a reset gate and an update gate. The reset gate determines how to combine the new input information with the previous memory, and the update gate defines the amount of the previous memory saved to the current time step. The two gate vectors determine which information can eventually be used as the output of the gated recurrent unit. They can save information in long-term sequences and will not be cleared over time or removed because it is not relevant to the prediction.

[0123] The calculation formula of GRU's gate and activation function is as follows:

[0124] (1) Activation function Sigmoid:

[0125] (2) Activation function tanh:

[0126] (3) Update gate: z t =σ(W z ·[h t-1 , x t ])

[0127] (4) Reset gate: r t =σ(W r ·[h t-1 , x t ])

[0128] (5) New memory content (reset gate input):

[0129]

[0130] (6) Output value:

[0131] Where σ is the activation function Sigmoid, and tanh is the activation function tanh. The update gate and reset gate are z t and r t .x t is the input, h t is the output of the hidden layer. is the input x t and the past hidden layer state h t-1 Summary of W z , W r and W are the weights of the update gate, reset gate, and candidate output, respectively.

[0132] In a preferred embodiment, in step 7, an attention layer is added after the GRU layer. By assigning different weights to the model input features, the influence of important information is strengthened to avoid the problem of information loss in long sequences, making it easier for the model to capture long-distance interdependent features in the sequence. The input of the attention layer is the output vector h after the GRU layer activation processing. t , according to the principle of weight distribution, the probabilities corresponding to different feature vectors are calculated, and the optimal weight parameter matrix is ​​continuously updated and iterated. The weight coefficient calculation formula of the attention layer is as follows:

[0133] e t =utanh(wh t +b)

[0134]

[0135]

[0136] In the formula, e t Indicates the output vector h from the GRU network layer at time t tThe attention probability distribution value determined by ; u and w are weight coefficients; b is the bias coefficient; the output of the attention layer at time t is given by s t express.

[0137] In a preferred embodiment, in step 8, each prediction result is merged in the output layer, and the prediction is performed through the fully connected layer to predict the output Y=[y1, y2, ·····, y m ] T When predicting, the model is monitored using an early stopping mechanism. When the training error is no longer optimized within a certain number of training times, the training is stopped. Otherwise, the training continues until the originally set number of times is completed. The prediction formula is as follows:

[0138] y t =Sigmoid(w o s t +b o )

[0139] In the formula, y t represents the predicted output value at time t; w o is the weight matrix; b o is the bias vector, and the activation function is the Sigmoid function.

[0140] Compared with the prior art, the present invention has the following advantages:

[0141] (4) The VMD method is used to process wind speed data, converting the unstable wind speed sequence into a relatively stable subsequence, thus improving the wind speed prediction accuracy.

[0142] (5) Considering that irrelevant features in the data will lead to a decline in model performance, we use the attention mechanism to reallocate feature weights and improve model performance.

[0143] The underlying architecture of the algorithm uses the CNN-GRU model, which can process the spatiotemporal characteristics of wind speed and predict wind speed using spatiotemporal correlation, thereby improving prediction accuracy.

[0144] Figure 6 Some wind speed prediction results and residuals when the prediction time interval is 20 minutes are given.

[0145] Depend on Figure 6 It can be seen that the VCGA model has a very high degree of fit and can accurately reflect the trend of the true value. The residual analysis results show that the prediction residuals of the model are uniformly and randomly distributed on both sides of the zero baseline, indicating that there is no systematic error in the modeling process. Therefore, the model is feasible in short-term wind speed forecasting.

[0146] Figure 7 and Figure 8The RMSE and MAPE results of different prediction models at different prediction times are shown respectively.

[0147] To verify the effect of the present invention, the algorithm of the present invention was compared with other traditional machine learning algorithms and sub-algorithms of the present algorithm, using two representative evaluation indicators, RMSE and MAPE. The comparison results show that compared with other traditional methods based on deep learning, the prediction accuracy of the method proposed in the present invention is higher and the results are more accurate.

[0148] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for short-term wind speed prediction in wind farms combining VMD and attention mechanism, characterized in that: The specific steps include: Step 1: Establish a wind speed dataset in both time and space dimensions; Step 2: Establish a series of SWSMs based on the original data, which contain the temporal and spatial characteristics of the wind speed dataset; Step 3: Use VMD to decompose the wind speed of the SWSM in each time series to obtain the sub-SWSM composed of various IMFs; Step 4: Combine the CNN model with the attention mechanism to obtain the SENet model; Step 5: For each sub-SWSM, apply step 4 to obtain the SENet model and extract the spatial characteristics of wind speed; Step 6: Apply the GRU model to process the spatial domain features obtained in step 5, extract the temporal domain features and obtain the predicted components of wind speed; Step 7: Assign different weights to the input features through the attention layer based on the attention mechanism; Step 8: Combine the various forecast results and obtain the final forecast wind speed; In step 3, the main steps of VMD decomposition are as follows: S21: First, construct a variational problem to ensure that the decomposition sequence is a modal component with a finite bandwidth and a center frequency, and at the same time minimize the sum of the estimated bandwidths of each mode. The wind speed data after preprocessing is The corresponding constrained variational expression is Where K is the number of patterns to be decomposed, a positive integer, {u k }、{ω k } respectively correspond to the kth modal component and center frequency after decomposition, δ(t) is the Dirac function, and * is the convolution operation; S22: To solve S21, the Lagrange multiplier λ is introduced to transform the constrained problem into an unconstrained problem, and the augmented Lagrangian expression is obtained: In the formula, α is the penalty factor, which is used to reduce the impact of Gaussian noise; S23: Finally, the alternating direction multiplier ADMM iterative algorithm is used to solve the unconstrained variational problem, optimize the modal components and center frequencies, search for the saddle point of the augmented Lagrangian function, and iteratively update the parameters {u k },{ω k } and λ; The formula is as follows: In the formula and They represent f(ω) and u respectively. i (ω), λ(ω), and Fourier transform of ; n is the number of iterations; γ is the noise tolerance, which is used to meet the fidelity requirements of signal decomposition; S24: Finally, for a given judgment accuracy e>0, when When , the iteration stops, otherwise it returns to step S3; finally, k decomposed IMF components are obtained; the SWSM is decomposed using the VMD method to obtain the sub-SWSM composed of each IMF. When the time is t, the component IMF of the site (M, N) k The composed sub-SWSM is defined as The core idea of ​​combining CNN and attention used in step 4 of SENet is to automatically obtain the importance of each feature channel through learning, and then enhance the useful features and suppress the features that are not very useful for the current task according to this importance. This function is implemented by SE blocks, and the SENet layer includes a convolution layer, two SE block layers, and then another convolution layer. In each SE block, a convolution layer, a global average pooling layer, two activation layers and a fusion layer are set; the following are the steps of SENet layer construction: S41: First, Ftr is a conversion operation, which is a standard convolution operation with input X and output U. The following is its definition formula: Where Vc represents the cth convolution kernel, X s represents the sth input, * represents the convolution operation, uc represents the cth 2D matrix in the 3D matrix U, is the 2D spatial kernel of the channel corresponding to X, which represents v c A single channel; S42: Then comes the Squeeze operation, which is actually a global average pooling operation used to compress spatial features and convert the W×H×C input into a 1×1×C output, where W represents the width of the channel and H represents the height of the channel. There are C channels in total. The Squeeze operation formula is as follows: S43: Next is the Excitation operation. The formula for this operation is as follows: s=σ(g(z,W))=σ(W2δ(W1z)) In the formula, W1z is a fully connected layer operation, the dimension of W1 is C / r*C, where r is a scaling parameter, and because the dimension of z is 1*1*C, the result of W1z is 1*1*C / r; δ is the ReLU function, which does not change the output dimension; then multiply it with W2, and the multiplication process of W2 is also a fully connected layer process, the dimension of W2 is C*C / r, so the output dimension is 1*1*C; finally, use σ, that is, the sigmoid function, to get the weight matrix s; (4) Finally, the 3D matrix U is assigned by the weight matrix s, and the formula is as follows: H S =s c ·u c In the formula, uc is a two-dimensional matrix, sc is the weight, and this formula is equivalent to multiplying each value of uc in the matrix by sc.

2. A method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: In step 1, a wind speed data set is established that includes two dimensions, time and space. For the original wind speed data set, the wind speed at the predicted time and location is set as the label wind speed, and then the data set and the label wind speed are divided into a training set, a validation set, and a test set in proportion in the time series.

3. A method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: In step 2, the establishment of SWSM includes the following process: Assume that the research object is an array consisting of M rows and N columns in the spatial area, which is represented by an M×N grid. In this array, the position of each station is indexed by a two-dimensional rectangular coordinate (i, j) (1≤i≤M, 1≤j, ≤N). For each station, the wind speed is a one-dimensional time series. At time t, the spatial wind speed matrix SWSM of the station (M, N) is defined as x(i, j) t ∈R M ×N : The wind speed series are converted into SWSM by the above method.

4. The method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: The sub-SWSM matrix obtained by VMD decomposition is input into the SENet layer, and the convolution kernel in the convolution layer is used to perform convolution activation on the input image to obtain the feature map of the convolution block. The feature map of the convolution block is then input into the convolution layer in the SE block, and two activation layers are used to assign weights to the channels of the convolution kernel in the convolution layer. A new feature map is obtained through global average pooling, and the new feature map is flattened to reduce the dimension while retaining the spatial features. The feature map after dimensionality reduction is used as the input of the GRU layer.

5. The method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: In step 6, feature extraction on the time series is implemented through the GRU layer. GRU has two gates, one is the reset gate and the other is the update gate. The reset gate determines how to combine the new input information with the previous memory, and the update gate defines the amount of the previous memory saved to the current time step. The two gate vectors determine which information can eventually be used as the output of the gated recurrent unit. They can save information in long-term sequences and will not be cleared over time or removed because it is not relevant to the prediction; The calculation formula of GRU's gate and activation function is as follows: S61: Activation function Sigmoid: S62: Activation function tanh: S63: Update gate: z t =σ(W z ·[h t-1 , x t ]) S64: Reset Gate: r t =σ(W r ·[h t-1 , x t ]) S65: New memory content (reset gate input): S66: Output value: Where σ is the activation function Sigmoid, tanh is the activation function tanh, and the update gate and reset gate are z t and r t , x t is the input, h t is the output of the hidden layer, is the input x t and the past hidden layer state h t-1 Summary of W z , W r and W are the weights of the update gate, reset gate, and candidate output, respectively.

6. A method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: In step 7, an attention layer is added after the GRU layer. By assigning different weights to the model input features, the input of the attention layer is the output vector h after the GRU layer activation processing. t , according to the principle of weight distribution, the probabilities corresponding to different feature vectors are calculated, and the optimal weight parameter matrix is ​​continuously updated and iterated. The weight coefficient calculation formula of the attention layer is as follows: e t =utanh(wh t +b) In the formula, e t Indicates the output vector h from the GRU network layer at time t t The attention probability distribution value determined by ; u and w are weight coefficients; b is the bias coefficient; the output of the attention layer at time t is given by s t express.

7. A method for short-term wind speed prediction in a wind farm combining VMD and attention mechanism according to claim 1, characterized in that: In step 8, the prediction results are combined in the output layer, and the fully connected layer is used to calculate and predict the output Y = [y1, y2, ·····, y m ] T When predicting, the early stopping mechanism is used to monitor the model. When the training error is no longer optimized within a certain number of training times, the training is stopped. Otherwise, the training continues until the originally set number of times is completed. The prediction formula is as follows: y t =Sigmoid(w o s t +b o ) In the formula, y t Represents the predicted output value at time t; w0 is the weight matrix; b0 is the bias vector, and the activation function is the Sigmoid function.

Citation Information

Patent Citations

  • Wind power plant short-term wind speed prediction method

    CN112613657A

  • Wind speed prediction method based on variational mode decomposition and attention mechanism

    CN114218870A