A distributed energy system closed-loop scenario generation method and system
By introducing an optimization scheduling cost feedback mechanism into the generative model and constructing a composite loss function and gradient penalty term, the problem of the separation between scenario generation and optimization scheduling in distributed energy systems is solved. The generated scenario set can more accurately reflect the impact of uncertain factors on costs, thereby improving the economic efficiency of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-03-05
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for generating distributed energy system scenarios are disconnected from the generation process and the application of optimization scheduling. This results in the generated scenario sets failing to accurately capture the key characteristics of uncertainties and making it difficult to guide optimization models to find the best scheduling strategy that is both economical and feasible.
A closed-loop scene generation method is adopted. By introducing an optimization scheduling cost feedback mechanism into the generation model, a composite loss function is constructed. Combining Wasserstein distance and gradient penalty terms, the generator is optimized to generate key uncertainty features that have a significant impact on the system's operating cost. A generation-optimization-feedback training framework is established to ensure that the generated scene set can serve the final optimization goal.
It significantly improves the economic efficiency of stochastic optimization scheduling of distributed energy systems. The generated scenario set can more accurately reveal the impact of uncertainty factors on scheduling costs, reduce the overall operating cost of the system, avoid overly conservative or aggressive scheduling strategies, and improve the economy and reliability of the system.
Smart Images

Figure CN121787031B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of multi-energy complementary distributed energy system, and particularly relates to a distributed energy system closed-loop scenario generation method and system. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.
[0003] With the increasing penetration of renewable energy, the optimal scheduling of distributed energy systems is facing unprecedented challenges. Wind and solar power outputs have strong intermittency, volatility and randomness, and their power outputs exhibit complex temporal and spatial distribution characteristics. At the same time, user-side load demand also exhibits high uncertainty driven by price signals, behavioral patterns and environmental factors. The multi-dimensional uncertainty of both source and load makes it difficult for traditional scheduling methods based on deterministic predictions to meet actual operational requirements. If the scheduling strategy cannot accurately capture these fluctuations, it may easily cause supply-demand imbalance, equipment overload, curtailment of wind and solar power, or load shedding.
[0004] In order to achieve optimal operation of the system under complex random environment, the scenario analysis-based stochastic optimization scheduling method has been widely applied. The core idea of this method is to approximate the continuous probability distribution space of source and load uncertainty variables by constructing a finite number of typical discrete scenario sets, and then to transform the complex stochastic programming problem into a deterministic programming problem for solution. As can be seen, the quality of the constructed scenario set directly determines the reliability and economy of the stochastic optimization scheduling result. A high-quality scenario set should be able to accurately capture the key characteristics of uncertainty factors, thereby guiding the optimization model to obtain the best scheduling strategy that can adapt to a variety of possible future situations.
[0005] Currently, the scenario generation technology for distributed energy systems mainly relies on data-driven generative model methods, such as generative adversarial networks (GAN), variational autoencoder and other deep learning models. The basic research and development idea of these existing technologies is usually as follows: a large amount of historical source and load operation data is collected as training samples, a complex generator model is constructed, and the model parameters are continuously adjusted through a specific training algorithm, aiming to make the simulated scenario data output by the generator as close as possible to the characteristics of the historical real data in terms of probability density distribution, time series autocorrelation and mutual correlation between multiple variables, etc. The underlying technical logic is that as long as the generated scenarios are statistically close to the historical rules, they can meet the needs of subsequent optimization scheduling.
[0006] However, through in-depth analysis and practical verification, it is found that the above mainstream existing technologies have a fundamental methodological defect in actual application, that is, the generation process of the scene and the subsequent optimization scheduling application process are in an open-loop state.
[0007] Specifically, in the training phase of the existing generation model, the core focus of the loss function is too limited to minimize the difference between the generated data distribution and the historical real data distribution, such as reducing the numerical value of some statistical distance indicators. This method of simply pursuing statistical similarity seriously ignores the physical characteristics and economic objectives of the downstream distributed energy system optimization scheduling model. In the actual complex distributed energy system optimization problem, due to the existence of a large number of nonlinear device operation constraints, complex energy coupling relationships and specific economic objective functions, the influence of scenes with different characteristics on the final scheduling result is nonlinear and greatly different. Some scene details that are not significantly biased in statistical indicators may be amplified sharply after being transmitted by the complex calculation of the optimization model, ultimately resulting in a significantly higher economic cost of the scheduling scheme, or even physically impossible to execute.
[0008] Although the scene set generated by the existing technology can fit the statistical rules of the historical data in appearance, when it is applied as input to the random optimization scheduling model with the goal of minimizing the operation cost, it is often difficult to guide the model to find a truly excellent scheduling strategy. The root cause of this problem is that there is a serious misalignment and disconnection between the training target of the scene generator in the existing technology and the ultimate goal of improving the scheduling economy. Since there is a lack of an effective mechanism to transmit the calculation results of the downstream optimization scheduling and their feedback information on the quality of the scene back to the upstream to guide the update iteration of the generator parameters, the existing scene generation method cannot break through the limitation of statistical fitting and cannot guarantee that the generated scene set can truly serve the ultimate goal of improving the system scheduling performance. SUMMARY
[0009] To solve the above problems, the present application proposes a distributed energy system closed-loop scene generation method and system, which can break the traditional open-loop one-way working mode and establish a new closed-loop scene generation mechanism directly guided by the final optimization scheduling cost, so that the scene generation model can directly perceive and learn the specific influence of uncertain factors on the scheduling result, thereby generating a scene set more valuable for optimization decision-making, and ultimately achieving the goal of improving the economic efficiency and operation reliability of the distributed energy system random optimization scheduling.
[0010] According to some embodiments, the present application adopts the following technical solutions:
[0011] A method for generating a closed-loop scenario of a distributed energy system includes the following steps:
[0012] To obtain historical real data sequences of distributed energy systems, and with minimizing the overall operating cost of distributed energy systems as the objective function, an operation optimization model for distributed energy systems is constructed by introducing equipment operation constraints and energy balance constraints.
[0013] A generative model is constructed and its network parameters are randomly initialized. Using the optimized model and the historical real data sequence as deterministic input, the optimal power flow is calculated to obtain the benchmark reference value.
[0014] An initial simulation scenario is generated using a generative model, and the optimal system scheduling cost for each simulation scenario is calculated using the aforementioned operational optimization model.
[0015] Construct a composite loss function, which includes a cost-based loss term to measure the difference between the optimal system scheduling cost and the benchmark reference value, and a regularization term to constrain the statistical features of the generated scenario.
[0016] Based on feedback optimization, the parameters of the generated model are generated. An optimization algorithm is used to calculate the gradient of the composite loss function with respect to the network parameters of the generated model. Based on this gradient information, the network parameters of the generated model are updated by backpropagation.
[0017] The network parameters of the generative model are updated and optimized iteratively until the training requirements are met, resulting in the final optimized generative model.
[0018] Using the final optimized generative model, a set of typical scenarios for stochastic optimization scheduling of distributed energy systems is generated.
[0019] As an alternative implementation method, the process of constructing an operation optimization model for the distributed energy system, with the objective function of minimizing the overall operating cost of the distributed energy system, and introducing equipment operation constraints and energy balance constraints, includes: the overall operating cost of the distributed energy system includes operating cost, wind and solar curtailment penalty cost, energy storage cost, carbon trading cost, demand response cost, and load curtailment penalty cost, with the objective function being to minimize the overall operating cost of the distributed energy system;
[0020] The operational constraints of the equipment include efficiency constraints of energy conversion equipment, efficiency constraints of energy storage equipment, and maximum transmission power constraints for interaction with the power grid and gas grid;
[0021] Energy balance constraints include power balance constraints for electrical load, thermal load, and cooling load.
[0022] As an alternative implementation method, the process of constructing a generative model includes: constructing a two-layer generative model, where the upper layer generates scenarios that meet the requirements through a minimum-maximum game between the generator and the discriminator of the generative adversarial network; and the lower layer performs two-stage scheduling optimization for each generated scenario, both day-ahead and real-time, calculates the deviation between the overall cost and the ideal cost of the scenario and feeds it back to the upper layer to guide the generator to optimize the direction of scenario generation.
[0023] As a further defined implementation, the process of generating a scenario that meets the requirements by the generator and discriminator of the generative adversarial network through a minimax game includes: using historical data as the training set x, the generator G takes random noise z as input and simulates the generation of data G(z); the discriminator D receives real wind and solar power output data and the data generated by G, and constructs a minimax game model for the generator and discriminator.
[0024] Based on generative adversarial networks, conditional labels are introduced. The conditional labels include at least one of source payload type, time period characteristics, and historical bias. Discriminator D judges the similarity between the generated data and the real data distribution and determines whether the conditional labels are satisfied.
[0025] As a further defined implementation, the loss function of the generative adversarial network is:
[0026] ;
[0027] Let G be the loss function of the generator. Let D be the loss function of the discriminator. and These are the discriminator and generator functions, respectively. To generate a data distribution; For the true data distribution, For historical data, y is the condition label. , They represent the expected value;
[0028] The Wasserstein distance is introduced to represent the similarity between the distributions of real data and historical data samples. The method for calculating the Wasserstein distance satisfies the following:
[0029] ;
[0030] express The network satisfies the 1-Lipschitz function, with an upper bound of 1 for the difference in the expected value of its derivatives, thus ensuring that the network can perform gradient optimization normally. `sup` is the function for finding the minimum upper bound, and a gradient penalty is introduced to replace the original weight clipping. The gradient penalty is:
[0031] ;
[0032] The objective function of the min-max game is:
[0033] ;
[0034] in, This represents the gradient penalty coefficient.
[0035] As a further defined implementation, the objective function of the lower-level scheduling problem is represented in a standard strongly convex quadratic form format;
[0036] With the constraints remaining unchanged, by introducing dual variables to embed the constraints into the objective function, the Lagrangian function for the day-ahead optimization problem becomes:
[0037] ;
[0038] Among them, matrix ;vector This is the coefficient vector of the original linear cost term; Energy balance equation constrains dual variables. These correspond to the balance constraints of electrical, thermal, and cold energy, respectively. Let be the dual variable of the inequality constraint, and This reflects the degree of constraint and tension. Represents the generated scene, and All Let A be a continuous function, and G be the coefficient matrix of the inequality constraints and G be the coefficient matrix of the equality constraints. This is historical data.
[0039] As a further defined implementation method, the global problem of the lower-level objective function is written as a set of subproblems according to the number of generated scenarios. The global parameter consensus problem is solved by using an asymptotic hedging algorithm. An augmented Lagrangian function is constructed, and global consensus parameters, dual multipliers, and penalty coefficients are introduced. Through the iterative process of solving subproblems, updating global parameters, and adjusting penalty coefficients, the convergence and consistency of parameters of each subproblem are achieved. At the same time, the two-stage total average cost is used as the convergence criterion to ensure the achievement of the global optimization objective.
[0040] As a further refined implementation, a bias penalty term and a dual multiplier are introduced for each subproblem, and the consensus constraint is embedded into the objective function of the subproblem, resulting in the augmented Lagrangian function:
[0041] ;
[0042] in, For the generator parameters in the d-th subproblem, The original loss for the d-th subproblem includes the squared value-oriented loss term; Let be the dual multiplier of the k-th iteration; This is an L2 penalty term. This is the penalty coefficient for the k-th iteration; the larger it is, the stronger the penalty for the deviation. Let $\frac{ ... The mean, in the k-th iteration, is fixed. and Each subproblem is solved independently to find the local optimal parameters. for:
[0043] ;
[0044] Loss gradient for each subproblem It consists of the distribution matching loss gradient and the value-oriented loss gradient:
[0045] ;
[0046] The original loss for the d-th subproblem, including the squared value-oriented loss, is related to the generator parameters. Gradient of the gradient, and solution for local optima:
[0047] ;
[0048] in, The learning rate controls the magnitude of each parameter update.
[0049] Solving subproblems relies solely on the scheduling cost gradient of the scene they generate, without requiring information from other subproblems.
[0050] As a further defined implementation, after all subproblems have been solved, the global consensus parameters are updated using a weighted average:
[0051] ;
[0052] Where D is the total number of subproblems;
[0053] The dual multiplier is updated based on deviation feedback to strengthen consensus constraints; the larger the deviation, the greater the adjustment of the dual multiplier.
[0054] ;
[0055] like Deviation , It will increase; in the next iteration, a penalty term will be used to force it. Towards Approaching; dual multipliers have no sign restriction, positive deviations correspond to positive penalties, and negative deviations correspond to negative penalties;
[0056] Penalty coefficient An adaptive adjustment strategy is adopted to balance convergence speed and stability:
[0057] ;
[0058] This is a penalty amplification factor, a constant greater than 1, which gradually increases the penalty in each iteration to strengthen the constraint. The deviation threshold is used to amplify the penalty coefficient when the maximum parameter deviation exceeds this threshold, thereby accelerating convergence.
[0059] As a further defined implementation, in the process of solving the global parameter consensus problem using the incremental hedging algorithm, when the maximum deviation between the local parameters of all subproblems and the global parameters is less than a threshold, and the fluctuation of the global average scheduling cost is less than a threshold, the iteration of the incremental hedging algorithm is stopped, and the generator parameters are updated according to the solution results.
[0060] As an alternative implementation, the training requirement is that the composite loss function value converges to a preset threshold or reaches the maximum number of iterations.
[0061] A distributed energy system closed-loop scenario generation system includes:
[0062] The operation optimization model construction module is configured to acquire historical real data sequences of the distributed energy system, take minimizing the overall operating cost of the distributed energy system as the objective function, introduce equipment operation constraints and energy balance constraints, and construct an operation optimization model of the distributed energy system.
[0063] The benchmark reference value calculation module is configured to build a generative model and randomly initialize its network parameters. Using the running optimization model and the historical real data sequence as deterministic input, it performs optimal power flow calculation to obtain the benchmark reference value.
[0064] The initial simulation scenario generation module is configured to generate an initial simulation scenario using a generation model, solve the problem using the operation optimization model, and calculate the optimal system scheduling cost corresponding to each simulation scenario.
[0065] The composite loss function construction module is configured to construct a composite loss function, which includes a cost-based loss term to measure the difference between the optimal system scheduling cost and the benchmark reference value, and a regularization term to constrain the statistical features of the generated scenario.
[0066] The generative model training module is configured to optimize the generative model parameters based on the feedback scenario. It uses an optimization algorithm to calculate the gradient of the composite loss function with respect to the generative model network parameters, and updates the generative model network parameters based on the gradient information through backpropagation. The update and optimization of the generative model network parameters are iteratively performed until the training requirements are met, and the final optimized generative model is obtained.
[0067] The scenario set generation module is configured to use the final optimized generation model to generate a typical scenario set for stochastic optimization scheduling of distributed energy systems.
[0068] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0069] This invention proposes a closed-loop scenario generation mechanism oriented towards optimizing scheduling costs, breaking the limitation of the separation between scenario generation and application in traditional methods. By feeding back the calculation results of the downstream optimization model to guide the training of the upstream generator, it ensures that the generated scenarios are not only statistically reasonable but also economically effective in serving the final optimization goal. This invention constructs a loss function based on scheduling cost differences, forcing the generator to learn key uncertainty features that significantly impact system operating costs. This enables stochastic optimization scheduling schemes based on the generated scenario set to achieve lower overall costs in actual operation. The closed-loop framework provided by this invention can be adapted to optimization models of distributed energy systems with different structures, effectively improving the economic operation level of systems under various complex and uncertain environments.
[0070] This invention establishes a closed-loop training framework of generation-optimization-feedback. It innovatively proposes directly incorporating the calculation results (i.e., scheduling costs) of the downstream distributed energy system optimization scheduling model into the training process of the upstream scenario generation model, constructing an end-to-end closed-loop feedback mechanism. This mechanism breaks through the limitation of traditional methods where the generator relies solely on statistical data for open-loop training, enabling the scenario generation process to directly perceive and respond to the needs of the optimization objective, achieving a deep integration of scenario generation and optimization application.
[0071] This invention proposes a loss function construction method oriented towards final scheduling economy, which differs from existing technologies that only focus on probability distribution similarity. This invention innovatively constructs a composite loss function that includes a "scheduling cost difference term." By minimizing the gap between the optimal scheduling cost corresponding to the generated scenario and the baseline historical cost, this invention guides the generator to focus on learning key uncertainty features that significantly impact system operational economy, thereby ensuring that the generated scenario is optimal in serving the ultimate goal of cost minimization. The proposed improved GAN model introduces Wasserstein distance and gradient penalty terms to avoid mode collapse and effectively improve the stability of model training. Simultaneously, a conditional label y is introduced into the generator model, making the generated data meet the required conditional probability. To further explore the interdependencies between the system's source and discriminator, a deep LSTM model is introduced in the construction of the generator and discriminator.
[0072] This invention significantly improves the economic efficiency of stochastic optimization scheduling in distributed energy systems. Through a scenario generator obtained via closed-loop training, it can generate more targeted scenario sets. These scenarios more accurately reveal how uncertainties affect the final scheduling cost through complex system constraints and energy coupling relationships. Stochastic optimization scheduling strategies formulated based on such high-quality scenario sets can effectively reduce the overall operating cost of the system when dealing with random disturbances in actual operation. This avoids the problem of overly conservative or aggressive scheduling strategies due to low scenario quality, significantly improving the system's economic efficiency.
[0073] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0074] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0075] Figure 1 This invention provides an example of a distributed energy system scenario generation framework based on an optimized cost feedback closed loop.
[0076] Figure 2 This is a diagram of the GAN structure of the present invention;
[0077] Figure 3 This is a schematic diagram of the closed-loop scene generation model in an example of the present invention;
[0078] Figure 4 The detailed neural network structure of the internal generator of GAN in this invention is shown below;
[0079] Figure 5 This invention improves the loss convergence process during the training of generative adversarial networks;
[0080] Figure 6 The process of changing scene generation costs in different training rounds;
[0081] Figure 7 The power balance diagram representing the scenario scheduling results is generated from the model for the closed-loop scenario.
[0082] Figure 8 A heat power balance diagram representing the scenario scheduling results is generated from the model for the closed-loop scenario.
[0083] Figure 9 A cold power balance diagram representing the scenario scheduling results is generated from the model for the closed-loop scenario. Detailed Implementation
[0084] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0085] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0086] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0087] Where there is no conflict, the embodiments and features described in this application may be combined with each other.
[0088] Example 1
[0089] A method for generating a closed-loop scenario of a distributed energy system includes the following steps:
[0090] Step 1: Building the basic model and preparing historical data: Constructing an operation optimization model for the distributed energy system. This model takes minimizing the overall operating cost of the system as the objective function and includes the operating constraints and energy balance constraints of various devices.
[0091] This step specifically includes: collecting historical operational data sequences containing multi-dimensional uncertainties such as wind power output, photovoltaic power output, and electricity, heat, and cooling loads, as the base dataset for training. The specific structure of the distributed energy system is as follows... Figure 1As shown, the specific expression for running the optimization model is as follows:
[0092] ;
[0093] In the formula, The day-ahead comprehensive cost of a distributed energy system; The optimization period is 24 hours prior to the current date; t represents the moment in the scheduling process. The number of scenes to be optimized. The operating cost of the scenario; The cost of penalizing the abandonment of wind and solar power; For energy storage costs; For tiered carbon trading costs; For IDR costs; The cost of abandoning loads.
[0094] Operating costs:
[0095] ;
[0096] for Moment Scene The power of the electricity / gas to be purchased; , They are respectively The electricity / natural gas price for purchasing electricity / gas at any time; the penalty cost for wind and solar power curtailment is:
[0097] ;
[0098] In the formula, The cost coefficient for abandoning light penalty This represents the cost coefficient for wind curtailment penalties. for Moment Scene The predicted value of photovoltaic power output is as follows; This is the predicted value for wind power output; Contribution value to the photovoltaic project; The power output value for the wind power plan.
[0099] The cost of energy storage can be specifically expressed as:
[0100] ;
[0101] In the formula, This is the energy storage cost coefficient; For energy storage devices The supplementary power value; This is the power value to be released.
[0102] The cost of IDR is:
[0103] ;
[0104] In the formula, For load The IDR cost coefficient; for Moment Scene Under load The IDR reduces the load value.
[0105] Cost of abandoning load:
[0106] ;
[0107] In the formula, For load The cost coefficient for abandoning load; for Moment Scene Under load The power of abandoned load.
[0108] The cost of tiered carbon trading can be expressed as:
[0109] ;
[0110] ;
[0111] ;
[0112] In the formula, For the cost of purchasing electricity and trading carbon credits; Costs associated with purchasing carbon gas; Increase the percentage of fees for tiered carbon trading; Carbon emissions per unit of electricity purchased; Carbon emissions per unit of gas purchased; The length of the tiered carbon trading range for electricity purchases; The length of the tiered carbon trading range for gas purchases; The base price for tiered carbon trading of electricity purchases; This is the base price for the tiered carbon trading system for natural gas. In this embodiment, 50%, The amount is 2500 kg, and the base price for carbon trading is 0.25 yuan / kW·h.
[0113] Energy conversion equipment includes gas turbines, gas boilers, electric boilers, electric chillers, absorption chillers, wind power generation devices, and photovoltaic power generation devices.
[0114] ;
[0115] ;
[0116] ;
[0117] In the formula, They are respectively The power generation / heat generation / intake gas power of the gas turbine at all times; They are respectively The heat output / air intake power of the gas-fired boiler at all times; for The heat output / electricity consumption of the electric boiler at all times; for Cooling / electrical power consumption of the instantaneous refrigerator; for Cooling / heating power of a constant-time absorption chiller; Let i be the power / heat generation efficiency of device i. for The power generation capacity of the wind power generation device at any given time; and These are the cut-in wind speed and cut-out wind speed of the wind power generation device, respectively. and Rated wind speed and The actual wind speed at that moment; This refers to the rated power of the wind power generation device. The power output of the photovoltaic power generation device; The rated power of the photovoltaic power generation device; and They are respectively Light intensity during the time period and reference light intensity under standard test conditions; The power temperature coefficient; and These are ambient temperature and reference temperature, respectively.
[0118] Energy storage devices include electrical energy storage devices, thermal energy storage devices, and cold energy storage devices.
[0119] ;
[0120] In the formula, These are the types of energy storage devices: ESe, ESh, and ESc are electrical energy storage devices, thermal energy storage devices, and cold energy storage devices, respectively. The energy already stored in the device; The self-loss rate of charge / discharge energy; and These are the charging and discharging efficiencies, respectively. and These are the charging and discharging power, respectively. and These are the maximum charging and discharging power, respectively. To ensure the equipment The 0-1 variable introduced because charging and discharging cannot occur simultaneously; and These are the maximum energy storage capacity and the minimum energy storage capacity, respectively. This indicates the energy stored in the device during a scheduling cycle. The start and end times within a given timeframe should be equal.
[0121] The relevant constraints on transmission power are:
[0122] ;
[0123] In the formula, and These represent the maximum transmission power for interaction with the power grid and the maximum transmission power for interaction with the gas grid, respectively.
[0124] In the formula, the subscript This refers to the type of load, specifically electrical load, thermal load, and cooling load. for Moment Scene Under load Adjust the maximum power of the load; In order to ensure that Moment Scene Under load 0-1 variables introduced because they cannot be simultaneously reduced or supplemented.
[0125] Power balance constraints:
[0126] ;
[0127] In the formula, , and They are respectively Moment Scene The power of electrical load, heat load and cooling load.
[0128] Step 2: Initialize the generation network and compute baseline scheduling costs: Build a neural network generator to generate the simulated scene, and randomly initialize its network parameters. The specific network structure is as follows: Figure 4 As shown. Using the optimization model constructed in step 1, and taking historical real data sequences as deterministic input, optimal power flow calculation is performed to obtain the optimal system scheduling cost under historical real conditions, which is then used as the benchmark reference value for subsequent closed-loop training.
[0129] like Figure 2As shown, a Generative Adversarial Network (GAN) is a neural network that treats an unsupervised problem as a supervised problem. This network consists of two parts: a generator (G) and a discriminator (D). This network employs a zero-sum game approach. The generator and discriminator have opposite goals: the generator aims to produce fake data that closely resembles the real data to confuse the discriminator, while the discriminator tries to determine whether the input is real or fake data, outputting a scalar to indicate the authenticity of the data.
[0130] The core of GAN training is minimizing the difference between the distribution of fake data and the distribution of real data. Historical data is used as the training set x, and the generator G takes random noise z as input to simulate and generate data G(z). The discriminator D receives real wind and solar power output data and the data generated by G. The loss functions of the two neural networks G and D in GAN are:
[0131] ;
[0132] Let G be the loss function of the generator. Let D be the loss function of the discriminator. and These are the discriminator and generator functions, respectively. To generate a data distribution; For the true data distribution, For historical data, y is the condition label. , These represent the expectation. In this embodiment, E represents the expectation function, which will not be elaborated further below.
[0133] A minimization game model is constructed for the generator and discriminator. During the game, a Nash equilibrium point needs to be obtained. The minimization game model is as follows:
[0134] ;
[0135] Building upon the traditional GAN network structure, the Conditional Generative Adversarial Network (CGAN) adds an extra label y to the input of G, enabling the model to generate specific conditional data. D not only needs to determine the similarity between the generated data and the real data distribution but also whether the condition y is satisfied. Therefore, the loss functions of G and D become:
[0136] ;
[0137] Wasserstein Generative Adversarial Network with Gradient Penalty (WGAN-GP) introduces Wasserstein distance to characterize the similarity between the distributions of real and historical data samples. The calculation method of Wasserstein distance should satisfy the following:
[0138] ;
[0139] express The network satisfies the 1-Lipschitz function, with an upper bound of 1 for the difference in the expected value of its derivatives, thus ensuring proper gradient optimization. `sup` is the function used to find the minimum upper bound. Gradient Penalty (GP) is introduced to replace the weight pruning in the original WGAN. This satisfies the 1-Lipschitz continuity constraint while avoiding gradient vanishing, exploding, or discriminator limitations caused by weight pruning, significantly improving training stability and the quality of generated data. GP is:
[0140] ;
[0141] Therefore, the objective function can be rewritten as:
[0142] ;
[0143] in, This represents the gradient penalty coefficient.
[0144] CWGAN-GP combines the features of CGAN and WGAN-GP. The model uses Wasserstein distance instead of traditional cross-entropy loss and incorporates Zero-Centered Gradient Penalty (ZC-GP) to avoid mode collapse and improve model training stability. It also embeds a "multi-scale convolution + Bi-LSTM + attention mechanism" architecture. Multi-scale convolution captures features at different temporal granularities, Bi-LSTM bidirectionally models long-term temporal dependencies, and the attention mechanism strengthens features of key time periods. This embodiment introduces a cost bias term into the generator loss function to guide the model to generate scenarios that can support low-cost scheduling, achieving the dual goals of "statistical realism" and "cost adaptation". Finally, by introducing conditional labels (source load type, time period features, historical bias), the model can generate scenarios that meet specific needs and adapt to the directional requirements of day-ahead scheduling.
[0145] This embodiment uses a GAN generator to generate scenarios that closely resemble real-world operational characteristics, providing comprehensive uncertain scenario inputs for two-stage scheduling. The scenario generation model is as follows: Figure 3 As shown. The core of this problem is a two-layer framework of upper-layer GAN game theory and lower-layer two-stage scheduling: the upper layer generates scenarios that conform to the real distribution and have low scheduling costs through a min-max game between the generator and the discriminator; the lower layer performs two-stage scheduling optimization for each generated scenario, both day-ahead and real-time, calculates the deviation between the overall cost and the ideal cost of the scenario and feeds it back to the upper layer, guiding the generator to optimize the direction of scenario generation. This framework realizes a closed loop of scenario generation and scheduling optimization cost feedback, improving the robustness of the scheduling scheme to uncertainty. The core problem of this process can be expressed in formula form:
[0146] ;
[0147] in, To substitute historical data into the ideal baseline historical scheduling cost obtained in step 1, This indicates that the optimized generated scene satisfies the distribution characteristics of the historical scene. Represents the generated scene, and All Let A be a continuous function, and G be the coefficient matrix of the inequality constraints and G be the coefficient matrix of the equality constraints. The data consists of historical data; the upper layer is a min-max game model of GAN, and the lower layer is a scheduling optimization model to calculate the total comprehensive cost. The goal of the global problem is to make the generator generate a scenario that is close to reality and has the lowest cost.
[0148] The lower-level objective function can be represented in the form of a standard strongly convex quadratic form:
[0149] :
[0150] matrix ;vector The coefficient vector of the original linear cost terms (such as electricity purchase price, wind curtailment penalty coefficient, etc.); the constraints remain unchanged. Introducing dual variables embeds the constraints into the objective function. The Lagrangian function for the day-ahead optimization problem is:
[0151] ;
[0152] Among them, matrix ;vector This is the coefficient vector of the original linear cost term; Energy balance equation constrains dual variables. These correspond to the balance constraints of electrical, thermal, and cold energy, respectively. Let be the dual variable of the inequality constraint, and This reflects the degree of constraint and tension. Represents the generated scene, and All Let A be a continuous function, and G be the coefficient matrix of the inequality constraints and G be the coefficient matrix of the equality constraints. This is historical data.
[0153] Optimal solution to strongly convex problems The following KKT conditions must be met: gradient condition (the gradient of the Lagrangian function with respect to the decision variables is 0); primal feasibility (all constraints must be satisfied); dual feasibility (the dual variables of the inequality constraints are non-negative); and complementary relaxation (the dual variables of the non-tight constraints are 0). An implicit system of equations can be constructed as follows:
[0154] ;
[0155] Mapping Satisfying continuity, and All A continuous function, therefore Continuous; and for The partial derivatives are continuous here. To and The relevant set of decision variables, because Positive definite Jacobian matrix Full rank is reversible. This is a variant of the Lagrange function, a recent optimization problem. This represents the optimal solution of the function. , This represents the Lagrange variable corresponding to the optimal solution. , The value of .
[0156] According to the implicit function theorem, there exists a unique continuously differentiable implicit function:
[0157] ;
[0158] The current optimal decision It is a scene The only function.
[0159] For the KKT equations Both sides regarding Find the total differential:
[0160] ;
[0161] Summarized as follows: ;
[0162] Combining the Lagrange function, we can obtain:
[0163] ;
[0164] ;
[0165] Among them, matrix Full rank is reversible. For energy balance constraints on the scenario The partial derivatives are typically the identity matrix or the selection matrix. They are obtained by matrix inversion. Extracting the first part yields:
[0166] ;
[0167] Strongly convex problems satisfy strong duality, meaning the optimal value of the primal problem equals the optimal value of the dual problem.
[0168] ;
[0169] Will Substituting the Lagrangian function and eliminating all decision variables, we obtain the result containing only the Lagrangian function. The cost expression for the dual variable:
[0170] ;
[0171] Where, vector This is the coefficient vector of the original linear cost term. For a function containing only dual variables, pass With scene Directly related, and This is the right-hand side term of the energy balance constraint, i.e., the total load-side demand, corresponding to the load-side component of the generator's output scenario. Ultimately, this can be used to establish... The relationship with generator parameters. The global problem can be written as a set of subproblems based on the number of generated scenarios:
[0172] ;
[0173] in, For the generator local parameters of the d-th subproblem, For global consensus parameters, The penalty coefficient is used to control the deviation between local and global parameters. The weights of the distributed loss in the objective function. As the weight of cost error loss, The weights are the values corresponding to the gradient penalty loss. For the upper bound constraint of the scenario in the d-th subproblem, s is the upper bound of the gradient penalty. dFor the input scenario of the d-th subproblem, These are the parameters for the discriminator.
[0174] Introducing the Lagrange multiplier The above formula can be rearranged as:
[0175] ;
[0176] The first part of the formula is a variation of the improved generator loss function, so the above formula can be written as:
[0177] ;
[0178] The Progressive Hedging Algorithm (PH) is employed to solve the global parameter consensus problem, aiming to address parameter consistency issues in parallel solutions of multiple subproblems. Since GAN-driven bilayer optimization problems can be decomposed into multiple independent subproblems, each corresponding to a scenario's scheduling optimization, generator parameters in each subproblem are prone to divergence, affecting the global optimization performance. The PH algorithm constructs an augmented Lagrangian function, introducing global consensus parameters, dual multipliers, and penalty coefficients. Through an iterative process of subproblem solving, global parameter updating, and penalty coefficient adjustment, it achieves convergence and consistency of parameters across subproblems. Simultaneously, it uses the two-stage total average cost as the convergence criterion to ensure the achievement of the global optimization objective. This algorithm balances solution efficiency and optimization accuracy, making it suitable for solving bilayer stochastic optimization problems in large-scale scenarios.
[0179] Combining the above, a bias penalty term and a dual multiplier are introduced for each subproblem, and the consensus constraint is embedded into the objective function of the subproblem, resulting in the augmented Lagrangian function:
[0180] ;
[0181] in The original loss for the d-th subproblem includes the squared value-oriented loss term; The dual multiplier for the k-th iteration (quantifying the tension of consensus constraints); This is an L2 penalty term. This is the penalty coefficient for the k-th iteration; the larger it is, the stronger the penalty for the deviation. Let $\frac{ ... The mean. In the k-th iteration, fixed and Each subproblem is solved independently to find the local optimal parameters. :
[0182] ;
[0183] The independent variable represents the value of the objective function. Values.
[0184] The loss gradient for each subproblem consists of the distribution-matching loss gradient and the value-oriented loss gradient:
[0185] ;
[0186] The Adam optimizer is used to find local optima.
[0187] ;
[0188] in, The learning rate controls the magnitude of each parameter update.
[0189] Solving subproblems relies solely on the scheduling cost gradient of their own generated scenarios, requiring no information from other subproblems, thus significantly reducing computational complexity. After all subproblems are solved, the global consensus parameters are updated using a weighted average.
[0190] ;
[0191] The dual multiplier is updated based on deviation feedback to strengthen consensus constraints; the larger the deviation, the greater the adjustment of the dual multiplier.
[0192] ;
[0193] like Deviation , It will increase; in the next iteration, a penalty term will be used to force it. Towards Approaching; dual multipliers have no sign restriction, positive deviations correspond to positive penalties, and negative deviations correspond to negative penalties.
[0194] Penalty coefficient An adaptive adjustment strategy is adopted to balance convergence speed and stability:
[0195] ;
[0196] (To avoid excessively large penalty coefficients that could lead to gradient explosion); (The penalty coefficient is increased slightly in each iteration to strengthen the constraint).
[0197] If either of the following two conditions is met, the PH algorithm iteration stops; otherwise, it returns to a fixed global parameter and proceeds to the next round:
[0198] Parameter consensus convergence: The maximum deviation between the local parameters and the global parameters of all subproblems is less than a threshold. :
[0199] ;
[0200] Cost convergence: Global average scheduling cost fluctuation is less than a threshold. :
[0201] ;
[0202] Let $\frac{ ...
[0203] After satisfying the above conditions, the generator parameters are updated according to the solution results. Before each parameter update, the discriminator accurately distinguishes the realism of the scene, and this standard is used to supervise the generator. When the generator adjusts its parameters due to scheduling cost losses, if the scene is slightly distorted, the discriminator will immediately provide feedback, allowing the generator to correct it in the next parameter update; if the distortion is severe, realism is corrected first. The gradient transfer process between the discriminator and the generator is well-established in existing research and will not be elaborated here. Within the framework of realism, the next round of scene generation and parameter updates is performed until the scene scheduling cost approaches the ideal cost and no longer changes. The model training is then complete. Combining the trained generator with the point prediction results generates a scene set that considers historical data distribution, satisfies the future prediction interval, and takes scheduling cost into account.
[0204] The generator described above takes random noise and conditional labels as input and outputs time series data of power sources such as electricity, heat, cold, photovoltaic, and wind power. Its structure consists of an input layer, a feature preprocessing layer, a multi-scale convolutional layer, a Bi-LSTM (Long Short Term Memory) layer, an attention mechanism layer, and an output layer. The detailed design of each layer is as follows:
[0205] The input layer obtains the fused input through feature concatenation. , dimension This provides a foundation for subsequent feature extraction, comprising two parts: random noise and conditional labels, balancing the needs of uncertainty modeling and targeted generation; among which (Training batch size, the optimal value verified by experiments). The time sequence length is 24 in this embodiment (i.e., the number of scheduling periods, covering 24 hours).
[0206] Random noise provides an uncertainty basis for scene generation, ensuring scene diversity and conforming to a uniform distribution. , dimension .
[0207] The dimensions of the conditional labels are It contains three types of labels, which are processed into numerical features through one-hot encoding or normalization, and are specifically defined as follows:
[0208] Source type tags Distinguish between wind power, photovoltaic power, electrical load, heat load, and cooling load, and use a 5-dimensional unique thermal encoding (e.g., wind power corresponds to [1,0,0,0,0]).
[0209] Time period feature tags Distinguish between peak, flat, and valley periods, and use 3D unique thermal coding (e.g., peak load period corresponds to [1,0,0]).
[0210] Historical deviation label : Scene prediction bias for the corresponding time period of the previous day (normalized to the [0,1] interval), used to dynamically correct scene generation bias.
[0211] The core function of the feature preprocessing layer is to standardize input features and improve model training stability. It includes two sub-layers: Layer Normalization (LN) and dimensionality enhancement.
[0212] Layer normalization involves normalizing the concatenated input features to eliminate training interference caused by differences in feature scales. The formula is as follows:
[0213] ;
[0214] in, The mean of features within the batch. The variance of characteristics within the batch. =1、 These are the initial learnable parameters (dynamically optimized during training). To prevent the minimum value where the denominator is zero.
[0215] In this embodiment, the number of input feature channels is 4, including the input noise and 3 types of condition labels mentioned above.
[0216] ;
[0217] ;
[0218] in t is the index of the feature channel, and t is the time.
[0219] Dimensionality enhancement refers to increasing the number of feature channels from 4 to 64 using a 1×1 convolutional layer, providing sufficient dimensionality support for multi-scale feature extraction. The formula is as follows:
[0220] ;
[0221] in, It is a 1×1 convolution kernel weight matrix. The bias term has an output dimension of . , This represents a temporal convolution operation.
[0222] The core objective of multi-scale convolutional layers is to capture the characteristics of source payload data at different time scales (small fluctuations within 15 minutes, medium-term changes within 2 hours, and long-term trends within 24 hours). By setting three different convolutional kernel sizes (3, 5, and 7) in parallel, the simultaneous extraction and fusion of multi-scale features can be achieved.
[0223] First, convolution operations are performed on the preprocessed feature maps, using the same formula:
[0224] ;
[0225] in, This represents the kernel size (corresponding to the time window length). This is the position index of the convolutional kernel in the temporal dimension. It is a K×1 temporal convolution kernel weight matrix (convolution is performed only in the temporal direction). As a bias term, padding is set to "same" to ensure the output temporal length is consistent with the input (both T=96). The output dimension of each convolution is... .
[0226] Then, the feature maps output from the three convolutional layers are concatenated along the channel dimension to obtain a multi-scale fused feature map, as shown in the formula:
[0227] ;
[0228] Output dimension is This enables complementary enhancement of features at different time scales.
[0229] The core function of the Bi-LSTM layer is to capture the long-term temporal dependencies of source-load data (such as the diurnal variation of photovoltaic power output with light intensity and the alternation of peak and valley loads). By using forward LSTM and backward LSTM to model the data collaboratively, it avoids the omission of backward temporal information by traditional unidirectional LSTM.
[0230] Each LSTM unit contains an input gate, a forget gate, an output gate, and a cell state. It dynamically adjusts the storage and forgetting of information through a gating mechanism. The core formula is:
[0231] ;
[0232] in, , , These are the activation values for the input gate, forget gate, and output gate (range [0,1]). In cellular state, Candidate cell state, In hidden state, This is the weight matrix. For bias terms, It is the sigmoid activation function. The hyperbolic tangent activation function maps the output to [-1, 1]. This is element-wise multiplication.
[0233] Bidirectional LSTM computation begins from the timing starting point. arrive Calculate and capture forward temporal dependencies, and output the forward hidden state. Then from the end of the time series arrive Calculate and capture backward temporal dependencies, and output the reverse hidden state. Finally, feature concatenation is performed: the forward and backward hidden states are concatenated at the neuron level to obtain bidirectional fused temporal features, as shown in the formula:
[0234] ;
[0235] Output dimension is To improve the model's generalization ability, the Bi-LSTM layer is set to 2 layers, with 128 neurons in each hidden layer, and a dropout rate of 0.2 (to prevent overfitting).
[0236] The core role of the attention mechanism layer is to amplify the characteristics of key time periods that significantly impact scheduling costs (such as peak load periods, periods of high wind power generation, and carbon trading tiered switching periods), preventing key information from being averaged out and improving the realism of core areas of the scenario.
[0237] First, the bidirectional fused features output by Bi-LSTM are mapped to a single-dimensional attention weight score through a two-layer multilayer perceptron (MLP), as shown in the formula:
[0238] ;
[0239] in, , The weight matrix of the MLP. , For the bias term, output The attention score is then calculated. The attention score is then converted into normalized weights (summed to 1) using the softmax function, as shown in the formula:
[0240] ;
[0241] in, The attention weights are calculated by assigning them element-wise to the Bi-LSTM output features. Larger weight values indicate a more significant impact of the corresponding time-period features on scene quality. Multiplication amplifies features from critical time periods and suppresses features from non-critical time periods. The formula is as follows:
[0242] ;
[0243] Output dimension is .
[0244] The core function of the output layer is to map the attention-enhanced high-dimensional features to the final source-load scene, thereby restoring physical quantities.
[0245] First, a 3×1 convolutional layer is used to map the number of feature channels from 256 to 5 (corresponding to the source payload). Then, the tanh activation function is used to map the output value to... The interval is then converted into an actual physical quantity (kW or m³ / h) through inverse normalization, as shown in the specific formula:
[0246] ;
[0247] ;
[0248] in, To output the convolution kernel weight matrix, This is the relative position index of the 3×1 convolutional kernel in the temporal dimension. The bias term has an output dimension of . . , These represent the maximum and minimum values of historical data for various power sources (such as wind power output). , The final output is the generated scene. .
[0249] Step 3: Generate initial simulation scenarios and solve for the corresponding scheduling costs using the generative model built in Step 2: Input a random noise vector into the generator under the current parameters to generate a batch of initial simulation scenarios containing wind power, photovoltaic, and various types of load data. Substitute these simulation scenarios as inputs into the distributed energy system operation optimization model built in Step 1 to solve for the optimal system scheduling cost corresponding to each simulation scenario.
[0250] Step 4: Construct a loss function based on scheduling cost differences. A composite loss function is constructed to guide generator parameter updates. The core of this loss function is a cost-based loss term, which measures the difference between the simulated scenario scheduling cost calculated in Step 3 and the baseline historical scheduling cost obtained in Step 2. The loss function may also include a regularization term to constrain the statistical characteristics of the generated scenario, ensuring the basic physical plausibility of the scenario. The specific formula for the loss function is:
[0251] ;
[0252] in, To substitute historical data into the ideal baseline historical scheduling cost obtained in step 1, This indicates that the optimized generated scene satisfies the distribution characteristics of the historical scene. This represents the system's day-to-day integrated cost.
[0253] Step 5: Optimize the scene generator parameters based on feedback. Using the loss function constructed in Step 4, calculate the gradient of the loss function relative to the generator network parameters using optimization algorithms such as gradient descent. Update the generator network parameters based on this gradient information through backpropagation. This aims to adjust the generator's output distribution so that the scheduling cost of the next batch of simulated scenes, after optimization, is closer to the baseline historical scheduling cost. The gradient update propagation process is as follows: Figure 3 As shown.
[0254] Step 6: Closed-Loop Iterative Training Until Convergence: Repeat steps 3 to 5 to form a closed-loop iterative training process of "generating a scene - solving the scheduling problem - calculating the loss - updating parameters". In each iteration, the generator will continuously self-correct based on the optimization scheduling results of the previous round. Set a training termination condition: when the loss function value converges to a preset threshold or the maximum number of iterations is reached, stop training and obtain the final optimized scene generator model.
[0255] Step 7: Generate the final scenario set for optimized scheduling: Using the final scenario generator trained in Step 6, generate a large-scale typical scenario set for stochastic optimized scheduling of distributed energy systems. This scenario set has been trained with an optimization cost feedback loop, which can effectively guide the optimization model to formulate a more economical scheduling strategy.
[0256] First, the overall idea of the method provided in this embodiment is as follows: Figure 1 As shown, based on known data and the scheduling model from historical data, the theoretical optimal cost for the scheduling day is calculated and used as the ideal cost to guide training. Then, scenarios generated by the GAN are scheduled, and the deviation between the scenario scheduling cost and the ideal cost guides the network model to generate a set of scenarios with lower scheduling costs. During training, interval prediction is incorporated to ensure that the generated scenarios conform to the prediction range of the next time period. Finally, the trained model is used to generate a set of scenarios oriented towards the scheduling cost of the distributed energy system and performs scheduling to obtain the final scheduling strategy and equipment output plan.
[0257] The key to closed-loop scene generation models is enabling GANs to generate scenes that ensure realism while considering cost. The loss during training varies as follows: Figure 5As shown, during training, in the first phase from 0 to 80 rounds, the generator and discriminator engage in a trade-off between scene realism and cost considerations. Between 80 and 160 rounds, the generator G can basically generate a set of scenes that conform to realism. At this point, the scenes generated by the generator can move towards lower costs while maintaining realism. After about 160 rounds, the discriminator loss remains unchanged, and the generated scenes can fully meet the requirements of the discriminator D. After about 240 rounds, the generated scenes can fully balance cost reduction and realism, and the loss of the generator D no longer changes.
[0258] The evolution trajectory of scheduling costs in various scenarios during the training process, such as Figure 6 As shown, this further confirms the phased dynamic game process between the generator and the discriminator. In the early training stage (rounds 0-80), corresponding to the intense adversarial exploration phase, the cost of each scene exhibits significant volatility and high dispersion, reflecting that the generator has not yet mastered the essentials of realism and cost control. As the generator gradually learns the distribution of real scenes under the guidance of cost constraints (rounds 80-160), the overall cost of the scenes shows a clear downward trend. Subsequently, when the scene realism is basically achieved (the discriminator loss stabilizes around round 160), the generator focuses on deepening cost optimization, causing the scene cost to continue to decline steadily and the variance to gradually decrease. Finally, as the game reaches Nash equilibrium (the generator loss stabilizes after round 240), the scheduling cost of all scenes converges and stabilizes within a narrow low-cost range, strongly demonstrating that the model has successfully achieved the training objective of minimizing scheduling costs while ensuring high scene realism.
[0259] Scenes were selected from the scene set samples generated by this method for day-ahead optimization scheduling. The results were compared with those of the traditional Monte Carlo method, which generates scene sets and performs day-ahead optimization scheduling. The results are shown in Table 1.
[0260] Table 1 Optimization scheduling strategies in different scenarios
[0261]
[0262] As can be seen from the scheduling results cost, the scenarios generated based on the closed-loop scenario generation strategy of this embodiment can effectively guarantee the economy of the scheduling strategy. Furthermore, since the wind and solar curtailment penalties are emphasized during the training process, the method proposed in this embodiment can effectively reduce wind and solar curtailment. The power balance diagram of the scheduling results (electricity, heat, and cooling) is shown below. Figure 7 , Figure 8 and Figure 9 As shown.
[0263] In this embodiment, the Distributed Energy System (DES) is an energy network that disperses energy production, storage, and consumption across multiple locations. Such a system typically includes small-scale renewable energy generation equipment, such as solar photovoltaic panels, wind turbines, and small hydroelectric generators, as well as energy storage equipment, such as battery storage systems. These devices can be used independently or interconnected to form a distributed energy network, enabling efficient energy utilization and optimized allocation.
[0264] In the power system sector, day-ahead dispatch is a core component of modern power grid operation. It refers to the process by which power system operators, based on forecasts of the next day's load demand (electricity consumption) and renewable energy output (such as wind and solar power), optimize and formulate generation plans, energy storage charging and discharging strategies, and demand-side response schemes for each time period (usually at one-hour intervals) the following day, with economic objectives (such as minimizing generation costs) or security as the goals. Its aim is to achieve optimal resource allocation while ensuring the safe and stable operation of the power grid.
[0265] Based on the scenario set sample generated by the closed-loop scenario generation strategy described in this embodiment, a simulated scenario for the next day is selected from the generated scenario set sample for day-ahead optimization scheduling. According to the generated day-ahead optimization scheduling, the optimized scheduling parameters for each device in the distributed energy system in the next 24 hours are output, and the devices in the distributed energy system are controlled to operate according to the day-ahead optimization scheduling in each time period of the next day. For example, in the scenario of excess renewable energy generation, the energy storage device is controlled to charge according to the relevant energy storage parameters in the day-ahead optimization scheduling. In the scenario of peak load, the backup distributed power source is started or the energy storage device is called to release energy. For example, the cogeneration (combined heat and power, CHP) is called and controlled to generate power in each time period of the next day according to the relevant output parameters in the day-ahead optimization scheduling.
[0266] Example 2
[0267] The operation optimization model construction module is configured to acquire historical real data sequences of the distributed energy system, take minimizing the overall operating cost of the distributed energy system as the objective function, introduce equipment operation constraints and energy balance constraints, and construct an operation optimization model of the distributed energy system.
[0268] The benchmark reference value calculation module is configured to build a generative model and randomly initialize its network parameters. Using the running optimization model and the historical real data sequence as deterministic input, it performs optimal power flow calculation to obtain the benchmark reference value.
[0269] The initial simulation scenario generation module is configured to generate an initial simulation scenario using a generation model, solve the problem using the operation optimization model, and calculate the optimal system scheduling cost corresponding to each simulation scenario.
[0270] The composite loss function construction module is configured to construct a composite loss function, which includes a cost-based loss term to measure the difference between the optimal system scheduling cost and the benchmark reference value, and a regularization term to constrain the statistical features of the generated scenario.
[0271] The generative model training module is configured to optimize the generative model parameters based on the feedback scenario. It uses an optimization algorithm to calculate the gradient of the composite loss function with respect to the generative model network parameters, and updates the generative model network parameters based on the gradient information through backpropagation. The update and optimization of the generative model network parameters are iteratively performed until the training requirements are met, and the final optimized generative model is obtained.
[0272] The scenario set generation module is configured to use the final optimized generation model to generate a typical scenario set for stochastic optimization scheduling of distributed energy systems.
[0273] 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 one or more computer-usable storage media (including, but not limited to, disk storage, etc.) containing computer-usable program code. CD - ROM It takes the form of a computer program product implemented on (such as optical memory, etc.).
[0274] 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.
[0275] 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.
[0276] 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.
[0277] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art without creative effort within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating closed-loop scenarios in a distributed energy system, characterized in that, Includes the following steps: To obtain historical real data sequences of distributed energy systems, and with minimizing the overall operating cost of distributed energy systems as the objective function, an operation optimization model for distributed energy systems is constructed by introducing equipment operation constraints and energy balance constraints. A generative model is constructed and its network parameters are randomly initialized. Using the optimized model and the historical real data sequence as deterministic input, the optimal power flow is calculated to obtain the benchmark reference value. An initial simulation scenario is generated using a generative model, and the optimal system scheduling cost for each simulation scenario is calculated using the aforementioned operational optimization model. Construct a composite loss function, which includes a cost-based loss term to measure the difference between the optimal system scheduling cost and the benchmark reference value, and a regularization term to constrain the statistical features of the generated scenario. Based on feedback optimization, the parameters of the generated model are generated. An optimization algorithm is used to calculate the gradient of the composite loss function with respect to the network parameters of the generated model. Based on this gradient information, the network parameters of the generated model are updated by backpropagation. The network parameters of the generative model are updated and optimized iteratively until the training requirements are met, resulting in the final optimized generative model. Using the final optimized generative model, a set of typical scenarios for stochastic optimization scheduling of distributed energy systems is generated; The process of building a generative model includes: building a two-layer generative model, where the upper layer generates a scene that meets the requirements by playing a minimum-maximum game between the generator and the discriminator of the generative adversarial network; The lower layer performs two-stage scheduling optimization for each generated scenario, both day-ahead and real-time, calculates the deviation between the overall cost and the ideal cost of the scenario, and feeds it back to the upper layer to guide the generator in optimizing the scenario generation direction.
2. The method for generating a closed-loop scenario of a distributed energy system as described in claim 1, characterized in that, The process of constructing an operation optimization model for a distributed energy system with the objective function of minimizing the overall operating cost of the distributed energy system, and introducing equipment operation constraints and energy balance constraints, includes: the overall operating cost of the distributed energy system includes operating cost, wind and solar curtailment penalty cost, energy storage cost, carbon trading cost, demand response cost, and load curtailment penalty cost, with the objective function being to minimize the overall operating cost of the distributed energy system; The operational constraints of the equipment include efficiency constraints of energy conversion equipment, efficiency constraints of energy storage equipment, and maximum transmission power constraints for interaction with the power grid and gas grid; Energy balance constraints include power balance constraints for electrical load, thermal load, and cooling load.
3. The method for generating a closed-loop scenario of a distributed energy system as described in claim 1, characterized in that the upper layer... The process of generating a scenario that meets the requirements by using a minimax game between the generator and the discriminator in a generative adversarial network includes: using historical data as a training set x, the generator G takes random noise z as input and simulates the generation of data G(z); the discriminator D receives real wind and solar power output data and the data generated by G, and constructs a minimax game model for the generator and the discriminator. Based on generative adversarial networks, conditional labels are introduced. The conditional labels include at least one of source payload type, time period characteristics, and historical bias. Discriminator D judges the similarity between the generated data and the real data distribution and determines whether the conditional labels are satisfied.
4. The method for generating a closed-loop scenario of a distributed energy system as described in claim 3, characterized in that, The loss function for generative adversarial networks is: ; Let G be the loss function of the generator. Let D be the loss function of the discriminator. and These are the discriminator and generator functions, respectively. To generate a data distribution; For the true data distribution, For historical data, y is the condition label. , They represent the expected value; The Wasserstein distance is introduced to represent the similarity between the distributions of real data and historical data samples. The method for calculating the Wasserstein distance satisfies the following: ; express The network satisfies the 1-Lipschitz function, with an upper bound of 1 for the difference in the expected value of its derivatives, thus ensuring that the network can perform gradient optimization normally. `sup` is the function for finding the minimum upper bound, and a gradient penalty is introduced to replace the original weight clipping. The gradient penalty is: ; The objective function of the min-max game is: ; in, This represents the gradient penalty coefficient.
5. The method for generating a closed-loop scenario of a distributed energy system as described in claim 3, characterized in that, The objective function of the lower-level scheduling problem is represented by a standard strongly convex quadratic form. With the constraints remaining unchanged, by introducing dual variables to embed the constraints into the objective function, the Lagrangian function for the day-ahead optimization problem becomes: ; Among them, matrix ;vector This is the coefficient vector of the original linear cost term; Energy balance equation constrains dual variables. These correspond to the balance constraints of electrical, thermal, and cold energy, respectively. Let be the dual variable of the inequality constraint, and This reflects the degree of constraint and tension. Represents the generated scene, and All Let A be a continuous function, and G be the coefficient matrix of the inequality constraints. This is historical data.
6. The method for generating a closed-loop scenario of a distributed energy system as described in claim 1, characterized in that, The global problem of the lower-level objective function is written as a set of subproblems according to the number of generated scenarios. The global parameter consensus problem is solved by using an asymptotic hedging algorithm. An augmented Lagrangian function is constructed, and global consensus parameters, dual multipliers, and penalty coefficients are introduced. Through the iterative process of solving subproblems, updating global parameters, and adjusting penalty coefficients, the convergence and consistency of parameters of each subproblem are achieved. At the same time, the two-stage total average cost is used as the convergence criterion to ensure the achievement of the global optimization objective.
7. The method for generating a closed-loop scenario of a distributed energy system as described in claim 6, characterized in that, By introducing a bias penalty term and a dual multiplier for each subproblem, and embedding consensus constraints into the objective function of the subproblems, we obtain the augmented Lagrangian function: ; in, For the generator parameters in the d-th subproblem, The original loss for the d-th subproblem includes the squared value-oriented loss term; Let be the dual multiplier of the k-th iteration; This is an L2 penalty term. This is the penalty coefficient for the k-th iteration; the larger it is, the stronger the penalty for the deviation. Let $\frac{ ... The mean, in the k-th iteration, is fixed. and Each subproblem is solved independently to find the local optimal parameters. for: ; Loss gradient for each subproblem It consists of the distribution matching loss gradient and the value-oriented loss gradient: ; The original loss for the d-th subproblem includes the squared value-oriented loss with respect to the generator parameters. Gradient of the gradient, and solution for local optima: ; in, The learning rate controls the magnitude of each parameter update. The solution of subproblems depends only on the scheduling cost gradient of the scene they generate, without requiring information about other subproblems; After all subproblems are solved, the global consensus parameters are updated using a weighted average: ; Where D is the total number of subproblems; The dual multiplier is updated based on deviation feedback to strengthen consensus constraints; the larger the deviation, the greater the adjustment of the dual multiplier. ; like Deviation , It will increase; in the next iteration, a penalty term will be used to force it. Towards Approaching; dual multipliers have no sign restriction, positive deviations correspond to positive penalties, and negative deviations correspond to negative penalties; Penalty coefficient An adaptive adjustment strategy is adopted to balance convergence speed and stability: ; This is a penalty amplification factor, a constant greater than 1, which gradually increases the penalty in each iteration to strengthen the constraint. The deviation threshold is used to amplify the penalty coefficient when the maximum parameter deviation exceeds this threshold, thereby accelerating convergence.
8. The method for generating a closed-loop scenario of a distributed energy system as described in claim 6, characterized in that, In the process of solving the global parameter consensus problem using the incremental hedging algorithm, when the maximum deviation between the local parameters of all subproblems and the global parameters is less than the threshold, and the fluctuation of the global average scheduling cost is less than the threshold, the iteration of the incremental hedging algorithm is stopped, and the generator parameters are updated according to the solution results.
9. A closed-loop scenario generation system for distributed energy systems, characterized in that, include: The operation optimization model construction module is configured to acquire historical real data sequences of the distributed energy system, take minimizing the overall operating cost of the distributed energy system as the objective function, introduce equipment operation constraints and energy balance constraints, and construct an operation optimization model of the distributed energy system. The benchmark reference value calculation module is configured to build a generative model and randomly initialize its network parameters. Using the running optimization model and the historical real data sequence as deterministic input, it performs optimal power flow calculation to obtain the benchmark reference value. The initial simulation scenario generation module is configured to generate an initial simulation scenario using a generation model, solve the problem using the operation optimization model, and calculate the optimal system scheduling cost corresponding to each simulation scenario. The composite loss function construction module is configured to construct a composite loss function, which includes a cost-based loss term to measure the difference between the optimal system scheduling cost and the benchmark reference value, and a regularization term to constrain the statistical features of the generated scenario. The generative model training module is configured to generate model parameters based on feedback optimization scenarios, calculate the gradient of the composite loss function with respect to the generative model network parameters using an optimization algorithm, and update the network parameters of the generative model through backpropagation based on this gradient information. The network parameters of the generative model are updated and optimized iteratively until the training requirements are met, resulting in the final optimized generative model. The scenario set generation module is configured to use the final optimized generation model to generate a typical scenario set for stochastic optimization scheduling of distributed energy systems; The process of building a generative model includes: building a two-layer generative model, where the upper layer generates a scene that meets the requirements by playing a minimum-maximum game between the generator and the discriminator of the generative adversarial network; The lower layer performs two-stage scheduling optimization for each generated scenario, both day-ahead and real-time, calculates the deviation between the overall cost and the ideal cost of the scenario, and feeds it back to the upper layer to guide the generator in optimizing the scenario generation direction.