Risk feature extraction method for main distribution microgrid

A risk feature extraction method for main-distribution microgrids was constructed by using the sequential Monte Carlo method and the random forest algorithm. This method solves the problem of insufficient risk feature extraction in existing technologies, realizes comprehensive assessment and preventive control of risks in main-distribution microgrids, and improves the stability of system operation.

CN122118722APending Publication Date: 2026-05-29STATE GRID HUNAN ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID HUNAN ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST
Filing Date
2026-02-06
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies have limited research on the establishment of risk indicator systems and the extraction of risk characteristics for main and distribution microgrids, making it difficult to effectively identify key influencing factors and construct explanatory models, and lacking preventive control strategies.

Method used

Multiple system operation scenarios are generated using the sequential Monte Carlo method. A risk feature extraction method is constructed by combining the random forest algorithm. Through active-reactive power optimization scheduling model and power flow calculation, a multi-level risk indicator system is established to identify key influencing factors and provide preventive control strategies.

Benefits of technology

It enables a comprehensive assessment of risks in the main distribution microgrid, identifies key influencing factors, provides interpretive models, assists grid operators in preventive control, and improves system operational stability and risk early warning capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122118722A_ABST
    Figure CN122118722A_ABST
Patent Text Reader

Abstract

The application discloses a risk feature extraction method for a main microgrid, and comprises the following steps: firstly, constructing a new energy output probability model and a system element operation model, and generating multiple system operation scenarios by using a sequential Monte Carlo method; then, determining an active power and reactive power dispatching optimization model, wherein the active power optimization takes the minimum system operation cost as an objective function, and the reactive power optimization takes the minimum system operation network loss as an objective function; subsequently, determining decision variables and constraint conditions of the dispatching evaluation model, and solving system state physical quantities by power flow calculation; then, constructing a risk criterion, determining a risk state data set of each scenario, inputting a random forest algorithm model to quantitatively analyze the risk importance of system features. Finally, determining a risk quantification evaluation method, and constructing a multi-level risk index system according to system risk features. The application can identify key influencing factors under a risk scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system operation risk assessment, and specifically to a method for extracting risk features for main distribution microgrids. Background Technology

[0002] With the large-scale integration of distributed power sources, the operational stability of power systems faces significant uncertainties. Consequently, methods for ensuring the safe and stable operation of the system and accurately identifying potential risks have been rapidly developed. Addressing the challenges of uncertainty in the operation of main and distribution microgrids under scenarios with high distributed energy penetration, constructing a comprehensive risk indicator system and assessment methods can effectively characterize the real-time risk status of the power system, providing theoretical support and technical assurance for improving system operational stability. This direction has become a research hotspot in the field of power systems in recent years.

[0003] While numerous methods have been developed for establishing and assessing power system risk indicators, research on establishing a risk indicator system for main and distribution systems and effectively extracting risk characteristics is relatively limited. This is a shortcoming of existing technologies. Summary of the Invention

[0004] The technical problem this invention aims to solve is to provide a risk feature extraction method for main and distribution microgrids, addressing the aforementioned problems in existing technologies. On one hand, risk feature extraction not only identifies which nodes are more likely to become key influencing factors in risk scenarios but also constructs an interpretative model of the dominant risk factors, assisting power grid operators in developing source-oriented preventative control strategies. On the other hand, it constructs a risk assessment index system for main and distribution microgrids, providing a reference for risk assessment of actual power grid operation systems.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A risk feature extraction method for primary and secondary microgrids includes the following steps: Construct output probability models for wind power, photovoltaics, and loads, as well as operation models for system components. Based on the output probability models and operation models, use the sequential Monte Carlo method to generate multiple operation scenarios that comprehensively consider the fault and repair states of system components and incorporate the output randomness of wind power, photovoltaics, and loads. Establish an optimized scheduling model covering both active and reactive power for each operational scenario; The decision variables and constraints of the scheduling model are determined, and then the optimal solution of the decision variables is obtained by optimization under each operating scenario. Based on the values ​​of the decision variables, power flow calculation is carried out to solve the physical quantities of each state of the system. Risk criteria are established and risk status is judged for features under various operating scenarios to obtain corresponding risk datasets. The risk datasets are then input into a random forest algorithm model for quantitative analysis to obtain the importance of each feature to the risk, thereby obtaining the importance score and influence mechanism of the system risk features. A risk quantification assessment method was determined, and a multi-level risk indicator system was constructed based on the importance score and impact mechanism of system risk characteristics.

[0006] Furthermore, when constructing the output probability models for wind power, photovoltaics, and loads, as well as the operating models for system components, the formula for the wind power output probability model is:

[0007]

[0008] The formula for the photovoltaic power output probability model is:

[0009]

[0010] The formula for the load output probability model is:

[0011] in, Represents the Gamma function; Let t be the wind speed; , This represents the shape and scale parameters of Weibull; , Indicates the average wind speed and standard deviation; , They represent Forecast values ​​of photovoltaic power at any given time and maximum output of photovoltaic power; , These are the shape parameters for Beta; , These represent the average and standard deviation of photovoltaic power output, respectively. Represents the active power of the load node and reactive power A set; , Representing variables The mean and standard deviation; The formula for the component fault state model in the system component operation model is:

[0012] The formula for the component repair rate model in the system component operation model is:

[0013] in, This represents the probability that a component is in a faulty state at time t; This represents the probability that a component will recover from a faulty state at time t. Indicates the failure rate of the component; , These are the fitting parameters; This represents the component repair probability.

[0014] Furthermore, based on the aforementioned output probability model and operating model, and using the sequential Monte Carlo method to generate multiple operating scenarios that comprehensively consider the fault and repair states of system components while incorporating the output randomness of wind power, photovoltaics, and loads, the process includes the following steps: Set initial time And all components are in normal operating condition; At the current moment, obtain the current state of each component. If the component is operating normally, call the component fault state model and generate the pre-fault duration that follows an exponential distribution based on its fault rate. If the component is out of service due to a fault, call the component repair rate model and generate the repair duration that follows an exponential distribution based on its repair rate. Take the minimum value of the state duration of all components as the time interval for the next state transition, and then determine the time of the next transition. Update the state of the component that has undergone a state transition, keep the states of other components unchanged, and record the constant system state within this time period. At the same time, consider the randomness of the output of wind power, photovoltaic power and load in each time period, and call the wind power output probability model, photovoltaic power output probability model and load output probability model to calculate the output of wind power, photovoltaic power and load in the corresponding time period. Finally, update the current time to the next transition time. Jump to the current time to obtain the current state of each component until the current time reaches the set total simulation time, and complete the generation of the scenario.

[0015] Furthermore, when establishing an active-reactive power optimization scheduling model for each operating scenario, specifically, under each operating scenario, active power scheduling is first performed with the objective function of minimizing system operating costs. This determines the output power of each generator unit, distributed photovoltaic, and wind power, the chargeable and dischargeable energy storage, and the active power of loads and load shedding. Subsequently, based on active power scheduling, reactive power scheduling is performed with the objective function of minimizing network losses. This determines the output power of each generator unit, distributed photovoltaic, and wind power, the chargeable and dischargeable energy storage, and the reactive power of loads and load shedding, thus establishing an active-reactive power scheduling model. The formula for the objective function of active power scheduling is:

[0016] in, This represents the total number of generators in the main grid; T represents the total time. Expressed as the output cost of the wind turbine unit; Expressed as the output cost of the photovoltaic unit; Expressed as load shedding cost; Expressed as the cost of energy storage charging; Expressed as the cost of energy storage and discharge; This represents the microgrid load shedding at time t; Represented as The load shedding power of all load nodes in the distribution network except for microgrid nodes at any given time; Indicates the mainnet number Power output of the generator unit at time t; This is expressed as wind power output; This is indicated as photovoltaic power output; Expressed as energy storage discharge power; This is expressed as energy storage charging power; This is expressed as the cost coefficient of the generator set.

[0017] The objective function for reactive power scheduling is formulated as follows: The formula for defining the objective function is:

[0018] in, This is represented as network overhead during system operation; For nodes Flow to Node The power; Represented as nodes The voltage vector; , They are nodes , The conjugate of the voltage vector; Let be the ground susceptance of node i; For nodes , Admittance of the line between them.

[0019] Furthermore, the decision variables for minimizing system operating costs, as set by the scheduling model according to the objective function, include: generator output. , Wind turbine output Photovoltaic unit output Energy storage charging power Discharge power load shedding power , ; The constraints of the scheduling model include: The energy storage charge and discharge constraints are given by the following formula:

[0020] The output constraints for wind and solar power are given by the following formula:

[0021] Shear load constraint, the formula is:

[0022] The system power balance constraint is given by the following formula:

[0023] Current flow constraint, the formula is:

[0024] in, This represents the total number of mainnet nodes; This represents the total number of distribution network nodes; Represented as the total number of microgrids; for The amount of energy that can be stored at any time; Indicates the maximum power for energy storage discharge and charging; This indicates the efficiency of energy storage discharge and charging; Indicates energy storage Constantly monitoring discharge and charging status; This indicates the self-loss rate of energy storage; These represent the maximum and minimum power output of wind power and the maximum and minimum power output of photovoltaic power, respectively. Indicates the first Initial load; Represented as the first Load power; definition Indicates the first The initial amount of reactive power for each load; Represented as the first One reactive load power; Represented as the first The power cut-off of each reactive load; Represented as the first Maximum resection ratio; This is expressed as the total output of the system units; Represented as total system load; , They are nodes , The node voltage; , For impedance parameters; For generator sets The active power; For generator sets reactive power; For load nodes The reactive power demand.

[0025] Furthermore, the risk criteria include: The voltage over-limit criterion is expressed by the following formula:

[0026] The formula for determining whether a distribution transformer load exceeds its limit is as follows:

[0027] The reverse load over-limit criterion is expressed by the following formula:

[0028] The criterion for exceeding the line power limit is as follows:

[0029] in, Represented as nodes The voltage value; and These are represented as the upper and lower limits of the voltage value, respectively. and They are respectively Time of the first The load and rated capacity of each distribution transformer; It is the threshold for the distribution transformer load to exceed the limit; Let t represent the total output of the distributed energy source at time t; This refers to the load power excluding distributed energy output; This is the maximum permissible reverse power threshold that the system can withstand; and These represent the allowed active power to be transmitted by the line and its maximum value, respectively.

[0030] Furthermore, the features in the risk dataset include the active and reactive power values ​​of each node in the main distribution network and the output value of distributed power sources in the microgrid. A label of 0 indicates no risk occurred in the operating scenario, and a label of 1 indicates a risk occurred in the operating scenario. When the risk dataset is input into a random forest algorithm model for quantitative analysis to determine the importance of each feature to the risk, the importance is specifically calculated based on the cumulative Gini gain contribution of each feature in the tree node. The formula for calculating feature importance is:

[0031] in, Represented as a node index; Represented as a feature; Represented as nodes Characteristics The reduction in impurity during segmentation; Represented as the total number of decision trees; An index representing a single decision tree; Represented as features A segmented set of nodes; The importance of a feature is represented by its characteristics.

[0032] Furthermore, the multi-level risk indicator system includes a risk indicator system at the microgrid level, comprising: The risk of renewable energy consumption is calculated using the following formula:

[0033]

[0034] The formula for load shedding risk is:

[0035] Flexibility risk, the formula is:

[0036]

[0037] in, This represents the total number of photovoltaic units. This represents the total number of wind turbine units. Total energy storage capacity; for The risk of light loss at all times; for The risk of wind curtailment is ever-present; for The risk of load shedding in microgrids at any given moment; , They represent Risks related to the upward and downward flexibility of the microgrid; For the first Under each operating mode Time of the first The predicted output of a single photovoltaic unit; For the first Under each operating mode Time of the first The predicted output of a wind power plant; For the first Under each operating mode Time of the first The actual output of each photovoltaic unit; For the first Under each operating mode Time of the first The actual output of each wind power unit; Represented as Total load of microgrid at any time; Represented as the first Under each operating mode The load shedding capacity of the microgrid at any given time; , Indicates the first The maximum value of energy storage charging and discharging; , Represented as the first The system state of the first The charging and discharging power of an energy storage unit at a given time (t); , The first The maximum and minimum values ​​of the energy stored; Let t be the amount of energy stored at time t.

[0038] Furthermore, the multi-level risk indicator system includes a risk indicator system at the distribution network level, comprising: The risk of exceeding power limits is calculated using the following formula:

[0039] The reactive power compensation margin risk is calculated using the following formula:

[0040] Power supply reliability risk, the formula is:

[0041] The formula for load shedding risk is:

[0042] The risk of reverse load exceeding limits is calculated using the following formula:

[0043] The risk of voltage exceeding limits is calculated using the following formula:

[0044] in, Number of distribution networks; Indicates the total number of distribution network lines; Indicates the number of reactive power compensation devices in the distribution network; This represents the total number of distribution network nodes; express Risk of power exceeding limits on distribution network lines at all times; express Risk of reactive power compensation margin in power distribution network at all times; express Risks to the reliability of power distribution network supply at all times; for The risk of load shedding in the distribution network at any time; Risk of reverse load exceeding limits; For the first Under each operating mode Real-time distribution network lines The power flowing through it; express Real-time distribution network lines The maximum power that it can withstand; For the first Under each operating mode Time of the first The output of the reactive power compensation device; express Time of the first The maximum capacity of a single reactive power compensation device; express Maximum load at any given time; Represented as the first Under each operating mode The load that is supplied at all times; Represented as Total load of the distribution network at all times; Represented as the first Under each operating mode The load shedding volume of the distribution network at all times; , The first Total output and load of new energy sources under various system conditions; , , They represent the first Under each operating mode Distribution network nodes The voltage and its upper and lower limits.

[0045] Furthermore, the multi-level risk indicator system includes a risk indicator system at the mainnet level, comprising: Carbon emission risk, the formula is:

[0046] Unit flexibility risk, the formula is:

[0047]

[0048] The risk of insufficient power factor is calculated using the following formula:

[0049] The formula for network loss benefit risk is:

[0050] The formula for exceeding the line power limit is:

[0051] The risk of voltage exceeding limits is calculated using the following formula:

[0052] in, Indicates the total number of main network lines; Number of mainnet units; Indicates the total number of mainnet nodes; express Carbon emission risks of time-based systems; express Risk of insufficient power factor in time-of-flight systems; Mainnet Risks of network loss and efficiency loss at any time; , They represent Upward and downward flexibility risks of the time-of-use crew; express Risk of main network line power exceeding limit at all times; , Represented as the first Under each operating mode Total carbon emissions and carbon emission quotas of the time-based system; Indicates the unit The rate of climb; , They represent the generating units. Maximum output and the first Under each operating mode System status at all times The effort put in; , They represent the first Under each operating mode The power factor deviation and the maximum power deviation at each moment; , Represented as the first Network loss and load of the main network under each operating mode; , Represented as the first Under each operating mode Timetable The power flowing through it and the maximum power that the line can withstand; , , They represent the first Under each operating mode Mainnet Nodes The voltage and its upper and lower limits.

[0053] Compared with the prior art, the advantages of the present invention are as follows: This invention generates collaborative scenarios involving both source-load dual uncertainties and component timing failures using the sequential Monte Carlo method. It then employs the random forest algorithm to uncover the implicit mapping between operational characteristics and risk states, overcoming the limitations of traditional indicator systems that "only assess but do not trace the source," thus providing interpretable decision-making basis for preventative control. Furthermore, it establishes a three-tiered indicator system covering microgrid absorption capacity, distribution network power supply quality, and main grid operational efficiency, achieving comprehensive quantification from micro-equipment status to macro-system risk.

[0054] This invention utilizes an exponential distribution to characterize the component failure-repair timing process during the scenario generation phase; and embeds an active-reactive power collaborative optimization scheduling model during the risk assessment phase, using the optimization results to drive power flow calculations and obtain risk index values. This "simulation-optimization-assessment" closed-loop mechanism ensures that the risk index not only reflects the static probability of exceeding limits but also embodies the dynamic response characteristics of the system's proactive control capabilities.

[0055] This invention effectively identifies key risk factors through a multi-decision tree voting mechanism of random forest, achieving an organic unity between data-driven objectivity and professional judgment in the power system, and providing quantitative support for building source-oriented risk warning and lean control strategies. Attached Figure Description

[0056] Figure 1 This is a flowchart of a method according to an embodiment of the present invention.

[0057] Figure 2 This is a table showing the importance score and impact explanation of system risk characteristics in this embodiment of the invention.

[0058] Figure 3 This is a schematic diagram of the multi-level risk indicator system constructed in an embodiment of the present invention. Detailed Implementation

[0059] The present invention will be further described below with reference to the accompanying drawings and specific preferred embodiments, but this does not limit the scope of protection of the present invention.

[0060] This embodiment proposes a risk feature extraction method for main-distribution microgrids. First, it constructs a new energy output probability model and a system component operation model, using the sequential Monte Carlo method to generate multiple system operation scenarios. Then, it determines active and reactive power scheduling optimization models, where active power optimization aims to minimize system operating costs, and reactive power optimization aims to minimize network losses. Next, it determines the decision variables and constraints of the scheduling evaluation model and solves for the physical quantities of each system state through power flow calculation. Then, it constructs risk criteria and generates datasets for risk states in each scenario, inputting them into a random forest algorithm model to quantitatively analyze the risk importance of system features, deriving the importance score and impact mechanism of system risk features. Finally, it determines the risk quantification assessment method and constructs a multi-level risk indicator system based on the importance score and impact mechanism of system risk features. On the one hand, it comprehensively constructs a risk assessment indicator system for main-distribution microgrids, providing a reference for risk assessment of actual power grid operation systems. On the other hand, risk feature extraction not only identifies which nodes are more likely to become key influencing factors in risk scenarios but also constructs explanatory models of risk-dominant factors, assisting power grid operators in developing source-oriented preventative control strategies.

[0061] like Figure 1 As shown, the method includes the following steps: S1) Construct output probability models for wind power, photovoltaics, and loads, as well as operation models for system components. Based on the output probability models and operation models, use the sequential Monte Carlo method to generate multiple operation scenarios that comprehensively consider the fault and repair states of system components and incorporate the output randomness of wind power, photovoltaics, and loads. S2) Establish an optimized scheduling model covering active and reactive power for each operating scenario; S3) Determine the decision variables and constraints of the scheduling model, then perform optimization and solution in each operating scenario to obtain the optimal solution of the decision variables, and perform power flow calculation based on the values ​​of the decision variables to solve for the physical quantities of each state of the system; S4) Establish risk criteria and determine the risk status of features under each operating scenario to obtain the corresponding risk dataset. Input the risk dataset into the random forest algorithm model for quantitative analysis to obtain the importance of each feature to the risk, thereby obtaining the importance score and influence mechanism of the system risk features. S5) Determine the risk quantification assessment method and construct a multi-level risk indicator system based on the importance score and impact mechanism of system risk characteristics.

[0062] This embodiment, through step S1, constructs a probability model for wind power, photovoltaic power, and load output, as well as an operational model for system components. Using the sequential Monte Carlo method, it comprehensively considers the fault and repair states of wind turbines, photovoltaic units, energy storage devices, power lines, and generator sets, while also incorporating the randomness of wind power, photovoltaic power, and load output to generate multiple operational scenarios, including the following steps: S11: Establish probabilistic models for wind power, photovoltaic power, and load output; definition Represents the Gamma function; definition Let t be the wind speed; definition , This represents the shape and scale parameters of Weibull; definition , This represents the average wind speed and standard deviation.

[0063] definition , They represent Forecast values ​​of photovoltaic power at any given time and maximum output of photovoltaic power; definition , These are the shape parameters for Beta; definition , These represent the average and standard deviation of photovoltaic power output, respectively.

[0064] definition Represents the active power of the load node and reactive power A set; definition , Representing variables The mean and standard deviation.

[0065] The formula for defining the wind power output probability model is as follows: (1) (2) The formula for defining the photovoltaic power output probability model is as follows: (3) (4) The formula for defining the load output probability model is as follows: (5) S12: Establish the operating model of system components definition This represents the probability that a component is in a faulty state at time t; definition This represents the probability that a component will change from a faulty state to a normal state at time t. definition Indicates the failure rate of the component; definition , These are the fitting parameters; definition This represents the component repair probability.

[0066] The formula for defining the component failure state model is as follows: (6) The formula for defining the component repair rate model is as follows: (7) Next, based on the output probability model and operation model, the sequential Monte Carlo method is used to generate multiple operation scenarios that comprehensively consider the fault and repair states of system components, while incorporating the output randomness of wind power, photovoltaics, and loads. This includes the following steps: S13: System Components and Status Definitions: Define the wind turbine, photovoltaic unit, energy storage equipment, line and generator set to consider only two states: "normal operation" and "fault operation"; S14: Simulation Parameter Determination: Determine the reliability parameters of each component, including fault parameters and repair parameters, and determine the total simulation time; S15: First, set the initial time. And all components are in normal operating condition; At the current moment, obtain the current state of each component. If the component is operating normally, call the component fault state model and generate the pre-fault duration that follows an exponential distribution based on its fault rate. If the component is out of service due to a fault, call the component repair rate model and generate the repair duration that follows an exponential distribution based on its repair rate. Take the minimum value of the state duration of all components as the time interval for the next state transition, and then determine the time of the next transition. S16: Update the state of the component that has undergone a state transition (from normal to fault or from fault to normal), keep the states of other components unchanged, and record the constant system state within this time period. At the same time, consider the randomness of the output of wind power, photovoltaic and load in each time period, call the wind power output probability model, photovoltaic output probability model and load output probability model to calculate the output of wind power, photovoltaic and load in the corresponding time period; finally, update the current time to the next transition time; jump to step S15 to execute the step of obtaining the current state of each component at the current time until the current time reaches the set total simulation time, and complete the generation of the scenario.

[0067] In step S2 of this embodiment, under each operating scenario, active power scheduling is first performed with the objective function of minimizing system operating costs. This determines the output power of each generator set, distributed photovoltaic power, wind power, the chargeable and dischargeable energy storage, and the active power of loads and load shedding. Subsequently, based on active power scheduling, reactive power scheduling with the minimum network loss is performed. This determines the output power of each generator set, distributed photovoltaic power, wind power, the chargeable and dischargeable energy storage, and the reactive power of loads and load shedding, establishing an active and reactive power scheduling model, including the following steps: S21: During the active power dispatch process, construct a function with the objective of minimizing the sum of the main grid unit operating cost, distribution network and microgrid load shedding cost, photovoltaic and wind power output cost, and energy storage charging and discharging cost. Solve the function to obtain the output power of each generator unit, distributed photovoltaic and wind power, energy storage charging and discharging capability, load and load shedding active power. definition This indicates the total number of generators in the main grid. Define T as the total time; definition Expressed as the output cost of the wind turbine unit; definition Expressed as the output cost of the photovoltaic unit; definition Expressed as load shedding cost; definition Expressed as the cost of energy storage charging; definition Expressed as the cost of energy storage and discharge; definition This represents the microgrid load shedding at time t.

[0068] definition Represented as The load shedding power of all load nodes in the distribution network except for microgrid nodes at any given time; definition Indicates the mainnet number Output of the generator unit at time t.

[0069] definition This is expressed as wind power output; definition This is indicated as photovoltaic power output; definition Expressed as energy storage discharge power definition This is expressed as the energy storage charging power.

[0070] definition This is expressed as the cost coefficient of the generator set.

[0071] The formula for defining the objective function is: (8) S22: During the reactive power dispatch process, by adjusting the reactive power allocation of each component of the system, an objective function that minimizes the network loss of the system is constructed, thereby determining the output power of each generator set, distributed photovoltaic, wind power, the rechargeable and dischargeable energy storage, the load and the reactive power of load shedding; definition This is represented as network overhead during system operation; definition For nodes Flow to Node The power; definition Represented as nodes The voltage vector; , They are nodes , The conjugate of the voltage vector; Let be the ground susceptance of node i; For nodes , Admittance of the line between them.

[0072] The formula for defining the objective function is: (9) The formula for calculating line transmission power is defined as follows: (10) S23: Determine the main and distribution network scheduling model: For each operating scenario, firstly, active power scheduling is performed with the objective function of minimizing system operating costs. This determines the output power of each generator set, distributed photovoltaic and wind power, the chargeable and dischargeable energy storage, and the active power of loads and load shedding. Then, based on the active power scheduling, reactive power scheduling is performed with the goal of minimizing network losses. This determines the output power of each generator set, distributed photovoltaic and wind power, the chargeable and dischargeable energy storage, and the reactive power of loads and load shedding, thus establishing an active and reactive power scheduling model.

[0073] In this embodiment, after determining the decision variables and constraints of the scheduling evaluation model in step S3, optimization solutions are performed using the YALMIP solver under various operating scenarios, and the physical quantities of each system state are obtained using power flow calculations. The steps include: S31: The decision variables for minimizing system operating cost set by the objective function in the scheduling model include: generator output. , Wind turbine output Photovoltaic unit output Energy storage charging power Discharge power load shedding power , ; S32: The active power scheduling constraints of the scheduling evaluation model include: (1) energy storage charging and discharging constraints, (2) photovoltaic and wind power output constraints, (3) load shedding power constraints, and (4) system power balance constraints; the reactive power scheduling constraints include power flow constraints. definition This represents the total number of mainnet nodes; definition This represents the total number of distribution network nodes; definition Represented as the total number of microgrids; definition for The amount of energy that can be stored at any time; definition Indicates the maximum power for energy storage discharge and charging; definition This indicates the efficiency of energy storage discharge and charging; definition Indicates energy storage Constantly monitoring discharge and charging status; definition This indicates the self-loss rate of energy storage.

[0074] definition These represent the maximum and minimum power output of wind power and the maximum and minimum power output of photovoltaic power, respectively.

[0075] definition Indicates the first The initial amount of active power of each load; definition Represented as the first The active power of each load; definition Indicates the first The initial amount of reactive power for each load; definition Represented as the first One reactive load power; definition Represented as the first The power cut-off of each reactive load; definition Represented as the first Maximum resection ratio; definition This is expressed as the total output of the system units; definition Represented as total system load; definition , They are nodes , The node voltage; definition , For impedance parameters; definition For generator sets The active power; definition For generator sets reactive power; definition For load nodes The reactive power demand; The formula for defining the energy storage charge and discharge constraints is: (11) The output constraints for wind power and solar power are defined as follows: (12) Define the load shedding constraint as follows: (13) The system power balance constraint is: (14) Current constraints are: (15) S33: In each operating scenario, the values ​​of each decision variable are obtained by solving the YALMIP solver, and the physical quantities of each state of the system are obtained by power flow calculation.

[0076] This embodiment, through step S4, first constructs risk criteria, then determines the risk state and forms a risk dataset based on the system state physical quantities under various operating scenarios; then, it inputs this dataset into a random forest algorithm model, and finally quantitatively analyzes and derives the importance of each system feature to the risk. The steps include: S41: By investigating the historical operating data of the integrated main and distribution network system, risk criteria are established in three aspects: voltage, load, and power transmission, to determine the system's operational risks. Subsequently, for the power flow calculation results obtained from the optimized scheduling of each operating scenario, the risk status is determined according to the preset risk criteria, thereby generating a risk dataset. In this dataset, a label of 0 indicates that no risk has occurred in the scenario, and a label of 1 indicates that a risk has occurred in the scenario.

[0077] definition Represented as nodes The voltage value; definition and These are represented as the upper and lower limits of the voltage value, respectively. definition and They are respectively Time of the first The load and rated capacity of each distribution transformer; definition It is the threshold for the distribution transformer load to exceed the limit; definition Let t represent the total output of the distributed energy source at time t; definition This refers to the load power excluding distributed energy output; definition This is the maximum permissible reverse power threshold that the system can withstand; definition and These represent the allowed active power to be transmitted by the line and its maximum value, respectively.

[0078] The formula for defining voltage over-limit is: (16) The formula for defining the overload limit of a distribution transformer is: (17) The formula for defining reverse load over-limit is: (18) The formula for defining line power exceeding the limit is: (19) S42: Use the risk dataset generated above as the training dataset for the random forest algorithm. The dataset features active and reactive power values ​​of each node in the main distribution network and the output values ​​of distributed power sources in the microgrid. Each time, take samples with replacement from the training dataset to construct a subset dataset and train a decision tree. When a node in the decision tree needs to split, randomly select a subset from the dataset... Select from the feature attributes Each attribute satisfies the condition. Then, information gain is used to select one attribute from these m attributes as the splitting attribute for that node; by following the above steps, a large number of decision trees are built, thus forming a random forest; S43: In the specific implementation process, the model learns the complex mapping relationship between input features (i.e., node load) and output risk labels through the construction of multiple decision trees and a voting mechanism. After the model training is completed, the influence of each feature on the prediction of operational risk can be quantified by evaluating the importance contribution of each feature to splitting nodes during the construction process (such as the degree of information gain or Gini index reduction). The final result is a table showing the importance score and impact explanation of the risk features of the primary and secondary microgrids, as shown below. Figure 2 As shown.

[0079] definition Represented as node index definition Represented as a feature; definition Represented as nodes Characteristics The reduction in impurity during segmentation; definition Represented as the total number of decision trees; definition An index representing a single decision tree; definition Represented as features A segmented set of nodes; definition The importance of features is expressed as a feature; The cumulative Gini gain contribution of each feature in the tree node is calculated using the following formula: (20) Depend on Figure 2 As shown in the importance score and impact explanation table, by quantifying the characteristic importance and impact mechanism of key features such as node voltage and new energy output fluctuations, risk indicators for main grid, distribution grid and microgrid can be derived. For example, node voltage deviation corresponds to the voltage limit risk of the main grid and distribution grid, line load rate corresponds to the line power limit risk, PV / PT output fluctuation corresponds to the new energy consumption risk of the microgrid, energy storage SOC corresponds to the energy storage flexibility risk of the microgrid, and adjustable load ratio and node load correspond to the load shedding risk of the distribution grid and microgrid. Finally, a comprehensive risk classification system for main grid, distribution grid and microgrid is formed.

[0080] Based on the importance of each feature obtained from the above steps to risk, this embodiment, when determining the risk quantification assessment method and constructing a multi-level risk indicator system in step S5, specifically includes the following steps: S51: Determine the method for quantifying and assessing risks; definition To indicate the current operating mode of the system; definition This indicates the system's state under this operating mode; definition Represents the set of system states; definition Indicates the first The probability of each state occurring; definition Indicates the status under the current operating mode. Corresponding severity level; definition For the first Risk values ​​for each system's operating mode; The formula for risk quantification assessment is defined as follows: (twenty one) S52: Construct a risk indicator system at the microgrid level; definition This represents the total number of photovoltaic units. definition This represents the total number of wind turbine units. definition Total energy storage capacity; definition for The risk of light loss at all times; definition for The risk of wind curtailment is ever-present; definition for The risk of load shedding in microgrids at any given moment; definition , They represent Risks related to the upward and downward flexibility of the microgrid; definition For the first Under each operating mode Time of the first The predicted output of a single photovoltaic unit; definition For the first Under each operating mode Time of the first The predicted output of a wind power plant; definition For the first Under each operating mode Time of the first The actual output of each photovoltaic unit; definition For the first Under each operating mode Time of the first The actual output of each wind power unit; definition Represented as Total load of microgrid at any time; definition Represented as the first Under each operating mode The load shedding capacity of the microgrid at any given time; definition , Indicates the first The maximum value of energy storage charging and discharging; definition , Represented as the first The system state of the first The charging and discharging power of an energy storage unit at a given time (t); definition , The first The maximum and minimum values ​​of the energy stored; definition Let be the amount of energy stored at time t; The formula for defining the risk of renewable energy consumption is as follows: (twenty two) (twenty three) The formula for defining load shedding risk is: (twenty four) The formula for defining flexibility risk is: (25) (26) S53: Constructing a risk indicator system for power distribution networks definition Number of distribution networks; definition Indicates the total number of distribution network lines; definition Indicates the number of reactive power compensation devices in the distribution network; definition express Risk of power exceeding limits on distribution network lines at all times; definition express Risk of reactive power compensation margin in power distribution network at all times; definition express Risks to the reliability of power distribution network supply at all times; definition for The risk of load shedding in the distribution network at any time; definition Risk of reverse load exceeding limits; definition express Risk of main network line power exceeding limit at all times; definition For the first Under each operating mode Real-time distribution network lines Power flowing through definition express Real-time distribution network lines The maximum power that it can withstand; definition For the first Under each operating mode Time of the first The output of the reactive power compensation device; definition express Time of the first The maximum capacity of a single reactive power compensation device; definition express Maximum load at any given time; definition Represented as the first Under each operating mode The load that is supplied at all times; definition Represented as Total load of the distribution network at all times; definition Represented as the first Under each operating mode The load shedding volume of the distribution network at all times; definition , The first Total output and load of new energy sources under various system conditions.

[0081] definition , , They represent the first Under each operating mode Distribution network nodes The voltage and its upper and lower limits; The formula for defining the risk of line power exceeding the limit is: (27) The formula for defining reactive power compensation margin risk is: (28) The formula for defining power supply reliability risk is: (29) The formula for defining load shedding risk is: (30) The formula for defining reverse load exceeding the limit risk is: (31) The formula for defining voltage over-limit risk is: (32) S54: Constructing a Risk Indicator System for the Mainnet definition Indicates the total number of main network lines; definition Indicates the total number of mainnet nodes; definition Number of mainnet units; definition express Carbon emission risks of time-based systems; definition express Risk of insufficient power factor in time-of-flight systems; definition Mainnet Risks of network loss and efficiency loss at any time; definition , They represent Upward and downward flexibility risks of the time-of-use crew; definition express Risk of main network line power exceeding limit at all times; definition , Represented as the first Under each operating mode The total carbon emissions and carbon emission quotas of the time system.

[0082] definition Represented as generator unit The rate of climb; definition , They represent the generating units. Maximum output and the first Under each operating mode System status at all times The effort put in.

[0083] definition , They represent the first Under each operating mode The power factor deviation and the maximum power deviation at time t.

[0084] definition , Represented as the first Network loss and load of the main network under each operating mode.

[0085] definition , Represented as the first Under each operating mode Timetable The power flowing through it and the maximum power that the line can withstand; definition , , They represent the first Under each operating mode Mainnet Nodes The voltage and its upper and lower limits; The formula for defining carbon emission risk is: (33) The formula for defining unit flexibility risk is: (34) (35) The formula for defining the risk of insufficient power factor is: (36) The formula for defining network loss benefit risk is: (37) The formula for defining line power exceeding the limit is: (38) The formula for defining voltage over-limit risk is: (39) Through the above steps, a multi-level risk indicator system is established as follows: Figure 3 As shown.

[0086] Furthermore, this embodiment also proposes a risk feature extraction method for primary and secondary microgrids, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in this embodiment.

[0087] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0088] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A method for extracting risk features of a primary-distribution microgrid, characterized in that, Includes the following steps: Construct output probability models for wind power, photovoltaics, and loads, as well as operation models for system components. Based on the output probability models and operation models, use the sequential Monte Carlo method to generate multiple operation scenarios that comprehensively consider the fault and repair states of system components and incorporate the output randomness of wind power, photovoltaics, and loads. Establish an optimized scheduling model covering both active and reactive power for each operational scenario; The decision variables and constraints of the scheduling model are determined, and then the optimal solution of the decision variables is obtained by optimization in each operating scenario. Power flow calculation is carried out based on the values ​​of the decision variables to solve for the physical quantities of each state of the system. Risk criteria are established and risk status is judged for features under various operating scenarios to obtain corresponding risk datasets. The risk datasets are then input into a random forest algorithm model for quantitative analysis to obtain the importance of each feature to the risk, thereby obtaining the importance score and influence mechanism of the system risk features. A risk quantification assessment method was determined, and a multi-level risk indicator system was constructed based on the importance score and impact mechanism of system risk characteristics.

2. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, When constructing the output probability models for wind power, photovoltaics, and loads, as well as the operating models for system components, the formula for the wind power output probability model is: The formula for the photovoltaic power output probability model is: The formula for the load output probability model is: in, Represents the Gamma function; Let t be the wind speed; , This represents the shape and scale parameters of Weibull; , Indicates the average wind speed and standard deviation; , They represent Forecast values ​​of photovoltaic power at any given time and maximum output of photovoltaic power; , These are the shape parameters for Beta; , These represent the average and standard deviation of photovoltaic power output, respectively. Represents the active power of the load node and reactive power A set; , Representing variables The mean and standard deviation; The formula for the component fault state model in the system component operation model is: The formula for the component repair rate model in the system component operation model is: in, This represents the probability that a component is in a faulty state at time t; This represents the probability that a component will recover from a faulty state at time t. Indicates the failure rate of the component; , These are the fitting parameters; This represents the component repair probability.

3. The risk feature extraction method for primary and secondary microgrids according to claim 2, characterized in that, Based on the aforementioned output probability model and operating model, and using the sequential Monte Carlo method to generate multiple operating scenarios that comprehensively consider the fault and repair states of system components while incorporating the output randomness of wind power, photovoltaics, and loads, the following steps are included: Set initial time And all components are in normal operating condition; At the current moment, obtain the current state of each component. If the component is operating normally, call the component fault state model and generate the pre-fault duration that follows an exponential distribution based on its fault rate. If the component is out of service due to a fault, call the component repair rate model and generate the repair duration that follows an exponential distribution based on its repair rate. Take the minimum value of the state duration of all components as the time interval for the next state transition, and then determine the time of the next transition. Update the state of the component that has undergone a state transition, keep the states of other components unchanged, and record the constant system state within this time period. At the same time, consider the randomness of the output of wind power, photovoltaic power and load in each time period, and call the wind power output probability model, photovoltaic power output probability model and load output probability model to calculate the output of wind power, photovoltaic power and load in the corresponding time period. Finally, update the current time to the next transition time. Jump to the current time to obtain the current state of each component until the current time reaches the set total simulation time, and complete the generation of the scenario.

4. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, When establishing an active-reactive power optimization scheduling model for each operating scenario, specifically, under each operating scenario, active power scheduling is first performed with the objective function of minimizing system operating costs. This determines the output power of each generator unit, distributed photovoltaic and wind power, the chargeable and dischargeable energy storage, and the active power of loads and load shedding. Subsequently, based on the active power scheduling, reactive power scheduling is performed with the objective function of minimizing network losses. This determines the output power of each generator unit, distributed photovoltaic and wind power, the chargeable and dischargeable energy storage, and the reactive power of loads and load shedding, thus establishing an active-reactive power scheduling model. The formula for the objective function of active power scheduling is: in, This represents the total number of generators in the main grid; T represents the total time. Expressed as the output cost of the wind turbine unit; Expressed as the output cost of the photovoltaic unit; Expressed as load shedding cost; Expressed as the cost of energy storage charging; Expressed as the cost of energy storage and discharge; This represents the microgrid load shedding at time t; Represented as The load shedding power of all load nodes in the distribution network except for microgrid nodes at any given time; Indicates the mainnet number Power output of the generator unit at time t; This is expressed as wind power output; This is indicated as photovoltaic power output; Expressed as energy storage discharge power; This is expressed as energy storage charging power; This is expressed as the cost coefficient of the generator set; The objective function for reactive power scheduling is formulated as follows: The formula for defining the objective function is: in, This is represented as network overhead during system operation; For nodes Flow to Node The power; Represented as nodes The voltage vector; , They are nodes , The conjugate of the voltage vector; Let be the ground susceptance of node i; For nodes , Admittance of the line between them.

5. The risk feature extraction method for primary and secondary microgrids according to claim 4, characterized in that, The scheduling model, based on the objective function, sets decision variables that minimize system operating costs, including: generator output. , Wind turbine output Photovoltaic unit output Energy storage charging power Discharge power load shedding power , ; The constraints of the scheduling model include: The energy storage charge and discharge constraints are given by the following formula: The output constraints for wind and solar power are given by the following formula: Shear load constraint, the formula is: The system power balance constraint is given by the following formula: Current flow constraint, the formula is: in, This represents the total number of mainnet nodes; This represents the total number of distribution network nodes; Represented as the total number of microgrids; for The amount of energy that can be stored at any time; Indicates the maximum power for energy storage discharge and charging; This indicates the efficiency of energy storage discharge and charging; Indicates energy storage Constantly monitoring discharge and charging status; This indicates the self-loss rate of energy storage; These represent the maximum and minimum power output of wind power and the maximum and minimum power output of photovoltaic power, respectively. Indicates the first Initial load; Represented as the first Each load power; Indicates the first The initial amount of reactive power for each load; Represented as the first One reactive load power; Represented as the first The power cut-off of each reactive load; Represented as the first Maximum resection ratio; This is expressed as the total output of the system units; Represented as total system load; , They are nodes , The node voltage; , For impedance parameters; For generator sets The active power; For generator sets reactive power; For load nodes The reactive power demand.

6. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, The risk criteria include: The voltage over-limit criterion is expressed by the following formula: The formula for determining whether a distribution transformer load exceeds its limit is as follows: The reverse load over-limit criterion is expressed by the following formula: The criterion for exceeding the line power limit is as follows: in, Represented as nodes The voltage value; and These are represented as the upper and lower limits of the voltage value, respectively. and They are respectively Time of the first The load and rated capacity of each distribution transformer; It is the threshold for the distribution transformer load to exceed the limit; Let t represent the total output of the distributed energy source at time t; This refers to the load power excluding distributed energy output; This is the maximum permissible reverse power threshold that the system can withstand; and These represent the allowed active power to be transmitted by the line and its maximum value, respectively.

7. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, The features in the risk dataset include the active and reactive power values ​​of each node in the main distribution network and the output value of distributed power sources in the microgrid. A label of 0 indicates no risk occurred in the operating scenario, and a label of 1 indicates a risk occurred. When the risk dataset is input into a random forest algorithm model for quantitative analysis to determine the importance of each feature to the risk, the importance is specifically calculated based on the cumulative Gini gain contribution of each feature in the tree node. The formula for calculating feature importance is as follows: in, Represented as a node index; Represented as a feature; Represented as nodes Characteristics The reduction in impurity during segmentation; Represented as the total number of decision trees; An index representing a single decision tree; Represented as features A segmented set of nodes; The importance of a feature is represented by its characteristics.

8. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, The multi-level risk indicator system includes a risk indicator system at the microgrid level, comprising: The risk of renewable energy consumption is calculated using the following formula: The formula for load shedding risk is: Flexibility risk, the formula is: in, This represents the total number of photovoltaic units. This represents the total number of wind turbine units. Total energy storage capacity; for The risk of light loss at all times; for The risk of wind curtailment is ever-present; for The risk of load shedding in microgrids at any given moment; , They represent Risks related to the upward and downward flexibility of the microgrid; For the first Under each operating mode Time of the first The predicted output of a single photovoltaic unit; For the first Under each operating mode Time of the first The predicted output of a wind power plant; For the first Under each operating mode Time of the first The actual output of each photovoltaic unit; For the first Under each operating mode Time of the first The actual output of each wind power unit; Represented as Total load of microgrid at any time; Represented as the first Under each operating mode The load shedding capacity of the microgrid at any given time; , Indicates the first The maximum value of energy storage charging and discharging; , Represented as the first The system state of the first The charging and discharging power of an energy storage unit at a given time (t); , The first The maximum and minimum values ​​of the energy stored; Let t be the amount of energy stored at time t.

9. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, The multi-level risk indicator system includes a risk indicator system at the distribution network level, comprising: The risk of exceeding power limits is calculated using the following formula: The reactive power compensation margin risk is calculated using the following formula: Power supply reliability risk, the formula is: The formula for load shedding risk is: The risk of reverse load exceeding limits is calculated using the following formula: The risk of voltage exceeding limits is calculated using the following formula: in, Number of distribution networks; Indicates the total number of distribution network lines; Indicates the number of reactive power compensation devices in the distribution network; This represents the total number of distribution network nodes; express Risk of power exceeding limits on distribution network lines at all times; express Risk of reactive power compensation margin in power distribution network at all times; express Risks to the reliability of power distribution network supply at all times; for The risk of load shedding in the distribution network at any time; Risk of reverse load exceeding limits; For the first Under each operating mode Real-time distribution network lines The power flowing through it; express Real-time distribution network lines The maximum power that it can withstand; For the first Under each operating mode Time of the first The output of the reactive power compensation device; express Time of the first The maximum capacity of a single reactive power compensation device; express Maximum load at any given time; Represented as the first Under each operating mode The load that is supplied at all times; Represented as Total load of the distribution network at all times; Represented as the first Under each operating mode The load shedding volume of the distribution network at all times; , The first Total output and load of new energy sources under various system conditions; , , They represent the first Under each operating mode Distribution network nodes The voltage and its upper and lower limits.

10. The risk feature extraction method for primary and secondary microgrids according to claim 1, characterized in that, The multi-level risk indicator system includes a risk indicator system at the mainnet level, comprising: Carbon emission risk, the formula is: Unit flexibility risk, the formula is: The risk of insufficient power factor is calculated using the following formula: The formula for network loss benefit risk is: The formula for exceeding the line power limit is: The risk of voltage exceeding limits is calculated using the following formula: in, Indicates the total number of main network lines; Number of mainnet units; Indicates the total number of mainnet nodes; express Carbon emission risks of time-based systems; express Risk of insufficient power factor in time-of-flight systems; Mainnet Risks of network loss and efficiency loss at any time; , They represent Upward and downward flexibility risks of the time-of-use crew; express Risk of main network line power exceeding limit at all times; , Represented as the first Under each operating mode Total carbon emissions and carbon emission quotas of the time-based system; Indicates the unit The rate of climb; , They represent the generating units. Maximum output and the first Under each operating mode System status at all times The effort put in; , They represent the first Under each operating mode The power factor deviation and the maximum power deviation at each moment; , Represented as the first Network loss and load of the main network under each operating mode; , Represented as the first Under each operating mode Timetable The power flowing through it and the maximum power that the line can withstand; , , They represent the first Under each operating mode Mainnet Nodes The voltage and its upper and lower limits.