A micro-grid typical scenario generation method, device and electronic equipment
By generating typical microgrid scenarios that meet specified operating characteristics through a conditional diffusion model, the problem of sample coverage and curve shape authenticity in photovoltaic high-fluctuation, low-output, and rapid load disturbance scenarios in existing technologies is solved, thereby improving the reliability and efficiency of microgrid operation analysis.
Patent Information
- Application Number
- CN202611245701.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-17
AI Technical Summary
Existing methods for constructing microgrid scenarios struggle to simultaneously meet the requirements of sample coverage, curve morphology authenticity, and target condition controllability under critical operating conditions such as high photovoltaic fluctuations, low output, and rapid load disturbances. This results in insufficient reliability in voltage over-limit analysis, photovoltaic carrying capacity assessment, and energy storage regulation strategy verification.
A pre-trained conditional diffusion model is used to generate typical microgrid scenarios that meet specified operating characteristics through forward denoising and denoising networks, including U-Net, multi-expert temporal denoising network and conditional gating network. Combined with differential enhancement, dilated one-dimensional convolution and multi-kernel local convolution and other techniques, intraday power curves that conform to the photovoltaic high fluctuation, low output and rapid load disturbance scenarios are generated.
It improves the coverage of microgrid operation analysis for boundary states and special operating conditions, enhances the efficiency of typical scenario construction, ensures consistency between generated scenario samples and real scenarios, and supports more reliable voltage safety verification and photovoltaic carrying capacity assessment.
Smart Images

Figure CN123116797A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microgrid typical scenario generation technology, and more specifically, to a method, apparatus and electronic device for generating typical microgrid scenarios. Background Technology
[0002] As the proportion of distributed photovoltaic (PV), flexible loads, and energy storage devices in microgrids continues to increase, the system's operating status exhibits greater randomness and volatility. PV output is significantly affected by irradiance, cloud cover, and weather changes, while load power changes rapidly due to user behavior and equipment start-up and shutdown. The quality of constructing typical operating scenarios directly impacts the reliability of voltage over-limit analysis, PV carrying capacity assessment, and the verification of energy storage and reactive power regulation strategies.
[0003] In actual operation analysis, microgrid dispatching, safety verification, and planning evaluation usually require a large number of representative scenario samples. If only a small number of historical typical days are used, it may be difficult to cover the operating states such as rapid ramp-up, short-term power fluctuations, continuous low output, and rapid load increases and decreases under high photovoltaic penetration conditions. If random disturbances are simply used, it is easy to destroy the continuity, peak-valley relationship, and time-period characteristics of the real intraday power curve.
[0004] Existing methods for constructing microgrid scenarios typically rely on historical sample screening, clustering on typical days, empirical settings, or generation through random perturbations. While these methods can extract a certain number of representative scenarios, they often struggle to simultaneously meet the requirements of sample coverage, accurate curve morphology, and controllable target conditions under critical operating conditions such as high photovoltaic fluctuations, low photovoltaic output, and rapid load disturbances. Especially for voltage-sensitive nodes and scenarios with high photovoltaic penetration, a small number of extreme samples are insufficient to support a comprehensive operational risk assessment. Summary of the Invention
[0005] In view of this, this application provides a method, apparatus and electronic device for generating typical microgrid scenarios.
[0006] One aspect of this application provides a method for generating typical microgrid scenarios, comprising: based on a received request for generating typical microgrid scenarios with the scenario type of the target scenario of the microgrid and the key indicator values of the target scenario as conditional information, applying a pre-trained conditional diffusion model to obtain a simulated intraday power curve under the target scenario; wherein the pre-trained conditional diffusion model is obtained by training the conditional diffusion model based on the actual intraday power curve of the microgrid containing the scenario type, date identifier, and key indicator values.
[0007] According to an embodiment of this application, the conditional diffusion model includes a forward denoising module and a denoising network; wherein, the forward denoising module is used to add noise to the real intraday power curve to obtain a noisy sample; the noisy sample is used to train the denoising network to obtain a trained denoising network; the pre-trained conditional diffusion model includes a trained denoising network and a feedback correction module; based on the microgrid typical scenario generation request, the trained denoising network is used to obtain an initial intraday power curve; based on the microgrid typical scenario generation request, the feedback correction module is used to correct the initial intraday power curve to obtain a simulated intraday power curve.
[0008] According to an embodiment of this application, the denoising network includes a U-Net, a multi-expert temporal denoising network, a conditional gating network, and a weighted fusion module. The U-Net is used to determine the shared feature vector of the input data. The multi-expert temporal denoising network is used to determine the target feature vector corresponding to the scenario type of the target scenario based on the typical microgrid scenario generation request and the shared features. The conditional gating network is used to determine the weight of the target feature vector based on the typical microgrid scenario generation request. The weighted fusion module is used to obtain the fused features based on the shared feature vector, the target feature vector, and the weights.
[0009] According to an embodiment of this application, when the above-mentioned scenario type includes a photovoltaic high-fluctuation scenario, the above-mentioned multi-expert temporal denoising network includes a photovoltaic high-fluctuation expert module; the above-mentioned photovoltaic high-fluctuation expert module includes a differential enhancement module and a dilated one-dimensional convolution; the above-mentioned differential enhancement module is connected to the above-mentioned U-Net; the above-mentioned differential enhancement module is used to enhance the above-mentioned shared feature vector according to the differential features included in the above-mentioned input data; the above-mentioned dilated one-dimensional convolution is connected to the above-mentioned differential enhancement module; the above-mentioned dilated one-dimensional convolution is used to determine the short-term fluctuation features of the above-mentioned input data according to the shared feature vector after feature enhancement, and use the above-mentioned short-term fluctuation features as the target feature vector corresponding to the above-mentioned photovoltaic high-fluctuation scenario.
[0010] According to an embodiment of this application, when the above-mentioned scenario type includes a low-output photovoltaic scenario, the above-mentioned multi-expert temporal denoising network includes a low-output photovoltaic expert module; the above-mentioned low-output photovoltaic expert module includes a long-window one-dimensional convolution and global energy pooling; the above-mentioned long-window one-dimensional convolution is connected to the above-mentioned U-Net; the above-mentioned long-window one-dimensional convolution is used to determine the low-frequency trend features of the above-mentioned input data; the above-mentioned global energy pooling is used to determine the energy features of the above-mentioned low-frequency trend features, and the above-mentioned energy features are used as the target feature vector corresponding to the above-mentioned low-output photovoltaic scenario.
[0011] According to an embodiment of this application, when the above-mentioned scenario type includes a rapid load disturbance scenario, the above-mentioned multi-expert temporal denoising network includes a rapid load disturbance expert module; the above-mentioned rapid load disturbance expert module includes multi-kernel local convolution, ramp feature calculation, and ramp gating; the above-mentioned multi-kernel local convolution is connected to the above-mentioned U-Net; the above-mentioned multi-kernel local convolution is used to extract multi-scale local features of the above-mentioned input data; the above-mentioned ramp feature calculation is connected to the above-mentioned multi-kernel local convolution; the above-mentioned ramp feature calculation is used to enhance the ramp features in the above-mentioned multi-scale local features; the above-mentioned ramp gating is connected to the above-mentioned ramp feature calculation; the above-mentioned ramp gating is used to extract abrupt disturbance features in the enhanced multi-scale local features, and use the abrupt disturbance features as the target feature vector corresponding to the above-mentioned rapid load disturbance scenario.
[0012] According to an embodiment of this application, the output of the above-mentioned conditional gating network is represented as follows: ; ;in, Here are the three soft-gating weights output by the multilayer perceptron, where MLP is the multilayer perceptron and e is the conditional embedding vector determined based on the conditional information. It is the Sigmoid activation function. For scene activation vectors, Indicates conditional embedding With scene activation vector The splicing result, This indicates element-wise multiplication. The final gating weights are those after the scene activation vectors have been masked.
[0013] According to an embodiment of this application, the above-described method for generating typical microgrid scenarios further includes: evaluating the trained conditional generation model using evaluation metrics, and using the trained conditional generation model that passes the evaluation as the pre-trained conditional generation model; wherein the evaluation metrics include at least one of the following: average daily curve error, target conditional index distribution difference, sample diversity, and conditional response consistency.
[0014] Another aspect of this application provides a typical microgrid scenario generation device, comprising: a target generation module, configured to, based on a received typical microgrid scenario generation request with the scenario type of the target scenario of the microgrid and the key indicator values of the target scenario as conditional information, apply a pre-trained conditional diffusion model to obtain a simulated intraday power curve under the target scenario; wherein the pre-trained conditional diffusion model is obtained by training the conditional diffusion model based on the actual intraday power curve of the microgrid containing the scenario type, date identifier, and key indicator values.
[0015] Another aspect of this application provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method described above.
[0016] According to the embodiments of this application, since the typical scenario generation request of the microgrid generates the corresponding simulated intraday power curve with the scenario type and key index value of the target scenario as conditional information, this application can generate typical scenarios around multiple key operating states of the microgrid, thereby improving the coverage of boundary states and special operating conditions of microgrid operation analysis. In addition, the batch generation of scenario samples that meet the conditional information improves the efficiency of typical scenario construction and reduces the problem of insufficient samples caused by simply relying on historical extreme samples. Attached Figure Description
[0017] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 An exemplary system architecture for generating typical microgrid scenarios, which can be applied to this application, is illustrated.
[0019] Figure 2 A flowchart illustrating a method for generating a typical microgrid scenario according to an embodiment of this application is shown.
[0020] Figure 3 A flowchart illustrating a typical microgrid scenario generation method based on a conditional diffusion model according to another embodiment of this application is shown.
[0021] Figure 4 A schematic diagram of the conditional diffusion generation model structure according to an embodiment of this application is shown.
[0022] Figure 5 The diagram illustrates a multi-expert temporal denoising network structure for continuous condition gating according to an embodiment of this application.
[0023] Figure 6 The illustration shows a schematic diagram of the construction of intraday power curve input features according to an embodiment of this application.
[0024] Figure 7 The illustration shows a schematic diagram of a differential enhancement and dilated one-dimensional convolution structure in a photovoltaic high-fluctuation expert according to an embodiment of this application.
[0025] Figure 8 A schematic diagram of a photovoltaic low-output expert structure according to an embodiment of this application is shown.
[0026] Figure 9 A schematic diagram of a load rapid disturbance expert structure according to an embodiment of this application is shown.
[0027] Figure 10 A block diagram of a typical microgrid scenario generation device according to an embodiment of this application is shown schematically.
[0028] Figure 11 A block diagram of an electronic device suitable for implementing a method for generating typical microgrid scenarios according to an embodiment of this application is shown schematically. Detailed Implementation
[0029] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0030] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0031] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0032] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0033] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0034] In the embodiments of this application, the user's authorization or consent was obtained before obtaining or collecting the user's personal information.
[0035] Existing technologies similar to this application include scenario construction methods based on historical typical days, representative day extraction methods based on clustering, and time-series scenario generation methods based on random perturbations. These methods typically first select or combine several representative curves from historical data and then use them for power flow calculations or operational assessments. These methods are simple to implement and highly interpretable, but the generated results are mainly limited by the number of historical samples and perturbation rules, making it difficult to perform targeted expansion according to given photovoltaic fluctuation intensity, given low power output level, or given load perturbation amplitude.
[0036] The diffusion model learns complex data distributions through a progressive noise addition and reverse denoising process, making it suitable for generating time-series scenarios with randomness and diversity. By embedding physically meaningful scenario indicators as conditional information into the diffusion generation process, typical microgrid scenarios that meet specified operating characteristics can be generated while maintaining the intraday power curve shape. This provides a richer sample base for subsequent voltage safety verification, photovoltaic carrying capacity analysis, and regulation resource allocation.
[0037] Therefore, it is necessary to propose a typical scenario generation method that takes into account physical index constraints, curve shape preservation, and scenario diversity, so that the generated results can not only reflect the statistical characteristics of real operating data, but also be extended in a targeted manner around the target operating conditions of concern in engineering analysis.
[0038] Figure 1 An exemplary system architecture for generating typical microgrid scenarios, to which the present application's method and apparatus for this application can be applied, is illustrated schematically. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this application, in order to help those skilled in the art understand the technical content of this application, but do not mean that the embodiments of this application cannot be used in other devices, systems, environments or scenarios.
[0039] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0040] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers, etc.
[0041] Server 105 can be a server that provides various services, such as a backend management server that supports the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests and feed the processing results back to the terminal devices.
[0042] It should be noted that the microgrid typical scenario generation method provided in this application embodiment can generally be executed by server 105. Correspondingly, the microgrid typical scenario generation device provided in this application embodiment can generally be located in server 105. The microgrid typical scenario generation method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the microgrid typical scenario generation device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Alternatively, the microgrid typical scenario generation method provided in this application embodiment can also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the microgrid typical scenario generation device provided in this application embodiment can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0044] Figure 2 A flowchart illustrating a method for generating a typical microgrid scenario according to an embodiment of this application is shown.
[0045] like Figure 2As shown, the method includes operation S201.
[0046] In operation S201, based on the received typical scenario generation request for microgrids with the scenario type and key indicator values of the target scenario as conditional information, a pre-trained conditional diffusion model is applied to obtain the simulated intraday power curve under the target scenario.
[0047] In the embodiments of this application, the pre-trained conditional diffusion model is obtained by training the conditional diffusion model based on the actual intraday power curve of the microgrid, which includes scene type, date identifier, and key indicator values.
[0048] To address the limited number of samples for various scenarios in historical data, such as high-fluctuation PV data, low-output PV data, and rapid load disturbance data, a generation method is constructed to expand the coverage of key operating scenarios. To address the difficulty of generating scenarios based on target operating conditions using traditional scenario screening or random disturbance methods, key indicator values are used as continuous conditions to guide the conditional generation model in generating intraday power curves that conform to specified characteristics. These key indicator values can include PV fluctuation intensity, daily power generation capacity, and load disturbance amplitude.
[0049] By using a conditional diffusion model to learn the distribution of measured samples, the generated results are made consistent with the real scenario in terms of average curve, key feature distribution, and sample diversity. This overcomes the problem that the generated scenario is prone to deviating from the real intraday curve shape. In addition, to address the lack of a unified evaluation of the generation quality in microgrid operation simulation, evaluation indicators oriented towards time series morphology, target condition response, key feature distribution, and diversity are established, providing a basis for the generation scenario to be incorporated into engineering analysis.
[0050] This application uses power curves within a complete natural day as basic samples and scene indicators with physical meaning as conditional information to generate typical microgrid scenarios that meet specified operating characteristics through a conditional diffusion model.
[0051] Figure 3 A flowchart illustrating a typical microgrid scenario generation method based on a conditional diffusion model according to another embodiment of this application is shown.
[0052] like Figure 3 As shown, the complete process of this application embodiment includes:
[0053] S1 Acquisition of measured data and construction of intraday samples; S2 Construction of scene indicators and continuous condition labels; S3 Construction of conditional diffusion generation model; S4 Multi-expert temporal denoising network and conditional gating; S5 Model training under composite loss constraints; S6 Target condition input and indicator feedback sampling; and S7 Evaluation and application analysis of generated scenes.
[0054] The above S1 to S7 form a closed-loop process from measured data to continuous condition construction, condition diffusion generation, quality screening, and engineering application analysis.
[0055] Regarding the acquisition of measured data and construction of intraday samples as described in step S1, measured operating data of the microgrid is acquired and organized into complete daily samples at fixed time intervals. For photovoltaic scenarios, active power output data of a single photovoltaic site is used; for scenarios with rapid load disturbances, load data of a single building is used. Each daily day contains 96 15-minute sampling points. After outlier handling, missing data verification, and normalization, intraday power curve samples are formed.
[0056] For any complete natural day, the intraday power curve sample can be expressed as Equation (1):
[0057] (1)
[0058] Among them, P d,i This represents the power value at the i-th sampling point on day d, where i takes values of 1, 2, ..., 96, X. d This represents the intraday power curve sample for day d.
[0059] During data processing, the calendar day was used as the basic organizational unit, maintaining the chronological order of sampling times within the same day. For photovoltaic data, curve characteristics such as daytime output ramp-up, peak, decline, and cloud shadow disturbances were preserved; for load data, time-period characteristics such as morning and evening peaks, equipment start-up and shutdown, and short-term load jumps were preserved. This processing method allows the subsequent conditional diffusion model to directly correspond to the daily operation process in engineering analysis.
[0060] The normalized version is used for model training and generation, while the actual power version is used for energy calculation, physical boundary verification, and engineering interpretation. Both versions maintain consistent date indices and sampling times, ensuring that the generated results can be consistently converted to the true power scale.
[0061] After normalization, a corresponding scene type, date identifier, and key indicator value are established for each intraday sample. Normalization curves are used during model training to improve numerical stability. Before the generated results are used for electrical calculations or energy analysis, they are restored to the actual power range using the same normalization parameters, thus ensuring consistency between the model's generated results and engineering applications.
[0062] Regarding the construction of scenario indicators and continuous condition labels as described in step S2, typical scenario indicators are constructed based on the microgrid operation analysis requirements, and the indicator values are used as condition information. For high-fluctuation photovoltaic scenarios, the photovoltaic fluctuation index is obtained by accumulating the power change amplitudes of adjacent moments within a day, which is used to characterize short-term power fluctuations caused by cloud cover or rapid changes in irradiance. For low-output photovoltaic scenarios, the daily equivalent power generation hours or daily power generation index is used to characterize the output-limited state under continuous cloudy, rainy, or low-irradiance conditions. For rapid load disturbance scenarios, the maximum value of the load change amplitude within adjacent 15 minutes is used to characterize the operational disturbances caused by rapid increases and decreases in building load.
[0063] The above indicators are all calculated from actual power curves and have clear physical meanings. The photovoltaic fluctuation index reflects the intensity of short-term power output changes within the day and can correspond to the risk of rapid voltage changes at the photovoltaic grid connection point; the photovoltaic low output index reflects the degree of decline in renewable energy supply capacity and can correspond to the needs of power supply gaps, energy storage support, and photovoltaic carrying capacity assessment; the load rapid disturbance index reflects the magnitude of short-term power changes on the load side and can correspond to power balance and voltage regulation pressures.
[0064] The photovoltaic fluctuation index, photovoltaic low output index, and load rapid disturbance index are calculated according to equations (2) to (4), respectively:
[0065] (2)
[0066] (3)
[0067] (4)
[0068] in, t represents the natural day number, and t represents the sampling time number within 15 minutes of the day, ranging from 1 to 96; For the first Photovoltaic active power at time t on a given day This refers to the rated capacity of the photovoltaic site or a capacity proxy value determined based on historical non-negative power. This is the intraday photovoltaic volatility index after capacity normalization; For the first The daily photovoltaic power generation, with a coefficient of 0.25, means that 15 minutes is converted to 0.25 hours. When using the unit capacity normalized value, Corresponding daily equivalent power generation hours; For the first The active power of the load at time t on a given day This represents the maximum load change amplitude over the 15-minute period of the day; the absolute value symbol indicates the amplitude of power change at adjacent times, and max indicates the maximum value taken from the 2nd to the 96th sampling time.
[0069] During the sample selection process, thresholds such as high volatility, extreme volatility, low output, extremely low output, and rapid disturbances are set based on the indicator distribution. These thresholds are used both to identify real-world typical scenarios and as target conditions for the generated model, enabling the model to generate new intraday curve samples around a specified operating intensity.
[0070] Condition labels use continuous numerical values instead of just discrete categories. Continuous conditions can express operating states of varying intensities, enabling the model to generate not only samples indicating whether a scenario belongs to a certain category, but also samples that approximate a given fluctuation intensity, a given power generation level, or a given disturbance amplitude, thereby improving the adjustability of scenario generation.
[0071] Regarding the construction of the conditional diffusion generation model described in step S3, the model uses the complete natural daily power curve as the learning object, and the diffusion time step, continuous target conditions, and scene activation vectors as conditional information. During the training phase, Gaussian noise is progressively added to the real samples through forward diffusion, and a conditional denoising network is used to learn the reverse process of recovering the real curve from noisy samples. In the generation phase, Gaussian noise is initialized, and denoising is progressively performed under the guidance of target conditions and scene activation vectors. Integrating index feedback correction, an intraday power curve that satisfies the characteristics of the target scene is generated. The following section uses... Figure 4 Taking an example, the structure of the conditional diffusion generation model in this application embodiment will be described.
[0072] like Figure 4 As shown, the conditional diffusion model includes a forward denoising module and a denoising network. The forward denoising module adds noise to the real intraday power curve to obtain a noisy sample. The noisy sample is then used to train the denoising network, resulting in a trained denoising network. The pre-trained conditional diffusion model includes the trained denoising network and a feedback correction module. Based on a typical microgrid scenario, a request is generated, and the trained denoising network is applied to obtain an initial intraday power curve. Finally, based on the same request, the feedback correction module is applied to correct the initial intraday power curve, resulting in a simulated intraday power curve.
[0073] Furthermore, the conditional diffusion generation model consists of forward diffusion, conditional encoding, multi-expert temporal denoising, backsampling denoising, and scene index feedback correction. During the training phase, the real intraday power curve is forward diffused to obtain noisy samples. The diffusion time step, continuous target conditions, and scene activation vectors are conditionally encoded and input into the denoising network to predict noise and form training constraints. In the generation phase, starting from Gaussian noise, backsampling is performed under the guidance of target conditions and scene activation vectors, and feedback correction is performed based on scene index deviations to obtain intraday power curves that satisfy the target operating characteristics.
[0074] The forward diffusion process and the noisy sample at any diffusion step can be expressed as Equation (5) and Equation (6), respectively:
[0075] (5)
[0076] (6)
[0077] in, Forward diffusion, the conditional probability distribution is... and These are the noisy samples at step τ and step (τ-1), respectively. This represents the actual intraday power curve; τ is the diffusion time step. The noise variance added at step τ, It is the identity matrix. Indicates a Gaussian distribution; The retained coefficients of the signal at step τ satisfy the following condition: , The signal retention coefficients from step 1 to step n The result of the cumulative product, It is random noise that follows a standard Gaussian distribution.
[0078] The continuous target conditions are used to describe the intensity of photovoltaic fluctuations, low photovoltaic output levels, or the amplitude of rapid load disturbances, while the scene activation vectors are used to describe the activation relationship of single or joint scenes. The conditional encoding results are used both to modulate the features of the denoising network and to control the activation and fusion intensity of experts in the subsequent multi-expert temporal denoising network, enabling the model to converge towards the target scene index while restoring the curve shape.
[0079] Regarding the multi-expert temporal denoising network and conditional gating described in step S4, the multi-expert temporal denoising network is based on the shared temporal characteristics of the intraday power curve, and scene expert modules are set up for high photovoltaic fluctuations, low photovoltaic output, and rapid load disturbances. The diffusion time step, continuous target conditions, and scene activation vectors together form a conditional embedding, which is used to control the expert activation state and feature fusion intensity.
[0080] The multi-expert temporal denoising network comprises a shared input backbone, a scene expert module, and an output module. The shared input backbone is used to extract the basic shape of the intraday power curve, and the scene expert module is used to extract target feature vectors corresponding to various typical scenarios.
[0081] Furthermore, scene activation vectors are used to describe the combination relationships of target scenes. When only a single scene is generated, the corresponding expert is activated, meaning the scene activation vector can activate a single expert individually; when generating a joint scene, multiple experts are activated simultaneously, meaning scene activation vectors can also be combined to form a joint scene, enabling the reverse denoising process to simultaneously satisfy multiple scene metric constraints. The following example... Figure 5 Taking an example, the multi-expert temporal denoising network structure of continuous condition gating in this application embodiment will be described.
[0082] like Figure 5 As shown, the denoising network includes U-Net, a multi-expert temporal denoising network, a conditional gating network, and a weighted fusion module. U-Net is used to determine the shared feature vector of the input data. The multi-expert temporal denoising network is used to generate requests based on typical microgrid scenarios and the shared feature vector to determine the target feature vector corresponding to the scenario type of the target scenario. The conditional gating network is used to generate requests based on typical microgrid scenarios and determine the weights of the target feature vector. The weighted fusion module is used to obtain the fused features based on the shared feature vector, the target feature vector, and the weights.
[0083] Furthermore, the conditional diffusion generation model employs a network structure with parallel input of data streams and conditional streams. The data stream includes noisy intraday power curves. Valid mask Intraday location code Difference characteristics and object / time period encoding The data is stitched together, and shared features are extracted through an input projection layer and a multi-scale one-dimensional U-Net. Conditional flow will diffuse time step t, continuous target conditions. and scene activation vector Input conditional encoder to obtain conditional embedding Among them, continuous target conditions Used to characterize the target photovoltaic fluctuation index, daily equivalent power generation hours, or maximum 15-minute load change amplitude, scenario activation vector. This is used to indicate the activation status of experts in each scene. This continuous condition setting can express different intensities of operating status, rather than just representing discrete scene categories. The outputs of the multi-expert temporal denoising network are fed into the weighted fusion module; the conditional gating network outputs gating weights based on conditional embeddings and scene activation vectors, and the gating weights are then fed into the weighted fusion module to complete the fusion by multiplying them with the corresponding expert features.
[0084] like Figure 6 As shown, Generated from missing data flags and quality check results before data cleaning: 1 is used when the power value at the corresponding time point is valid, and 0 is used when it is missing, out of bounds, or cannot be checked; invalid positions are filled with 0 after normalization, and are used in feature extraction and masked loss calculation. shield. Using fixed sine and cosine functions to encode the intraday time sequence numbers from 1 to 96, the network can distinguish the location of time periods such as night, rise, peak, and fall. The noise power is obtained by subtracting the noise power of adjacent time points, where the first time point is set to 0, and the noise power of the previous time point is subtracted from the current noise power for the remaining time points. The features are obtained by adding the object identifier and the preset time period identifier after mapping them through a trainable embedding table, and then arranged along 96 time points. The above features are related to... After aligning channels according to their time positions, a 1×1 one-dimensional convolution is performed to unify the input projection and dimensions. Effective mask M, intra-day position code P, and differential features are used. and object / time period encoding These four types of auxiliary features are all aligned with the noisy power curve at 96 time points and are jointly input into a shared feature vector to extract the backbone.
[0085] In scenarios involving high fluctuations in photovoltaic (PV) data, the multi-expert temporal denoising network includes a PV high fluctuation expert module. This module comprises a differential enhancement module and a dilated one-dimensional convolution. The differential enhancement module is connected to U-Net. It enhances the shared feature vector based on the differential features of the input data. The dilated one-dimensional convolution is connected to the differential enhancement module. It determines the short-term fluctuation features of the input data based on the enhanced shared feature vector and uses these short-term fluctuation features as the target feature vector corresponding to the PV high fluctuation scenario.
[0086] When the scenario type includes low-output photovoltaic scenarios, the multi-expert temporal denoising network includes a low-output photovoltaic expert module. The low-output photovoltaic expert module includes long-window one-dimensional convolution and global energy pooling. The long-window one-dimensional convolution is connected to U-Net. The long-window one-dimensional convolution is used to determine the low-frequency trend features of the input data. The global energy pooling is used to determine the energy features of the low-frequency trend features and uses the energy features as the target feature vector corresponding to the low-output photovoltaic scenario.
[0087] In scenarios involving rapid load disturbances, the multi-expert temporal denoising network includes a rapid load disturbance expert module. This module comprises multi-kernel local convolution, ramp feature computation, and ramp gating. The multi-kernel local convolution is connected to U-Net. It extracts multi-scale local features from the input data. Ramp feature computation is connected to the multi-kernel local convolution, enhancing ramp features within the multi-scale local features. Ramp gating is connected to ramp feature computation, extracting abrupt disturbance features from the enhanced multi-scale local features and using these abrupt disturbance features as the target feature vector corresponding to the rapid load disturbance scenario.
[0088] Specifically, the multi-expert time-series denoising network includes a photovoltaic high-fluctuation expert, a photovoltaic low-output expert, and a load rapid disturbance expert. The photovoltaic high-fluctuation expert... , and As input, differential augmentation and dilated one-dimensional convolution are used to extract short-term fluctuation features, and the output is... Photovoltaic low-output experts and As input, long-window one-dimensional convolution and global energy pooling are used to extract low-frequency trends and energy features, and the output is... ; Load rapid disturbance experts , and As input, multi-kernel local convolution and ramp gating are used to extract abrupt perturbation features, and the output is... The aforementioned expert modules are configured in parallel to extract specific timing features for different typical microgrid scenarios.
[0089] To further illustrate the internal structure of the three scenario experts, Figures 7 to 9 The structures of the photovoltaic high fluctuation expert, the photovoltaic low output expert, and the load rapid disturbance expert are shown respectively.
[0090] like Figure 7 As shown, photovoltaic high volatility experts first... After 1×1 one-dimensional convolution projection, After being mapped by two layers of multilayer perceptrons, the data is broadcast along 96 time points, and then compared with... Channel concatenation is performed, followed by 1×1 one-dimensional convolution to obtain differential enhancement features. Subsequently, three parallel dilated one-dimensional convolution branches are set up, each with a kernel length of 3 and dilation rates of 1, 2, and 4 respectively; each branch performs one-dimensional convolution, normalization, and SiLU activation sequentially. The outputs of the three branches are then fused through channel concatenation and a 1×1 one-dimensional convolution. Adding the residuals, we get This structure covers power variations over nearby, medium, and longer time ranges, and is used to enhance the characteristics of adjacent 15-minute fluctuations and continuous cloud shadow disturbances.
[0091] The differential enhancement module consists of a differential projection branch, a conditional mapping branch, a channel stitching layer, an enhancement projection layer, and residual connections. The differential projection branch uses 1×1 one-dimensional convolutions to perform channel mapping on the differential features, that is, it maps the differential features to channels... The 1×1 one-dimensional convolution maps to the same number of channels as the shared features; the conditional mapping branch uses a two-layer multilayer perceptron to map the conditional embeddings and broadcasts them along the intraday sampling times, that is, ... Conditional features are obtained by sequentially passing through two fully connected layers and SiLU activation, and then replicated along 96 intraday sampling times. Subsequently, a channel stitching layer stitches the shared feature vector, the mapped differential features, and the broadcast conditional features together, effectively concatenating them. The mapped difference features and conditional features are concatenated along the channel dimension, and feature compression is achieved through 1×1 one-dimensional convolution, normalization, and SiLU activation in the enhanced projection layer. Finally, they are combined with the shared feature vector. The residuals are added together to form the difference enhancement feature. This structure allows power changes at adjacent time steps to directly participate in shared feature updates.
[0092] The dilated one-dimensional convolution module consists of three parallel convolutional branches, a branch concatenation layer, a fusion projection layer, and residual connections. The kernels of the three parallel convolutional branches all use one-dimensional convolutions with a length of 3 and a stride of 1, with dilation rates set to 1, 2, and 4 respectively. A constant-length padding method is used to maintain the same time duration, ensuring that their effective receptive range covers 3, 5, and 9 sampling times respectively. Each branch is sequentially configured with one-dimensional convolution, normalization, and SiLU activation. The outputs of the three branches are concatenated along the channel dimension, fused using a 1×1 one-dimensional convolution, and then integrated with... The residuals are summed to obtain the high-fluctuation photovoltaic expert output. This refers to the target feature vector corresponding to the high volatility scenario of photovoltaics. This allows for the simultaneous retention of single-step fluctuations, continuous fluctuations, and fluctuation information over a longer time period.
[0093] like Figure 8 As shown, photovoltaic low-output experts will The parameters are mapped to channel-wise scaling and bias parameters through two layers of multilayer perceptron. Conditional modulation is performed to obtain The modulated features were input into three long-window one-dimensional convolution branches with kernel lengths of 7, 15, and 31, respectively. Each branch used a stride of 1 and equal-length padding, and then sequentially performed one-dimensional convolution, normalization, and SiLU activation. Simultaneously, for... Global averaging or summation pooling is performed over 96 time points to obtain a global feature representing the energy level throughout the day. This global feature is then activated by a fully connected layer and a sigmoid function to form energy-gated weights. The three convolutional branches are concatenated and compressed using 1×1 one-dimensional convolutions, and then adjusted channel-by-channel by the energy-gated weights before being combined with... Adding the residuals, we get .
[0094] like Figure 9 As shown, the load rapid disturbance expert will Three local one-dimensional convolutional branches with kernel lengths of 3, 5, and 7 are input respectively. Each branch uses a stride of 1 and equal-length padding. The branch outputs are concatenated and subjected to a 1×1 one-dimensional convolution to obtain multi-scale local features. At the same time, The climbing features are obtained by concatenating the channels and their absolute values and performing a 1×1 one-dimensional convolution. Then will , and broadcast along the time dimension The concatenation is followed by 1×1 one-dimensional convolution and sigmoid activation to obtain the climbing gating. ;by right Position-wise weighting, and with Adding the residuals, we get Multi-core local convolution covers load abrupt changes of different durations, and ramp gating selectively amplifies disturbance periods based on differential amplitude. This structure is used to selectively amplify local disturbances corresponding to equipment start-up, shutdown, or energy consumption behavior abrupt changes while maintaining the load baseline.
[0095] In terms of connectivity, the outputs of the photovoltaic high-fluctuation expert, the photovoltaic low-output expert, and the load rapid disturbance expert are all input to the weighted fusion module; the conditional gating network does not use expert characteristics as input, but only bases its input on the characteristics of the experts. and Output three gate weights , and The three gate weights and their corresponding expert features are input into the weighted fusion module, which then performs weighted fusion of the expert features and adds them to the shared features. Therefore, Figure 5 The expert feature pathway and the gated weight pathway should be understood as converging at the weighted fusion module.
[0096] Conditional gating networks embed based on conditions and scene activation vector The gating weights for each expert are generated. Specifically, the conditional gating network includes a multilayer perceptron and a sigmoid gating layer, and its output can be represented as:
[0097] (7)
[0098] (8)
[0099] in, Here are the three soft-gating weights output by the multilayer perceptron, where MLP is the multilayer perceptron and e is the conditional embedding vector determined based on the conditional information. It is the Sigmoid activation function. For scene activation vectors, Indicates conditional embedding With scene activation vector The splicing result, This indicates element-wise multiplication. The final gating weights are those after the scene activation vectors have been masked. , , and These correspond to the final gating weights for photovoltaic high-fluctuation experts, photovoltaic low-output experts, and load rapid disturbance experts, respectively. , , and These correspond to the activation values for photovoltaic high fluctuation experts, photovoltaic low output experts, and load rapid disturbance experts, respectively. ,in, The final gating weight is the value corresponding to the k-th scene expert. The soft gating weights are the output weights of the multilayer perceptron corresponding to the k-th scene expert. Let be the activation value of the k-th scene expert. At that time, the corresponding expert was blocked; when multiple At the same time, multiple experts participate in reverse denoising to support joint scene generation.
[0100] The weighted fusion module merges shared features and features from each expert into:
[0101] (9)
[0102] Fusion features Input noise prediction head, output predicted noise It is used for reverse denoising sampling; simultaneously, it inputs the indicator prediction head and outputs the predicted values of key indicators. This is used for continuous condition consistency constraints during the training phase. Through this structure, the model can adaptively activate different scenario experts based on target conditions while maintaining the basic shape of the intraday power curve, and generate typical microgrid scenarios that meet specified photovoltaic fluctuation intensity, low output levels, or load disturbance amplitudes.
[0103] For model training under the composite loss constraint described in step S5, during training, the actual intraday power curve is used. Adding Gaussian noise to obtain noisy samples And the diffusion time step t, continuous target conditions and scene activation vector Input a multi-expert temporal denoising network to predict noise. The model training objectives include masked noise prediction loss, continuous conditional consistency loss, and scene feature constraint loss:
[0104] (10)
[0105] in, The loss is defined as the masked noise prediction loss, where B is the number of samples in a training batch, b is the sample ID within the batch, and t is the sampling time number within the day. Let be the effective mask value of the b-th sample at time t; The Gaussian noise actually added for forward diffusion. The noise predicted by the multi-expert time-series denoising network. This represents the squared L2 norm; the denominator is the total number of valid sampling points in the current training batch, used to avoid missing locations from participating in the loss calculation.
[0106] (11)
[0107] in, Used to constrain the consistency between predicted noise and actual noise; Key metrics used to constrain the output of the predictor head Continuity condition with the target Consistent; This is used to constrain the generated curve to be consistent with the real sample in terms of scenario characteristics such as short-term fluctuations, all-day energy levels, or local upslopes.
[0108] The loss of continuous conditional consistency can be expressed as:
[0109] (12)
[0110] in, Let be the activation value of the b-th sample for the k-th type of scene expert. For smoothing loss function, The predicted values of the scenario indicators output by the indicator prediction head. The target is a continuous condition. This loss is used to constrain only the indicators corresponding to the currently activated scenario, enabling the model to learn in a targeted manner based on the target photovoltaic fluctuation index, daily equivalent power generation hours, or the maximum 15-minute load change amplitude.
[0111] The scene feature constraint loss can be expressed as:
[0112] (13)
[0113] in, Let be the feature function corresponding to the k-th scenario. This represents the estimated clean intraday power curve for the b-th sample; This represents the actual intraday power curve corresponding to the b-th sample; for high-fluctuation photovoltaic scenarios, This indicates short-term fluctuation characteristics; for low-output photovoltaic scenarios, This indicates intraday energy or low-frequency trend characteristics; for scenarios with rapid load disturbances, This indicates the characteristics of local uphill climbs or changes at the maximum adjacent time.
[0114] According to an embodiment of this application, the method for generating typical microgrid scenarios further includes: evaluating the trained conditional generation model using evaluation metrics, and using the trained conditional generation model that passes the evaluation as the pre-trained conditional generation model; wherein the evaluation metrics include at least one of the following: average daily curve error, target conditional index distribution difference, sample diversity, and conditional response consistency.
[0115] After training, the target continuity condition and scene activation vector are input, samples are initialized from standard Gaussian noise, and a backsampling process is used to generate intraday power curves. To enhance the constraint of the target condition on the generated results, this application introduces scene index feedback correction in each backsampling step. Specifically, in the t-th denoising step, the current clean sample estimate is obtained based on the noise prediction result. And calculate its scenario metrics. Then, based on the continuity condition of this indicator and the target... Bias-corrected sample estimation:
[0116] (14)
[0117] in, This is for the conditionally guided correction of the sample estimate. Let be the correction step size for the t-th denoising step. This is a function for calculating scenario-specific indicators. For scenarios with high photovoltaic fluctuations, This refers to the photovoltaic fluctuation index; for low-output photovoltaic scenarios, This is the equivalent daily power generation hours; for scenarios with rapid load disturbances... This represents the maximum load change amplitude over a 15-minute period.
[0118] Corrected This is used for subsequent reverse updates until the final intraday power curve is obtained. Through the training loss and sampling stage index feedback correction mentioned above, the generation process not only relies on conditional embedding to implicitly adjust the network features, but also explicitly reduces the deviation between the generated curve and the target scene index at each reverse denoising step, thereby improving the conditional controllability of photovoltaic high fluctuation, photovoltaic low output and rapid load disturbance scenarios.
[0119] After completing the target condition input and indicator feedback sampling as described in step S6, the generated scenarios are evaluated and screened for quality. Evaluation indicators include average daily curve error, target condition indicator distribution difference, sample diversity, and condition response consistency. Specifically, average daily curve error measures the degree of similarity between the generated curve and the actual curve in terms of intraday morphology; target condition indicator distribution difference measures whether the generated samples cover the specified operational characteristics; sample diversity measures whether the generated results have a sufficient range of variation; and condition response consistency measures whether the generated results exhibit a reasonable trend as the target conditions change.
[0120] After the above evaluation, the generation scenario that meets the target operating characteristics and has a reasonable curve shape is selected as the input scenario for microgrid voltage over-limit analysis, photovoltaic carrying capacity assessment, energy storage support demand analysis and regulation strategy verification.
[0121] For the generated scenario evaluation and application analysis described in step S7, the generated scenario that passes the evaluation will be output as an intraday power curve that can be directly used for microgrid operation simulation. For the photovoltaic scenario, the output curve can be used as the active power output input of the photovoltaic grid connection point to analyze the impact of photovoltaic fluctuations on node voltage, inverter regulation requirements, and photovoltaic carrying capacity; for the rapid load disturbance scenario, the output curve can be used as the building load input to analyze the impact of rapid load changes on power balance, voltage level, and regulation resource response.
[0122] The generated scenarios can be used independently for typical operating condition analysis, or combined with power flow calculation, time series simulation, energy storage scheduling, or reactive power optimization modules to form a complete process from scenario generation to engineering application analysis. By generating scenarios in batches under different target conditions, more comprehensive boundary condition samples can be provided for microgrid planning and operation.
[0123] The embodiments of this application embed the photovoltaic fluctuation index, daily equivalent power generation hours, and maximum 15-minute load change amplitude as continuous target conditions into the diffusion generation process, enabling the model to generate photovoltaic high fluctuation, photovoltaic low output, and load rapid disturbance scenarios and their combinations according to specified operating intensities. The embodiments of this application construct a multi-expert temporal denoising network with continuous condition gating, controlling the activation status of photovoltaic high fluctuation experts, photovoltaic low output experts, and load rapid disturbance experts through scenario activation vectors, and supporting multiple experts to jointly participate in scenario generation. During the training phase, noise prediction loss, continuous condition consistency loss, and scenario feature constraint loss are introduced. During the sampling phase, scenario index feedback correction is further adopted to ensure that the generated curves maintain consistency in intraday shape, key indicators, and target condition responses. Finally, an evaluation process oriented towards average curves, key feature distribution, sample diversity, and condition response consistency is established, enabling the generated scenarios to support engineering applications such as voltage over-limit analysis, photovoltaic carrying capacity assessment, and resource allocation regulation.
[0124] This application can generate typical scenarios around key operating states such as high photovoltaic fluctuations, low photovoltaic output, and rapid load disturbances, improving the microgrid operation analysis's coverage of boundary states and special operating conditions. By using scenario indicators with clear physical meanings as conditional information, the generation process is controllable. It can generate corresponding intraday curves based on target fluctuation intensity, target power generation capacity, or target load disturbance amplitude. The generated results maintain the overall shape and local variation characteristics of the real intraday power curve, and can be used to analyze the impact of short-term photovoltaic fluctuations, insufficient output due to low irradiance, and rapid load changes on node voltage and regulation resource requirements.
[0125] In the embodiments of this application, the same generation framework can be adapted to both photovoltaic power output and load power, and can be extended to other microgrid operation scenarios by changing the condition indicators, thus exhibiting strong versatility and scalability. After adopting an accelerated sampling strategy, this application enables the model to generate scenario samples that meet the target conditions in batches, improving the efficiency of constructing typical scenarios and reducing the problem of insufficient samples caused by solely relying on historical extreme samples.
[0126] In typical experiments, the average daily curve error for the high-fluctuation photovoltaic scenario was 0.0206, and the key feature distribution distance was 0.1506; the average daily curve error for the low-output photovoltaic scenario was 0.0169, and the key feature distribution distance was 0.2166; and the average daily curve error for the rapid load disturbance scenario was 0.0311, and the key feature distribution distance was 0.0083. These results indicate that the generated scenarios can effectively maintain the temporal pattern and key feature distribution of the real scenarios.
[0127] The generated samples in this application can supplement the insufficient coverage of historical samples while maintaining the statistical characteristics of the real curves, providing richer input conditions for voltage over-limit prediction, photovoltaic absorption boundary assessment, energy storage capacity verification, and regulation strategy comparison. Furthermore, because the condition information is in the form of continuous indicators, this application can generate scenario samples of different levels according to the target operating intensity, facilitating continuous sensitivity analysis from general operating conditions to extreme operating conditions.
[0128] The following sections provide a more detailed explanation of the microgrid typical scenario generation method of this application through specific implementation examples of photovoltaic high fluctuation scenario generation, photovoltaic low output scenario generation, and load rapid disturbance scenario generation.
[0129] For generating high-fluctuation photovoltaic (PV) scenarios: Daily output data from a PV site was selected, and a 96-point power curve sample was constructed based on natural days. The PV fluctuation index was calculated. High-fluctuation and extreme-fluctuation samples were selected based on the fluctuation index distribution, and the fluctuation index was used as the model input. The model employed 100-step diffusion training and 20-step DDIM sampling to generate 64 daily PV output scenarios that met the high-fluctuation conditions. The generated results maintained consistency with the real samples in terms of average daily curves and key fluctuation feature distributions, and can be used to analyze the risk of voltage exceeding limits caused by short-term cloud shadowing or rapid changes in irradiance.
[0130] In this embodiment, a larger photovoltaic fluctuation index indicates more drastic power output changes between adjacent sampling times within a day. By using this index as a continuous condition, the model can generate photovoltaic power output curves under different target fluctuation levels. The generated curves retain the basic intraday pattern of morning rise, high output at noon, and evening fall, while also reflecting rapid fluctuations in local periods, making them suitable for analyzing rapid changes in photovoltaic grid-connected voltage and inverter regulation pressure.
[0131] During implementation, the training set, validation set, test set, and external samples were divided by date, and the model rounds were selected using validation loss. The average daily curve error of the generated samples was 0.0206, and the distribution distance of the photovoltaic fluctuation index was 0.1506, indicating that the generated samples can well reproduce the average shape and key fluctuation characteristics of the measured high-voltage fluctuation scenario.
[0132] For low-output photovoltaic (PV) scenarios, the following approach is used: Daily output data from the same PV site is selected, and the daily equivalent power generation hours or daily power generation index is calculated. Low-output and extremely low-output samples are then selected based on the index distribution. The low-output index is used as conditional information input into a diffusion model to generate a daily PV curve that meets the target low-output level. The generated results reflect the operating status of PV output limitations under continuous cloud cover, rainfall, or low irradiance conditions, and can be used to analyze power supply gaps, changes in PV carrying capacity, and energy storage support requirements.
[0133] In this embodiment, the low output index reflects the effective power generation capacity of the photovoltaic power station within a day. The lower the target conditions, the lower the overall output level and midday peak of the generated curve. Unlike simply scaling the curve, the conditional diffusion model can learn the curve shape of a real low-irradiance day, so that the generated result simultaneously has a low power generation level and a reasonable intraday variation process.
[0134] In practice, the model also employed 100-step diffusion training and 20-step DDIM sampling to generate 64 intraday photovoltaic scenarios that met the low-output target. The average daily curve error of the generated samples was 0.0169, the distribution distance of the key low-output features was 0.2166, and the conditional response correlation was 0.9814, indicating that the generated results could exhibit a stable response as the target low-output conditions changed.
[0135] For generating load disturbance scenarios: Mandeville building load data was selected, and a 96-point load curve sample was constructed based on natural days. The maximum value of the load change amplitude within adjacent 15 minutes was calculated. Rapid disturbance samples were selected based on a disturbance index, which was then used as conditional information input into the diffusion model. The generated results can reflect the typical disturbance process caused by rapid rises and falls in building load and can be used to analyze the impact of load abrupt changes on microgrid voltage levels, power balance, and regulation resource response.
[0136] In this embodiment, the rapid load disturbance index is used to characterize the most significant short-term load changes within a day. This index can reflect phenomena such as the start-up and shutdown of high-power equipment, concentrated changes in building energy consumption behavior, or rapid shifts in local loads. The load curve generated by the conditional diffusion model can present short-term disturbances of a specified intensity while maintaining the intraday load baseline and peak-valley characteristics.
[0137] During implementation, load samples were divided into training, validation, test, and external samples according to date, using the same model training and sampling process as the photovoltaic scenario. The average daily curve error of the generated samples was 0.0311, the target condition distribution distance was 0.0083, and the condition response correlation was 0.9760, indicating that the method also has good condition control capability and curve shape preservation capability under rapid load disturbance scenarios.
[0138] The generated scenarios of high photovoltaic fluctuations, low photovoltaic output, and rapid load disturbances are input into the microgrid time-series power flow or operation simulation model, respectively, to obtain operational results such as node voltage, line power flow, energy storage charging and discharging power, and inverter regulation. By comparing the simulation results under different target conditions, operating states that are more likely to cause voltage exceedances or insufficient regulation resources can be identified, providing a basis for photovoltaic capacity assessment and operation control strategy formulation, thus achieving the goal of using the generated scenarios for engineering application analysis.
[0139] Without departing from the core ideas of this application, typical scenario indicators can be replaced or expanded according to application requirements. For example, photovoltaic scenarios can use indicators such as ramp rate, daily peak value, duration of low output, or net load pressure, while load scenarios can use indicators such as peak-to-valley difference, load ramp rate, event duration, or peak load level.
[0140] Regarding the model structure, the denoising network in this application refers to a holistic multi-expert temporal denoising network composed of a shared input backbone, three parallel scene experts, a conditional gating fusion module, and an output module. In alternative implementations of the denoising network, the shared input backbone and each scene expert can employ a one-dimensional convolutional network, a recurrent neural network, a Transformer self-attention structure, or a combination thereof. The outputs of each expert are still input into the weighted fusion module along with the gating weights generated by the conditional gating network to maintain the conditional control relationship between single and joint scenes. Regarding the sampling method, denoising diffusion probabilistic models (DDPM), DDIM, or other accelerated sampling methods can be used. Regarding the application targets, this method can be extended to other microgrid sites, distributed photovoltaic clusters, building loads, energy storage power, or net load scenarios.
[0141] Regarding the data time scale, the intraday sampling interval can be adjusted to 5 min, 10 min, 15 min, 30 min, or 1 h depending on the measured data conditions. Correspondingly, the length of the model input curve varies with the number of sampling points, and the condition indicators can still be calculated according to changes in adjacent time periods, intraday energy, or disturbance amplitude. The core of this application lies in using physical indicators to guide the diffusion generation process, and is not limited to a specific sampling frequency.
[0142] Regarding the setting of conditions, this application can use a single scenario indicator for generation, or it can use multiple indicators to jointly constrain the generation process. For example, it can simultaneously constrain the intensity of photovoltaic fluctuations and daily power generation, or simultaneously constrain the load disturbance amplitude and peak load level. The above alternative solutions are all equivalent implementations under the technical concept of this application.
[0143] In engineering applications, the generated results can be combined with different electrical analysis modules, including but not limited to power flow calculation, probabilistic voltage limit assessment, photovoltaic carrying capacity calculation, energy storage capacity configuration, reactive power optimization, and demand response analysis. Any application of the technical solution presented in this application can be considered as using the scenario-guided diffusion model to generate the intraday power curve of the microgrid and applying it to operational analysis or planning evaluation.
[0144] Figure 10 A block diagram of a typical microgrid scenario generation device according to an embodiment of this application is shown schematically.
[0145] like Figure 10 As shown, the microgrid typical scenario generation device 1000 includes a target generation module 1010.
[0146] The target generation module 1010 is used to generate a typical microgrid scenario based on a received request that includes the scenario type and key indicator values of the target scenario. It then applies a pre-trained conditional diffusion model to obtain a simulated intraday power curve for the target scenario. The pre-trained conditional diffusion model is trained using the actual intraday power curve of the microgrid, which includes the scenario type, date identifier, and key indicator values.
[0147] Any one or more of the modules, submodules, units, and subunits according to the embodiments of this application, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to the embodiments of this application can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to the embodiments of this application can be at least partially implemented as hardware circuits, such as field-programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits (ASICs), or implemented by hardware or firmware in any other reasonable manner by integrating or packaging circuits, or implemented in any one of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, one or more of the modules, submodules, units, and subunits according to the embodiments of this application can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.
[0148] For example, the target generation module 1010 may be implemented in a single module / unit / subunit, or any one of these modules / units / subunits may be divided into multiple modules / units / subunits. Alternatively, at least some of the functionality of one or more of these modules / units / subunits may be combined with at least some of the functionality of other modules / units / subunits and implemented in a single module / unit / subunit. According to embodiments of this application, the target generation module 1010 may be at least partially implemented as a hardware circuit, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, the target generation module 1010 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0149] It should be noted that the microgrid typical scene generation device part in the embodiments of this application corresponds to the microgrid typical scene generation method part in the embodiments of this application. For a detailed description of the microgrid typical scene generation device part, please refer to the microgrid typical scene generation method part, which will not be repeated here.
[0150] Figure 11 A block diagram of an electronic device suitable for implementing a method for generating typical microgrid scenarios according to an embodiment of this application is shown schematically. Figure 11 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0151] like Figure 11 As shown, an electronic device 1100 according to an embodiment of this application includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage portion 1108 into a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0152] RAM 1103 stores various programs and data required for the operation of electronic device 1100. Processor 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Processor 1101 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 1102 and / or RAM 1103. It should be noted that the programs may also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0153] According to embodiments of this application, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to a bus 1104. The electronic device 1100 may also include one or more of the following components connected to the input / output (I / O) interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output (I / O) interface 1105 as needed. A removable medium 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1110 as needed so that computer programs read from it can be installed into the storage section 1108 as needed.
[0154] According to embodiments of this application, the method flow according to embodiments of this application can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by processor 1101, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0155] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0156] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0157] For example, according to embodiments of this application, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above and / or one or more memories other than ROM 1102 and RAM 1103.
[0158] Embodiments of this application also include a computer program product, which includes a computer program containing program code for executing the methods provided in the embodiments of this application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the microgrid typical scenario generation method provided in the embodiments of this application.
[0159] When the computer program is executed by the processor 1101, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0160] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1109, and / or installed from the removable medium 1111. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0161] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments of this application can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of this application.
[0163] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.
Claims
1. A method for generating typical microgrid scenarios, characterized in that, The method includes: Based on the received typical scenario generation request for microgrids with the scenario type of the target scenario and the key indicator values of the target scenario as conditional information, a pre-trained conditional diffusion model is applied to obtain the simulated intraday power curve under the target scenario. The pre-trained conditional diffusion model is obtained by training the conditional diffusion model based on the actual intraday power curve of the microgrid, which includes scenario type, date identifier, and key indicator values.
2. The method for generating typical microgrid scenarios according to claim 1, characterized in that, The conditional diffusion model includes a forward noise module and a denoising network; Specifically, the forward noise-adding module is used to add noise to the real intraday power curve to obtain a noisy sample. The denoising network is trained using the noisy samples to obtain the trained denoising network; The pre-trained conditional diffusion model includes a trained denoising network and a feedback correction module; Based on the request generated in the typical microgrid scenario, the trained denoising network is applied to obtain the initial intraday power curve; Based on the request generated by the typical microgrid scenario, the feedback correction module is used to correct the initial intraday power curve to obtain the simulated intraday power curve.
3. The method for generating typical microgrid scenarios according to claim 2, characterized in that, The denoising network includes U-Net, a multi-expert temporal denoising network, a conditional gating network, and a weighted fusion module; The U-Net is used to determine the shared feature vector of the input data; The multi-expert temporal denoising network is used to determine the target feature vector corresponding to the scenario type of the target scenario based on the typical scenario generation request of the microgrid and the shared features. The conditional gating network is used to generate requests based on typical microgrid scenarios and determine the weights of the target feature vector. The weighted fusion module is used to obtain fused features based on the shared feature vector, the target feature vector, and the weights.
4. The method for generating typical microgrid scenarios according to claim 3, characterized in that, When the scenario type includes a photovoltaic high-fluctuation scenario, the multi-expert temporal denoising network includes a photovoltaic high-fluctuation expert module; The photovoltaic high-fluctuation expert module includes a differential enhancement module and a dilated one-dimensional convolution; The differential enhancement modules are connected to the U-Net respectively; the differential enhancement modules are used to enhance the shared feature vector based on the differential features included in the input data; The dilated one-dimensional convolution is connected to the differential enhancement module; the dilated one-dimensional convolution is used to determine the short-term fluctuation features of the input data based on the shared feature vector after feature enhancement, and to use the short-term fluctuation features as the target feature vector corresponding to the photovoltaic high-fluctuation scenario.
5. The method for generating typical microgrid scenarios according to claim 3, characterized in that, When the scenario type includes a low-output photovoltaic scenario, the multi-expert temporal denoising network includes a low-output photovoltaic expert module; The photovoltaic low-output expert module includes long-window one-dimensional convolution and global energy pooling; The long-window one-dimensional convolution is connected to the U-Net; the long-window one-dimensional convolution is used to determine the low-frequency trend features of the input data. The global energy pooling is used to determine the energy characteristics of the low-frequency trend features, and the energy characteristics are used as the target feature vector corresponding to the low-output photovoltaic scenario.
6. The method for generating typical microgrid scenarios according to claim 3, characterized in that, When the scenario type includes a rapid load disturbance scenario, the multi-expert time-series denoising network includes a rapid load disturbance expert module; The load rapid disturbance expert module includes multi-core local convolution, ramp feature calculation, and ramp gating. The multi-kernel local convolution is connected to the U-Net; the multi-kernel local convolution is used to extract multi-scale local features of the input data; The climbing feature calculation is connected to the multi-kernel local convolution; the climbing feature calculation is used to enhance the climbing features in the multi-scale local features. The ramp gating is connected to the ramp feature calculation; the ramp gating is used to extract abrupt disturbance features from the enhanced multi-scale local features, and the abrupt disturbance features are used as the target feature vector corresponding to the rapid load disturbance scenario.
7. The method for generating typical microgrid scenarios according to claim 3, characterized in that, The output of the conditional gating network is represented as follows: ; ; in, Here are the three soft-gating weights output by the multilayer perceptron, where MLP is the multilayer perceptron and e is the conditional embedding vector determined based on the conditional information. It is the Sigmoid activation function. For scene activation vectors, Indicates conditional embedding With scene activation vector The splicing result, This indicates element-wise multiplication. The final gating weights are those after the scene activation vectors have been masked.
8. The method for generating typical microgrid scenarios according to claim 1, characterized in that, The method further includes: The trained conditional generation model is evaluated using evaluation metrics, and the trained conditional generation model that passes the evaluation is used as the pre-trained conditional generation model. The evaluation indicators include at least one of the following: average daily curve error, difference in the distribution of target condition indicators, sample diversity, and consistency of condition response.
9. A device for generating typical microgrid scenarios, characterized in that, The device includes: The target generation module is used to generate a typical microgrid scenario based on the received microgrid target scenario scenario type and key indicator values of the target scenario as conditional information, and to apply a pre-trained conditional diffusion model to obtain the simulated intraday power curve under the target scenario. The pre-trained conditional diffusion model is obtained by training the conditional diffusion model based on the actual intraday power curve of the microgrid, which includes scenario type, date identifier, and key indicator values.
10. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1 to 8.
