A wind speed prediction method and device based on a Transformer model
By using a wind speed prediction method based on the Transformer model, combined with a feature factor set and an environmental disturbance correction model, the shortcomings of traditional wind speed prediction methods in handling multi-factor correlations and environmental disturbances are addressed, achieving efficient and accurate wind speed prediction and distribution map generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINESE PEOPLES LIBERATION ARMY UNIT 63968
- Filing Date
- 2025-07-16
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional wind speed forecasting methods struggle to fully capture the complex relationships and dynamic changes among multiple factors. Especially when dealing with large-scale monitoring networks, they are unable to efficiently integrate spatial and temporal characteristics and do not adequately consider environmental interference factors, resulting in limited forecast accuracy and high computational complexity.
A wind speed prediction method based on the Transformer model is adopted. By constructing a set of feature factors and combining it with an environmental interference correction model, the multi-head attention mechanism and position encoding layer of the Transformer architecture are used to capture the global dependencies of long-term time series data. Finally, environmental interference is processed by a convolutional neural network to generate a regional wind speed prediction distribution map.
It improves the accuracy and robustness of wind speed forecasting, can adapt to the wind speed forecasting needs of different regions and time periods, reduces forecasting deviations caused by environmental interference, and provides an intuitive regional wind speed forecast distribution map.
Smart Images

Figure CN122198196A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wind speed prediction technology, specifically to a wind speed prediction method and apparatus based on the Transformer model. Background Technology
[0002] Wind speed forecasting plays a crucial role in weather forecasting, energy production (such as wind power), aerospace, agricultural production, and traffic management. Accurate wind speed forecasts can help wind power companies optimize turbine scheduling and improve wind energy utilization efficiency; provide safe and reliable flight weather support for aviation sectors; assist agricultural production in rationally planning planting and harvesting schedules; and help transportation departments develop effective road control measures. However, traditional wind speed forecasting methods face numerous challenges.
[0003] From the perspective of the complexity of influencing factors, wind speed is affected by a combination of various environmental and spatiotemporal factors. For example, changes in atmospheric pressure create pressure gradient forces, directly driving airflow and thus affecting wind speed; temperature differences lead to changes in air density, triggering thermal circulation, which in turn affects wind speed; humidity levels may indirectly affect wind speed by altering the physical properties of the atmosphere; geographical location information (such as latitude and longitude, topography, etc.) determines the underlying surface conditions of different regions, with significant differences in wind speed characteristics between mountainous areas, plains, and coastal areas; in time series information, the different atmospheric circulation patterns and stability levels in different seasons and diurnal periods cause wind speed to exhibit obvious periodic and fluctuating changes. Traditional methods often struggle to comprehensively and accurately capture the complex relationships and dynamic changes among these multiple factors.
[0004] In terms of model building, traditional statistical models (such as ARIMA and ARMA) are mainly based on linear assumptions, making it difficult to effectively handle the nonlinear characteristics and complex spatiotemporal dependencies in wind speed data. Although some machine learning models (such as random forests and support vector machines) have improved nonlinear fitting capabilities to some extent, they still have shortcomings in feature extraction and global dependency modeling for long-term data. Especially when facing spatiotemporal data from multiple monitoring points in a large-scale monitoring network, traditional models struggle to efficiently fuse spatial and temporal features, resulting in limited prediction accuracy.
[0005] Furthermore, the impact of environmental disturbances (such as cloud cover) on wind speed cannot be ignored. Changes in cloud cover can indirectly affect wind speed by influencing the distribution of solar radiation and altering the atmospheric thermal structure. Traditional wind speed forecasting methods typically do not adequately consider this dynamic environmental disturbance, leading to significant deviations in forecasts under complex meteorological conditions.
[0006] With the development of meteorological observation technology and the widespread adoption of sensor networks, massive amounts of high spatiotemporal resolution monitoring data can be acquired. This places higher demands on the data processing capabilities and computational efficiency of wind speed prediction models. Traditional models often face problems such as high computational complexity and long training times when processing large-scale data, making it difficult to meet the real-time and high-precision prediction requirements. Summary of the Invention
[0007] The purpose of this invention is to provide a wind speed prediction method and apparatus based on the Transformer model to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides the following technical solution: a wind speed prediction method based on the Transformer model, the method comprising:
[0009] For any one of several monitoring points in the target area, the influence of atmospheric pressure, temperature, humidity, geographical location information and time series information on the wind speed of the monitoring point is collected respectively. Based on the obtained influence levels, the first influence factor, the second influence factor, the third influence factor, the fourth influence factor and the fifth influence factor are calculated to form a set of characteristic factors.
[0010] A wind speed prediction model is constructed. For any monitoring point, at any prediction time point, the historical wind speed data of the K preset time windows preceding the monitoring point are arranged in chronological order to form wind speed time series data. The predicted atmospheric pressure, predicted temperature, predicted humidity, and time code information for the next time window are obtained, and the current geographical location identifier is also obtained. The wind speed time series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographical location identifier, time code information, and feature factor set collected at the current prediction time point are input into the wind speed prediction model, and the predicted wind speed value of the monitoring point in the next time window is output.
[0011] An environmental disturbance correction model is constructed. For any monitoring point, real-time cloud cover data is obtained at any prediction time point. The cloud cover data, predicted atmospheric pressure, and predicted temperature at the current prediction time point are input into the environmental disturbance correction model, and the environmental disturbance correction coefficient for the monitoring point in the next time window is output.
[0012] For any given monitoring point, based on the predicted wind speed value obtained at the current prediction time and the environmental disturbance correction coefficient, the final predicted wind speed value for that monitoring point in the next time window is calculated.
[0013] By integrating the final wind speed forecasts from all monitoring points, a regional wind speed forecast distribution map is generated.
[0014] Preferably, the degree of influence of the collected atmospheric pressure, temperature, humidity, geographical location information, and time series information on the wind speed at the monitoring point specifically includes:
[0015] For any given monitoring point, wind speed data for each time window within a historical period is acquired, along with average atmospheric pressure, average temperature, average humidity, geographic location code, and time code information for each time window. The geographic location code is divided into several levels based on the latitude and longitude of the monitoring point, with each level corresponding to a unique code. The time code information includes seasonal identifiers and day / night segments. Seasonal identifiers are divided into four categories according to meteorological standards, and day / night segments are divided into daytime and nighttime based on natural light conditions.
[0016] The time series information for each time window includes the wind speed fluctuation values of the monitoring point at m consecutive moments within that time window; the m moments of each time window are sequentially encoded as 1 to m, and the moment with the highest frequency of wind speed fluctuation peaks in the historical period is encoded.
[0017] The influence of atmospheric pressure, temperature, humidity, geographical location information, and time series information on the wind speed at the current monitoring point were calculated respectively. The influence of the first four items was obtained through covariance correlation analysis between historical data and wind speed, and the influence of time series information was calculated by the distribution density of peak time encoding.
[0018] Preferably, the set of characteristic factors is calculated as follows: based on the degree of influence of atmospheric pressure, temperature, humidity, geographical location information and time series information, the first to fifth influence factors are obtained by normalized weighted summation.
[0019] Preferably, the wind speed prediction model is built on the Transformer architecture, including an input embedding layer, a position encoding layer, an encoder stacking layer, a multi-head attention layer, a feedforward network layer, and an output decoding layer;
[0020] The input embedding layer is used to convert wind speed time series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographic location identifiers, time-coded information, and feature factor sets into high-dimensional vectors;
[0021] The location coding layer is used to generate location codes for each time window in the wind speed time series data to preserve the temporal relationships;
[0022] The encoder stack layer contains N encoder modules connected in series. Each encoder module sequentially performs multi-head self-attention calculation and feedforward network transformation to extract a fusion representation of temporal and spatial features.
[0023] The multi-head attention layer is used to perform cross-attention calculation on the feature factor set and the features output by the encoder to generate dynamic weight allocation results;
[0024] The feedforward network layer is used to further fuse the dynamic weight allocation results with the encoder output to generate an intermediate feature vector;
[0025] The output decoding layer is used to map the intermediate feature vectors to the predicted wind speed values for the next time window.
[0026] Preferably, the training process of the wind speed prediction model includes:
[0027] Historical datasets from multiple monitoring points were collected. Each data sample contained wind speed data for K+1 consecutive time windows, influencing factor data for the K+1th time window, and a set of feature factors. The dataset was then divided into a training set and a validation set.
[0028] The model parameters are optimized by backpropagation using the data and influencing factors of the first K time windows in the training set as input and the wind speed data of the (K+1)th time window as the target output.
[0029] The model prediction error is evaluated using a validation set. If the error does not reach the convergence threshold, the model is retrained after adjusting the number of layers or attention heads.
[0030] Preferably, the environmental interference correction model is constructed based on a convolutional neural network, including a feature extraction branch and a regression branch;
[0031] The feature extraction branch extracts spatial distribution features from cloud cover data through multi-layer convolution operations;
[0032] The regression branch concatenates the spatial distribution characteristics with the predicted atmospheric pressure and temperature, and outputs the environmental disturbance correction coefficient after calculation by the fully connected layer.
[0033] Preferably, the formula for calculating the final wind speed prediction value is as follows: the predicted wind speed value is superimposed with the environmental interference correction coefficient according to a preset rule, and linear calibration is performed in combination with the altitude of the monitoring point.
[0034] Preferably, the method for generating the regional wind speed prediction distribution map is as follows: spatial interpolation calculation is performed on the final wind speed prediction values of all monitoring points, and the data is combined with geographic information system data to render a visual grid map.
[0035] Preferably, the model training process further includes a dynamic optimization step:
[0036] Based on the changing trend of the validation set error, the number of encoder stack layers or the number of attention heads are automatically adjusted; if the error continues to decrease, the current model parameters are frozen and the training cycle is shortened; if the error fluctuation exceeds the preset threshold, the number of encoder layers is increased or a residual connection structure is introduced and then retrained.
[0037] Preferably, the present invention further includes a wind speed prediction device based on a Transformer model, used to implement a wind speed prediction method based on a Transformer model as described in any one of the above claims, comprising the following modules:
[0038] The feature factor calculation module is used to collect information on the influence of atmospheric pressure, temperature, humidity, geographical location and time series information on wind speed for each monitoring point in the target area, and generate a feature factor set containing the first to fifth influencing factors through a weighted fusion algorithm.
[0039] The time series processing module is equipped with a sliding time window unit, which is used to arrange the historical wind speed data of each monitoring point in time series according to a preset time granularity, forming wind speed time series data containing K time steps.
[0040] The meteorological forecast input module integrates a numerical weather prediction interface to obtain the predicted atmospheric pressure, predicted temperature, and predicted humidity parameters of the target area within the prediction time window.
[0041] The spatial coding module, with a built-in geographic information system unit, is used to convert the latitude and longitude coordinates of monitoring points into high-dimensional geographic location identifier vectors.
[0042] The environmental interference correction module connects to the meteorological satellite remote sensing data source and is equipped with a convolutional neural network unit to process real-time cloud coverage images and generate environmental interference correction coefficients.
[0043] The core module for wind speed prediction adopts an improved Transformer architecture, which includes a multi-head attention mechanism and a time-location encoding layer. It is used to receive the wind speed time series data, predicted meteorological parameters, geographic location identifiers, time-encoded information and feature factor set, and output a preliminary wind speed prediction value.
[0044] The fusion output module is equipped with a weighted fusion algorithm unit, which dynamically weights the preliminary wind speed prediction value with the environmental interference correction coefficient to generate the final wind speed prediction value, and generates a regional wind speed prediction distribution map through a geospatial interpolation algorithm.
[0045] Compared with the prior art, the beneficial effects of the present invention are:
[0046] In feature processing, a feature factor set containing the first to fifth influencing factors was constructed by collecting information on the impact of atmospheric pressure, temperature, humidity, geographic location, and time series data on wind speed. This process not only considers the covariance correlation between each factor and wind speed, but also calculates the influence of time series information through the distribution density of peak time encoding, achieving in-depth mining of multi-source heterogeneous data. For example, geographic location encoding is divided into levels according to latitude and longitude and assigned a unique code, and time encoding information is subdivided into seasonal identifiers and day-night segments, enabling the model to accurately capture the influence patterns of various factors on wind speed at different spatiotemporal scales, providing rich feature inputs for subsequent predictions.
[0047] The wind speed prediction model is built on the Transformer architecture. Its unique multi-head attention mechanism and positional encoding layer effectively capture global dependencies in long-term time-series data, preserving temporal features while achieving a fusion representation of spatiotemporal features. The input embedding layer converts multi-dimensional features into high-dimensional vectors. The encoder stacking layer, through the concatenation of N encoder modules, sequentially performs multi-head self-attention calculations and feedforward network transformations, extracting deeper feature representations layer by layer. The multi-head attention layer performs cross-attention calculations on the feature factor set and the encoder output features, generating dynamic weight allocation results, enabling the model to adaptively adjust according to the importance of different features. The feedforward network layer further integrates the dynamic weights with the encoder output, and finally, the output decoding layer maps them to the predicted wind speed value. This architectural design enables the model to overcome the problem of insufficient long-distance dependency modeling ability of traditional models when processing long-series wind speed data, thus improving the accuracy of predictions.
[0048] A dynamic optimization mechanism is introduced during model training, automatically adjusting the number of encoder layers or attention heads based on the changing trend of the validation set error. If the error decreases continuously, the parameters are frozen and the training cycle is shortened to avoid overtraining; if the error fluctuation exceeds a threshold, the number of encoder layers is increased or a residual connection structure is introduced before retraining, ensuring that the model maintains good generalization ability under different data distributions. This dynamic optimization strategy improves the efficiency and stability of model training, enabling it to better adapt to the wind speed prediction needs of different regions and time periods.
[0049] The environmental disturbance correction model is built on a convolutional neural network. It extracts spatial distribution features from cloud cover data through a feature extraction branch, then concatenates these features with predicted atmospheric pressure and temperature in a regression branch and performs fully connected computation to output environmental disturbance correction coefficients. This mechanism fully considers the indirect impact of dynamic environmental factors such as cloud cover on wind speed. For example, clouds affect wind speed by influencing solar radiation and altering the atmospheric thermal structure. By correcting the prediction results using real-time cloud cover data, the model's robustness under complex meteorological conditions is effectively improved, and prediction bias caused by environmental disturbances is reduced.
[0050] In the calculation of the final wind speed prediction, the predicted wind speed value is superimposed with an environmental disturbance correction coefficient according to a preset rule, and linear calibration is performed in conjunction with the altitude of the monitoring points. Atmospheric density and wind conditions vary at different altitudes; this calibration step further improves the spatial adaptability and accuracy of the prediction results. Finally, spatial interpolation calculations are performed on the final wind speed prediction values for all monitoring points, and the data is rendered into a visual grid map using geographic information system data. This provides users with an intuitive and clear regional wind speed prediction distribution, facilitating decision-making and analysis in practical applications. Attached Figure Description
[0051] Figure 1 This is a schematic diagram illustrating the working principle of the wind speed prediction method and device based on the Transformer model described in this invention.
[0052] Figure 2 This is a diagram illustrating the working principle of a wind speed prediction model (Transformer architecture).
[0053] Figure 3 A flowchart for training and optimizing a wind speed prediction model;
[0054] Figure 4 This is a schematic diagram illustrating the working principle of the environmental disturbance correction model (convolutional neural network). Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] Please see Figures 1-4 The present invention relates to a wind speed prediction method based on the Transformer model, the specific implementation steps of which are as follows:
[0057] Step 1: For any one of several monitoring points within the target area, collect data on the impact of atmospheric pressure, temperature, humidity, geographical location, and time series information on the wind speed at that monitoring point. The specific operations are as follows: Obtain wind speed data for each time window of the monitoring point within the historical period, and simultaneously collect the average atmospheric pressure, average temperature, average humidity, geographical location code, and time code information for each time window. The geographical location code is divided into several levels based on the latitude and longitude of the monitoring point, with each level corresponding to a unique code. The time code information includes seasonal identifiers and day / night segments. Seasonal identifiers are divided into four categories according to meteorological standards, and day / night segments are divided into daytime and nighttime based on natural light conditions. The time series information for each time window includes the wind speed fluctuation values of the monitoring point at m consecutive moments within that time window. Encode the m moments of each time window sequentially as 1 to m, and statistically analyze the code of the moment with the highest frequency of wind speed fluctuation peaks within the historical period. The influence of atmospheric pressure, temperature, humidity, geographical location information, and time series information on the wind speed at the current monitoring point were calculated separately. The influence of the first four factors was obtained through covariance correlation analysis between historical data and wind speed, while the influence of the time series information was calculated through the distribution density of the peak time encoding. Based on the above influence levels, the first, second, third, fourth, and fifth influence factors were obtained by normalized weighted summation, forming a set of characteristic factors.
[0058] Step 2: Construct a wind speed prediction model based on the Transformer architecture. This model includes an input embedding layer, a location encoding layer, an encoder stacking layer, a multi-head attention layer, a feedforward network layer, and an output decoding layer. For any monitoring point, at any prediction time point, the historical wind speed data of the K preset time windows preceding that monitoring point are arranged in chronological order to form wind speed time series data. The predicted atmospheric pressure, predicted temperature, predicted humidity, and time encoding information for the next time window are then obtained, along with the current geographic location identifier. The input embedding layer converts wind speed time-series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographic location identifiers, time-coded information, and feature factor sets into high-dimensional vectors. The location coding layer generates location codes for each time window in the wind speed time-series data to preserve temporal relationships. The encoder stacking layer contains N cascaded encoder modules, each of which sequentially performs multi-head self-attention calculation and feedforward network transformation to extract a fused representation of temporal and spatial features. The multi-head attention layer performs cross-attention calculation on the feature factor set and the features output by the encoder to generate dynamic weight allocation results. The feedforward network layer further fuses the dynamic weight allocation results with the encoder output to generate intermediate feature vectors. The output decoding layer maps the intermediate feature vectors to the predicted wind speed values for the next time window.
[0059] Step 3: Construct an environmental interference correction model based on a convolutional neural network. This model includes a feature extraction branch and a regression branch. For any monitoring point, real-time cloud cover data is acquired at any prediction time point. The feature extraction branch extracts spatial distribution features from the cloud cover data through multi-layer convolution operations; the regression branch concatenates the spatial distribution features with the predicted atmospheric pressure and predicted temperature, and outputs the environmental interference correction coefficient for the monitoring point in the next time window after calculation by a fully connected layer.
[0060] Step 4: For any monitoring point, based on the predicted wind speed value obtained at the current prediction time point and the environmental interference correction coefficient, the two are superimposed according to preset rules, and linear calibration is performed in combination with the altitude of the monitoring point to calculate the final predicted wind speed value of the monitoring point in the next time window.
[0061] Step 5: Integrate the final wind speed prediction values from all monitoring points, perform spatial interpolation calculations, and combine them with geographic information system data to render a visual grid map, generating a regional wind speed prediction distribution map.
[0062] The technical solution of the present invention will be further described in detail below with reference to specific embodiments.
[0063] Example 1:
[0064] This embodiment details the process of constructing the feature factor set. For any monitoring point within the target area, the system needs to collect information on the influence of atmospheric pressure, temperature, humidity, geographical location, and time series data on wind speed, and generate a feature factor set through specific calculations.
[0065] In the data acquisition phase, the historical period range is first determined. This range can be set based on the temporal characteristics of wind speed data and forecasting needs. For example, a time period encompassing multiple complete seasonal cycles (such as the past two years) can be selected as the historical period. For each time window, wind speed data and corresponding environmental parameters and time information for that monitoring point must be acquired synchronously. The average atmospheric pressure, average temperature, and average humidity are calculated statistically from the real-time monitoring data within that time window. For example, data is collected every 10 minutes, and the arithmetic mean of all data within the window is taken as the environmental parameter value for that window.
[0066] The geographic location coding is based on the latitude and longitude coordinates of the monitoring points. Specifically, the longitude range of the target area is divided into P intervals from minimum to maximum, and the latitude range is divided into Q intervals from minimum to maximum, forming a P×Q grid matrix. Each grid corresponds to a unique geographic location code. For example, longitude intervals from east to west are coded as 1 to P, and latitude intervals from south to north are coded as 1 to Q. The code for the grid where a monitoring point is located can be represented as (p, q), where... This encoding method can transform geospatial locations into discrete numerical features that the model can process.
[0067] The time-coded information includes two parts: seasonal identifiers and day-night segments. The seasonal identifiers are divided according to meteorological standards: March to May is spring, June to August is summer, September to November is autumn, and December to February is winter, represented by the numbers 1, 2, 3, and 4, respectively. The day-night segments are determined based on the sunrise and sunset times of the monitoring point's location. For example, 6:00 to 18:00 local time is considered daytime (coded as 1), and 18:00 to 6:00 the next day is considered nighttime (coded as 0). This division method can reflect the potential impact of solar radiation intensity on wind speed at different times.
[0068] The processing of time series information focuses on wind speed fluctuations over m consecutive moments within each time window. The value of m is determined by considering the data acquisition frequency and the time scale of wind speed changes. For example, when the time window is 1 hour and the acquisition frequency is once per minute, m = 60, and each moment is sequentially coded from 1 to 60. By traversing all time windows within the historical period, the frequency of peak wind speed fluctuations corresponding to each moment's code is counted. The peak value criterion can be set as: the wind speed value at a certain moment is greater than 20% of the wind speed values at the adjacent moments (the specific threshold can be adjusted according to data characteristics). After the statistics are completed, the code for the moment with the highest frequency is determined. This code reflects the temporal regularity of wind speed fluctuations at that monitoring point. For example, if the peak value at moment 30 occurs most frequently, it indicates that the monitoring point is more likely to experience sudden wind speed changes in the middle of each time window.
[0069] In the influence calculation phase, the influence of atmospheric pressure, temperature, humidity, and geographic location information is obtained through covariance correlation analysis. Taking atmospheric pressure as an example, the covariance between the average atmospheric pressure and the corresponding wind speed value for each time window within the historical period is calculated. The larger the absolute value of the covariance, the stronger the linear correlation between the two, meaning that atmospheric pressure has a higher influence on wind speed. Similarly, the covariances of temperature, humidity, and geographic location codes with wind speed are processed. The geographic location code, as a discrete variable, can be converted into multiple binary features through one-hot encoding, and the covariance of each feature is calculated separately. The sum of the absolute values of the covariances of each feature is taken as the comprehensive influence of geographic location information.
[0070] The impact of time series information is calculated using the distribution density of peak moment codes. Specifically, the distribution of peak moment codes within historical periods is statistically analyzed, and the frequency of occurrence of each code across all time windows is calculated. A higher frequency indicates a greater distribution density, signifying a more significant impact of the time series information on wind speed. For example, if peak moment code 30 at a monitoring point appears 300 times in 1000 time windows, its distribution density is 0.3, which can be directly used as an indicator of the impact of the time series information.
[0071] After obtaining the influence levels of each factor, the first to fifth influence factors are generated through normalized weighted summation. The normalization process uses a min-max standardization method to map the influence levels of each factor to the [0,1] interval, as shown in the formula: Where x represents the original degree of influence, x min and x max These represent the historical minimum and maximum values of the influence of each factor. During weighted summation, a weight is assigned to each factor (the sum of the weights is 1). Weight settings can be based on domain knowledge or data-driven optimization methods, such as automatically learning the importance weights of each factor through model training. The resulting five influencing factors form a feature factor set, which comprehensively reflects the quantitative impact of each factor on wind speed and can serve as one of the input features for the wind speed prediction model.
[0072] Example 2:
[0073] This embodiment details the construction and training process of the wind speed prediction model. Based on the Transformer architecture, the model uses a multi-layered structure to fuse wind speed time-series data and multi-dimensional environmental features, specifically including the following steps:
[0074] The wind speed prediction model consists of an input embedding layer, a location encoding layer, an encoder stack layer, a multi-head attention layer, a feedforward network layer, and an output decoding layer. The input embedding layer transforms different types of input data into vector representations of a uniform dimension. For time-series wind speed data, the wind speed value for each time window is mapped to a high-dimensional vector using an embedding matrix. Scalar parameters such as predicted atmospheric pressure, predicted temperature, and predicted humidity are first converted to one-dimensional vectors, and then their dimensionality is increased through embedding operations. Geographic location identifiers and time-encoded information are treated as discrete features, encoded using one-hot encoding, and then concatenated with the embedding vectors. All embedding vectors must maintain a consistent dimension for subsequent processing.
[0075] The location encoding layer is used to inject temporal sequence information into wind speed time-series data. Since the Transformer model itself lacks time-series awareness, location encoding is necessary to generate encoded vectors with the same dimension as the embedded vectors. The location encoding can be generated using sine and cosine functions. Different frequencies of sine and cosine signals correspond to different time windows, ensuring that the encoded vectors of adjacent time windows have similar spatial distances, thus preserving temporal relationships. For example, in the location encoding vector of each time window, odd-numbered dimensions use sine functions, and even-numbered dimensions use cosine functions. The frequency of the functions is adjusted according to the dimension, ensuring that the encoding at different locations has a unique and continuous representation.
[0076] The encoder stack layer contains N cascaded encoder modules, each consisting of a multi-head self-attention sublayer and a feedforward neural network sublayer. The multi-head self-attention mechanism divides the input into multiple heads (e.g., 8 heads), with each head independently calculating self-attention to capture feature correlations across different subspaces. During self-attention computation, the embedding vector and positional encoding vector for each time window are added together and used as input. A linear transformation of the query, key, and value matrices is applied to calculate the attention weights between time windows, reflecting the correlation between the current window and other windows. The weighted sum yields the self-attention output. The feedforward neural network sublayer performs a non-linear transformation on the self-attention output, typically containing two fully connected layers. The first layer uses the ReLU activation function, while the second layer remains linear, further extracting non-linear relationships between features. Stacking multiple encoder modules progressively increases the complexity of feature extraction, enabling multi-level fusion of temporal and spatial features.
[0077] The multi-head attention layer is used to compute the cross-attention between the feature factor set and the encoder output features. The feature factor set serves as the query vector, and the encoder output feature vector serves as the key and value vectors. Attention weights are generated by calculating the similarity between the query and the key. These weights are then used to perform a weighted summation of the value vectors, generating a dynamic weight allocation result. This mechanism allows the model to dynamically adjust its focus on the encoder output features based on the influence of each factor in the feature factor set. For example, if the temperature influence factor is high, the model will increase its attention to temperature-related features.
[0078] The feedforward network layer fuses the dynamic weight allocation result with the encoder output. The two are combined by element-wise addition or concatenation and then input into the feedforward neural network. After linear transformation and activation function processing by the fully connected layer, an intermediate feature vector is generated. This vector integrates composite features influenced by temporal, spatial, and other factors.
[0079] The output decoding layer maps the intermediate feature vectors to predicted wind speed values. A fully connected layer reduces the dimension of the intermediate feature vectors to 1, and a linear activation function (such as the identity function) is used to output continuous numerical values, i.e., the predicted wind speed values for the next time window.
[0080] Before model training, a historical dataset needs to be prepared. Data collection covers multiple monitoring points, and each data sample contains wind speed data for K+1 consecutive time windows, influencing factor data for the K+1th time window (such as atmospheric pressure, temperature, humidity, etc.), and a set of feature factors. For example, when K is 24, each sample contains historical wind speed data and corresponding influencing factors for the first 24 time windows, as well as the true wind speed value and influencing factors for the 25th time window. The dataset is divided into a training set (approximately 70%) and a validation set (approximately 30%). The training set is used for model parameter optimization, and the validation set is used to evaluate generalization ability.
[0081] The training process employs supervised learning, using data from the first K time windows and influencing factors in the training set as input, and wind speed data from the (K+1)th time window as the target output. After initializing the model parameters, the predicted wind speed value is calculated through forward propagation. The difference between the predicted and true values is calculated using a loss function (such as mean squared error). Then, the model parameters (such as embedding matrix, attention matrix, and fully connected layer weights) are updated through backpropagation. During backpropagation, a gradient descent optimizer (such as the Adam optimizer) is used to iteratively adjust the parameters to minimize the loss function.
[0082] Validation set evaluation is performed periodically during training, calculating the loss value and other evaluation metrics (such as mean absolute error) on the validation set. If the evaluation results show that the error has not reached the preset convergence threshold (e.g., mean squared error less than 0.5 m / s), the evaluation is terminated. 2 If the error is detected, model structure adjustments are triggered. Adjustments can include increasing the number of encoder stack layers (e.g., from 3 to 4), changing the number of attention heads (e.g., from 8 to 12), or adjusting the number of neurons in the feedforward network layers to enhance the model's expressive power. After adjustments, parameters are reinitialized or training continues based on the current parameters until the error converges or the maximum number of training epochs is reached.
[0083] Early stopping can be employed during training. If the validation set error does not decrease significantly over multiple consecutive rounds (e.g., 10 rounds), training should be stopped to avoid overfitting. Simultaneously, regularization (e.g., L2 regularization) can be applied to the model parameters to suppress excessive expansion of the weight matrix and improve the model's generalization ability.
[0084] During the forecasting phase, for any monitoring point and forecast time point, the input data needs to be prepared according to the following steps:
[0085] Wind speed time series data: Collect historical wind speed data for the K preset time windows before this monitoring point, and arrange them in chronological order to form a sequence. For example, when K=12, use the hourly wind speed data of the previous 12 hours.
[0086] Predicted meteorological parameters: Obtain the predicted atmospheric pressure, predicted temperature, and predicted humidity for the next time window through the numerical weather prediction interface, such as predicting meteorological parameters for the next hour.
[0087] Time coding information: Generate seasonal identifiers and day-night segment codes based on the predicted time point. For example, if the predicted time is 14:00 on July 15, 2025, the seasonal identifier is summer (code 2) and the day-night segment is daytime (code 1).
[0088] Geographic location identification: The latitude and longitude of the monitoring points are converted into high-dimensional vectors through geographic information system units, for example, by using a pre-trained embedding model to map the coordinates into a 128-dimensional vector.
[0089] Feature factor set: The first to fifth influencing factors generated by the feature factor calculation module reflect the historical influence of each factor on the wind speed at the monitoring point.
[0090] After the above data is input into the model, it is processed through each layer in sequence, and finally the predicted wind speed value is output by the output decoding layer. The entire model effectively captures the long-term temporal dependence and multi-factor correlation of wind speed data through the self-attention mechanism and multi-layer feature fusion of the Transformer architecture, providing an efficient solution for wind speed prediction.
[0091] Example 3:
[0092] This embodiment details the construction of the environmental disturbance correction model and the process of obtaining the environmental disturbance correction coefficients. The model is based on a convolutional neural network (CNN) and aims to generate environmental disturbance correction coefficients for correcting wind speed forecasts by processing real-time cloud cover data and combining it with meteorological parameters. The specific implementation steps are as follows:
[0093] The environmental disturbance correction model consists of two parts: a feature extraction branch and a regression branch. The feature extraction branch employs a multi-layer convolutional neural network structure to extract spatial distribution features from cloud cover images. The input cloud cover data is a two-dimensional image, such as a grayscale image with a resolution of 256×256 pixels, where the pixel value represents the percentage of cloud cover in the corresponding area (0% indicates no clouds, and 100% indicates complete coverage).
[0094] The first layer of the feature extraction branch is typically a convolutional layer, using multiple 3×3 or 5×5 convolutional kernels. For example, the initial layer might use 64 3×3 kernels with a stride of 1 and padding of 1 to maintain the feature map size. Following the convolutional operation, a batch normalization layer and a ReLU activation function are applied. Batch normalization accelerates training and mitigates gradient vanishing, while the ReLU activation function introduces non-linearity. Subsequent layers gradually increase the number of convolutional kernels (e.g., 128, 256), and pooling layers (e.g., max pooling with a 2×2 kernel and a stride of 2) reduce the feature map resolution and expand the receptive field. For instance, after three convolutional layers and two pooling operations, the feature map size decreases from 256×256 to 64×64, while the number of channels increases from 1 to 256, forming a high-level representation containing rich spatial features.
[0095] The regression branch combines the spatial features output from the feature extraction branch with the predicted meteorological parameters (atmospheric pressure, temperature) to generate environmental disturbance correction coefficients. The final output of the feature extraction branch is a three-dimensional tensor (e.g., 64×64×256), which needs to be compressed into a one-dimensional feature vector (length 256) through a global average pooling layer to reduce computation and retain global spatial information. Then, this vector is concatenated with the two scalar parameters, predicted atmospheric pressure and predicted temperature, to form an input vector containing 258 elements. The concatenated vector is then processed through multiple fully connected layers, for example, first through a fully connected layer with 512 neurons (using the ReLU activation function), then through a fully connected layer with 128 neurons (using a linear activation function), and finally through a single-neuron fully connected layer to output the environmental disturbance correction coefficients. These coefficients are continuous values, which can be positive or negative, and are used to adjust the predicted wind speed.
[0096] Real-time cloud cover data is acquired by connecting to meteorological satellite remote sensing data sources, such as cloud image data from geostationary meteorological satellites (e.g., Fengyun-4). The data update frequency is every 10 minutes to 1 hour, depending on the satellite's observation mode. The cloud image data undergoes preprocessing steps, including geometric correction (eliminating image distortion caused by satellite observation perspective), radiometric calibration (converting pixel values to actual cloud cover percentages), and noise removal (using median filtering or Gaussian filtering). The preprocessed cloud cover image serves as the input data for the model.
[0097] The predicted atmospheric pressure and temperature parameters are obtained from numerical weather prediction systems, such as hourly forecasts obtained through the meteorological forecast input module. These two parameters need to be normalized to match their numerical range with the scale of the feature vector output by the feature extraction branch. For example, the atmospheric pressure (unit: hPa) and temperature (unit: ℃) can be mapped to the [0,1] interval through min-max normalization.
[0098] The model training employs supervised learning. The training dataset includes historical cloud cover images, corresponding predicted atmospheric pressure, predicted temperature, and the difference between actual wind speed and baseline wind speed predictions (i.e., wind speed corrections caused by environmental disturbances). Baseline wind speed predictions can be generated using a wind speed prediction model without introducing environmental disturbance corrections. The difference between the actual wind speed and the baseline prediction is the true value of the required environmental disturbance correction coefficient.
[0099] The training process is as follows:
[0100] ① Data preparation: Collect cloud cover images, predicted atmospheric pressure, predicted temperature, and the true values of the corresponding environmental disturbance correction coefficients for the same monitoring point at multiple historical times. For example, select 12 times per day (one time every 2 hours) for a certain monitoring point over the past year, for a total of 4380 samples.
[0101] ② Data partitioning: Divide the dataset into a training set (approximately 3500 samples) and a validation set (approximately 880 samples) to ensure that the samples are evenly distributed in both sets.
[0102] ③ Model initialization: The weights and biases of the convolutional neural network are randomly initialized. The weights of the fully connected layers are initialized using the Xavier method to keep the variance of the activation values of each layer stable.
[0103] ④ Forward propagation: The cloud cover image is input into the feature extraction branch, and spatial feature vectors are generated through convolution and pooling operations. These vectors are then concatenated with the normalized predicted atmospheric pressure and predicted temperature and input into the regression branch to calculate the predicted value of the environmental interference correction coefficient.
[0104] ⑤ Loss Calculation: The difference between the predicted value and the true value is calculated using the mean squared error loss function. The formula is as follows:
[0105]
[0106] Where y i It is true. These are predicted values.
[0107] ⑥ Backpropagation: The model parameters are updated through the backpropagation algorithm. The optimizer can be Adam or SGD. The learning rate is initialized to 0.001 and a learning rate decay strategy (such as decaying by 5% every 10 rounds) is adopted to avoid premature convergence.
[0108] ⑦ Validation and Evaluation: After each training epoch, calculate the loss and mean absolute error using the validation set to observe the model's generalization ability. If the validation set loss increases over five consecutive epochs, trigger the early stopping mechanism to stop training and roll back to the optimal parameters.
[0109] IV. Application in the Prediction Phase
[0110] At the predicted time point, the environmental disturbance correction module performs the following operations:
[0111] Real-time data acquisition: Obtain the latest cloud coverage image of the target area through the meteorological satellite remote sensing interface. The resolution must be consistent with that during training (e.g., 256×256 pixels), and complete the preprocessing steps.
[0112] Parameter input: Obtain the predicted atmospheric pressure and predicted temperature values at the same prediction time point from the meteorological prediction input module and perform normalization processing.
[0113] Feature extraction and regression: The preprocessed cloud cover image is input into the feature extraction branch, and spatial feature vectors are generated through convolution and pooling operations; this vector is concatenated with normalized meteorological parameters and input into the regression branch to calculate the environmental interference correction coefficient.
[0114] Output results: The correction coefficients are directly output to the fusion output module to adjust the initial prediction values generated by the wind speed prediction model.
[0115] For example, if at a certain moment the cloud cover image shows strong convective clouds in the middle of the target area (pixel values generally higher than 80%), the predicted atmospheric pressure is 1005 hPa (normalized to 0.6), and the predicted temperature is 28℃ (normalized to 0.8), the model may output a correction coefficient of +0.5, indicating that environmental interference causes the wind speed prediction value to increase by 0.5 m / s; if the cloud cover is low (pixel values lower than 20%) and the weather is clear, the model may output a correction coefficient of -0.2, indicating that environmental factors have a smaller suppressive effect on wind speed.
[0116] Example 4:
[0117] This embodiment details the calculation process of the final wind speed prediction value and the generation method of the regional wind speed prediction distribution map. After completing the preliminary prediction of the wind speed prediction model and the coefficient calculation of the environmental disturbance correction model, the final prediction result needs to be obtained through fusion processing and then visualized.
[0118] The final wind speed prediction needs to comprehensively consider the preliminary results output by the wind speed prediction model, the environmental interference correction coefficient, and the altitude of the monitoring point. The specific process is as follows:
[0119] First, the predicted wind speed value output by the wind speed prediction model is obtained. This value is a preliminary result calculated based on historical wind speed time series data, meteorological parameters, geographical location, and a set of characteristic factors, reflecting the wind speed trend under normal environmental conditions. For example, the predicted wind speed value at a certain monitoring point may be 5.2 m / s, indicating that the predicted wind speed for the next time window is 5.2 meters per second, without considering real-time environmental interference.
[0120] Obtain the environmental disturbance correction coefficients output from the environmental disturbance correction model. These coefficients are calculated using real-time cloud cover data, predicted atmospheric pressure, and predicted temperature, and are used to correct the initial forecast values to reflect the impact of current weather conditions. The correction coefficients can be positive or negative; for example, +0.8 indicates that environmental factors increase wind speed by 0.8 m / s, and -0.3 indicates that environmental factors decrease wind speed by 0.3 m / s.
[0121] The predicted wind speed value and the environmental disturbance correction coefficient are superimposed according to a preset rule. The preset rule can be determined according to the model design requirements, such as direct addition or weighted summation. For example, if the preset rule is simple addition, the result of superposition is the algebraic sum of the predicted wind speed value and the correction coefficient, such as 5.2m / s + 0.8m / s = 6.0m / s, or 5.2m / s - 0.3m / s = 4.9m / s.
[0122] In addition, linear calibration is required based on the altitude of the monitoring points. Different altitudes affect atmospheric density and terrain conditions, influencing wind speed. Generally, higher altitudes experience less ground friction resistance, potentially leading to different wind speed variation patterns. The specific method for linear calibration is to adjust the superimposed result using a linear transformation function based on the monitoring point's altitude. For example, the wind speed calibration coefficient can be increased or decreased by a certain percentage for every 100-meter increase in altitude; this percentage can be obtained from historical data. Assuming a monitoring point has an altitude of 500 meters and a calibration coefficient of +0.1, the final predicted wind speed value is the product or sum of the superimposed result and the calibration coefficient, depending on the form of the calibration function.
[0123] The entire calculation process integrates multiple factors, combining the trend results predicted by the model with real-time environmental corrections and terrain factors, so that the final wind speed prediction is closer to the actual observation.
[0124] The generation of a regional wind speed forecast distribution map requires integrating the final wind speed forecast values from all monitoring points and visualizing them through spatial interpolation and geographic information rendering. The specific steps are as follows:
[0125] First, collect the final wind speed predictions and corresponding latitude and longitude coordinates of all monitoring points within the target area. Monitoring points may be distributed across different geographical locations, and their density may be uneven; for example, monitoring points may be more densely packed in urban centers and sparser in suburban or mountainous areas. For instance, an area may contain 100 monitoring points, each with coordinates such as (longitude 116.48°, latitude 39.90°) and a corresponding final wind speed prediction of 4.5 m / s.
[0126] Spatial interpolation is performed on discrete monitoring point data to estimate wind speed values at any location within the target area. Spatial interpolation algorithms can include Kriging interpolation, inverse distance weighted interpolation, or spline interpolation. Taking inverse distance weighted interpolation as an example, its basic principle is to assume that the wind speed value at an unknown point is obtained by averaging the values of neighboring monitoring points according to their distance, with closer monitoring points having greater weights. In practice, the target area is divided into a regular grid (e.g., a grid resolution of 1 km × 1 km). For each grid node, several monitoring points (e.g., 10) closest to that node are found, and their weights are calculated based on the reciprocal of their distances. A weighted average is then used to obtain the predicted wind speed value for that grid node.
[0127] After spatial interpolation, the data is rendered using Geographic Information System (GIS) data. GIS data includes geographic features of the target area, such as topography, rivers, roads, and administrative divisions, which can be represented using vector or raster layers. The interpolated wind speed values are overlaid on the geographic feature layers, and a color mapping scheme is used to visualize the wind speed. For example, the wind speed range is set as follows: 0-2 m / s is blue, 2-4 m / s is green, 4-6 m / s is yellow, 6-8 m / s is orange, and above 8 m / s is red. Each grid node is filled with the corresponding color based on its wind speed value, forming a color-gradient grid map.
[0128] During the rendering process, map elements such as legends, scale bars, and compasses can be added to enhance the readability of the distribution map. For example, the legend clearly marks the wind speed ranges corresponding to different colors, the scale bar shows the ratio of the map's actual size to its pixel size, and the compass indicates the map's direction. Important geographical landmarks (such as mountains, lakes, and city names) can be highlighted with text labels, making it easier for users to understand the wind speed distribution characteristics in the context of the geographical environment.
[0129] The final wind speed forecast and regional distribution map can be applied to weather forecasting, energy production (such as power generation forecasting for wind farms), and agricultural production (such as the development of wind protection measures). Output formats include real-time data interfaces (for use by other systems), web-based visualization interfaces, or mobile applications. For example, in wind power scenarios, maintenance personnel can view wind speed distribution maps of the wind farm area via a web interface to quickly locate high-wind-speed areas and adjust wind turbine operating parameters; meteorological departments can use mobile applications to release weather forecast information including wind speed distribution to the public.
[0130] Example 5:
[0131] This embodiment details the dynamic optimization steps during model training and the specific implementation methods of each module of the device. Dynamic optimization aims to improve training efficiency and prediction accuracy by adaptively adjusting the model structure or parameters, while the device modules automate the execution of the process through the collaborative design of hardware and software.
[0132] I. Dynamic Optimization Steps for Model Training
[0133] During model training, the dynamic optimization mechanism automatically adjusts the model structure or training strategy by monitoring the changing trend of the validation set error. This includes the following steps:
[0134] ① Error Trend Monitoring: After each training round, calculate the loss value (such as mean squared error) and other evaluation metrics using the validation set, and record their changing trends. For example, continuously record the validation set loss value for 10 rounds and observe whether it continues to decrease, fluctuates, or increases.
[0135] ②Structural adjustment triggering conditions:
[0136] If the validation set error decreases continuously and tends to stabilize (e.g., the decrease is less than a preset threshold for 5 consecutive rounds, such as 0.01 m / s), then... 2 This indicates that the current model structure and parameter settings are effective. At this point, the parameter freeze mechanism is triggered, the model weights are stopped from being updated, and the subsequent training cycles are shortened (e.g., the remaining rounds are reduced by 50%) to avoid overtraining and waste of computing resources.
[0137] If the validation set error fluctuation exceeds a preset threshold (e.g., the fluctuation amplitude exceeds 15% of the current error value for three consecutive rounds), or does not decrease significantly within a certain number of rounds (e.g., 20 rounds), it indicates that the model may be trapped in a local optimum or has underfitting / overfitting problems, and structural adjustment needs to be triggered.
[0138] ③Structural adjustment methods:
[0139] Increase encoder layers: If the model complexity is deemed insufficient (e.g., the training set loss is still high and the difference between the validation set loss and the training set loss is small), the number of encoder stack layers is automatically increased from N to N+1. The parameter initialization method for the newly added layers is the same as that for the original layers. For example, if the original model contains 3 encoder layers, it is adjusted to 4 layers to enhance the depth of feature extraction.
[0140] Introducing residual connections: Residual connections are added to the encoder module, that is, skip connections are added between the multi-head self-attention sub-layer and the feedforward neural network sub-layer, directly adding the input to the output. Residual connections can alleviate the vanishing gradient problem in deep networks, enabling the model to be trained on deeper structures. For example, for each encoder module, the input vector is added to the output vector of the feedforward neural network and then normalized to form a residual block structure.
[0141] Adjust the number of attention heads: Increase the number of heads in the multi-head attention layer (e.g., from 8 to 12 heads) to expand the coverage of the feature space and capture richer feature associations. After adjustment, the query, key, and value matrix parameters of each head need to be reinitialized.
[0142] ④ Retraining and Evaluation: After the structural adjustment is completed, the model continues to train based on the current optimal parameters, or it is re-initialized and trained (depending on the adjustment magnitude). After each adjustment, the error needs to be re-evaluated on the validation set until the convergence condition is met or the maximum training epoch limit is reached.
[0143] II. Module Design and Functional Implementation of Wind Speed Prediction Device
[0144] This module is responsible for collecting multi-dimensional data from each monitoring point and calculating a set of characteristic factors. At the hardware level, atmospheric pressure, temperature, and humidity data are collected in real time using sensors (such as barometers, thermometers, and hygrometers) deployed at the monitoring points. The sensor accuracy must meet meteorological observation standards (e.g., atmospheric pressure accuracy ±0.5 hPa, temperature accuracy ±0.2℃). Geographic location information is obtained through the Global Positioning System (GPS) or the BeiDou Navigation Satellite System, with accuracy down to the meter level. The collection of time-series information relies on a data storage system, storing historical wind speed fluctuation data in preset time windows (e.g., 1 hour). The accuracy of the timestamps for the m data points within each window (e.g., once per minute, m=60) must be ensured.
[0145] At the software level, data processing algorithms calculate the influence of each factor. Covariance correlation analysis employs a sliding window technique to perform windowed statistical analysis on environmental parameters and wind speed data within historical periods. The window length can be set to quarterly or annually to capture the impact at different time scales. The distribution density calculation of peak moment codes is achieved by traversing historical data, using hash tables or histograms to statistically analyze the frequency of occurrence of codes at each time point, efficiently identifying high-frequency peak moments. The normalized weighted summation module has a built-in weight configuration interface, supporting manual weight setting or automatic optimization of weight parameters through machine learning algorithms (such as linear regression).
[0146] This module is equipped with a sliding time window unit to achieve time-series arrangement of historical wind speed data. The time granularity of the sliding window is configurable (e.g., 15 minutes, 1 hour), and the window sliding step size is usually equal to the time granularity to ensure that the data does not overlap and is fully covered. For example, when the time granularity is 1 hour, the window slides from tK hours to t-1 hours, extracting data from K consecutive windows each time (e.g., K=24 means extracting data from the previous 24 hours). Data storage adopts a circular buffer structure, overwriting old data in real time to ensure controllable memory usage. The time-series arranged wind speed data is converted into a tensor format (e.g., a vector of shape K×1) for subsequent modules to use.
[0147] This module integrates a Numerical Weather Prediction (NWP) interface, acquiring predicted meteorological parameters in real time via an Application Programming Interface (API). It supports integration with major domestic and international meteorological data sources (such as the European Centre for Medium-Range Weather Forecasts (ECMWF) and the US National Weather Service (NWS). The interface protocol must meet HTTPS or FTP standards to ensure data transmission security and stability. The acquired parameters include predicted atmospheric pressure, temperature, and humidity values and their corresponding time windows (the next time window is for the next hour). The data update frequency matches the time granularity of the prediction model (e.g., updated hourly). After receiving the parameters, validity verification is performed, outliers (such as temperatures exceeding historical extreme values ±3σ) are removed, and the data is stored in a cache for use by other modules.
[0148] The system incorporates a Geographic Information System (GIS) unit to convert latitude and longitude coordinates into high-dimensional vectors. The GIS unit is developed based on open-source or commercial GIS libraries (such as GDAL or ArcGIS Engine), supports reading vector map data (such as Shapefile format), and divides the target area into grid cells (such as 10 km × 10 km). The latitude and longitude coordinates of each monitoring point are converted to planar coordinates through projection transformation (such as UTM projection), and then the encoding of its grid (such as a combination of row and column numbers) is determined according to grid division rules. High-dimensional vector generation can employ embedding learning methods, mapping the grid encoding to 128-dimensional vectors through a pre-trained geographic embedding model (such as a TransE-based spatial relationship model). The vector elements reflect spatial proximity and geographic features (such as terrain elevation and land / sea location).
[0149] Connecting to meteorological satellite remote sensing data sources (such as the Fengyun meteorological satellite data receiving system) allows for real-time acquisition of cloud cover images. The image format is a standard remote sensing data format (such as HDF or NetCDF), requiring preprocessing modules for radiometric calibration, geometric correction, and noise removal. The convolutional neural network unit employs a pre-trained image feature extraction model (such as ResNet-18) and is fine-tuned for cloud cover data. The model input is a single-channel grayscale image (pixel values 0-100 representing coverage), and the output is a spatial feature vector (length 512). The parameters of the fully connected layers in the regression branch are determined through offline training. The training data includes historical cloud images, corresponding meteorological parameters, and ground truth values of correction coefficients, optimized using a mean squared error loss function.
[0150] Employing an improved Transformer architecture, it incorporates a multi-head attention mechanism and a temporal location encoding layer. The input embedding layer supports multimodal data fusion; different data types (wind speed time series, meteorological parameters, spatial encoding, etc.) are converted into vectors of the same dimension (e.g., 256-dimensional) through independent embedding matrices, and the location encoding is fused by element-wise addition. Each module of the encoder stack layer incorporates a layer normalization operation to prevent gradient explosion and accelerate convergence. The number of heads in the multi-head attention layer is configurable (default 8 heads), with each head having a 32-dimensional query, key, and value matrix, resulting in a total output dimension of 256. The feedforward network layer adopts a "bottleneck" structure (256-dimensional → 1024-dimensional → 256-dimensional) to enhance nonlinear expressive power.
[0151] Equipped with a weighted fusion algorithm unit, it dynamically weights the initial predicted values and correction coefficients. The weighting coefficients are automatically adjusted based on the absolute value of the environmental interference correction coefficients. For example, when the absolute value of the correction coefficient is greater than 1 m / s, a higher weight (e.g., 0.7) is assigned, and vice versa (e.g., 0.3), to balance the influence of model prediction trends and real-time corrections. The geospatial interpolation algorithm unit supports multiple interpolation methods (e.g., Kriging, inverse distance weighting), and users can select the interpolation method through interface parameter settings. The interpolation results and GIS data rendering are achieved through open-source visualization libraries (e.g., Leaflet, Mapbox), and the generated regional wind speed prediction distribution map supports interactive operations (e.g., zooming, querying point wind speed values).
[0152] III. Module Collaboration and System Integration
[0153] Each module interacts with the others via message queues (such as RabbitMQ) or shared memory to ensure real-time processing. For example, after the feature factor calculation module completes data processing, it sends the feature factor set to the message queue. The time-series processing module and the spatial coding module retrieve data from the queue, generate wind speed time-series data and geographic location identifiers, and then send them to the wind speed prediction core module. The environmental interference correction module operates independently, periodically acquiring cloud image data from remote sensing data sources, generating correction coefficients, and storing them in a cache for use by the fusion output module.
[0154] The system is deployed in a distributed architecture, with tasks such as sensor data acquisition, model training, and predictive inference distributed across different servers or edge computing nodes. Model training nodes utilize GPU acceleration (such as NVIDIA Tesla series) to improve the training efficiency of Transformers and CNNs; edge nodes are responsible for real-time data acquisition and preprocessing, reducing the computing pressure on the cloud. The entire device is monitored and configured through a unified management interface, supporting functions such as module status viewing, parameter adjustment, and log analysis to ensure stable system operation.
[0155] Example 6:
[0156] This embodiment will describe in detail a wind speed prediction method and apparatus based on the Transformer model, which can effectively improve the accuracy and efficiency of wind speed prediction.
[0157] Data Acquisition and Preprocessing Stage: The data acquisition module collects multivariate time-series data from the wind farm's SCADA system and weather stations, covering the target variable wind speed and auxiliary variables such as temperature, humidity, air pressure, wind direction, and precipitation. The sampling frequency is fixed at 10-minute intervals to ensure data timeliness and accuracy, and historical data spans at least 6 months to guarantee data sufficiency and representativeness. Data is stored in CSV format indexed by timestamps for easy subsequent processing and analysis.
[0158] For data preprocessing, a spatiotemporal weighted interpolation method is used to handle missing values, calculating weighted values based on spatiotemporal neighborhood windows to fill in missing points. Simultaneously, outliers are removed using the 3σ principle to ensure data quality. Next, the data is standardized by calculating the mean and standard deviation by dimension, performing Z-score standardization, and outputting a preprocessed matrix to prepare for subsequent model input.
[0159] Input sequence construction and location encoding: The input construction module divides the time window, defining the input window length as 4 hours of historical data and the prediction step size as 1 hour of future data. The processed data is split into multiple samples, each containing the input sequence and a label containing only wind speed. Location encoding uses sine-cosine encoding to generate location encoding vectors for each time step. The input sequence is projected onto the hidden dimension through a linear layer. Finally, the location encoding is superimposed on the input sequence to obtain the final input representation, preserving the temporal relationship of the data.
[0160] The Transformer model architecture is constructed as follows: The prediction model module adopts an encoder-decoder structure. The encoder consists of six stacked layers, each containing a multi-head self-attention mechanism, a feedforward network, residual connections, and layer normalization. The multi-head self-attention mechanism computes the query, key, and value, processes them separately, and merges the multi-head outputs to extract a fusion representation of temporal and spatial features. The feedforward network further processes the features, while residual connections and layer normalization ensure the model's stability and convergence. The decoder input consists of the encoder output and the encoding of the future step position. Masked self-attention prevents the decoder from focusing on future time steps, cross-attention fuses the encoder output, and finally, the wind speed prediction is obtained through linear projection of the output layer.
[0161] During the model training and optimization phases, the training module uses dynamically weighted MSE and MAE as loss functions, gradually adjusting the weights in the later stages of training. Optimization strategies include using the AdamW optimizer, setting appropriate initial learning rate and weight decay, employing cosine annealing for learning rate scheduling at a period of 50 epochs, using a dropout rate of 0.1 applied to the FFN layer for regularization, and setting a gradient clipping threshold of 1.0 to prevent gradient explosion. Training results show that the MAE on the training and validation sets reaches 0.62 m / s and 0.78 m / s, respectively, and the loss remains stable within 100 epochs.
[0162] For wind speed prediction methods, the first step is to collect data on the influence of atmospheric pressure, temperature, humidity, geographical location, and time series information on wind speed at each monitoring point within the target area. Specifically, wind speed data for each monitoring point and time window within a historical period is obtained, along with corresponding average atmospheric pressure, average temperature, average humidity, geographical location code, and time code information. The geographical location code is divided into several levels based on latitude and longitude, with each level corresponding to a unique code; the time code information includes seasonal identifiers and day / night segments. The time codes of the moments with the highest frequency of wind speed fluctuation peaks within the historical period are statistically analyzed, and the influence of each factor on wind speed is calculated. The influence of atmospheric pressure, temperature, humidity, and geographical location information is obtained through covariance correlation analysis between historical data and wind speed, while the influence of time series information is calculated through the distribution density of peak moment codes. Based on these influence levels, the first to fifth influence factors are obtained through normalized weighted summation, forming a set of characteristic factors.
[0163] During the prediction process, for any monitoring point and at any prediction time, historical wind speed data from the K preset time windows preceding that monitoring point are arranged chronologically to form wind speed time-series data. Simultaneously, the predicted atmospheric pressure, predicted temperature, predicted humidity, and time-coded information for the next time window are obtained through the meteorological prediction input module, and the current geographic location identifier is obtained through the spatial coding module. The wind speed time-series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographic location identifier, time-coded information, and feature factor set collected at the current prediction time are input into the wind speed prediction model. This model is built on a Transformer architecture and includes an input embedding layer, a location coding layer, an encoder stacking layer, a multi-head attention layer, a feedforward network layer, and an output decoding layer, outputting the predicted wind speed value for that monitoring point in the next time window.
[0164] To account for environmental interference, an environmental interference correction model is constructed. This model is based on a convolutional neural network and includes feature extraction and regression branches. The environmental interference correction module connects to meteorological satellite remote sensing data sources and processes real-time cloud cover images. For any monitoring point, real-time cloud cover data is acquired at any prediction time point. The cloud cover data, predicted atmospheric pressure, and predicted temperature at the current prediction time point are input into the environmental interference correction model, which outputs the environmental interference correction coefficient for that monitoring point in the next time window.
[0165] For any given monitoring point, based on the predicted wind speed value obtained at the current prediction time and the environmental interference correction coefficient, a weighted fusion algorithm unit dynamically weights and calculates the values, and performs linear calibration by incorporating the monitoring point's altitude to calculate the final predicted wind speed value for that monitoring point in the next time window. The final predicted wind speed values from all monitoring points are then integrated, and a geospatial interpolation algorithm is used to spatially interpolate these values. This data is then combined with geographic information system data to render a visual grid map, generating a regional wind speed prediction distribution map.
[0166] The model training process also includes a dynamic optimization step. Based on the changing trend of the validation set error, the number of encoder stack layers or the number of attention heads are automatically adjusted. If the error continues to decrease, the current model parameters are frozen and the training cycle is shortened; if the error fluctuation exceeds a preset threshold, the number of encoder layers is increased or a residual connection structure is introduced before retraining to further improve the model's performance and prediction accuracy.
[0167] This wind speed prediction method and device based on the Transformer model achieves accurate wind speed prediction and the generation of regional wind speed prediction distribution maps through effective data processing, reasonable model construction, and dynamic optimization, providing strong support for wind farm scheduling, power grid optimization, and meteorological early warning.
[0168] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0169] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A wind speed prediction method based on the Transformer model, characterized in that, include: For any one of several monitoring points within the target area, the influence of atmospheric pressure, temperature, humidity, geographical location information, and time series information on the wind speed at that monitoring point is collected. Based on the obtained influence levels, a first influence factor, a second influence factor, a third influence factor, a fourth influence factor, and a fifth influence factor are calculated. Composition of the feature factor set; A wind speed prediction model is constructed. For any monitoring point, at any prediction time point, the historical wind speed data of the K preset time windows preceding the monitoring point are arranged in chronological order to form wind speed time series data. The predicted atmospheric pressure, predicted temperature, predicted humidity, and time code information for the next time window are obtained, and the current geographical location identifier is also obtained. The wind speed time series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographical location identifier, time code information, and feature factor set collected at the current prediction time point are input into the wind speed prediction model, and the predicted wind speed value of the monitoring point in the next time window is output. An environmental disturbance correction model is constructed. For any monitoring point, real-time cloud cover data is obtained at any prediction time point. The cloud cover data, predicted atmospheric pressure, and predicted temperature at the current prediction time point are input into the environmental disturbance correction model, and the environmental disturbance correction coefficient for the monitoring point in the next time window is output. For any given monitoring point, based on the predicted wind speed value obtained at the current prediction time and the environmental disturbance correction coefficient, the final predicted wind speed value for that monitoring point in the next time window is calculated. By integrating the final wind speed forecasts from all monitoring points, a regional wind speed forecast distribution map is generated.
2. The wind speed prediction method based on the Transformer model according to claim 1, characterized in that, The extent to which the collected atmospheric pressure, temperature, humidity, geographical location information, and time series information affect the wind speed at the monitoring point specifically includes: For any given monitoring point, wind speed data for each time window within a historical period is acquired, along with average atmospheric pressure, average temperature, average humidity, geographic location code, and time code information for each time window. The geographic location code is divided into several levels based on the latitude and longitude of the monitoring point, with each level corresponding to a unique code. The time code information includes seasonal identifiers and day / night segments. Seasonal identifiers are divided into four categories according to meteorological standards, and day / night segments are divided into daytime and nighttime based on natural light conditions. The time series information for each time window includes the wind speed fluctuation values of the monitoring point at m consecutive moments within that time window; the m moments of each time window are sequentially encoded as 1 to m, and the moment with the highest frequency of wind speed fluctuation peaks in the historical period is encoded. The influence of atmospheric pressure, temperature, humidity, geographical location information, and time series information on the wind speed at the current monitoring point were calculated respectively. The influence of the first four items was obtained through covariance correlation analysis between historical data and wind speed, and the influence of time series information was calculated by the distribution density of peak time encoding.
3. The wind speed prediction method based on the Transformer model according to claim 2, characterized in that, The set of characteristic factors is calculated as follows: based on the degree of influence of atmospheric pressure, temperature, humidity, geographical location information and time series information, the first to fifth influence factors are obtained by normalized weighted summation.
4. The wind speed prediction method based on the Transformer model according to claim 3, characterized in that, The wind speed prediction model is built on the Transformer architecture, including an input embedding layer, a position encoding layer, an encoder stacking layer, a multi-head attention layer, a feedforward network layer, and an output decoding layer. The input embedding layer is used to convert wind speed time series data, predicted atmospheric pressure, predicted temperature, predicted humidity, geographic location identifiers, time-coded information, and feature factor sets into high-dimensional vectors; The location coding layer is used to generate location codes for each time window in the wind speed time series data to preserve the temporal relationships; The encoder stack layer contains N encoder modules connected in series. Each encoder module sequentially performs multi-head self-attention calculation and feedforward network transformation to extract a fusion representation of temporal and spatial features. The multi-head attention layer is used to perform cross-attention calculation on the feature factor set and the features output by the encoder to generate dynamic weight allocation results; The feedforward network layer is used to further fuse the dynamic weight allocation results with the encoder output to generate an intermediate feature vector; The output decoding layer is used to map the intermediate feature vectors to the predicted wind speed values for the next time window.
5. The wind speed prediction method based on the Transformer model according to claim 4, characterized in that, The training process of the wind speed prediction model includes: Historical datasets from multiple monitoring points were collected. Each data sample contained wind speed data for K+1 consecutive time windows, influencing factor data for the K+1th time window, and a set of feature factors. The dataset was then divided into a training set and a validation set. The model parameters are optimized by backpropagation using the data and influencing factors of the first K time windows in the training set as input and the wind speed data of the (K+1)th time window as the target output. The model prediction error is evaluated using a validation set. If the error does not reach the convergence threshold, the model is retrained after adjusting the number of layers or attention heads.
6. The wind speed prediction method based on the Transformer model according to claim 5, characterized in that, The environmental interference correction model is built based on a convolutional neural network, including a feature extraction branch and a regression branch; The feature extraction branch extracts spatial distribution features from cloud cover data through multi-layer convolution operations; The regression branch concatenates the spatial distribution characteristics with the predicted atmospheric pressure and temperature, and outputs the environmental disturbance correction coefficient after calculation by the fully connected layer.
7. The wind speed prediction method based on the Transformer model according to claim 6, characterized in that, The formula for calculating the final wind speed prediction value is as follows: the predicted wind speed value is superimposed with the environmental interference correction coefficient according to a preset rule, and linear calibration is performed in combination with the altitude of the monitoring point.
8. The wind speed prediction method based on the Transformer model according to claim 7, characterized in that, The method for generating the regional wind speed prediction distribution map is as follows: spatial interpolation calculation is performed on the final wind speed prediction values of all monitoring points, and the data is combined with geographic information system data to render a visual grid map.
9. The wind speed prediction method based on the Transformer model according to claim 5, characterized in that, The model training process further includes a dynamic optimization step: Based on the changing trend of the validation set error, the number of layers in the encoder stack or the number of attention heads are automatically adjusted; if the error continues to decrease, the current model parameters are frozen and the training cycle is shortened. If the error fluctuation exceeds the preset threshold, the number of encoder layers is increased or a residual connection structure is introduced before retraining.
10. A wind speed prediction device based on a Transformer model, used to implement the wind speed prediction method based on a Transformer model as described in any one of claims 1 to 9, characterized in that, Includes the following modules: The feature factor calculation module is used to collect information on the influence of atmospheric pressure, temperature, humidity, geographical location and time series information on wind speed for each monitoring point in the target area, and generate a feature factor set containing the first to fifth influencing factors through a weighted fusion algorithm. The time series processing module is equipped with a sliding time window unit, which is used to arrange the historical wind speed data of each monitoring point in time series according to a preset time granularity, forming wind speed time series data containing K time steps. The meteorological forecast input module integrates a numerical weather prediction interface to obtain the predicted atmospheric pressure, predicted temperature, and predicted humidity parameters of the target area within the prediction time window. The spatial coding module, with a built-in geographic information system unit, is used to convert the latitude and longitude coordinates of monitoring points into high-dimensional geographic location identifier vectors. The environmental interference correction module connects to the meteorological satellite remote sensing data source and is equipped with a convolutional neural network unit to process real-time cloud coverage images and generate environmental interference correction coefficients. The core module for wind speed prediction adopts an improved Transformer architecture, which includes a multi-head attention mechanism and a time-location encoding layer. It is used to receive the wind speed time series data, predicted meteorological parameters, geographic location identifiers, time-encoded information and feature factor set, and output a preliminary wind speed prediction value. The fusion output module is equipped with a weighted fusion algorithm unit, which dynamically weights the preliminary wind speed prediction value with the environmental interference correction coefficient to generate the final wind speed prediction value, and generates a regional wind speed prediction distribution map through a geospatial interpolation algorithm.