Ultra-short-term wind speed measuring and calculating method based on multi-dimensional features and Seq2Seq model
By using multi-dimensional features and Seq2Seq model in wind speed prediction, combined with sliding window and feature coupling technology, the lag problem in traditional methods in ultra-short-term wind speed prediction is solved, significantly improving prediction accuracy and timeliness.
Patent Information
- Application Number
- CN202510607797.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Traditional wind speed prediction methods have limitations in terms of time and spatial resolution, which is difficult to meet the needs of ultra-short-term, i.e. minute-level prediction, and ignoring the three-dimensional dynamic characteristics of the wind field leads to prediction lag.
The ultra-short-term wind speed calculation method based on multi-dimensional features and Seq2Seq model is adopted, and outliers are eliminated through the sliding window, first-order change characteristics and vertical gradient characteristics of multi-meteorological parameters are extracted, and feature coupling is performed, and prediction is carried out by combining the Seq2Seq model with a staged dynamic attention mechanism.
It significantly improves the accuracy and timeliness of ultra-short-term wind speed prediction, effectively captures the three-dimensional dynamic characteristics of the wind field, reduces prediction errors, and optimizes the prediction effect of the model through dynamic weight coefficient division.
Smart Images

Figure CN120124014A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electronic digital data processing, and particularly relates to a method for ultra-short-term wind speed measurement based on multi-dimensional features and a Seq2Seq model. Background Art
[0002] Due to the non-stationarity and chaos of wind speed data, it is challenging to accurately predict wind speed changes at different time intervals. Traditional wind speed prediction methods mainly rely on physical models and numerical weather prediction models, but these methods have limitations in terms of time resolution and spatial resolution, and it is difficult to meet the requirements of ultra-short-term, i.e., minute-level prediction. Summary of the Invention
[0003] The present invention proposes a method for ultra-short-term wind speed measurement based on multi-dimensional features and a Seq2Seq model, which includes the following steps: Data preprocessing: Traverse the wind speed sequence through a sliding window to eliminate outliers, extract the first-order change features of multiple meteorological parameters and the wind speed vertical gradient feature, and perform feature coupling on the first-order change features of multiple meteorological parameters and the wind speed vertical gradient feature to generate a comprehensive wind speed change feature; wherein, the feature coupling is achieved through the formula where (F Δ1 ; WS ΔT ) is the combined input of the first-order change feature F Δ1 of meteorological parameters including temperature, humidity, pressure, and wind speed and the vertical gradient feature WS ΔT , W 1 , W 2 are weight matrices, b 1 , b 2 are bias terms, GELU is an activation function, and LayerNorm is a layer normalization operation; Data normalization: Normalize the preprocessed data using the batch normalization method; Model construction and prediction: Use the Seq2Seq model combined with the dynamic attention weight mechanism to predict the future wind speed in stages through multiple cascaded sub-modules, and distinguish the focus of the model in different prediction stages through the coupling layer mapping, and finally output the ultra-short-term wind speed prediction result.
[0004] Specifically, in the staged prediction, the local temporal attention mechanism for high-precision stage prediction extracts mutation features through a sliding window, and the global periodic attention mechanism for expansion stage prediction extracts periodic dependencies through historical 24-hour data.
[0005] Specifically, the final output of the ultra-short-term wind speed prediction result is , where the dynamic weight coefficient γ(s)=1-s / 4n*(e (n-s / 4)) where s is the predicted number of steps, Y(1,n) and Y(n+1,7) are the model outputs in the high-precision stage and the extended stage respectively, and n is the number of hours.
[0006] Specifically, the dynamic attention weight mechanism is implemented through the following steps: linearly map the hidden state output by the encoder to generate attention scores; activate the attention scores using the tanh function; normalize them to a probability distribution through softmax; and perform weighted summation on the encoder hidden states to generate attention-weighted features.
[0007] Specifically, the decoder of the cascaded sub-module uses a unidirectional LSTM. At each step, the predicted value at the previous moment is used as the input, and the current prediction result is generated by combining the encoder hidden state. Specifically, during model training, an adaptive learning rate optimization algorithm is adopted, and gradient backpropagation is performed in combination with the mean squared error loss function.
[0008] Specifically, the cascaded sub-modules achieve inheritance of temporal dependencies through the transfer of hidden states, that is, the initial hidden state of the encoder of the k-th sub-module is inherited from the final hidden state of the (k-1)-th sub-module.
[0009] Specifically, the wind speed sequence is traversed by a sliding window to eliminate outliers. Specifically: a sliding window is used to detect a sequence where the wind speed remains unchanged for 5 consecutive steps. If it exists, the window is skipped.
[0010] Beneficial technical effects: By coupling the first-order change characteristics of multiple meteorological parameters with the vertical gradient characteristics of wind speed, and combining the Seq2Seq model with a phased dynamic attention mechanism, the present invention significantly improves the accuracy and timeliness of ultra-short-term wind speed prediction. By coupling the differential characteristics and vertical gradient characteristics of temperature, humidity, pressure, and wind speed through layer normalization and the GELU activation function, the three-dimensional dynamic characteristics of the wind field are effectively captured, solving the problem of prediction lag caused by traditional models ignoring the vertical structure, and reducing the prediction error; the high-precision stage and the extended stage are divided by dynamic weight coefficients, and the model first focuses on local temporal mutation characteristics and gradually transitions to global periodic dependencies, and the overall prediction mean squared error is reduced compared with the single-stage model. Description of the Drawings
[0011] The present invention will be further described below with reference to the accompanying drawings.
[0012] Figure 1 is a flowchart of the ultra-short-term wind speed measurement method based on multi-dimensional features and the Seq2Seq model of the present invention; Figure 2 is a schematic diagram of the structure of the Seq2Seq model of the present invention. Specific Embodiments
[0013] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0014] As Figure 1 shown, the present invention discloses a very short-term wind speed measurement method based on multi-dimensional features and a Seq2Seq model, which combines the first-order change features of multiple meteorological parameters with the vertical gradient features of the wind speed at a height of 100 meters. By capturing the coupling relationship between the instantaneous changes of atmospheric physical quantities and the vertical structure of the wind field, the problem of prediction lag caused by traditional methods ignoring the three-dimensional dynamic characteristics of the wind field is solved. Finally, using a staged progressive Seq2Seq prediction framework, the wind speed for the next 7 hours is predicted by 28 cascaded sub-modules respectively. Each sub-module adopts a dynamic attention weight mechanism, enabling the model to focus on local temporal mutation features in the initial high-precision stage and global periodic features in the subsequent expansion stage. The specific steps are as follows: 1. Data preprocessing: (1) To eliminate the stagnant values and outliers in the data, a sliding window with a size of 84 steps is set to traverse the entire sequence in turn. The obtained sub-time series F = [W 1 , W 2 , W 3 , …, W T , …, W t-82 , W t-83 .
[0015] Where t is the total length of the time series and T is the T-th moment in the middle.
[0016] For each W T It can be expressed as: W T = [t 1 , t 2 , …, t 84 .
[0017] For each window, if there is a continuous sequence of wind speed with a length of 5 or there are outliers, skip this window and take the value of the next window until all sequences are traversed.
[0018] (2) Use the strptime function in the datetime library of python to add timestamp information to the features. Here, only the minutes and hours-level time are selected to add timestamps, and they are linearly mapped to continuous integers.
[0019] (3)Extract the first-order change features of the data. Calculate the differences between the four features of temperature, humidity, pressure, and wind speed in the input data and the features at the previous moment (15 minutes) ago. The obtained features are the first-order change features F for 15 minutes. Δ1 。
[0020] (4)Extract the wind speed gradient information. Each moment in the dataset contains wind speed information at heights of 10 meters, 30 meters, 50 meters, 70 meters, and 100 meters. Subtract the wind speeds at other heights from the wind speed at 100 meters to obtain the gradient feature WS of the wind speed. ΔT 。
[0021] (5)Couple the overall change features. The overall change information of the wind speed can be found after coupling the single first-order change of the wind speed and the vertical gradient information. It can be expressed as: , where (F Δ1 ; WS ΔT ) is the combined input of the first-order change features F Δ1 of the meteorological parameters including temperature, humidity, pressure, and wind speed and the vertical gradient feature WS ΔT . W 1 , W 2 are weight matrices, b 1 , b 2 are bias terms, GELU is the activation function, and LayerNorm is the layer normalization operation.
[0022] 2. Data reading and normalization: Use the Dataset library in Python to read the data. Different from previous normalization methods, here the batch normalization method is selected to process the data. For each batch of data read by the Dataset library, perform normalization within this batch of data to ensure that the model produces good results under extreme weather conditions. The normalization method is the maximum-minimum normalization, which maps the data between 0 and 1, and finally obtains the normalized data Norm batch , which can be expressed by the following formula: Norm batch =(Data batch -Min batch ) / (Max batch -Min batch ), where Data batch represents the original data of each batch, and Max batch and Min batch represent the maximum and minimum values in each batch of data respectively.
[0023] 3. Model construction and prediction: As Figure 2As shown, the present invention uses a Seq2Seq model combined with an attention mechanism to extract data features and predict the wind speed at future moments. The model consists of 28 consecutive sub-modules, each sub-module is used to predict the wind speed value for the next step, and the sub-module includes an encoder and a decoder structure respectively. After each sub-module, an attention mechanism is added to analyze the features output currently, ensuring that the model focuses on the information of important parts.
[0024] (1) The encoder structure is a long short-term memory network (LSTM). The LSTM combines the previous state and the current input through memory cells and gating mechanisms, and can capture long-distance dependencies. Each LSTM cell can be represented by the following formula:
[0025] where h t is the hidden state at the current time step, C t is the cell state at the current time step, x t is the input at the current time step, W and b are the weight matrix and bias term of the LSTM, and σ and tanh are activation functions. It should be noted that for x 0 corresponding to the first moment, since there is no h t-1 and C t-1 from the previous moment, 0 is used as the input information to start the LSTM encoding process. After passing through the encoder, the current h t and C t are obtained.
[0026] (2) The decoder uses the h t and C t decoded by the encoder as part of the input at the current moment, uses the previous step's predicted value as the other part of the input at the current time step, updates the hidden state using a unidirectional LSTM, and finally generates the predicted value by passing the hidden state through a fully connected layer. This step-by-step prediction mechanism allows the decoder to utilize the predicted values generated at each step, thus getting closer to the real inference process.
[0027] (3) The attention mechanism assigns a weight to the features at each step. For the prediction result output by the encoder at each step: First, a linear layer is used to map the current information to 1 dimension to generate the attention score of the current feature. Then, the tanh function in the torch library is used to non-linearly activate the attention score to help capture more complex patterns. Then, softmax is used to normalize the activated attention score to a probability. Finally, by multiplying the attention probability with the input tensor and performing weighted summation, a weighted output is obtained, which is the result after dynamically attention-weighting the input data.
[0028] (4) The results obtained through the aforementioned steps are mapped by the coupling layer in the high-precision stage and the expansion stage to distinguish the focus of the model. It can be expressed as: , where γ(s) is the stage weight coefficient and can be designed as: γ(s) = 1 - s / 4n * (e (n-s / 4) ), where s is the number of steps of time prediction, Y(1, n) and Y(n + 1, 7) are the model outputs of the high-precision stage and the expansion stage respectively, n is the number of hours, and n is less than 6. Through this method, the model can distinguish the differences between the initial high-precision stage and the subsequent expansion stage.
[0029] (5) The output of the coupling layer undergoes a linear transformation through the fully connected layer to the target wind speed value, which is the final result. The design of the fully connected layer ensures that the dimension of the predicted value is 1, matching the target wind speed.
[0030] Through the above network structure design, the Seq2Seq model makes full use of the historical time series features and dynamically adjusts the feature weights in combination with the attention mechanism, so as to achieve efficient prediction of future wind speeds. Each part of the model architecture has been verified through multiple experiments, and its combination can effectively capture the non-linear features and time dependence of wind speed data.
Claims
1. A method for calculating ultra-short-term wind speed based on multidimensional features and Seq2Seq model, characterized in that: The following steps are involved: Data preprocessing: The wind speed sequence is traversed through a sliding window to eliminate outliers, the first-order change characteristics of multiple meteorological parameters and the vertical gradient characteristics of wind speed are extracted, and the first-order change characteristics of multiple meteorological parameters are coupled with the vertical gradient characteristics of wind speed to generate comprehensive wind speed change characteristics; the feature coupling is achieved through the formula Implementation, where (F Δ1 ;WS ΔT ) is the first-order variation characteristic F of meteorological parameters including temperature, humidity, pressure, and wind speed Δ1 With vertical gradient feature WS ΔT The combined input of , W1 and W2 are weight matrices, b1 and b2 are bias terms, GELU is the activation function, and LayerNorm is the layer normalization operation; Data normalization: Batch normalization method is used to normalize the preprocessed data; Model construction and prediction: The Seq2Seq model is combined with a dynamic attention weight mechanism to predict future wind speeds in stages through multiple cascaded sub-modules. The coupling layer mapping is used to distinguish the focus of the model at different prediction stages, and finally the ultra-short-term wind speed prediction results are output.
2. The method according to claim 1, characterized in that In the stage-by-stage prediction, the local temporal attention mechanism of the high-precision stage prediction extracts mutation features through sliding windows, and the global periodic attention mechanism of the extended stage prediction extracts periodic dependencies through historical 24-hour data.
3. The method according to claim 1, characterized in that The final output of the ultra-short-term wind speed forecast is , where the dynamic weight coefficient γ(s)=1-s / 4n*(e (n-s / 4) ), where s is the number of prediction steps, Y(1,n) and Y(n+1,7) are the model outputs of the high-precision stage and the expansion stage respectively, and n is the number of hours.
4. The method according to claim 1, characterized in that The dynamic attention weight mechanism is implemented through the following steps: linearly map the hidden state of the encoder output to generate an attention score; activate the attention score using the tanh function; normalize it to a probability distribution through softmax; and weighted sum the encoder hidden state to generate an attention weighted feature.
5. The method according to claim 1, characterized in that The decoder of the cascade submodule adopts a unidirectional LSTM. The prediction value of the previous moment is used as input at each step, and the current prediction result is generated in combination with the encoder hidden state.
6. The method according to claim 1, characterized in that An adaptive learning rate optimization algorithm is used during model training, and the mean square error loss function is combined for gradient back propagation.
7. The method according to claim 1, characterized in that The temporal dependency inheritance is achieved between cascaded submodules through hidden state transfer, that is, the initial hidden state of the encoder of the kth submodule is inherited from the final hidden state of the k-1th submodule.
8. The method according to claim 1, characterized in that The wind speed sequence is traversed through a sliding window to eliminate outliers. Specifically, a sliding window is used to detect a sequence of 5 consecutive steps of unchanged wind speed. If one exists, the window is skipped.
Citation Information
Patent Citations
Coupling large-scale data flow width learning rapid prediction intelligent algorithm based on network community detection and GCN
CN111696345A
Wind speed prediction method based on variational mode decomposition and attention mechanism
CN114218870A
Ultra-short-term wind power prediction method and system based on time sequence representation and multi-level attention
CN116826727A
Short-term photovoltaic power generation power prediction method based on L-Transform
CN117034055A
Mixed deep learning water quality prediction method based on time-frequency feature extraction
CN117194954A