Method for evaluating flexibility of medium and low voltage distribution system facing multi-scenario typical networking

By combining action masking and reinforcement learning, the problems of computational complexity and single index in the evaluation of medium and low voltage power distribution systems are solved, enabling flexible evaluation of extreme scenarios and improving the accuracy and objectivity of the evaluation.

CN122456483APending Publication Date: 2026-07-24ECONOMIC TECH RES INST OF STATE GRID ANHUI ELECTRIC POWER
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ECONOMIC TECH RES INST OF STATE GRID ANHUI ELECTRIC POWER
Filing Date
2026-06-26
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies face challenges in assessing the flexibility of medium and low voltage power distribution systems, including computational complexity, limited evaluation metrics, and subjective evaluation results. These limitations make it difficult to effectively address the multi-source bidirectional power flow and random fluctuations of medium and low voltage power distribution systems, leading to biased evaluation results and insufficient regulation capabilities.

Method used

By constructing action masks to avoid disrupting topological physical connectivity, and combining reinforcement learning agents to output network dynamic reconstruction instructions, the system utilizes a closed-loop drive that calculates the difference and flexibility penalty in optimal power flow calculations to find the extreme operating trajectory, extracts flexibility physical indicators, and outputs a comprehensive evaluation index.

Benefits of technology

It effectively solves the computational explosion problem of traditional methods in complex reconstructed networks, realizes dynamic continuous physical boundary detection for flexibility assessment, improves the objectivity and accuracy of assessment, and can truly reflect the adjustment capability under extreme scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122456483A_ABST
    Figure CN122456483A_ABST
Patent Text Reader

Abstract

The application discloses a multi-scene typical networking-oriented flexibility evaluation method for a medium and low voltage power distribution system, relates to the technical field of power system distribution automation, and comprises the following steps: acquiring source and load time sequence data, topological parameters and candidate reconfiguration branches of networking, generating typical operation scenes, and splicing the scenes into a state vector; analyzing and checking the candidate reconfiguration branches, and generating an action mask for constraint topological connectivity; combining the action mask, outputting network dynamic reconfiguration instructions from an intelligent agent, calculating the operation cost difference before and after instruction execution and a flexibility shortage penalty amount; taking the sum of the operation cost difference and the flexibility shortage penalty amount as an iterative incentive to obtain a limit operation trajectory under safety constraints; and extracting flexibility physical indexes from the trajectory, fusing and calculating the flexibility physical indexes, and outputting a comprehensive evaluation index. The application effectively avoids invalid topological actions of the intelligent agent through the action mask, and improves optimization efficiency; meanwhile, the flexibility shortage is quantified as a dynamic penalty to drive closed-loop optimization, and scientific and objective evaluation of the flexibility of the power distribution system is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system distribution automation technology, and more specifically, to a method for evaluating the flexibility of medium and low voltage distribution systems for typical multi-scenario network configurations. Background Technology

[0002] The high proportion of distributed photovoltaic, wind power, and electric vehicles has transformed medium- and low-voltage power distribution systems from unidirectional radial networks to multi-source, bidirectional, active power distribution networks. The randomness and volatility of both the source and load sides lead to frequent operational risks such as voltage exceeding limits and line congestion. Scientifically quantifying the flexibility of the power distribution system (its adjustment potential to cope with supply and demand uncertainties) is crucial for grid upgrades and efficient operation.

[0003] Currently, the industry has conducted extensive research on the assessment and planning of distribution networks. Existing technologies mostly employ mathematical analytical optimization models (such as mixed-integer nonlinear programming) to calculate the static safety margin or economic cost of the system under given scenarios. However, facing increasingly complex medium- and low-voltage distribution systems, existing flexibility assessment methods have the following significant shortcomings: First, traditional optimization algorithms suffer from the curse of dimensionality and struggle to accommodate topology reconfiguration. The number of nodes and reconfigurable branches in medium- and low-voltage distribution networks is enormous. When using mathematical solvers such as mixed-integer nonlinear programming to collaboratively optimize candidate lines and equipment outputs, combinatorial explosion leads to a sharp increase in computation time. While introducing deep reinforcement learning can accelerate the process, the general-purpose agent lacks awareness of physical connectivity constraints, easily outputting invalid topology actions that cause system disconnection or islanding, generating a large number of invalid simulations, reducing convergence speed and solution feasibility.

[0004] Second, the evaluation indicators are too simplistic and lack dynamic quantification of insufficient regulation capacity. Existing systems often consider construction costs or steady-state voltage boundaries in isolation, failing to transform the flexibility deficit under net load fluctuations into a quantifiable economic penalty. This fails to accurately reflect the cost of regulation capacity exhaustion in extreme scenarios, leading to significant biases in the evaluation results.

[0005] Third, the evaluation results are highly subjective and lack a closed-loop mechanism driven by extreme physical characteristics. Existing evaluations mostly rely on subjective weighting by experts or listing conventional electrical parameters, without extracting key physical characteristics of extreme operating states such as network redundancy and the degree of net load fluctuation smoothing, and without establishing a comprehensive evaluation standard that integrates expert experience and data information entropy, resulting in a lack of objectivity and closed-loop verification in the evaluation results. Summary of the Invention

[0006] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a method for evaluating the flexibility of medium and low voltage power distribution systems for typical multi-scenario networking. By constructing an action mask to avoid illegal decisions that disrupt the physical connectivity of the topology, and by using a joint feedback closed loop of economic cost and flexibility shortage penalty to drive the optimization of the extreme trajectory, the present invention addresses the problems of traditional mathematical programming methods in solving complex reconfiguration networks, such as easy combinatorial explosion and difficulty in convergence, as well as the single dimension of evaluation indicators that are detached from actual dynamic operating scenarios.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for evaluating the flexibility of medium- and low-voltage power distribution systems for typical network configurations in multiple scenarios includes the following steps: acquiring source-load time-series data, topology parameters, and candidate reconfiguration branches of the network; generating multiple typical operating scenarios; concatenating the parameters of each scenario into a state vector; verifying candidate reconfiguration branches based on graph connectivity analysis; generating action masks that constrain topology connectivity; combining the action masks, outputting network dynamic reconfiguration instructions by a reinforcement learning agent; calculating the difference in operating costs before and after instruction execution and the flexibility shortage penalty through optimal power flow calculation; using the sum of the difference and the penalty as iterative incentives to optimize and obtain the extreme operating trajectory of the network under safety constraints; extracting flexibility physical indicators from the trajectory; and outputting a comprehensive evaluation index through fusion calculation.

[0008] In a preferred embodiment, the acquisition of source-load time-series data, topology parameters, and candidate reconfigurable branches of the network to generate multiple typical operating scenarios includes: extracting the predicted output of distributed renewable energy, the load power of each node, and the state of charge of the battery energy storage system in the network as environmental time-series features; extracting the node voltage amplitude and line load rate of the power distribution system as safety constraint features; and extracting the branch connection relationship of the initial topology and the opening and closing identifiers of the candidate reconfigurable branches as discrete topology features.

[0009] In a preferred embodiment, concatenating the scenario parameters into a state vector includes: applying linear normalization to the environmental time-series features and binary encoding to the discrete topology features; employing nonlinear boundary-sensitive encoding based on physical safety red lines for the safety constraint features, whereby the encoded mapping value is exponentially amplified when the node voltage amplitude or line load rate approaches a preset safety limit threshold; and concatenating the processed environmental time-series features, discrete topology features, and safety constraint features into a state vector according to a preset dimension.

[0010] In a preferred embodiment, the step of verifying candidate reconstruction branches based on graph connectivity analysis and generating an action mask that constrains topological connectivity includes: for each candidate reconstruction branch, simulating disconnection of the branch in the current topology, and verifying whether the system remains fully connected using a breadth-first search or disjoint-set data structure algorithm; if the system remains fully connected after disconnection, then marking the mask bit corresponding to the branch as 1, otherwise marking it as 0; and combining all mask bits into a binary vector as the action mask.

[0011] In a preferred embodiment, the action mask for generating constraint topological connectivity further includes: identifying the edge cut set composed of candidate reconstruction branches in the current topology; recording the set of historical disconnected branches executed by the agent in the current optimization round; and if only one branch remains undisconnected in a certain edge cut set, forcibly setting the mask bit corresponding to that branch to 0.

[0012] In a preferred embodiment, the step of combining action masks and having the reinforcement learning agent output network dynamic reconstruction instructions includes: inputting the state vector into the agent's policy network and outputting the initial action probability distribution of a single candidate reconstruction branch; using the action mask to force the selection probability of illegal branch actions with mask bits set to 0 to zero, and re-normalizing the probability distribution after being set to zero; sampling the target reconstruction branch based on the normalized probability distribution, converting it into network dynamic reconstruction instructions and executing them, while simultaneously triggering the dynamic update of the state vector and action mask in the next decision step.

[0013] In a preferred embodiment, the step of calculating the difference in operating costs and the flexibility shortage penalty before and after the execution of the optimal power flow calculation instruction includes: after executing the network dynamic reconfiguration instruction, solving for the optimal power flow to obtain the operating cost, and calculating the cost difference with that before the instruction execution; based on the net load fluctuation and the adjustability margin of each node's flexibility resources, calculating the insufficient upward adjustment capacity and the insufficient downward adjustment capacity respectively, and using the sum of the two as the flexibility shortage penalty.

[0014] In a preferred embodiment, the safety constraints include: node voltage amplitude not exceeding limits, line load rate not exceeding limits, topology full connectivity, and the total number of switching operations throughout the day not exceeding a preset upper limit.

[0015] In a preferred embodiment, the step of extracting flexibility physical indicators from the trajectory and calculating and outputting a comprehensive evaluation index by fusion includes: extracting the average node voltage margin, the average line load rate margin, and the switching action consumption rate from the extreme operating trajectory; using a combination of the analytic hierarchy process and the entropy weighting method to assign weights, weighting and summing the flexibility physical indicators to obtain the comprehensive evaluation index and outputting it.

[0016] A flexibility assessment system for medium- and low-voltage power distribution systems oriented towards typical network configurations in multiple scenarios includes: a data acquisition module for acquiring source-load time-series data, topology parameters, and candidate reconfiguration branches of the network, generating multiple typical operating scenarios, and concatenating the parameters of each scenario into a state vector; an action mask generation module for verifying candidate reconfiguration branches based on graph connectivity analysis and generating an action mask that constrains topology connectivity; a reconfiguration command output module for combining the action mask with a reinforcement learning agent to output dynamic network reconfiguration commands, and calculating the difference in operating costs and the flexibility shortage penalty before and after command execution through optimal power flow calculation; an optimization module for using the sum of the difference and the penalty as iterative incentives to optimize and obtain the extreme operating trajectory of the network under safety constraints; and an evaluation module for extracting flexibility physical indicators from the trajectory, and outputting a comprehensive evaluation index through fusion calculation.

[0017] The technical effects and advantages of this invention's method for evaluating the flexibility of medium- and low-voltage power distribution systems in typical multi-scenario networks are as follows: 1. This invention verifies candidate reconfiguration branches based on graph connectivity analysis, generates action masks that constrain topological connectivity, and deeply integrates them with reinforcement learning agents. This effectively suppresses the "state-action space explosion" problem caused by large-scale discrete switch combinations in distribution networks, significantly reducing the frequency of ineffective optimal power flow simulation calculations. It not only establishes the physical topological feasibility of network dynamic reconfiguration instructions from the algorithm's underlying layer, but also fundamentally overcomes the technical bottleneck of traditional mathematical planners easily falling into the "curse of dimensionality" and combinatorial explosion when solving complex distribution network reconfigurations, achieving a leapfrog improvement in model convergence rate and high-dimensional space optimization efficiency.

[0018] 2. This invention couples the difference in operating costs calculated from the optimal power flow with a flexibility shortage penalty as an iterative incentive to drive the reinforcement learning agent to optimize the extreme operating trajectory, breaking the limitations of existing evaluation methods that rely solely on static scenario settings or single steady-state indicators. This invention precisely maps the "system physical regulation capacity deficit" under extreme source-load fluctuation scenarios to an "economic penalty term" in the reinforcement learning scalar reward and punishment function, constructing a dual-track joint driving model that considers both operational economy and flexibility margin. The "extreme operating trajectory" obtained through closed-loop iterative optimization can realistically characterize the extreme regulation potential of the power distribution system under conditions approaching the nonlinear power flow red line and equipment extreme value constraints, achieving a substantial upgrade in flexibility evaluation from "static discrete operator calculation" to "dynamic continuous physical boundary detection." Attached Figure Description

[0019] Figure 1 A flowchart illustrating the overall process of a method for evaluating the flexibility of medium- and low-voltage power distribution systems in typical multi-scenario networking scenarios, provided by an embodiment of the present invention. Figure 2A module structure block diagram of a medium- and low-voltage power distribution system flexibility assessment system for typical multi-scenario networking provided in an embodiment of the present invention; Figure 3 A flowchart illustrating the action mask generation and dynamic defense mechanism provided in this embodiment of the invention; Figure 4 This is a closed-loop logic diagram of iterative optimization of a deep reinforcement learning agent provided in an embodiment of the present invention. Figure 5 This is a schematic diagram of the timing evolution of the extreme running trajectory provided in an embodiment of the present invention; Figure 6 An improved IEEE 33-node test system topology diagram is provided for an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0021] Example 1: This example provides a method for evaluating the flexibility of medium- and low-voltage power distribution systems for typical multi-scenario network configurations. For example... Figure 1 As shown, the method includes the following steps: S1: Obtain the source load time series data, topology parameters and candidate reconfiguration branches of the network, generate multiple typical operation scenarios, and concatenate the parameters of each scenario into a state vector; In this embodiment, the steps of acquiring the source-load time-series data, topology parameters, and candidate reconfiguration branches of the network, generating multiple typical operating scenarios, and concatenating the parameters of each scenario into a state vector include the following: S11. Obtain one year's worth of historical operating data for the target low-voltage power distribution system. Data dimensions include: historical output time series of each distributed photovoltaic and wind power station (sampling interval set to 15 minutes), load power time series of each node, state of charge time series of the battery energy storage system, node voltage amplitude time series, line load rate time series, branch connection relationship of the initial topology, and a preset set of candidate reconfigurable branches (e.g., 8 to 12 operable tie switch branches preset according to the power grid plan).

[0022] To characterize the long-term uncertainty of source load variations with seasonal and meteorological conditions, the K-means clustering algorithm was used to perform scene reduction on historical daily operational data. The specific steps are as follows: Each day's 24-hour data (96 15-minute segments in total) is used as a raw scene, and all historical days constitute the raw scene set; The elbow method is used to determine the optimal number of clusters K (usually K=4~6). Based on the shape of the net load curve, the K-means algorithm is used to divide the original scene into K clusters. The cluster center of each cluster represents a typical operating scenario, and the probability of this scenario occurring is equal to the number of original scenarios within the cluster divided by the total number of days.

[0023] In other embodiments, density-based clustering (DBSCAN) or Gaussian mixture model (GMM) can also be used to generate typical scenes, which can achieve similar results.

[0024] S12 extracts environmental time series features, security constraint features, and discrete topology features for each time segment (time t) under each typical operating scenario.

[0025] The environmental time-series characteristics include: the predicted power output of each distributed renewable energy node (photovoltaic, wind power). (Unit: MW), this value is derived from numerical weather prediction or a forecasting model based on historical data; active power at each load node. (Unit: MW), taken from load forecasts or actual measurements; current state of charge of each battery energy storage system. , is defined as the ratio of the current remaining capacity of the energy storage system to its rated capacity, and its value ranges from 0 to 1.

[0026] Of the parameters mentioned above, This is the current time segment. This serves as the index for distributed renewable energy node subscripts. For load node index, This is a subscript index for battery energy storage systems.

[0027] The above data is directly taken from the scene generation results or operation monitoring data, forming environmental time-series feature quantities, denoted as vectors. .

[0028] The security constraint features include: Voltage amplitude at each node (Per-unit value), typically ranging from 0.95 to 1.05 pu, taken from distribution network state estimation or power flow calculation results; Load rate of each line Defined as: (1) In equation (1), branch road exist The active power flowing through at any given time (unit: MW), taken as the absolute value to ignore the direction of power. branch road The maximum permissible active power to be transmitted (unit: MW) is determined by the thermal stability limit of the line or the rated capacity of the equipment.

[0029] These parameters are provided by distribution network state estimation or power flow calculation, and constitute the safety constraint feature vector. .

[0030] The discrete topological features include: Initial topology branch connection relationship: The static structure of the current power grid is described in the form of an adjacency matrix or edge list (whether each branch physically exists); Open / closed flags of candidate reconstructed branches: For a preset set of candidate reconstructed branches (e.g., 9 connecting lines), a binary variable is used to indicate whether the branch is currently closed, where "1" indicates closed and "0" indicates open.

[0031] These features constitute discrete topological features, denoted as binary vectors. The length is equal to the number of candidate branches.

[0032] S13, a differentiated encoding method is adopted for the above three types of feature quantities, specifically as follows: For the environmental time-series features, linear normalization is used to map each dimension of data to the [0,1] interval: (2) In equation (2), The normalized value. and These are the global minimum and maximum values ​​of the feature across the entire training dataset, respectively. The normalized result is denoted as... .

[0033] For discrete topological features, binary-preserved encoding is used: the opening / closing identifier directly takes the value 0 or 1; the branch connection relationship is converted into a binary adjacency matrix and then flattened into a one-dimensional vector. The encoded result is denoted as... .

[0034] Furthermore, to address the technical deficiency of conventional linear normalization leading to insensitivity of the agent to safety thresholds such as voltage exceedances and line overloads, this embodiment employs nonlinear boundary-sensitive coding based on physical safety red lines for safety constraint features. The specific mapping method is as follows: For node voltage amplitude (Per unit value), setting the safety lower limit Safety limit The following segmented coding function is used: (3) In equation (3), These are the encoded voltage characteristic values. This is a dimensionless amplification factor (typically 5-10) used to adjust the sensitivity to exponential growth. When the voltage slightly exceeds 1.05 pu, The value rapidly increases from 1 to hundreds, giving the agent a strong "dangerous over-limit" signal; when the voltage is below 0.95 pu, the encoded value also increases exponentially with the deviation, providing a clear low-voltage alarm.

[0035] For line load rate Define security thresholds Its nonlinear coding function is: (4) In equation (4), This is the encoded load rate feature value.

[0036] When the load rate exceeds 1.0, the coded value increases exponentially, warning of the risk of line thermal instability overload; when the load rate is within the safe range, the coded value is the load rate itself, preserving linear characteristics. After performing a nonlinear mapping on all safety constraint feature quantities according to the above rules, the coded safety constraint feature quantity vector is obtained. .

[0037] The encoded environmental temporal features, discrete topological features, and security constraint features are directly concatenated into a one-dimensional system state vector according to a preset dimensional order. .

[0038] S2, based on graph connectivity analysis, verifies candidate reconstructed branches and generates an action mask that constrains topological connectivity; like Figure 3 As shown, Figure 3 This is a flowchart illustrating the action mask generation and dynamic defense mechanism provided in this embodiment of the invention. This step aims to perform joint offline and online pre-verification of each candidate reconfiguration branch using a graph connectivity algorithm during the sequential decision-making process of power distribution network dynamic reconfiguration. This pre-intercepts illegal action explorations that could lead to system disconnection or power supply islanding, thus rigidly constraining the agent's exploration space.

[0039] In this embodiment, the step of verifying candidate reconstruction branches based on graph connectivity analysis and generating an action mask that constrains topological connectivity specifically includes the following steps: S21, Perform a single-step connectivity check on the current topology. Assume the current distribution network topology is an undirected graph. ,in For the system node set, This is the set of branches currently in a closed state (including fixed physical branches and closed candidate reconfigurable branches). Let the preset set of candidate reconfigurable branches be... ,in This represents the total number of candidate branches.

[0040] For sets Each candidate reconstruction branch in Perform the following verification: Temporarily assemble from the current branch Remove the branch and obtain a temporary branch set. The graph is determined using either Breadth-First Search (BFS) or Union-Find algorithms. Is it fully connected?

[0041] Full connectivity means that there is a path between any two nodes in the graph, that is, there are no isolated islands or isolated nodes in the entire network.

[0042] If implemented using BFS, then starting from any power node (usually a substation node), traverse all reachable nodes. If the number of visited nodes equals the total number of nodes, then... If , then it is fully connected.

[0043] If a disjoint-set data structure is used, then all nodes at both ends of all branches are merged. If all nodes eventually belong to the same set, then the system is fully connected.

[0044] If disconnected If the system remains fully connected, then the mask bit corresponding to that branch will be used. A branch is marked as 1 (meaning the agent is allowed to disconnect the branch in the current decision step); conversely, if an island is detected, it is marked as 0 (meaning disconnecting the branch is absolutely prohibited).

[0045] After verifying all candidate branches, combine all mask bits into a binary vector according to the branch number order. , which serves as the basic action mask for constraining the single-step actions of the intelligent agent.

[0046] S2.2 Relying solely on single-branch connectivity checks cannot defend against the "multi-step cumulative cut set risk," meaning that while disconnecting a single branch does not destroy connectivity, disconnecting multiple branches sequentially (executed in multiple steps) can lead to system disconnection. Therefore, this step further introduces the concept of edge cut sets and records the history of disconnected branches executed by the agent in the current optimization round, dynamically updating the mask.

[0047] In the current topology In this context, an edge cut set is defined as: a subset of branches. To satisfy from Remove from After all branches are connected, the graph is divided into two or more connected components, and No proper subset of the set possesses this property (i.e., minimal cut set). This invention focuses only on edge cut sets composed of candidate reconstruction branches, because fixed branches are not operable. This embodiment uses the Stoer-Wagner global minimal cut algorithm or the Gomory-Hu tree-based algorithm to pre-enumerate and filter out edge cut sets composed only of candidate reconstruction branches and with small cut set sizes, denoted as . .

[0048] In the current optimization round of deep reinforcement learning, maintain a set of historical broken paths. Initially, the set is empty. Whenever an agent executes a network dynamic reconstruction instruction (i.e., disconnects or closes a candidate reconstruction branch), and the instruction is a disconnect operation, the branch is added to the network. Closing operations do not change .

[0049] Before outputting the final mask at each decision step, combine the historical set. For the base mask Make defensive adjustments, specifically: Traverse each identified edge cut set Calculate the intersection of this cut set and the historical disconnect set. ,like If only one branch remains unbroken in the cut set, then this remaining branch (denoted as...) is... The corresponding mask bit is forcibly set to 0 (even if the single-branch connectivity check result is 1). No additional restrictions are imposed on other cases (the number of unbroken branches in the cut set is ≥2 or all branches have been disconnected).

[0050] This rule ensures that an agent cannot "complete" a cut set, thus preventing isolated incidents caused by multiple steps accumulating.

[0051] By combining the base mask and the dynamic correction rules, the final action mask vector for the current decision step is generated. This vector will be directly fed into the agent's action output layer for probability truncation.

[0052] For better understanding, this embodiment uses the IEEE 33-node system as an example, assuming that the candidate reconstructed branch contains three branches: (18-33) (8-21) (25-29), and these three branches form an edge cut set (simultaneous disconnection will cause downstream nodes to lose connection). Under single-branch verification, disconnection of each branch individually does not affect connectivity, therefore the basic mask is 1 for all branches. When the agent disconnects in the first decision step... Historical Disconnected Sets At this point, the remaining unbroken branches in the cut-off set are (Two lines) The defense condition has not yet been triggered, therefore the mask remains unchanged. If the agent disconnects again in the second step... ,at this time Only the remaining parts of the cut are left. If not disconnected, the aforementioned edge cut set defense rule will be triggered. The mask bit is forcibly set to 0. After this, the agent will no longer be able to choose to disconnect. This avoids an islanding incident caused by the disconnection of all three branch lines.

[0053] Through the dual verification of graph theory and sequential logic, this invention achieves absolute security protection of the physical boundaries of complex power distribution network topology without sacrificing the exploration freedom of the agent, and significantly avoids the waste of ineffective computing power.

[0054] S3, combined with action mask, outputs network dynamic reconstruction instructions by reinforcement learning agent, and calculates the difference in operating cost before and after instruction execution and the amount of flexibility shortage penalty through optimal power flow; This step is a deep coupling layer between the deep reinforcement learning algorithm and the physical simulation of optimal power flow (OPF) in the distribution network. Under the mandatory constraints of the action mask, the agent outputs a legal reconfiguration command. After the distribution network environment executes the command, it feeds back a dual reward signal (Reward) that combines economy and flexibility through optimal power flow calculation.

[0055] In this embodiment, the step of combining action masks, having the reinforcement learning agent output network dynamic reconstruction instructions, and calculating the difference in operating costs and the penalty for flexibility shortage before and after instruction execution through optimal power flow calculation, specifically includes the following steps: S31, The deep reinforcement learning agent (preferably using the Proximal Policy Optimization (PPO) algorithm or the Soft Actor-Critic (SAC) algorithm in this embodiment) includes a Policy Network.

[0056] exist In the decision step, the state vector generated by S1 is... The input policy network, after being processed by a multilayer perceptron (MLP) and a softmax activation function, outputs an initial action probability distribution vector for all candidate reconstruction branches. .

[0057] Introducing the final action mask dynamically generated by S2 The probability of selecting an illegal action is forced to zero using the Hadamard product (i.e., element-wise multiplication): (6) In equation (6), This is the truncated action probability vector. The Hadamard product (i.e., element-wise multiplication of vectors). This operation will absolutely set the probability of illegal branch selection due to islands or cut set breaks to 0.

[0058] Probability Renormalization: To ensure the sum of probabilities is 1, the truncated probability vector is renormalized. (7) In equation (7), For the normalized first The probability of a candidate reconstruction branch being selected as the final legal path. and They are vectors The first in The and the first One element, This represents the total number of candidate reconstructed branches.

[0059] intelligent agents according to The target reconstructed branch is obtained by sampling and converted into a network dynamic reconstruction command for execution.

[0060] S32, after instruction execution, topology update, solve the optimal power flow (OPF) model: (8) In equation (8), This is the difference in operating costs (i.e., the difference in savings resulting from the refactoring action). The optimal power flow integrated operating cost of the system at the current section before executing the reconfiguration command. This represents the overall operating cost under the new topology after executing the instructions. The lower the cost, the better. The larger the value, the stronger the positive incentive.

[0061] The S33 computing system lacks the ability to adapt to extreme fluctuations: (9) (10) In equations (9) and (10), and The upward and downward adjustment capabilities are insufficient, respectively. The preset unit adjustment capacity penalty price coefficient (unit: yuan / MW). and Together, they characterize the net load fluctuation of each node, representing the maximum possible upward and downward fluctuation based on scenario prediction. and The common characteristic of the adjustable margin of the aforementioned flexibility resources is the sum of the upward adjustable margin and the sum of the downward adjustable margin that can be provided by all flexibility resources (such as energy storage, microgrids, etc.) in the current system. The maximum value function means that if the system's adjustment margin is greater than the fluctuation requirement, no penalty will be imposed.

[0062] The sum of insufficient upward adjustment capacity and insufficient downward adjustment capacity is negativeized to generate a flexibility shortage penalty. The negative value is used to represent it as a scalar of "punishment" for the agent in reinforcement learning.

[0063] Finally, the difference in operating costs obtained from the above steps is... With flexibility shortage penalty The sum of these values ​​can be used as the iterative stimulus for optimizing the limit trajectory in subsequent steps: (11) In equation (11), For the scalar reward value of the agent's reinforcement learning, The preset weighting coefficients for operational economic efficiency The preset flexibility and security weighting coefficients.

[0064] S4. Using the sum of the difference and the penalty as the iterative stimulus, the extreme operating trajectory of the network under security constraints is obtained by optimization. In this embodiment, the step of using the sum of the difference and the penalty as an iterative stimulus to optimize and obtain the extreme operating trajectory of the network under security constraints specifically includes the following steps: S41, In this embodiment, it is preferred to use deep reinforcement learning algorithms suitable for discrete action spaces, such as Proximal Policy Optimization (PPO) or Soft Actor-Critic (SAC). Figure 4 This is a closed-loop logic diagram for the iterative optimization of a deep reinforcement learning agent provided in an embodiment of the present invention. (See diagram below.) Figure 4 As shown, the intelligent agent consists of two core networks: Policy Network (Actor): Used to output the final action probability distribution of a single candidate reconstruction branch. .

[0065] Value network (Critic): Used to evaluate the value of the current state. This assists in gradient updates of the policy network. The training process follows a standard Markov Decision Process (MDP), with each episode corresponding to a complete dynamic reconfiguration sequence of the distribution network. The sequence begins with the initial topology state and executes cyclic interactions S1 to S4 at each decision step until the preset maximum number of decision steps (e.g., set to 3 steps) is reached or the system can no longer be optimized.

[0066] S42, during the entire process of optimizing the extreme trajectory, safety constraints must be strictly observed, specifically including: Node voltage amplitude does not exceed limits: In AC-OPF calculations, node voltage constraints are incorporated into the optimization model. If the agent's tentative actions lead to an unsolvable OPF problem, the environment directly imposes a very large, constant-order negative penalty (e.g., ...). ), and forcibly terminate the current round.

[0067] Line load rate not exceeding limits: Add branch power flow thermal stability constraints to OPF: If the trend exceeds the limit after reconstruction, a severe penalty will be imposed and the round will be terminated.

[0068] Fully connected topology: This constraint is enforced by the action mask mechanism generated in step S2 before probability sampling, blocking the generation of islands from the bottom layer, without the need for additional penalties in the reward function.

[0069] The total number of on / off actions throughout the day does not exceed a preset limit: In each optimization round, the cumulative number of executions of all on / off actions is dynamically recorded. Set a preset upper limit. (For example, 3 times). When the agent attempts to execute at a certain decision step, it will lead to... When the action is performed, the action is forcibly masked (the mask bit is hard-set to 0).

[0070] S43, at each decision step The intelligent agent performs actions Afterwards, the environment returns a single-step reward. The intelligent agent will use experience tuples The data is stored in the experience replay pool, and the network parameters are updated using gradient ascent. The goal of the policy network is to maximize the expected cumulative discount reward. (12) In equation (12), This is the discount factor (typically 0.99). The maximum number of decision steps in a round.

[0071] S44. After completing offline training, input the typical operating scenario to be evaluated into the converged agent, and generate the extreme operating trajectory according to the following process: like Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the timing evolution of the extreme running trajectory provided in an embodiment of the present invention. (For...) arrive The agent is based on the state vector With action mask Output Action (A greedy strategy is used during the testing phase, directly selecting the legal action with the highest probability), the action is executed, and the distribution network topology is updated. The state profile during the initialization phase (index 0) is obtained and recorded before the loop begins; arrive This indicates the subsequent decision loop.

[0072] Record the system operating status (including node voltage, branch power flow, switch status, operating costs, etc.) at each time point throughout the process to form the extreme operating trajectory: (13) In equation (13), This represents the optimal power flow physical profile obtained after executing the action. This is the extreme running trajectory. This represents the maximum regulation capacity that a power distribution system can provide in response to extreme net load fluctuations, while strictly adhering to all physical safety constraints.

[0073] S5 extracts flexibility physical indicators from the trajectory, performs fusion calculations, and outputs a comprehensive evaluation index.

[0074] In this embodiment, the extraction of flexibility physical indicators from the trajectory, and the fusion calculation and output of a comprehensive evaluation index, specifically includes the following steps: S51, from the extreme operating trajectory The three flexibility physical indicators extracted from these are the average node voltage margin, the average line load margin, and the switching action consumption rate.

[0075] Define nodes exist The voltage margin at time t is: (14) In equation (14), For nodes exist Voltage margin at any given time (typically ranging from [0,1], with values ​​closer to 1 indicating a closer voltage to the rated optimal value and a more sufficient margin). The nodes obtained after solving the optimal power flow (OPF) exist The actual voltage amplitude at any given time (per unit value pu). This is the rated reference voltage of the distribution network node (usually taken as 1.0 pu). The maximum permissible voltage deviation limit specified by the power grid (for example, if the permissible voltage fluctuates between 0.95 and 1.05, then take 0.05pu).

[0076] To serve as a macroscopic indicator for evaluating the overall flexibility of the system, a dual averaging operation is required for both spatial (all network nodes) and temporal (extreme trajectory over the entire time period). Therefore, the average node voltage margin is: (15) In equation (15), This is the final extracted mean value of the node voltage margin. This represents the total number of time segments (or total number of decision steps) contained in the extreme running trajectory. This represents the total number of load nodes in the power distribution system.

[0077] Define branches (i.e., connecting nodes) With nodes (the route) in The instantaneous load margin at time t is: (16) In equation (16), branch road exist The load margin at any given time (the value ranges from [0,1], and the closer the value is to 1, the more lightly loaded the line is and the more available remaining transmission capacity is). To solve for the AC-OPF (Alternating Current Optimal Power Flow) problem, the branch... The load rate.

[0078] To quantify the average adequacy of the entire distribution network structure under extreme operating trajectories, it is also necessary to perform dual averaging calculations for both spatial (all branches of the network) and temporal (all time periods). Therefore, the average line load factor margin is: (17) In equation (17), This is the final extracted average line load margin. It is the set of all closed branches in the distribution network (including fixed physical branches and currently reconfigured tie branches). The total number of branches in a closed state under the current topological section (i.e., the set) (Number of elements in the text).

[0079] Set the maximum number of switching actions throughout the entire time period as follows: The actual number of actions performed in the trajectory is The action count consumption rate is: (18) In equation (18), This represents the consumption rate of the number of switching actions.

[0080] Since the aforementioned "voltage margin" and "load rate margin" are both positive indicators (the larger the better), while "switching power consumption" is a negative indicator (the smaller the better), in order to achieve a unified linear weighting in the comprehensive evaluation index, it is necessary to perform a forward transformation before substituting it into the AHP and entropy weight method models: (19) In equation (19), This represents the margin for the number of switching actions.

[0081] S52 uses the Analytic Hierarchy Process (AHP) to determine subjective weights, the Entropy Weight Method to determine objective weights, and finally obtains the comprehensive weights through linear weighting.

[0082] Power system experts were invited to conduct pairwise comparisons of the importance of three indicators (voltage margin, load factor margin, and switching action frequency consumption rate), construct a judgment matrix, calculate the eigenvector, and perform a consistency test (CR < 0.1) to obtain the subjective weight vector: (20) In equation (20), This is the subjective weight vector of AHP. The subjective weight of the mean voltage margin The subjective weight of the mean load margin. The subjective weight of the consumption rate of switching action count.

[0083] Suppose there are K power distribution network planning schemes (or K typical operating scenarios) to be evaluated, each scheme having three indicator values, forming an original data matrix. After standardizing the indicators, the information entropy is calculated, thus obtaining the objective weights. Entropy weighting can automatically uncover the inherent differences in the data, avoiding subjective bias.

[0084] Furthermore, the final weights of each indicator are obtained using a linear combination formula: (twenty one) In equation (21), For indexing indicators, A moderating factor (typically 0.5) is used to balance the influence of subjective and objective factors. Subjective weights determined by the Analytic Hierarchy Process (AHP) The objective weights determined by the entropy weight method.

[0085] Finally, the extracted three physical index values ​​are weighted and summed with their corresponding combined weights to calculate and output the comprehensive evaluation index. : (twenty two) In equation (22), The combined weights are the average voltage margin values. The combined weights of the load margin mean The combined weights for the switching action consumption rate are calculated using equation (21).

[0086] Final calculation The value range is [0,1]. The system outputs the evaluation result to the auxiliary decision-making terminal: if A value greater than 0.8 is rated as excellent flexibility; if If the value is less than 0.6, it is considered to be insufficient in flexibility, triggering an early warning for grid upgrades or energy storage expansion plans.

[0087] Example 2: This example provides a flexibility assessment system for medium and low voltage power distribution systems in typical multi-scenario networking scenarios. For example... Figure 2 As shown, it includes: The data acquisition module is used to acquire the source load time series data, topology parameters and candidate reconfiguration branches of the network, generate multiple typical operating scenarios, and concatenate the parameters of each scenario into a state vector. The action mask generation module is used to verify candidate reconstructed branches based on graph connectivity analysis and generate action masks that constrain topological connectivity. The reconstruction instruction output module is used to combine action masks and output network dynamic reconstruction instructions by reinforcement learning agents. The difference in operating cost before and after instruction execution and the amount of flexibility shortage penalty are calculated through optimal power flow. The optimization module is used to use the sum of the difference and the penalty as the iterative incentive to optimize and obtain the extreme operating trajectory of the network under safety constraints. The evaluation module is used to extract flexibility physical indicators from the trajectory, and output a comprehensive evaluation index through fusion calculation.

[0088] Example 3: To verify the effectiveness and advancement of the flexibility assessment method and system for medium and low voltage power distribution systems in typical multi-scenario networking described in this invention, this example uses the IEEE 33-node test system improved with a high proportion of distributed energy resources to conduct full-time simulation and comparative verification. Figure 6 An improved IEEE 33-node test system topology diagram is provided for an embodiment of the present invention.

[0089] 1. Calculation system and parameter settings: The nominal voltage of the reference system is 12.66 kV. To simulate the challenges of high-penetration renewable energy integration and bidirectional power flow, the following flexible resource equipment is deployed on the reference system: Distributed photovoltaic (PV) grid connection points: Node 18 (capacity 3MW), Node 33 (capacity 2.5MW), Node 25 (capacity 1.5MW); Battery Energy Storage System (BESS) access points: Node 18 (configured with 1MW / 2MWh), Node 6 (configured with 1.5MW / 3MWh), Node 30 (configured with 1MW / 2MWh). There are 9 candidate reconfiguration branches in the preset distribution network (with intelligent tie switches, such as branch 1-1 connecting nodes 18 and 33, branch 1-2 connecting nodes 8 and 21, etc.). The system is set to allow a maximum of 3 switching actions in a single extreme operating trajectory optimization round.

[0090] Table 1. Candidate Reconfiguration Branches for the Improved IEEE 33-Node Test System

[0091] 2. Comparison of test scenarios and algorithm configurations To quantify the scientific validity of the evaluation method of this invention and the effectiveness of optimizing the acquisition of the extreme running trajectory, the following two comparative test cases are set up: Case 0 (Benchmark Case - Traditional Static Evaluation): Without triggering the dynamic topology reconstruction strategy based on deep reinforcement learning, the original radial network structure is maintained, and the system relies solely on energy storage charging and discharging to cope with source-load fluctuations. This serves as a reference group to evaluate the original flexibility of the system.

[0092] Case 1 (Invention Solution - Extreme Trajectory Optimization Evaluation): Using the method provided in this invention, the DRL agent performs sequential decision-making under extreme net load fluctuation scenarios. The agent employs a Double Deep Q Network (DQN) or the PPO algorithm, and the policy network uses a two-layer multilayer perceptron (each containing 256 neurons). Under the mandatory physical constraints of the S2 edge cut set mask defense mechanism, the agent autonomously learns and selects no more than three legal reconstruction actions to generate an extreme running trajectory under safety constraints and outputs a comprehensive evaluation index.

[0093] 3. Effect Comparison and Verification Analysis Under typical test sections with severe net load fluctuations (such as a sudden surge in daytime photovoltaic power and peak evening load periods), the comparison results of the physical operation status and flexibility evaluation indicators of the two cases are as follows: In terms of technical security and physical over-limit suppression: In Case 0, due to the fragility of the original radial network structure, the branch end nodes experienced severe voltage overruns (dropping to a minimum of 0.92 pu, below the safety threshold of 0.95 pu) when faced with the high proportion of photovoltaics at nodes 18 and 33. At the same time, the trunk lines near the power source were in a state of overload for a long time, with a flexibility deficiency probability as high as 29.17%, and the flexibility deficit lasted for 7 hours per day.

[0094] In Case 1, the agent of this invention successfully found the optimal extreme operating trajectory of "closed branch 18-33, closed branch 8-21, and closed branch 5-15" under the premise of satisfying all physical constraints and action masking interception. This trajectory achieved excellent power flow transfer in the spatiotemporal dimension: the minimum node voltage was forcibly raised and stabilized at 0.96 pu (completely within the safe and acceptable range), and the system's highest line load rate was significantly reduced, fundamentally eliminating the power flow bottleneck. The probability of insufficient flexibility and the duration of deficit both dropped to 0, verifying the superior technical effect of this invention in suppressing physical limits.

[0095] In terms of overall cost and economic improvement: Although Case 0 does not involve mechanical depreciation due to switching operations, it causes a surge in network loss costs and flexibility penalty costs due to the large-scale abandonment of photovoltaic power and severe network congestion.

[0096] The extreme operating trajectory in Case 1 effectively promoted the local consumption of renewable energy and alleviated congestion. Compared with Case 0, Case 1 achieved a total comprehensive operating equivalent cost saving rate of 26.91% for the distribution network, reduced system power loss by 15.23%, and increased the utilization rate of flexibility resources to 100%. The increased depreciation cost of micro-switching operations was far less than the saved operating costs, demonstrating the significant economic benefits of the discovered trajectory.

[0097] Regarding the quantitative output of the comprehensive flexibility evaluation index, based on the subjective and objective combined weighting method described in this invention, the physical indicators of the aforementioned test sections are fused and calculated to output a comprehensive evaluation index: Case 0 assessment results: Due to the near-zero node voltage margin and extremely low net load fluctuation mitigation coefficient (only 12.7%), its comprehensive assessment index score is 0.38. Based on this, the system's auxiliary decision-making terminal issued a warning of "severe lack of flexibility".

[0098] Case 1 Evaluation Results: Under the extreme operating trajectory output by this invention, the average node voltage margin and the average line load rate margin are significantly improved, the net load fluctuation smoothing coefficient reaches 100%, and the switching consumption rate is reliably controlled within the upper limit. The system's final output comprehensive evaluation index score is 0.89, rated as "Excellent Flexibility".

[0099] 4. Comprehensive Verification Conclusions The above calculation results fully demonstrate that this invention can not only perfectly avoid the "curse of dimensionality" and "island risk" in complex topology reconstruction through action masking and DRL algorithm, but also accurately and objectively uncover the maximum adjustment potential of the power distribution system in both spatiotemporal dimensions by finding the extreme operating trajectory. Its final quantitative output of the comprehensive flexibility evaluation index provides a precise, scientific, and highly industrially valuable decision-making basis for the grid upgrade and energy storage planning of modern new power distribution networks.

[0100] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0101] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0102] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0103] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0104] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0105] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for evaluating the flexibility of medium- and low-voltage power distribution systems for typical multi-scenario networking, characterized in that, Includes the following steps: Obtain the source load time series data, topology parameters and candidate reconfiguration branches of the network, generate multiple typical operation scenarios, and concatenate the parameters of each scenario into a state vector; Based on graph connectivity analysis, candidate reconstruction branches are verified, and action masks constraining topological connectivity are generated. By combining action masks, the reinforcement learning agent outputs network dynamic reconstruction instructions, and calculates the difference in operating costs before and after instruction execution and the amount of flexibility shortage penalty through optimal power flow. Using the sum of the difference and the penalty as the iterative incentive, the extreme operating trajectory of the network under security constraints is obtained by optimization. The physical indicators of flexibility are extracted from the trajectory, and a comprehensive evaluation index is output through fusion calculation.

2. The method according to claim 1, characterized in that, The process involves acquiring the source-load time-series data, topology parameters, and candidate reconfiguration branches of the network to generate multiple typical operating scenarios, including: Extract the predicted output of distributed renewable energy, the load power of each node, and the state of charge of the battery energy storage system in the network as environmental time-series characteristic quantities. Extract the node voltage amplitude and line load rate of the power distribution system as safety constraint characteristic quantities; Extract the branch connection relationships of the initial topology and the opening / closing identifiers of the candidate reconstructed branches as discrete topological feature quantities.

3. The method according to claim 2, characterized in that, The step of concatenating the parameters of each scenario into a state vector includes: The environmental temporal features are processed by linear normalization, and the discrete topological features are processed by binary encoding. For safety constraint characteristics, a nonlinear boundary-sensitive coding based on physical safety red lines is adopted. When the node voltage amplitude or line load rate approaches the preset safety limit threshold, the coded mapping value is amplified exponentially. The processed environmental temporal features, discrete topological features, and security constraint features are concatenated into a state vector according to a preset dimension.

4. The method according to claim 3, characterized in that, The step of verifying candidate reconstruction branches based on graph connectivity analysis and generating an action mask that constrains topological connectivity includes: For each candidate reconstruction branch, simulate disconnecting the branch in the current topology, and use breadth-first search or disjoint-set data structure algorithm to verify whether the system maintains full connectivity; If the system remains fully connected after disconnection, the mask bit corresponding to that branch is marked as 1; otherwise, it is marked as 0. Combine all the mask bits into a binary vector to serve as the action mask.

5. The method according to claim 4, characterized in that, The action mask for generating constrained topological connectivity also includes: Identify the edge cut set consisting of candidate reconstructed branches in the current topology; Record the set of historical broken paths that the agent has executed in the current optimization round; If only one branch remains unbroken in a certain cut set, then the mask bit corresponding to that branch is forcibly set to 0.

6. The method according to claim 5, characterized in that, The action mask, combined with the network dynamic reconstruction instructions output by the reinforcement learning agent, includes: The state vector is input into the agent's policy network, and the initial action probability distribution of a single candidate reconstruction branch is output. The probability of selecting illegal branch actions with a mask bit of 0 is forced to zero using an action mask, and the probability distribution after being set to zero is renormalized. The target reconstruction branch is obtained by sampling based on the normalized probability distribution, which is then transformed into a network dynamic reconstruction instruction and executed, while triggering the dynamic update of the state vector and action mask in the next decision step.

7. The method according to claim 6, characterized in that, The difference in operating costs and the flexibility shortage penalty before and after executing the optimal power flow calculation instructions include: After executing the network dynamic reconfiguration instruction, the optimal power flow is solved to obtain the operating cost, and the cost difference with that before the instruction was executed is calculated. Based on the net load fluctuations and flexibility resource adjustability of each node, the insufficient upward adjustment capacity and the insufficient downward adjustment capacity are calculated separately, and the sum of the two is used as the flexibility shortage penalty.

8. The method according to claim 7, characterized in that, The security constraints include: The node voltage amplitude does not exceed the limit, the line load rate does not exceed the limit, the topology is fully connected, and the total number of switching operations throughout the day does not exceed the preset upper limit.

9. The method according to claim 8, characterized in that, The process of extracting flexibility physical indicators from the trajectory, and then calculating and outputting a comprehensive evaluation index, includes: Extract the average node voltage margin, average line load rate margin, and switching action consumption rate from the extreme operating trajectory; By combining the analytic hierarchy process (AHP) and the entropy weighting method, the physical indicators of flexibility are weighted and summed to obtain a comprehensive evaluation index, which is then output.

10. A flexibility assessment system for medium- and low-voltage power distribution systems oriented towards typical multi-scenario networking, characterized in that, include: The data acquisition module is used to acquire the source load time series data, topology parameters and candidate reconfiguration branches of the network, generate multiple typical operating scenarios, and concatenate the parameters of each scenario into a state vector. The action mask generation module is used to verify candidate reconstructed branches based on graph connectivity analysis and generate action masks that constrain topological connectivity. The reconstruction instruction output module is used to combine action masks and output network dynamic reconstruction instructions by reinforcement learning agents. The difference in operating cost before and after instruction execution and the amount of flexibility shortage penalty are calculated through optimal power flow. The optimization module is used to use the sum of the difference and the penalty as the iterative incentive to optimize and obtain the extreme operating trajectory of the network under safety constraints. The evaluation module is used to extract flexibility physical indicators from the trajectory, and output a comprehensive evaluation index through fusion calculation.