Scene generation method, system and equipment based on time sequence change characteristics and medium
By improving the strategy through spatiotemporal feature extraction and conditional generative adversarial networks, high-quality distributed photovoltaic power output scenarios are generated, which solves the uncertainty and volatility problems of distributed photovoltaic clusters, enhances the control capability of the distribution network, and ensures the stability and economy of the power system.
Patent Information
- Application Number
- CN202510744525.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-11-04
AI Technical Summary
In existing research, distributed photovoltaic clusters exhibit strong uncertainty and volatility. The training of existing generative adversarial network models is unstable, making it difficult to provide effective scenario support for day-ahead scheduling strategies, which increases the difficulty of distribution network regulation.
A scene generation method based on time-series variation characteristics is adopted. Through spatiotemporal feature extraction mechanism and dual discriminator model, combined with conditional generative adversarial network improvement strategy, the discriminator loss function is optimized to generate high-quality load and distributed photovoltaic power output scenes.
This improves the stability of model training and the accuracy of generated scenarios, enhances the economy and effectiveness of day-ahead optimized scheduling strategies, and ensures the safe and stable operation of the power system.
Smart Images

Figure CN120894175A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power load and new energy scene generation, and particularly relates to a scene generation method, system, device and medium based on time sequence change characteristics. BACKGROUND
[0002] The penetration rate of distributed photovoltaics in distribution networks increases year by year, and it plays an important role in the optimization and scheduling process of distribution networks. The access of large-scale distributed photovoltaic systems significantly changes the load characteristics of distribution networks, leading to intensified instantaneous fluctuations of loads and increased difficulty in regulating distribution networks. In addition, the output of distributed photovoltaic systems and the load characteristics are not matched in time and space, and the distribution network cannot effectively formulate a scheduling strategy for the output scene of the distributed photovoltaic cluster in the day-ahead, thereby reducing the economy and effectiveness of the day-ahead optimization and scheduling strategy in the execution process, and even causing the day-ahead optimization and scheduling strategy to be invalid, which threatens the safe and stable operation of the distribution network. Output scene generation is one of the main methods to solve this problem, which helps to identify potential risks in advance and ensure the stable operation of the power system by simulating and analyzing various time sequence scenes.
[0003] At present, existing researches mainly focus on scene generation methods based on centralized light load and generative adversarial networks. In the context of the increasing proportion of distributed photovoltaics, research on scene generation based on distributed photovoltaics is relatively less. Distributed photovoltaic clusters have stronger uncertainty and volatility than centralized photovoltaics, and their temporal and spatial correlation with loads is stronger, so it is necessary to design a precise and effective feature extraction module according to the characteristics of distributed photovoltaic clusters. The generative adversarial network model generally has the problems of unstable training and large deviation in generation quality, which makes it difficult to provide effective scene support for day-ahead scheduling strategy formulation, and it is necessary to design effective model improvement strategies according to task requirements. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a scene generation method, system, device and medium based on time sequence change characteristics to solve the problem of lack of interactive characteristics between new energy output scene and power load scene.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides a scene generation method based on time sequence change characteristics, comprising:
[0008] obtaining load data, distributed photovoltaic output data and conditional variables;
[0009] Through the spatio-temporal feature extraction mechanism, features of the load and the distributed photovoltaic cluster output in the time dimension and the space dimension are extracted;
[0010] The features extracted in the spatio-temporal feature extraction mechanism are input into the dual discriminator model, and through training iteration of the dual discriminator model, preliminary generated sample data is formed;
[0011] Based on the preliminary generated sample data, the loss function of the discriminator is optimized through the conditional generative adversarial network improvement strategy, and a load and distributed photovoltaic output scene is obtained.
[0012] As a preferred scheme of the scene generation method based on the time sequence change characteristic according to the application, wherein:
[0013] The spatio-temporal feature extraction mechanism comprises the following steps:
[0014] The weight matrix is defined to transform the input data;
[0015] The transformed data is combined in a specific manner using a concatenation function to form feature representation;
[0016] After the weight transformation and concatenation, the self-attention mechanism is used to identify the key features and patterns in the data;
[0017] After processing by the self-attention mechanism, an activation function is applied to further convert and enhance the feature representation;
[0018] Through time multi-head attention and space multi-head attention, features in the time dimension and the space dimension are extracted respectively.
[0019] The beneficial effects of the preferred technical scheme are that the features obtained by the spatio-temporal feature extraction mechanism are input into the generation model and the dual discriminator model, and the load data and the distributed photovoltaic output data are processed using the respective optimized structures, so that the model can generate preliminary sample data that conforms to the actual characteristics, and the accuracy and reliability of the discrimination ability between real and generated samples are effectively improved.
[0020] As a preferred scheme of the scene generation method based on the time sequence change characteristic according to the application, wherein:
[0021] The features extracted in the spatio-temporal feature extraction mechanism are input into the dual discriminator model, and through training iteration of the dual discriminator model, preliminary generated sample data is formed, comprising the following steps:
[0022] The features in the time and space dimensions extracted by the spatio-temporal feature extraction mechanism are input;
[0023] The generation model generates preliminary sample data based on the conditional variable;
[0024] The generated sample is input into the first discriminator and the second discriminator, and the generation of the sample includes load data and distributed photovoltaic output data;
[0025] The first discriminator adopts a spatio-temporal multi-head attention mechanism to process the distributed photovoltaic data, and evaluates the authenticity of the photovoltaic data through a specific combination of convolution and activation layers.
[0026] The second discriminator is optimized for load data, and uses a spatio-temporal attention mechanism and a specific intermediate layer setting to identify the authenticity of the load data and the generated sample.
[0027] As a preferred scheme of the scene generation method based on the time sequence change characteristic, wherein:
[0028] The conditional generative adversarial network improvement strategy comprises the following steps:
[0029] The distribution difference between the preliminary sample data and the real sample data is compared through the distance metric function;
[0030] The gradient penalty is introduced into the loss function of the discriminator to obtain the discriminator loss function after the gradient penalty is introduced;
[0031] Based on the discriminator loss function after the gradient penalty is introduced, an improved distance metric function is obtained;
[0032] The optimization objective function of the entire model is updated in combination with the objectives of the generator and the discriminator;
[0033] After multiple iterations of training, the load and distributed photovoltaic output scene similar to the real sample is generated.
[0034] The beneficial effects of the preferred technical scheme are that by introducing the distance metric function and the gradient penalty, the loss function of the discriminator is improved, so that the generative adversarial network can be more stably trained and generate a load and distributed photovoltaic output scene highly similar to the real sample, thereby improving the accuracy and practicality of the model.
[0035] As a preferred scheme of the scene generation method based on the time sequence change characteristic, wherein:
[0036] The discriminator loss function L D is expressed as:
[0037]
[0038] wherein z represents the generated data distribution P zwhere z represents the extracted noise vector, G(z) represents the generated fake sample generated by the generator G using the noise z, D(G(z)) represents the output of the discriminator D on the generated sample G(z), x represents the extracted real sample from the real data distribution P x where x represents the extracted real sample from the real data distribution P where x represents the extracted real sample from the real data distribution P
[0039] As a preferred scheme of the scene generation method based on the time sequence change characteristic according to the present application, in the method:
[0040] The improved distance measurement function is represented as:
[0041]
[0042] where K represents a constant of the Wasserstein distance function; ‖f‖ L ≤K represents that the discriminant network function satisfies the Lipschitz continuity condition with a constant K.
[0043] As a preferred scheme of the scene generation method based on the time sequence change characteristic according to the present application, in the method:
[0044] The optimization objective function for updating the entire model is represented as:
[0045]
[0046] where, represents the gradient of the discriminator D on the interpolation sample .
[0047] In a second aspect, the present application provides a scene generation system based on the time sequence change characteristic, comprising:
[0048] Obtaining load data, distributed photovoltaic output data and conditional variables;
[0049] The feature extraction module is configured to extract the features of the load and the distributed photovoltaic cluster output in the time dimension and the space dimension through the spatio-temporal feature extraction mechanism.
[0050] The model training module is configured to input the features extracted in the spatio-temporal feature extraction mechanism into the double-discriminator model, and form the preliminary generated sample data through the training iteration of the double-discriminator model.
[0051] The loss function optimization module is configured to optimize the loss function of the discriminator based on the preliminary generated sample data through the conditional generative adversarial network improvement strategy, and obtain the load and distributed photovoltaic output scene.
[0052] In a third aspect, the present application provides an electronic device, comprising:
[0053] a memory for storing a program;
[0054] a processor for executing the computer executable instructions, which, when executed by the processor, implement the steps of the scenario generation based on the time series change characteristics.
[0055] In a fourth aspect, the present application provides a computer readable storage medium, comprising: the program, which, when executed by the processor, implements the steps of the scenario generation based on the time series change characteristics.
[0056] The present application has the following beneficial effects: the present application designs a space-time feature extraction mechanism, mines the correlation of load and distributed photovoltaic cluster output in time dimension and space dimension, proposes an improved strategy of conditional generative adversarial network, effectively improves the stability and performance of model training, designs a conditional generative adversarial network architecture with double discriminators, further improves the stability of the model, and enhances the ability of the model to generate high-quality scenarios. Finally, the load-distributed photovoltaic cluster output scenario is generated by training the model. The present application fully considers the features of load and distributed photovoltaic cluster output in time dimension and space dimension, and compared with other benchmark models, the proposed model has obviously higher scenario generation accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. Among them:
[0058] Figure 1 A basic flow diagram of scenario generation based on time series change characteristics is provided for an embodiment of the present application;
[0059] Figure 2 A space-time multi-head attention structure diagram of scenario generation based on time series change characteristics is provided for an embodiment of the present application;
[0060] Figure 3 A TS-WCGAN-GP generation model structure diagram of scenario generation based on time series change characteristics is provided for an embodiment of the present application;
[0061] Figure 4 A TS-WCGAN-GP discriminant model structure diagram of scenario generation based on time series change characteristics is provided for an embodiment of the present application;
[0062] Figure 5 An ACF plot of load data generated by each model region 1 and region 2 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0063] Figure 6 An ACF plot of load data generated by each model region 3 and region 4 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0064] Figure 7 An ACF plot of load data generated by each model region 5 and region 6 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0065] Figure 8 An ACF plot of load data generated by each model region 7 and region 8 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0066] Figure 9 An ACF plot of load data generated by each model region 9 and region 10 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0067] Figure 10 An ACF plot of load data generated by each model region 11 and region 12 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0068] Figure 11 An ACF plot of load data generated by each model region 13 and region 14 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0069] Figure 12 An ACF plot of load data generated by each model region 15 and region 16 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0070] Figure 13 An ACF plot of load data generated by each model region 17 and region 18 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0071] Figure 14 An ACF plot of load data generated by each model region 19 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0072] Figure 15 An ACF plot of distributed photovoltaic cluster data generated by each model region 1 and region 2 of a scenario generation based on timing change characteristics is provided for an embodiment of the present application;
[0073] Figure 16A scene generation model based on time sequence change characteristics for generating an ACF graph of distributed photovoltaic cluster data of each model region 3 and region 4 is provided for an embodiment of the present application.
[0074] Figure 17 A real scene data correlation analysis heat map of scene generation based on time sequence change characteristics is provided for an embodiment of the present application.
[0075] Figure 18 A TS-WCGAN-GP model of scene generation based on time sequence change characteristics generates a scene data correlation analysis heat map for an embodiment of the present application.
[0076] Figure 19 A WCGAN-GP model of scene generation based on time sequence change characteristics generates a scene data correlation analysis heat map for an embodiment of the present application.
[0077] Figure 20 A WCGAN model of scene generation based on time sequence change characteristics generates a scene data correlation analysis heat map for an embodiment of the present application.
[0078] Figure 21 A fluctuation value probability distribution graph of a real scene of scene generation based on time sequence change characteristics is provided for an embodiment of the present application.
[0079] Figure 22 A TS-WCGAN-GP generates a fluctuation value probability distribution graph of a joint scene of scene generation based on time sequence change characteristics for an embodiment of the present application.
[0080] Figure 23 A WCGAN-GP generates a fluctuation value probability distribution graph of a joint scene of scene generation based on time sequence change characteristics for an embodiment of the present application.
[0081] Figure 24 A WCGAN generates a fluctuation value probability distribution graph of a joint scene of scene generation based on time sequence change characteristics for an embodiment of the present application. DETAILED DESCRIPTION
[0082] In order to make the above objectives, features and advantages of the present application more apparent, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the protection scope of the present application.
[0083] Embodiment 1
[0084] Referring to Figure 1 For an embodiment of the present application, a scene generation method based on time sequence change characteristics is provided, comprising:
[0085] S100: obtaining load data, distributed photovoltaic output data and conditional variables;
[0086] S200: extracting the features of the load and distributed photovoltaic cluster output in the time dimension and the space dimension through a space-time feature extraction mechanism;
[0087] S300: inputting the features extracted in the space-time feature extraction mechanism into a double discriminator model, and forming preliminary generated sample data through training iteration of the double discriminator model;
[0088] S400: based on the preliminary generated sample data, optimizing the loss function of the discriminator through a conditional generative adversarial network improvement strategy, and obtaining the load and distributed photovoltaic output scene.
[0089] It should be noted that the penetration rate of distributed photovoltaic in the power distribution network has been significantly improved, but its space-time distribution does not match the power load, resulting in increased difficulty in power grid regulation. Past research on the generation method of a single time sequence scene in the power system does not consider the interaction characteristics between the source and the load, so the generated time sequence scene only has single time sequence time distribution characteristics; therefore, it is very important to provide high-quality output scenes.
[0090] Therefore, in view of the above-mentioned problem that there is a lack of interaction characteristics between the new energy output scene and the power load scene, through the steps of S100-S400, through the design of the space-time self-attention mechanism for accurate feature extraction, and through the conditional generative adversarial network improvement strategy, the above challenges are effectively solved, and high-quality, actual characteristic-compliant load and distributed photovoltaic output scenes can be generated, thereby significantly improving the economy and effectiveness of the day-ahead optimization scheduling strategy, and ensuring the safe and stable operation of the power system. This provides key technical support and solutions for coping with the new challenges brought by distributed photovoltaic clusters.
[0091] Embodiment 2, referring to Figures 2-4 For an embodiment of the present application, a scene generation method based on time sequence change characteristics is provided, comprising:
[0092] In the embodiment of the present application, the space-time feature extraction mechanism in step S200 includes the following steps:
[0093] Defining the input data of the generation network, including the conditional variables and the random noise sequence;
[0094] Defining the input data of the adversarial network, including the conditional variables, the generated sample data and the real sample data;
[0095] Based on the defined input data, a query object, a key-value object and a value object are constructed;
[0096] Multi-head attention is calculated, and a final feature representation is generated through a self-attention function and a concatenation operation;
[0097] Based on the final feature representation, the hidden feature quantity and the feature value of the query object, the key-value object and the value object are adjusted to extract features in the time dimension and the space dimension, respectively.
[0098] In the embodiment of the present application, the feature extraction process based on the space-time feature extraction mechanism includes the space-time feature extraction mechanism and the generative adversarial network (GAN). The space-time feature extraction mechanism is used to extract features in the time dimension and the space dimension from the load and the distributed photovoltaic cluster output data, and the generative adversarial network (GAN) includes a generator G and a discriminator D. The generator generates sample data according to the input conditional variable c and random noise z, and the discriminator evaluates the authenticity of the generated sample.
[0099] In the embodiment of the present application, the input data of the generator G is the conditional variable c and the randomly sampled random noise sequence z, wherein the conditional variable c is the load and the distributed photovoltaic cluster output prediction error distribution information and the prediction data; the input data of the discriminator D is the conditional variable c, the generated sample data D(G(z|c)) and the real sample data x.
[0100] In the embodiment of the present application, as shown in Figure 2 In the space-time feature extraction mechanism, h is a set of attention heads, which can be represented by {h1, h2,..., h n V1, V2,..., V n are value objects of each attention head, and their set constitutes an input value object K1, K2,..., K n are key-value objects of each attention head, and their set constitutes an input key-value object Q1, Q2,..., Q n are query objects of each attention head, and their set constitutes an input query object The calculation process of the multi-head attention layer is as follows:
[0101] O MHA (Q, K, V) = Concat(h1, h2,..., h n )W o
[0102] h i = Attention(Q i ,K i ,Vi
[0103]
[0104] where W o , W Q , W K and W V are the weight matrices of each layer; Concat(·) is the concatenation function; Attention(·) is the self-attention solving function; and softmax(·) is the activation function. The difference between the time multi-head attention and the spatial attention network lies in the quantity and value of the input {Q, K, V} hidden features. The quantity of the input hidden features of the time attention network is the data of the spatial dimension of the load and the distributed photovoltaic cluster output, and the value of the input hidden features is the data of the time dimension of the load and the distributed photovoltaic cluster output.
[0105] In the embodiment of the present application, the features extracted in the space-time feature extraction mechanism are input into the dual discriminator model in step S300, and through the training iteration of the dual discriminator model, the preliminary generated sample data is formed, including the following steps:
[0106] The features extracted by the space-time feature extraction mechanism in the time and space dimensions are taken as inputs;
[0107] The generated model generates preliminary sample data based on the conditional variables;
[0108] The generated sample is input into the first discriminator and the second discriminator, and the generated sample includes load data and distributed photovoltaic output data;
[0109] The first discriminator adopts the space-time multi-head attention mechanism to process the distributed photovoltaic data, and through a specific combination of convolution and activation layers, the authenticity of the photovoltaic data is evaluated;
[0110] The second discriminator optimizes the load data by using the space-time attention mechanism and a specific intermediate layer setting to identify the authenticity of the load data and the generated sample.
[0111] In the embodiment of the present application, the dual discriminator model in step S300 refers to using two different discriminators in the generative adversarial network (GAN) framework: the first discriminator is specifically used to process the distributed photovoltaic data, and the second discriminator is specifically used to process the load data. This design can more accurately capture the characteristics of different types of data, thereby improving the performance of the overall model.
[0112] In the embodiment of the present application, as Figure 3 As shown, the generator G includes three network layer structures, namely a feature layer, an intermediate layer and an output layer. The feature layer structure is composed of a time multi-head attention network and a space multi-head attention network; the intermediate layer is stacked by a 2-dimensional convolution Conv2D, a 2-dimensional deconvolution network ConvTranspose2D, BN and ReLU6, and the number of stacked layers is 4; and the output layer is composed of an average pooling layer AvgPool2d, a linear layer Linear, BN and a Sigmoid activation function. Figure 4 As shown, the discriminator D includes three network layer structures, namely a feature layer, an intermediate layer and an output layer. The feature layer is composed of a time multi-head attention network and a space multi-head attention network; the intermediate layer is stacked by a 2-dimensional convolution Conv2D, a batch normalization (Batch Normolization, BN) and an activation function ReLU6, and the number of stacked layers is 4; and the output layer is composed of a linear layer Linear, BN and a Sigmoid activation function.
[0113] In the embodiment of the present application, the conditional generative adversarial network improves the strategy in step S400, including the following steps:
[0114] By the distance metric function, the distribution difference between the preliminary sample data and the real sample data is compared;
[0115] The gradient penalty is introduced into the loss function of the discriminator, to obtain the discriminator loss function after introducing the gradient penalty;
[0116] Based on the discriminator loss function after introducing the gradient penalty, an improved distance metric function is obtained;
[0117] Combining the objectives of the generator and the discriminator, the optimization objective function of the entire model is updated;
[0118] After multiple iterations of training, the load and the distributed photovoltaic output scene similar to the real sample are generated.
[0119] In an optional implementation, the distance metric function in step S400 can also be the KL divergence. In the output layer of the discriminator, the KL divergence between the generated sample distribution and the real sample distribution is calculated, and is taken as part of the loss function of the generator;
[0120] In an optional implementation, the distance metric function in step S400 can also be the JS divergence. In the discriminator, the JS divergence between the generated sample distribution and the real sample distribution is calculated to evaluate the difference between the two;
[0121] It should be noted that the Wasserstein distance used by the present application provides more stable gradient information in the training process compared to the KL divergence and the JS divergence, especially when the generated distribution does not overlap with the real distribution. This enables the model to maintain good performance under a wider range of conditions without causing mode collapse as with the KL divergence, or gradient vanishing as with the JS divergence.
[0122] In an optional embodiment, the conditional generative adversarial network improvement strategy in step S400 can also be a feature matching-based improvement strategy, which calculates the difference in feature statistics between the generated sample and the real sample in the intermediate layer of the discriminator, and uses it as part of the generator loss function to minimize the feature difference between the two, thereby optimizing the generation effect of the entire model.
[0123] In an optional embodiment, the conditional generative adversarial network improvement strategy in step S400 can also be a spectrum normalization-based improvement strategy, which applies a spectrum normalization technique to the weight matrix of each layer of the discriminator to limit its maximum singular value to ensure Lipschitz continuity, and adjusts the loss function and optimization target accordingly to improve the quality of the generated sample and the stability of the model.
[0124] It should be noted that the introduction of the gradient penalty (GP) term in our application not only effectively solves the training instability problem caused by weight clipping, but also enhances the robustness of the model. Compared with the feature matching or spectrum normalization method, the gradient penalty can provide a smoother loss surface, thereby avoiding the mode collapse phenomenon and enabling the model to perform well when facing complex high-dimensional data.
[0125] In the embodiments of the present application, the Wasserstein distance and gradient penalty (GP) are introduced to improve the traditional conditional generative adversarial network (CGAN), thereby solving the balance problem between the generator and the discriminator in the training process and improving the stability of the model and the quality of the generated sample. The following is a detailed analysis:
[0126] In the embodiments of the present application, the Wasserstein distance is used as the measurement standard. The Wasserstein distance, also known as the Earth Mover's Wasserstein distance (EMD), is a distance measurement used to compare the differences between two probability distributions in measurement theory. It is derived from the Optimal Transport Problem and is used to measure the minimum "cost" required to convert one probability distribution into another. Suppose there are two probability distributions P and Q defined on a metric space, that is, they are two probability measures. Consider how to convert the distribution P into the distribution Q, and the commonly used formula is as follows.
[0127] W1(P,Q)=inf γ∈Π(P,Q) ∫ x×X d(x,y)dγ(x,y)
[0128] where d(x,y) is the point x and y in the space, Π(P,Q) represents the set of all joint distributions with P and Q as marginal distributions, and γ(x,y) represents the movement from x in distribution P to y in Q.
[0129] In the embodiments of the present application, in order to meet the Lipschitz continuity condition, the discriminant network needs to be constrained during training. The Lipschitz continuity of the function f w indicates that there is a constant K≥0 under the condition of applying a limit, and for two points x1 and x2 in the domain of the function, the following relationship is satisfied:
[0130] ∣f w (x1)-f w (x2)∣≤K∣x1-x2∣
[0131] In the embodiments of the present application, when the function satisfies the K-Lipschitz continuity condition, for the function f w , the local variation amplitude of the function can be limited. In order to strengthen the Lipschitz continuity condition, all parameters W can be limited to a certain range [-c,c] by using weight clipping. If the weight of the discriminant network exceeds the range during training, it is adjusted, and at this time the derivative with respect to the input sample x will also not exceed a certain range. Therefore, there is an unknown constant K that limits the local variation amplitude of f w to a certain range.
[0132] In the embodiments of the present application, considering that WGAN adopts the strategy of weight clipping, the weights of the network will concentrate at the two clipping boundaries during the training process, which will cause the network to train too slowly or fail to converge, for example, the problems of gradient explosion or gradient disappearance may occur if the clipping boundary is set too large or too small. Therefore, the strategy of weight clipping may cause difficulty in model optimization, so that the CGAN model still has the problem of unstable training during the training process. Based on the optimal transport theory, when the model is trained to the optimum, the discriminative network G has a unit gradient norm between the sampling points of the generated distribution P G and the data distribution p x . Therefore, according to the output and input of the discriminative network, a gradient penalty term can be added, which is specifically represented as:
[0133]
[0134] In the formula, is the random sampling of the real sample x and the generated sample z on the connecting line.
[0135] In the embodiments of the present application, since it is difficult to impose gradient norm constraints on all levels, the above-mentioned way is an effective strategy for improving model training. After adding the gradient term GP, the loss function L D is re-expressed as:
[0136]
[0137] In the embodiments of the present application, after the gradient penalty term GP is used to strengthen the Lipschitz constraint, the loss function of the discriminative network satisfies the Lipschitz continuity, and the distance metric function of the improved WCGAN-GP is represented as:
[0138]
[0139] In the formula, K represents a constant of the Wasserstein distance function; ‖f‖ L ≤K represents that the discriminative network function satisfies the Lipschitz continuity condition with a constant K. The optimization objective function of the finally improved WCGAN-GP is represented as:
[0140]
[0141] In the embodiments of the present application, related evaluation indexes are further included for the generated scene set from the aspects of volatility, time correlation, spatial correlation and effectiveness, to verify the similarity between the generated distributed photovoltaic cluster output scene of load and the actual real data characteristics, specifically including:
[0142] (1) Volatility characteristic index
[0143] The ramp rate is used to evaluate the short-time fluctuation of the distributed PV cluster output, and is defined as:
[0144]
[0145] where P(t+Δt) and P(t) are the real and predicted values of the load at t+Δt and t, respectively; P max is the maximum value of the distributed PV cluster output or the installed capacity value.
[0146] (2) Time correlation index
[0147] Since the load distributed PV cluster output data is a continuous flow process, in the time dimension, there is a certain correlation between the output of the load distributed PV cluster output at each time. In view of the distribution characteristics of the load distributed PV cluster output sequence in the time dimension, the autocorrelation coefficient (ACF) is used to reflect the correlation of the load distributed PV cluster output in time, and the specific formula is:
[0148]
[0149] where R ACF is the autocorrelation coefficient (ACF); k represents the number of time intervals; P(t) and P(t+k) represent the source load values at t and t+k, respectively; is the daily average of the load distributed PV cluster output. The value of R ACF ranges from -1 to 1, and the closer the value is to 1, the higher the positive correlation of the source load output in time, and the closer the value is to -1, the higher the negative correlation, and when it is 0, it means no correlation.
[0150] (3) Spatial correlation index
[0151] The Pearson correlation coefficient is used to measure the degree of spatial correlation between the load distributed PV cluster output data in different regions. The specific formula is:
[0152]
[0153] where R ρXY is the Pearson correlation coefficient; and are the mean values of the load distributed PV cluster output sequences X and Y, respectively.
[0154] (4) t-distribution index
[0155] The t-distribution is used to describe the probability density of the short-time fluctuation value of the load distributed PV cluster output data, and the definition of the t-distribution is:
[0156]
[0157] where Γ(·) is the gamma function; v is the degree of freedom; x is the mean of the sample; s is the standard deviation of the sample; μ is the mean of the overall sample; and n is the number of samples. The t-distribution approximates the normal distribution, but compared with the standard normal distribution curve, the t-distribution curve has a slightly bottomed top and slightly high and flat two tails. The t-distribution curve is affected by the degree of freedom, and the smaller the degree of freedom, the greater the degree of dispersion.
[0158] (5) Effectiveness index
[0159] The effectiveness refers to the accuracy degree of generating the scene description load distributed photovoltaic cluster output random uncertainty characteristics. In this chapter, the coverage rate (CoverRate) and the power interval average width (Power Interval Average Width) two indexes are proposed for the load distributed photovoltaic cluster output joint generation scene effectiveness evaluation. The calculation formula of the coverage rate and the calculation formula of the power interval average width are expressed as:
[0160]
[0161] where T' is the number of times when the load distributed photovoltaic cluster output prediction value is surrounded in the scene set, T is the number of times of the generated load distributed photovoltaic cluster output prediction scene set; C is the coverage rate, and the greater the value, the more reliable the generated load distributed photovoltaic cluster output prediction scene set; P t up is the upper limit of the load distributed photovoltaic cluster output prediction scene set at t time; is the lower limit of the load distributed photovoltaic cluster output prediction scene set at t time; and W is the power interval average width of the load distributed photovoltaic cluster prediction output, and the smaller the value, the closer the generated load distributed photovoltaic cluster output prediction scene to the actual value.
[0162] Embodiment 3, refer to Figures 5-24 and Tables 1-5, an embodiment of the present application provides a scene generation method based on the time sequence change characteristics, in order to verify the beneficial effects of the present application, scientific demonstration is carried out through experiments.
[0163] This embodiment is simulated and optimized based on the pycharm platform in the WIN11 system, i5 CPU, 2.20 GHz processor environment, and the specific solution flowchart is as shown in Figure 1 .
[0164] In this embodiment, in order to verify the effectiveness of the TS-WCGAN-GP double discriminator model in jointly generating load-distributed photovoltaic cluster output scenes, the historical data and prediction data of 19 regional loads and the historical data and prediction data of 4 regional distributed photovoltaic cluster outputs in a certain province of China are selected for simulation experiments. The sampling frequency of the data is 15 min / time, and the time span of the data is from January 1, 2020 to January 1, 2022. 80% of the historical data is selected as the training set, and 20% of the historical data is selected as the verification set. The prediction data of 19 regional loads and the prediction data of 4 regional distributed photovoltaic cluster outputs are used as the test set. In order to verify the superiority of the TS-WCGAN-GP double discriminator model in jointly generating load-distributed photovoltaic cluster output scenes, comparative experiments based on WCGAN and WCGAN-GP models are designed, and the specific parameters of the algorithms are shown in Table 1.
[0165] Table 1: Model parameters
[0166]
[0167]
[0168] In order to more intuitively analyze the time correlation of the WGCAN, WCGAN-GP and TS-WCGAN models in generating load and distributed photovoltaic cluster output scenes, the time correlation index ACF is used to analyze the correlation of the generated scenes, and the ACF analysis graphs of the load and distributed photovoltaic cluster output scene data are shown in Figs. 6 and 7, respectively. Figures 5-14 Figures 15-16 According to the ACF analysis graphs of the load and distributed photovoltaic cluster output scene data, it can be seen that the TS-WCGAN model has better time correlation than the WCGAN and WCGAN-GP models in generating load and distributed photovoltaic cluster output scenes. Figures 5-16 The results show that the load and distributed photovoltaic cluster output data generated by the TS-WCGAN-GP model have similar trends with the real data in each region in terms of the autocorrelation coefficient at a lag time of 96. Although there are slight differences in individual regions, the overall performance is better than that of the WCGAN and WCGAN-GP models. This is mainly due to the TS module's ability to accurately mine the temporal correlation of load and distributed photovoltaic data and map it to the generated scenario. The data generated by the WCGAN model without using the GP term shows fluctuations in the ACF graph, because the model without using the GP term may cut the network parameters during the training process, reducing the model's fitting ability for temporal correlation, resulting in unstable model. By calculating the RMSE values of the ACF of the scenario data generated by the three models and the ACF of the real data, the performance differences of the three models can be clearly compared. The RMSE between the ACF of the load and distributed photovoltaic cluster output scenario data generated by the TS-WCGAN-GP model and the ACF of the real data is 0.0222 and 0.0076, respectively, and the RMSE of the WCGAN-GP model is 0.0518 and 0.0109, respectively, and the RMSE of the WCGAN model is 0.0646 and 0.0128, respectively. The TS-WCGAN-GP model has the best RMSE performance, which is closer to the real data.
[0169] To analyze the correlation of the jointly generated load and distributed photovoltaic cluster output scenario in independent space and joint space, the Pearson correlation coefficient is used to evaluate the independent and joint space distribution characteristics of the generated scenario. The Pearson correlation coefficients of the real scenario data and the scenario data generated by the three models are given in Figures 17-20
[0170] Figures 17-20 The results show that the load and distributed photovoltaic cluster output data generated by the TS-WCGAN-GP model have similar trends with the real data in each region in terms of the autocorrelation coefficient at a lag time of 96. Although there are slight differences in individual regions, the overall performance is better than that of the WCGAN and WCGAN-GP models. This is mainly due to the TS module's ability to accurately mine the temporal correlation of load and distributed photovoltaic data and map it to the generated scenario. The data generated by the WCGAN model without using the GP term shows fluctuations in the ACF graph, because the model without using the GP term may cut the network parameters during the training process, reducing the model's fitting ability for temporal correlation, resulting in unstable model. By calculating the RMSE values of the ACF of the scenario data generated by the three models and the ACF of the real data, the performance differences of the three models can be clearly compared. The RMSE between the ACF of the load and distributed photovoltaic cluster output scenario data generated by the TS-WCGAN-GP model and the ACF of the real data is 0.0222 and 0.0076, respectively, and the RMSE of the WCGAN-GP model is 0.0518 and 0.0109, respectively, and the RMSE of the WCGAN model is 0.0646 and 0.0128, respectively. The TS-WCGAN-GP model has the best RMSE performance, which is closer to the real data.
[0171] The load and distributed photovoltaic cluster output data have specific fluctuation characteristics, which reflect the real running state of the load and distributed photovoltaic cluster output in the environment. If the fluctuation characteristics of the generated model generated scene and the fluctuation characteristics of the real scene have a large difference, the generated model is not available. Therefore, the t distribution is used to evaluate the fluctuation characteristics of the three kinds of model generated scenes, and the probability distribution graphs of the fluctuation values of the real scene data and the three kinds of model generated scene data are given in Figures 21-24
[0172] Figures 21-24 The probability density of the historical scene data and the three kinds of model generated scene data is approximately t distribution, and the t distribution parameters of the load and distributed photovoltaic cluster output fluctuation values are shown in Tables 2 and 3.
[0173] Table 2 t distribution parameters of load fluctuation values
[0174]
[0175] Table 3 t distribution parameters of distributed photovoltaic cluster output fluctuation values
[0176]
[0177] In the t distribution, the degree of freedom reflects the concentration of the load and distributed photovoltaic cluster output fluctuation values at the mean value, the mean value reflects the concentration position information of the load and distributed photovoltaic cluster output fluctuation values, and the standard deviation reflects the dispersion degree of the load and distributed photovoltaic cluster output fluctuation values. According to the data analysis results in Tables 2 and 3, it can be found that the t distribution parameters of the load fluctuation values and the distributed photovoltaic cluster output fluctuation values generated by the TS-WCGAN-GP model are closest to the parameters of the real data, which indicates that the TS-WCGAN-GP model has better accuracy and stability in generating load and distributed photovoltaic cluster output scenes.
[0178] The effectiveness index proposed in this study verifies the effectiveness of the three kinds of models in approximating the real predicted scene. The effectiveness indexes of the three kinds of models in generating load and distributed photovoltaic cluster output scenes are shown in Tables 4 and 5 respectively through comparative experiments.
[0179] Table 4 effectiveness indexes of various models in generating load in each region
[0180]
[0181] Table 5 effectiveness indexes of various models in generating distributed photovoltaic cluster output
[0182]
[0183] It can be seen from Tables 4 and 5 that the load and distributed photovoltaic cluster output prediction scenarios generated by the TS-WCGAN-GP model are superior to the WCGAN-GP model and the WCGAN model in terms of the coverage index C and the power interval average width index W at the confidence levels of 99%, 95% and 90%. Taking the confidence level of 99% as an example, the average values of the coverage index C of the load and distributed photovoltaic cluster output prediction scenarios generated by the TS-WCGAN-GP model are 92.6% and 96.9% respectively, which are superior to 83.8%, 93.3% of the WCGAN-GP model and 68.8%, 88.3% of the WCGAN model; the average values of the power interval average width index W of the load and distributed photovoltaic cluster output prediction scenarios generated by the TS-WCGAN-GP model are 29.1 MW and 97.7 MW respectively, which are superior to 32.4 MW, 115.9 MW of the WCGAN-GP model and 35.9 MW, 106.3 MW of the WCGAN model; indicating that the TS-WCGAN-GP model can more truly and reliably generate load and distributed photovoltaic cluster output prediction scenarios.
[0184] In Example 4, which is an embodiment of the present application, different from the first embodiment, a scene generation system based on time sequence change characteristics is provided.
[0185] It should be noted that the technical scheme of the scene generation system based on time sequence change characteristics is the same as the technical scheme of the scene generation method based on time sequence change characteristics described above, and the details of the technical scheme of the scene generation system based on time sequence change characteristics in the present embodiment can be seen from the description of the technical scheme of the scene generation method based on time sequence change characteristics.
[0186] The scene generation system based on time sequence change characteristics in the present embodiment comprises:
[0187] Load data, distributed photovoltaic output data and conditional variables are obtained.
[0188] The feature extraction module is configured to extract the features of the load and distributed photovoltaic cluster output in the time dimension and the space dimension through a space-time feature extraction mechanism.
[0189] The model training module is configured to input the features extracted in the space-time feature extraction mechanism into a double discriminator model, and form preliminary generated sample data through training iteration of the double discriminator model.
[0190] The loss function optimization module is configured to optimize the loss function of the discriminator based on the preliminary generated sample data by introducing a distance measurement function and adding a gradient penalty, and obtain the load and distributed photovoltaic output scene.
[0191] The embodiment also provides an electronic device suitable for the case of the scene generation method based on the time sequence change characteristic, comprising:
[0192] The memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions to realize the scene generation method based on the time sequence change characteristic.
[0193] The embodiment also provides a storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to realize the scene generation method based on the time sequence change characteristic.
[0194] The storage medium provided by the embodiment belongs to the same inventive concept as the scene generation method based on the time sequence change characteristic, and the technical details not described in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
[0195] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by software and necessary general hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH memory, a hard disk or an optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods of various embodiments of the present application.
[0196] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application, and although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the present application, and all should be covered in the scope of the claims of the present application.
Claims
1. A method for generating a scene based on timing change characteristics, characterized by, The method comprises the steps of: obtaining load data, distributed photovoltaic output data and condition variables; extracting the features of the load and the distributed photovoltaic cluster output in the time dimension and the space dimension through a space-time feature extraction mechanism; inputting the features extracted in the space-time feature extraction mechanism into a generative model and a double discriminator model, and forming preliminary generated sample data through training iterations of the generative model and the double discriminator model; optimizing the loss function of the discriminator based on the preliminary generated sample data through a conditional generative adversarial network improvement strategy, and obtaining a load and distributed photovoltaic output scenario.
2. The scene generation method based on timing change characteristics according to claim 1, characterized by: The space-time feature extraction mechanism comprises the following steps: defining the input data of the generative network, including condition variables and random noise sequences; defining the input data of the adversarial network, including condition variables, generated sample data and real sample data; based on the defined input data, constructing a query object, a key-value object and a value object; calculating multi-head attention, generating the final feature representation through a self-attention function and a concatenation operation; based on the final feature representation, adjusting the hidden feature quantity and the feature value of the query object, the key-value object and the value object to extract the features in the time dimension and the space dimension, respectively.
3. The scene generation method based on timing change characteristics according to claim 1 or 2, characterized by: The input of the space-time feature extraction mechanism in the generative model and the double discriminator model, and the preliminary generated sample data through the training iterations of the generative model and the double discriminator model, comprises the following steps: input the features extracted in the time and space dimensions by the space-time feature extraction mechanism; generating preliminary sample data based on the condition variables using the generative model; inputting the generated sample into the first discriminator and the second discriminator, and the generated sample comprising load data and distributed photovoltaic output data; the first discriminator adopts a space-time multi-head attention mechanism to process the distributed photovoltaic data, and evaluates the authenticity of the photovoltaic data through a specific combination of convolution and activation layers; the second discriminator optimizes the load data, and discriminates the authenticity of the load data from the generated sample by using a space-time attention mechanism and a specific intermediate layer setting.
4. The scene generation method based on timing change characteristics according to claim 3, characterized by: The conditional generative adversarial network improvement strategy comprises the following steps: comparing the distribution difference between the preliminary sample data and the real sample data through a distance metric function; introducing a gradient penalty into the loss function of the discriminator to obtain a discriminator loss function with a gradient penalty; based on the discriminator loss function with the gradient penalty, obtaining an improved distance metric function; updating the optimization objective function of the entire model in combination with the objectives of the generator and the discriminator; after multiple iterations of training, generating a load and distributed photovoltaic output scenario similar to the real sample.
5. The scene generation method based on timing change characteristics according to claim 4, characterized by: The introduced gradient-penalized discriminator loss function L D is represented as: where z denotes a noise vector drawn from a data distribution P z , G(z) denotes a fake sample generated by the generator G using the noise z, D(G(z)) denotes the output of the discriminator D on the generated sample G(z), x denotes a real sample drawn from a real data distribution P x , D(x) denotes the output of the discriminator D on the real sample x, denotes an interpolated sample selected between the real sample x and the generated sample G(z) by linear interpolation, and λ denotes a weight coefficient of the gradient penalty term.
6. The scene generation method based on timing change characteristics according to claim 5, characterized by: The improved distance metric function is expressed as: wherein K represents a constant of the Wasserstein distance function; ‖f‖ L ≤ K represents that the discriminative network function satisfies the Lipschitz continuity condition with a constant K.
7. The scene generation method based on timing change characteristics according to claim 6, characterized by: The updated optimization objective function of the entire model is expressed as: wherein, denotes the gradient of the discriminator D on the interpolated sample .
8. A scene generation system based on timing change characteristics, applying the method according to any one of claims 1 to 7, characterized in that, The method comprises the steps of: obtaining load data, distributed photovoltaic output data and condition variables; a feature extraction module for extracting the features of the load and the distributed photovoltaic cluster output in the time dimension and the space dimension through a space-time feature extraction mechanism; a model training module for inputting the features extracted in the space-time feature extraction mechanism into a double discriminator model, and forming preliminary generated sample data through training iterations of the double discriminator model; The loss function optimization module is configured to optimize the loss function of the discriminator based on the preliminary generated sample data and through a conditional generative adversarial network improvement strategy to obtain the load and distributed photovoltaic output scene.
9. An electronic device, comprising: The method comprises the following steps: a memory for storing a program; a processor for loading the program to execute the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a program, characterized in that, The program is executed by the processor to implement the steps of the method according to any one of claims 1-7.
