Power grid dynamic safety analysis method based on improved maximum flow optimal classification tree

By improving the maximum current optimal classification tree method, steady-state and transient safety analysis of the power grid is solved, and the accuracy and interpretability of dynamic safety analysis of the power grid in the existing technology is improved, and the grid stability and scheduling decisions are improved.

CN120067885AActive Publication Date: 2025-05-30HUAZHONG UNIV OF SCI & TECH +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510009991.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-05-30
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to design an accurate and interpretable dynamic safety analysis method for the power grid, it is difficult to effectively evaluate whether the power grid can operate stably after encountering large disturbances, and it is difficult to provide acceptable scheduling decision support.

Method used

Using a method based on improving the optimal classification tree of the maximum current, the real-time net load corresponding to the current grid current is input into the target classification tree, and steady-state and transient safety analysis is performed to determine whether the power grid violates steady-state and dynamic safety rules, and emergency control is carried out to ensure the stability of the power grid.

Benefits of technology

It realizes the accuracy and interpretability of dynamic safety analysis of the power grid, improves the accuracy and real-timeness of the power grid stability judgment, and ensures the safe operation of the power grid and the reliability of scheduling decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067885A_ABST
    Figure CN120067885A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid dynamic safety analysis method based on an improved maximum flow optimal classification tree, and belongs to the technical field of power grid control, and the method comprises the steps: inputting a real-time net load corresponding to a current power grid flow into a target first classification tree, so as to rapidly obtain an effective anticipated fault set, and taking the effective anticipated fault set as a basis for power grid stability discrimination; and if the effective anticipated fault meets the steady-state safety rule, inputting real-time operation state data corresponding to the effective anticipated fault into the target second classification tree to obtain a current transient stability result, and taking the current transient stability result as a basis for further judging the stability of the power grid. Whether the power grid meets steady-state safety or not is detected firstly, then dynamic safety is detected after the power grid meets the steady-state safety, and the accuracy of safety analysis is improved through multiple times of judgment. Furthermore, the improved maximum flow optimal classification tree is used as an original first classification tree and / or an original second classification tree, continuous net load characteristics and unbalanced data are considered, and the accuracy of a real-time effective anticipated fault set is ensured while providing interpretability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power grid control, and more specifically, relates to a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree. Background Art

[0002] The safe and stable operation of a power system is of crucial importance. Dynamic security analysis is one of the key links and is also a prerequisite for corrective control and emergency control. Power system dynamic security analysis determines the transient stability problem of the system after a presupposed fault based on real-time power flow, and can evaluate the ability of the system to transition from the current operating state to a post-fault stable operating state after a large disturbance. The ultimate goal of power system dynamic security analysis is to achieve preventive control, improve the reliability of the power grid, and prevent large-scale power outages. In order to assess whether the current operating state of the system is safe when a presupposed fault occurs, presupposed fault determination needs to be carried out, that is, transient stability analysis is performed one by one on all the faults in a subset of the set of all possible faults in the system - the presupposed fault set, eliminating the presupposed faults that will not cause safety problems, and screening out the faults that are harmful to the system stability.

[0003] With the development of monitoring and data acquisition systems, energy management systems, and wide-area monitoring systems in the power system, as well as the progress of artificial intelligence technology, the application of data-driven methods in the power grid is increasing day by day, providing support for aspects such as power grid monitoring, management, optimization, and prediction, and providing new ideas for improving the real-time performance of power grid dynamic security analysis. Neural networks, especially "black box" models such as deep neural networks, although having high accuracy, have poor interpretability, resulting in the generated results being difficult to be accepted by power grid dispatchers. Decision trees (classification trees) built according to rules are inherently interpretable. However, classical decision tree construction methods often use greedy algorithms to minimize a certain index to make the classified data at each branch node the most "pure", thus unable to guarantee the optimality of the entire tree and making it difficult to improve the classification accuracy.

[0004] In summary, there is an urgent need for an accurate and interpretable power grid dynamic security analysis method to provide support for the safe operation of the power grid. Summary of the Invention

[0005] In view of the above defects or improvement requirements of the prior art, the present invention provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, aiming to solve the technical problem of how to design an accurate and interpretable power grid dynamic security analysis method.

[0006] To achieve the above object, according to one aspect of the present invention, there is provided a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, including:

[0007] S1: Input the real-time net load corresponding to the current power grid flow into the target first classification tree to obtain the current effective pre-fault set, and perform a steady-state security analysis on the current effective pre-fault set to determine whether the current power grid violates the steady-state security rules;

[0008] S2: If the steady-state security rules are violated, update the current power grid flow and return to S1; if the steady-state security rules are met, proceed to S3;

[0009] S3: Input the real-time operating state data corresponding to the current effective pre-fault into the target second classification tree to obtain the current transient stability result, and use the current transient stability result to determine whether the current power grid violates the dynamic security rules;

[0010] S4: If the dynamic security rules are violated, perform emergency control and conduct a power flow calculation to update the current power grid flow and return to S1; if the dynamic security rules are met, use the current transient stability result output by the target second classification tree to characterize the target stability degree of the power grid;

[0011] Wherein, the original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

[0012] In one embodiment, before the S1, the method further includes:

[0013] A1: Cluster and sample the historical net load to obtain representative samples;

[0014] A2: Use the representative samples in the historical net load as input data, and use the effective pre-faults corresponding to the representative samples as output labels to train the original first classification tree to finally obtain the target first classification tree.

[0015] In one embodiment, before the S3, the method further includes:

[0016] B1: Perform a steady-state power flow calculation on the historical operation data of the power grid to obtain the power grid flow result;

[0017] B2: Use the power grid flow result as the initial value of the operating parameters of the physical simulation module, and solve the physical simulation module to obtain the transient stability margin index;

[0018] B3: Use the operating state variables as input data, and use the transient stability margin index as the output label to train the original second classification tree to finally obtain the target second classification tree.

[0019] In one embodiment, the B2 includes:

[0020] Use the power grid flow result as the initial value of the operating parameters of the physical simulation module;

[0021] Solve the physical simulation module by using the time-domain simulation method to obtain data such as the generator power angle and frequency, and analyze the data such as the generator power angle and the frequency to obtain the transient stability margin index.

[0022] In one embodiment, the transient stability margin index is the difference between the stable limit phase angle difference and the actual maximum phase angle difference.

[0023] In one embodiment, the constraints of the improved maximum flow optimal classification tree include:

[0024]

[0025] Among them, the 0-1 decision variable Indicates whether sample j flows along the arc from node n to the left child node l(n) of n, and the 0-1 variable Indicates that the feature f of data sample j is selected by node n to branch to the left or right side of the node. The left side is 0, the right side is 1, and the 0-1 decision variable b n,f Indicates whether the branch node n branches on the feature f, N B Indicates the set of branch nodes, η n Indicates the continuous decision variable, 0-1 decision variable Indicates whether sample j flows along the arc from node n to the right child node r(n) of n. ε represents the preset threshold, and v n Equal to 1 indicates that node n is a terminal node, Equal to 1 indicates that node n is pruned because there is a terminal node in its ancestor nodes. A(n) represents the set of ancestor nodes of node n, and the 0-1 decision variable w n,h Indicates whether the terminal node n is labeled as category h∈{0,1}, where w n,0 =0 indicates an invalid contingency category, and w n,1 =1 indicates a valid contingency category, Indicates the counting times of data sample j in the data flow graph, Indicates whether sample j flows along the arc from a certain ancestor node a(n) of n to node n, Indicates whether sample j flows along the arc from node n to the sink node S, Indicates whether sample j is classified as the correctly labeled contingency c at node n, N min Indicates the minimum number of data samples for each terminal node n.

[0026] In one embodiment, the objective function of the improved maximum flow optimal classification tree is:

[0027]

[0028] where α ∈ [0, 1] is a weight factor, π j represents the class weight, and N represents the set of all candidate nodes.

[0029] According to another aspect of the present invention, there is provided a power grid dynamic security analysis device based on an improved maximum flow optimal classification tree, including: a first prediction module, a first judgment module, a second prediction module, and a second judgment module;

[0030] The first prediction module is configured to input the real-time net load corresponding to the current power grid power flow into the target first classification tree to obtain the current effective pre-fault set, perform a steady-state security analysis on the current effective pre-fault set to determine whether the current power grid violates the dynamic security rules, and transmit the judgment result to the first judgment module;

[0031] The first judgment module is configured to, if the judgment result of the first prediction module violates the dynamic security rules, update the current power grid power flow and transmit the current power flow to the first prediction module; if it conforms to the dynamic security rules, trigger the second prediction module to work;

[0032] The second prediction module is configured to input the real-time operating state data corresponding to the current effective pre-fault into the target second classification tree to obtain the current transient stability result, use the current transient stability result to determine whether the current power grid violates the dynamic security rules, and transmit the judgment result to the second judgment module;

[0033] The second judgment module is configured to, if the judgment result of the second prediction module violates the dynamic security rules, perform emergency control and implement power flow calculation to update the current power grid power flow and transmit the current power flow to the first prediction module; if it conforms to the dynamic security rules, use the current transient stability result output by the target second classification tree to characterize the target stability degree of the power grid;

[0034] Wherein, the original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

[0035] According to another aspect of the present invention, there is provided a power grid dynamic security analysis system, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0036] According to another aspect of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0037] Generally speaking, compared with the prior art, the above technical solution conceived by the present invention can achieve the following beneficial effects:

[0038] (1) The present invention provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree. By inputting the real-time net load corresponding to the current power grid power flow into the target first classification tree, an effective set of contingency faults can be quickly obtained in a data-driven manner, which is used as a basis for power grid stability discrimination. If the effective contingency faults meet the steady-state security rules, the current operation data corresponding to the effective contingency faults is further input into the target second classification tree to obtain the current transient stability result, which is used as a further basis for power grid stability judgment. The present invention first checks whether the power grid meets the steady-state security, and then checks the dynamic security after meeting it, and improves the accuracy of security analysis through multiple discriminations. In addition, by using the improved maximum flow optimal classification tree as the original first classification tree and / or the original second classification tree, the continuous net load characteristics and unbalanced data are considered, ensuring the accuracy of the real-time effective set of contingency faults while providing interpretability, thereby achieving the improvement of dispatching decision-making security.

[0039] (2) The first classification tree constructed by the present solution using the net load in historical data realizes the rapid prediction of an effective set of contingency faults through contingency fault classification, which is used for steady-state security analysis; clustering and sampling the historical net load to obtain representative samples can reduce the noise of training samples.

[0040] (3) The second classification tree trained by the present solution using the operating state variables and transient stability margin indexes realizes the mapping from the system operating state to the system stability degree, which can be used for rapid and accurate dynamic security analysis.

[0041] (4) The present solution uses the time-domain simulation method to iteratively solve the dynamic differential equations and static algebraic equations, obtains data such as generator power angle curves and frequency responses, and performs rapid and accurate analysis on them to obtain transient stability margin indexes.

[0042] (5) The present solution uses the transient stability margin index to characterize the stability level of the power grid after a fault occurs, and selects the maximum phase angle difference method to calculate the transient stability margin index, realizing accurate and low-complexity discrimination of the system stability state.

[0043] (6) In the present solution, for the original Max-Flow Optimal Classification Trees (MFOCTs) model which can only use 0-1 feature classification, in order to consider continuous features, new continuous decision variables are introduced to construct new branch threshold constraints.

[0044] (7) This scheme improves the objective function of the original MFOCTs model. This design takes into account that the original MFOCTs model does not distinguish between samples of different categories, and therefore may not be accurate enough when dealing with unbalanced expected fault sets. Therefore, category weights are introduced to take into account unbalanced data sets without increasing complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a flow chart of a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree provided in Example 1 of the present invention;

[0046] Figure 2 It is a flow chart of a method for dynamic security analysis of a power grid based on an improved maximum flow optimal classification tree including first and second classification trees for training targets provided in Embodiment 1 of the present invention.

[0047] Figure 3 is a schematic diagram of a flow chart of steady-state power flow calculation provided by Embodiment 1 of the present invention;

[0048] Figure 4 It is a flow chart of determining a transient stability margin index by solving a physical simulation module using a time domain simulation method provided by Embodiment 1 of the present invention;

[0049] Figure 5 It is a schematic diagram of a classification tree and a classification tree based on a data flow graph provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0051] Example 1

[0052] like Figure 1As shown in the figure, this embodiment provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, including: S1: Input the real-time net load corresponding to the current power grid power flow into the target first classification tree to obtain the current effective contingency set, and perform a steady-state security analysis on the current effective contingency set to determine whether the current power grid violates the steady-state security rules. S2: If the steady-state security rules are violated, update the current power grid power flow and return to S1; if the steady-state security rules are met, enter S3. S3: Input the real-time operating state data corresponding to the current effective contingency into the target second classification tree to obtain the current transient stability result, and use the current transient stability result to determine whether the current power grid violates the dynamic security rules. S4: If the dynamic security rules are violated, perform emergency control and implement power flow calculation to update the current power grid power flow and return to S1; if the dynamic security rules are met, use the current transient stability result output by the target second classification tree to characterize the target stability degree of the power grid. Among them, the original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

[0053] As an optional implementation manner, the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree further includes the process of training the target first classification tree and the target second classification tree, as Figure 2 shown.

[0054] As an optional implementation manner, before S1, the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree further includes: A1: Performing clustering sampling on historical net loads to obtain representative samples; A2: Using the representative samples in the historical net loads as input data and the effective contingencies corresponding to the representative samples as output labels to train the original first classification tree, and finally obtaining the target first classification tree.

[0055] In the offline training stage, since the historical net load data may contain similar data samples, a clustering sampling method can be used to select representative samples to improve the training efficiency. Clustering sampling divides the data into multiple clusters according to the similarity between samples and samples from each cluster to obtain a representative sample set. The K-means algorithm is used for clustering, and its goal is to minimize the Euclidean distance from each data point to its cluster center (or mean), that is:

[0056]

[0057] In the formula, K is the preset number of clusters (i.e., the clustering number), indexed by k, μ k is the center vector of the k-th cluster, r j,kIndicates whether each data sample j belongs to cluster k. The center vector of each cluster is used as a representative sample, and its label can be obtained using the nearest neighbor method (if the sample has been labeled) or expected fault screening (if the sample is not labeled). Afterwards, the representative sample set composed of all cluster center vectors is used to train the original first classification tree.

[0058] Furthermore, the representative sample set is expressed as {X,Y}={(x j ,y j )|1≤j≤J}, where J is the total number of samples with index j. Input feature vector It consists of system load and node net load, each feature is indexed by f (1≤f≤F) and scaled to [0,1] using the Min-Max normalization method. F In the label vector y j ∈{0,1} C In the above example, each label y j,c Indicates whether the expected fault c is valid in sample j: "0" indicates invalid, and "1" indicates valid.

[0059] As an optional implementation, before S3, the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree further includes: B1: performing steady-state power flow calculation on the historical operation data of the power grid to obtain the power grid power flow result, wherein: Figure 3 It is a schematic diagram of the steady-state power flow calculation process of an embodiment of the present invention; B2: Use the power grid power flow result to assign initial values ​​to the physical simulation module, and solve the physical simulation module to obtain the transient stability margin index; B3: Use the operating state quantity as input data and the transient stability margin index as the output label to train the original second classification tree and finally obtain the target second classification tree.

[0060] Specifically, first, the grid topology parameters and historical operation data are obtained. The grid topology parameters include the power of each power source and load point in the system, the voltage of the hub point, the voltage and phase angle of the balance point, the impedance and capacity of the transmission line, the grid structure, etc. The historical operation data includes the historical net load. Specifically, according to the input grid data, the steady-state flow calculation is performed to obtain the voltage amplitude and phase angle of each bus node of the grid, as well as the power distribution of each branch, the power loss of the network, etc.

[0061] Initialize the data from the prepared input data collection, set the convergence standard of steady-state power flow calculation, and construct the node power balance equation to describe the power input and output relationship of each node. Solve the nonlinear equation using Newton's method, PQ decomposition method, and nonlinear programming power flow algorithm to determine whether the result converges. If not, iterate the nonlinear equation to update the voltage amplitude and phase angle until the convergence conditions are met. If converged, the output result is passed to the physical simulation module as the initial value. The steady-state power flow calculation result is used as the initial value of the running parameter y in the physical simulation module.(0) and the initial value x of the state variable (0) , and then solve it by the time-domain simulation method, and iteratively solve the dynamic differential equation and the static algebraic equation.

[0062] Among them, the differential equation is The algebraic equation is 0 = g(x, y), where x represents the state variable describing the dynamic characteristics of the system in the differential equation set; y represents the operating parameter of the system in the algebraic equation set. It mainly includes:

[0063] 1) The differential equation describing the transient and sub-transient potential changes of each synchronous generator.

[0064] 2) The swing equation describing the rotor movement of each synchronous generator.

[0065] 3) The differential equation describing the dynamic characteristics of the excitation regulation system in the synchronous generator set.

[0066] 4) The differential equation describing the dynamic characteristics of the prime mover and its speed regulation system in the synchronous generator set.

[0067] 5) The differential equation describing the dynamic characteristics of each induction motor and synchronous motor load.

[0068] 6) The differential equation describing the control behavior of the rectifier and inverter in the DC system.

[0069] 7) The differential equation describing the dynamic characteristics of other dynamic devices (such as FACTS components like SVC, TCSC, etc.).

[0070] 0 = g(x, y) mainly includes:

[0071] 1) The power network equation, that is, the relationship between the node voltage and the node injection current described in the common reference coordinate system x-y;

[0072] 2) The stator voltage equation of each synchronous generator (established in its own d-q coordinate system) and the coordinate transformation equation for the connection between the d-g coordinate system and the x-y coordinate system;

[0073] 3) The voltage equation of each DC line;

[0074] 4) The voltage static characteristic equation of the load, etc.

[0075] After forming the differential equation and the algebraic equation, enter the transient process calculation. Set the moment when the system suffers a large disturbance as the initial moment (i.e., t = 0s), and take the integration step size Δt as a fixed constant. Since x (0) and y (0) The initial values are known. Assume that the transient process calculation has proceeded to the t moment. At this time, x (t) and y(t) is a known quantity. When calculating x (t+Δt) and y (t+Δt) , it should first be checked whether there is a fault or operation in the system at time t. If not, according to x (t) and y (t) , the alternating solution method or the simultaneous solution method is used to obtain the values of x (t+Δt) and y (t+Δt) ; if so, the differential or (and) algebraic equations need to be modified. Moreover, when a fault or operation occurs in the power network, the operating parameter y (t) of the system may change suddenly. Therefore, the network equations must be solved again to obtain the operating parameter y (t+0) after the fault or operation. Since the state variables do not change suddenly, x (t) and x (t+0) before and after the fault or operation are the same. Then, according to x (t) and y (t) , the alternating solution method or the simultaneous solution method is used to obtain the values of x (t+Δt) and y (t+Δt) . Subsequently, an appropriate criterion (such as the relative swing angle between the rotors of any two generators exceeding 180° as the criterion for system instability) is used to judge the system stability. If the system loses stability, the calculation results are output and the process stops; otherwise, the time is advanced by Δt for the next calculation until the time reaches the predetermined t max moment.

[0076] As an alternative implementation, as shown in Figure 4 , B2 includes: using the power grid power flow result as the initial value of the operating parameters of the physical simulation module; solving the physical simulation module by the time-domain simulation method to obtain data such as the generator power angle and frequency, and analyzing the data such as the generator power angle and frequency to obtain the transient stability margin index. Further, the transient stability margin index can be set as the difference between the stable limit phase angle difference and the actual maximum phase angle difference.

[0077] Determine the transient stability margin index from the output results obtained from the physical simulation module, process the transient stability margin index data and the operating state variables, and then train the original second classification tree to learn the mapping relationship from the power grid operating state to the system stability degree result.

[0078] Specifically, the transient stability margin index of the power system is a quantitative index used to measure the ability of the power system to maintain transient stability after suffering a large disturbance. The definition methods include the energy function method, the maximum phase angle difference method, etc. Based on the transient stability margin index, the correlation between the grid operation state and stability is obtained. The definition method of the index does not affect the generality of the proposed method. The maximum phase angle difference method can be selected to define the transient stability margin index. The maximum phase angle difference method measures the transient stability of the system based on the generator rotor angle. This method mainly focuses on the maximum relative phase angle difference between generator rotors after the system is subjected to a large disturbance. The transient stability margin index can be defined as the difference between the stable limit phase angle difference and the actual maximum phase angle difference, that is where Δδ max represents the maximum value of the power angle difference between any two generators in the system. The value range of TSI is (-1, 1). If TSI is positive, the system is marked as safe; otherwise, the system is marked as unsafe.

[0079] For example, the power grid contains a large amount of dispatching operation data. The online security and stability analysis of the power grid dispatching center conducts a comprehensive security and stability assessment every 15 minutes. The calculated data volume is about 1 GB, and the daily cumulative data volume reaches 96 GB. The method of mutual information needs to be used to screen the key features of the power grid operation from a large amount of data. Mutual information is used to represent the correlation between two variables, that is, the degree of reduction in the uncertainty of one variable set by another variable set, and it can also characterize the amount of shared information between two or more variables. First, mutual information is used to initially screen the original attributes. The input attributes include operation state variables such as generator active power output and node load. By calculating the mutual information between relevant physical variables and the stability margin, an input feature set with a greater correlation with stability is obtained; then the transient stability margin index is discretized into several intervals to characterize the stability degree of the power system, and more refined stability rules are obtained. By calculating the average stability margin of all samples in different stability intervals, a quantitative description index of the system degree in a certain sample interval can be obtained. Each branch of the classification tree can be used as a rule to directly evaluate the system stability degree under specific faults according to the power system operation state; finally, when it is found that the stability of the power grid decreases in a certain state, through the backward analysis of the classification tree, the upper-layer node feature quantity (i.e., the power grid state value) can be adjusted to obtain an operation mode adjustment strategy to improve the system stability, and it is output to the discrimination result to obtain a dispatching decision set.

[0080] Although a large number of samples under different operation modes are obtained through simulation by changing parameters such as generator output and load power, and then a target second classification tree is trained. However, in the face of the uncertainties in the power system, the initial sample set can only represent the predictable situations and does not completely cover all scenarios. Therefore, the idea of incremental learning can be used. When new special samples appear, only the newly added samples are learned to achieve the dynamic update of the evaluation model.

[0081] As an optional implementation, the constraints based on the improved maximum flow optimal classification tree include:

[0082]

[0083] Among them, 0-1 decision variables Indicates whether sample j flows along the arc from node n to the left child node l(n) of n, a 0-1 variable Indicates that the feature f of data sample j is selected by node n to branch to the left or right side of the node, the left side is 0, the right side is 1, and the 0-1 decision variable b n,f Indicates whether the branch node n branches on feature f, N B represents the branch node set, η n Represents a continuous decision variable, a 0-1 decision variable Indicates whether sample j flows along the arc from node n to the right child node r(n) of n, ε represents the preset threshold, v n Equal to 1 means that the n node is a terminal node, Equal to 1 means that node n is pruned because of the existence of a terminal node in its ancestor node, A(n) represents the set of ancestor nodes of node n, and 0-1 decision variable w n,h Indicates whether the terminal node n is labeled as category h∈{0,1}, where w n,0 =0 indicates invalid anticipated fault category, w n,1 =1 indicates a valid anticipated fault category, represents the number of times data sample j is counted in the data flow graph, Indicates whether sample j flows along the arc from an ancestor node a(n) of n to node n. Indicates whether sample j flows along the arc from node n to sink node S, Indicates whether sample j is classified as the correctly labeled expected fault c at node n, N min Indicates the minimum number of data samples for each terminal node n.

[0084] The original first classification tree and / or the original second classification tree are improved maximum flow optimal classification trees. Specifically, assuming that a decision tree with a depth of D has 2 D+1 -1 candidate node, consisting of n(or n')∈N={1,2,...,2 D+1 -1}. These nodes can be divided into 2 D -1 node consisting of a branch node set N B ={1,2,...,2 D -1}, and by 2 D The terminal node (or leaf node) set NT ={2 D ,2 D +1,...,2 D+1 -1}. In these subscripts, node 1 is named the root node. To describe the relationship between two nodes, let p(n) denote the parent node of n, l(n) and r(n) denote the left and right child nodes of node n. In addition, let A(n) denote the set of ancestor nodes of node n. Note that each node n can be either a branch node, thereby performing feature partitioning, or a terminal node, thereby performing label prediction. If the branch node is a terminal node, its left and right child nodes (if any) will be pruned and not included in the tree.

[0085] Figure 5 is a classification tree and a diagram of a classification tree based on a data flow graph. If Figure 5 Node 2 in (left side) is a terminal node, so its child nodes 4 and 5 will be pruned. The data partitioning process in MFOCTs is represented as the data flow process in the data flow graph. Figure 5 As shown, the data sample flows from the source node 0 connected to the root node to the sink node S (=2 D+1 ). Therefore, there are 2 D+1 +1 node, each node index is {0,1,2,...,2 D+1 -1,2 D+1}. During training, only data samples that can flow from the source node to the sink node are considered correctly classified samples, while those that are misclassified cannot flow out of the source node or into the sink node. The goal of MFOCTs is to determine the structure of a decision tree that maximizes the number of correctly classified samples in the data flow graph.

[0086] The decision variables involved are 0-1 variables b n,f Indicates whether the branch node n branches on feature f, where "1" means yes and "0" means no. 0-1 variable w n,h Indicates whether the terminal node n classifies the label into category h∈{0,1}, where w n,0 =1 indicates invalid anticipated fault category, w n,1 =1 indicates a valid anticipated fault category. 0-1 variable v n Indicates whether node n is determined to be a terminal node, and the 0-1 variable Indicates whether sample j flows along the arc from node n to node n'.

[0087] The existing MFOCTs model can only use 0-1 features for classification, and its key node division constraints are as follows:

[0088]

[0089] The first constraint requires that if the feature f of data sample j is selected by node n to branch to the left (i.e., x j f = 0), then data sample j can flow to the left child node l(n). Similarly, the second constraint is for branching to the right. Although continuous features (such as payload values) can be processed in chunks and one-hot encoding can be used to enable MFOCTs to handle these continuous features, this operation may reduce accuracy. On the one hand, this is because discretization may lead to information loss. On the other hand, after one-hot encoding, the number of features increases, which may weaken the effectiveness of key features.

[0090] To directly consider continuous features, a continuous decision variable η n is introduced to represent the branching threshold of each branch node n. By comparing the feature value with this threshold, it can be ensured that at most one branch occurs, thereby determining whether the data sample branches to the left or right of the node, that is:

[0091]

[0092] Therefore, the new node branching threshold constraint is as follows:

[0093]

[0094] where ε is a very small value used to convert a strict inequality into a non-strict inequality.

[0095] Indicates that if then data sample j can flow to the left child node l(n). Similarly, Indicates that if then data sample j can flow to the right child node r(n).

[0096] Assume that each continuous feature is discretized into N block blocks, then there are N block ×F 0-1 features after one-hot encoding. Therefore, the number of 0-1 branch variables is also multiplied by N block . In contrast, can directly utilize F continuous features, only requiring an additional N B continuous variables, which does not increase with the increase in the number of features. Therefore, the new branching threshold constraint is more beneficial, especially when there are many blocks that need to be discretized.

[0097] The remaining constraints of IMFOCTs that are not affected by the nature of continuous or discrete features are as follows:

[0098]

[0099]

[0100] Among them, the constraint ensures that each branch node n has one of the following three possibilities: when equals 1, branch at this node; when v n equals 1, this node is a terminal node; when equals 1, this node is pruned because there is a terminal node among its ancestor nodes. The constraint ensures that only when node n is a terminal node will it be assigned a class label. The constraint means that each terminal node n is either a leaf node or pruned from the classification tree.

[0101] The constraint indicates that each data sample j can be counted at most once in the data flow graph. The constraint ensures that if data sample j reaches branch node n, then it must flow to its left or right child node, or the sink node S. ensures that if data sample j reaches terminal node n, then it must flow to the sink node S. requires that only when data sample j is classified as the expected fault c with correct annotation at node n can it flow into the sink node S through node n. is the regularization condition for the classification tree, ensuring that there are at least N min data samples reaching each terminal node n.

[0102] As an optional implementation, the objective function for improving the maximum flow optimal classification tree is:

[0103]

[0104] α ∈ [0, 1] is the weight factor, π j represents the class weight, represents whether sample j flows along the arc from node n to the sink node S, N represents the set of all candidate nodes, N B represents the set of branch nodes, and the 0-1 decision variable b n,f represents whether branch node n branches on feature f.

[0105] Specifically, the expression of the objective function of the original MFOCTs is as follows:

[0106]

[0107] The first term maximizes the number of data samples flowing to the sink node, and the second term is a regularization term that penalizes the number of branch nodes to avoid unnecessary nodes in an unbalanced tree. These two terms are weighted using a weight factor α∈[0,1]. However, since most of the expected fault labels are unbalanced, and this objective function does not distinguish between samples of different categories, it may not be accurate enough when processing unbalanced expected fault datasets.

[0108] Although imbalanced datasets are considered in MFOCTs by adding multiple sinks (one for each class), the number of 0-1 decision variables is also multiplied by the number of classes, thus increasing the complexity of the model. In order to consider imbalanced datasets without adding too much additional complexity, class weights are introduced. Then the objective function of MFOCTs can be modified as follows:

[0109]

[0110] The idea of ​​class weights is as follows: suppose there are 100 samples, of which 20 are class 0 (invalid) and 80 are class 1 (valid). The weight of class 0 samples will be 5 (= 100 / 20), while the weight of class 1 samples will be 1.25 (= 100 / 80). In this way, the influence of different classes is "balanced".

[0111] In summary, the proposed IMFOCTs uses a mixed integer linear programming model consisting of an objective function and various constraints to solve the learning problem of the optimal classification tree, while considering continuous features and unbalanced datasets.

[0112] Example 2

[0113] This embodiment provides a power grid dynamic security analysis device based on an improved maximum flow optimal classification tree, comprising: a first prediction module, a first judgment module, a second prediction module, and a second judgment module.

[0114] The first prediction module is configured to input the real-time net load corresponding to the current power grid power flow into the target first classification tree to obtain the current effective contingency set, perform steady-state security analysis on the current effective contingency set to determine whether the current power grid violates the steady-state security rules, and transmit the judgment result to the first judgment module. The first judgment module is configured to, if the judgment result of the first prediction module violates the steady-state security rules, update the current power grid power flow and transmit the current power flow to the first prediction module; if it conforms to the steady-state security rules, trigger the second prediction module to work. The second prediction module is configured to input the real-time operation state data corresponding to the current effective contingency into the target second classification tree to obtain the current transient stability result, use the current transient stability result to determine whether the current power grid violates the dynamic security rules, and transmit the judgment result to the second judgment module. The second judgment module is configured to, if the judgment result of the second prediction module violates the dynamic security rules, perform emergency control and implement power flow calculation to update the current power grid power flow and transmit the current power flow to the first prediction module; if it conforms to the dynamic security rules, use the current transient stability result output by the target second classification tree to characterize the target stability degree of the power grid. Wherein, the original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

[0115] Embodiment 3

[0116] This embodiment provides a power grid dynamic security analysis system, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree in Embodiment 1.

[0117] Embodiment 4

[0118] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree in Embodiment 1.

[0119] Those skilled in the art can easily understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for dynamic security analysis of power grid based on improved maximum flow optimal classification tree, characterized in that: include: S1: inputting the real-time net load corresponding to the current power grid flow into the target first classification tree to obtain the current valid expected fault set, and performing steady-state safety analysis on the current valid expected fault set to determine whether the current power grid violates the steady-state safety rules; S2: If the steady-state safety rule is violated, the current power grid flow is updated and the process returns to S1; if the steady-state safety rule is met, the process enters S3; S3: inputting the real-time operating status data corresponding to the current effective expected fault into the target second classification tree to obtain a current transient stability result, and using the current transient stability result to determine whether the current power grid violates a dynamic safety rule; S4: If the dynamic safety rules are violated, emergency control is performed and power flow calculation is implemented to update the current power grid power flow and return to S1; if the dynamic safety rules are met, the current transient stability result output by the target second classification tree is used to represent the target stability of the power grid; The original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

2. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 1, characterized in that: Before S1, the method further includes: A1: Cluster sampling of historical net loads to obtain representative samples; A2: Using representative samples in the historical net load as input data and valid anticipated faults corresponding to the representative samples as output labels, the original first classification tree is trained to finally obtain the target first classification tree.

3. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 1, characterized in that: Before S3, the method further includes: B1: Perform steady-state power flow calculation on the historical operation data of the power grid to obtain the power grid power flow results; B2: using the power grid flow result to assign initial values ​​to the physical simulation module, solving the physical simulation module to obtain a transient stability margin index; B3: Using the operating state quantity as input data and the transient stability margin index as an output label, the original second classification tree is trained to finally obtain the target second classification tree.

4. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 3 is characterized in that: The B2 includes: Using the power grid flow results as initial values ​​of operating parameters of the physical simulation module; The physical simulation module is solved by using a time domain simulation method to obtain data such as the generator power angle and frequency, and the transient stability margin index is obtained by analyzing the generator power angle and the frequency data.

5. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 4, characterized in that: The transient stability margin index is the difference between the stability limit phase angle difference and the actual maximum phase angle difference.

6. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 1, characterized in that: The constraints of the improved maximum flow optimal classification tree include: Among them, 0-1 decision variables Indicates whether sample j flows along the arc from node n to the left child node l(n) of n, a 0-1 variable Indicates that the feature f of data sample j is selected by node n to branch to the left or right side of the node, the left side is 0, the right side is 1, and the 0-1 decision variable b n,f Indicates whether the branch node n branches on feature f, N B represents the branch node set, η n Represents a continuous decision variable, a 0-1 decision variable Indicates whether sample j flows along the arc from node n to the right child node r(n) of n, ε represents the preset threshold, v n Equal to 1 means that the n node is a terminal node, Equal to 1 means that node n is pruned because of the existence of a terminal node in its ancestor node, A(n) represents the set of ancestor nodes of node n, and 0-1 decision variable w n,h Indicates whether the terminal node n is labeled as category h∈{0,1}, where w n,0 =0 indicates invalid anticipated fault category, w n,1 =1 indicates a valid anticipated fault category, represents the number of times data sample j is counted in the data flow graph, Indicates whether sample j flows along the arc from an ancestor node a(n) of n to node n. Indicates whether sample j flows along the arc from node n to sink node S, Indicates whether sample j is classified as the correctly labeled expected fault c at node n, N min Indicates the minimum number of data samples for each terminal node n.

7. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree according to claim 6, characterized in that: The objective function of the improved maximum flow optimal classification tree is: Among them, α∈[0,1] is the weight factor, π j represents the category weight, and N represents the set of all candidate nodes.

8. A power grid dynamic security analysis device based on improved maximum flow optimal classification tree, characterized in that: include: A first prediction module, a first judgment module, a second prediction module, and a second judgment module; The first prediction module is used to input the real-time net load corresponding to the current power grid flow into the target first classification tree to obtain a current valid expected fault set, perform a steady-state safety analysis on the current valid expected fault set to determine whether the current power grid violates the steady-state safety rules, and transmit the determination result to the first determination module; The first judgment module is used to update the current power grid flow and transmit the current power grid flow to the first prediction module if the judgment result of the first prediction module violates the steady-state safety rule; if it meets the steady-state safety rule, trigger the second prediction module to work; The second prediction module is used to input the current operating state data corresponding to the current effective expected fault into the target second classification tree to obtain a current transient stability result, use the current transient stability result to determine whether the current power grid violates the dynamic safety rule, and transmit the determination result to the second determination module; The second judgment module is used to perform emergency control and implement power flow calculation if the judgment result of the second prediction module violates the dynamic safety rule, so as to update the current power grid power flow and transmit the current power flow to the first prediction module; if it meets the dynamic safety rule, the current transient stability result output by the target second classification tree is used to characterize the target stability of the power grid; The original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.

9. A power grid dynamic security analysis system, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Decision data based power grid transient stability assessment method

    CN105740905A

  • Multi-attribute decision tree power grid stability margin assessment method based on linear discrimination analysis

    CN107274105A

  • A power system online dynamic safety assessment method based on an integrated decision tree

    CN109726766A

  • Power grid transient safety and stability evaluation method

    CN116031867A

  • Electric grid analytics learning machine

    US20200334577A1