Wind power generation power prediction method
By improving the attention mechanism of the Transformer model into the cross attention mechanism in the prediction of wind power generation power, and combining the CEEMDAN decomposition and decomposition window sliding strategies, the multi-head attention mechanism ignores the future information leakage problem caused by wind power uncertainty and time series decomposition, achieving a prediction effect with higher accuracy and achievability.
Patent Information
- Application Number
- CN202411713928.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, in the prediction of wind power generation power, the multi-head attention mechanism ignores the high uncertainty of the wind power sequence on wind, resulting in poor prediction results. At the same time, the time series decomposition method leads to future information leakage.
The multi-head attention mechanism of the Transformer model is improved as a cross-attention mechanism, which captures the dependence between the meteorological sequence and the wind power sequence, and uses CEEMDAN for decomposition prediction in the time dimension, and uses a decomposition window sliding strategy to avoid future information leakage.
It improves the accuracy of wind power generation power prediction, avoids future information leakage, and enhances the realization of prediction methods.
Smart Images

Figure CN119623738A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of wind power generation prediction, and in particular relates to a wind power generation prediction method. Background Art
[0002] Against the backdrop of global energy shortages and increasingly serious environmental problems, wind power generation has attracted widespread attention as a renewable clean energy source. However, wind power generation is highly dependent on wind, which is uncertain, making wind power intermittent and random. If wind power is to be connected to the grid on a large scale, this intermittency and randomness may lead to instability in the power system. Therefore, establishing an accurate prediction system is crucial for wind farms to formulate power generation and distribution strategies, improve the reliability of large-scale wind power grid connection, and improve the safety and economy of power system operation.
[0003] At present, the research on wind power prediction focuses on deep learning methods, among which the Transformer-like model is an important research direction. It uses the attention mechanism to capture the characteristics of wind power sequences in the time dimension. Multi-head attention uses multiple self-attention mechanisms on the time dimension of an input sequence to obtain multiple sets of attention results, and then these results are spliced and linearly projected to obtain the final output. Multi-head attention can capture the correlation characteristics of different distances in the time dimension, making the model more expressive. However, wind power is highly uncertain due to its dependence on wind, and overfitting may occur when using a multi-head attention mechanism on the wind power sequence. At the same time, the use of this multi-head attention mechanism ignores the impact of meteorological factors on wind power.
[0004] The prediction of wind power generation is essentially the prediction of the time series of wind power. For the prediction of time series with poor stationarity, scholars often use some decomposition methods to decompose the series to enhance its stationarity, such as VMD, EMD, CEEMDAN and other methods. However, the decomposition of the series inevitably uses the information of the entire series, which causes the leakage of future information during the model training process. In actual application scenarios, future information cannot be obtained.
[0005] In response to the above problems, this paper proposes a wind power prediction method. This method improves the multi-head attention mechanism inside the ordinary Transformer model, and learns the dependency between each meteorological series and the wind power series in the variable dimension through the cross-attention mechanism. At the same time, in the time dimension of the wind power series, CEEMDAN is used to decompose and predict it, and the decomposition window sliding strategy is innovatively adopted to avoid the use of future information. Finally, the prediction results of the time dimension and the variable dimension are spliced and linearly projected to obtain the final output. Summary of the invention
[0006] Purpose of the invention: The purpose of the present invention is to overcome the problem that the Transformer-like model adopts a multi-head attention mechanism to capture the time dimension dependency of wind power when predicting wind power generation, but ignores the high uncertainty of wind power series dependency, resulting in poor prediction effect, as well as the problem that the common time series decomposition method is applied to wind power generation prediction, resulting in future information leakage.
[0007] Technical solution: The specific steps of the present invention are as follows:
[0008] S1: Collect historical data of wind farms, including wind power generation data and related meteorological data such as wind speed, wind direction, temperature, air pressure, etc. The data are spliced into a two-dimensional matrix of shape L×C, and then normalized as data input for the next step.
[0009] S2: Input the wind power sequence and meteorological sequence matrix into the encoder layer without going through the embedding layer. The sequence data first enters the cross-attention mechanism layer in the encoder layer to perform attention operations between the wind power sequence and the meteorological sequence, capturing the dependency between the time features in the prediction variables and the time features in the meteorological variables. The matrix containing the variable dimension correlation features output by the cross-attention mechanism layer is input into the feedforward neural network layer for mapping after residual connection and standardization. After that, it is again connected and standardized through residual connection to become the encoder output.
[0010] S3: The encoder output does not pass through the decoder, but directly enters the projection layer to directly obtain the prediction result containing variable dimension features.
[0011] S4: In the time dimension, the wind power sequence is subjected to complete noise-assisted aggregate empirical mode decomposition (CEEMDAN), and then the subsequences are predicted separately using the prediction model. The decomposition window sliding is used to ensure that each prediction only uses historical data before the current time point without involving future data.
[0012] S5: Sum the prediction results of each subsequence to obtain a prediction result containing time dimension trend information.
[0013] S6: Project the two parts of the prediction results including the variable dimension detail information and the time dimension trend information to obtain the final prediction result and output it.
[0014] The encoder layer in step S2 is composed of multiple encoders, among which the cross-attention mechanism layer has an input of a two-dimensional matrix of shape L×C, where L is the length of the sequence in the time dimension and C is the number of sequences. This layer flips the input matrix to obtain a matrix of shape C×L, and multiplies it with the three weight matrices to obtain Q, K, and V, which contain information about the values of each meteorological sequence and the current wind power value at the same time point, which is different from Q, K, and V obtained by the ordinary Transformer encoder. Where Q is the query, K is the key value, and V is the value. The cross-attention value is calculated according to the following formula to obtain a matrix W containing the variable dimension correlation characteristics: z .
[0015]
[0016] The CEEMDAN in step S4 introduces auxiliary noise to enhance stability and effect, and solves the modal aliasing problem of EMD to a certain extent. The specific implementation steps are as follows:
[0017] 1. Add Gaussian white noise to the signal to be decomposed to obtain a new signal. Perform EMD decomposition on the new signal to obtain the first-order intrinsic mode component;
[0018] 2. Take an overall average of the multiple modal components generated to obtain the first intrinsic modal component of CEEMDAN decomposition;
[0019] 3. Calculate the residual after removing the first modal component, and add positive and negative paired Gaussian white noise to the residual to obtain a new signal. Perform EMD decomposition on the new signal to obtain the second-order intrinsic modal component;
[0020] 4. Repeat the above steps until the residual signal obtained is a monotonic function and cannot be further decomposed. The obtained signal is the subsequence.
[0021] The decomposition window sliding in step S4 is performed in the following specific steps:
[0022] 1. Perform CEEMDAN decomposition on the first T data of the wind power sequence to obtain several subsequences, and then use the prediction model to train each subsequence.
[0023] 2. After the model training is completed, use the data of [TM:T] to obtain M / 2 prediction outputs of each subsequence model, and then sum them up to get the prediction value of [T+1:T+M / 2].
[0024] 3. Perform CEEMDAN decomposition on the data of [M / 2+1:T+M / 2] to obtain multiple subsequences, and then train a prediction model for each subsequence. Then use the M data of [TM / 2-1:T+M / 2] to obtain M / 2 prediction data of each subsequence model, and then sum them up to obtain M / 2 prediction values of [T+M / 2:T+M].
[0025] Repeat the above steps, slide the decomposition window M / 2 data each time, then decompose and train the model for the data in the window, and finally predict until all the predicted values of [T+1:T+k] are obtained. By sliding the decomposition window, it is possible to avoid using data after the prediction moment, thereby avoiding the leakage of future information. Compared with the prior art, the beneficial effect of the present invention is that the present invention makes full use of the powerful correlation capture ability of the attention mechanism in the Transformer model in the time dimension, and improves it into a cross-attention mechanism that captures the correlation between the meteorological sequence and the wind power, thereby making full use of the information of the multivariate sequence, thereby enhancing the accuracy of the prediction results. At the same time, in the time dimension, CEEMDAN is used to decompose the wind power sequence, and the decomposed subsequences are predicted separately through the model. In terms of decomposition strategy, an innovative decomposition window sliding strategy is proposed to avoid the use of future information, which greatly enhances the feasibility of this method in practical applications.
[0026] Experimental results:
[0027] The achievable wind power prediction method based on the cross-attention mechanism proposed in this patent can better predict wind power, solve the problem of low prediction accuracy caused by the Transformer-like model focusing on capturing the correlation of the time dimension, and the future information leakage problem caused by the empirical mode decomposition method of the time series. The overall framework includes two parts: detail prediction of the variable dimension and trend prediction of the time dimension; the encoder uses improved cross-attention to replace the multi-head attention in the ordinary Transformer; in the time dimension, the decomposition window sliding strategy is innovatively used in combination with CEEMDAN to avoid the leakage of future information; finally, the prediction results of the two dimensions are combined to obtain the final prediction result. The present invention transfers the powerful dependency capture ability of the attention mechanism to the variable dimension, and has a better feature extraction effect in the prediction of wind power series with high uncertainty; at the same time, it improves the feasibility of the prediction method in practical application. It has significant advantages over traditional methods.
[0028] Description of the accompanying tables and graphs
[0029] Figure 1 Schematic diagram of the framework of the wind power prediction method based on the cross attention mechanism proposed in this invention
[0030] Figure 2 Schematic diagram of the improved cross attention mechanism of the present invention
[0031] Figure 3 Schematic diagram of the decomposition window sliding proposed by the present invention DETAILED DESCRIPTION
[0032] 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, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] S1: Collect historical data of wind farms, including wind power generation data and related meteorological data such as wind speed, wind direction, temperature, air pressure, etc. The data are spliced into a two-dimensional matrix of shape, and then normalized as the data input for the next step.
[0034] S2: Input the wind power sequence and meteorological sequence matrix into the encoder layer without passing through the embedding layer. The sequence data first enters the cross-attention mechanism layer in the encoder layer to perform attention operations between the wind power sequence and the meteorological sequence to capture the dependency between the time features in the prediction variables and the time features in the meteorological variables. The matrix containing the variable dimension correlation features output by the cross-attention mechanism layer is input into the feedforward neural network layer for mapping after residual connection and standardization. After that, it is again connected and standardized through residual connection to become the encoder output. S3: The encoder output does not pass through the decoder, but directly enters the projection layer to directly obtain the prediction results containing the variable dimension features.
[0035] S4: In the time dimension, the wind power sequence is subjected to complete noise-assisted aggregate empirical mode decomposition (CEEMDAN), and then the subsequences are predicted separately using the prediction model. The decomposition window sliding is used to ensure that each prediction only uses historical data before the current time point without involving future data.
[0036] S5: Sum the prediction results of each subsequence to obtain a prediction result containing time dimension trend information.
[0037] S6: Project the two parts of the prediction results including the variable dimension detail information and the time dimension trend information to obtain the final prediction result and output it.
[0038] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting wind power generation, characterized in that : Includes the following steps: S1: Collect historical data of wind farms, including wind power generation data and related meteorological data such as wind speed, wind direction, temperature, air pressure, etc. The data are spliced into a two-dimensional matrix of shape, and then normalized as the data input for the next step. S2: Input the wind power sequence and meteorological sequence matrix into the encoder layer without going through the embedding layer. The sequence data first enters the cross-attention mechanism layer in the encoder layer to perform attention operations between the wind power sequence and the meteorological sequence to capture the dependency between the time features in the prediction variables and the time features in the meteorological variables. The matrix containing the variable dimension correlation features output by the cross-attention mechanism layer is input into the feedforward neural network layer for mapping after residual connection and normalization. After that, it is again connected and normalized through residual connection to become the encoder output. S3: The encoder output does not pass through the decoder, but directly enters the projection layer to directly obtain the prediction result containing variable dimension features. S4: In the time dimension, the wind power sequence is subjected to complete noise-assisted aggregate empirical mode decomposition (CEEMDAN), and then the subsequences are predicted separately using the prediction model. The decomposition window sliding is used to ensure that each prediction only uses historical data before the current time point without involving future data. S5: Sum the prediction results of each subsequence to obtain a prediction result containing trend information of the time dimension. S6: Project the two parts of the prediction results including the variable dimension detail information and the time dimension trend information to obtain the final prediction result and output it.
2. A wind power generation power prediction method according to claim 1, characterized in that: The encoder layer in step S2 is composed of multiple encoders, among which the cross attention mechanism layer has an input of a two-dimensional matrix of shape , is the length of the sequence time dimension, and is the number of sequences. This layer flips the input matrix to obtain a matrix of shape , which is multiplied by the three weight matrices to obtain Q, K, and V, which contain the information of each meteorological sequence value and the current wind power value at the same time point, which is different from the Q, K, and V obtained by the ordinary Transformer encoder. Where Q is the query Query, K is the key value Key-value, and V is the value Value. The cross attention value is calculated according to the following formula to obtain a matrix containing the variable dimension correlation characteristics.
3. A method for predicting wind power generation according to claim 1, characterized in that: In step S4, CEEMDAN introduces auxiliary noise to enhance stability and effect, and solves the modal aliasing problem of EMD to a certain extent. The specific implementation steps are as follows: (1) Add Gaussian white noise to the signal to be decomposed to obtain a new signal. Perform EMD decomposition on the new signal to obtain the first-order intrinsic mode component; (2) The multiple modal components generated are averaged to obtain the first intrinsic modal component of CEEMDAN decomposition; (3) Calculate the residual after removing the first modal component, and add positive and negative paired Gaussian white noise to the residual to obtain a new signal. Perform EMD decomposition on the new signal to obtain the second-order intrinsic modal component; (4) Repeat the above steps until the residual signal obtained is a monotonic function and cannot be further decomposed. The obtained signal is the subsequence.
4. A method for predicting wind power generation according to claim 1, characterized in that: The decomposition window sliding in step S4 is performed in the following specific steps: (1) The first T data of the wind power sequence are decomposed by CEEMDAN to obtain several subsequences, and then the prediction model is used to train each subsequence. (2) After the model training is completed, the data of [TM:T] is used to obtain M / 2 prediction outputs of each subsequence model, and then they are summed to obtain the prediction value of [T+1:T+M / 2]. (3) Perform CEEMDAN decomposition on the data of [M / 2+1:T+M / 2], and obtain multiple subsequences. Then train a prediction model for each subsequence. Then use the M data of [TM / 2-1:T+M / 2] to obtain M / 2 prediction data of each subsequence model, and then sum them up to obtain M / 2 prediction values of [T+M / 2:T+M]. (4) Repeat the above steps, sliding the decomposition window by M / 2 data each time, then decompose the data in the window and train the model, and finally make predictions until all the prediction values of [T+1:T+k] are obtained. By sliding the decomposition window, it is possible to avoid using data after the prediction time, thereby avoiding the leakage of future information.