Multi-region wind power output sequence scene generation method and system based on space-time attention mechanism
By constructing a multi-regional wind power output scenario generation model using a CGAN network based on a spatiotemporal attention mechanism, the problem of multi-regional wind power spatiotemporal correlation modeling is solved, and the accurate generation of wind power output scenarios is achieved, supporting the planning and scheduling of power systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-03-31
AI Technical Summary
Existing generative methods lack systematicity in modeling and generating the spatiotemporal correlation of wind power output in multiple regions, making it difficult to accurately express the nonlinear correlation of wind power in multiple regions.
A CGAN network based on a spatiotemporal attention mechanism is adopted to determine the temporal and spatial correlation of wind power output through autocorrelation function and Spearman correlation coefficient. A three-dimensional convolution and spatiotemporal attention module are introduced to construct a multi-region wind power output scene generation model. Combined with the Wasserstein distance constraint discriminator training process, the stability and fitting ability of adversarial learning are improved.
It accurately expresses the nonlinear correlation of wind power in multiple regions, and the generated wind power output scenario is highly consistent with the actual output, which can effectively support power system planning and dispatch.
Smart Images

Figure CN121765667A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of renewable energy forecasting technology, and more specifically, to a method and system for generating multi-regional wind power output sequence scenarios based on a spatiotemporal attention mechanism. Background Technology
[0002] In recent years, with the continuous expansion of regional wind power clusters in my country, the spatiotemporal correlation between the output of multiple wind farms has become increasingly prominent. Modeling research on the cross-correlation between different wind farms and its time-varying characteristics is crucial for constructing medium- and long-term wind power cluster output scenarios that conform to actual operating characteristics, and evaluating their effectiveness. This research can provide support for addressing the uncertainty of wind power output, and is of great significance for power system planning, operation scheduling, and maintenance management.
[0003] With the rapid development of artificial intelligence technology, data-driven generative networks are increasingly being applied to wind power output scenario generation research. This type of method, through deep learning of historical data, enables the model to autonomously generate output sequences that conform to statistical regularities, exhibiting typical black-box characteristics. Among them, Generative Adversarial Networks (GANs) are the most representative models. GANs are used to capture the relevant features of wind and solar power output in the spatiotemporal dimensions, and Wasserstein distance is introduced to improve the training stability of traditional GANs. While using Wasserstein Generative Adversarial Networks (WGANs) to simulate wind and solar power output scenarios improves network performance, the model lacks a constraint mechanism on the generated results. Based on Conditional Generative Adversarial Networks (CGANs), this study uses predicted wind power as a conditional variable and designs the network structure in conjunction with wind power output characteristics to effectively learn the temporal pattern of power output. A scaled dot product attention mechanism and a Temporal Convolutional Network (TCN) are introduced to construct a temporal generative adversarial model to generate monthly wind and solar power output scenarios. Furthermore, monthly label information is added to the model, leading to an improved Conditional Deep Convolutional Generative Adversarial Network (DCGAN), which enables the generation of joint wind and solar power output scenarios for planning analysis. Overall, while existing generative methods can capture the temporal correlation characteristics of wind power output to some extent, most studies still focus on single regions and lack systematic modeling and generation methods for the spatiotemporal correlation of wind power output across multiple regions. Summary of the Invention
[0004] To address the above problems, this invention proposes a method for generating multi-regional wind power output sequence scenarios based on a spatiotemporal attention mechanism, comprising:
[0005] A dataset was created by selecting short-term wind power forecast data and actual power data for preset time periods in each region;
[0006] Based on the dataset, determine the correlation of wind power output in each region over time.
[0007] Based on the spatiotemporal attention mechanism of the CGAN network and the aforementioned correlation, a multi-regional wind power output sequence scenario is generated.
[0008] Optional, the dataset includes: training set and test set;
[0009] The ratio of training set to test set is 7:5.
[0010] Optional, the correlation of wind power output over time in different regions includes:
[0011] Temporal correlation and spatial correlation;
[0012] The time correlation is determined using the autocorrelation function, and the calculation formula is as follows:
[0013]
[0014] Among them, P t Let be the wind power output at time t, and k be the number of time intervals. This represents the average wind power output. P is the autocorrelation coefficient of wind power with a time delay of k, where n is the length of the time series used for calculation. t+k This represents the wind power output value delayed by k time steps relative to time t.
[0015] The spatial correlation is represented by the Spearman correlation coefficient, which is calculated using the following formula:
[0016]
[0017] Where, ρ X,Y R(P) is the Spearman correlation coefficient. xi ) and R(P yi ) are samples P xi P yi The corresponding sequence, and Sequence P X P Y Average rank, ρ X,Y >0 indicates a positive correlation.
[0018] Optionally, the spatiotemporal attention mechanism CGAN network can be trained and tested based on the training set and the test set, respectively;
[0019] When training the spatiotemporal attention mechanism CGAN network, a spatiotemporal attention module is added to the spatiotemporal attention mechanism CGAN network;
[0020] The spatiotemporal attention module includes a spatial attention layer and a temporal attention layer.
[0021] Optionally, a spatial attention mechanism is used through a spatial attention layer to describe the spatial characteristics between the wind turbine outputs at different locations. The expression for the spatial attention mechanism is as follows:
[0022]
[0023] in, Let N be the input of the r-th spatiotemporal module, and C be the number of nodes. r-1 Let T be the number of input data channels for the r-th layer. r-1 Let V be the length of the time dimension of the r-th layer. s ,b s ∈R N×N , Here are the network parameters that can be used for learning, δ is the activation function, and S is the value in matrix S. i,j S′ represents the correlation between spatial nodes i and j. i,j The correlation is normalized.
[0024] Optionally, the temporal correlation between wind power outputs can be dynamically captured using a time attention module within the time attention layer. The expression for the time attention module is as follows:
[0025]
[0026] in, U1∈R N , For the parameters used in learning, E in the time correlation matrix E i,j E′ represents the correlation between time points i and j. i,j This represents the normalized correlation strength.
[0027] Optional methods also include:
[0028] Based on spatial correlation indicators, temporal correlation indicators, and effectiveness indicators, the results of the generated wind power output sequence scenarios in multiple regions are evaluated.
[0029] The spatial correlation indicators include: goodness-of-fit indicators and correlation indicators;
[0030] The effectiveness metrics include: coverage metrics, average width of power range metrics, and pinball loss metrics.
[0031] Furthermore, this invention also proposes a multi-regional wind power output sequence scene generation system based on a spatiotemporal attention mechanism, comprising:
[0032] The data acquisition unit is used to select short-term wind power forecast data and actual power data for preset time periods in each region to establish a dataset;
[0033] The calculation unit is used to determine the correlation of wind power output in each region over time based on the dataset.
[0034] The scene generation unit is used to generate wind power output sequence scenes in multiple regions based on the spatiotemporal attention mechanism CGAN network and the aforementioned correlation.
[0035] Optional, the dataset includes: training set and test set;
[0036] The ratio of training set to test set is 7:5.
[0037] Optional, the correlation of wind power output over time in different regions includes:
[0038] Temporal correlation and spatial correlation;
[0039] The time correlation is determined using the autocorrelation function, and the calculation formula is as follows:
[0040]
[0041] Among them, P t Let be the wind power output at time t, and k be the number of time intervals. This represents the average wind power output. P is the autocorrelation coefficient of wind power with a time delay of k, where n is the length of the time series used for calculation. t+k This represents the wind power output value delayed by k time steps relative to time t.
[0042] The spatial correlation is represented by the Spearman correlation coefficient, which is calculated using the following formula:
[0043]
[0044] Where, ρ X,Y R(P) is the Spearman correlation coefficient. xi ) and R(P yi ) are samples P xi P yi The corresponding sequence, and Sequence P X P Y Average rank, ρ X,Y >0 indicates a positive correlation.
[0045] Optionally, the spatiotemporal attention mechanism CGAN network can be trained and tested based on the training set and the test set, respectively;
[0046] When training the spatiotemporal attention mechanism CGAN network, a spatiotemporal attention module is added to the spatiotemporal attention mechanism CGAN network;
[0047] The spatiotemporal attention module includes a spatial attention layer and a temporal attention layer.
[0048] Optionally, a spatial attention mechanism is used through a spatial attention layer to describe the spatial characteristics between the wind turbine outputs at different locations. The expression for the spatial attention mechanism is as follows:
[0049]
[0050] in, Let N be the input of the r-th spatiotemporal module, and C be the number of nodes. r-1 Let T be the number of input data channels for the r-th layer. r-1 Let V be the length of the time dimension of the r-th layer. s ,b s ∈R N×N , Here are the network parameters that can be used for learning, δ is the activation function, and S is the value in matrix S. i,j S′ represents the correlation between spatial nodes i and j. i,j The correlation is normalized.
[0051] Optionally, the temporal correlation between wind power outputs can be dynamically captured using a time attention module within the time attention layer. The expression for the time attention module is as follows:
[0052]
[0053] in, U1∈R N , For the parameters used in learning, E in the time correlation matrix E i,j E′ represents the correlation between time points i and j. i,j This represents the normalized correlation strength.
[0054] Optionally, the scene generation unit is also used for:
[0055] Based on spatial correlation indicators, temporal correlation indicators, and effectiveness indicators, the results of the generated wind power output sequence scenarios in multiple regions are evaluated.
[0056] The spatial correlation indicators include: goodness-of-fit indicators and correlation indicators;
[0057] The effectiveness metrics include: coverage metrics, average width of power range metrics, and pinball loss metrics.
[0058] In another aspect, the present invention also provides a computing device, comprising: one or more processors;
[0059] A processor is used to execute one or more programs;
[0060] When the one or more programs are executed by the one or more processors, the method described above is implemented.
[0061] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described above.
[0062] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0063] This invention provides a method for generating multi-regional wind power output sequence scenarios based on a spatiotemporal attention mechanism. The method includes: selecting short-term predicted wind power data and actual power data for a preset time period in each region to establish a dataset; determining the correlation of wind power output in each region over time based on the dataset; and generating multi-regional wind power output sequence scenarios based on a spatiotemporal attention mechanism CGAN network and the correlations. This invention generates wind power output sequence scenarios by using a spatiotemporal attention mechanism CGAN network and correlations, which can accurately represent the problem of nonlinear correlations in multi-regional wind power. Attached Figure Description
[0064] Figure 1 This is a flowchart of the method of the present invention;
[0065] Figure 2 This is a schematic diagram of the basic structure of CGAN in an embodiment of the method of the present invention;
[0066] Figure 3 This is a schematic diagram of the reconstructed data matrix in an embodiment of the method of the present invention;
[0067] Figure 4 This is a schematic diagram of a three-dimensional tensor data structure in an embodiment of the method of the present invention;
[0068] Figure 5 This is a schematic diagram of the three-dimensional convolution process in an embodiment of the method of the present invention;
[0069] Figure 6 This is a schematic diagram of the spatiotemporal attention module structure in an embodiment of the method of the present invention;
[0070] Figure 7 This is a schematic diagram of the generator network structure in an embodiment of the method of the present invention;
[0071] Figure 8 This is a schematic diagram of the discriminator network structure in an embodiment of the method of the present invention;
[0072] Figure 9 This is a schematic diagram of the network training process in an embodiment of the method of the present invention;
[0073] Figure 10 (ad) is a scene diagram of regional wind power output generation according to an embodiment of the method of the present invention;
[0074] Figure 11 This is a structural diagram of the system of the present invention. Detailed Implementation
[0075] Exemplary embodiments of the invention will now be described with reference to the accompanying drawings. However, the invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.
[0076] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.
[0077] Example 1:
[0078] This invention proposes a multi-region wind power output sequence scene generation method S100 based on a spatiotemporal attention mechanism, such as... Figure 1 As shown, it includes:
[0079] S101, Select short-term predicted power data and actual power data of wind power for a preset period in each region to establish a dataset;
[0080] S102, Based on the dataset, determine the correlation of wind power output in each region over time;
[0081] S103, Based on the spatiotemporal attention mechanism CGAN network and the aforementioned correlation, generate wind power output sequence scenarios in multiple regions.
[0082] The dataset includes: a training set and a test set;
[0083] The ratio of training set to test set is 7:5.
[0084] The correlation of wind power output in different regions over time includes:
[0085] Temporal correlation and spatial correlation;
[0086] The time correlation is determined using the autocorrelation function, and the calculation formula is as follows:
[0087]
[0088] Among them, P t Let be the wind power output at time t, and k be the number of time intervals. This represents the average wind power output. P is the autocorrelation coefficient of wind power with a time delay of k, where n is the length of the time series used for calculation (i.e., the number of sample points). t+k This represents the wind power output value delayed by k time steps relative to time t.
[0089] The spatial correlation is represented by the Spearman correlation coefficient, which is calculated using the following formula:
[0090]
[0091] Where, ρ X,Y R(P) is the Spearman correlation coefficient. xi ) and R(P yi ) are samples P xi P yi The corresponding sequence, and Sequence P X P Y Average rank, ρ X,Y >0 indicates a positive correlation.
[0092] Among them, the spatiotemporal attention mechanism CGAN network was trained and tested based on the training set and the test set, respectively.
[0093] When training the spatiotemporal attention mechanism CGAN network, a spatiotemporal attention module is added to the spatiotemporal attention mechanism CGAN network;
[0094] The spatiotemporal attention module includes a spatial attention layer and a temporal attention layer.
[0095] Specifically, a spatial attention mechanism is used through a spatial attention layer to describe the spatial characteristics of wind turbine output at different locations. The expression for the spatial attention mechanism is as follows:
[0096]
[0097] in, Let N be the input of the r-th spatiotemporal module, and C be the number of nodes. r-1 Let T be the number of input data channels for the r-th layer. r-1 Let V be the length of the time dimension of the r-th layer. s ,b s ∈R N×N , Here are the network parameters that can be used for learning, δ is the activation function, and S is the value in matrix S. i,j S′ represents the correlation between spatial nodes i and j. i,j The correlation is normalized.
[0098] Specifically, the time attention module of the time attention layer dynamically captures the time correlation between wind power outputs. The expression of the time attention module is as follows:
[0099]
[0100] in, U1∈R N , For the parameters used in learning, E in the time correlation matrix E i,j E′ represents the correlation between time points i and j. i,j This represents the normalized correlation strength.
[0101] The methods also include:
[0102] Based on spatial correlation indicators, temporal correlation indicators, and effectiveness indicators, the results of the generated wind power output sequence scenarios in multiple regions are evaluated.
[0103] The spatial correlation indicators include: goodness-of-fit indicators and correlation indicators;
[0104] The effectiveness metrics include: coverage metrics, average width of power range metrics, and pinball loss metrics.
[0105] The invention will be further described below with reference to specific implementation examples:
[0106] To address the problem that traditional methods are unable to accurately represent the nonlinear correlation of wind power in multiple regions, this paper extracts the spatiotemporal correlation patterns of wind power in multiple regions based on a large amount of measured data, constructs a CGAN scene generation model with three-dimensional convolution as its skeleton, and uses a Wasserstein distance-constrained discriminator for training to improve the stability and fitting ability of adversarial learning.
[0107] The specific implementation steps are as follows:
[0108] (1) Data Acquisition:
[0109] Taking five wind power regions in Northwest my country as examples, we selected the short-term predicted and actual wind power for each region over one year as the dataset. The data interval is 1 hour, and the length of the predicted and actual data sequences is 34,560. For this example, 210 days of data were used as the training sample, and 150 days of data were used as the test dataset. A rolling dataset was formed with a 3-day window, and the scene generation network was trained and analyzed.
[0110] (2) Spatiotemporal correlation analysis:
[0111] 1) Time correlation analysis:
[0112] Due to the continuous flow of wind, wind power output exhibits significant correlation over time. To characterize the time-dependent nature of wind power series, an autocorrelation function (ACF) is typically introduced to quantitatively describe the degree of temporal correlation. Its calculation expression is shown in the equation, reflecting the correlation between wind power output at different times.
[0113]
[0114] In the formula, P t Let be the wind power output at time t; k be the number of time intervals; This represents the average wind power output. is the autocorrelation coefficient of wind power with a time delay of k. The closer the value is to 1, the higher the positive correlation; conversely, the closer it is to -1, the higher the negative correlation.
[0115] 2) Spatial correlation analysis:
[0116] The Spearman correlation coefficient is a statistical indicator commonly used to measure the correlation of wind power output between different regions. Let P... X With P Y P represents the actual wind power series of the two regions respectively. xi With P yi Let ρ be the power value corresponding to the i-th sample after sorting. Then, the Spearman correlation coefficient ρ between the two regions is... X,Y The following formula can be used to calculate and reflect the correlation of wind power output in the spatial dimension.
[0117]
[0118] In the formula, R(P) xi ) and R(P yi ) are samples P xi P yi The corresponding sequence; and Sequence PX P Y Average rank; ρ X,Y >0 indicates a positive correlation.
[0119] (2) Wind power output scene generation based on CGAN:
[0120] 1) Principle of Conditional Generative Adversarial Networks:
[0121] Generative Adversarial Networks (GANs) are a class of unsupervised learning models based on deep learning, consisting of a generator (G) and a discriminator (D). They approximate the data distribution through adversarial training. Conditional Generative Adversarial Networks (CGANs) build upon this by introducing supervised constraints, incorporating conditional information into the generation and discrimination processes. This makes the model more goal-oriented when generating samples with a specific distribution. Its principle can be viewed as a zero-sum game: the generator continuously optimizes to produce samples that approximate the true distribution, while the discriminator continuously learns to identify fake data; ultimately, the two reach an optimal balance in the adversarial process.
[0122] As attached Figure 2 As shown, CGAN adds a condition variable 'c' to the inputs of both the generator and the discriminator, requiring the discriminator not only to determine the authenticity of samples but also to verify whether they conform to the distribution mapping characteristics under given conditions. In wind power prediction applications, short-term prediction errors are large, directly affecting the reliability of scheduling optimization. To address this issue, this paper constructs a condition variable 'c' based on the predicted power and error distribution, and uses random noise 'z' as input to generate wind power output scenarios that meet the conditions through a generator G(z|c). The discriminator outputs a discrimination value based on the difference between the generated result and the real sample, and feeds it back to the generator to achieve adversarial iterative updates. The final generated scenario distribution is highly consistent with the actual wind power output.
[0123] 2) Spatiotemporal characteristics input of wind power output:
[0124] The core of Generative Adversarial Networks (GANs) lies in feature extraction and distribution learning of input samples, enabling the generator to produce samples consistent with the target object. As shown in the previous section, the wind power output scene generation framework based on Conditional GAN (CGAN) uses the wind power prediction sequence as the conditional vector c and a randomly sampled sequence derived from the prediction error distribution as noise z.
[0125] For wind power output across multiple regions, spatial correlations are prevalent. Therefore, simply learning the autocorrelation of time series data is insufficient to construct a reliable scenario; it is also necessary to characterize the spatial dependency structure between multiple regions simultaneously. To this end, during the training phase, historical operational data from multiple wind power regions should be input into the generator network as real samples in parallel, enabling the network to extract cross-regional correlation features from the joint samples.
[0126] Suppose there are m wind power areas, denoted by z. i With c i Let z represent the noise input and conditional input corresponding to the i-th region. Then, the set of noise z and conditional input sequences generated in a multi-region scene can be written as z = {z1, z2, ..., z...} m-1 ,z m c = {c1, c2, ..., c} m-1 ,c m At each time step, the conditional value and the noise are matched one-to-one, ensuring that their lengths are consistent. The conditional sequences and noise sequences of the m regions are concatenated along their feature dimensions (vertical direction) to obtain m sets of planar matrices; the reconstructed data matrix of the i-th region is shown in the appendix. Figure 3 As shown. This processing method preserves the temporal dynamics of each region and explicitly encodes the spatial relationships between regions, providing support for the joint generation of wind power output scenarios in multiple regions.
[0127] At any given time, wind power output is correlated across regions. To explicitly preserve this cross-regional dependency, the reconstructed data matrices obtained from m wind power regions within the same time period can be concatenated column-wise (horizontally) to form a three-dimensional tensor. Input data is attached. Figure 4 As shown.
[0128] Two-dimensional convolutional networks are only suitable for extracting planar structural features; while three-dimensional convolution (Conv3) performs convolution operations on three-dimensional data tensors by expanding the kernel dimension, achieving joint modeling of features in both the temporal and spatial dimensions. (Appendix) Figure 5 The workflow is described: the convolution kernel moves along the width, height, and depth axes, and at each position, the kernel coefficients are multiplied element-wise with the covered sub-block and accumulated to obtain the corresponding feature value. Since the convolution traverses a three-dimensional voxel domain, the network output remains a three-dimensional tensor.
[0129] In network training for multi-region wind power output scenarios, the input is a three-dimensional tensor formed by stitching together historical output data from multiple regions. Sliding the 3D convolutional kernel along the width axis effectively extracts time-series features; sliding along the height axis helps learn spatially relevant structures. By padding the perimeter of the 3D tensor, the size of the convolutional layer output can be controlled, thereby obtaining a scene sequence of a set time length. Its 3D convolution operation is represented as follows:
[0130] F = S * f
[0131] In the formula, * represents the three-dimensional convolution operator, S is the input three-dimensional tensor, and f is the three-dimensional convolution kernel. Based on the sampling interval and spatiotemporal correlation characteristics of wind power data, the number of network layers and the convolution kernel size can be configured accordingly. Combining short-term prediction settings and considering the sampling interval, this paper adopts a 6-layer convolution structure with a kernel size of 3×17 to characterize the wind power output characteristics.
[0132] 3) Spatiotemporal attention module:
[0133] Attention mechanisms, initially applied in machine learning, have become a crucial component of neural network models. Their core idea is to learn the importance of input features to the output, dynamically adjusting the weights of each feature to make the model more focused on key information. Given that wind power sequences exhibit significant spatial correlation and temporal dependence, this paper designs a spatiotemporal attention module to capture the spatiotemporal coupling relationship of wind turbine power. The module structure is shown in the attached figure. Figure 6 As shown, it consists of two parts: a spatial attention layer and a temporal attention layer, which are used to extract spatial feature dependencies and temporal dynamic correlations, respectively.
[0134] Spatial attention layer:
[0135] The proposed spatial attention mechanism describes the spatial characteristics of wind turbine output at different locations. The attention mechanism is as follows:
[0136]
[0137] In the formula, The input is the r-th spatiotemporal module; N is the number of nodes; C r-1 T represents the number of input data channels for the r-th layer; r-1 V is the length of the time dimension of the r-th layer; s ,b s ∈R N×N , Here are the network parameters that can be used for learning; δ is the activation function; in matrix S, S0... i,j S′ represents the correlation between spatial nodes i and j. i,j The correlation is normalized.
[0138] Time-based attention layer:
[0139] Wind power output exhibits a certain correlation at different times, and this correlation also varies across different times. Therefore, a time attention module is needed to dynamically capture the time correlation between wind power outputs. The formula is as follows:
[0140]
[0141] In the formula, U1∈R N , The parameters used for learning; E in the time correlation matrix E i,j E′ represents the correlation between time points i and j; i,j This represents the normalized correlation strength.
[0142] 4) Network structure design:
[0143] The CGAN-based multi-region wind power output scenario generation model consists of two parts: a generator and a discriminator. Its network structure is shown in the attached figure. Figure 7 With appendix Figure 8 As shown.
[0144] The generator is designed as a six-layer network. The input layer and each intermediate layer contain convolutional layers (Conv3), batch normalization (BN), and activation functions. Batch normalization standardizes the inputs of each layer to an approximate Gaussian distribution, thereby reducing the correlation between parameters and improving the model's training stability and convergence speed. Since some neurons may output negative values after normalization, LeakyReLU activation functions are used in the input and intermediate layers to maintain gradient propagation capability, ensuring that data in the negative interval still has some learning potential. The generator's output expression at time t for the l-th layer (l∈{1,…,5}) is given. As shown in equation (4).
[0145]
[0146] In the formula, This represents the output of the (l-1)th layer; N represents the 3D convolution kernel of the l-th layer. BN This is a batch normalization function.
[0147] The output layer of generator G aims to make the generated wind power output scenario distribution as close as possible to the actual output characteristics. Introducing batch normalization into this layer may cause the output results to shift towards a specific distribution, thereby weakening the model's ability to represent diverse scenarios. Based on this, this paper does not use batch normalization in the output layer, but instead uses the ReLU activation function to ensure that the generated wind power output scenario values remain non-negative.
[0148] The discriminator network consists of convolutional layers and fully connected layers. Its convolutional layer structure is similar to that of the generator, with batch normalization and a LeakyReLU activation function introduced after each convolutional operation to improve training stability and prevent gradient vanishing. The output of the discriminator at time t, layer m ∈ {1,…,6}, is denoted as... Its calculation form is shown in the formula.
[0149]
[0150] In the formula, Represents the output of the (m-1)th layer; represents The m-th layer's three-dimensional convolution kernel.
[0151] The results obtained after six layers of operations are input into a fully connected layer, where full-plane weights are used for calculation, and finally mapped to the discriminant value of the real data distribution.
[0152] 5) Online training:
[0153] During the model training phase, the parameter update frequency of the generator and discriminator is kept consistent, meaning they are optimized synchronously within the same training cycle. The overall training process is shown in the appendix. Figure 9 As shown.
[0154] The discriminator D aims to maximize the difference between the generated sample x′ and the real sample x, thereby enhancing its discriminative power. Correspondingly, the generator G's training objective is to minimize this difference, generating samples that are as close as possible to the true distribution. The two iterate in a game-like adversarial process, eventually reaching equilibrium. Based on this mechanism, the overall optimization objective of the generative adversarial network can be expressed as max(V(x,x′)), with the objective function shown in the equation.
[0155]
[0156] In the formula, x represents the actual power of wind power; x′ represents the wind power output generated by the generator; Pr(x) represents the actual sample data; P(x′) represents the generated sample data; D(·) represents the discriminator function; and V(x,x′) represents the difference between the generated data x′ and the sample data x.
[0157] To avoid problems such as vanishing gradients and mode collapse that may occur during training, this paper introduces the Wasserstein distance into the discriminator's loss function to measure the difference between the generated sample distribution and the real sample distribution. Its mathematical definition is shown below:
[0158]
[0159] In the formula, γ represents the joint distribution of an optimal path; ∏(p r (x),p(x′)) represents the joint distribution established between the true sample distribution and the generated sample distribution; W represents the distance between the true sample distribution and the generated sample distribution; ||xx′|| is the distance between the true sample distribution and the generated sample distribution.
[0160] Because it is difficult to solve directly, to ensure the feasibility and stability of the training process, constraints are imposed on the discriminator parameters to maintain Lipschitz continuity. This is usually achieved through weight clipping, thereby ensuring the approximate computability of the Wasserstein distance. Therefore:
[0161]
[0162] In the formula, sup represents the least upper bound; K represents a constant in the function; ||D(x)|| L≤K indicates that the discriminator function satisfies the continuity condition of the constant K. The final objective function is shown in the equation.
[0163]
[0164] In the formula, This is the "tiered penalty" item; It is a random sampling of the real sample x and the generated sample x′.
[0165] (3) Evaluation of scene generation results:
[0166] 1) Spatial correlation indicators:
[0167] Common metrics for evaluating fit are as follows:
[0168] ① Goodness-of-fit index: The Euclidean distance d is used to measure it. The smaller d is, the better the Copula function matches the empirical distribution.
[0169] ② Correlation Indicators: Spearman and Kendall correlation coefficients are used to calculate the scenarios sampled by each Copula function. The closer the correlation coefficient is to the actual sample, the more accurately the selected Copula model reflects the true spatial correlation characteristics.
[0170] The above indicators are defined as follows.
[0171] Let the cumulative distribution functions of random vectors X and Y be F(x) and G(y), respectively, expressed as u = F(x) and v = G(y). Let (x i ,y i (i = 1, 2, ..., N) are samples taken from the random vector (X, Y). The Copula function of (X, Y) is C(u, v), and u, v ∈ [0, 1].
[0172] The Euclidean distance d is:
[0173]
[0174] In the formula, The empirical distribution function can be calculated using the following formula.
[0175]
[0176] In the formula, I[·] is the explicit function, if F(x i If )≤u, then I[F(x) i )≤u]=1, otherwise I[F(x i )≤u]=0.
[0177] The Spearman correlation coefficient is:
[0178]
[0179] In the formula, P[·] is the probability density function; the random vector (X′,Y′), (X,Y) follow the same distribution.
[0180] Kendall's correlation coefficient is:
[0181] τ(X,Y)=
[0182] P[(XX′)(YY′)>0]-P[(XX′)(YY′)<0]
[0183] 2) Time-related indicators:
[0184] This paper uses the autocorrelation coefficient (ACF) to evaluate the simulation quality of the generated wind power output scenario's correlation with the time-dependent wind power output. The autocorrelation coefficient of the actual wind power output gradually decreases with increasing lag time; therefore, the quality of the generated scenario can be measured by analyzing the magnitude and variation characteristics of the correlation coefficient.
[0185] 3) Effectiveness indicators:
[0186] Effectiveness refers to whether the generated wind power output scenario can accurately characterize the randomness and uncertainty of actual power output. To achieve this goal, three complementary metrics are used for evaluation: coverage rate, power interval average width, and pinball loss.
[0187] The formula for calculating coverage is:
[0188]
[0189] In the formula, T represents the total number of output moments in the wind power sequence; T′ represents the number of moments in which the actual wind power output falls within the scene set; and C represents the coverage rate. A larger C value indicates higher reliability.
[0190] The formula for calculating the power range width is:
[0191]
[0192] In the formula, W is the average width of the power range of wind power output; Let t be the upper bound of the wind power output scenario at time t; This is the lower bound. The narrower the average width of the power range, the better the generated scene effect.
[0193] The Pinball loss function is:
[0194]
[0195] In the formula, S(P) t Q t P represents the pinball loss value for the wind power output scenario at time t; real This refers to the actual power output of the wind power. Let be the wind power output value of the i-th quantile; m be the number of quantiles; α i Let be the i-th quantile.
[0196] In the scenario effectiveness assessment, coverage rate C measures the extent to which the generated scenario set envelops the actual wind power output, while the average width of the power range W describes the range of uncertainty. There is a trade-off between the two, meaning that a wider range usually results in higher coverage rate. To comprehensively reflect the performance of the above two aspects under a single indicator, Pinball loss S is introduced as a total metric. The smaller the value, the better the scenario matches the quantile of the actual output and the more accurate the characterization of random uncertainty, thus resulting in higher overall effectiveness.
[0197] Generate scene sets such as Figure 10 As shown in (a)-(d), the mean trajectory (green) follows the dominant trend of the actual power output curve (red) well in different weeks, accurately reproducing multiple rises, plateaus, and falls, indicating that the model can effectively explore the nonlinear mapping relationship between wind speed sequence and power output. From the perspective of uncertainty characterization, the generated scenario band represented by the dashed line widens significantly during the high-output phase and contracts significantly during the low-output phase. Most of the time, the actual curve falls within or near the edge of the scenario band, indicating that the model has reasonable time-varying dispersion at different power levels and can cover the uncertainty of wind power output in a probabilistic sense. It should be noted that in some periods with drastic jumps (such as short-term deep valleys or peaks), the mean trajectory shows a certain smoothing tendency, slightly overestimating extreme low output and slightly underestimating extreme high output, indicating that the current model's characterization of extreme abrupt events is still conservative. The constructed conditional GAN model can generate diverse and reasonably distributed long-term power output scenarios in typical periods, ensuring consistency with historical observations and providing rich sample support for subsequent uncertainty analysis and risk assessment.
[0198] Example 2:
[0199] Furthermore, this invention also proposes a multi-regional wind power output sequence scene generation system 200 based on a spatiotemporal attention mechanism, such as... Figure 11 As shown, it includes:
[0200] Data acquisition unit 201 is used to select short-term wind power forecast data and actual power data for preset time periods in each region to establish a dataset;
[0201] The calculation unit 202 is used to determine the correlation of wind power output in each region over time based on the dataset.
[0202] Scene generation unit 203 is used to generate wind power output sequence scenes in multiple regions based on the spatiotemporal attention mechanism CGAN network and the aforementioned correlation.
[0203] The dataset includes: a training set and a test set;
[0204] The ratio of training set to test set is 7:5.
[0205] The correlation of wind power output in different regions over time includes:
[0206] Temporal correlation and spatial correlation;
[0207] The time correlation is determined using the autocorrelation function, and the calculation formula is as follows:
[0208]
[0209] Among them, P t Let be the wind power output at time t, and k be the number of time intervals. This represents the average wind power output. P is the autocorrelation coefficient of wind power with a time delay of k, where n is the length of the time series used for calculation (i.e., the number of sample points). t+k for;
[0210] The spatial correlation is represented by the Spearman correlation coefficient, which is calculated using the following formula:
[0211]
[0212] Where, ρ X,Y R(P) is the Spearman correlation coefficient. xi ) and R(P yi ) are samples P xi P yi The corresponding sequence, and Sequence P X P Y Average rank, ρ X,Y >0 indicates a positive correlation.
[0213] Among them, the spatiotemporal attention mechanism CGAN network was trained and tested based on the training set and the test set, respectively.
[0214] When training the spatiotemporal attention mechanism CGAN network, a spatiotemporal attention module is added to the spatiotemporal attention mechanism CGAN network;
[0215] The spatiotemporal attention module includes a spatial attention layer and a temporal attention layer.
[0216] Specifically, a spatial attention mechanism is used through a spatial attention layer to describe the spatial characteristics of wind turbine output at different locations. The expression for the spatial attention mechanism is as follows:
[0217]
[0218] in, Let N be the input of the r-th spatiotemporal module, and C be the number of nodes. r-1 Let T be the number of input data channels for the r-th layer. r-1 Let V be the length of the time dimension of the r-th layer. s ,b s ∈R N×N , Here are the network parameters that can be used for learning, δ is the activation function, and S is the value in matrix S. i,j S′ represents the correlation between spatial nodes i and j. i,j The correlation is normalized.
[0219] Specifically, the time attention module of the time attention layer dynamically captures the time correlation between wind power outputs. The expression of the time attention module is as follows:
[0220]
[0221] in, U1∈R N , For the parameters used in learning, E in the time correlation matrix E i,j E′ represents the correlation between time points i and j. i,j This represents the normalized correlation strength.
[0222] The scene generation unit 203 is also used for:
[0223] Based on spatial correlation indicators, temporal correlation indicators, and effectiveness indicators, the results of the generated wind power output sequence scenarios in multiple regions are evaluated.
[0224] The spatial correlation indicators include: goodness-of-fit indicators and correlation indicators;
[0225] The effectiveness metrics include: coverage metrics, average width of power range metrics, and pinball loss metrics.
[0226] This invention generates wind power output sequence scenarios through the spatiotemporal attention mechanism CGAN network and correlation, which can accurately express the problem of nonlinear correlation of wind power in multiple regions.
[0227] Example 3:
[0228] Based on the same inventive concept, this invention also provides a computer device, which includes a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement corresponding method flows or corresponding functions, thereby implementing the steps of the methods in the above embodiments.
[0229] Example 4:
[0230] Based on the same inventive concept, this invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of the method in the above embodiments.
[0231] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0232] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0234] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0235] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0236] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for generating multi-region wind power output sequence scenarios based on a spatio-temporal attention mechanism, characterized in that, The method comprises the steps of: selecting wind power short-term prediction power data and actual power data of a preset period in each region to establish a data set; determining the correlation of wind power output in each region in time sequence according to the data set; generating a wind power output sequence scene in multiple regions based on a spatio-temporal attention mechanism CGAN network and the correlation.
2. The method of claim 1, wherein, The data set comprises a training set and a test set. The ratio of the training set to the test set is 7:
5.
3. The method of claim 1, wherein, The correlation of wind power output in each region in time sequence comprises: temporal correlation and spatial correlation. The temporal correlation is determined by an autocorrelation function, and the calculation formula is as follows: where P t is the wind power output at time t, k is the number of time intervals, is the average value of wind power output, is the wind power autocorrelation coefficient with time delay k, n is the length of time series for calculation, P t+k is the wind power output value delayed k time steps backward relative to time t; The spatial correlation is represented based on a Spearman correlation coefficient, and the calculation formula of the Spearman correlation coefficient is as follows: wherein p X,Y is the Spearman correlation coefficient, R(P xi ) and R(P yi ) are the ranks of the samples P xi , P yi , respectively, and are the average ranks of the sequences P X , P Y , respectively, and p X,Y > 0 indicates a positive Correlation.
4. The method of claim 2, wherein, The spatio-temporal attention mechanism CGAN network is trained and tested based on the training set and the test set. When the spatio-temporal attention mechanism CGAN network is trained, a spatio-temporal attention module is added to the spatio-temporal attention mechanism CGAN network. The spatio-temporal attention module comprises a spatial attention layer and a temporal attention layer.
5. The method of claim 4, wherein, The spatial attention layer adopts a spatial attention mechanism to describe the spatial characteristics between wind turbine outputs at different positions, and the expression of the spatial attention mechanism is as follows: wherein, is the input of the rth spatio-temporal module, N is the number of nodes, C r-1 is the number of input data channels of the rth layer, T r-1 is the length of the time dimension of the rth layer, V s ,b s ∈R N×N , is the network parameter available for learning, δ is the activation function, S i,j represents the correlation between spatial nodes i and j, S′ i,j is the normalized correlation.
6. The method of claim 4, wherein, The temporal attention module of the temporal attention layer dynamically captures the temporal correlation between wind power outputs, and the expression of the temporal attention module is as follows: wherein, U1∈R N , is a parameter for learning, E i,j denotes the correlation between time nodes i and j, E′ i,j is the normalized correlation strength.
7. The method of claim 1, wherein, The method further comprises: based on the spatial correlation index, the temporal correlation index, and the effectiveness index, the generated wind power output sequence scene in multiple regions is evaluated. The spatial correlation index comprises a goodness-of-fit index and a correlation index. The effectiveness index comprises a coverage rate index, a power interval average width index, and a Pinball loss index.
8. A multi-region wind power output sequence scenario generation system based on a spatio-temporal attention mechanism, characterized in that, The method comprises the steps of: a data acquisition unit is configured to select wind power short-term prediction power data and actual power data of a preset period in each region to establish a data set; a calculation unit is configured to determine the correlation of wind power output in each region in time sequence according to the data set; a scene generation unit is configured to generate a wind power output sequence scene in multiple regions based on a spatio-temporal attention mechanism CGAN network and the correlation.
9. The multi-zone wind power output sequence scenario generation system according to claim 8, characterized in that, The data set comprises a training set and a test set. The ratio of the training set to the test set is 7:
5.
10. The multi-zone wind power output sequence scenario generation system according to claim 8, wherein, The correlation of wind power output in each region in time sequence comprises: temporal correlation and spatial correlation. The temporal correlation is determined by an autocorrelation function, and the calculation formula is as follows: where P t is the wind power output at time t, k is the number of time intervals, is the average value of wind power output, is the wind power autocorrelation coefficient with a time delay of k, n is the length of the time series used for calculation, P t+k is the wind power output value delayed by k time steps backward with respect to time t; The spatial correlation is represented based on a Spearman correlation coefficient, and the calculation formula of the Spearman correlation coefficient is as follows: where ρ X,Y is the Spearman correlation coefficient, R(P xi ) and R(P yi ) are the ranks of the samples P xi , P yi correspondingly, and are the average ranks of the sequences P X , P Y respectively, and ρ X,Y > 0 indicates a positive correlation.
11. The multi-zone wind power output sequence scenario generation system according to claim 9, wherein, The spatio-temporal attention mechanism CGAN network is trained and tested based on the training set and the test set. When the spatio-temporal attention mechanism CGAN network is trained, a spatio-temporal attention module is added to the spatio-temporal attention mechanism CGAN network. The spatio-temporal attention module comprises a spatial attention layer and a temporal attention layer.
12. The multi-zone wind power output sequence scenario generation system according to claim 11, wherein, The spatial attention layer adopts a spatial attention mechanism to describe spatial characteristics between fan outputs at different positions, and an expression of the spatial attention mechanism is as follows: wherein, is the input of the rth spatio-temporal module, N is the number of nodes, C r-1 is the number of input data channels of the rth layer, T r-1 is the length of the time dimension of the rth layer, V s ,b s ∈R N×N , is the network parameter available for learning, δ is the activation function, S i,j represents the correlation between spatial nodes i and j, S′ i,j is the normalized correlation.
13. The multi-zone wind power output sequence scenario generation system according to claim 11, wherein, The time attention module of the time attention layer dynamically captures time correlation between wind power outputs, and an expression of the time attention module is as follows: wherein, U1∈R N , are parameters for learning, E i,j denotes the correlation between time nodes i and j, E′ i,j is the normalized correlation strength.
14. The multi-zone wind power output sequence scenario generation system of claim 8, wherein, The scene generation unit is further configured to: Based on the spatial correlation index, the time correlation index and the effectiveness index, the generated wind power output sequence scene in the multiple regions is evaluated. The spatial correlation index includes a goodness-of-fit index and a correlation index. The effectiveness index includes a coverage rate index, a power interval average width index and a Pinball loss index.
15. A computer device, comprising: The method comprises: One or more processors; The processor is configured to execute one or more programs; When the one or more programs are executed by the one or more processors, the method as claimed in any one of claims 1-7 is implemented.
16. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable medium, and when the computer program is executed, the method as claimed in any one of claims 1-7 is implemented.