Multi-point wind speed space-time prediction method and system
By constructing a physical information neural network model based on Transformer and the N-S equation, the problem of ignoring spatial correlation and physical mechanism in wind speed prediction is solved, and short-term accurate prediction of wind speed is achieved, providing a more comprehensive basis for strong wind warnings. .
Patent Information
- Application Number
- CN202410996725.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The existing wind speed prediction methods ignore the physical mechanisms of wind speed spatial correlation and wind speed changes, resulting in inaccurate predictions.
Using the multi-point wind speed spatiotemporal prediction method, by constructing a physical information neural network model based on Transformer, combining the N-S equation, the geographical, wind power and meteorological parameters of multiple measurement points are used to pre-process and predict wind speed data, and the physics of wind speed changes is considered law.
It realizes short-term prediction of wind speed, captures long-term dependence in wind speed data, provides a more accurate and comprehensive basis for strong wind warning, and is suitable for high-speed railways, wind farms and other fields.
Smart Images

Figure CN119168112A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of regional wind speed prediction, and in particular to a multi-point wind speed spatiotemporal prediction method and system. Background Art
[0002] As the country attaches great importance to infrastructure construction, the scale of engineering construction has expanded year by year, and the construction of large-scale engineering projects in the fields of highways, high-speed railways, wind farms and photovoltaic power plants has increased. However, large-scale engineering projects are easily threatened by strong winds due to their large size. Among them, the speed increase of trains has increased the importance of strong crosswind factors, and serious traffic safety accidents such as train derailment and rollover caused by strong winds are common; strong winds are an important factor in the operation of wind farms, but the damage to wind power equipment and power grid fluctuations caused by extreme strong winds cannot be ignored; similarly, strong wind environments have a great impact on the normal and stable operation of photovoltaic brackets and components in photovoltaic power plants. Therefore, it is necessary to establish a complete strong wind monitoring and early warning system to monitor and predict local area wind speed data in real time, realize the timely acquisition of wind speed information, provide decision-making basis for the dispatching center, and be able to take corresponding control and response measures in advance to the maximum extent to ensure the safe and efficient operation of engineering projects. At present, traditional wind speed prediction methods often make predictions based on wind speed data at a single location, ignoring the wind speed correlation and spatial distribution characteristics between multiple measurement points. At the same time, the prediction process rarely considers other factors besides wind speed prediction data, and only makes predictions based on wind speed statistical models or empirical formulas. It can be seen that the existing wind speed prediction methods have the problem of ignoring the spatial correlation of wind speed and incompletely considering the physical mechanism of wind speed changes. Summary of the invention
[0003] The present invention provides a multi-point wind speed spatiotemporal prediction method and system to solve the problems that the existing wind speed prediction methods ignore the spatial correlation of wind speed and incompletely consider the physical mechanism of wind speed change.
[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0005] In a first aspect, the present invention provides a multi-point wind speed spatiotemporal prediction method, comprising:
[0006] Determine N measuring points in the local area of the target engineering project, obtain geographical parameters, wind parameters and meteorological parameters of each measuring point, and determine a monitoring data sequence of the measuring point based on the geographical parameters, wind parameters and meteorological parameters, where N is an integer greater than 1;
[0007] The spatial position information of the measuring points is determined based on the spatial array layout of the measuring points, and the monitoring data sequence and the spatial position information of the measuring points are preprocessed to obtain the wind speed data sequence of the measuring points, and the training samples are constructed based on the wind speed data sequences of all the measuring points;
[0008] Construct a physical information neural network model based on Transformer, and construct the NS equation to learn the law of wind speed change. The NS equation is embedded in the physical information neural network model based on Transformer to obtain a wind speed prediction model.
[0009] The wind speed prediction model is trained using the training samples to obtain a trained wind speed prediction model, and the wind speed data sequence of the measuring point is input into the trained wind speed prediction model to obtain the predicted wind speed result of the measuring point.
[0010] Optionally, the geographical parameters include: longitude parameters and latitude parameters, the wind parameters include: wind speed parameters and wind direction parameters, and the meteorological parameters include: temperature parameters, density parameters and air pressure parameters.
[0011] Optionally, the monitoring data sequence and spatial position information of the measuring point are preprocessed to obtain the wind speed data sequence of the measuring point, including:
[0012] The monitoring data sequence and spatial location information are cleaned, missing values are filled, and dimensionless linear normalization is performed to obtain the wind speed data sequence. The dimensionless linear normalization process includes:
[0013] The monitoring data sequence and spatial location information are standardized and mapped to the [0,1] interval through a dimensionless linear normalization expression, where the dimensionless linear normalization expression satisfies the following relationship:
[0014]
[0015] In the formula, x' represents the dimensionless linear normalized data, x represents the input value of the data to be processed by dimensionless linear normalization, and x max Indicates the maximum value of the data input value, x min Indicates the minimum value of the data input value.
[0016] Optionally, the Transformer-based physical information neural network model includes: position encoding, feedforward fully connected network, multi-head attention layer, and residual and layer normalization.
[0017] Optionally, positional encodings include:
[0018] Add relative position encoding to the input data, and assign a relative position vector to the relative distance between each pair of elements in the input data sequence, where the expressions for adding relative position encoding and assigning relative position vectors satisfy the following relationship:
[0019]
[0020] In the formula, pos represents the data position index, i represents the dimension index in the position vector, d is the dimension of each position vector, PE is the position embedding matrix, each row of the matrix corresponds to a position, and the position is encoded by a vector of length d. The dimension corresponds to different calculation modes according to odd and even.
[0021] Optionally, a feed-forward fully connected network includes:
[0022] The feedforward fully connected network consists of two linear transformations and a nonlinear activation function. The input vector obtained after position encoding is transformed into a new vector through the first linear transformation, and then transformed nonlinearly through a ReLU activation function. The output vector after nonlinear transformation is mapped to the same dimension as the input vector in the second linear transformation. The expression of linear transformation is as follows:
[0023] FFN(x 1 )=max(0,x 1 W i +b i )W 2 +b 2 ;
[0024] In the formula, FFN(x 1 ) represents the output of the feedforward fully connected network, max(·) represents the maximum value, x 1 represents the input data, W i is the weight matrix of the i-th hidden layer, b i is the bias vector of the i-th hidden layer;
[0025] The ReLU activation function is:
[0026] f(x 1 )=max(0,x 1 );
[0027] In the formula, f(x 1 ) represents the output of the ReLU activation function, max(·) represents the maximum value, x 1 Represents input data;
[0028] Optionally, a multi-head attention layer includes:
[0029] Construct query matrix, key matrix and value matrix;
[0030] The attention level of each data element is obtained by calculating the similarity between the query matrix and the key matrix. The attention level is the weight of the value matrix in the final calculated attention value. Then, the weighted sum of the values of all data elements is taken to obtain the final attention value.
[0031] Among them, the query matrix, key matrix, and value matrix all come from the same input X, and their expressions satisfy the following relationship:
[0032] Q=W Q X;
[0033] K=W K X;
[0034] V=W V X;
[0035] Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and the query matrix and the key matrix have the same dimension. Q ,W K ,W V are parameter matrices updated with training, X represents input;
[0036] The input matrix is converted into query matrix, key matrix, value matrix and evenly divided according to the number of heads of multi-attention mechanism. The expression is as follows:
[0037] (Q 1 ,K 1 ,V 1 ),(Q 2 ,K 2 ,V 2 ),…,(Q n ,K n ,V n );
[0038] n=D k / h;
[0039] Where n represents the matrix dimension assigned to each attention head, (Q n ,K n ,V n ) is the query, key, and value matrix of the nth attention head, D k The dimensions of the query matrix and the key matrix determine the number of features that each attention head can process. h represents the number of attention heads.
[0040] Using the query matrix, key matrix, and value matrix to calculate h groups of attention, the model can extract different relationships between the query matrix, key matrix, and value matrix, and pay attention to the representation subspace information from different positions. The expression is as follows:
[0041]
[0042] Among them, Attention represents the attention value, softmax(·) represents the normalized exponential function, and H i represents the output of the i-th attention head, are projection matrices, represents the dimension of the projection matrix, V represents the value matrix, d k represents the dimensions of the key matrix and query matrix, K τ represents the transpose of the key matrix;
[0043] Each head will use a different projection matrix for parameter updates;
[0044] Next, the output results of different attention values are concatenated and then linearly transformed through a fully connected layer to obtain the final result:
[0045] MultiHead(Q,K,V)=Concat(H 1 ,...,H k )W O R;
[0046] In the formula, MultiHead(·) represents the output of multi-head attention, Concat(·) represents the concatenation operation, and H K represents the output of the Kth attention head, W O represents the weight matrix of the fully connected layer, Represents the dimension of the fully connected layer weight matrix.
[0047] Optional, residual and layer normalization include:
[0048] The residual operation is performed on the input data of each sub-layer, and then the layer normalization is performed. The expression of the residual operation satisfies the following relationship:
[0049] H(x 1 )=F(x)+x 1 ;
[0050] Among them, x 1 represents the input data, F(x) represents a series of operations before the residual, and H(x 1 ) is the final output of the residual block model.
[0051] Optionally, construct the NS equation to learn the wind speed variation law, and embed the NS equation into the Transformer-based physical information neural network model to obtain a wind speed prediction model, including:
[0052] Construct the NS equations for incompressible gas, where the NS equations satisfy the following relationship:
[0053]
[0054] In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas respectively, p represents the pressure variable, ρ represents the density, μ represents the viscosity, F represents other external forces, x and y represent the spatial coordinate variable and the position of the gas flow respectively, represents the partial derivative of a variable;
[0055] In the application of natural wind, the viscosity parameter in the NS equation is ignored, and the main external forces are the pressure gradient force and the Coriolis force. At this time, the NS equation is simplified, and the simplified NS equation satisfies the following relationship:
[0056]
[0057] Where, f represents the Coriolis coefficient, and f = 2Ωsinφ, Ω represents the angular velocity of the earth's rotation, φ represents the latitude of the earth, t represents the time variable, u, v represent the horizontal and vertical velocity components of the gas, respectively, p represents the pressure variable, ρ represents the density, x, y represent the spatial coordinate variable and the position of the gas flow, respectively, represents the partial derivative of a variable;
[0058] At the same time, natural wind is a fluid, and the fluid follows the continuity equation, which satisfies the following relationship:
[0059]
[0060] In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas, respectively, ρ represents the density, and x and y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable;
[0061] Substituting the continuity equation into the simplified NS equation, we can get the residual of the NS equation, which satisfies the following relationship:
[0062]
[0063] In the formula, e 1 , e 2 , e 3 They represent the residuals of the NS equation on the horizontal velocity component u, the vertical velocity component v and the continuity equation, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas, f represents the Coriolis coefficient, p represents the pressure variable, x and y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable;
[0064] The residual of the NS equation is embedded into the physical information neural network model based on Transformer to obtain the loss function of the wind speed prediction model, where the loss function satisfies the following relationship:
[0065] L=αL e +βL i
[0066]
[0067] Where L is the loss function of the wind speed prediction model, L e and L i They represent the loss function components corresponding to the partial differential structure of the equation and the real data conditions, respectively. N represents the number of training data. represents the residual of the ith equation at the nth data point, represents the predicted value of the nth data point, u n =(u n ,v n ) represents the true data weight coefficients α and β of the nth data point, which are used to balance the two components of the loss function.
[0068] In a second aspect, an embodiment of the present application provides a multi-point wind speed spatiotemporal prediction system, characterized in that it includes a processor and a memory;
[0069] Memory, used to store computer programs;
[0070] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0071] Beneficial effects:
[0072] The multi-point wind speed spatiotemporal prediction method provided by the present invention adopts a wind speed short-term prediction model to perform short-term wind speed prediction, obtains a monitoring data sequence of each measuring point by real-time acquisition and processing of geographical parameters, wind parameters and meteorological parameters of multiple measuring points, and obtains a corresponding measuring point wind speed data sequence after preprocessing, aiming to achieve multi-point comprehensive prediction, rather than focusing only on the data of a single measuring point. Considering the wind speed data of multiple measuring points and combining their spatial position information, it is possible to achieve a comprehensive prediction of multi-point wind speed, providing a more comprehensive basis for regional gale warning. By extracting the measuring point wind speed data sequence as a sample, training and predicting the physical information neural network based on Transformer and NS equations, the prediction result can be obtained. The wind speed short-term prediction model adopts the Transformer model with the help of the self-attention mechanism and the physical information neural network model based on the NS equation. Through the hybrid prediction of the two models, while considering a variety of meteorological parameters related to wind speed, it can better capture the long-term dependency in the wind speed data sequence, and realize the learning of physical equations and NS equations and the capture of the physical laws of wind speed changes, so as to achieve real-time and accurate prediction of short-term wind speed. The method and system of the present invention are not only suitable for high-speed railways, highways, wind farms, photovoltaic farms and other local areas of the gale warning, but can also be extended to other fields according to actual needs, such as marine engineering, agricultural production, etc., and can take corresponding management and response measures in advance to protect the lives and property of personnel and ensure the safe and efficient operation of engineering projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 It is a schematic flow chart of a multi-point wind speed spatiotemporal prediction method according to a preferred embodiment of the present invention;
[0074] Figure 2 Schematic diagram of the structure of the multi-head self-attention mechanism of the preferred embodiment of the present invention, wherein (a) is a schematic diagram of the attention mechanism, and (b) is a schematic diagram of the multi-head attention mechanism;
[0075] Figure 3 is a schematic diagram of the structure of a Transformer unit in a preferred embodiment of the present invention;
[0076] Figure 4 It is a structural schematic diagram of a PINN network unit based on the NS equation according to a preferred embodiment of the present invention;
[0077] Figure 5 It is a prediction result diagram of a sample of the physical information neural network prediction model based on Transformer and NS equations in the preferred embodiment of the present invention;
[0078] Figure 6This is a graph of prediction index calculation results of a sample of the physical information neural network prediction model based on Transformer and NS equations in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0079] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0081] Example 1
[0082] See also Figure 1-6 The present application embodiment provides a multi-point wind speed spatiotemporal prediction method, comprising:
[0083] Determine N measuring points in the local area of the target engineering project, obtain geographical parameters, wind parameters and meteorological parameters of each measuring point, and determine a monitoring data sequence of the measuring point based on the geographical parameters, wind parameters and meteorological parameters, where N is an integer greater than 1;
[0084] The spatial position information of the measuring points is determined based on the spatial array layout of the measuring points, and the monitoring data sequence and the spatial position information of the measuring points are preprocessed to obtain the wind speed data sequence of the measuring points, and the training samples are constructed based on the wind speed data sequences of all the measuring points;
[0085] Construct a physical information neural network model based on Transformer, and construct the NS equation to learn the law of wind speed change. The NS equation is embedded in the physical information neural network model based on Transformer to obtain a wind speed prediction model.
[0086] The wind speed prediction model is trained using the training samples to obtain a trained wind speed prediction model, and the wind speed data sequence of the measuring point is input into the trained wind speed prediction model to obtain the predicted wind speed result of the measuring point.
[0087] In the above embodiment, a set of sequences is divided into multiple small sequences, and some pre-processed measuring point wind speed data sequences are extracted as samples, and a speed prediction model based on the physical information neural network of Transformer and NS equations is trained; the wind speed prediction model is used to predict the remaining wind speed data in the measuring point wind speed data sequence except the samples to obtain the short-term predicted wind speed and wind direction; the spatial position relative information of each measuring point is encoded into the time series through position encoding, and then the Transformer model with self-attention mechanism is used to capture the long-term dependency in the wind speed data sequence, so as to improve the global information perception ability. In the prediction, by embedding the NS equation as physical information into the prediction of the time series, the wind speed prediction process not only considers the influence of the historical wind speed, but also considers other meteorological factors related to physical information, including temperature, humidity and air pressure, etc., learns the physical laws of wind speed changes, and realizes accurate prediction of wind speed and wind direction. The LSTM deep neural network is used to train the prediction model for short-term wind speed prediction.
[0088] Optionally, the geographical parameters include: longitude parameters and latitude parameters, the wind parameters include: wind speed parameters and wind direction parameters, and the meteorological parameters include: temperature parameters, density parameters and air pressure parameters.
[0089] Optionally, the monitoring data sequence and spatial position information of the measuring point are preprocessed to obtain the wind speed data sequence of the measuring point, including:
[0090] The monitoring data sequence and spatial location information are cleaned, missing values are filled, and dimensionless linear normalization is performed to obtain the wind speed data sequence. The dimensionless linear normalization process includes:
[0091] The monitoring data sequence and spatial location information are standardized and mapped to the [0,1] interval through a dimensionless linear normalization expression, where the dimensionless linear normalization expression satisfies the following relationship:
[0092]
[0093] In the formula, x' represents the dimensionless linear normalized data, x represents the input value of the data to be processed by dimensionless linear normalization, and x max Indicates the maximum value of the data input value, x min Indicates the minimum value of the data input value.
[0094] Optionally, the Transformer-based physical information neural network model includes: position encoding, feedforward fully connected network, multi-head attention layer, and residual and layer normalization.
[0095] Optionally, positional encodings include:
[0096] Add relative position encoding to the input data, and assign a relative position vector to the relative distance between each pair of elements in the input data sequence, where the expressions for adding relative position encoding and assigning relative position vectors satisfy the following relationship:
[0097]
[0098] In the formula, pos represents the data position index, i represents the dimension index in the position vector, d is the dimension of each position vector, PE is the position embedding matrix, each row of the matrix corresponds to a position, and the position is encoded by a vector of length d. The dimension corresponds to different calculation modes according to odd and even.
[0099] Optionally, a feed-forward fully connected network includes:
[0100] The feedforward fully connected network consists of two linear transformations and a nonlinear activation function. The input vector obtained after position encoding is transformed into a new vector through the first linear transformation, and then transformed nonlinearly through a ReLU activation function. The output vector after nonlinear transformation is mapped to the same dimension as the input vector in the second linear transformation. The expression of linear transformation is as follows:
[0101] FFN(x 1 )=max(0,x 1 W i +b i )W 2 +b 2 ;
[0102] In the formula, FFN(x 1 ) represents the output of the feedforward fully connected network, max(·) represents the maximum value, x 1 represents the input data, W i is the weight matrix of the i-th hidden layer, b i is the bias vector of the i-th hidden layer;
[0103] The ReLU activation function is:
[0104] f(x 1 )=max(0,x 1 );
[0105] In the formula, f(x 1) represents the output of the ReLU activation function, max(·) represents the maximum value, x 1 Represents input data;
[0106] Optionally, a multi-head attention layer includes:
[0107] Construct query matrix, key matrix and value matrix;
[0108] The attention level of each data element is obtained by calculating the similarity between the query matrix and the key matrix. The attention level is the weight of the value matrix in the final calculated attention value. Then, the weighted sum of the values of all data elements is taken to obtain the final attention value.
[0109] Among them, the query matrix, key matrix, and value matrix all come from the same input X, and their expressions satisfy the following relationship:
[0110] Q=W Q X;
[0111] K=W K X;
[0112] V=W V X;
[0113] Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and the query matrix and the key matrix have the same dimension. Q ,W K ,W V are parameter matrices updated with training, X represents input;
[0114] The input matrix is converted into query matrix, key matrix, value matrix and evenly divided according to the number of heads of multi-attention mechanism. The expression is as follows:
[0115] (Q 1 ,K 1 ,V 1 ),(Q 2 ,K 2 ,V 2 ),…,(Q n ,K n ,V n );
[0116] n=D k / h;
[0117] Where n represents the matrix dimension assigned to each attention head, (Q n ,K n ,V n ) is the query, key, and value matrix of the nth attention head, D kThe dimensions of the query matrix and the key matrix determine the number of features that each attention head can process. h represents the number of attention heads.
[0118] Using the query matrix, key matrix, and value matrix to calculate h groups of attention, the model can extract different relationships between the query matrix, key matrix, and value matrix, and pay attention to the representation subspace information from different positions. The expression is as follows:
[0119]
[0120] Among them, Attention represents the attention value, softmax(·) represents the normalized exponential function, and H i represents the output of the i-th attention head, are projection matrices, represents the dimension of the projection matrix, V represents the value matrix, d k represents the dimensions of the key matrix and query matrix, K τ represents the transpose of the key matrix;
[0121] Each head will use a different projection matrix for parameter updates;
[0122] Next, the output results of different attention values are concatenated and then linearly transformed through a fully connected layer to obtain the final result:
[0123] MultiHead(Q,K,V)=Concat(H 1 ,...,H k )W O R;
[0124] In the formula, MultiHead(·) represents the output of multi-head attention, Concat(·) represents the concatenation operation, and H K represents the output of the Kth attention head, W O represents the weight matrix of the fully connected layer, Represents the dimension of the fully connected layer weight matrix.
[0125] Optional, residual and layer normalization include:
[0126] The residual operation is performed on the input data of each sub-layer, and then the layer normalization is performed. The expression of the residual operation satisfies the following relationship:
[0127] H(x 1 )=F(x)+x 1 ;
[0128] Among them, x 1 represents the input data, F(x) represents a series of operations before the residual, and H(x 1) is the final output of the residual block model.
[0129] Optionally, construct the NS equation to learn the wind speed variation law, and embed the NS equation into the Transformer-based physical information neural network model to obtain a wind speed prediction model, including:
[0130] Construct the NS equations for incompressible gas, where the NS equations satisfy the following relationship:
[0131]
[0132] In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas respectively, p represents the pressure variable, ρ represents the density, μ represents the viscosity, F represents other external forces, x and y represent the spatial coordinate variable and the position of the gas flow respectively, represents the partial derivative of a variable;
[0133] In the application of natural wind, the viscosity parameter in the NS equation is ignored, and the main external forces are the pressure gradient force and the Coriolis force. At this time, the NS equation is simplified, and the simplified NS equation satisfies the following relationship:
[0134]
[0135] Where, f represents the Coriolis coefficient, and f = 2Ωsinφ, Ω represents the angular velocity of the earth's rotation, φ represents the latitude of the earth, t represents the time variable, u, v represent the horizontal and vertical velocity components of the gas, respectively, p represents the pressure variable, ρ represents the density, x, y represent the spatial coordinate variable and the position of the gas flow, respectively, represents the partial derivative of a variable;
[0136] At the same time, natural wind is a fluid, and the fluid follows the continuity equation, which satisfies the following relationship:
[0137]
[0138] In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas, respectively, ρ represents the density, and x and y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable;
[0139] Substituting the continuity equation into the simplified NS equation, we can get the residual of the NS equation, which satisfies the following relationship:
[0140]
[0141] In the formula, e 1 , e 2, e 3 They represent the residuals of the NS equation on the horizontal velocity component u, the vertical velocity component v and the continuity equation, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas, f represents the Coriolis coefficient, p represents the pressure variable, x and y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable;
[0142] The residual of the NS equation is embedded into the physical information neural network model based on Transformer to obtain the loss function of the wind speed prediction model, where the loss function satisfies the following relationship:
[0143] L=αL e +βL i
[0144]
[0145] Where L is the loss function of the wind speed prediction model, L e and L i They represent the loss function components corresponding to the partial differential structure of the equation and the real data conditions, respectively. N represents the number of training data. represents the residual of the ith equation at the nth data point, represents the predicted value of the nth data point, u n =(u n ,v n ) represents the true data weight coefficients α and β of the nth data point, which are used to balance the two components of the loss function.
[0146] Example 2
[0147] See also Figure 1 The present application embodiment provides a multi-point wind speed spatiotemporal prediction method, and the specific steps are as follows:
[0148] (1) Determine multiple measuring points in the local area of the target project, monitor and collect wind speed at the measuring points in real time, obtain the geographical parameters (including longitude parameters and latitude parameters), wind force parameters (including wind speed parameters and wind direction parameters) and meteorological parameters (including temperature, density and air pressure) of each measuring point, and sort them out to obtain the monitored wind speed sequence x;
[0149] Based on the above geographical parameters, wind parameters and meteorological parameters, the monitoring data sequence of each measuring point is calculated and obtained.
[0150] (2) According to the spatial array layout of multiple measuring points, the monitoring wind speed sequence x and the spatial position information of the corresponding measuring points are preprocessed. The parameters include wind speed, wind direction sine and cosine values, and meteorological parameters, and data cleaning, missing value filling, and dimensionless linear normalization are performed. The normalization method is used to standardize the indicators with different dimensions and orders of magnitude of the parameter data of the measuring points, and the data is mapped to the [0,1] interval. The expression for dimensionless linear normalization of the data is as follows:
[0151]
[0152] Among them, x max and x min They are the maximum and minimum values of the data input respectively.
[0153] (3) Through disordered random selection, some wind speed data sequences of measuring points are extracted as training samples, and the physical information neural network model based on Transformer and NS equations is used for training.
[0154] As an important component of the Transformer model, the multi-head attention mechanism learns different dependencies between different positions in the sequence through different attention heads. It is suitable for wind speed prediction with strong nonlinearity and can consider multiple related variables (including wind direction, air pressure, temperature, etc.) at the same time to learn their interactions and relationships. The structural diagram of the mechanism can be seen in Figure 2 .
[0155] The attention mechanism calculates the similarity between the query and the key to obtain the degree of attention of each data element, that is, the weight of the value in the final calculated attention value, and then performs a weighted summation of the values of all data elements to obtain the final attention value. The Q (Query), K (Key), and V (Value) matrices all come from the same input The expression is as follows:
[0156] Q=W Q X
[0157] K=W K X
[0158] V=W V X
[0159] in The Q and K matrices have the same dimensions, W Q ,W K ,W V These are parameter matrices that are updated during training.
[0160] The input matrix is converted into Q, K, V and evenly divided according to the number of multi-attention mechanism heads h. The expression is as follows:
[0161] (Q 1 ,K 1 ,V 1 ),(Q 2 ,K 2 ,V 2 ),…,(Q n ,K n ,V n )
[0162] n=D k / h
[0163] Using Q, K, and V to calculate h groups of attention, the model can extract different relationships between Q, K, and V respectively, focusing on the representation subspace information from different positions. The expression is as follows:
[0164]
[0165] in, They are all projection matrices. Each head will use a different projection matrix for parameter update.
[0166] Next, the different Attention output results are concatenated and then linearly transformed through a fully connected layer to obtain the final result:
[0167] MultiHead(Q,K,V)=Concat(H 1 ,...,H k )W O R
[0168] in, The final result can be obtained by multiplying this parameter matrix.
[0169] (4) The training process of the Transformer model includes steps such as position encoding, feedforward fully connected network, multi-head attention layer, residual operation and layer normalization. It consists of two parts: encoder and decoder. The structure of its basic module and the flow of information are shown below. Figure 3 shown.
[0170] Position encoding: First, add relative position encoding to the input X, and assign a relative position vector to the relative distance between each pair of elements in the sequence. The specific expression is as follows:
[0171]
[0172] Among them, pos represents the data position index, d is the dimension of each position vector, PE is the position embedding matrix, each row of the matrix corresponds to a position, and the position is encoded by a vector of length d. The dimension corresponds to different calculation modes according to the odd and even values.
[0173] Feedforward fully connected network: Then, after the feedforward fully connected network, which consists of two linear transformations and a nonlinear activation function, the input vector is mapped to a new vector through the first linear transformation, and then nonlinearly transformed through a ReLU activation function. Finally, the output vector is mapped to the same dimension as the input vector in the second linear transformation. The expression is as follows:
[0174] FFN(x)=max(0,xW i +b i )W 2 +b 2
[0175] Among them, W i is the weight matrix of the i-th hidden layer, b i is the bias vector of the i-th hidden layer.
[0176] The ReLU activation function is:
[0177] f(x)=max(0,x)
[0178] Multi-head attention layer: I will not go into details here.
[0179] Residual and layer normalization: Finally, each sublayer needs to undergo a residual operation to avoid information loss and gradient vanishing problems. In addition, layer normalization is used to handle the problem of varying lengths of input data before output. The expression of the residual operation is as follows:
[0180] H(x)=F(x)+x
[0181] Among them, x represents the input data, the F function represents a series of operations before the residual, and H(x) is the final output of the residual block model.
[0182] (5) The above method realizes the calculation and processing of global information and multivariate data by the prediction model. Next, the physical information neural network model method of the NS equation is used to realize the learning of the wind speed prediction model for the NS equation. The schematic diagram of the physical information neural network model is shown in Figure 4 For incompressible natural wind, the viscosity term of the NS equation is usually ignored, and the main external forces are the pressure gradient force and the Coriolis force. The equation expression is as follows:
[0183]
[0184] Among them, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas respectively, p represents the pressure variable, ρ represents the density, f represents the Coriolis coefficient, f = 2Ωsinφ, Ω represents the angular velocity of the earth's rotation, which is equal to 7.29×10 -5 s -1 , φ represents the latitude of the earth.
[0185] At the same time, the fluid obeys the continuity equation, which is:
[0186]
[0187] Therefore, the residual of the equation can be summarized and defined as follows:
[0188]
[0189] Based on the above, the loss function of the entire wind speed training model is obtained, which is specifically defined as follows:
[0190] L=αL e +βL i
[0191]
[0192] Among them, L e and L i They represent the loss function components corresponding to the partial differential structure of the equation and the real data conditions, respectively. N represents the number of training data. represents the residual of the ith equation at the nth data point. represents the predicted value of the nth data point, u n =(u n ,v n ) represents the true data weight coefficients α and β of the nth data point, which are used to balance the two components of the loss function.
[0193] (6) Use the trained wind speed prediction model to predict the wind speed data series of multiple measuring points to obtain the predicted wind speed results of the target measuring point. Figure 5 The figure shows the prediction results of one set of samples using the wind speed prediction model.
[0194] (7) The mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE) and mean absolute percentage error (MAPE) are used to evaluate the prediction accuracy of the model. Figure 6 The prediction index calculation result diagram of a sample of the prediction model shows that the overall index is less than 0.15, which has a good effect and proves the accuracy of this prediction method.
[0195] The embodiment of the present application also provides a multi-point wind speed spatiotemporal prediction system, including a processor and a memory;
[0196] Memory, used to store computer programs;
[0197] The processor is used to implement any method step in the multi-point wind speed spatiotemporal prediction method when executing the program stored in the memory.
[0198] The above-mentioned multi-point wind speed spatiotemporal prediction system can implement various embodiments of the above-mentioned multi-point wind speed spatiotemporal prediction method and achieve the same beneficial effects, which will not be described in detail here.
[0199] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A multi-point wind speed spatiotemporal prediction method, characterized in that: include: Determine N measuring points in the local area of the target engineering project, obtain geographical parameters, wind parameters and meteorological parameters of each measuring point, and determine a monitoring data sequence of the measuring point based on the geographical parameters, the wind parameters and the meteorological parameters, wherein N is an integer greater than 1; Determine the spatial position information of the measuring points based on the spatial array layout of the measuring points, pre-process the monitoring data sequence and the spatial position information of the measuring points to obtain the wind speed data sequence of the measuring points, and construct training samples based on the wind speed data sequences of all the measuring points; Construct a physical information neural network model based on Transformer, and construct the NS equation to learn the law of wind speed change. The NS equation is embedded in the physical information neural network model based on Transformer to obtain a wind speed prediction model. The wind speed prediction model is trained using the training samples to obtain a trained wind speed prediction model, and the wind speed data sequence of the measuring point is input into the trained wind speed prediction model to obtain the predicted wind speed result of the measuring point.
2. The multi-point wind speed spatiotemporal prediction method according to claim 1, characterized in that: The geographical parameters include: longitude parameters and latitude parameters, the wind parameters include: wind speed parameters and wind direction parameters, and the meteorological parameters include: temperature parameters, density parameters and air pressure parameters.
3. The multi-point wind speed spatiotemporal prediction method according to claim 1, characterized in that: The preprocessing of the monitoring data sequence and the spatial position information of the measuring point to obtain the wind speed data sequence of the measuring point includes: The monitoring data sequence and the spatial position information are subjected to data cleaning, missing value filling and dimensionless linear normalization processing to obtain a wind speed data sequence, wherein the dimensionless linear normalization processing includes: The monitoring data sequence and the spatial position information are standardized and mapped to the interval [0,1] through a dimensionless linear normalization expression, wherein the dimensionless linear normalization expression satisfies the following relationship: In the formula, x' represents the dimensionless linear normalized data, x represents the input value of the data to be processed by dimensionless linear normalization, and x max Indicates the maximum value of the data input value, x min Indicates the minimum value of the data input value.
4. The multi-point wind speed spatiotemporal prediction method according to claim 1, characterized in that: The Transformer-based physical information neural network model includes: position encoding, feedforward fully connected network, multi-head attention layer and residual and layer normalization.
5. The multi-point wind speed spatiotemporal prediction method according to claim 4, characterized in that: The position encoding includes: Add relative position encoding to the input data, and assign a relative position vector to the relative distance between each pair of elements in the input data sequence, where the expressions for adding relative position encoding and assigning relative position vectors satisfy the following relationship: In the formula, pos represents the data position index, i represents the dimension index in the position vector, d is the dimension of each position vector, PE is the position embedding matrix, each row of the matrix corresponds to a position, and the position is encoded by a vector of length d. The dimension corresponds to different calculation modes according to odd and even.
6. The multi-point wind speed spatiotemporal prediction method according to claim 4, characterized in that: The feedforward fully connected network includes: The feedforward fully connected network consists of two linear transformations and a nonlinear activation function. The input vector obtained after position encoding is transformed into a new vector through the first linear transformation, and then transformed nonlinearly through a ReLU activation function. The output vector after nonlinear transformation is mapped to the same dimension as the input vector in the second linear transformation. The expression of linear transformation is as follows: <h2 style=";text-align:left;direction:ltr">FFN(x1) = max(0,x1W<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> +b<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> W2+b2) In the formula, FFN(x1) represents the output of the feedforward fully connected network, max(·) represents the maximum value, x1 represents the input data, and W i is the weight matrix of the i-th hidden layer, b i is the bias vector of the i-th hidden layer; The ReLU activation function is: f(x1)=max(0,x1); In the formula, f(x1) represents the output of the ReLU activation function, max(·) represents the maximum value, and x1 represents the input data.
7. The multi-point wind speed spatiotemporal prediction method according to claim 4, characterized in that: The multi-head attention layer includes: Construct query matrix, key matrix and value matrix; The attention level of each data element is obtained by calculating the similarity between the query matrix and the key matrix. The attention level is the weight of the value matrix in the final calculated attention value. Then, the weighted sum of the values of all data elements is taken to obtain the final attention value. Among them, the query matrix, key matrix, and value matrix all come from the same input X, and their expressions satisfy the following relationship: Q=W Q X; K=W K X; V=W V X; Where Q represents the query matrix, K represents the key matrix, V represents the value matrix, and the query matrix and the key matrix have the same dimension. Q ,W K ,W V are parameter matrices updated with training, X represents input; The input matrix is converted into query matrix, key matrix, value matrix and evenly divided according to the number of heads of multi-attention mechanism. The expression is as follows: (Q1,K1,V1),(Q2,K2,V2),…,(Q n ,K n ,V n ); n=D k / h; Where n represents the matrix dimension assigned to each attention head, (Q n ,K n ,V n ) is the query, key, and value matrix of the nth attention head, D k The dimensions of the query matrix and the key matrix determine the number of features that each attention head can process. h represents the number of attention heads. Using the query matrix, key matrix, and value matrix to calculate h groups of attention, the model can extract different relationships between the query matrix, key matrix, and value matrix, and pay attention to the representation subspace information from different positions. The expression is as follows: Among them, Attention represents the attention value, softmax(·) represents the normalized exponential function, and H i represents the output of the i-th attention head, are projection matrices, represents the dimension of the projection matrix, V represents the value matrix, d k represents the dimensions of the key matrix and query matrix, K τ represents the transpose of the key matrix; Each head will use a different projection matrix for parameter updates; Next, the output results of different attention values are concatenated and then linearly transformed through a fully connected layer to obtain the final result: MultiHead(Q,K,V)=Concat(H1,...,H k )W O R; In the formula, MultiHead(·) represents the output of multi-head attention, Concat(·) represents the concatenation operation, and H K represents the output of the Kth attention head, W O represents the weight matrix of the fully connected layer, Represents the dimension of the fully connected layer weight matrix.
8. The multi-point wind speed spatiotemporal prediction method according to claim 4, characterized in that: The residual and layer normalization include: The residual operation is performed on the input data of each sub-layer, and then the layer normalization is performed. The expression of the residual operation satisfies the following relationship: H(x1)=F(x)+x1; Among them, x1 represents the input data, F(x) represents a series of operations before the residual, and H(x1) is the final output of the residual block model.
9. The multi-point wind speed spatiotemporal prediction method according to claim 1, characterized in that: The NS equation for learning the wind speed variation law is constructed, and the NS equation is embedded in a physical information neural network model based on Transformer to obtain a wind speed prediction model, including: Construct the NS equations for incompressible gas, where the NS equations satisfy the following relationship: In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas respectively, p represents the pressure variable, ρ represents the density, μ represents the viscosity, F represents other external forces, x and y represent the spatial coordinate variable and the position of the gas flow respectively, represents the partial derivative of a variable; In the application of natural wind, the viscosity parameter in the NS equation is ignored, and the main external forces are the pressure gradient force and the Coriolis force. At this time, the NS equation is simplified, and the simplified NS equation satisfies the following relationship: Where, f represents the Coriolis coefficient, and f = 2Ωsinφ, Ω represents the angular velocity of the earth's rotation, φ represents the latitude of the earth, t represents the time variable, u, v represent the horizontal and vertical velocity components of the gas, respectively, p represents the pressure variable, ρ represents the density, x, y represent the spatial coordinate variable and the position of the gas flow, respectively, represents the partial derivative of a variable; At the same time, natural wind is a fluid, and the fluid follows the continuity equation, which satisfies the following relationship: In the formula, t represents the time variable, u and v represent the horizontal and vertical velocity components of the gas, respectively, ρ represents the density, and x and y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable; Substituting the continuity equation into the simplified NS equation, we can get the residual of the NS equation, which satisfies the following relationship: Where, e1, e2, e3 represent the residuals of the NS equation on the horizontal velocity component u, vertical velocity component v and continuity equation, t represents the time variable, u, v represent the horizontal and vertical velocity components of the gas, f represents the Coriolis coefficient, p represents the pressure variable, x, y represent the spatial coordinate variable and the position of the gas flow, respectively. represents the partial derivative of a variable; The residual of the NS equation is embedded into the physical information neural network model based on Transformer to obtain the loss function of the wind speed prediction model, where the loss function satisfies the following relationship: L=αL e +βL i Where L is the loss function of the wind speed prediction model, L e and L i They represent the loss function components corresponding to the partial differential structure of the equation and the real data conditions, respectively. N represents the number of training data. represents the residual of the ith equation at the nth data point, represents the predicted value of the nth data point, u n =(u n ,v n ) represents the true data weight coefficients α and β of the nth data point, which are used to balance the two components of the loss function.
10. A multi-point wind speed spatiotemporal prediction system, characterized in that: Including processor and memory; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.
Citation Information
Patent Citations
Multi-station wind speed prediction method
CN116859488A
Multi-fan wind speed space-time prediction method and system
CN116894384A
Wind speed prediction method and system in extreme weather
CN116894390A
Construction method of wind power plant short-time wind speed prediction model based on deep learning model
CN117744755A
Transform-based space-time meteorological prediction method
CN117874448A
Cited By
Method, computer device, system, computer readable storage medium and computer program product for weather forecast
CN119511417A
Control method and system of whole vehicle thermal management system based on multi-dimensional data
CN120056692A
