A wind speed prediction method, device and storage medium
Through the graph convolution and continuous residual spatiotemporal module combined with the Informer model, the spatiotemporal characteristics of wind speed data are extracted and fused, which solves the problem of low accuracy and stability in wind speed prediction and achieves more efficient wind speed prediction.
Patent Information
- Application Number
- CN202411155214.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-22
AI Technical Summary
The prior art has problems of low accuracy and stability in wind speed prediction, especially when processing the non-stationarity and multi-scale characteristics of wind speed data, it is difficult to take into account both the time dependence and spatial dynamics.
The graph convolution module and the continuous residual space-time module are combined with the Informer encoder and decoder to extract the space-time map matrix of the weather station through graph convolution, and the continuous residual space-time module extracts the spatial and timing characteristics, and performs feature fusion and inputs to the Informer The decoder performs wind speed prediction and uses the kernel loss function for model training.
It improves the accuracy and stability of wind speed prediction, especially in the capture of long-term dependencies and the fusion of spatiotemporal features, enhances the stability and efficiency of training, and alleviates the problem of gradient vanishing.
Smart Images

Figure CN118673464B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a wind speed prediction method, a device and a storage medium, and belongs to the technical field of wind speed prediction. Background Art
[0002] As the global demand for renewable energy continues to grow, wind energy, as a clean renewable energy source, plays an important role in energy structure adjustment and environmental protection. However, due to the strong randomness and volatility of wind speed changes, accurate wind speed prediction is crucial to improving wind farm operating efficiency and grid stability. Traditional wind speed prediction methods mainly include statistical methods, physical methods, and machine learning-based methods.
[0003] Statistical methods such as the autoregressive moving average model and the seasonal autoregressive integrated moving average model perform well in processing linear and periodic data, but they are not effective in processing nonlinear characteristics and mutations in wind speed data. Physical methods simulate atmospheric physical processes to predict wind speed. Although they have high theoretical accuracy, they require high computing resources and have limited prediction effects on short time scales.
[0004] In recent years, prediction methods based on machine learning have received extensive attention and research. These methods make predictions by learning complex patterns and features in historical data, and can better handle nonlinear features in the data. However, existing machine learning methods still have certain limitations when dealing with the non-stationarity and multi-scale characteristics of wind speed data. Traditional methods have their own advantages in feature extraction in a single time dimension or spatial dimension, but it is often difficult to take into account the complexity of both at the same time. Therefore, a single time series feature extraction method may ignore spatial dynamics, while a single spatial feature extraction method may ignore time dependencies; in summary, the existing technology still has problems with low accuracy and stability in predicting wind speed. Summary of the invention
[0005] The purpose of the present invention is to provide a wind speed prediction method, device and storage medium to solve the problems of low accuracy and stability in wind speed prediction in the prior art.
[0006] To achieve the above objectives, the present invention is implemented by adopting the following technical solutions:
[0007] In a first aspect, the present invention provides a wind speed prediction method, comprising:
[0008] Acquire denoised meteorological data, where the meteorological data includes measurement values of multiple meteorological elements within a preset historical time;
[0009] Inputting the denoised meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time and complete the wind speed prediction;
[0010] In the wind speed prediction model, the denoised meteorological data is processed as follows:
[0011] Input the denoised meteorological data into a graph convolution module to construct a spatiotemporal graph matrix of a weather station;
[0012] Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features;
[0013] Fusing the spatial feature and the temporal feature to obtain a fused feature;
[0014] The fused features are input into the Informer decoder to predict the wind speed and obtain the wind speed at a preset future time.
[0015] Furthermore, the denoised meteorological data is obtained by the following method:
[0016] Performing maximum and minimum normalization on the collected meteorological data to scale the collected meteorological data to between 0 and 1 to obtain normalized meteorological data;
[0017] The normalized meteorological data is subjected to continuous wavelet transform to remove high-frequency noise, thereby completing denoising and obtaining denoised meteorological data.
[0018] Furthermore, the maximum and minimum normalization is performed by the following formula:
[0019] ;
[0020] in, x is the meteorological data before scaling, min ( x ) is the minimum meteorological data collected, max ( x ) is the maximum meteorological data collected, x norm is the scaled meteorological data;
[0021] The continuous wavelet transform is performed by the following formula:
[0022] ;
[0023] in, s is the scaling factor, τ is the translation factor, x ( t )yes t The meteorological data at time, Ψ(•) is the Morlet wavelet function, Ψ * (•) is the complex conjugate of Ψ(•),T is the time step, CWT( s , τ ) is the meteorological data after continuous wavelet transform.
[0024] Furthermore, the expression of the graph convolution module is:
[0025] ;
[0026] in, X out is the weather station space-time map matrix, X in is the denoised meteorological data, is the adjacency matrix, yes The degree matrix of .
[0027] Furthermore, the expression for extracting spatial features by the continuous residual spatiotemporal module is:
[0028] ;
[0029] ;
[0030] in, X out is the weather station space-time map matrix, F (•) is the spatial convolution operation, G (•) is the temporal convolution operation, BN (•)yes BN function, ReLU (•)yes ReLU Activation function, It is the intermediate result output after a layer of residual spatiotemporal module. Y out It is the spatial feature output after two layers of residual spatiotemporal modules.
[0031] Furthermore, the expression of the feature fusion is:
[0032] ;
[0033] in, X in,1 is the time series feature, Y out It is the spatial feature output after two layers of residual spatiotemporal modules. M (•) is the multi-scale channel attention module, ⊕ represents weighted fusion, represents the multiplication of each element, Z It is a fusion feature.
[0034] Furthermore, the expression for wind speed prediction by the Informer decoder is:
[0035] ;
[0036] ;
[0037] ;
[0038] ;
[0039] ;
[0040] in, is the input sequence of the embedded Informer decoder, x dec is the input sequence of the Informer decoder, x mark_dec is the time stamp of the target sequence, Concat (•) indicates an embedding operation, dec _ out 1 is the first intermediate output, dec _ out 2 is the second intermediate output, dec _ out is the third intermediate output, LayerNorm represents the residual connection operation, mask dec is a mask used to prevent information leakage. mask cross is a mask for the criss-cross attention mechanism, MaskedMultiHeadSelfAttention represents the masked multi-head attention mechanism, Z is the fusion feature, MultiHeadAttention represents the multi-head attention mechanism, FeedForward represents a feed-forward neural network, Linear represents a linear layer, yes t The wind speed prediction model predicts the value at the moment.
[0041] Furthermore, the wind speed prediction model uses a kernel loss function as a loss function during training. In each training cycle, the training data is input into the wind speed prediction model, the kernel loss function is calculated, and the parameters of the wind speed prediction model are updated according to the kernel loss function and the following formula:
[0042] ;
[0043] in, θ ( k ) is the k The parameters of the training cycle, θ ( k- 1) is the k- Parameters for 1 training cycle, α is the learning rate, is the gradient of the parameter;
[0044] The expression of the kernel loss function is:
[0045] ;
[0046] in, L KMSE is the kernel loss function, N is the total time, parameter , y t yes t The true value of the wind speed prediction model at the moment, yes t The wind speed prediction model predicts the value at the moment.
[0047] In a second aspect, the present invention provides a wind speed prediction device, comprising:
[0048] The data acquisition module is configured to: acquire denoised meteorological data, wherein the meteorological data includes measurement values of multiple meteorological elements within a preset historical time;
[0049] The wind speed prediction module is configured to: input the denoised meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time, and complete the wind speed prediction;
[0050] In the wind speed prediction model, the denoised meteorological data is processed as follows:
[0051] Input the denoised meteorological data into a graph convolution module to construct a spatiotemporal graph matrix of a weather station;
[0052] Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features;
[0053] Fusing the spatial feature and the temporal feature to obtain a fused feature;
[0054] The fused features are input into the Informer decoder to predict the wind speed and obtain the wind speed at a preset future time.
[0055] In a third aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the wind speed prediction method described in any one of the first aspects.
[0056] Compared with the prior art, the beneficial effects achieved by the present invention are:
[0057] The present invention provides a wind speed prediction method, device and storage medium, which, by setting a continuous residual spatiotemporal module and utilizing a residual structure, reduce the loss of input information and effectively alleviate the gradient vanishing problem, thereby enhancing the stability and efficiency of training and improving the performance of the wind speed prediction model in capturing long-distance dependencies and subtle features, thereby effectively improving the accuracy and stability of wind speed prediction, and particularly showing excellent performance in capturing long-term dependencies and fusing spatiotemporal features. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 is a flow chart of a wind speed prediction method provided by an embodiment of the present invention;
[0059] Figure 2 Schematic diagram of the training process of the wind speed prediction model provided by an embodiment of the present invention;
[0060] Figure 3 It is a structural diagram of the continuous residual spatiotemporal module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the protection scope of the present invention. Example
[0062] like Figure 1 As shown, the present invention provides a wind speed prediction method, comprising:
[0063] S1. Obtain denoised meteorological data, where the meteorological data includes measurement values of multiple meteorological elements within a preset historical time.
[0064] S2. Input the denoised meteorological data into the trained wind speed prediction model to obtain the wind speed at a preset future time and complete the wind speed prediction.
[0065] In the wind speed prediction model, the denoised meteorological data is processed as follows:
[0066] The denoised meteorological data is input into the graph convolution module to construct the spatiotemporal graph matrix of the weather station;
[0067] The weather station space-time map matrix is input into the continuous residual space-time module to extract spatial features, and the weather station space-time map matrix is input into the informer encoder to extract temporal features;
[0068] Fuse the spatial features and temporal features to obtain fused features;
[0069] The fused features are input into the Informer decoder for wind speed prediction to obtain the wind speed at the preset future moment.
[0070] The graph convolution operation used in the present invention is intended to extract and fuse features between weather stations.
[0071] The present invention provides a continuous residual spatiotemporal module, wherein the residual structure reduces the loss of input information, effectively alleviates the gradient vanishing problem, and enhances the stability and efficiency of training.
[0072] In the present invention, an encoder of the Informer model (Informer encoder) is used to process the wind speed time series and extract the time series features. Through the Informer encoder, the time information in the wind speed data is effectively captured. The Informer encoder is a stacked structure composed of multiple layers of sparse self-attention layers and feedforward neural networks. The Informer encoder uses its unique sparse self-attention mechanism to sparse the self-attention calculation, greatly improving the computational efficiency. The Informer encoder can extract the time series features of the wind speed time series, which reflect the complex time dependencies in the data. The time series features output by the Informer encoder contain the time information of the wind speed series, which serves as one of the subsequent features to be fused.
[0073] The self-attention mechanism of the Informer decoder allows each decoder layer to take into account information from all previous steps when generating output. This is achieved by calculating the self-attention score of the decoder input, similar to the encoder, but the decoder uses masked self-attention to prevent information leakage.
[0074] In summary, the present invention sets a continuous residual spatiotemporal module and utilizes the residual structure to reduce the loss of input information and effectively alleviate the gradient vanishing problem, thereby enhancing the stability and efficiency of training and improving the performance of the wind speed prediction model in capturing long-distance dependencies and subtle features, thereby effectively improving the accuracy and stability of wind speed prediction, and showing excellent performance in capturing long-term dependencies and fusing spatiotemporal features. Example
[0075] The present invention provides a wind speed prediction method, comprising:
[0076] S1. Obtain denoised meteorological data, where the meteorological data includes measurement values of multiple meteorological elements within a preset historical time.
[0077] In this embodiment, the preset historical time is the past 96 hours, and the multiple measurement values include all measurement values measured every 1 hour.
[0078] The shape of the collected raw meteorological data is C × T × V 1. Scale the original meteorological data to between 0 and 1 through maximum and minimum normalization. The scaling is performed using the following formula:
[0079] ;
[0080] in, x is the meteorological data before scaling, min ( x ) is the minimum meteorological data collected, max ( x ) is the maximum meteorological data collected, x norm is the scaled meteorological data.
[0081] Continuous wavelet transform can be used for multi-scale analysis and feature extraction, and wavelet decomposition is used to remove noise in meteorological data. Continuous wavelet transform observes signal characteristics at different scales by convolving the signal with a series of scaled and translated wavelet functions. Continuous wavelet transform is very suitable for processing wind speed in meteorological data, which is non-stationary and affected by meteorological elements of different scales. In the present invention, Morlet wavelet function is used as the mother wavelet function to perform multi-scale analysis on the wind speed time series, remove high-frequency noise, and extract effective features.
[0082] The continuous wavelet transform is performed by the following formula:
[0083] ;
[0084] in, s is the scaling factor, τ is the translation factor, x ( t )yes t The meteorological data at the time, Ψ(•) is the Morlet wavelet function, Ψ * (•) is the complex conjugate of Ψ(•), T is the time step, CWT( s , τ ) is the meteorological data after continuous wavelet transform.
[0085] The main advantage of using Morlet wavelet for CWT (continuous wavelet transform) is its good time-frequency localization characteristics, which can retain the time and frequency information of the signal at the same time. Multi-scale analysis can decompose the different frequency components of the signal and effectively remove noise. At the same time, it has strong feature extraction capabilities and can effectively capture the periodic changes and non-stationary characteristics in the wind speed signal.
[0086] S2. Input the denoised meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time, thereby completing the wind speed prediction.
[0087] The training and validation data come from two real meteorological datasets from the Netherlands and Denmark. The real meteorological dataset from Denmark contains hourly measurements of four meteorological elements: temperature, air pressure, wind speed, and wind direction. Each measurement includes five cities in Denmark. The real meteorological data from the Netherlands contains meteorological data from seven cities, including hourly measurements of six meteorological elements: wind speed, wind direction, temperature, dew point, air pressure, and rainfall.
[0088] After the model is built, it is necessary to train and verify the model to ensure its effectiveness and generalization ability in the wind speed prediction task. The training and verification process is as follows: Figure 2 shown.
[0089] like Figure 2 As shown in Figure 1, the historical wind speed data is first divided into a training set and a validation set. The training set is used for model training, and the validation set is used to evaluate model performance. During the training process, the kernel loss function is selected as the loss function to measure the gap between the model prediction value and the true value.
[0090] Using the Gaussian kernel function as the kernel function, the expression is as follows:
[0091] ;
[0092] in, is the Gaussian kernel function with parameters , y t yes t The true value of the wind speed prediction model at the moment, yes t The wind speed prediction model predicts the value at the moment.
[0093] Then the kernel loss function can be expressed as:
[0094] ;
[0095] in, L KMSE is the kernel loss function, N is the total time.
[0096] The optimization algorithm uses the Adam algorithm (adaptive motion estimation algorithm). The Adam algorithm can efficiently process large-scale data and has a fast convergence speed. The parameter update formula of the optimization process is:
[0097] ;
[0098] in, θ ( k ) is the k The parameters of the training cycle, θ ( k- 1) is the k- Parameters for 1 training cycle, α is the learning rate, is the gradient of the parameter.
[0099] In each training cycle, the training data is input into the constructed wind speed prediction model, the loss is calculated and the parameters are updated.
[0100] like Figure 2 As shown in the figure, in the wind speed prediction model, the denoised meteorological data is processed as follows:
[0101] The denoised meteorological data is input into the graph convolution module to construct the spatiotemporal graph matrix of the weather station;
[0102] The weather station space-time map matrix is input into the continuous residual space-time module to extract spatial features, and the weather station space-time map matrix is input into the informer encoder to extract temporal features;
[0103] Fuse the spatial features and temporal features to obtain fused features;
[0104] The fused features are input into the Informer decoder for wind speed prediction to obtain the wind speed at the preset future moment.
[0105] The expression of the graph convolution module is:
[0106] ;
[0107] in, X out is the weather station space-time map matrix, X in is the denoised meteorological data, is the adjacency matrix, yes The degree matrix of is equal to the sum of the weights of all neighboring nodes of the th node.
[0108] The graph convolution operation used in this paper aims to extract and fuse features between weather stations. Given an input tensor X in , whose shape is C × T × V 1, where C is the number of features for each city, T is the time step. The present invention sets the time step of the data to 1.V 1. To perform graph convolution, we first process the input tensor into CT × V 1 Input Matrix X in The core of graph convolution is to integrate the information of each node and its neighbors through the adjacency matrix. In the wind speed prediction model, the present invention adopts a standardized learning adjacency matrix and applies a symmetric normalization technique, using the node degree matrix , the adjacency matrix And its degree matrix Obtained through conversion.
[0109] The expression of the continuous residual space-time module is:
[0110] ;
[0111] ;
[0112] in, X out It is a time-space diagram of the weather station. F (•) is the spatial convolution operation, G (•) is the temporal convolution operation, BN (•)yes BN function, ReLU (•)yes ReLU Activation function, It is the intermediate result output after a layer of residual spatiotemporal module. Y out It is the spatial feature output after two layers of residual spatiotemporal modules.
[0113] The relationship between weather stations is captured through spatial and temporal convolution, but there are problems of gradual information loss and gradient vanishing. This will cause the model to perform poorly in capturing long-distance dependencies and subtle features, and deep network training is difficult. Although batch normalization and ReLU activation function improve training speed and nonlinear expression ability, these methods cannot solve the above problems well. Therefore, the present invention proposes a continuous residual spatiotemporal module. The residual structure reduces the loss of input information, effectively alleviates the gradient vanishing problem, and enhances the stability and efficiency of training. Figure 3 As shown, the present invention adds a batch normalization (BN) layer and a ReLU activation function after the spatial convolution and the temporal convolution, respectively, and adds a continuous residual.
[0114] In the present invention, an encoder of the informer model (informer encoder) is used to process the wind speed time series and extract the time series features. The encoder effectively captures the time information in the wind speed data.
[0115] The Informer encoder is a stacked structure consisting of multiple layers of sparse self-attention layers and feedforward neural networks. The encoder uses its unique sparse self-attention mechanism to sparse the self-attention calculation, greatly improving the computational efficiency.
[0116] (1) Sparse self-attention mechanism.
[0117] The traditional self-attention mechanism needs to calculate the similarity between all time steps, and the computational complexity is O ( L 2 ),in L is the number of time steps. The sparse self-attention mechanism reduces the computational complexity by selecting important attention distributions. The specific steps are as follows:
[0118] 1) Query and key generation;
[0119] For the input sequence X Perform matrix calculations to generate query matrices Q and key K :
[0120] Q = XW Q , K = XW K ;
[0121] in, W Q and W K is a trainable weight matrix.
[0122] 2) Calculate the coefficient attention distribution;
[0123] Use the probabilistic sparsification method to keep only the important parts of the attention distribution. By selecting the query matrix that contributes the most to the attention, calculate its similarity with the key:
[0124] ;
[0125] in, d k is the dimension of the key, softmax(•) is the softmax function, Attention( Q , K ) represents the query matrix Q and key K The similarity of T Indicates transpose.
[0126] 3) Weighted sum of values;
[0127] The output is obtained by weighted summing the attention weights and the corresponding values:
[0128] ;
[0129] in, V is the matrix obtained by linear transformation of the input sequence, V = XW V , W V is a trainable weight matrix, Attention( Q , K , V ) is the output of the weighted sum step in the sparse self-attention mechanism.
[0130] (2) Informer encoder processing flow.
[0131] 1) Input embedding;
[0132] Will X The input is fed into the Informer encoder, which is converted into a high-dimensional representation through the embedding layer.
[0133] 2) Multi-head self-attention mechanism;
[0134] Perform multi-head attention calculation on the input sequence. This mechanism captures the subspace information of the input sequence by calculating multiple independent attention heads in parallel:
[0135] ;
[0136] Among them, each attention head head i (No. i attention heads) are independent self-attention calculations, head 1, head 2,…, head h Respectively represent the 1st to the h Attention head, W O is a trainable weight matrix, MultiHead represents the multi-head attention mechanism, Concat (•) indicates an embedding operation.
[0137] 3) Feedforward neural network and residual connection;
[0138] Process the output of the multi-head self-attention mechanism through a feedforward neural network:
[0139] ;
[0140] in, W 1 and W 2 is the weight matrix, b 1 and b 2 is the bias vector, ReLU (•)yes ReLU Activation function, FFN ( x 1) is the output of the feedforward neural network, x 1 is the output of the multi-head self-attention mechanism.
[0141] After each self-attention layer and feed-forward neural network layer, residual connections and layer normalization are included to help stabilize model training and accelerate convergence:
[0142] LN ( x 1+ SL ( x 1));
[0143] in, LN (•) represents residual connection, SL (•) represents the sub-layer operation, which can be expressed as a multi-layer self-attention mechanism or a feed-forward neural network.
[0144] Through the above processing flow, the Informer encoder can extract the time series features of the wind speed time series, which reflect the complex time dependencies in the data. The time series features output by the Informer encoder contain the time information of the wind speed series, which serves as one of the features to be fused later.
[0145] Assuming that spatial features have a larger receptive field than temporal features, a multi-scale channel attention module is used in the attention fusion framework. M (•) Assign weights to each feature for selection and weighted averaging.
[0146] The expression of feature fusion is:
[0147] ;
[0148] in, X in,1 is the time series feature, Y out is the spatial feature, M (•) is the multi-scale channel attention module, ⊕ represents weighted fusion, represents the multiplication of each element, Z It is a fusion feature.
[0149] In this paper, the informer decoder is used as the final predictor. The present invention uses a standard decoder consisting of two multi-head attention layers. The self-attention mechanism of the informer decoder allows each decoder layer to consider the information of all previous steps when generating the output. This is achieved by calculating the self-attention score of the decoder input, similar to the encoder, but the decoder uses masked self-attention to prevent information leakage.
[0150] The processing flow of the informer decoder includes:
[0151] (1) The input sequence of the Informer decoder x dec and the time stamp of the target sequence x mark_dec Embed and get the embedded representation (i.e. the input sequence of the Informer decoder after embedding):
[0152] ;
[0153] (2) Input the embedded decoder into the sequence and fusion features Z Input to the decoder, prevent information leakage by using a mask to ensure that each position can only pay attention to its previous position, and then compare the output result with the initial input Make a residual connection:
[0154] ;
[0155] (3) The first intermediate output obtained in step (2) dec _ out 1 performs cross attention fusion and dec _ out 1 Perform residual fusion:
[0156] ;
[0157] (4) The second intermediate output obtained in step (3) dec _ out 2 After the feedforward neural network and residual fusion, the third intermediate output is obtained, which is the final output dec _ out , and finally after a linear layer, we get the final prediction result:
[0158] ;
[0159] ;
[0160] in, is the input sequence of the embedded Informer decoder, x dec is the input sequence of the Informer decoder, x mark_dec is the time stamp of the target sequence, Concat (•) indicates an embedding operation, dec _ out 1 is the first intermediate output, dec _ out 2 is the second intermediate output, dec _ out is the third intermediate output, LayerNorm represents the residual connection operation, mask dec is a mask used to prevent information leakage. mask cross is a mask for the criss-cross attention mechanism, MaskedMultiHeadSelfAttention represents the masked multi-head attention mechanism, Z is the fusion feature, MultiHeadAttention represents the multi-head attention mechanism, FeedForward represents a feed-forward neural network, Linear represents a linear layer, yes t The wind speed prediction model predicts the value at the moment.
[0161] In order to verify the effect of the present invention, the following wind speed prediction test was performed:
[0162] For the wind speed forecast in Denmark, the wind speeds of the three cities of Esbjerg, Odense and Roskilde were predicted, and the proposed WST-Informer model (the model proposed in the present invention) was compared with multiple baseline models. The average MAE (mean absolute error) and MSE (mean square error) of various prediction models in different prediction time periods (6h, 12, 18h, 24h) are recorded in Table 1. It can be seen from Table 1 that the model provided by the present invention is compared with the Informer model with better time series prediction performance, and the MAE results of 6h, 12h, 18h, and 24h are reduced by 0.033, 0.033, 0.046, and 0.073, respectively, and compared with the single WeatherGCNet model, the final MAE is reduced by 0.085, 0.196, 0.245, and 0.222, respectively. It can be seen that the final results of the model provided by the present invention are better than the Informer and WeatherGCNet models. The full spelling + Chinese of the abbreviations of each model in Table 1 and Table 2 are as follows: 2D is a two-dimensional convolution model, 2D+attention is a two-dimensional attention convolution model, 2D+upscling is a two-dimensional upsampling convolution model, 3D is a three-dimensional convolution model, Multidimensional is a multi-dimensional convolution model, WeatherGCNet is a weather forecast graph convolution network, Informer is an efficient transformer model for ultra-long sequence time prediction (an efficient Transformer model, a variant of Transformer), and WST-Informer is a wind speed prediction model provided by the present invention.
[0163] Table 1 - Average MAE and MSE of wind speed forecasts for Danish urban meteorological data
[0164]
[0165] For the Netherlands dataset, the prediction target is the wind speed of all cities, and the wind speed is predicted for the next 2, 4, 6, 8, and 10 hours. The final MAE and MSE of the wind speed prediction are shown in Table 2. Compared with Informer, the MAE of each time period is reduced by 0.58, 0.26, 0.32, 0.42, and 0.41, respectively. Compared with the results of the WeatherGCNet model, the MAE of the present invention is reduced by 0.64, 1.34, 1.67, 2.23, and 2.48, respectively.
[0166] Table 2 - Average MAE and MSE of wind speed prediction for Dutch cities
[0167]
[0168] The two experimental results show that the WST-Informer model provided by the present invention has great advantages in processing time dependency and extracting spatial features, especially in processing the prediction of longer time series, and can better capture and predict wind speed changes. Example
[0169] The present invention provides a wind speed prediction device, comprising:
[0170] The data acquisition module is configured to: acquire denoised meteorological data, wherein the meteorological data includes measurement values of multiple meteorological elements within a preset historical time;
[0171] The wind speed prediction module is configured to: input the meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time and complete the wind speed prediction;
[0172] In the wind speed prediction model, the meteorological data is processed as follows:
[0173] Input the meteorological data into the graph convolution module to construct a spatiotemporal graph matrix of the weather station;
[0174] Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features;
[0175] Fusing the spatial feature and the temporal feature to obtain a fused feature;
[0176] The fused features are input into the Informer decoder to predict the wind speed and obtain the wind speed at a preset future time.
[0177] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 2 and will not be elaborated here. Example
[0178] The present invention provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the wind speed prediction method provided in Example 1 are implemented:
[0179] Acquire denoised meteorological data, the meteorological data comprising a plurality of measurement values of a plurality of meteorological elements within a preset historical time;
[0180] Input the meteorological data into the trained wind speed prediction model to obtain the wind speed at a preset future time and complete the wind speed prediction;
[0181] In the wind speed prediction model, the meteorological data is processed as follows:
[0182] Input the meteorological data into the graph convolution module to construct a spatiotemporal graph matrix of the weather station;
[0183] Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features;
[0184] Fusing the spatial feature and the temporal feature to obtain a fused feature;
[0185] The fused features are input into the Informer decoder to predict the wind speed and obtain the wind speed at a preset future time.
[0186] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0187] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0190] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A wind speed prediction method, It is characterized in that include: Acquire denoised meteorological data, where the meteorological data includes measurement values of multiple meteorological elements within a preset historical time; Inputting the denoised meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time and complete the wind speed prediction; In the wind speed prediction model, the denoised meteorological data is processed as follows: Input the denoised meteorological data into a graph convolution module to construct a spatiotemporal graph matrix of a weather station; Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features; Fusing the spatial feature and the temporal feature to obtain a fused feature; The fused features are input into the Informer decoder to predict the wind speed, and the wind speed at a preset future time is obtained; The expression for extracting spatial features by the continuous residual spatiotemporal module is: ; ; in, X out is the weather station space-time map matrix, F (•) is the spatial convolution operation, G (•) is the temporal convolution operation, BN (•)yes BN function, ReLU (•)yes ReLU Activation function, It is the intermediate result output after a layer of residual spatiotemporal module. Y out It is the spatial feature output after two layers of residual spatiotemporal modules; The expression of the feature fusion is: ; in, X in,1 is the time series feature, Y out It is the spatial feature output after two layers of residual spatiotemporal modules. M (•) is the multi-scale channel attention module, ⊕ represents weighted fusion, represents the multiplication of each element, Z It is a fusion feature; The expression for wind speed prediction by the Informer decoder is: ; ; ; ; ; in, is the input sequence of the embedded Informer decoder, x dec is the input sequence of the Informer decoder, x mark_dec is the time stamp of the target sequence, Concat (•) indicates an embedding operation, dec _ out 1 is the first intermediate output, dec _ out 2 is the second intermediate output, dec _ out is the third intermediate output, LayerNorm represents the residual connection operation, mask dec is a mask used to prevent information leakage. mask cross is a mask for the criss-cross attention mechanism, MaskedMultiHeadSelfAttention represents the masked multi-head attention mechanism, Z is the fusion feature, MultiHeadAttention represents the multi-head attention mechanism, FeedForward represents a feed-forward neural network, Linear represents a linear layer, yes t The wind speed prediction model predicts the value at the moment.
2. The wind speed prediction method according to claim 1, It is characterized in that The denoised meteorological data is obtained by the following method: Performing maximum and minimum normalization on the collected meteorological data to scale the collected meteorological data to between 0 and 1 to obtain normalized meteorological data; The normalized meteorological data is subjected to continuous wavelet transform to remove high-frequency noise, thereby completing denoising and obtaining denoised meteorological data.
3. The wind speed prediction method according to claim 2, It is characterized in that The maximum and minimum normalization is performed by the following formula: ; in, x is the meteorological data before scaling, min ( x ) is the minimum meteorological data collected, max ( x ) is the maximum meteorological data collected, x norm is the scaled meteorological data; The continuous wavelet transform is performed by the following formula: ; in, s is the scaling factor, τ is the translation factor, x ( t )yes t The meteorological data at the time, Ψ(•) is the Morlet wavelet function, Ψ * (•) is the complex conjugate of Ψ(•), T is the time step, CWT( s , τ ) is the meteorological data after continuous wavelet transform.
4. The wind speed prediction method according to claim 1, It is characterized in that The expression of the graph convolution module is: ; in, X out is the weather station space-time map matrix, X in is the denoised meteorological data, is the adjacency matrix, yes The degree matrix of .
5. The wind speed prediction method according to claim 1, It is characterized in that The wind speed prediction model adopts the kernel loss function as the loss function during training. In each training cycle, the training data is input into the wind speed prediction model, the kernel loss function is calculated, and the parameters of the wind speed prediction model are updated according to the kernel loss function and the following formula: ; in, θ ( k ) is the k The parameters of the training cycle, θ ( k- 1) is the k- Parameters for 1 training cycle, α is the learning rate, is the gradient of the parameter; The expression of the kernel loss function is: ; in, L KMSE is the kernel loss function, N is the total time, parameter , y t yes t The true value of the wind speed prediction model at the moment, yes t The wind speed prediction model predicts the value at the moment.
6. A wind speed prediction device, It is characterized in that include: The data acquisition module is configured to: acquire denoised meteorological data, wherein the meteorological data includes measurement values of multiple meteorological elements within a preset historical time; The wind speed prediction module is configured to: input the denoised meteorological data into a trained wind speed prediction model to obtain the wind speed at a preset future time, and complete the wind speed prediction; In the wind speed prediction model, the denoised meteorological data is processed as follows: Input the denoised meteorological data into a graph convolution module to construct a spatiotemporal graph matrix of a weather station; Input the weather station space-time map matrix into the continuous residual space-time module to extract spatial features, and input the weather station space-time map matrix into the informer encoder to extract temporal features; Fusing the spatial feature and the temporal feature to obtain a fused feature; The fused features are input into the Informer decoder to predict the wind speed, and the wind speed at a preset future time is obtained; Among them, the expression for extracting spatial features by the continuous residual spatiotemporal module is: ; ; in, X out is the weather station space-time map matrix, F (•) is the spatial convolution operation, G (•) is the temporal convolution operation, BN (•)yes BN function, ReLU (•)yes ReLU Activation function, It is the intermediate result output after a layer of residual spatiotemporal module. Y out It is the spatial feature output after two layers of residual spatiotemporal modules; The expression of the feature fusion is: ; in, X in,1 is the time series feature, Y out It is the spatial feature output after two layers of residual spatiotemporal modules. M (•) is the multi-scale channel attention module, ⊕ represents weighted fusion, represents the multiplication of each element, Z It is a fusion feature; The expression for wind speed prediction by the Informer decoder is: ; ; ; ; ; in, is the input sequence of the embedded Informer decoder, x dec is the input sequence of the Informer decoder, x mark_dec is the time stamp of the target sequence, Concat (•) indicates an embedding operation, dec _ out 1 is the first intermediate output, dec _ out 2 is the second intermediate output, dec _ out is the third intermediate output, LayerNorm represents the residual connection operation, mask dec is a mask used to prevent information leakage. mask cross is a mask for the criss-cross attention mechanism, MaskedMultiHeadSelfAttention represents the masked multi-head attention mechanism, Z is the fusion feature, MultiHeadAttention represents the multi-head attention mechanism, FeedForward represents a feed-forward neural network, Linear represents a linear layer, yes t The wind speed prediction model predicts the value at the moment.
7. A computer-readable storage medium having a computer program / instructions stored thereon, It is characterized in that When the computer program / instruction is executed by a processor, the steps of the wind speed prediction method according to any one of claims 1 to 5 are implemented.
