Method, device, equipment and medium for wind power prediction

By combining causal inference and dynamic adjacency matrix construction with graph convolutional networks and Transformer architecture, the problem of low prediction accuracy under the complex spatiotemporal characteristics of wind farms is solved, and high-precision and stable wind power prediction is achieved.

CN120810583APending Publication Date: 2025-10-17CHINA THREE GORGES CORPORATION +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510923419.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing wind power generation prediction methods ignore the spatiotemporal characteristics of climate when dealing with the complex spatiotemporal features of large-scale wind farms, resulting in low prediction accuracy. Static adjacency matrices cannot reflect the dynamic structural changes of wind farms, lack causal information filtering mechanisms, have serious information redundancy, make it difficult to distinguish causal relationships between variables, and have difficulty uniformly handling feature changes at different time scales, leading to unstable prediction results.

Method used

By acquiring multidimensional data, the causal relationship between wind power and meteorological factors is analyzed based on causal inference. A dynamic adjacency matrix is ​​constructed, and by combining graph convolutional networks and Transformer architecture, the spatial dependencies and multi-scale features between wind turbines are captured to generate prediction vectors.

Benefits of technology

It improves the accuracy and stability of wind power forecasting, especially in the case of sudden wind speed changes, with a significant improvement in real-time response capability and a reduction in forecast error of more than 15%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120810583A_ABST
    Figure CN120810583A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of wind power generation, and discloses a wind power prediction method, device and equipment and a medium, and the method comprises the steps: obtaining multi-dimensional data, and generating a sequence sample based on the multi-dimensional data; based on causal inference, analyzing causal relevance in the sequence sample to obtain a causal relationship between the wind power and the meteorological factors; constructing an adjacent matrix based on the sequence sample and the causal relationship; and aggregating the sequence sample and the adjacent matrix to obtain a spatial feature vector, fusing the sequence sample and the spatial feature vector to generate a prediction vector, and representing a wind power prediction result based on the prediction vector. The adjacent matrix is constructed based on the sequence sample and the causal relationship, the connection weight between the nodes in the wind power plant can be updated according to the real-time meteorological characteristics and the operation state information of the fans, the spatial dependency relationship, changing along with time, between the fans can be accurately reflected, and the prediction precision of the wind power can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wind power generation, in particular to a method, device, equipment and medium for wind power prediction. BACKGROUND

[0002] The wind power prediction in the related art relies on physical models, statistical models and traditional machine learning models. The physical model simulates the conversion process of wind energy by using meteorological data and physical laws of the wind field, such as wind speed, wind direction and air pressure, to predict wind power. The statistical model uses historical wind speed data to establish a mathematical relationship between wind speed and wind power by using time series analysis methods (such as ARIMA) or regression analysis to predict wind power. The traditional machine learning model, such as support vector machine (SVM) and random forest (RF), learns the multi-dimensional features of wind speed, temperature and other variables in the historical data to predict future wind power.

[0003] The aforementioned wind power prediction method has the technical problem of low prediction accuracy in the case of ignoring the spatiotemporal nature of climate when dealing with complex spatiotemporal characteristics of large-scale wind farms. SUMMARY

[0004] Therefore, the present application provides a method, device, equipment and medium for wind power prediction to solve the problem of low prediction accuracy in the case of ignoring the spatiotemporal nature of climate when dealing with complex spatiotemporal characteristics of large-scale wind farms in the wind power prediction method in the related art.

[0005] In a first aspect, the present application provides a method for wind power prediction, the method comprising: obtaining multi-dimensional data, generating sequence samples based on the multi-dimensional data; analyzing the causal association in the sequence samples based on causal inference to obtain the causal relationship between wind power and meteorological factors; constructing an adjacency matrix based on the sequence samples and the causal relationship; aggregating the sequence samples and the adjacency matrix to obtain a spatial feature vector, fusing the sequence samples and the spatial feature vector to generate a prediction vector, and representing the wind power prediction result based on the prediction vector.

[0006] In an optional implementation, the analyzing the causal association in the sequence samples based on causal inference to obtain the causal relationship between wind power and meteorological factors comprises: creating variable pairs composed of each of the meteorological factors and the wind power; calculating the variance of each of the variable pairs at different time steps; representing the influence degree of the value of the meteorological factor in the time step on the current value of the wind power based on the variance; and screening target variable pairs with variance less than a preset significance threshold, and representing the causal relationship based on the target variable pairs.

[0007] In an optional implementation, the analyzing the causal relationship between the wind power and the meteorological factors based on the causal inference further includes: identifying the causal relationship in the sequence sample based on a causal graph; fitting the meteorological factors and the wind power in the causal relationship to obtain a linear regression relationship between the meteorological factors and the wind power; and estimating a causal effect of the meteorological factors on the wind power based on the linear regression relationship.

[0008] In an optional implementation, the analyzing the causal relationship between the wind power and the meteorological factors based on the causal inference further includes: if a variance of a first variable pair is less than the preset significance threshold and a causal effect of the first variable pair is positive, determining that there is a positive causal relationship between the meteorological factors in the first variable pair and the wind power.

[0009] In an optional implementation, the constructing the adjacency matrix based on the sequence sample and the causal relationship further includes: calculating meteorological features corresponding to each wind turbine node based on the sequence sample; calculating initial association weights between the meteorological features based on a similarity function; and correcting the initial association weights based on the causal relationship to generate the adjacency matrix.

[0010] In an optional implementation, the aggregating the sequence sample and the adjacency matrix to obtain the spatial feature vector further includes: mapping the sequence sample through linear transformation to obtain a query matrix, a key matrix, and a value matrix; determining an initial attention score based on the query matrix, the key matrix, and the value matrix, and constraining a calculation range of the initial attention score based on the adjacency matrix; performing normalization processing on the initial attention score to obtain an attention weight matrix between wind turbine nodes, and performing weighted aggregation on the value matrix based on the attention weight matrix to obtain the spatial feature vector.

[0011] In an optional implementation, the fusing the sequence sample and the spatial feature vector to generate a prediction vector, and representing a wind power prediction result based on the prediction vector further includes: creating time windows of different scales, in each of the time windows, using a transformer architecture to obtain a dependency relationship between the time windows based on an attention mechanism; generating multi-scale features based on the dependency relationship; and fusing the multi-scale features to generate the prediction vector, wherein the prediction vector includes short-term changes and long-term regularities.

[0012] In a second aspect, the present application provides a device for wind power prediction, the device comprising: an acquisition module configured to acquire multi-dimensional data and generate sequence samples based on the multi-dimensional data; an analysis module configured to analyze causal correlations in the sequence samples based on causal inference, and obtain a causal relationship between wind power and meteorological factors; a construction module configured to construct an adjacency matrix based on the sequence samples and the causal relationship; and a prediction module configured to aggregate the sequence samples and the adjacency matrix to obtain a spatial feature vector, fuse the sequence samples and the spatial feature vector to generate a prediction vector, and represent a wind power prediction result based on the prediction vector.

[0013] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, which are communicatively connected with each other, and the memory stores computer instructions; the processor executes the computer instructions to perform the method for wind power prediction according to the first aspect or any one of the corresponding embodiments thereof.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for causing a computer to perform the method for wind power prediction according to the first aspect or any one of the corresponding embodiments thereof.

[0015] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions for causing a computer to perform the method for wind power prediction according to the first aspect or any one of the corresponding embodiments thereof.

[0016] The method for wind power prediction provided by the present application can analyze time series data of wind turbines, combine causal inference technology, and construct a dynamic adjacency matrix, which can dynamically update connection weights between nodes (i.e., wind turbines) in a wind farm according to real-time meteorological characteristics and wind turbine operation state information, accurately reflect spatial dependence relationships between wind turbines changing over time, and improve the prediction accuracy of wind power. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the specific embodiments or related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0018] Figure 1 A flowchart of the method for wind power prediction provided by the present application is shown;

[0019] Figure 2A model schematic diagram of the graph convolution network converter provided in the application is shown.

[0020] Figure 3 A multi-dimensional data schematic diagram provided in the application is shown.

[0021] Figure 4 A structural schematic diagram of the device for wind power prediction provided in the application is shown.

[0022] Figure 5 A hardware structure schematic diagram of the computer device of the embodiment of the application. DETAILED DESCRIPTION

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the application clearer, the technical solutions in the embodiments of the application will be described below in a clear and complete manner with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some but not all of the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.

[0024] The wind power prediction method in the related art has the following technical problems in processing large-scale wind farm complex spatio-temporal characteristics:

[0025] First, the static adjacency matrix cannot reflect the dynamic structure change of the wind farm.

[0026] Second, the current mainstream graph neural network prediction model generally uses a fixed or static similarity-based adjacency matrix, lacks the modeling capability of the dynamic evolution of the spatial relationship of the wind farm under extreme weather or rapid weather change, and causes the model response lag and the prediction deviation to increase.

[0027] Third, there is a lack of effective causal information screening mechanism, and the information redundancy is serious.

[0028] Fourth, the prediction model of the multivariate input fails to distinguish the causal relationship between variables, easily introduces invalid or even interference information, reduces the generalization ability and stability of the model, and especially in the context of the multi-source data of the wind farm, the data dimension is high and the noise is large, and the traditional method is difficult to model the real driving factor.

[0029] Fifth, it is difficult to uniformly process the feature change in different time scales.

[0030] Sixth, the wind power has obvious multi-scale dynamic characteristics, and the model in the related art is modeled in a single time scale, cannot capture short-term fluctuations and long-term trends at the same time, and the prediction result is unstable in the high-frequency disturbance scene.

[0031] According to an embodiment of the present invention, a method embodiment for wind power prediction is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0032] In this embodiment, a method for wind power prediction is provided, which can be used in the above-mentioned terminals, such as mobile phones, tablet computers, desktop computers or laptop computers, etc. Figure 1 The flow chart of the method for wind power prediction provided by the present application is shown as follows: Figure 1 As shown, the process includes the following steps:

[0033] Step S101: Acquire multidimensional data and generate sequence samples based on the multidimensional data.

[0034] In this step, the multidimensional data includes wind speed, wind direction, temperature, voltage, current, and wind power. This multidimensional data can be regularly collected by the Supervisory Control and Data Acquisition (SCADA) system within the wind farm. The SCADA system then uploads the multidimensional data to the multidimensional data processing terminal via an intranet communication interface.

[0035] The multidimensional data processing end preprocesses the multidimensional data to generate sequence samples. This preprocessing includes data missingness handling and standardization. The preprocessing results are applied using a sliding window technique to generate sequence samples. Wind power prediction is then performed based on these sequence samples.

[0036] Specifically, the process of preprocessing multidimensional data can be represented based on the following pseudo code:

[0037] features = features.fillna(features.mean()) / / fill missing values

[0038] scaler = StandardScaler() / / feature standardization

[0039] features_scaled=scaler.fit_transform(features)

[0040] for iin range(len(df)-lookback): / / lookback is used to represent the time window size, that is, the length of the historical time step; time series samples are generated cyclically, and each sample includes the data of the lookback consecutive time steps

[0041] window_features = features_scaled[i:(i+lookback)] # extract feature data in sliding window

[0042] window_features = window_features.reshape(lookback, 15, -1) # reshape window data into three-dimensional tensor

[0043] X.append(window_features)

[0044] y.append(target.iloc[i+lookback]) # build feature tensor X and target value y

[0045] In this way, the standard input structure of the data can be constructed, and the data input quality is guaranteed.

[0046] In step S102, based on causal inference, the causal relationship between the wind power and the meteorological factors is obtained by analyzing the causal relationship in the sequence sample.

[0047] In this step, the causal relationship between the wind power and the meteorological factors can be obtained by analyzing the causal relationship in the sequence sample through at least one of Granger causality test and DoWhy framework.

[0048] Specifically, whether each meteorological factor is a Granger cause of the wind power can be verified through Granger causality test, and the causal relationship between the wind power and the meteorological factors can be screened through statistical variance and a preset significance threshold. The causal graph can also be constructed through the DoWhy framework, the causal effect can be quantified based on the backdoor adjustment method, and the causal relationship between the wind power and the meteorological factors can be obtained. The causal relationship between the wind power and the meteorological factors can also be screened in combination with Granger causality test and DoWhy framework.

[0049] In this way, non-causal relationships can be effectively eliminated, the quality of input features can be improved, and the generalization performance of the model can be enhanced.

[0050] In step S103, based on the sequence sample and the causal relationship, an adjacency matrix is constructed.

[0051] In this step, the initial association weight between wind turbines can be calculated based on the sequence sample. Based on the causal relationship, the connections without causal relationship are filtered, and the weight with causal relationship is strengthened. Through normalization processing, the association weight is ensured to meet the input requirements of the graph neural network. On the basis of the sequence sample and the causal relationship, a dynamic adjacency matrix is formed.

[0052] In step S104, the sequence sample and the adjacency matrix are aggregated to obtain a spatial feature vector, the sequence sample and the spatial feature vector are fused to generate a prediction vector, and the wind power prediction result is represented based on the prediction vector.

[0053] In this step, the sequence sample includes a time step, a number of wind turbines, and a number of features. For each time step, the features of all wind turbines are aggregated by the adjacency matrix weighting. The spatial feature vector is spliced with the original sequence sample by time step, the time-dependent relationship of the fused features is captured based on a transformer, and the time series features are mapped to the prediction result through a fully connected layer.

[0054] The method for wind power prediction provided in this embodiment can construct an adjacency matrix based on a sequence sample and a causal relationship, can update the connection weights between nodes in a wind farm according to real-time meteorological features and wind turbine operating state information, can accurately reflect the spatial dependence relationship between wind turbines changing over time, and can improve the prediction accuracy of wind power.

[0055] In some optional embodiments, the causal relationship between wind power and meteorological factors is obtained by analyzing the causal association in the sequence sample based on causal inference, including: creating a variable pair composed of each meteorological factor and wind power; calculating the variance of each variable pair at different time steps; based on the variance, representing the influence degree of the value of the meteorological factor at the time step on the current value of the wind power; screening the target variable pair with a variance less than a preset significance threshold, and representing the causal relationship based on the target variable pair.

[0056] In this embodiment, each meteorological factor and wind power are respectively composed into a binary variable pair to form a variable pair set of (meteorological factor, wind power). The meteorological factors include but are not limited to wind speed, temperature, or air pressure, etc. The sequence sample can be time-aligned time series data, for example, the wind speed collected every minute and the power value at the corresponding time.

[0057] The lag order k is set to represent the influence of the target meteorological factor on the current power in the past k time steps. A prediction model including the historical values of the meteorological factors is constructed, the variance of the prediction error is calculated by the prediction model, the greater the variance, the greater the contribution of the historical values of the meteorological factors to the wind power prediction, that is, the stronger the causal influence. A significance threshold is set, if the variance is less than the limit threshold, it is considered that the meteorological factor has a significant causal influence on the photovoltaic power at this time step. All variable pairs that meet the condition are screened to form a target variable pair set.

[0058] Specifically, the Granger causality test can be represented by the following pseudo code to identify the causal relationship between features:

[0059] causality = perform_granger_causality(features_df, max_lag=3, significance_level=0.05)

[0060] where features_df includes a two-dimensional table of multiple time series features, each row represents a time point, and each column represents a feature. max_lag is used to represent the maximum lag order, that is, the maximum time delay considered in the test. significance_level is used to represent the preset significance threshold.

[0061] In this way, by quantifying the causal effect through variance, subjective setting of feature importance can be avoided, and the screening process is reproducible; at the same time, by feature dimensionality reduction, variables without causal relationship can be eliminated, and the risk of model overfitting can be reduced; in addition, multi-time lag analysis can capture the causal relationship under different lag orders, and can adapt to short-term mutations and long-term trends.

[0062] In some optional embodiments, based on causal inference, the causal relationship between wind power and meteorological factors in the sequence sample is analyzed, and the method further comprises: identifying the causal relationship in the sequence sample based on the causal graph; fitting the meteorological factors and the wind power in the causal relationship to obtain a linear regression relationship between the meteorological factors and the wind power; and estimating the causal effect of the meteorological factors on the wind power based on the linear regression relationship.

[0063] In the present embodiment, time series of meteorological factors and wind power are extracted from the sequence sample to form a pair of (meteorological factors, wind power) variables. The assumed causal relationship direction is determined, for example, wind speed and wind power, and based on the assumed causal relationship direction, a directed acyclic graph, i.e. a causal graph, is constructed, with nodes as variables and edges as causal relationships. For each causal edge in the causal graph, a linear regression relationship is constructed, and based on the regression coefficient, the average influence of a unit change in the meteorological factors on the wind power is represented.

[0064] Specifically, the identification of the causal relationship between features can be represented by the following pseudo code:

[0065]

[0066]

[0067] In this way, by identifying and controlling confounding variables through the causal graph, the effect estimation bias caused by missing variables in traditional linear regression can be avoided.

[0068] In some optional embodiments, based on the causal inference, the causal relationship between the wind power and the meteorological factors is analyzed in the sequence sample, and the method further comprises: if the variance of the first variable pair is less than a preset significance threshold, and the causal effect of the first variable pair is positive, it is determined that the meteorological factor in the first variable pair has a positive causal relationship with the wind power.

[0069] In this embodiment, the Granger causality test and the DoWhy framework are combined to identify the causal relationship between the wind power and the meteorological factors. If the variance of the first variable pair is less than the preset significance threshold, it indicates that there is a significant difference in the prediction ability of the first variable pair, i.e., there may be a causal relationship. The causal effect value of the first variable pair is estimated using linear regression or the DoWhy framework. If both the variance is less than the preset significance threshold and the causal effect value is greater than zero, it is determined that the two variables in the first variable pair have a positive causal relationship.

[0070] In this way, by using the Granger causality test and the DoWhy causal inference framework to automatically mine the significant causal relationship between the wind power and the meteorological factors, redundant or spurious correlation variables can be effectively eliminated, thereby improving the interpretability, robustness and generalization ability of the model from the source.

[0071] In some optional embodiments, based on the sequence sample and the causal relationship, an adjacency matrix is constructed, comprising: based on the sequence sample, calculating the meteorological features corresponding to each wind turbine node; based on a similarity function, calculating the initial association weight between the meteorological features; based on the causal relationship, correcting the initial association weight to generate the adjacency matrix.

[0072] In this embodiment, for each wind turbine node, its meteorological features at each time step are extracted, for example, the meteorological features of the first wind turbine = [wind speed at time t, temperature at time t, wind speed at time t-1, …]. The absolute difference in the meteorological feature space can be measured by the Euclidean distance, for example, the absolute difference in the feature space of continuous variables (wind speed, temperature, etc.) can be measured by the Euclidean distance. The similarity of the feature direction can be measured by the cosine similarity, for example, the similarity of the angular feature direction of the wind direction can be measured by the cosine similarity.

[0073] For each pair of wind turbines, the similarity of their meteorological features is calculated to form an initial adjacency matrix. Through the causal relationship, a binary mask c is obtained, where c[i, j] = 1 indicates that the meteorological features of the wind turbine i have a significant causal relationship with the wind power of the wind turbine j. Based on the causal relationship, the initial association weight is corrected to only retain the connections with causal relationship and suppress the spurious correlation with no causal relationship but high similarity, thereby generating the adjacency matrix.

[0074] Specifically, the construction process of the adjacency matrix can be represented by the following pseudo code:

[0075] self.causal_mask = self._create_causal_mask() # create initial adjacency matrix

[0076] attention_logits = attention_logits * self.causal_mask.to(x.device) # multiply attention scores with causal mask to mask information from future time steps.

[0077] Compared with the fixed form of graph structure, the real-time dynamically updated adjacency matrix in the embodiment can dynamically adjust the connection weight between the fan nodes according to the real-time meteorological data, can accurately reflect the spatial dependence relationship between the fans changing at any time, is significantly superior to the traditional static graph structure modeling mode, and can automatically strengthen or weaken the information propagation between nodes in combination with the causal relationship. In this way, the spatial structure of the wind farm can be timely responded to the change of the real-time meteorological state, and the prediction accuracy can be greatly improved.

[0078] In some optional embodiments, the dynamic adjacency matrix can be specifically implemented in the model through an attention mechanism, including:

[0079] Input preparation: taking the meteorological features and historical wind power of each fan at multiple time steps as sequence sample inputs.

[0080] Linear mapping: the sequence sample is mapped into a query matrix (Query), a key matrix (Key) and a value matrix (Value) through linear transformation, respectively.

[0081] Attention score calculation and modulation: first, the initial attention score is calculated by the product of the query matrix and the key matrix. Then, the score matrix is multiplied element-wise with the dynamic adjacency matrix. This step uses the weight in the adjacency matrix (which has integrated causal relationship and real-time meteorological information) to modulate the attention score, so as to filter or weaken the connection of nodes without direct correlation, and to enhance the connection of important nodes.

[0082] Normalization: the normalized function such as Softmax is applied to the modulated attention score to obtain the final attention weight matrix, so that the sum of the attention weights of each node is one.

[0083] Feature aggregation: finally, based on the attention weight matrix, the value matrix is weighted and summed to aggregate the information of each node, and generate the final spatial feature vector for subsequent power prediction.

[0084] In some optional embodiments, the sequence sample and the adjacency matrix are aggregated to obtain the spatial feature vector, including: mapping the sequence sample through a linear transformation to obtain a query matrix, a key matrix and a value matrix; determining an initial attention score based on the query matrix, the key matrix and the value matrix, and constraining the calculation range of the initial attention score based on the adjacency matrix; performing normalization processing on the initial attention score to obtain an attention weight matrix between the fan nodes, and performing weighted aggregation on the value matrix based on the attention weight matrix to obtain the spatial feature vector.

[0085] In the embodiment, the sequence sample includes the meteorological features and the historical wind power of each fan at multiple time steps. The adjacency matrix can be dynamically adjusted based on the causal relationship and the real-time meteorological condition, and the correlation strength between the fans can be represented based on the adjacency matrix. The sequence sample is mapped to the query matrix, the key matrix and the value matrix through the linear transformation, and the attention weight is calculated based on the foregoing matrices. The original attention score is calculated based on the matrix multiplication, and then multiplied element by element with the adjacency matrix to filter the connections without causal relationship. The weight is normalized to ensure that the attention weight sum of each node is one. The value matrix is weighted aggregated based on the attention weight to obtain the spatial feature vector.

[0086] Specifically, the sequence sample can be mapped to the query matrix, the key matrix and the value matrix through the following pseudo code:

[0087] Q = self.query(x) / / map the input sequence sample to the query space for calculating the attention score

[0088] K = self.key(x) / / map the input sequence sample to the key space for matching with the query

[0089] V = self.value(x) / / map the input sequence sample to the value space for information aggregation

[0090] The spatial feature vector can be obtained through the following pseudo code:

[0091] attention_logits = torch.matmul(Q + pos_encoding, (K + pos_encoding).transpose(-2, -1)) / / calculate the attention score matrix, and add the position encoding to retain the time sequence information of the sequence

[0092] attention_logits = attention_logits / math.sqrt(self.out_features) / / scale the attention score to prevent gradient disappearance

[0093] attention_logits = attention_logits * self.causal_mask.to(x.device) / / Apply causal mask to ensure the model only attends to information up to the current time step

[0094] attention_weights = F.softmax(attention_logits, dim=-1) / / Convert attention scores to probability distribution by normalizing

[0095] out = torch.matmul(attention_weights, V) / / Aggregate value matrix based on attention weights

[0096] In this way, the Physics Informed Graph Attention based on physical information and causal weights combines position encoding and causal weight masks, not only focusing on the spatial position relationship between nodes, but also effectively emphasizing feature nodes with significant causal relationships, optimizing attention allocation. At the same time, the causal relationship is integrated into the graph attention mechanism, guiding the model to focus on the real driving factors and optimizing the information transmission path.

[0097] In some optional embodiments, the sequence sample and the spatial feature vector are fused to generate a prediction vector, and the prediction vector is used to represent the wind power prediction result, including: creating different scale time windows, in each time window, using a transformer architecture, based on an attention mechanism, obtaining the dependency relationship between each time window; based on the dependency relationship, generating multi-scale features; and fusing the multi-scale features to generate a prediction vector, wherein the prediction vector includes short-term changes and long-term regularities.

[0098] In this embodiment, the transformer architecture combining spatial and multi-scale time series can adapt to short-term and long-term prediction. Different length time windows are created, and different time windows can cover different periods of wind power changes. For the sequence in each window, the self-attention mechanism of the transformer is used to capture the dependency relationship between the time windows. The cross-attention mechanism is used to calculate the dependency relationship between different windows, and the feature vectors of each window are spliced through a fully connected layer, and the weights of each scale are dynamically adjusted through a gating mechanism.

[0099] Figure 2 The model schematic diagram of the graph convolutional network (GCN) transformer provided by the present application is shown as follows: Figure 2As shown, the GCN-Transformer includes a main model class 201 for integrating all components to realize spatio-temporal feature extraction and prediction. The Spatio Temporal Transformer Model 202 includes an input transform layer 2021, an encoder 2022, a spatio_temporal_transformer 2023, a graph_conv layer 2024, a predictor 2025, and a forward of the spatio_temporal_transformer 2026.

[0100] The GCN-Transformer also includes a spatio_temporal_transformer 203 for processing the dependency relationship of the time and space dimensions respectively. The spatio_temporal_transformer 203 includes a temporal_transformer 2031, a temporal_encoder 2032, a spatio_transformer 2033, a spatio_encoder 2034, a positional_encoding 2035, and a forward of the spatio_temporal_transformer 2036.

[0101] The GCN-Transformer also includes a graph_conv 204 and a positional_encoding 205. The graph_conv 204 includes a linear layer 2041 and a forward of the graph_conv 2042. The positional_encoding 205 is used to add position information to the sequence, and includes a positional_encoding matrix 2051 and a forward of the positional_encoding 2052.

[0102] Specifically, the prediction vector can be generated by the following pseudo code:

[0103] / / Build a Transformer encoder for extracting time series dependencies and spatial features in sequence samples

[0104] self.transformer = nn.TransformerEncoder( / / Define the single-layer structure of the Transformer encoder

[0105] nn.TransformerEncoderLayer(

[0106] d_model = hidden_dim, / / The hidden layer dimension of the model determines the feature representation ability

[0107] nhead=num_heads, / / number of heads of multi-head attention mechanism, to realize multi-view feature extraction

[0108] dropout=dropout, / / dropout ratio, to prevent overfitting

[0109] batch_first=True / / data format

[0110] ),

[0111] num_layers=2 / / number of layers of Transformer encoder, to stack multiple layers to enhance feature extraction capability / / position encoding

[0112] time_encoding=self.time_pos_encoding.unsqueeze(1).repeat(1,num_nodes,1) / / generate time position encoding and expand to all nodes, to capture time sequence information of the sequence

[0113] node_encoding=self.node_pos_encoding.unsqueeze(0).repeat(seq_len,1,1) / / generate node position encoding and expand to all time steps, to capture spatial information of the node

[0114] x=x+time_encoding.unsqueeze(0)+node_encoding.unsqueeze(0) / / add the original input to the time and node position encodings, to inject the time and space position information

[0115] In this way, based on the multi-scale Transformer structure, short-term fluctuations and medium and long-term trends of wind power can be extracted simultaneously at different time scales, overcoming the limitations of traditional models that model only a single time granularity, improving the prediction accuracy and time response capability, and realizing unified and effective modeling of wind power changes at different time scales, improving the prediction accuracy and robustness of the model.

[0116] Figure 3 A multi-dimensional data diagram provided by the application is shown. As shown in Figure 3 The multi-dimensional data includes: timestamp (Timestamp), first wind speed (wind speed 01), first voltage (power 01), second wind speed (wind speed 02), second voltage (power 02), etc.

[0117] In some optional embodiments, a weighted mean square error (Weighted MSE) loss function can also be created. Specifically, the loss function can be constructed by the following pseudo code:

[0118] def weighted_mse_loss(pred, target, threshold=250.0): / / dynamically generate weight tensor according to target value size, when target value (real power) exceeds threshold, weight is set to 2.0, when target value is lower than threshold, weight is set to 1.0

[0119] weights = torch.where(target > threshold,

[0120] torch.ones_like(target) * 2.0,

[0121] torch.ones_like(target)) / / calculate weighted mean square error loss, square the prediction error, the error in high power area will be amplified by 2 times

[0122] return torch.mean(weights * (pred - target) ** 2)

[0123] In this way, by weighting high-power samples, the prediction error in key scheduling nodes can be significantly reduced, the engineering application value of prediction can be improved, and the problem of serious high-power prediction error can be solved.

[0124] In some optional embodiments, the foregoing method further includes model training and deployment output. Specifically, the model training and deployment output includes model optimization, evaluation and deployment. The deployment interface design (MQTT / HTTP, etc. Industrial communication standards) supports real-time output of prediction results for scheduling system application. The model training can be implemented by the following pseudo code, and the trained model, training loss and test loss history record can be returned, the early stopping strategy can be used to prevent overfitting, and the model with the best performance on the validation set can be saved:

[0125]

[0126] In this way, the early stopping strategy stops the model training at the best generalization point, which can reduce the test error fluctuation. By introducing the weighted mean square error loss function, higher training weight is given to high-power scene samples, effectively reducing the prediction error in the key runtime period, and improving the operation reliability of the system in the key period of power grid scheduling.

[0127] The method for wind power prediction provided in the application is exemplarily described through the following specific embodiments. In a certain actual application scenario of a wind farm, the system obtains the running state and meteorological information of each wind turbine through an intranet interface every 10 seconds, automatically updates a dynamic adjacency matrix, and uses a causal graph attention Transformer model to predict the wind power change in the next 5-60 minutes. The prediction error is reduced by more than 15% compared with a traditional static graph model, and the real-time response capability is significantly improved, especially in the case of sudden wind speed change.

[0128] Table 1 shows the data number and actual parameter dictionary of the multi-dimensional data in the application. As shown in Table 1:

[0129] Table 1 shows the data number and actual parameter dictionary of the multi-dimensional data in the application. As shown in Table 1:

[0130]

[0131]

[0132]

[0133] In this embodiment, a device for wind power prediction is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.

[0134] The embodiment provides a device for wind power prediction, Figure 4 The structure of the device for wind power prediction provided in the application is shown in the schematic diagram as shown in Figure 4 As shown, it comprises:

[0135] The acquisition module 401 is configured to acquire multi-dimensional data and generate sequence samples based on the multi-dimensional data.

[0136] The analysis module 402 is configured to analyze the causal correlation in the sequence samples based on causal inference, and obtain the causal relationship between the wind power and the meteorological factors.

[0137] The construction module 403 is configured to construct an adjacency matrix based on the sequence samples and the causal relationship.

[0138] The prediction module 404 is configured to aggregate the sequence samples and the adjacency matrix to obtain a spatial feature vector, fuse the sequence samples and the spatial feature vector to generate a prediction vector, and represent the wind power prediction result based on the prediction vector.

[0139] In some optional embodiments, the analysis module 402 comprises:

[0140] The analysis module first unit is configured to create variable pairs of each meteorological factor and wind power composition; calculate variances of each variable pair at different time steps; based on the variances, represent the influence degree of the value of the meteorological factor in the time step on the current value of the wind power; filter target variable pairs with variances less than a preset significance threshold, and represent the causal relationship based on the target variable pairs.

[0141] In some optional embodiments, the analysis module 402 further comprises:

[0142] The analysis module second unit is configured to identify causal relationships in the sequence samples based on the causal graph; fit the meteorological factors and the wind power in the causal relationships to obtain a linear regression relationship between the meteorological factors and the wind power; and estimate the causal effect of the meteorological factors on the wind power based on the linear regression relationship.

[0143] In some optional embodiments, the analysis module 402 further comprises:

[0144] The analysis module third unit is configured to determine that there is a positive causal relationship between the meteorological factor in the first variable pair and the wind power if the variance of the first variable pair is less than the preset significance threshold and the causal effect of the first variable pair is positive.

[0145] In some optional embodiments, the construction module 403 comprises:

[0146] The construction module first unit is configured to calculate meteorological characteristics corresponding to each wind turbine node based on the sequence samples; calculate initial association weights between the meteorological characteristics based on a similarity function; and correct the initial association weights based on the causal relationship to generate an adjacency matrix.

[0147] In some optional embodiments, the prediction module 404 comprises:

[0148] The prediction module first unit is configured to map the sequence samples through linear transformation to obtain a query matrix, a key matrix, and a value matrix; determine an initial attention score based on the query matrix, the key matrix, and the value matrix; constrain the calculation range of the initial attention score based on the adjacency matrix; perform normalization processing on the initial attention score to obtain an attention weight matrix between the wind turbine nodes; and perform weighted aggregation on the value matrix based on the attention weight matrix to obtain a spatial feature vector.

[0149] In some optional embodiments, the prediction module 404 further comprises:

[0150] The second unit of the prediction module is used to create time windows of different scales. In each time window, a transformer architecture is used to obtain the dependencies between time windows based on the attention mechanism. Based on the dependencies, multi-scale features are generated. The multi-scale features are then fused to generate a prediction vector, which includes short-term changes and long-term patterns.

[0151] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0152] The device for wind power prediction in this embodiment is presented in the form of a functional unit, where the unit refers to an application specific integrated circuit (ASIC) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0153] The embodiment of the present invention also provides a computer device having the above Figure 4 The device shown is used for wind power prediction.

[0154] See also Figure 5 , Figure 5 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of a graphical user interface on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0155] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.

[0156] The aforementioned memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods illustrated by the above embodiments.

[0157] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function. The data storage area can store data created according to the use of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some optional embodiments, the memory 20 can optionally include a memory disposed remotely with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0158] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state disk. The memory 20 can also include a combination of the above types of memories.

[0159] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 can be connected by a bus or other means, Figure 5 For example, by a bus connection.

[0160] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, and the like. The output device 40 can include a display device, an auxiliary lighting device (such as a light-emitting diode), a tactile feedback device (such as a vibration motor), and the like. The display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0161] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0162] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, the operation of the computer can invoke or provide the method and / or technical solutions according to the present application. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc. Correspondingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0163] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.

Claims

1. A method for wind power prediction, characterized in that: The method comprises: Acquiring multidimensional data, and generating sequence samples based on the multidimensional data; Based on causal inference, the causal correlation in the sequence samples is analyzed to obtain the causal relationship between wind power and meteorological factors; constructing an adjacency matrix based on the sequence samples and the causal relationship; The sequence samples and the adjacency matrix are aggregated to obtain a spatial feature vector, the sequence samples and the spatial feature vector are fused to generate a prediction vector, and a wind power prediction result is represented based on the prediction vector.

2. The method according to claim 1, characterized in that The causal relationship between wind power and meteorological factors is analyzed based on causal inference, including: Creating variable pairs consisting of each of the meteorological factors and the wind power; Calculating the variance of each of the variable pairs at different time steps; Based on the variance, characterize the influence of the value of the meteorological factor in the time step on the current value of the wind power; Target variable pairs whose variances are smaller than a preset significance threshold are screened, and the causal relationship is characterized based on the target variable pairs.

3. The method according to claim 2, characterized in that The step of analyzing the causal correlation in the sequence samples based on causal inference to obtain the causal relationship between wind power and meteorological factors further includes: Based on the causal graph, identifying the causal relationship in the sequence sample; Fitting the meteorological factors and wind power in the causal relationship to obtain a linear regression relationship between the meteorological factors and the wind power; Based on the linear regression relationship, a causal effect of the meteorological factor on the wind power is estimated.

4. The method according to claim 3, characterized in that The step of analyzing the causal correlation in the sequence samples based on causal inference to obtain the causal relationship between wind power and meteorological factors further includes: If the variance of the first variable pair is less than the preset significance threshold, and the causal effect of the first variable pair is positive, it is determined that the meteorological factor in the first variable pair has a positive causal relationship with the wind power.

5. The method according to claim 1, wherein The step of constructing an adjacency matrix based on the sequence samples and the causal relationship includes: Based on the sequence samples, calculating the meteorological characteristics corresponding to each wind turbine node; Calculating initial association weights between the meteorological features based on a similarity function; Based on the causal relationship, the initial association weights are modified to generate the adjacency matrix.

6. The method according to claim 1, characterized in that The aggregating the sequence samples and the adjacency matrix to obtain a spatial feature vector includes: Mapping the sequence samples through linear transformation to obtain a query matrix, a key matrix and a value matrix; determining an initial attention score based on the query matrix, the key matrix, and the value matrix, and constraining a calculation range of the initial attention score based on the adjacency matrix; The initial attention scores are normalized to obtain an attention weight matrix between wind turbine nodes. Based on the attention weight matrix, the value matrix is ​​weightedly aggregated to obtain the spatial feature vector.

7. The method according to claim 1, characterized in that The fusing of the sequence samples and the spatial feature vector to generate a prediction vector, and characterizing the wind power prediction result based on the prediction vector, includes: Create time windows of different scales, and in each time window, use a transformer architecture and an attention mechanism to obtain the dependencies between the time windows; Based on the dependency relationship, generating multi-scale features; The multi-scale features are integrated to generate the prediction vector, wherein the prediction vector includes short-term changes and long-term regularities.

8. A device for wind power prediction, characterized in that: The device comprises: an acquisition module, configured to acquire multidimensional data and generate sequence samples based on the multidimensional data; An analysis module, configured to analyze the causal correlation in the sequence samples based on causal inference to obtain a causal relationship between wind power and meteorological factors; A construction module, configured to construct an adjacency matrix based on the sequence samples and the causal relationship; The prediction module is used to aggregate the sequence samples and the adjacency matrix to obtain a spatial feature vector, fuse the sequence samples and the spatial feature vector to generate a prediction vector, and characterize the wind power prediction result based on the prediction vector.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for wind power prediction according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for wind power prediction according to any one of claims 1 to 7.

Citation Information

Cited By

  • Active load prediction method and device for low-voltage distribution transformer area

    CN120955651A