Ultra-short-term wind speed measurement method based on multi-dimensional features and Seq2Seq model
By combining multi-dimensional features and Seq2Seq model, wind speed is predicted in stages, and using dynamic attention mechanism and LSTM architecture, the problem of insufficient time and spatial resolution in wind speed prediction by traditional methods is solved, and high-precision minute-level wind speed prediction is achieved.
Patent Information
- Application Number
- CN202510607797.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Traditional wind speed prediction methods are difficult to meet the needs of ultra-short-term wind speed prediction in terms of time and spatial resolution, especially the accuracy of the minute level is insufficient.
By extracting the first-order differential characteristics and vertical gradient characteristics of temperature, humidity, pressure and wind speed, combining the Seq2Seq model and dynamic attention mechanism, future wind speed is predicted in stages, layer normalization and GELU activation function are used to construct multi-dimensional feature characterization, and wind speed prediction is performed using the LSTM encoder-decoder architecture.
It significantly improves the accuracy and timeliness of ultra-short-term wind speed prediction, solves the prediction lag problem caused by traditional methods due to ignoring the vertical structure, and reduces prediction errors.
Smart Images

Figure CN120124014B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electronic digital data processing, and particularly relates to a very short-term wind speed measurement method 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 are difficult to meet the requirements of very short-term (i.e., minute-level) prediction. Summary of the Invention
[0003] The present invention proposes a very short-term wind speed measurement method based on multi-dimensional features and a Seq2Seq model, which includes the following steps:
[0004] 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 vertical gradient features of the wind speed, and perform feature coupling on the first-order change features of multiple meteorological parameters and the vertical gradient features of the wind speed to generate comprehensive wind speed change features; 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 , W1 and W2 are weight matrices, b1 and b2 are bias terms, GELU is an activation function, and LayerNorm is a layer normalization operation;
[0005] Data normalization: Perform normalization processing on the preprocessed data using the batch normalization method;
[0006] Model construction and prediction: Use the Seq2Seq model combined with a 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 a coupling layer mapping, and finally output the very short-term wind speed prediction result.
[0007] Specifically, in the stage 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 extended stage prediction extracts periodic dependencies through historical 24-hour data.
[0008] Specifically, the final output of the very 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 of the high-precision stage and the extended stage respectively, and n is the number of hours.
[0009] 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.
[0010] Specifically, the decoder of the cascaded sub-module uses a unidirectional LSTM. At each step, the predicted value of the previous moment is used as the input, and the current prediction result is generated by combining the encoder hidden state.
[0011] 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.
[0012] Specifically, the cascaded sub-modules achieve the inheritance of temporal dependence 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.
[0013] 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, and if it exists, the window is skipped.
[0014] 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; using dynamic weight coefficients to divide the high-precision stage and the extended stage, 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 to the single-stage model. Brief Description of the Drawings
[0015] The present invention will be further described below with reference to the accompanying drawings.
[0016] Figure 1 is the flowchart of the ultra-short-term wind speed measurement method based on multi-dimensional features and the Seq2Seq model of the present invention;
[0017] Figure 2 is the schematic diagram of the structure of the Seq2Seq model of the present invention. Detailed Embodiments
[0018] 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.
[0019] As Figure 1 shown, the present invention discloses a very short-term wind speed measurement method based on multi-dimensional features and the Seq2Seq model, which combines the first-order change features of multi-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 prediction lag problem 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 in the next 7 hours is predicted by 28 cascaded sub-modules respectively. Each sub-module adopts a dynamic attention weight mechanism, so that the model focuses 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:
[0020] 1. Data preprocessing:
[0021] (1) To eliminate the dead 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 = [W1, W2, W3, …, W T , …, W t-82 , W t-83 .
[0022] Where t is the total length of the time series and T is the T-th moment in the middle.
[0023] For each W T It can be expressed as: W T = [t1, t2, …, t 84 .
[0024] 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.
[0025] (2) Use the strptime function in the datetime library in python to add timestamp information to the features. Here, it is selected to add timestamps only to the time at the minute and hour levels and linearly map them to continuous integers.
[0026] (3)Extract the first-order change features of the data. Calculate the difference between the four features of temperature, humidity, pressure, and wind speed in the input data and the features 15 minutes ago, and the obtained features are the first-order change features F of 15 minutes Δ1 .
[0027] (4)Extract the wind speed gradient information. The features included in each moment in the dataset are the wind speed information at 10 meters, 30 meters, 50 meters, 70 meters, and 100 meters. Subtract the wind speed at other heights from the wind speed at 100 meters to obtain the gradient feature WS of the wind speed ΔT .
[0028] (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 feature F Δ1 of the meteorological parameters including temperature, humidity, pressure, and wind speed and the vertical gradient feature WS ΔT . W1 and W2 are weight matrices, b1 and b2 are bias terms, GELU is the activation function, and LayerNorm is the layer normalization operation
[0029] 2. Data reading and normalization:
[0030] 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, normalization is performed within this batch of data, which can ensure that the model produces good results in extreme weather. 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
[0031] 3. Model construction and prediction:
[0032] As Figure 2As shown in the figure, 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 of which is used to predict the wind speed value for the next step. The sub-modules respectively include an encoder and a decoder structure. After each sub-module, an attention mechanism is added to analyze the features output at the current time to ensure that the model focuses on the information of important parts.
[0033] (1) The encoder structure is a long short-term memory network (LSTM). The LSTM combines the previous state and the current input through memory units and gating mechanisms, and can capture long-distance dependencies. Each LSTM unit can be represented by the following formula:
[0034]
[0035] 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 x0 corresponding to the first moment, since there is no h t-1 and C t-1 at 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.
[0036] (2) The decoder uses the h t and C t obtained by decoding the encoder as a part of the input at the current time, uses the previous step prediction value as the other part of the input at the current time step, updates the hidden state using a unidirectional LSTM, and finally generates a prediction value by passing the hidden state through a fully connected layer. This step-by-step prediction mechanism allows the decoder to utilize the generated prediction values at each step, thus being closer to the real inference process.
[0037] (3) The attention mechanism assigns a weight to the features at each step. For the prediction results output at each step of the encoder: 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.
[0038] (4) The results obtained through the above steps are separated by the coupling layer mapping in the high-precision stage and the expansion stage. 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.
[0039] (5) The output of the coupling layer is linearly transformed 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.
[0040] 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 very short-term wind speed measurement method based on multi-dimensional features and Seq2Seq model, characterized in that, Including 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 vertical gradient features of wind speed, and couple the first-order change features of multiple meteorological parameters with the vertical gradient features of wind speed to generate comprehensive wind speed change features; among them, 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 , 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: The preprocessed data is normalized using the batch normalization method; Model construction and prediction: The Seq2Seq model is used in combination with the dynamic attention weight mechanism to predict the future wind speed in stages through multiple cascaded sub-modules. The coupling layer mapping is used to distinguish the focus of the model in different prediction stages, and finally the ultra-short-term wind speed prediction result is output; Specifically, the model consists of multiple consecutive sub-modules. Each sub-module is used to predict the wind speed value for the next step. The sub-modules respectively include an encoder and a decoder structure, and an attention mechanism is added after each sub-module to analyze the features of the current output. In the phased prediction, the local temporal attention mechanism in the high-precision stage prediction extracts mutation features through a sliding window, and the global periodic attention mechanism in the expansion stage prediction extracts periodic dependencies through the historical 24-hour data. The final output of the ultra-short-term wind speed prediction result is , where the dynamic weight coefficient , 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.
2. 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 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 weighted sum the encoder hidden states to generate attention-weighted features.
3. The method according to claim 1, wherein The decoder of the cascaded sub-module uses a unidirectional LSTM, with the prediction value of the previous moment as the input at each step, and combines the encoder hidden state to generate the current prediction result.
4. The method according to claim 1, wherein During model training, the adaptive learning rate optimization algorithm is adopted, and the gradient is backpropagated in combination with the mean square error loss function.
5. The method according to claim 1, wherein The cascaded sub-modules inherit the temporal dependence 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.
6. The method according to claim 1, wherein The wind speed sequence is traversed through 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, and if it 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