A power grid dynamic security analysis method based on improved maximum flow optimal classification tree
By improving the power grid dynamic security analysis method based on the maximum flow optimal classification tree, the accuracy and interpretability issues of power grid dynamic security analysis in the existing technology are solved, enabling rapid identification of fault sets and emergency control, thereby improving the stability and reliability of the power grid.
Patent Information
- Application Number
- CN202510009991.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-01-03
AI Technical Summary
Existing methods for dynamic security analysis of power grids suffer from poor accuracy and insufficient interpretability, making it difficult to meet the needs of power grid dispatchers.
An improved maximum flow optimal classification tree is adopted, and dynamic security analysis of the power grid is carried out through two classification trees. First, steady-state security analysis is performed, and then transient stability judgment is performed. The classification tree is trained using historical data and operating state variables, and transient stability margin index is obtained by combining time-domain simulation method, thus constructing an interpretable and accurate analysis method.
It improves the accuracy and interpretability of power grid dynamic security analysis, can quickly identify effective anticipated fault sets, reduce training noise, achieve rapid and accurate judgment of power grid stability, and provide reliable dispatch decision support.
Smart Images

Figure CN120067885B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of power grid control, and more particularly relates to a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree. BACKGROUND
[0002] The safe and stable operation of a power system is of great importance, and dynamic security analysis is one of the key links and a prerequisite for corrective control and emergency control. Power system dynamic security analysis is to determine the transient stability of a system after a contingency according to real-time power flow, which can evaluate the ability of the system to transition from the current operating state to the stable operating state after a contingency. The ultimate goal of power system dynamic security analysis is to achieve preventive control and improve the reliability of the power grid to prevent large-scale power outages. In order to assess whether the current operating state of the system is safe in the event of a contingency, contingency determination is required, i.e., all faults in a subset of the entire set of possible faults of the system, i.e., the contingency set, are analyzed for transient stability one by one, and the contingencies that do not cause safety problems are eliminated, and the faults that are harmful to the stability of the system are selected.
[0003] With the development of monitoring and data acquisition systems, energy management systems, and wide-area monitoring systems in power systems and the progress of artificial intelligence technology, data-driven methods are increasingly applied in power grids, providing support for monitoring, management, optimization, and prediction of power grids, and providing a new approach to improving the real-time performance of power grid dynamic security analysis. Although neural networks, especially deep neural networks, and other "black box" models have high accuracy, they have poor interpretability, making it difficult for power dispatchers to accept the results. Decision trees (classification trees) built according to rules have interpretability. However, the classical decision tree construction method often uses a greedy algorithm to minimize a certain index to make the data classified at each branch node the most "pure", thus failing to guarantee the optimality of the entire tree and making it difficult to improve the accuracy of classification.
[0004] In summary, there is an urgent need for an accurate and interpretable power grid dynamic security analysis method to support the safe operation of power grids. SUMMARY
[0005] In view of the above defects or improvement needs of the prior art, the present application provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, which aims to solve the technical problem of how to design an accurate and interpretable power grid dynamic security analysis method.
[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree is provided, comprising:
[0007] S1: inputting real-time net load corresponding to current power grid flow into a target first classification tree to obtain a current effective contingency set, performing steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a steady-state security rule;
[0008] S2: if the steady-state security rule is violated, updating the current power grid flow and returning to S1; if the steady-state security rule is met, proceeding to S3;
[0009] S3: inputting real-time operating state data corresponding to the current effective contingency into a 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 security rule;
[0010] S4: if the dynamic security rule is violated, performing emergency control and implementing flow calculation to update the current power grid flow and return to S1; if the dynamic security rule is met, using the current transient stability result output by the target second classification tree to represent a target stability degree of the power grid;
[0011] The original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.
[0012] In one of the embodiments, before the S1, the method further comprises:
[0013] A1: clustering and sampling historical net load to obtain representative samples;
[0014] A2: using the representative samples in the historical net load as input data, using effective contingencies corresponding to the representative samples as output labels, and training an original first classification tree to finally obtain the target first classification tree.
[0015] In one of the embodiments, before the S3, the method further comprises:
[0016] B1: performing steady-state flow calculation on historical operating data of the power grid to obtain power grid flow results;
[0017] B2: using the power grid flow results to assign initial values to a physical simulation module, solving the physical simulation module to obtain a transient stability margin index;
[0018] B3: using operating state quantities as input data and using the transient stability margin index as an output label to train an original second classification tree to finally obtain the target second classification tree.
[0019] In one of the embodiments, the B2 comprises:
[0020] using the power grid flow results as initial values of operating quantities of the physical simulation module;
[0021] The physical simulation module is solved by using a time domain simulation method to obtain generator power angle and frequency data, and the transient stability margin index is analyzed based on the generator power angle and the frequency data.
[0022] In one embodiment, the transient stability margin index is a difference between a stable limit phase angle difference and an actual maximum phase angle difference.
[0023] In one embodiment, the constraint of the improved maximum flow optimal classification tree includes:
[0024]
[0025] wherein, 0-1 decision variable represents whether sample j flows along an arc from node n to the left child node l(n) of n, 0-1 variable represents whether the feature f of the data sample j is selected by the node n to branch to the left or right of the node, 0 for the left and 1 for the right, 0-1 decision variable b n,f represents whether the branch node n branches on the feature f, N B represents a set of branch nodes, η n represents a continuous decision variable, 0-1 decision variable represents whether sample j flows along an arc from node n to the right child node r(n) of n, ε represents a preset threshold value, v n equal to 1 indicates that the n node is a terminal node, equal to 1 indicates that the n node is pruned due to the existence of a terminal node in its ancestor node, A(n) represents a set of ancestor nodes of the node n, 0-1 decision variable w n,h represents whether the terminal node n is classified as a class h∈{0,1}, wherein w n,0 =0 represents an invalid contingency class, w n,1 =1 represents a valid contingency class, represents the count number of the data sample j in the data flow graph, represents whether sample j flows along an arc from a certain ancestor node a(n) of n to the node n, represents whether sample j flows along an arc from the n node to the sink node S, represents whether sample j is classified as a correctly labeled contingency c at the node n, N min represents the minimum number of data samples of each terminal node n.
[0026] In one embodiment, the objective function of the improved maximum flow optimal classification tree is:
[0027]
[0028] wherein, a ∈ [0, 1] is a weight factor, π j represents a category weight, and N represents a set of all candidate nodes.
[0029] According to another aspect of the present application, there is provided 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.
[0030] The first prediction module is configured to input real-time net load corresponding to current power grid power flow into a target first classification tree to obtain a current effective contingency set, perform steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a dynamic security rule, and transmit a determination result to the first judgment module.
[0031] The first judgment module is configured to, if the determination result of the first prediction module violates the dynamic security rule, update the current power grid power flow and transmit the current power flow to the first prediction module; and if the dynamic security rule is met, trigger the second prediction module to work.
[0032] The second prediction module is configured to input real-time operating state data corresponding to the current effective contingency into a target second classification tree to obtain a current transient stability result, determine whether the current power grid violates the dynamic security rule by using the current transient stability result, and transmit a determination result to the second judgment module.
[0033] The second judgment module is configured to, if the determination result of the second prediction module violates the dynamic security rule, 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; and if the dynamic security rule is met, use the current transient stability result output by the target second classification tree to represent a target stability degree of the power grid.
[0034] 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 application, there is provided a power grid dynamic security analysis system, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0036] According to another aspect of the present application, there is provided a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the above method when executed by a processor.
[0037] Overall, compared with the prior art, the above technical solutions conceived by the present application can achieve the following beneficial effects:
[0038] (1) The present application provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree. The real-time net load corresponding to the current power grid power flow is input into the target first classification tree to quickly obtain an effective contingency set in a data-driven manner, which is used as a basis for power grid stability discrimination. If the effective contingency meets the steady-state security rule, the current operating data corresponding to the effective contingency 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 discrimination. The present application first checks whether the power grid meets the steady-state security, and then checks the dynamic security if it meets the steady-state security. The accuracy of the security analysis is improved through multiple discriminations. In addition, the improved maximum flow optimal classification tree is used as the original first classification tree and / or the original second classification tree, which takes into account the continuous net load characteristics and unbalanced data, provides interpretability, ensures the accuracy of the real-time effective contingency set, and thus improves the security of dispatching decisions.
[0039] (2) The first classification tree constructed using the net load in the historical data in the present scheme realizes fast prediction of an effective contingency set through contingency classification, which is used for steady-state security analysis. Clustering and sampling of the historical net load to obtain representative samples can reduce the noise of the training samples.
[0040] (3) The second classification tree trained using the operating state quantity and the transient stability margin index in the present scheme realizes mapping from the system operating state to the system stability degree, which can be used for fast and accurate dynamic security analysis.
[0041] (4) The present scheme uses the time domain simulation method to iteratively solve the dynamic differential equation and the static algebraic equation to obtain generator power angle curves, frequency responses and other data, which are quickly and accurately analyzed to obtain the transient stability margin index.
[0042] (5) The present scheme uses the transient stability margin index to represent the stability level of the power grid after a fault occurs, and uses the maximum phase angle difference method to calculate the transient stability margin index to accurately and low-complexity discriminate the system stability state.
[0043] (6) In the present scheme, the original Max-Flow Optimal Classification Trees (MFOCTs) model 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) The target function of the original MFOCTs model is improved in the scheme, so the design considers that the original MFOCTs model does not distinguish samples of different categories, and therefore may not be accurate enough when dealing with an unbalanced set of expected faults, so the category weight is introduced to consider the unbalanced data set without increasing the complexity. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 is a flowchart of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree provided by the embodiment 1 of the present application;
[0046] Figure 2 is a flowchart of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree provided by the embodiment 1 of the present application.
[0047] Figure 3 is a flowchart of the steady-state power flow calculation provided by the embodiment 1 of the present application;
[0048] Figure 4 is a flowchart of the determination of the transient stability margin index by using the time domain simulation method provided by the embodiment 1 of the present application;
[0049] Figure 5 is a classification tree and a data flow diagram-based classification tree provided by the embodiment 1 of the present application. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0051] Embodiment 1
[0052] As Figure 1As shown, the embodiment provides a power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, which comprises: S1: inputting real-time net load corresponding to current power grid power flow into a target first classification tree to obtain a current effective contingency set, performing steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a steady-state security rule. S2: if the steady-state security rule is violated, updating the current power grid power flow and returning to S1; if the steady-state security rule is met, proceeding to S3. S3: inputting real-time operating state data corresponding to the current effective contingency into a 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 security rule. S4: if the dynamic security rule is violated, performing emergency control and implementing power flow calculation to update the current power grid power flow and return to S1; if the dynamic security rule is met, using the current transient stability result output by the target second classification tree to represent the target stability degree of the power grid. 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, the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree further comprises a process of training the target first classification tree and the target second classification tree, as shown in Figure 2 .
[0054] As an optional implementation, before S1, the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree further comprises: A1: clustering and sampling historical net load to obtain representative samples; A2: using the representative samples in the historical net load as input data, using the effective contingency corresponding to the representative samples as output labels, and training the original first classification tree to finally obtain the target first classification tree.
[0055] In the offline training phase, since the historical net load data may contain similar data samples, a clustering sampling method can be used to select representative samples to improve training efficiency. Clustering sampling divides data into multiple clusters according to the similarity between samples, and samples are selected from each cluster to obtain a representative sample set. K-means algorithm is used for clustering, and the goal is to minimize the Euclidean distance of each data point to its cluster center (or mean), that is:
[0056]
[0057] In the formula, K is a preset cluster number (i.e., the number of clusters), which is indexed by k, μ k is the center vector of the kth cluster, and r j,krepresents whether each data sample j belongs to cluster k. The center vector of each cluster, as a representative sample, can obtain its label using the nearest neighbor method (if the sample has been labeled) or the expected failure screening (if the sample has not been labeled). Then, the representative sample set composed of all cluster center vectors is used to train the original first classification tree.
[0058] Further, the representative sample set is represented as {X, Y}={(x j ,y j )|1≤j≤J}, where J is the total number of samples indexed by j. The input feature vector is composed of system load and node net load, each feature is indexed by f (1≤f≤F), and is scaled to [0, 1] F using the Min-Max normalization method. j ∈{0,1} C In the label vector y j,c , each label y j,c represents whether the expected failure c is effective in the sample j: “0” means invalid, and “1” means valid.
[0059] As an optional implementation, before S3, the power grid dynamic security analysis method based on improved maximum flow optimal classification tree further comprises: B1: performing steady-state power flow calculation on the historical operation data of the power grid to obtain power grid power flow results, wherein, Figure 3 is a steady-state power flow calculation process schematic diagram of an embodiment of the present application; B2: using the power grid power flow results to assign initial values to the physical simulation module to obtain transient stability margin indicators by solving the physical simulation module; B3: taking the operating state quantity as input data and the transient stability margin indicator as output label, training the original second classification tree to finally obtain the target second classification tree.
[0060] Specifically, first, the power grid topology structure parameters and historical operation data are obtained, the power grid topology structure parameters including 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 power grid structure, etc. The historical operation data includes historical net load. Specifically, according to the input power grid data, steady-state power flow calculation is performed to obtain the voltage amplitude and phase angle of each bus node of the power grid, as well as the power distribution of each branch, the power loss of the network, etc.
[0061] After initializing the data collected from the prepared input data, setting the convergence criteria for steady-state power flow calculation, the node power balance equation is constructed to describe the power input and output relationship of each node. The non-linear equation is solved by Newton method, P-Q decomposition method and non-linear programming power flow algorithm, etc. to judge whether the result converges. If it does not converge, the voltage amplitude and phase angle are iteratively updated for the non-linear equation until the convergence condition is met. If it converges, the output result is transmitted as the initial value into the physical simulation module. The steady-state power flow calculation result is used as the initial value y(0) and state variable initial value x (0) , the dynamic differential equations and static algebraic equations are solved by iteration.
[0062] where the differential equations are and the algebraic equations are 0 = g(x, y), where x represents the state variables in the differential equations that describe the dynamic characteristics of the system; and y represents the operating parameters of the system in the algebraic equations. Mainly include:
[0063] 1) Differential equations describing the transient and sub-transient potential variation of each synchronous generator.
[0064] 2) Sway equations describing the rotor motion of each synchronous generator.
[0065] 3) Differential equations describing the dynamic characteristics of the excitation regulation system in the synchronous generator set.
[0066] 4) Differential equations describing the dynamic characteristics of the prime mover and its speed regulation system in the synchronous generator set.
[0067] 5) Differential equations describing the dynamic characteristics of the load of each induction motor and synchronous motor.
[0068] 6) Differential equations describing the control behavior of the rectifier and inverter of the DC system.
[0069] 7) Differential equations describing the dynamic characteristics of other dynamic devices (such as SVC, TCSC, etc. FACTS elements).
[0070] 0 = g(x, y) mainly includes:
[0071] 1) Power network equations, i.e. describing the relationship between node voltage and node injected current in the common reference coordinate system x-y;
[0072] 2) Stator voltage equations of each synchronous generator (established in the respective d-q coordinate system) and coordinate transformation equations between the d-g coordinate system and the x-y coordinate system;
[0073] 3) Voltage equations of each DC line;
[0074] 4) Voltage static characteristic equations of the load, etc.
[0075] After the differential equations and algebraic equations are formed, the transient process calculation is entered. The time when the system suffers a large disturbance is defined as the initial time (i.e. t = 0s), and the integral step Δt is taken as a constant, since x (0) and y (0) initial values are known, it is assumed that the transient process calculation has been carried out to the t time, at which time x (t) and y(t) The quantity is known. In calculating x... (t+Δt) and y (t+Δt) When checking, first check if there is any fault or operation in the system at time t. If not, proceed according to x. (t) and y (t) x can be obtained by using the alternating solution method or the simultaneous solution method. (t+Δt) and y (t+Δt) The value of ; if present, then the differential or (and) algebraic equations need to be modified. Furthermore, when a fault or operation occurs within the power grid, the system's operating parameter y (t) Sudden changes may occur, therefore the network equations must be resolved to obtain the operating parameters y after the fault or operation. (t+0) Since state variables do not undergo abrupt changes, x before and after a fault or operation... (t) and x (t+0) Same, then based on x (t) and y (t) x can be obtained by using the alternating solution method or the simultaneous solution method. (t+Δt) and y (t+Δt) The value is then used. Subsequently, appropriate criteria (such as a relative sway angle exceeding 180° between any two generator rotors as a criterion for system instability) are used to determine system stability. If the system becomes unstable, the calculation result is output and the process stops; otherwise, the time is advanced by Δt, and the next calculation is performed until the predetermined time t is reached. max time.
[0076] As an optional implementation method, such as Figure 4 As shown, B2 includes: using the power flow results as initial values for the operating parameters of the physical simulation module; using the time-domain simulation method to solve the physical simulation module to obtain data such as generator power angle and frequency; and analyzing the generator power angle and frequency data to obtain a transient stability margin index. Further, the transient stability margin index can be set as the difference between the stability limit phase angle difference and the actual maximum phase angle difference.
[0077] The transient stability margin index is determined from the output results obtained from the physical simulation module. After processing the transient stability margin index data and the operating state variables, the original second classification tree is trained to learn the mapping relationship from the power grid operating state to the system stability result.
[0078] Specifically, the transient stability margin index of the power system is a quantitative index for measuring the ability of the power system to maintain transient stability after suffering a large disturbance. Its definition methods include the energy function method and the maximum phase angle difference method. 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, which is based on the generator rotor angle to measure the transient stability of the system. This method mainly focuses on the maximum relative phase angle difference between the generators after the system is disturbed. 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, i.e. 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 power grid dispatching center performs a comprehensive safety and stability analysis online every 15 minutes, and the calculation data amount is about 1 GB, and the daily cumulative data amount is up to 96 GB. The mutual information method 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, i.e., the degree of uncertainty reduction of one variable set to another variable set, and also represents the amount of shared information between two or more variables. First, the mutual information is used to preliminarily screen the original attributes, the input attributes include the generator active power output, node load and other operating state quantities. By calculating the mutual information between the relevant physical variables and the stability margin, a set of input features with a larger correlation with stability is obtained. Then, the transient stability margin index is discretized into several intervals to represent 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, and the stability degree of the system under a specific fault can be directly evaluated according to the operating state of the power system. Finally, when the stability of the power grid decreases in a certain state, the upper node feature quantity (i.e., the grid state value) can be adjusted through backtracking analysis of the classification tree to obtain an operation mode adjustment strategy for improving the stability of the system, which is output to the discrimination result to obtain a set of dispatching decisions.
[0080] Although a large number of samples under different operating modes are simulated by changing the generator output, load power and other parameters, and then a target second classification tree is trained. However, in the face of uncertainty in the power system, the initial sample set can only represent the predictable situation and cannot completely cover all scenarios. Therefore, the incremental learning idea can be used to learn only the newly added samples when a new special sample appears to realize the dynamic update of the evaluation model.
[0081] As an optional implementation, the constraint based on the improved maximum flow optimal classification tree comprises:
[0082]
[0083] wherein, 0-1 decision variable represents whether sample j flows along the arc from node n to the left child node l(n) of n, 0-1 variable represents whether the feature f of the data sample j is selected by the node n to branch to the left or right of the node, 0 for the left and 1 for the right, 0-1 decision variable b n,f represents whether the branch node n branches on the feature f, N B represents a set of branch nodes, η n represents a continuous decision variable, 0-1 decision variable represents whether sample j flows along the arc from node n to the right child node r(n) of n, ε represents a preset threshold value, v n equal to 1 indicates that the n node is a terminal node, equal to 1 indicates that the n node is pruned due to the existence of a terminal node in its ancestor node set, A(n) represents a set of ancestor nodes of node n, 0-1 decision variable w n,h represents whether the terminal node n is labeled as a class h∈{0,1}, wherein w n,0 = 0 indicates an invalid anticipated failure class, w n,1 = 1 indicates a valid anticipated failure class, represents the count number of data sample j in the data flow graph, represents whether sample j flows along the arc from a certain ancestor node a(n) of n to node n, represents whether sample j flows along the arc from node n to sink node S, represents whether sample j is classified as a correctly labeled anticipated failure c at node n, N min represents the minimum number of data samples for each terminal node n.
[0084] wherein, the original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree. Specifically, assume that a decision tree with a depth of D has 2 D+1 -1 candidate nodes, which are indexed by n (or n') ∈ N = {1, 2,..., 2 D+1 -1}. These nodes can be divided into a set of branch nodes N D = {1, 2,..., 2 B -1} consisting of 2 D -1 nodes, and a set of terminal nodes (or leaf nodes) N D consisting of 2T = {2 D D +1,...,2 D+1 -1}. In these subscripts, node 1 is named as the root node. To describe the relationship between two nodes, let p(n) denote the parent node of n, and let l(n) and r(n) denote the left child node and the right child node of node n. In addition, let A(n) denote the ancestor node set of node n. Note that each node n can be either a branch node, which makes a feature split, or a terminal node, which makes a label prediction. If a branch node is a terminal node, its left child node and right child node (if exist) will be pruned and not included in the tree.
[0085] Figure 5 For a classification tree and a classification tree based on a dataflow graph, if Figure 5 node 2 in (left) is a terminal node, its child nodes 4 and 5 will be pruned. The data partitioning process in MFOCTs is represented as the dataflow process in the dataflow graph. As shown in Figure 5 , data samples flow from the source node 0 connected to the root node to the sink node S (=2 D+1 ) connected to all other nodes (except the source node). Thus, there are 2 D+1 +1 nodes in the entire dataflow graph, and the index of each node is {0, 1, 2,..., 2 D+1 -1, 2 D+1}. In training, only the data samples that can flow from the source node to the sink node are considered as correctly classified samples, while the incorrectly classified ones 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 such that the number of correctly classified samples in the dataflow graph is maximized.
[0086] The decision variables involved are 0-1 variables b n,f representing whether a branch node n splits on feature f, where “1” means yes and “0” means no. 0-1 variables w n,h represent whether a terminal node n classifies labels into class h e {0, 1}, where w n,0 = 1 represents an invalid anticipated failure class, and w n,1 = 1 represents a valid anticipated failure class. 0-1 variables v n represent whether node n is determined as a terminal node, and 0-1 variables represent whether sample j flows along the arc from node n to node n’.
[0087] Existing MFOCTs models can only use 0-1 features for classification, and the key node partitioning constraints are as follows:
[0088]
[0089] The first constraint requires that if the feature f of the data sample j is selected by the node n to branch to the left (i.e., x j f = 0), then the data sample j can flow to the left child node l(n). Similarly, the second constraint is for branching to the right. While continuous features (such as net load values) can be handled by binning and using one-hot encoding to enable MFOCTs to handle these continuous features, this operation can reduce accuracy. On one hand, this is because binning can result in loss of information. On the other hand, binning increases the number of features after one-hot encoding, which can dilute 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 branching node n. By comparing the feature value with this threshold, it can be ensured that branching happens at most once, thereby determining whether the data sample branches to the left or right of the node, i.e.,
[0091]
[0092] Thus, the new node branching threshold constraint is as follows:
[0093]
[0094] where ε is a very small value to convert the strict inequality to a non-strict inequality.
[0095] indicates that if then the data sample j can flow to the left child node l(n). Similarly, indicates that if then the 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 x F 0-1 features after one-hot encoding. Thus, the number of 0-1 branching variables is also multiplied by N block . In contrast, can directly utilize the F continuous features with only an extra N B continuous variables, which does not increase with the number of features. Thus, the new branching threshold constraint is more beneficial, especially when there are many blocks for discretization.
[0097] The remaining constraints of IMFOCTs that are not affected by the nature of continuous or discrete features are as follows:
[0098]
[0099]
[0100] where the constraint ensures that each branch node n has one of the following three possibilities: when is equal to 1, the node branches at this node; when v n is equal to 1, the node is a terminal node; when is equal to 1, the node is pruned due to the existence of a terminal node in its ancestor nodes. The constraint ensures that only when node n is a terminal node, it will be assigned a class label. The constraint means that each terminal node n is either a leaf node or is 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 arrives at branch node n, it must flow to its left or right child node, or sink node S. The constraint ensures that if data sample j arrives at terminal node n, it must flow to sink node S. The constraint requires that only when data sample j is classified as the correctly labeled anticipated fault c at node n, it can flow through node n into sink node S. The constraint is a regularization condition for the classification tree, which ensures that at least N min data samples arrive at each terminal node n.
[0102] As an optional implementation, the objective function of the maximum flow optimal classification tree is improved as:
[0103]
[0104] where a e [0, 1] is a weight factor, π j represents the class weight, represents whether sample j flows along the arc from node n to sink node S, N represents the set of all candidate nodes, N B represents the set of branch nodes, 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] where 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 unbalanced trees. The two terms are weighted using a weight factor a e [0, 1]. However, since the envisioned failure labels are mostly unbalanced, and there is no distinction between samples of different classes in this objective function, it can not be accurate enough when dealing with unbalanced envisioned failure datasets.
[0108] While the unbalanced dataset is considered in MFOCTs by adding multiple sink nodes (one for each class), the number of 0-1 decision variables is also multiplied by the number of classes, increasing the complexity of the model. To consider unbalanced datasets without adding too much additional complexity, class weights are introduced, The objective function of MFOCTs can then be modified to:
[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 use 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 both continuous features and unbalanced datasets.
[0112] Embodiment 2
[0113] The 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 real-time net load corresponding to current power grid flow into a target first classification tree to obtain a current effective contingency set, perform steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a steady-state security rule, and transmit a determination result to the first determination module. The first determination module is configured to update the current power grid flow if the determination result of the first prediction module violates the steady-state security rule, and transmit the current flow to the first prediction module; and trigger the second prediction module to work if the determination result meets the steady-state security rule. The second prediction module is configured to input real-time operating state data corresponding to the current effective contingency into a target second classification tree to obtain a current transient stability result, determine whether the current power grid violates a dynamic security rule by using the current transient stability result, and transmit a determination result to the second determination module. The second determination module is configured to perform emergency control and implement power flow calculation if the determination result of the second prediction module violates the dynamic security rule, to update the current power grid flow and transmit the current flow to the first prediction module; and use the current transient stability result output by the target second classification tree to represent a target stability degree of the power grid if the determination result meets the dynamic security rule. The original first classification tree and / or the original second classification tree is an improved maximum flow optimal classification tree.
[0115] Embodiment 3
[0116] The embodiment provides a power grid dynamic security analysis system, which comprises a memory and a processor. The memory stores a computer program. The processor implements the steps of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree in the embodiment 1 when executing the computer program.
[0117] Embodiment 4
[0118] The embodiment provides a computer readable storage medium, which stores a computer program. The computer program implements the steps of the power grid dynamic security analysis method based on the improved maximum flow optimal classification tree in the embodiment 1 when executed by a processor.
[0119] Those skilled in the art will easily understand that the above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement and improvement within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A power grid dynamic security analysis method based on an improved maximum flow optimal classification tree, characterized in that, The method comprises the following steps: S1: inputting real-time net load corresponding to current power grid flow into a target first classification tree to obtain a current effective contingency set, performing steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a steady-state security rule; S2: if the steady-state security rule is violated, updating the current power grid flow and returning to S1; if the steady-state security rule is met, proceeding to S3; S3: inputting real-time operating state data corresponding to the current effective contingency into a 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 security rule; S4: if the dynamic security rule is violated, performing emergency control and implementing flow calculation to update the current power grid flow and return to S1; if the dynamic security rule is met, using the current transient stability result output by the target second classification tree to represent a target stability degree of the power grid; The target first classification tree is finally obtained by training an original first classification tree, and the target second classification tree is finally obtained by training an original second classification tree, wherein the original first classification tree and the original second classification tree are improved maximum flow optimal classification trees.
2. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 1, wherein, Before S1, the method further comprises: A1: clustering and sampling historical net load to obtain representative samples; A2: training the original first classification tree by taking the representative samples in the historical net load as input data and taking the effective contingency corresponding to the representative samples as output labels to finally obtain the target first classification tree.
3. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 1, wherein, Before S3, the method further comprises: B1: performing steady-state flow calculation on historical operating data of the power grid to obtain power grid flow results; B2: using the power grid flow results to assign initial values to a physical simulation module to solve the physical simulation module to obtain a transient stability margin index; B3: training the original second classification tree by taking operating state quantities as input data and taking the transient stability margin index as output labels to finally obtain the target second classification tree.
4. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 3, wherein, The B2 comprises: taking the power grid flow results as operating parameter initial values of the physical simulation module; solving the physical simulation module by using a time-domain simulation method to obtain generator power angle and frequency data, and analyzing the generator power angle and the frequency data to obtain the transient stability margin index.
5. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 4, wherein, The transient stability margin index is a difference between a stable limit phase angle difference and an actual maximum phase angle difference.
6. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 1, wherein, The constraint of the improved maximum flow optimal classification tree comprises: ; ; ; ; ; ; ; ; ; ; where 0-1 decision variable represents a sample j whether to flow along the arc from node n to n its left child node l ( n ), 0-1 variable x j f represents a feature of a data sample j f selected by node n to branch to the left or right of the node, left is 0 and right is 1, 0-1 decision variable represents a branching node n whether to branch on feature f , represents a set of branching nodes, η n represents a continuous decision variable, 0-1 decision variable represents a sample j whether to flow along the arc from node n to n its right child node r ( n ), represents a preset threshold value, equal to 1 indicates n the node is a terminal node, equal to 1 indicates n the node is pruned due to the existence of a terminal node in its ancestor node, A ( n ) represents a set of ancestor nodes of node n , 0-1 decision variable represents a terminal node n whether the label is classified as class , wherein w n,0 = 0 indicates an invalid expected failure class, w n,1 = 1 indicates a valid expected failure class, represents the number of times a data sample j in a data flow graph, represents a sample j whether to flow along the arc from n some ancestor node a ( n ) of node n , represents a sample j whether to flow along the arc from n node to sink node S , representative sample j at a node n whether the predicted failure at the node c , representative sample of each end node n.
7. The power grid dynamic security analysis method based on improved maximum flow optimal classification tree of claim 6, wherein, The objective function of the improved maximum flow optimal classification tree comprises: ; wherein, is a weight factor, denotes a class weight, and N denotes 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, The method comprises the following steps: a first prediction module, a first determination module, a second prediction module and a second determination module; the first prediction module is configured to input real-time net load corresponding to current power grid flow into a target first classification tree to obtain a current effective contingency set, perform steady-state security analysis on the current effective contingency set to determine whether the current power grid violates a steady-state security rule, and transmit a determination result to the first determination module; The first judging module is configured to update the current power grid flow and transmit the current power grid flow to the first predicting module if the judging result of the first predicting module violates the steady-state security rule; and trigger the second predicting module to work if the steady-state security rule is met. The second predicting module is configured to input current operating state data corresponding to the current effective contingency into a target second classification tree to obtain a current transient stability result, judge whether the current power grid violates a dynamic security rule by using the current transient stability result, and transmit a judging result to the second judging module. The second judging module is configured to perform emergency control and implement power flow calculation to update the current power grid flow and transmit the current power grid flow to the first predicting module if the judging result of the second predicting module violates the dynamic security rule; and use the current transient stability result output by the target second classification tree to represent a target stability degree of the power grid if the dynamic security rule is met. The target first classification tree is obtained by training an original first classification tree, and the target second classification tree is obtained by training an original second classification tree. The original first classification tree and the original second classification tree are improved maximum flow optimal classification trees.
9. A power grid dynamic security analysis system comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 7.
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