High-precision wind speed prediction method, system and device and storage medium
By preprocessing and extracting features from digital elevation models and meteorological data, combined with a gated attention mechanism and adaptive time-step convolution, a multi-scale gated adaptive causal temporal network is constructed, which solves the problem of insufficient accuracy in wind speed prediction in complex terrain areas and achieves high-precision and stable wind speed prediction.
Patent Information
- Application Number
- CN202510689202.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-10-17
AI Technical Summary
Existing wind speed prediction methods have difficulty accurately modeling the spatiotemporal variation characteristics of wind speed in complex terrain areas. They lack sufficient integration of terrain features and adaptive time modeling, cannot effectively capture short-term fluctuations and long-term trends in wind speed, and fail to fully utilize multi-scale information, resulting in insufficient prediction accuracy.
By obtaining digital elevation model data and meteorological data, preprocessing and feature extraction are performed, and the gated attention mechanism is used to fuse terrain and meteorological features. A multi-scale gated adaptive causal temporal network is constructed by combining adaptive time step convolution and extended causal convolution. The model is optimized using a joint loss function to achieve high-precision wind speed prediction.
It significantly improves the accuracy and stability of wind speed prediction in complex terrain areas, dynamically captures spatiotemporal dependencies, enhances the efficiency of utilizing terrain information and the ability to express the spatiotemporal variation characteristics of meteorological information, and improves the accuracy and reliability of predictions.
Smart Images

Figure CN120805019A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence intelligent meteorological technology, and in particular to a high-precision wind speed prediction method, system, device and storage medium. Background Art
[0002] Wind speed prediction plays an important role in meteorology and wind energy development. However, because wind speed is affected by complex terrain, weather systems, and the dynamics of the atmospheric boundary layer, traditional prediction methods struggle to accurately model the spatiotemporal variations in wind speed. While existing numerical weather prediction (NWP) models can provide large-scale wind speed information, their low resolution makes it difficult to effectively characterize the impact of local terrain on wind fields. Furthermore, wind speed prediction methods based on statistical modeling and machine learning often lack in-depth modeling of spatiotemporal dependencies, resulting in significant inaccuracies in predictions, particularly in areas with complex terrain.
[0003] Deep learning methods have made significant progress in wind speed forecasting research in recent years, with spatiotemporal sequence modeling and terrain feature extraction being key issues. However, existing methods generally suffer from the following deficiencies: They fail to fully integrate terrain features, resulting in large prediction errors in complex terrain areas such as mountainous and hilly areas; they lack an adaptive temporal modeling mechanism, making it impossible to dynamically adjust the temporal perception range, making it difficult to accurately capture both short-term fluctuations and long-term trends in wind speed; and they fail to fully utilize multi-scale information about wind speed, resulting in insufficient prediction capabilities for changes at different time scales. Therefore, a prediction method that simultaneously considers terrain features, meteorological data, and the spatiotemporal dynamics of wind speed is urgently needed to improve wind speed forecast accuracy in complex terrain areas. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a high-precision wind speed prediction method, system, device and storage medium to solve the problems of the shortcomings of existing wind speed prediction methods in dealing with complex terrain, meteorological diversity and spatiotemporal changes.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a high-precision wind speed prediction method, comprising:
[0008] Acquiring digital elevation model data and meteorological data, and preprocessing the digital elevation model data and meteorological data to obtain first digital elevation model data and first meteorological data;
[0009] Performing feature extraction on the first digital elevation model data and the first meteorological data to obtain a terrain feature vector and a meteorological feature vector;
[0010] Fuse the terrain feature vector and the weather feature vector by using a gated attention mechanism to obtain a joint feature vector;
[0011] Take the joint feature vector as input, combine adaptive time step convolution and extended causal convolution, construct a multi-scale gated adaptive causal time series network to obtain a high-precision wind speed prediction model;
[0012] Optimize the high-precision wind speed prediction model using a joint loss function to obtain a high-precision wind speed prediction result.
[0013] As a preferred scheme of the high-precision wind speed prediction method, the preprocessing of the digital elevation model data and the weather data includes:
[0014] Uniform the coordinates of the digital elevation model data by using a transformation matrix to obtain first digital elevation model data;
[0015] Resample the weather data by using a bicubic interpolation method, and perform spatio-temporal alignment on the weather data to select continuous data of the same time range to obtain first weather data;
[0016] The beneficial effects of the preferred technical scheme are that through coordinate unification and spatio-temporal alignment, the consistency of the digital elevation model and the weather data in space and time is ensured, providing an accurate data basis for subsequent feature extraction and fusion, and improving the accuracy and reliability of wind speed prediction.
[0017] As a preferred scheme of the high-precision wind speed prediction method, the terrain feature vector includes:
[0018] Take the three-channel terrain map in the first digital elevation model data as input data, and perform preliminary feature extraction by two-dimensional convolution to obtain a first feature map;
[0019] Perform layer normalization processing on the first feature map, and the processed first feature map enters a plurality of depth separable convolution blocks, and multi-scale features are extracted by using depth separable convolution, layer normalization, multi-layer perception expansion and activation function;
[0020] Gradually reduce the spatial resolution and increase the number of channels by using an improved pure convolutional neural network to obtain a second feature map;
[0021] Perform global average pooling on the second feature map by using the improved pure convolutional neural network to obtain a global average pooled feature vector;
[0022] Perform layer normalization processing on the global average pooled feature vector, and map the global average pooled feature vector through a fully connected layer to obtain a terrain feature vector;
[0023] The beneficial effects of the preferred technical solution are that the improved convolutional neural network gradually extracts multi-scale terrain features, effectively reduces the spatial dimension and enhances the feature expression capability, provides accurate terrain feature information for subsequent wind speed prediction, and improves the adaptability of the model to complex terrain.
[0024] As a preferred scheme of the high-precision wind speed prediction method, the weather feature vector includes:
[0025] The terrain feature vector and the first weather feature vector output by the terrain feature encoder and the weather time series encoder are taken as inputs of the deep learning model;
[0026] Based on the terrain feature vector and the first weather feature vector, the spatial attention mechanism and the time attention mechanism are calculated to obtain the spatial updated feature representation and the time updated feature representation;
[0027] The spatial updated feature representation and the time updated feature representation are fused by using an additive fusion strategy to output the weather feature vector.
[0028] As a preferred scheme of the high-precision wind speed prediction method, the fusion of the terrain feature and the weather feature by using the gated attention mechanism includes:
[0029] The terrain feature vector and the weather feature vector are input into the gating mechanism, and the terrain feature vector and the weather feature vector are weighted by using a weight matrix and a bias term to obtain a gating signal;
[0030] The weights of the terrain feature vector and the weather feature vector are adjusted according to the gating signal, and the terrain feature vector and the weather feature vector are fused by using weighted average to obtain a fused feature vector;
[0031] The beneficial effects of the preferred technical solution are that the weights of the terrain feature and the weather feature are dynamically adjusted by using the gating mechanism to realize adaptive fusion of the features, enhance the comprehensive representation capability of the model for multi-modal information, and improve the prediction accuracy.
[0032] As a preferred scheme of the high-precision wind speed prediction method, the construction of the multi-scale gated adaptive causal time series network includes:
[0033] The historical weather data are obtained and taken as inputs of the adaptive time step convolution;
[0034] For each time step, the gating parameters of the adaptive time step convolution are calculated to adjust the time step of the convolution operation, and a time step adjusted feature representation is obtained;
[0035] The time step adjusted feature representation is input into an extended causal convolution, and a causal convolution after feature representation is calculated through the causal convolution;
[0036] The causal convolution after feature representation is input into multi-scale feature fusion, and convolution operations are performed using convolution kernels of different sizes to obtain multi-scale feature representation;
[0037] The time step adjusted feature representation, the causal convolution after feature representation and the multi-scale feature representation are spliced in the channel dimension to obtain a spatio-temporal joint feature;
[0038] The spatio-temporal joint feature is dimensionally reduced through a fully connected layer, and a wind speed prediction value is calculated through an activation function;
[0039] The beneficial effects of the preferred technical scheme are that through adaptive time step convolution and multi-scale feature fusion, spatio-temporal dependence is dynamically captured, the modeling capability of the model for wind speed changes is enhanced, and the prediction accuracy and stability are improved.
[0040] As a preferred scheme of the high-precision wind speed prediction method, the optimization of the high-precision wind speed prediction model by using the joint loss function includes:
[0041] The joint loss function includes a mean square error loss, a quantile loss and a terrain gradient constraint loss;
[0042] The loss terms are weighted and summed to obtain the joint loss function;
[0043] The high-precision wind speed prediction model is optimized by using an optimizer to perform gradient update and combining a learning rate decay strategy to obtain a high-precision wind speed prediction result.
[0044] In a second aspect, the application provides a high-precision wind speed prediction system, comprising:
[0045] A preprocessing module is configured to obtain digital elevation model data and meteorological data, and to preprocess the digital elevation model data and the meteorological data to obtain first digital elevation model data and first meteorological data;
[0046] A feature extraction module is configured to extract features from the first digital elevation model data and the first meteorological data to obtain a terrain feature vector and a meteorological feature vector;
[0047] A fusion module is configured to fuse the terrain feature vector and the meteorological feature vector by using a gated attention mechanism to obtain a joint feature vector;
[0048] A model construction module is configured to construct a multi-scale gated adaptive causal time series network by taking the joint feature vector as input, combining adaptive time step convolution and extended causal convolution, to obtain a high-precision wind speed prediction model.
[0049] A model optimization module is configured to optimize the high-precision wind speed prediction model by using a joint loss function, to obtain a high-precision wind speed prediction result.
[0050] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the high-precision wind speed prediction method when executing the computer program.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the high-precision wind speed prediction method.
[0052] Compared with the prior art, the present application has the following beneficial effects: The present application preprocesses digital elevation model data and meteorological data to provide an accurate data basis for subsequent feature extraction and fusion, improves the accuracy and reliability of wind speed prediction, uses an improved pure convolutional neural network (ConvNeXt network) to extract multi-scale terrain features, reduces spatial dimensions and enhances feature expression capability, effectively solves the influence of complex terrain on wind speed prediction, improves the utilization efficiency of the model for terrain information, uses a spatiotemporal deep learning (Transformer) layer to capture the spatiotemporal correlation features of meteorological factors, can accurately capture the spatiotemporal variation characteristics of meteorological data, provides more abundant meteorological information for wind speed prediction, dynamically adjusts the weights of terrain and meteorological features through a gated attention mechanism, realizes adaptive fusion of features, combines adaptive time step convolution (ATC) and extended causal convolution (DCC) to dynamically capture short-term fluctuations and long-term trends of wind speed, and enhances spatial feature expression capability through multi-scale feature fusion (MSF), and uses a joint loss function for optimization, which significantly improves the accuracy and stability of wind speed prediction in complex terrain regions. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0054] Figure 1 A high-precision wind speed prediction method provided by an embodiment of the present application is shown in the overall flow logic diagram.
[0055] Figure 2 A multi-scale gated adaptive causal time series network structure diagram of a high-precision wind speed prediction method is provided for an embodiment of the present application.
[0056] Figure 3 A future 3-hour wind speed prediction based on multi-modal spatio-temporal feature fusion and gated adaptive network is provided for an embodiment of the present application.
[0057] Figure 4 A high-precision wind speed prediction method and a root mean square error (RMSE) trend chart under each prediction length compared with a traditional prediction method are provided for an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0059] Embodiment 1, refer to Figures 1-2 For an embodiment of the present application, a high-precision wind speed prediction method is provided, comprising:
[0060] S100: Obtain digital elevation model data and meteorological data, and pre-process the digital elevation model data and meteorological data to obtain first digital elevation model data and first meteorological data;
[0061] S200: Extract features from the first digital elevation model data and the first meteorological data respectively to obtain a terrain feature vector and a meteorological feature vector;
[0062] S300: Fuse the terrain feature vector and the meteorological feature vector using a gated attention mechanism to obtain a joint feature vector;
[0063] S400: Use the joint feature vector as input, combine adaptive time step convolution and extended causal convolution, and construct a multi-scale gated adaptive causal time series network to obtain a high-precision wind speed prediction model;
[0064] S500: Optimize the high-precision wind speed prediction model using a joint loss function to obtain a high-precision wind speed prediction result.
[0065] It should be noted that through the multi-modal spatio-temporal feature fusion and the gate adaptive network, the terrain and weather data are deeply fused, the spatio-temporal dependence is dynamically captured, the accuracy and robustness of the wind speed prediction in a complex terrain area are significantly improved, and the deep fusion and multi-level modeling of terrain features and weather data can accurately predict future wind speed under complex terrain and variable weather conditions.
[0066] In the embodiment of the present application, the above step S100 comprises the following sub-steps A1-A2.
[0067] In A1: the digital elevation model data is unified in coordinates by using a transformation matrix to obtain first digital elevation model data.
[0068] In A2: the weather data is resampled by using a bicubic interpolation method, and the weather data is spatio-temporally aligned, continuous data of the same time range is selected, and first weather data is obtained.
[0069] Specifically, digital elevation model (DEM) data is obtained, with a resolution of 30m x 30m, in GeoTIFF format (image format), containing elevation, slope, slope direction, and roughness.
[0070] The weather data is obtained, with a time resolution of 1 hour and a spatial resolution of 0.25° x 0.25°, including 10m height wind speed (u / v component), 2m temperature, and surface pressure.
[0071] In the embodiment of the present application, the preprocessing of the DEM data comprises: unifying the coordinate system of the DEM data to the WGS84 coordinate system, and expressing it by a transformation matrix as follows:
[0072]
[0073] Where T is the transformation matrix from the source coordinate system to the WGS84 coordinate system, X source , Y source , Z source are the original coordinate values, and X WGS84 , Y WGS84 , Z WGS84 are the transformed WGS84 coordinate values.
[0074] In the embodiment of the present application, the preprocessing of the weather data comprises:
[0075] The weather data is resampled to have the same resolution as the DEM data, and a bicubic interpolation method is used for interpolation, expressed as:
[0076]
[0077] Where f(x, y) is an interpolation function used to calculate the value at a new position (x, y), aij is the coefficient to be solved, usually calculated by the values of 16 known points, x i ,y j is the normalized coordinate;
[0078] The meteorological data is spatio-temporally aligned to ensure that the meteorological data and the DEM data are paired on the same time period and spatial grid, ensuring consistency between different data sources.
[0079] The wind speed vector synthesis is used to synthesize the east-west (U component) and north-south (V component) of the wind speed in the meteorological data into a complete wind speed vector, and by synthesizing the wind speed modulus and the wind direction angle, the size and direction of the wind speed are obtained. The wind speed modulus is calculated as:
[0080]
[0081] wherein u and v are the components of the wind speed in the east-west direction and the north-south direction, respectively;
[0082] The wind direction angle is represented as:
[0083] θ=arctan2(v,u)
[0084] wherein arctan2(·) is a mathematical function;
[0085] The vertical wind speed correction is performed on the wind speed. Since the meteorological data provides the wind speed at a height of 10 meters, if wind speed prediction at different heights is required, vertical wind speed correction must be performed. The logarithmic wind speed profile model is used to correct according to the relationship between the reference height and the actual prediction height, represented as:
[0086]
[0087] wherein is the wind speed at a height of 10 meters, z ref is the reference height, z0 is the roughness length, and ln(·) is the logarithmic function;
[0088] The DEM data and the meteorological data after integration processing are used to construct a multi-dimensional feature tensor, including time stamp, longitude, latitude, elevation, slope, aspect, terrain shading index (TRI), wind speed, wind direction, temperature, and pressure. The continuous variables among them are subjected to Z-score standardization, represented as:
[0089]
[0090] wherein X is the original feature value, μ is the mean of the feature, and σ is the standard deviation of the feature;
[0091] The wind direction feature is coded by sine / cosine, and the wind direction angle is converted into a form that can be input into the neural network, expressed as:
[0092] sin(θ),cos(θ)
[0093] After preprocessing, a spatio-temporal fusion data set is obtained, which is saved in the network universal data format (NetCDF format), and the dimension structure is time x longitude x latitude x feature channel number.
[0094] It should be noted that by unifying coordinates, aligning space-time, correcting and standardizing wind speed, integrating multi-source data, constructing a spatio-temporal fusion data set, providing consistent and standardized input for subsequent model training, the accuracy and stability of wind speed prediction are significantly improved.
[0095] In the embodiment of the present application, the above step S200 includes the following sub-steps B1-B5.
[0096] In B1: the three-channel terrain map in the first digital elevation model data is taken as input data, and two-dimensional convolution is performed for preliminary feature extraction to obtain a first feature map;
[0097] In B2: the first feature map is subjected to layer normalization processing, and the processed first feature map enters a plurality of deep separable convolution blocks, and multi-scale features are extracted by using deep separable convolution, layer normalization, multi-layer perception expansion and activation function;
[0098] In B3: the improved pure convolutional neural network is used to gradually perform down-sampling to reduce the spatial resolution and increase the number of channels, and a second feature map is obtained;
[0099] In B4: the improved pure convolutional neural network is used to perform global average pooling on the second feature map to obtain a global average pooled feature vector;
[0100] In B5: the global average pooled feature vector is subjected to layer normalization processing, and a terrain feature vector is obtained by mapping through a fully connected layer.
[0101] In the embodiment of the present application, the terrain feature is extracted by the improved ConvNeXt network.
[0102] Specifically, the slope is the inclination of the ground surface, which reflects an important influencing factor of wind speed change, and by calculating the slope, the change of the terrain can be understood.
[0103] The slope calculation is represented by differential processing of the elevation data as:
[0104]
[0105] wherein, and First-order partial derivatives of the elevation value in X and Y directions, respectively, arctan(·) is the inverse tangent function;
[0106] TRI describes the degree of shelter of a grid point in the terrain around it, reflecting the influence of terrain on wind speed changes, and is obtained by calculating the elevation change around the grid point. The terrain shelter index TRI is expressed as:
[0107]
[0108] where z i is the elevation value of the surrounding grid point, z central is the elevation of the central grid point, and N is the number of surrounding grid points;
[0109] Input data represent a three-channel topographic map containing elevation, slope and aspect information. The first feature map is obtained by two-dimensional convolution for preliminary feature extraction, and is expressed as:
[0110] Y1=X*K+b
[0111] where K is a two-dimensional convolution kernel, b is a bias term, * is a convolution operation, and X is input data;
[0112] The first feature map after layer normalization is expressed as:
[0113]
[0114] where μ and σ are the mean and standard deviation, respectively, and γ and β are trainable parameters;
[0115] The processed first feature map first enters 3 depth separable convolution blocks (SACN-Block), each Block is composed of a depth separable convolution layer (DepthwiseConv), a layer normalization (LayerNorm) and a multi-layer perception expansion (MLP), expressed as:
[0116] F1=DepthwiseConv(F,K d )
[0117] F2=LayerNorm(F1)
[0118] F3=W2·GELU(W1·F2)
[0119] F out =F+F3
[0120] where K dFor the depthwise convolution kernel, W1, W2 are the weight matrices of the MLP, GELU is a nonlinear activation function, F is the input feature map, F1 is the feature map after depthwise convolution, F2 is the feature map after layer normalization, F3 is the feature map after MLP processing, F out is the final output feature map.
[0121] The improved ConvNeXt network performs the first down-sampling using a 4x4 convolution with a stride of 2 to reduce the spatial resolution and increase the number of channels, denoted as:
[0122] F down1 = Conv(F out , K 4×4 , s = 2)
[0123] where K 4×4 is a 4x4 convolution kernel, and the stride s = 2 realizes 2 times down-sampling;
[0124] Then, 9 SACN-Blocks are entered to extract deeper terrain features, and each Block is calculated again.
[0125] Subsequently, the second down-sampling is performed, also using a 4x4 convolution with a stride of 2, denoted as:
[0126] F down2 = Conv(F down1 , K 4×4 , s = 2)
[0127] Enter 3 SACN-Blocks to further extract high-level features.
[0128] Next, the improved ConvNeXt network performs the third down-sampling, continuing to use a 4x4 convolution with a stride of 2, denoted as:
[0129] F down3 = Conv(F down2 , K 4×4 , s = 2)
[0130] Enter 3 SACN-Blocks to extract more abstract semantic terrain features.
[0131] Finally, the fourth down-sampling is performed, using the same 4x4 convolution, denoted as:
[0132] F down4 = Conv(F down3 , K 4×4 , s = 2)
[0133] Enter 3 SACN-Blocks to complete the final feature extraction.
[0134] The improved ConvNeXt network performs global average pooling on the final feature map, which is represented as:
[0135]
[0136] where F down4 is the feature map after multiple down-sampling, (i,j) is the spatial position coordinate on the feature map, H is the height of the feature map F down4 , and W is the width of the feature map F down4 .
[0137] The feature vector after global average pooling is mapped to a 512-dimensional terrain feature vector representation through layer normalization and a fully connected layer, which is represented as:
[0138] F DEM =FC(LayerNorm(F GAP ))
[0139] where FC(·) is a fully connected layer function, and LayerNorm(·) is a layer normalization function.
[0140] It should be noted that by improving the ConvNeXt network to extract terrain features, combining multi-scale down-sampling and global average pooling, the feature dimension is effectively reduced while retaining the global features of terrain information, providing accurate terrain feature representation for wind speed prediction, and significantly improving the adaptability and prediction accuracy of the model for complex terrain.
[0141] In the embodiment of the present application, after the steps B1-B5 in the above step S200 are completed, the following steps B6-B8 are further included;
[0142] In B6, the terrain feature vector and the first meteorological feature vector output by the terrain feature encoder and the meteorological time series encoder are taken as inputs of the deep learning model;
[0143] In B7, based on the terrain feature vector and the first meteorological feature vector, the spatial attention mechanism and the temporal attention mechanism are calculated to obtain the spatial updated feature representation and the temporal updated feature representation;
[0144] In B8, the spatial updated feature representation and the temporal updated feature representation are fused using an additive fusion strategy to output a meteorological feature vector.
[0145] In the embodiment of the present application, the meteorological features are extracted by constructing a spatio-temporal Transformer layer;
[0146] Specifically, the input spatiotemporal data includes the terrain feature vector and the first meteorological feature vector output from the terrain feature encoder and the meteorological time series encoder, where the first meteorological feature vector is the initial meteorological feature vector; the spatiotemporal Transformer architecture includes a spatial attention mechanism and a temporal attention mechanism;
[0147] The goal of the spatial attention mechanism is to capture the correlation between different spatial positions through self-attention calculation and establish spatial dependencies. Given the input spatiotemporal data X spatial , the basic process of spatial attention calculation is expressed as:
[0148] Q=X spatial W Q ,K=X spatial W K ,V=X spatial W V
[0149] Among them, W Q 、W K 、W V The weight matrices for query, key, and value are used to generate the query vector, key vector, and value vector of spatial attention, respectively. The weight matrices are learned during the training process.
[0150] The spatial attention matrix A is obtained by calculating the dot product of the query vector and the key vector spatial Represents the relationship between spatial positions:
[0151]
[0152] Among them, Q is the query vector, K is the key vector, and d k is the dimension of the key vector, Softmax(·) is the activation function;
[0153] The spatially updated feature representation is obtained by multiplying the spatial attention matrix with the value vector:
[0154] O spatial =A spatial ·V
[0155] Among them, A spatial is the spatial attention matrix, V is the value vector;
[0156] Given the temporal features of the input in the temporal attention mechanism, the query, key, and value vectors are generated through the weight matrix including:
[0157] Q time =X temporal W Q ,K time =X temporal W KV time = X temporal W V
[0158] wherein, X temporal is a time attention matrix, W Q , W K , W V are weight matrices of query, key and value;
[0159] The dot product of the query and the key is calculated to obtain the time attention matrix, which is represented as:
[0160]
[0161] wherein, Q time is a query vector, is the transpose of a key vector, V time is a value vector, d k is the dimension of the key vector, and Softmax(·) is an activation function;
[0162] The output of the time attention is obtained by multiplying the time attention matrix and the value vector, and the time-updated feature representation is:
[0163] O time = A time · V time
[0164] wherein, A time is a time attention matrix, and V time is a value vector;
[0165] An additive fusion strategy is adopted to fuse the space-updated feature representation and the time-updated feature representation, which is represented as:
[0166] F DEM F ERA5 = O spatial + O time
[0167] The fused feature F DEM F ERA5 contains all information of the spatial and time dimensions of the meteorological data, and a meteorological feature vector is obtained.
[0168] It should be noted that the spatial and time features of the meteorological data are deeply fused through the space-time Transformer layer, the complex space-time dependency relationship is captured by using the spatial and time attention mechanisms, the expression capability of the meteorological feature is significantly improved, more accurate input is provided for the wind speed prediction, and the prediction accuracy and stability of the model are enhanced.
[0169] In the embodiment of the present application, the above step S300 comprises the following sub-steps C1-C2:
[0170] In C1: the terrain feature vector and the weather feature vector are input into a gating mechanism, the terrain feature vector and the weather feature vector are weighted through a weight matrix and a bias term, and a gating signal is obtained;
[0171] In C2: the weight of the terrain feature vector and the weather feature vector is adjusted according to the gating signal, the terrain feature vector and the weather feature vector are fused through weighted average, and a fused feature vector is obtained.
[0172] In the embodiment of the application, the terrain feature vector and the weather feature vector are fused by using a gated attention mechanism (Gated Attention mechanism);
[0173] Specifically, the terrain feature vector and the weather feature vector are input into a gating mechanism, the terrain feature and the weather feature are weighted by a weight matrix and a bias term in the gating mechanism, and a gating signal is generated, the signal value is activated by a Sigmoid function, and the output range is between 0 and 1, and the gating signal is represented as:
[0174] G gate =σ(W g ·[F DEM ,F ERA5 ]+b g )
[0175] Wherein, σ is a Sigmoid activation function, W g is a weight matrix, b g is a bias term, F DEM is a terrain feature vector, and F ERA5 is a weather feature vector;
[0176] The gating signal is used for weighted average terrain feature and weather feature, which is represented as:
[0177] F fused =G gate ·F ERA5 +(1-G gate )·F DEM
[0178] Wherein, G gate is the weight of the weather feature, 1-G gate is the weight of the terrain feature, and F fused is a fused feature vector containing comprehensive information of terrain feature and weather feature.
[0179] It should be noted that the weights of terrain and weather features are dynamically adjusted by the gated attention mechanism, adaptive fusion is realized, feature representation capability is enhanced, and wind speed prediction accuracy is significantly improved.
[0180] In an embodiment of the present invention, the above step S400 includes the following sub-steps D1-D6;
[0181] In D1: historical meteorological data is obtained and used as input for adaptive time step convolution;
[0182] In D2: For each time step, the gate parameters of the adaptive time step convolution are calculated, the time step of the convolution operation is adjusted, and the feature representation after the time step adjustment is obtained;
[0183] In D3: The feature representation after time step adjustment is input into the extended causal convolution, and the feature representation after causal convolution is obtained through causal convolution calculation;
[0184] In D4: The feature representation after causal convolution is input into the multi-scale feature fusion, and convolution operations are performed using convolution kernels of different sizes to obtain multi-scale feature representation;
[0185] In D5: The feature representation after time step adjustment, the feature representation after causal convolution, and the multi-scale feature representation are spliced in the channel dimension to obtain the spatiotemporal joint feature;
[0186] In D6: The spatiotemporal joint features are reduced in dimension through the fully connected layer, and the wind speed prediction value is obtained through activation function calculation.
[0187] In this embodiment of the present invention, a multi-scale gated adaptive causal temporal network (MGAC-TNet) combines adaptive time-step convolution (ATC) and dilated causal convolution (DCC) to generate wind speed forecast results through a fully connected layer (FC);
[0188] Specifically, such as Figure 2 As shown in Figure 2, in ATC, first, the meteorological data of the past N hours, including wind speed, temperature and air pressure, are input. These data are combined into a multi-dimensional time series tensor. For each time step, ATC calculates two important gating parameters: one is the filter gate σ(W) used to control the convolution strength. f *x t +b f ), and the other is a dynamic activation gate tanh(W g *x t +b g Through these two gating mechanisms, ATC dynamically adjusts the time step of the convolution operation according to the current data, allowing the network to learn short-term and long-term temporal dependencies more flexibly.
[0189] The gated convolution is expressed as:
[0190] h t =σ(W f*x t +b f )⊙tanh(W g *x t +b g )
[0191] Among them, x t is the input time series data such as wind speed, temperature, and air pressure, σ is the activation function, tanh is the hyperbolic tangent function, and W f 、W g is the trainable convolution weight, b f 、b g is the bias term, ⊙ is the element-by-element multiplication operation;
[0192] The high-precision wind speed prediction model also learns an adaptive time step, which is expressed as:
[0193] Δ t =ReLU(W d *x t +b d )
[0194] Among them, W d Adjust the parameter for the time step, b d As a bias, the ReLU function is used to ensure that the time step is non-negative;
[0195] When the wind speed changes dramatically, the time step is shortened, allowing the model to capture rapid fluctuations in a more fine-grained manner; when the wind speed is relatively stable, the time step is lengthened to improve computational efficiency and stability.
[0196] The final output feature F of ATC ATC It is the combined result of gated convolution and adaptive time step:
[0197]
[0198] Among them, τ represents the t The adjusted time series index, K(τ) is the convolution kernel weight on the time axis, and its sampling interval is Δ t Dynamic decision.
[0199] MGAC-TNet uses extended causal convolution to ensure the directionality of the flow of temporal information. At each time step, the causal convolution calculation is expressed as:
[0200]
[0201] Among them, d is the void factor, k is the convolution kernel size, W i is the weight of the convolution kernel, x t-d·i is the value in the input feature sequence;
[0202] In addition to the modeling of the time dimension, the MGAC-TNet also utilizes multi-scale feature fusion to enhance the expression ability of spatial features; in the MSF module, a plurality of convolution kernels of different sizes are used to extract features from the wind speed data, which is expressed as:
[0203]
[0204] wherein, W s is the convolution weight of scale s, x s is the input feature under scale s.
[0205] 3x3 convolution is used for short-term local feature extraction, 5x5 convolution focuses on medium-term features, and 7x7 convolution captures larger scale wind speed change patterns; the features under different scales are spliced and transmitted to the subsequent layer, so that the model can comprehensively judge the spatio-temporal variation of wind speed at different scales;
[0206] All features are spliced in the channel dimension to form the final spatio-temporal joint feature, which is expressed as:
[0207] F final =Concat(F ATC ,F DCC ,F MSF )
[0208] wherein, F ATC is the feature after adjusting the time step, F DCC is the feature after causal convolution, F MSF is the multi-scale feature, and Concat(·) is a splicing function.
[0209] The joint feature is then reduced in dimension through a fully connected layer, and the final wind speed prediction value is calculated through a Softmax activation function, which is expressed as:
[0210]
[0211] wherein, W o and b o are the weights and biases of the output layer, F final is the final spatio-temporal joint feature, and Softmax(·) is an activation function.
[0212] It should be noted that by combining the multi-scale gated adaptive causal time series network with adaptive time step convolution and extended causal convolution, the time step is dynamically adjusted, short-term fluctuations and long-term trends are captured, and the expression ability of spatial features is enhanced by using multi-scale feature fusion, which significantly improves the accuracy and stability of wind speed prediction.
[0213] In the embodiment of the present application, the above step S500 includes the following sub-steps E1-E3:
[0214] In E1: the joint loss function includes mean square error loss, quantile loss and terrain gradient constraint loss;
[0215] In E2: the loss terms are weighted and summed to obtain the joint loss function;
[0216] In E3: the optimizer is used for gradient update, combined with learning rate decay strategy, to optimize the high-precision wind speed prediction model, and obtain the high-precision wind speed prediction result.
[0217] Specifically, the mean square error loss is expressed as:
[0218]
[0219] Where y pred is the predicted wind speed value, y true is the true predicted value, and N is the sample size;
[0220] Considering the uncertainty of wind speed, the quantile loss is introduced and expressed as:
[0221]
[0222] Where τ is the quantile (e.g. 25%, 50%, 75%), y is the predicted wind speed value, and y is the true wind speed value;
[0223] This loss term can make the model pay attention to wind speed prediction at different confidence levels, and improve its modeling ability for uncertainty factors;
[0224] In order to reduce the influence of terrain complexity on wind speed prediction, the terrain gradient constraint loss is introduced and expressed as:
[0225]
[0226] Where, is the terrain gradient, λ is the regularization parameter, and ||·||2 2 is the norm square, y pred is the predicted wind speed value, and y true is the true predicted value;
[0227] The joint training of these loss terms is used to optimize the wind speed prediction capability and expressed as:
[0228] L = L MSE + λ1L q + λ2L topo
[0229] Where λ1 and λ2 are hyperparameters used to balance the influence of different loss terms;
[0230] During the training process, the Adam optimizer is used for gradient update, and combined with the learning rate decay strategy, the prediction stability and generalization ability of the model are gradually improved.
[0231] It should be noted that by comprehensively optimizing the model through the joint loss function, combining the mean square error, quantile loss and terrain gradient constraint loss, the accuracy and stability of wind speed prediction can be effectively improved, while the model's adaptability to uncertainty and complex terrain can be enhanced.
[0232] The above is a schematic diagram of a high-precision wind speed prediction method according to this embodiment. It should be noted that the technical solution of this high-precision wind speed prediction system and the technical solution of the high-precision wind speed prediction method described above are based on the same concept. For details not described in detail in the technical solution of the high-precision wind speed prediction system according to this embodiment, please refer to the description of the technical solution of the high-precision wind speed prediction method described above.
[0233] The high-precision wind speed prediction system in this embodiment includes:
[0234] a preprocessing module, configured to obtain digital elevation model data and meteorological data, and preprocess the digital elevation model data and meteorological data to obtain first digital elevation model data and first meteorological data;
[0235] a feature extraction module, configured to extract features from the first digital elevation model data and the first meteorological data, respectively, to obtain a terrain feature vector and a meteorological feature vector;
[0236] a fusion module, configured to fuse the terrain feature vector and the meteorological feature vector using a gated attention mechanism to obtain a joint feature vector;
[0237] A model building module is used to take the joint feature vector as input, combine adaptive time step convolution and extended causal convolution, build a multi-scale gated adaptive causal temporal network, and obtain a high-precision wind speed prediction model;
[0238] The model optimization module is used to optimize the high-precision wind speed prediction model using a joint loss function to obtain a high-precision wind speed prediction result.
[0239] This embodiment further provides a computer device suitable for high-precision wind speed prediction, including:
[0240] Memory and processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement a high-precision wind speed prediction method proposed in the above embodiment.
[0241] This embodiment further provides a storage medium on which a computer program is stored. When the program is executed by a processor, a high-precision wind speed prediction method as proposed in the above embodiment is implemented.
[0242] The storage medium proposed in the embodiment belongs to the same inventive concept as the high-precision wind speed prediction method proposed in the above embodiment. Technical details not described in detail in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
[0243] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by software and necessary general hardware, and of course can also be realized by hardware. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH, a hard disk or an optical disk, etc., and includes a plurality of instructions for causing a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the method of each embodiment of the present application.
[0244] Embodiment 2, with reference to Table 1, different from the first embodiment, provides a verification test of a high-precision wind speed prediction method, which verifies the technical effects used in the method.
[0245] The experimental area is selected in the area between 24.5° N and 29.5° N, and 103.5° E and 109.5° E. The experimental data uses the published meteorological data reanalysis, which contains wind speed, air temperature, air pressure, humidity and other meteorological variables, and combines with terrain data such as elevation, slope and other characteristics.
[0246] The data from 2020 to 2023 is selected as the model training set, and the data in 2024 is selected as the independent test set. The prediction target is the hourly wind speed value in the future 1 hour, 2 hours and 3 hours.
[0247] As shown in Figure 3 , it is a comparison chart of the future 3-hour wind speed prediction of the embodiment of the present application and the actual observation, which shows the comparison between the prediction result of the model on the future 3-hour wind speed change trend and the real-time data of the meteorological data under a certain typical prediction starting point.
[0248] It can be observed that the model prediction curve of the present application is highly consistent with the measured curve, especially in the time period of wind speed mutation or frequent fluctuation, which can still accurately capture the trend change, indicating that the model has good dynamic response ability and short-term prediction accuracy.
[0249] To verify the prediction ability of the model, a plurality of comparison experiments are carried out, and the experimental results are shown in Table 1, Table 2 andFigure 4 As shown.
[0250] In the comparative experiment, the following four models are selected for comparison: long short-term memory neural network (LSTM); time series convolution network (TCN); standard Transformer; HWP-ASTM model proposed in the application.
[0251] Taking RMSE (root mean square error), MAE (mean absolute error) and MAPE (mean absolute percentage error) as evaluation indexes, the prediction performance of each model under different prediction lengths is evaluated, and the experimental results are shown in Tables 1-2:
[0252] Table 1 MAE comparison table of different prediction methods under different prediction lengths
[0253]
[0254] Table 2 MAPE comparison table of different prediction methods under different prediction lengths
[0255]
[0256] In summary, as shown in Figure 3 , Figure 4 and Tables 1 and 2, in the prediction of the first hour, the second hour and the third hour, the MAE values of HWP-ASTM are 0.60 m / s, 0.71 m / s and 0.81 m / s respectively, which are significantly lower than those of other methods, indicating that the prediction accuracy is higher. In terms of MAPE, the error percentage of HWP-ASTM is also significantly lower than that of other methods, indicating that the relative error of the prediction result is smaller, and the ability to capture wind speed changes is stronger. From the perspective of error statistics and trend changes, the effectiveness and adaptability of the method of the application in the complex terrain wind speed prediction task are verified, and the method has good engineering practical value.
[0257] It should be noted that the above examples are only used to illustrate the technical solutions of the application and are not limiting. Although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the application, and all should be covered in the scope of the claims of the application.
Claims
1. A high-precision wind speed prediction method, characterized in that: include: Acquiring digital elevation model data and meteorological data, and preprocessing the digital elevation model data and meteorological data to obtain first digital elevation model data and first meteorological data; Performing feature extraction on the first digital elevation model data and the first meteorological data to obtain a terrain feature vector and a meteorological feature vector; Using a gated attention mechanism to fuse the terrain feature vector and the meteorological feature vector to obtain a joint feature vector; Taking the joint feature vector as input, combining adaptive time-step convolution and extended causal convolution, a multi-scale gated adaptive causal temporal network is constructed to obtain a high-precision wind speed prediction model; The high-precision wind speed prediction model is optimized using a joint loss function to obtain a high-precision wind speed prediction result.
2. A high-precision wind speed prediction method according to claim 1, characterized in that: Preprocessing the digital elevation model data and meteorological data includes: Using a transformation matrix to unify the coordinates of the digital elevation model data to obtain first digital elevation model data; The meteorological data are resampled using the bicubic interpolation method, and the meteorological data are aligned in time and space. Continuous data in the same time range are selected to obtain the first meteorological data.
3. A high-precision wind speed prediction method according to claim 2, characterized in that: The terrain feature vector includes: Taking the three-channel topographic map in the first digital elevation model data as input data, performing preliminary feature extraction through two-dimensional convolution to obtain a first feature map; The first feature map is subjected to layer normalization processing, and the processed first feature map enters multiple depth-wise separable convolution blocks, and multi-scale features are extracted using depth-wise separable convolution, layer normalization, multi-layer perceptron expansion and activation function; The improved pure convolutional neural network is used to gradually downsample to reduce the spatial resolution and increase the number of channels to obtain the second feature map; Using the improved pure convolutional neural network to perform global average pooling on the second feature map, a global average pooled feature vector is obtained; The globally averaged pooled feature vector is normalized by layers and mapped through a fully connected layer to obtain the terrain feature vector.
4. A high-precision wind speed prediction method according to claim 3, characterized in that: Meteorological feature vectors include: The terrain feature vector and the first meteorological feature vector output by the terrain feature encoder and the meteorological time series encoder are used as inputs of the deep learning model; Based on the terrain feature vector and the first meteorological feature vector, the spatial attention mechanism and the temporal attention mechanism are calculated to obtain a spatially updated feature representation and a temporally updated feature representation; The spatially updated feature representation and the temporally updated feature representation are fused using an additive fusion strategy to output a meteorological feature vector.
5. A high-precision wind speed prediction method according to claim 4, characterized in that: Using a gated attention mechanism to fuse the terrain features and the meteorological features includes: The terrain feature vector and the meteorological feature vector are input into the gating mechanism, and the terrain feature vector and the meteorological feature vector are weighted by the weight matrix and the bias term to obtain the gating signal; The weights of the terrain feature vector and the meteorological feature vector are adjusted according to the gating signal, and the terrain feature vector and the meteorological feature vector are fused by weighted averaging to obtain a fused feature vector.
6. A high-precision wind speed prediction method according to claim 5, characterized in that: Constructing a multi-scale gated adaptive causal temporal network includes: Obtain historical meteorological data and use it as input for adaptive time-step convolution; For each time step, the gate parameters of the adaptive time step convolution are calculated, the time step of the convolution operation is adjusted, and the feature representation after the time step adjustment is obtained; The feature representation after time step adjustment is input into the extended causal convolution, and the feature representation after causal convolution is obtained through causal convolution calculation; The feature representation after causal convolution is input into the multi-scale feature fusion, and convolution operations are performed using convolution kernels of different sizes to obtain multi-scale feature representation; The feature representation after time step adjustment, the feature representation after causal convolution and the multi-scale feature representation are spliced in the channel dimension to obtain the spatiotemporal joint feature; The spatiotemporal joint features are reduced in dimension through the fully connected layer, and the wind speed prediction value is obtained by activation function calculation.
7. A high-precision wind speed prediction method according to claim 6, characterized in that: Optimizing the high-precision wind speed prediction model using a joint loss function includes: The joint loss function includes mean square error loss, quantile loss and terrain gradient constraint loss; Perform weighted summation of the loss terms to obtain the joint loss function; The optimizer is used to update the gradient and combined with the learning rate decay strategy to optimize the high-precision wind speed prediction model and obtain high-precision wind speed prediction results.
8. A high-precision wind speed prediction system, using a high-precision wind speed prediction method according to any one of claims 1 to 7, characterized in that: include: a preprocessing module, configured to obtain digital elevation model data and meteorological data, and preprocess the digital elevation model data and meteorological data to obtain first digital elevation model data and first meteorological data; a feature extraction module, configured to extract features from the first digital elevation model data and the first meteorological data, respectively, to obtain a terrain feature vector and a meteorological feature vector; a fusion module, configured to fuse the terrain feature vector and the meteorological feature vector using a gated attention mechanism to obtain a joint feature vector; A model building module is used to take the joint feature vector as input, combine adaptive time step convolution and extended causal convolution, build a multi-scale gated adaptive causal temporal network, and obtain a high-precision wind speed prediction model; The model optimization module is used to optimize the high-precision wind speed prediction model using a joint loss function to obtain a high-precision wind speed prediction result.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a high-precision wind speed prediction method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the steps of a high-precision wind speed prediction method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Power transmission line fault rate prediction model training method and system based on machine learning
CN121211291A
Task sensitive learning-based interpretable typhoon path and strength prediction method
CN121278656A
Photovoltaic base guarantee power prediction method based on hierarchical graph neural network and joint loss function
CN121614816A