New energy power prediction method and device based on decomposition and attention mechanism
By employing a new energy power prediction method based on decomposition and attention mechanisms, and utilizing the cross-attention mechanism of the Transformer model to process wind speed data, this method addresses the problem of insufficient accuracy in existing wind power prediction models, achieving high-precision and well-generalized wind power prediction, thereby improving the stability and economy of the power system.
Patent Information
- Application Number
- CN202310852279.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
Existing wind power prediction models are insufficient in terms of accuracy and generalization ability. In particular, statistical models assume that wind speed data is normally distributed and linearly correlated, which does not match the actual situation and results in poor prediction performance.
A new energy power prediction method based on decomposition and attention mechanism is adopted. Noise signals are removed by empirical mode decomposition, and the cross-attention mechanism of the Transformer model is used to encode and decode wind speed data, thereby improving prediction accuracy and generalization ability.
It improves the accuracy and generalization ability of wind power forecasting, better handles the volatility and intermittency of wind power, reduces grid operating costs, and enhances the security and stability of the power system.
Smart Images

Figure CN119312654A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wind power prediction, and in particular to a new energy power prediction method and device based on a decomposition and attention mechanism. Background Art
[0002] Wind energy is clean and renewable, and is an ideal new energy source. Due to the volatility, randomness and intermittency of wind power generation, the access of large-capacity wind power generation to the power grid affects the safe and stable operation of the power system. High-precision wind power forecasting can reduce the adverse effects of wind power volatility and intermittency on power quality, improve the ability of wind to cross power limits, and enhance the safety and stability of power system operation. When the forecast reaches sufficient accuracy, the system can reduce the spare capacity used to balance its power fluctuations, thereby reducing the cost of grid operation and facilitating the system to effectively absorb large-scale wind power. Therefore, it is of great theoretical and practical significance to study the multi-step forecasting method of wind farm power.
[0003] So far, researchers' research on wind power forecasting is mainly classified into three models: physical models, statistical models and artificial intelligence. Physical models use physical factors and meteorological data to estimate future wind power, but they are not effective in forecasting. Statistical models assume that wind speed data is normally distributed and linearly related, which is inconsistent with the actual situation, so its forecasting performance is often not guaranteed. Summary of the invention
[0004] In order to overcome the above defects, the present invention proposes a new energy power prediction method and device based on decomposition and attention mechanism.
[0005] In a first aspect, a new energy power prediction method based on decomposition and attention mechanism is provided, and the new energy power prediction method based on decomposition and attention mechanism includes:
[0006] Obtaining a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the forecast period;
[0007] Obtaining a second query vector and a second key vector corresponding to the wind speed data of the forecast period;
[0008] Using the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-built neural network model, using the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-built neural network model, and obtaining a new energy power prediction result of the prediction period output by the pre-built neural network model;
[0009] Among them, the value vector of the second cross-attention mechanism input to the decoder in the pre-constructed neural network model is the output feature of the encoder in the pre-constructed neural network model.
[0010] Preferably, the obtaining of the first query vector, the first key vector and the first value vector corresponding to the wind speed data in the forecast period includes:
[0011] Perform empirical mode decomposition on the wind speed data during the forecast period to obtain a set of modes;
[0012] Eliminating noise signals from the set of modes;
[0013] The group of modalities are passed through a channel attention mechanism module and then a word embedding operation is performed to obtain a first mapping feature vector;
[0014] taking the sum of the position vector corresponding to the wind speed data in the prediction period and the first mapping feature vector as the first value vector corresponding to the wind speed data in the prediction period;
[0015] The wind speed data of the forecast period is subjected to a convolution operation to obtain a convolution vector;
[0016] The convolution vector is linearly transformed using two random matrices of the same dimension to obtain a first query vector and a first key vector corresponding to the wind speed data of the forecast period.
[0017] Furthermore, the obtaining of the second query vector and the second key vector corresponding to the wind speed data in the forecast period includes:
[0018] Performing a word embedding operation on the wind speed data of the prediction period to obtain a second mapping feature vector;
[0019] The sum of the position vector corresponding to the wind speed data of the prediction period and the first mapping feature vector is used as the second query vector and the second key vector corresponding to the wind speed data of the prediction period, respectively.
[0020] Preferably, before performing empirical mode decomposition on the wind speed data of the prediction period, the process includes: performing normalization processing on the wind speed data of the prediction period.
[0021] Furthermore, the removing of noise signals from the group of modes includes:
[0022] Using the Kolmogorov-Smirnov test method to test the correlation between each mode in the set of modes and the Gaussian noise;
[0023] Modes whose correlation with Gaussian noise exceeds a threshold are eliminated.
[0024] Preferably, the process of acquiring the pre-built neural network model includes:
[0025] Obtain a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the historical period;
[0026] Obtain a second query vector and a second key vector corresponding to the wind speed data of the historical period;
[0027] Constructing training data using a first query vector, a first key vector, a first value vector, a second query vector and a second key vector of wind speed data in a historical period and new energy power in a historical period;
[0028] The initial neural network model is trained using the training data to obtain the pre-constructed neural network model.
[0029] Furthermore, the initial neural network model is a Transformer model.
[0030] Furthermore, the encoder of the Transformer model includes a first cross-attention mechanism layer, a first self-attention mechanism layer, a first normalized residual connection layer, a first feedforward network layer and a second normalized residual connection layer which are connected in sequence.
[0031] Furthermore, the decoder of the Transformer model includes a second cross-attention mechanism layer, a second self-attention mechanism layer, a third normalized residual connection layer, a second feedforward network layer, a fourth normalized residual connection layer and a fully connected layer, which are connected in sequence.
[0032] Furthermore, the number of layers of the encoder is 6, and the number of layers of the decoder is 4.
[0033] Furthermore, the filtering threshold in the process of performing empirical mode decomposition on the wind speed data in the forecast period is 3.
[0034] In a second aspect, a new energy power prediction device based on a decomposition and attention mechanism is provided, and the new energy power prediction device based on a decomposition and attention mechanism comprises:
[0035] A first acquisition module, used to acquire a first query vector, a first key vector and a first value vector corresponding to the wind speed data in the forecast period;
[0036] A second acquisition module, used to acquire a second query vector and a second key vector corresponding to the wind speed data in the forecast period;
[0037] An analysis module, used to use the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-built neural network model, and use the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-built neural network model, to obtain a new energy power prediction result of the prediction period output by the pre-built neural network model;
[0038] Among them, the value vector of the second cross-attention mechanism input to the decoder in the pre-constructed neural network model is the output feature of the encoder in the pre-constructed neural network model.
[0039] In a third aspect, a computer device is provided, comprising: one or more processors;
[0040] The processor is used to store one or more programs;
[0041] When the one or more programs are executed by the one or more processors, the new energy power prediction method based on decomposition and attention mechanism is implemented.
[0042] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed, the new energy power prediction method based on decomposition and attention mechanism is implemented.
[0043] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0044] The present invention relates to the technical field of wind power prediction, and specifically provides a new energy power prediction method and device based on decomposition and attention mechanism, including: obtaining a first query vector, a first key vector and a first value vector corresponding to the wind speed data of a prediction period; obtaining a second query vector and a second key vector corresponding to the wind speed data of the prediction period; using the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-constructed neural network model, using the output features of the encoder in the pre-constructed neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-constructed neural network model, and obtaining a new energy power prediction result of the prediction period output by the pre-constructed neural network model; the technical solution provided by the present invention has high accuracy and good generalization ability, and can effectively improve the performance of the wind power prediction method in the problem of multi-step wind power prediction. Furthermore, the technical solution provided by the present invention has no restrictions on the operating platform, is flexible and convenient to use, has strong portability, and has excellent wind power prediction performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic flow chart of the main steps of the new energy power prediction method based on the decomposition and attention mechanism according to an embodiment of the present invention;
[0046] Figure 2 is a complete flow chart of a new energy power prediction method based on decomposition and attention mechanism according to an embodiment of the present invention;
[0047] Figure 3 This is an IEMD decomposition effect diagram of an embodiment of the present invention;
[0048] Figure 4 is a schematic diagram of a self-attention mechanism layer and a cross-attention mechanism layer in an embodiment of the present invention;
[0049] Figure 5 is an ADF test result diagram of an embodiment of the present invention;
[0050] Figure 6 This is a graph showing changes in the prediction effect of the GRU model after using IEMD in an embodiment of the present invention;
[0051] Figure 7 is a comparison diagram of using an IEMD-GRU model and an IEMD-Transformer model in an embodiment of the present invention;
[0052] Figure 8 It is a main structural block diagram of a new energy power prediction device based on decomposition and attention mechanism according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] As disclosed in the background technology, wind energy is clean and renewable, and is an ideal new energy source. Due to the volatility, randomness and intermittency of wind power generation, the access of large-capacity wind power generation to the power grid affects the safe and stable operation of the power system. High-precision wind power forecasting can reduce the adverse effects of wind power volatility and intermittency on power quality, improve the ability of wind to cross power limits, and enhance the safety and stability of power system operation. When the prediction reaches a sufficient accuracy, the system can reduce the spare capacity used to balance its power fluctuations, thereby reducing the cost of grid operation and facilitating the system to effectively absorb large-scale wind power. Therefore, it is of great theoretical and practical significance to study the multi-step prediction method of wind farm power.
[0056] So far, researchers' research on wind power forecasting is mainly classified into three models: physical models, statistical models and artificial intelligence. Physical models use physical factors and meteorological data to estimate future wind power, but they are not effective in forecasting. Statistical models assume that wind speed data is normally distributed and linearly related, which is inconsistent with the actual situation, so its forecasting performance is often not guaranteed.
[0057] In order to improve the above-mentioned problems, the present invention relates to the technical field of wind power prediction, and specifically provides a new energy power prediction method and device based on decomposition and attention mechanism, including: obtaining a first query vector, a first key vector and a first value vector corresponding to the wind speed data of the prediction period; obtaining a second query vector and a second key vector corresponding to the wind speed data of the prediction period; using the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as the input of the first cross-attention mechanism of the encoder in the pre-constructed neural network model, and using the output features of the encoder in the pre-constructed neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as the input of the second cross-attention mechanism of the decoder in the pre-constructed neural network model, and obtaining the new energy power prediction result of the prediction period output by the pre-constructed neural network model; the technical solution provided by the present invention has high accuracy and good generalization ability, and can effectively improve the performance of the wind power prediction method in the problem of multi-step prediction of wind power. Furthermore, the technical solution provided by the present invention has no restrictions on the operating platform, is flexible and convenient to use, has strong portability, and has excellent wind power prediction performance.
[0058] The above scheme is described in detail below.
[0059] Example 1
[0060] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a new energy power prediction method based on decomposition and attention mechanism according to an embodiment of the present invention. Figure 1As shown, the new energy power prediction method based on decomposition and attention mechanism in the embodiment of the present invention mainly includes the following steps:
[0061] Step S101: obtaining a first query vector, a first key vector and a first value vector corresponding to the wind speed data of the forecast period;
[0062] Step S102: Acquire a second query vector and a second key vector corresponding to the wind speed data of the forecast period;
[0063] Step S103: using the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of the first cross-attention mechanism of the encoder in the pre-built neural network model, using the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of the second cross-attention mechanism of the decoder in the pre-built neural network model, and obtaining the new energy power prediction result of the prediction period output by the pre-built neural network model;
[0064] Among them, the value vector of the second cross attention mechanism input of the decoder in the pre-built neural network model is the output feature of the encoder in the pre-built neural network model. The specific flow chart is as follows: Figure 2 As shown;
[0065] In one embodiment, the wind power data set used is the WIND (The Wind Integration National Dataset) toolkit, which is one of the largest publicly available wind data sets and truly reflects the historical wind characteristics of more than 126,000 wind power stations in the United States. The WIND toolkit provides 7 years of wind speed data (2007-2013). The wind power generation sites selected by the present invention are 126684, 126685, and 126686 to form the data set.
[0066] In this embodiment, the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the forecast period are obtained, including:
[0067] Perform empirical mode decomposition on the wind speed data during the forecast period to obtain a set of modes. The decomposition effect is as follows: Figure 3 As shown, signal is the original signal and imf is the modal component after decomposition;
[0068] Eliminating noise signals from the set of modes;
[0069] The group of modalities are passed through a channel attention mechanism module and then a word embedding operation is performed to obtain a first mapping feature vector;
[0070] taking the sum of the position vector corresponding to the wind speed data in the prediction period and the first mapping feature vector as the first value vector corresponding to the wind speed data in the prediction period;
[0071] The wind speed data of the forecast period is subjected to a convolution operation to obtain a convolution vector;
[0072] The convolution vector is linearly transformed using two random matrices of the same dimension to obtain a first query vector and a first key vector corresponding to the wind speed data of the forecast period.
[0073] In this embodiment, the second query vector and the second key vector corresponding to the wind speed data of the forecast period are obtained, including:
[0074] Performing a word embedding operation on the wind speed data of the prediction period to obtain a second mapping feature vector;
[0075] The sum of the position vector corresponding to the wind speed data of the prediction period and the first mapping feature vector is used as the second query vector and the second key vector corresponding to the wind speed data of the prediction period, respectively.
[0076] In this embodiment, before performing empirical mode decomposition on the wind speed data of the prediction period, the process includes: performing normalization processing on the wind speed data of the prediction period.
[0077] In one embodiment, the removing of noise signals from the group of modes includes:
[0078] Using the Kolmogorov-Smirnov test method to test the correlation between each mode in the set of modes and the Gaussian noise;
[0079] Modes whose correlation with Gaussian noise exceeds a threshold are eliminated.
[0080] In this embodiment, the process of obtaining the pre-built neural network model includes:
[0081] Obtain a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the historical period;
[0082] Obtain a second query vector and a second key vector corresponding to the wind speed data of the historical period;
[0083] Constructing training data using a first query vector, a first key vector, a first value vector, a second query vector and a second key vector of wind speed data in a historical period and new energy power in a historical period;
[0084] The initial neural network model is trained using the training data to obtain the pre-constructed neural network model.
[0085] In one embodiment, the initial neural network model is a Transformer model.
[0086] In one embodiment, the encoder of the Transformer model includes a first cross-attention mechanism layer, a first self-attention mechanism layer, a first normalized residual connection layer, a first feedforward network layer, and a second normalized residual connection layer connected in sequence.
[0087] In one embodiment, the decoder of the Transformer model includes a second cross-attention mechanism layer, a second self-attention mechanism layer, a third normalized residual connection layer, a second feedforward network layer, a fourth normalized residual connection layer and a fully connected layer connected in sequence.
[0088] Among them, the principle diagram of the self-attention mechanism layer and the cross-attention mechanism layer is as follows Figure 4 As shown;
[0089] In one embodiment, the number of layers of the encoder is 6, and the number of layers of the decoder is 4.
[0090] In one embodiment, the filtering threshold in the process of performing empirical mode decomposition on the wind speed data in the prediction period is 3.
[0091] In an optimal implementation, the present invention can perform multi-step prediction on wind power, and use the mean absolute error (MAE) and mean square error (MSE) to evaluate the performance of various methods.
[0092] The smaller the MSE and MAE values are, the closer the predicted value is to the actual value, and the higher the prediction accuracy of the model is.
[0093] Comparative experiment: The model is trained on the training set, and the model is verified on the validation set after each training round and the verification effect is compared. When the performance of the model on the validation set does not improve for 5 consecutive rounds, the training is stopped, and the model parameters with the best verification effect are saved and used for wind speed series prediction. Table 1 below is a comparison of various models of MAE indicators, and Table 2 below is a comparison of various models of MSE indicators:
[0094] Table 1
[0095] Prediction step length Step 48 Step 96 192 steps GRU 1.310 1.679 2.119 IEMD-GRU 1.029 1.262 1.446 Autoformer 1.990 2.116 2.519 IEMD-Autoformer 2.017 2.332 2.480 Informer 1.246 1.624 2.037 IEMD-Informer 1.074 1.326 1.474 Transformer 1.264 1.624 2.068 IEMD-Transformer 0.967 1.199 1.348
[0096] Table 2
[0097] Prediction step length Step 48 Step 96 192 steps GRU 3.993 5.824 8.435 IEMD-GRU 2.409 3.140 4.141 Autoformer 7.659 8.381 11.624 IEMD-Autoformer 7.707 9.379 10.315 Informer 3.650 5.560 7.862 IEMD-lnformer 2.442 3.670 4.473 Transformer 3.744 5.613 8.707 IEMD-Transformer 2.159 3.043 3.909
[0098] Among them, GRU is a gated recurrent unit network, IEMD-GRU is a gated recurrent unit network based on empirical mode decomposition, Autoformer is an autocoupled transformer network, IEMD-Autoformer is an autocoupled transformer network based on empirical mode decomposition, informer is a probabilistic sparse self-attention transformer network, IEMD-informer is a probabilistic sparse self-attention transformer network based on empirical mode decomposition, Transformer is a deep neural network model fused with attention mechanism, and IEMD-Transformer is a deep neural network model based on empirical mode decomposition and fused with attention mechanism;
[0099] The IEMD-Transformer model is compared with other wind power prediction methods such as GRU and IEMD-GRU. The data used is the 126684 station data in the WIND toolkit. A total of 735987 wind power data with a 5-minute time interval from 2007 to 2013 are selected as the experimental data set. The mean absolute error MAE and mean square error MSE are used as evaluation indicators. The experimental results are shown in Tables 1 and 2. Figure 3 Compared with directly processing the original data without IEMD decomposition, the model combined with IEMD has better prediction effect. After decomposition, we used ADF test (Augmented Dickey-Fuller test) to verify the decomposition effect on the original sequence and the component subsequence. The result P-value of ADF test reflects the stability of the input sequence data. The lower the value, the more stable the data. The test results are as follows Figure 5 As shown in Figure 2, it can be seen that the non-stationarity of the component series after decomposition has been significantly improved. Figure 6 It can be seen that under the same GRU model, after IEMD decomposition, the model has a significant improvement in multi-step prediction. This shows that IEMD decomposition can effectively extract the features of input time series data, so that the neural network model parameter training can focus more on the processing of key feature information, which is conducive to improving the prediction effect.
[0100] At the same time, combining the results of Table 1 and Table 2, we compared multiple models and found that the IEMD-Transformer model has better prediction performance in terms of multi-step prediction. Here, we take the IEMD-GRU model as an example and combine it with Figure 7From the above, we can see that the IEMD-Transformer model is more accurate in predicting peak and valley power compared to the IEMD-GRU model. At the same time, as the time step length increases, the IEMD-Transformer model's prediction trend for wind power is closer to the true value than the GRU model. Therefore, it can be seen that the neural network model Transformer that introduces the fusion attention mechanism has a better learning effect on global information features than the recurrent neural network GRU, which makes it have better performance in the prediction of relatively longer time series.
[0101] Example 2
[0102] Based on the same inventive concept, the present invention also provides a new energy power prediction device based on decomposition and attention mechanism, such as Figure 8 As shown, the new energy power prediction device based on decomposition and attention mechanism includes:
[0103] A first acquisition module, used to acquire a first query vector, a first key vector and a first value vector corresponding to the wind speed data in the forecast period;
[0104] A second acquisition module, used to acquire a second query vector and a second key vector corresponding to the wind speed data in the forecast period;
[0105] An analysis module, used to use the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-built neural network model, and use the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-built neural network model, to obtain a new energy power prediction result of the prediction period output by the pre-built neural network model;
[0106] Among them, the value vector of the second cross-attention mechanism input to the decoder in the pre-constructed neural network model is the output feature of the encoder in the pre-constructed neural network model.
[0107] Preferably, the obtaining of the first query vector, the first key vector and the first value vector corresponding to the wind speed data in the forecast period includes:
[0108] Perform empirical mode decomposition on the wind speed data during the forecast period to obtain a set of modes;
[0109] Eliminating noise signals from the set of modes;
[0110] The group of modalities are passed through a channel attention mechanism module and then a word embedding operation is performed to obtain a first mapping feature vector;
[0111] taking the sum of the position vector corresponding to the wind speed data in the prediction period and the first mapping feature vector as the first value vector corresponding to the wind speed data in the prediction period;
[0112] The wind speed data of the forecast period is subjected to a convolution operation to obtain a convolution vector;
[0113] The convolution vector is linearly transformed using two random matrices of the same dimension to obtain a first query vector and a first key vector corresponding to the wind speed data of the forecast period.
[0114] Preferably, the obtaining of the second query vector and the second key vector corresponding to the wind speed data in the forecast period includes:
[0115] Performing a word embedding operation on the wind speed data of the prediction period to obtain a second mapping feature vector;
[0116] The sum of the position vector corresponding to the wind speed data of the prediction period and the first mapping feature vector is used as the second query vector and the second key vector corresponding to the wind speed data of the prediction period, respectively.
[0117] Preferably, before performing empirical mode decomposition on the wind speed data of the prediction period, the process includes: performing normalization processing on the wind speed data of the prediction period.
[0118] Furthermore, the removing of noise signals from the group of modes includes:
[0119] Using the Kolmogorov-Smirnov test method to test the correlation between each mode in the set of modes and the Gaussian noise;
[0120] Modes whose correlation with Gaussian noise exceeds a threshold are eliminated.
[0121] Preferably, the process of acquiring the pre-built neural network model includes:
[0122] Obtain a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the historical period;
[0123] Obtain a second query vector and a second key vector corresponding to the wind speed data of the historical period;
[0124] Constructing training data using a first query vector, a first key vector, a first value vector, a second query vector and a second key vector of wind speed data in a historical period and new energy power in a historical period;
[0125] The initial neural network model is trained using the training data to obtain the pre-constructed neural network model.
[0126] Furthermore, the initial neural network model is a Transformer model.
[0127] Furthermore, the encoder of the Transformer model includes a first cross-attention mechanism layer, a first self-attention mechanism layer, a first normalized residual connection layer, a first feedforward network layer and a second normalized residual connection layer which are connected in sequence.
[0128] Furthermore, the decoder of the Transformer model includes a second cross-attention mechanism layer, a second self-attention mechanism layer, a third normalized residual connection layer, a second feedforward network layer, a fourth normalized residual connection layer and a fully connected layer, which are connected in sequence.
[0129] Furthermore, the number of layers of the encoder is 6, and the number of layers of the decoder is 4.
[0130] Furthermore, the filtering threshold in the process of performing empirical mode decomposition on the wind speed data in the forecast period is 3.
[0131] Example 3
[0132] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a new energy power prediction method based on decomposition and attention mechanism in the above embodiment.
[0133] Example 4
[0134] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It can be understood that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of a new energy power prediction method based on a decomposition and attention mechanism in the above embodiment.
[0135] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A new energy power prediction method based on decomposition and attention mechanism, characterized in that: The method comprises: Obtaining a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the forecast period; Obtaining a second query vector and a second key vector corresponding to the wind speed data in the forecast period; Using the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-built neural network model, using the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-built neural network model, and obtaining a new energy power prediction result of the prediction period output by the pre-built neural network model; Among them, the value vector of the second cross-attention mechanism input to the decoder in the pre-constructed neural network model is the output feature of the encoder in the pre-constructed neural network model.
2. The method according to claim 1, characterized in that The step of obtaining the first query vector, the first key vector and the first value vector corresponding to the wind speed data in the forecast period includes: Perform empirical mode decomposition on the wind speed data during the forecast period to obtain a set of modes; Eliminating noise signals from the set of modes; The group of modalities are passed through a channel attention mechanism module and then a word embedding operation is performed to obtain a first mapping feature vector; taking the sum of the position vector corresponding to the wind speed data in the prediction period and the first mapping feature vector as the first value vector corresponding to the wind speed data in the prediction period; The wind speed data of the forecast period is subjected to a convolution operation to obtain a convolution vector; The convolution vector is linearly transformed using two random matrices of the same dimension to obtain a first query vector and a first key vector corresponding to the wind speed data of the forecast period.
3. The method according to claim 2, characterized in that The step of obtaining the second query vector and the second key vector corresponding to the wind speed data in the forecast period includes: Performing a word embedding operation on the wind speed data of the forecast period to obtain a second mapping feature vector; The sum of the position vector corresponding to the wind speed data of the prediction period and the first mapping feature vector is used as the second query vector and the second key vector corresponding to the wind speed data of the prediction period, respectively.
4. The method according to claim 1, characterized in that Before performing empirical mode decomposition on the wind speed data of the forecast period, the wind speed data of the forecast period is normalized.
5. The method according to claim 2, characterized in that The removing of noise signals from the group of modes comprises: Using the Kolmogorov-Smirnov test method to test the correlation between each mode in the set of modes and the Gaussian noise; Modes whose correlation with Gaussian noise exceeds a threshold are eliminated.
6. The method according to claim 1, characterized in that The acquisition process of the pre-built neural network model includes: Obtain a first query vector, a first key vector, and a first value vector corresponding to the wind speed data of the historical period; Obtain a second query vector and a second key vector corresponding to the wind speed data of the historical period; Constructing training data using a first query vector, a first key vector, a first value vector, a second query vector and a second key vector of wind speed data in a historical period and new energy power in a historical period; The initial neural network model is trained using the training data to obtain the pre-constructed neural network model.
7. The method according to claim 6, characterized in that The initial neural network model is a Transformer model.
8. The method according to claim 7, characterized in that The encoder of the Transformer model includes a first cross attention mechanism layer, a first self-attention mechanism layer, a first normalized residual connection layer, a first feedforward network layer and a second normalized residual connection layer which are connected in sequence.
9. The method according to claim 8, characterized in that The decoder of the Transformer model includes a second cross attention mechanism layer, a second self-attention mechanism layer, a third normalized residual connection layer, a second feedforward network layer, a fourth normalized residual connection layer and a fully connected layer, which are connected in sequence.
10. The method according to claim 9, characterized in that The number of layers of the encoder is 6, and the number of layers of the decoder is 4.
11. The method according to claim 2, characterized in that The filtering threshold in the process of performing empirical mode decomposition on the wind speed data in the forecast period is 3.
12. A new energy power prediction device based on decomposition and attention mechanism, characterized in that: The device comprises: A first acquisition module, used to acquire a first query vector, a first key vector and a first value vector corresponding to the wind speed data in the forecast period; A second acquisition module, used to acquire a second query vector and a second key vector corresponding to the wind speed data in the forecast period; An analysis module, used to use the first query vector, the first key vector and the first value vector corresponding to the wind speed data of the prediction period as inputs of a first cross-attention mechanism of an encoder in a pre-built neural network model, and use the output features of the encoder in the pre-built neural network model, the second query vector and the second key vector corresponding to the wind speed data of the prediction period as inputs of a second cross-attention mechanism of a decoder in the pre-built neural network model, to obtain a new energy power prediction result of the prediction period output by the pre-built neural network model; Among them, the value vector of the second cross-attention mechanism input to the decoder in the pre-constructed neural network model is the output feature of the encoder in the pre-constructed neural network model.
13. A computer device, characterized in that: include: one or more processors; The processor is used to store one or more programs; When the one or more programs are executed by the one or more processors, the new energy power prediction method based on decomposition and attention mechanism as described in any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, it implements the new energy power prediction method based on decomposition and attention mechanism as described in any one of claims 1 to 11.