Method, device and equipment for optimizing power grid security domain based on denoising diffusion model
By employing a closed-loop learning method based on a denoising diffusion model, conditional samples are selected from the power injection samples of a DC power system to optimize the grid security domain boundary. This solves the problem of high data preparation and computational costs in existing technologies and achieves efficient and accurate characterization of the static voltage security domain boundary.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EAST CHINA BRANCH OF STATE GRID CORP
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, machine learning analysis methods rely on large-scale random sampling when constructing static voltage security domains in DC power systems, resulting in high data preparation and computation costs, and making it difficult to accurately sample and train data, thus hindering their application in large-scale networks.
A closed-loop learning method based on a denoising diffusion model is adopted to screen conditional samples close to the safety boundary from the power injection samples of the DC power system. The random noise is transformed into candidate samples close to the safety boundary through the denoising diffusion model, and the candidate samples are verified by the power flow equation to optimize the power grid safety domain boundary.
It achieves efficient and accurate characterization of the static voltage safety domain boundary, reduces computational costs, improves classification and fitting performance, provides more reliable criteria for safe and stable operation, and reduces dependence on high-cost power flow simulation and complex solvers.
Smart Images

Figure CN122118886A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of DC network analysis technology, and in particular to a method, apparatus and device for optimizing the power grid security domain based on a denoising diffusion model. Background Technology
[0002] The DC network stability domain (SVSR) is a concept for stability analysis and control of voltage source rectifiers in DC power systems. In DC power systems, SVSRs are primarily used to ensure that power electronic devices (such as rectifiers and inverters) can maintain stable system operation under various operating conditions. This is especially true for high-voltage direct current (HVDC) transmission systems, which typically rely on voltage source rectifiers (VSRs) to convert alternating current (AC) to direct current (DC) and ensure the stability of the DC grid.
[0003] In related technologies, machine learning analysis methods are commonly used to characterize the static voltage safety domain of DC systems. However, this method relies on the scale of training data, employing an open-loop path of sampling → labeling → training to construct the training dataset. Such open-loop large-scale learning methods cannot fully utilize the geometric features of the trained sample space and the effective information during the iteration process. Moreover, a large number of random samples are required to comprehensively capture the geometric characteristics of the entire DC system safety domain, resulting in high data preparation and computational costs. Due to the inability to accurately sample and train based on the characteristics of the sample space, it is difficult to apply in large-scale networks. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus and equipment for optimizing the power grid security domain based on a denoising diffusion model, which realizes efficient and accurate characterization of the static voltage security domain boundary, and provides an important analytical tool for the safe operation of DC systems.
[0005] According to a first aspect of this application, a method for optimizing the power grid security domain based on a denoising diffusion model is provided, the method comprising: Based on the solvability of the power flow equations, conditional samples close to the safety boundary are selected from the power injection samples of the DC power system using a closed-loop learning approach. The conditional samples are input into the denoising diffusion model, and the denoising diffusion model transforms random noise into candidate samples close to the safety boundary under the constraints of the conditional samples. The candidate samples are verified based on their solvability to the power flow equations. The security boundary of the grid security domain of the DC power system is updated based on the verified candidate samples.
[0006] According to a second aspect of this application, an apparatus for optimizing the power grid security domain based on a denoising diffusion model is provided, the apparatus comprising: The sample processing module is used to filter conditional samples close to the safety boundary from the power injection samples of the DC power system based on the solvability of the power flow equations. The sample generation module is used to input the conditional samples into the denoising diffusion model, and the denoising diffusion model transforms random noise into candidate samples close to the safety boundary under the constraints of the conditional samples. The sample processing module is also used to verify the candidate samples based on the solvability of the power flow equations. An update module is used to update the security boundary of the grid security domain of the DC power system based on the verified candidate samples.
[0007] According to a third aspect of this application, a readable storage medium is provided on which a program or instructions are stored, which, when executed by a processor, implement the steps of the above-described method for optimizing the power grid security domain based on a denoising diffusion model.
[0008] According to a fourth aspect of this application, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method for optimizing the power grid security domain based on a denoising diffusion model.
[0009] By employing the aforementioned technical solution, the solvability of the power flow equations is used as a safety criterion. Combined with a closed-loop learning mechanism, conditional samples with high information content and proximity to the safety boundary are selected from the original power injection samples. These conditional samples reflect areas of ambiguity in the system's safety state judgment, i.e., regions with high uncertainty. These conditional samples are then used as prior knowledge or constraints and input into a denoising and diffusion model. Guided by these conditional samples, the model transforms random noise into new, diverse candidate samples that still closely approximate the safety boundary. The solvability of the power flow equations is then re-executed to verify the candidate samples, ensuring their physical correctness and safety. The verified high-quality candidate samples are then added to the training set to iteratively optimize the DC power system's grid safety domain boundary model's perception of the boundary. High-resolution, continuously smooth safety domain boundary characterization results are obtained through small-sample simulations. This approach organically integrates proactively recommended high-value samples with candidate samples near the boundary generated by the diffusion model. It generates more diverse candidate samples that closely approximate the true safety boundary characteristics, achieving a "less is more" data acquisition method. The candidate samples compensate for the sparsity of the original data in the boundary region, resulting in better classification and fitting performance with the same sample size. This helps reduce reliance on high-cost power flow simulations and complex solvers. Simultaneously, it allows the training process to quickly approximate the true boundary shape of the safety domain in each iteration, thus accelerating model convergence. Furthermore, while reducing the consumption of engineering computing resources, it provides more reliable boundary criteria for the safe and stable operation of DC power systems, helping dispatchers accurately assess the system's operating status and proactively mitigate safety risks.
[0010] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating the method for optimizing the power grid security domain based on a denoising diffusion model provided in an embodiment of this application is shown. Figure 2 A schematic diagram of the equivalent circuit model of the DC power system provided in the embodiments of this application is shown; Figure 3 This paper shows a structural block diagram of a device for optimizing the power grid security domain based on a denoising diffusion model, as provided in an embodiment of this application. Figure 4A schematic diagram of the electronic structure of a computer device provided in an embodiment of this application is shown; Figure 5 This diagram illustrates a comparison of the F1 scores between the method for optimizing the power grid security domain based on a denoising diffusion model provided in this application and other methods. Figure 6 A heatmap showing the distribution of sample uncertainty scores after the fifth round of training in an embodiment of this application is illustrated. Figure 7 A heatmap showing the distribution of sample uncertainty scores after the 15th round of training in an embodiment of this application is illustrated. Figure 8 A heatmap showing the distribution of sample uncertainty scores after the 20th round of training in an embodiment of this application is illustrated. Detailed Implementation
[0012] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0013] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0014] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “attached” to another element, it can be directly connected or attached to the other element, or there may be intermediate elements. Furthermore, “connected” or “attached” as used herein can include wireless connections or wireless interconnections. The term “and / or” as used herein includes all or any unit and all combinations of one or more associated listed items.
[0015] Exemplary embodiments according to this application will now be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments may be implemented in many different forms and should not be construed as being limited to the embodiments set forth herein. It should be understood that these embodiments are provided so that the disclosure of this application is thorough and complete, and that the concept of these exemplary embodiments is fully conveyed to those skilled in the art.
[0016] This embodiment provides a method for optimizing the power grid security domain based on a denoising diffusion model, such as... Figure 1 As shown, the method includes: Step 101: Based on the solvability of the power flow equations, select conditional samples close to the safety boundary from the power injection samples of the DC power system using a closed-loop learning approach.
[0017] The safety boundary is the edge of the power grid safety domain, used to divide the current operating state of the power system into safe and unsafe areas. The power grid safety domain is the set of all possible values that all operating variables of the power system (such as generator active / reactive power output, load, line power flow, voltage, etc.) can take at a given point in time or within a given time period. Any point in this set, i.e., the operating state, guarantees that the system meets all preset technical and operational constraints. For example, the power grid safety domain may include a voltage safety domain, a power angle safety domain, and a frequency safety domain.
[0018] In this embodiment, a closed-loop learning training is performed using a small sample set obtained through active sampling. The boundary geometry information learned in each iteration is used as a feedback learning signal to achieve a closed-loop learning process of "sampling—labeling—retraining—boundary verification." This closed-loop learning allows for the selection of power injection samples close to the safety boundary. By replacing a large, randomly sampled sample set with a small sample set containing high information value, the system can directly focus on conditional samples located in the neighborhood of the safety boundary, significantly reducing the computational cost of sample processing and helping to reduce the number of power flow solutions and simulations. Simultaneously, it ensures that the selected samples possess the core characteristics of the safety boundary, laying a high-quality data foundation for subsequent safety domain boundary analysis and achieving accurate and efficient characterization of the static safety domain boundary.
[0019] In one embodiment, the safety boundary of a power grid safety domain can be initially defined using known power injection samples and operating data of the DC power system. Specifically: a static network model of the DC power system is obtained; power flow equations are constructed based on the DC network model; different power injection samples are substituted into the power flow equations for solving, and the power injection samples that yield at least one solution are taken as stable samples; the safety boundary is determined based on the stable samples.
[0020] The static network model includes power source nodes, operating state source nodes, and network topology relationships. The network topology relationships include transmission relationships between voltage sources and loads, transmission relationships between loads, and transmission relationships between voltage sources. Operating state source nodes include at least one of voltage source nodes, power angle source nodes, and frequency source nodes.
[0021] In this embodiment, a static network model of a DC power grid is used as the basis. Power flow equations are constructed to describe the power flow and voltage distribution of the grid under a given power injection. By iteratively substituting multiple known power injection samples into the power flow equations for solving, the power injection conditions (stable samples) that enable the system to achieve steady-state operation under the current network topology and parameters are identified. Based on these stable samples, the safety boundary of the safety domain is initially defined. This quantifies the abstract concept of safety into a specific power injection range, ensuring the reliability of the initial safety boundary and providing an initial reference benchmark with clear physical meaning for subsequent boundary refinement optimization based on closed-loop learning and diffusion models. Moreover, it can be seamlessly extended to DC network systems with different topologies (radial, ring, multi-terminal) and different control strategies (primary / secondary droop control), and can be extended to the stability and safety analysis of various AC / DC systems.
[0022] For example, such as Figure 2 As shown, a DC power grid consists of several power source nodes and load nodes, which are interconnected through equivalent RLC transmission lines. The internal structure of the power source and load nodes is as follows: Figure 2 As shown.
[0023] Taking voltage and power as operating states as an example, the power network model includes: 1) Power source nodes: The injected power of the node is constant, that is, constant power load or constant power generation unit, and its characteristics are similar to PQ nodes in AC system; 2) Voltage source nodes: The node is powered by voltage-controlled power sources, such as controlled rectifiers, DC bus voltage regulators, etc., and its behavior is similar to PV nodes in AC system.
[0024] If node j With nodes k If power lines exist, then it is denoted as Otherwise, record as Connecting nodes j and k The line admittance is denoted as Based on the network topology, the node admittance matrix can be defined. : ; matrix The nodes are divided into blocks according to node type (load node or power node): .
[0025] In the formula, , and These represent load-load, source-load, and source-source submatrices, respectively. (Subscript) l and s These correspond to load nodes and power supply nodes, respectively.
[0026] Define the power injection vector of the load node. Load node voltage Power node voltage The set voltage of the controlled power supply .
[0027] Combine the voltage vectors of all nodes into And the corresponding injected current vector is At this point, the total node power injection vector can be expressed as: .
[0028] According to Kirchhoff's laws and Ohm's law, the relationship between current and voltage is determined as follows: ; Substituting the relationship between current and voltage into the equation for the total nodal power injection vector, the power injection vector can be written as: .
[0029] To simplify the representation of the steady-state power flow equations, we define the system at a certain steady-state equilibrium point. Given the equivalent variable set below, let the equilibrium points of node voltage and power injection be respectively... and Substituting the known variables into the power injection vector expression, we obtain the simplified steady-state power flow equation: ; In the formula, the voltage of the power supply node is... For a given quantity, the power injection at the load node Treated as a variable parameter, it is used to describe system uncertainties caused by load fluctuations or changes in renewable energy output. Parameterized equations Regarding state variables It exhibits a quadratic relationship. When When the amplitude is too large, the system may no longer have a feasible solution to the power flow equation, thus causing voltage instability.
[0030] Furthermore, taking an integrated photovoltaic-energy storage-charging system as an example, the uncertainties from photovoltaic power generation and electric vehicle charging loads are comprehensively considered. Specifically, the photovoltaic units and electric vehicle charging piles have rapid voltage support capabilities and can be modeled as power nodes; the energy storage unit can be regarded as a voltage source node. The source load uncertainty can then be represented by the nodal power injection vector in the steady-state power flow equation. The changes are reflected in this.
[0031] To characterize this type of uncertainty, the uncertainty set is defined as follows: ; in, and These represent the lower and upper bounds for each uncertain power injection, respectively; This is a set of power injection vectors with uncertainty at power system nodes. For example, when photovoltaic output is high, This indicates that there is net power injection at the node; however, when the load demand is high, This corresponds to the power absorption state, reflecting the actual operating characteristics under scenarios such as surplus photovoltaic power or off-peak reverse charging.
[0032] The Static Voltage Stability Region (SVSR) is defined as the set of all power injections that ensure at least one solution to the power flow equations. This region characterizes the operating state of the system under different power injection scenarios, allowing the power flow equations to remain solvable. It is an important criterion for judging the static voltage stability of a DC system. The SVSR is represented as follows: .
[0033] Therefore, through verification This allows us to determine whether the system is solvable within a given range of uncertainty. All scenarios that satisfy this condition can be considered as feasible operating states of the system, and their set constitutes the region characterized by the SVSR. This helps to identify the maximum level of power injection uncertainty that the system can tolerate while maintaining solvability.
[0034] In practical applications, the probability of extreme critical conditions occurring in the actual operation of DC power systems is low, resulting in a very small number of natural boundary samples, making it difficult to accurately characterize the safety boundary. Therefore, step 101, which involves selecting conditional samples close to the safety boundary from the power injection samples of the DC power system based on the solvability of the power flow equations using a closed-loop learning approach, specifically includes the following steps: Step 101-1: Map the power injection samples to a preset interval based on the solvable probability function to obtain the first confidence score.
[0035] The first confidence score is used to indicate the probability that the power injection sample belongs to the grid security domain.
[0036] Step 101-2: Input the first confidence score into the classifier to determine the first uncertainty score of the power injection sample.
[0037] The classifier assigns a higher uncertainty score to samples located in the neighborhood of the safe boundary compared to samples farther from the safe boundary. The first uncertainty score measures the incremental information a sample learns about the boundary. This uncertainty score is highest near the classifier's decision threshold, highlighting samples that are closest to the stable boundary and have the highest discriminative value. During training, this first uncertainty score serves both as a ranking criterion for active sample selection and as a heatmap for uncertainty in two-dimensional / multi-dimensional slices. This heatmap visually reflects the model's blind spots and confidence regions in the sample space, guiding sampling resources to concentrate in the critical neighborhood, reducing redundant labeling and ineffective simulations, and accelerating convergence.
[0038] Step 101-3: The power injection samples with a first uncertainty score greater than a first preset score are determined as conditional samples.
[0039] The first preset score can be reasonably set according to the required accuracy, and this application embodiment does not impose specific limitations.
[0040] In this embodiment, a solvable probability function maps power injection samples to a preset interval and generates a first confidence score. This first confidence score allows for a preliminary assessment of the probability that each sample is within the safe zone. The first confidence score is then input into a classifier, which performs secondary discrimination on the boundary attributes of each sample. This results in samples located in the neighborhood of the safe boundary (i.e., those with a solvable probability in the critical interval) receiving higher uncertainty scores, while samples far from the safe boundary (i.e., those whose model can definitively determine whether they belong to or not within the power grid's safe zone) receive lower uncertainty scores. The first preset score is used to filter power injection samples, prioritizing those with high feature ambiguity and substantial information about the neighborhood of the safe boundary. This adaptively discovers key samples near the boundary, achieving precise localization of boundary neighborhood samples and avoiding blind random sampling. This significantly reduces the number of numerical power flow solutions, achieving higher computational efficiency and convergence speed than traditional numerical methods. Furthermore, it provides better classification and fitting performance for each sample with the same sample size, thus improving the accuracy of the safe boundary characterization.
[0041] For example, first, define a posterior solvable probability function: ; The solvable probability function is determined by the parameter set. Control, implemented by a multilayer perceptron (MLP), is used to inject the normalized power into the point. The mapping is based on the confidence score of whether it belongs to SVSR. Each layer of this function includes a linear transformation and ReLU activation; dropout layers can be added to intermediate layers to enhance generalization ability, and the final output layer uses the Sigmoid function to ensure the result is in the [0,1] interval, specifically as follows: ; ; In the formula, These represent the weights and biases for each layer.
[0042] Taking a classifier decision threshold of 0.5 as an example, an uncertainty scoring function based on the classifier output is defined. Samples closer to the boundary are assigned higher scores to identify the most uncertain and informative samples at that decision threshold. The uncertainty scoring function of this classifier is expressed as: ; In the formula, Score the uncertainty. This represents the confidence score.
[0043] Furthermore, in one embodiment, after step 101, the method for optimizing the power grid security domain based on the denoising diffusion model further includes: selecting optimized samples from the unlabeled sample set based on the confidence scores corresponding to the conditional samples to solve the power flow problem; and updating the model parameters of the classifier based on the power flow solution results of the optimized samples.
[0044] The unlabeled sample set includes multiple power injection samples without safety domain attribute labels. The safety domain attribute labels include stable samples, unstable samples, and boundary neighborhood samples.
[0045] Understandably, power flow solutions for unlabeled samples can be obtained through manual evaluation and numerical labeling, or through automatic labeling based on a physical model.
[0046] In this embodiment, in each iteration, candidate batches are randomly selected from the unlabeled sample set. The trained classifier calculates the uncertainty score for each sample, and the highest-scoring subset is used to solve the power flow equations. The results are then fed back into the next training round. This allows the classifier to continuously learn the critical features of safety boundary samples, constantly improving the discrimination accuracy and reliability of uncertainty scores for samples in the boundary neighborhood. Simultaneously, a self-optimizing closed loop is formed, enabling the classifier to dynamically adapt to changes in the operating conditions of the DC power system and maintain efficient screening capabilities for safety boundary samples, thus facilitating dynamic and targeted data sampling.
[0047] Step 102: Input the conditional samples into the denoising diffusion model, and transform random noise into candidate samples close to the safety boundary under the constraints of the conditional samples.
[0048] In this embodiment, a denoising diffusion model is used, with the conditional samples obtained through closed-loop screening as constraints, to progressively transform random noise into candidate samples that conform to the characteristics of the safety boundary. Thus, while satisfying the basic constraints of the power flow equations, a large number of diverse and highly realistic boundary candidate samples are synthesized in the boundary vicinity using the diffusion model based on a limited number of real samples. This significantly increases the number of samples in the training set, compensating for the lack of actual samples, reducing reliance on high-cost power flow simulations and complex solvers, and minimizing the consumption of engineering computing resources. Furthermore, while ensuring a limited number of samples, smooth, continuous, and high-resolution boundary fitting is achieved, effectively improving the accuracy of the static voltage safety region characterization.
[0049] In practical applications, step 102, where the denoising diffusion model transforms random noise into candidate samples close to the safety boundary under conditional sample constraints, specifically includes the following steps: Step 102-1: Normalize the conditional samples.
[0050] In this embodiment, the samples are first mapped to a uniform numerical range through normalization to eliminate dimensional interference, enabling the model to capture the core feature patterns of the samples more efficiently. At the same time, it reduces the training oscillation problem caused by parameter numerical differences and ensures the training stability of the denoising network.
[0051] Step 102-2: Gaussian noise is gradually added to the normalized conditional samples to generate noisy samples.
[0052] Among them, noisy samples Represented as: . Power injection sample, For high-dimensional condition variables, For noise reduction networks, For noise components, Discrete time step , Noise attenuation factor , Cumulative noise figure .
[0053] It is understandable that generating a noisy intermediate state can be represented as .
[0054] Step 102-3: Construct high-dimensional condition variables based on condition samples.
[0055] The high-dimensional condition variable is represented as follows: . For conditional samples; Score the uncertainty. ; The minimum distance from a sample to a boundary sample set that meets preset boundary conditions can be: , It can be set reasonably according to the accuracy requirements. The smaller the sample size that meets the criteria, the higher the uncertainty. For the sample neighborhood density, the previous method is used. The reciprocal representation of nearest neighbor distance, specifically, It can be represented as , For training set The first in The nearest neighbor points, training set Composed of all conditional samples, To prevent decimals with a denominator of zero; This is a diversity metric used to suppress variations from the existing training set. Redundant points that are too close together and maintaining spatial coverage are measures, specifically, It can be represented as: It is used to control the spatial coverage and diversity of new sampling points and prevent sample redundancy.
[0056] Step 102-4: Train the denoising network based on noisy samples and high-dimensional conditional variables.
[0057] The denoising network is used to denoise the noise components predicted under different noise intensities when they match the noise of the noisy sample.
[0058] Understandably, high-dimensional condition variables Feature splicing can be used to inject into the denoising network. Specifically, the diffusion step size... Mapped to temporal embedding vector To characterize the noise intensity differences corresponding to different diffusion step sizes; through a conditional encoder High-dimensional condition variables Mapped to a fixed-dimensional vector To standardize the scale and enhance learnability; finally The concatenation is used as input to a denoising network to obtain the predicted noise. .in, It can be generated by sine-cosine position encoding or learnable embeddings. It can be implemented using a multilayer perceptron (MLP).
[0059] In one embodiment, step 102-4 specifically includes: training the denoising network using a boundary-guided weighted loss function, so that the prediction error of samples that meet the preset boundary conditions receives higher training weights.
[0060] The preset boundary conditions are expressed as follows: .
[0061] In this embodiment, based on the above sampling and condition construction, the parameters of the denoising network are updated and optimized using weighted mean square error. By adjusting the weights, the blurred regions near the decision threshold are given higher loss weights, thereby prioritizing the improvement of denoising accuracy and generation resolution in the boundary neighborhood.
[0062] Specifically, the weighted loss function is expressed as: ; In the formula, To prevent small constants with a denominator of zero, This represents the mathematical expectation of random samples during the training process. For noise reduction networks, For the parameters of the denoising network, For training weights, For noise components, For high-dimensional condition variables, Score the uncertainty.
[0063] Step 102-5: Guided by high-dimensional conditional variables, candidate samples are generated through an iterative reverse process using a denoising network for iterative denoising.
[0064] Specifically, in the reasoning generation stage, from the Gaussian distribution The sampling and iterative reverse process is represented as follows: ; In the formula, For noisy samples, Power injection sample, For high-dimensional condition variables, For noise reduction networks, For noise components, For conditional samples, Score the uncertainty. This represents the minimum distance from a sample to the boundary sample set that meets the preset boundary conditions. The density of the sample neighborhood, As a diversity indicator, Noise attenuation factor The cumulative noise figure, Standard Gaussian noise, This is random noise sampled from a Gaussian distribution. The process progressively transforms the noise into structured data consistent with the conditional samples, causing the high-density sample distribution to adaptively cluster near the SVSR boundary.
[0065] In this embodiment, high-quality conditional samples are progressively annoyed through a forward diffusion process to generate noisy samples. Combined with the original conditional samples, conditional variables incorporating multiple dimensions such as uncertainty, boundary distance, and diversity are constructed. A denoising network is then trained to focus on the critical features of the safety boundary samples, ensuring that the generated candidate samples not only satisfy the basic constraints of the power flow equations. This denoising network then learns to iterate backward under critical constraints to gradually eliminate noise, bringing the samples back from the noisy distribution to the true sample distribution, ultimately forming new candidate samples that are both close to the safety boundary and distinct from the conditional samples. This approach ensures the diversity of sample generation while avoiding the generation of invalid samples outside the system's operating parameters. It encrypts the key region sample distribution in the parameter space without relying solely on category labels or global statistical conditions, avoiding overly conservative problems caused by fixed geometric assumptions. This makes the obtained safety domain boundary closer to the actual power flow solvability boundary, thereby improving the reliability of the stability safety margin assessment.
[0066] Step 103: Verify the candidate samples based on the solvability of the power flow equations.
[0067] In this embodiment, candidate samples are screened using preset boundary conditions. Samples near the boundary that meet the preset boundary conditions are retained first, while redundant points that are too close to the training set are removed. This allows for numerical verification of a small number of representative samples to control error accumulation. This enables a limited number of labeled samples to cover the most critical areas of the security domain, achieving the effect of "replacing many with few," reducing the dependence of the learning model on a large-scale training sample set, and reducing data preparation costs.
[0068] Furthermore, based on the high-value areas and the degree of local geometric changes at the boundaries of the uncertainty heatmap, the number of generated samples and the step size configuration can be adaptively scheduled, so that resources are concentrated on high uncertainty / high curvature boundary segments.
[0069] In practical applications, similar to the principle of selecting conditional samples close to the safety boundary using closed-loop learning, step 103, which is to verify the candidate samples based on the solvability of the power flow equation, specifically includes: mapping the candidate samples to a preset interval to obtain a second confidence score; inputting the second confidence score into a classifier to determine the second uncertainty score of the candidate samples; if the second uncertainty score is greater than the second preset score, the candidate samples are determined to pass the verification; if the second uncertainty score is less than or equal to the second preset score, the candidate samples are deleted.
[0070] The second confidence score is used to represent the probability that a candidate sample belongs to the power grid security domain.
[0071] Step 104: Update the security boundary of the grid security domain of the DC power system based on the verified candidate samples.
[0072] Understandably, candidate samples and known conditional samples can be used as training data and input into the existing machine learning model to train it, so that the machine learning model can fully capture the boundary geometric characteristics of the entire DC system safety domain and characterize a more accurate DC system static voltage safety domain.
[0073] The method for optimizing the power grid safety domain based on a denoising diffusion model provided in this application utilizes the solvability of power flow equations as a safety criterion and combines it with a closed-loop learning mechanism to screen conditional samples that are close to the safety boundary and have high information content from the original power injection samples. These conditional samples reflect the ambiguity in the judgment of the system safety state, that is, the region with high uncertainty. The conditional samples are used as prior knowledge or constraints and input into the denoising diffusion model. Under the guidance of the conditional samples, the denoising diffusion model transforms random noise into new, diversified candidate samples that are still close to the safety boundary. The solvability of the power flow equations is executed again to verify the candidate samples to ensure their physical correctness and safety. The high-quality candidate samples that have passed the verification are added to the training set to iteratively optimize the boundary perception of the power grid safety domain boundary model of the DC power system, and obtain high-resolution, continuous and smooth safety domain boundary characterization results through small-sample simulation. This approach organically integrates proactively recommended high-value samples with candidate samples near the boundary generated by the diffusion model. It generates more diverse candidate samples that closely resemble the true safety boundary characteristics, achieving a "less is more" data acquisition method. The candidate samples compensate for the sparsity of the original data in the boundary region, resulting in better classification and fitting performance with the same sample size. This helps reduce reliance on high-cost power flow simulations and complex solvers. Simultaneously, it allows the training process to quickly approximate the true boundary shape of the safety domain in each iteration, accelerating model convergence and reducing dependence on large-scale additional simulations. Furthermore, while reducing the consumption of engineering computing resources, it provides more reliable boundary criteria for the safe and stable operation of DC power systems, helping dispatchers accurately assess the system's operating status and proactively mitigate safety risks.
[0074] It is worth mentioning that after validating the candidate samples, a comparative experiment can be conducted on the IEEE 14-bus DC system. In the experiment, the solvability of the system power flow equations was verified using the IPOPT nonlinear optimization solver, and both the machine learning model and the diffusion model were implemented in Python. The diffusion-enhanced active learning method (DAL) proposed in this application is compared with existing random sampling machine learning methods (RML) and pure diffusion model-based methods (DL). Under the same experimental conditions and data scale, such as... Figure 5 As shown, the method proposed in this application further improves boundary sampling efficiency by actively selecting samples, based on deep learning (DL). Compared with traditional RML, DAL achieves an F1 score of 0.98 with an average computation time of only 32 seconds, which is approximately 54% more efficient than the 70-second computation time of existing random sampling machine learning methods.
[0075] Furthermore, the initial sample size is 50, with 10 new samples added each training cycle, for a total of 200 training cycles. Figures 6 to 8 As shown, a visualization heatmap of the uncertain 2D SVSR after training rounds 5, 15, and 20 is presented, with bus 3 and bus 4 selected as variable injection nodes. The red areas correspond to higher uncertainty (i.e., The blue area represents a higher classification confidence level (i.e., ...). (Close to 0 or 1). The green arrows mark the locations where samples were actively selected during the learning process. Figure 6 , Figure 7 and Figure 8 It can be observed that as the number of rounds increases, active learning gradually optimizes the sampling to the boundary region with the most information content. This result shows that closed-loop active learning can effectively reduce redundant sampling and invalid simulations, greatly reduce the number of power flow solutions, and enable the system to achieve fast convergence even in a large sample space. The training process can achieve a high level of accuracy with fewer real samples and simulation calls.
[0076] The method for optimizing the power grid security domain based on a denoising diffusion model provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0077] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0078] Furthermore, such as Figure 3 As shown, as a specific implementation of the above-mentioned method for optimizing the power grid security domain based on the denoising diffusion model, this application provides an apparatus 300 for optimizing the power grid security domain based on the denoising diffusion model. The apparatus 300 for optimizing the power grid security domain based on the denoising diffusion model includes: a sample processing module 301, a sample generation module 302, and an update module 303.
[0079] The sample processing module 301 is used to filter conditional samples close to the safety boundary from the power injection samples of the DC power system based on the solvability of the power flow equations. The sample generation module 302 is used to input conditional samples into the denoising diffusion model, and to transform random noise into candidate samples close to the safety boundary under the constraint of the conditional samples through the denoising diffusion model. The sample processing module 301 is also used to verify the candidate samples based on the solvability of the power flow equations. Update module 303 is used to update the security boundary of the grid security domain of the DC power system based on the verified candidate samples.
[0080] Further, the sample processing module 301 is specifically used to map the power injection sample to a preset interval based on a solvable probability function to obtain a first confidence score, wherein the first confidence score is used to represent the probability that the power injection sample belongs to the power grid safety domain; input the first confidence score into a classifier to determine a first uncertainty score for the power injection sample, wherein the classifier is used to assign a higher uncertainty score to samples located in the neighborhood of the safety boundary than to samples far from the safety boundary; and determine the power injection sample with a first uncertainty score greater than a first preset score as a conditional sample.
[0081] Optionally, the device 300 for optimizing the power grid security domain based on the denoising diffusion model further includes: The model optimization module (not shown in the figure) is used to select optimized samples from the unlabeled sample set based on the confidence scores corresponding to the conditional samples for power flow solution. The unlabeled sample set includes multiple power injection samples without safety domain attribute labels. The model parameters of the classifier are updated based on the power flow solution results of the optimized samples.
[0082] Optionally, the sample processing module 301 is further configured to obtain a second confidence score based on mapping the candidate sample to a preset interval, wherein the second confidence score is used to represent the probability that the candidate sample belongs to the power grid safety domain; and input the second confidence score into a classifier to determine a second uncertainty score for the candidate sample, wherein the classifier is used to assign a higher uncertainty score to samples located in the neighborhood of the safety boundary than to samples far from the safety boundary. The sample processing module 301 is specifically used to determine that a candidate sample passes verification if the second uncertainty score is greater than the second preset score, and to delete the candidate sample if the second uncertainty score is less than or equal to the second preset score.
[0083] Furthermore, the classifier is represented as:
[0084]
[0085]
[0086] In the formula, Score the uncertainty. The confidence score is... These represent the weights and biases of each layer of the classifier. This is the power injection point.
[0087] Furthermore, the sample generation module 302 is specifically used to normalize the conditional samples; gradually add Gaussian noise to the normalized conditional samples to generate noisy samples; construct high-dimensional conditional variables based on the conditional samples; train a denoising network based on the noisy samples and the high-dimensional conditional variables, wherein the denoising network is used to denoise when the noise component predicts the noise of the noisy sample under different noise intensities; guided by the high-dimensional conditional variables, iterative denoising is performed using the denoising network through an iterative reverse process to generate candidate samples. The noisy sample is represented as:
[0088] High-dimensional condition variables are represented as: ; The iterative reverse process is represented as:
[0089] In the formula, For noisy samples, Power injection sample, For high-dimensional condition variables, For noise reduction networks, For noise components, For conditional samples, Score the uncertainty. This represents the minimum distance from a sample to the boundary sample set that meets the preset boundary conditions. The density of the sample neighborhood, As a diversity indicator, Noise attenuation factor The cumulative noise figure, Standard Gaussian noise, This is random noise sampled from a Gaussian distribution.
[0090] Furthermore, the sample generation module 302 is also used to: adopt a boundary-oriented weighted loss function during the training of the denoising network, so that the prediction error of samples that meet the preset boundary conditions can obtain higher training weights. The preset boundary conditions are expressed as follows: The weighted loss function is expressed as: ; In the formula, To prevent small constants with a denominator of zero, This represents the mathematical expectation of random samples during the training process. For noise reduction networks, For the parameters of the denoising network, For training weights, For noise components, For high-dimensional condition variables, Score the uncertainty.
[0091] Furthermore, the sample processing module 301 is also used to obtain a static network model of the DC power system, wherein the static network model includes power source nodes, operating state source nodes, and network topology relationships, and the operating state source nodes include at least one of voltage source nodes, power angle source nodes, and frequency source nodes; construct power flow equations based on the DC network model; substitute different power injection samples into the power flow equations for solving, and take the power injection samples that can obtain at least one solution as stable samples; determine the safety boundary based on the stable samples.
[0092] Specific limitations regarding the device for optimizing the power grid security domain based on the denoising diffusion model can be found in the limitations of the method for optimizing the power grid security domain based on the denoising diffusion model mentioned above, and will not be repeated here. Each module in the aforementioned device for optimizing the power grid security domain based on the denoising diffusion model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0093] Based on the above, Figure 1 Accordingly, embodiments of this application also provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figure 1 The method shown is to optimize the power grid security domain based on a denoising diffusion model.
[0094] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.
[0095] Based on the above, Figure 1 The method shown, and Figure 3 The virtual device embodiment shown is designed to achieve the above objectives, such as... Figure 4 As shown in the figure, this application embodiment also provides a computer device 400, which includes a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the above-mentioned... Figure 1 The method shown is to optimize the power grid security domain based on a denoising diffusion model.
[0096] The memory 402 can be used to store software programs and various data. The memory 402 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 402 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 402 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0097] Processor 401 may include one or more processing units; optionally, processor 401 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 401.
[0098] Computer equipment can specifically include personal computers, servers, network devices, etc.
[0099] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB ports, card reader ports, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Bluetooth interfaces, Wi-Fi interfaces), etc.
[0100] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platform, or it can be implemented by hardware.
[0102] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0103] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A method for optimizing the power grid security domain based on a denoising diffusion model, characterized in that, The method includes: Based on the solvability of the power flow equations, conditional samples close to the safety boundary are selected from the power injection samples of the DC power system using a closed-loop learning approach. The conditional samples are input into the denoising diffusion model, and the denoising diffusion model transforms random noise into candidate samples close to the safety boundary under the constraints of the conditional samples. The candidate samples are verified based on their solvability to the power flow equations. The security boundary of the grid security domain of the DC power system is updated based on the verified candidate samples.
2. The method for optimizing the power grid security domain based on a denoising diffusion model according to claim 1, characterized in that, The method of selecting conditional samples close to the safety boundary from the power injection samples of the DC power system based on the solvability of the power flow equations using a closed-loop learning approach includes: The power injection sample is mapped to a preset interval based on a solvable probability function to obtain a first confidence score, wherein the first confidence score is used to represent the probability that the power injection sample belongs to the power grid security domain; The first confidence score is input into the classifier to determine the first uncertainty score of the power injection sample, wherein the classifier is used to assign a higher uncertainty score to samples located in the neighborhood of the safety boundary compared to samples far from the safety boundary; The power injection samples whose first uncertainty score is greater than the first preset score are determined as the conditional samples.
3. The method for optimizing the power grid security domain based on a denoising diffusion model according to claim 2, characterized in that, The method further includes: Based on the confidence scores corresponding to the conditional samples, optimized samples are selected from the unlabeled sample set to solve the power flow problem. The unlabeled sample set includes multiple power injection samples without security domain attribute labels. The model parameters of the classifier are updated based on the power flow solution results of the optimized samples.
4. The method for optimizing the power grid security domain based on a denoising diffusion model according to claim 1, characterized in that, The verification of the candidate samples based on the solvability of the power flow equations includes: A second confidence score is obtained by mapping the candidate samples to a preset interval, wherein the second confidence score is used to represent the probability that the candidate sample belongs to the power grid security domain; The second confidence score is input into the classifier to determine the second uncertainty score of the candidate sample, wherein the classifier is used to assign a higher uncertainty score to samples located in the neighborhood of the safety boundary compared to samples far from the safety boundary; If the second uncertainty score is greater than the second preset score, then the candidate sample is determined to have passed the verification. If the second uncertainty score is less than or equal to the second preset score, then the candidate sample is deleted.
5. The method for optimizing the power grid security domain based on a denoising diffusion model according to any one of claims 2 to 4, characterized in that, The classifier is represented as: In the formula, Score the uncertainty. The confidence score is... These represent the weights and biases of each layer of the classifier. This is the power injection point.
6. The method for optimizing the power grid security domain based on a denoising diffusion model according to any one of claims 1 to 4, characterized in that, The denoising diffusion model, under the conditional sample constraints, transforms random noise into candidate samples close to the safety boundary, including: The conditional samples are then normalized. Gaussian noise is progressively added to the normalized conditional samples to generate noisy samples, wherein the noisy samples are represented as follows: A high-dimensional condition variable is constructed based on the conditional sample, wherein the high-dimensional condition variable is represented as follows: ; A denoising network is trained based on the noisy sample and the high-dimensional conditional variable, wherein the denoising network is used to perform denoising processing when the noise component predicts noise that matches the noise of the noisy sample under different noise intensities; Guided by the high-dimensional condition variable, the candidate samples are generated through iterative denoising using the denoising network via an iterative inverse process. The iterative inverse process is expressed as follows: In the formula, For noisy samples, Power injection sample, For high-dimensional condition variables, For noise reduction networks, For noise components, For conditional samples, Score the uncertainty. This represents the minimum distance from a sample to the boundary sample set that meets the preset boundary conditions. The density of the sample neighborhood, As a diversity indicator, Noise attenuation factor The cumulative noise figure, Standard Gaussian noise, This is random noise sampled from a Gaussian distribution.
7. The method for optimizing the power grid security domain based on a denoising diffusion model according to claim 6, characterized in that, The method further includes: During the training of the denoising network, a boundary-oriented weighted loss function is used so that the prediction error of samples that meet the preset boundary conditions can be given higher training weights. Wherein, the preset boundary condition is expressed as The weighted loss function is expressed as: ; In the formula, To prevent small constants with a denominator of zero, This represents the mathematical expectation of random samples during the training process. For noise reduction networks, For the parameters of the denoising network, For training weights, For noise components, For high-dimensional condition variables, Score the uncertainty.
8. The method for optimizing the power grid security domain based on a denoising diffusion model according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the static network model of the DC power system, wherein the static network model includes power source nodes, operating state source nodes and network topology, and the operating state source nodes include at least one of voltage source nodes, power angle source nodes and frequency source nodes; The power flow equations are constructed based on the DC network model. Different power injection samples are substituted into the power flow equation for solution, and the power injection sample that yields at least one solution is taken as the stable sample. The security boundary is determined based on the stable samples.
9. A device for optimizing the power grid security domain based on a denoising diffusion model, characterized in that, The device includes: The sample processing module is used to filter conditional samples close to the safety boundary from the power injection samples of the DC power system based on the solvability of the power flow equations. The sample generation module is used to input the conditional samples into the denoising diffusion model, and the denoising diffusion model transforms random noise into candidate samples close to the safety boundary under the constraints of the conditional samples. The sample processing module is also used to verify the candidate samples based on the solvability of the power flow equations. An update module is used to update the security boundary of the grid security domain of the DC power system based on the verified candidate samples.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for optimizing the power grid security domain based on the denoising diffusion model as described in any one of claims 1 to 7.