A power grid prevention control method, device, equipment and medium
Patent Information
- Application Number
- CN202211425797.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-11-14
AI Technical Summary
[0005]本发明的目的在于提供一种电网预防控制方法、装置、设备及介质,以解决背景技术中传统方法计算速度慢的问题
[0048] 1) The power grid prevention and control method provided in this solution inputs the current actual value of regional active power output into a preset stability assessment model, which outputs the power system operation prediction result. When the power system operation prediction result indicates power system instability, the current actual value of regional active power output is input into a preset local proxy model. This model identifies key features affecting power system stability. Based on these key features, linear constraints on the power grid safety boundary are generated. Based on these constraints, a DC optimal power flow method considering network losses is used to adjust the active power flow of the power system, thereby stabilizing its operation. This method eliminates the need for mechanistic modeling of the power system. The trained model can directly and in real-time perform transient stability assessment and prevention and control generation, supporting online applications and solving the problem of slow computation speed in traditional methods.
Smart Images

Figure CN115713032B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power system safety analysis and control, and specifically relates to a power grid prevention and control method, device, equipment and medium. Background Technology
[0002] Explanations of complex models can generally be divided into ante-hoc and post-hoc interpretations. Ante-hoc interpretation involves training models with simple structures and good interpretability, or integrating interpretability into specific model structures. Post-hoc interpretation refers to explaining trained machine learning models through the development of interpretability techniques. Post-hoc interpretability can be further divided into global interpretability and local interpretability, depending on the explanation goal and object. Global interpretability aims to help people understand the overall logic and internal working mechanisms behind complex models, while local interpretability aims to help people understand the decision-making process and basis of machine learning models for each input sample.
[0003] Power system unit instability is one of the main causes of large-scale accidents, and effective transient stability assessment and accident prevention measures are crucial for maintaining the safe and stable operation of the system. In power system transient stability control, there are generally two important methods: preventive control and emergency control, which are complementary in terms of time. Real-time prediction of transient stability after a fault requires extremely high speed and accuracy; however, if assessment can be performed before a fault occurs based on actual operating conditions, it can avoid analyzing a large number of irrelevant conditions, reducing the difficulty of the solution. Furthermore, once the current state is determined to be unsafe, there is still sufficient time to formulate preventive control strategies.
[0004] Generally, prevention and control problems require solving transient stability-constrained optimal power flow (TSCOPF) models. Traditional physical model-based computational methods offer advantages in accuracy and reliability, but the presence of nonlinear differential-algebraic equations in these models leads to computational complexity and long processing times, making them unsuitable for online computation. Data-driven methods excel in uncovering underlying patterns and offer fast computation speeds, allowing for the avoidance of solving complex time-domain equations in transient stability assessment problems. Simple models are intuitive and easy to interpret, but generally have lower prediction accuracy. Complex "black box" models typically have higher accuracy, but their incomprehensible decision-making logic makes them difficult to apply in highly security-sensitive power systems. Summary of the Invention
[0005] The purpose of this invention is to provide a power grid prevention and control method, device, equipment and medium to solve the problem of slow calculation speed in traditional methods in the background art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a power grid prevention and control method, comprising the following steps:
[0008] Obtain the current actual value of the active power output of the region's power generation;
[0009] The current actual value of the active power output of the region is input into a preset stability assessment model, and the stability assessment model outputs the power system operation prediction results.
[0010] When the power system operation prediction result indicates that the power system is unstable, the current actual value of the active power output of the regional power generation is input into a preset local proxy model, and the preset local proxy model is used to identify the key features affecting the stability of the power system operation.
[0011] Based on the aforementioned key features, linear constraints for power grid security boundaries are generated.
[0012] Based on the linear constraints of the power grid security boundary, the DC optimal power flow method considering network losses is used to adjust the active power flow of the power system, thereby stabilizing the operation of the power system.
[0013] Furthermore, in the step of inputting the current actual value of the active power output of the region into the preset stability assessment model, the training method of the stability assessment model is as follows:
[0014] Obtain a sample set of power system operation modes;
[0015] Construct an XGBoost model; wherein the XGBoost model is a decision tree forest model composed of K decision trees;
[0016] The objective function for training the decision tree forest model is determined, and iterative training is performed using gradient boosting based on the sample set of the operation mode to finally obtain the trained stability evaluation model.
[0017] Furthermore, the step of obtaining the power system operation mode sample set specifically includes:
[0018] The generators within the region are aggregated, and Latin hypercube sampling is performed on the aggregated generators to obtain a sample of the total active power output of the region.
[0019] Randomly sample the generators within the region to obtain a sample of their active power output.
[0020] The generator active power output sample is adjusted based on the total active power output sample of the region, so that the sum of the adjusted generator active power output samples is equal to the total active power output sample of the region.
[0021] The adjusted generator active power output sample is used to diagnose and adjust the branch active power flow exceeding the limit, so as to obtain the power system operation mode sample set;
[0022] The power system operation mode sample set includes unstable samples and stable samples.
[0023] Furthermore, after obtaining the sample set of power system operation modes, the process also includes the following steps:
[0024] When the unstable samples and stable samples in the power system operation mode sample set are unbalanced, the unstable samples or stable samples are minority class samples;
[0025] The k-nearest neighbor samples of the minority class samples are generated using the SMOTE method.
[0026] Several samples are randomly selected from the k nearest neighbor samples and combined with the minority class samples in a random proportion to form new minority class samples;
[0027] The new minority class samples are added to the power system operation mode sample set to obtain a balanced operation mode sample set.
[0028] Furthermore, in the step of determining the objective function for training the decision tree forest model, the objective function is J:
[0029]
[0030] In the formula: N and K are the number of samples and the number of decision trees, respectively; Ω is the L2 regularization term of the decision tree; f is the loss function; k is the leaf node value of the input feature for the k-th decision tree pair.
[0031] Furthermore, the step of identifying key features affecting the operational stability of the power system using a preset local proxy model is as follows:
[0032] The local proxy model is constructed using a classification regression tree; wherein the classification regression tree is a binary tree, and each branch node of the binary tree has two child nodes;
[0033] Obtain samples of local operating modes of the power system;
[0034] For the features of the sample in the local operation mode, starting from the root node of the binary tree, proceed to its child node according to the branching conditions of each branch node, until finally reaching the leaf node. The category corresponding to the leaf node is the predicted category of the feature of this sample.
[0035] Based on the prediction category, key characteristics affecting the stability of power grid operation are identified.
[0036] Furthermore, in the step of using the DC optimal power flow method considering network losses to adjust the active power flow of the power system, the objective function of the DC optimal power flow method for active power flow adjustment is:
[0037]
[0038] In the formula: S G It is a set of controllable power generation nodes; P G,i These represent the active power output of the controllable power generation node i before and after adjustment.
[0039] In a second aspect, the present invention provides a power grid prevention and control device, comprising:
[0040] The acquisition module is used to obtain the current actual value of the active power output of the regional power generation.
[0041] The prediction module is used to input the current actual value of the active power output of the region into a preset stability assessment model, and the stability assessment model outputs the power system operation prediction result.
[0042] The identification module is used to input the current actual value of the active power output of the power generation in the region into a preset local proxy model when the power system operation prediction result is that the power system is unstable, and to use the preset local proxy model to identify the key features affecting the stability of the power system operation.
[0043] The generation module is used to generate linear constraints for the power grid security boundary based on the key features;
[0044] The operation adjustment module is used to adjust the active power flow of the power system based on the linear constraints of the power grid security boundary and using the DC optimal power flow method that takes into account network losses, so as to stabilize the operation of the power system.
[0045] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the above-described power grid prevention and control method.
[0046] Fourthly, the present invention provides a computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the above-described power grid prevention and control method.
[0047] The beneficial effects of this invention are as follows:
[0048] 1) The power grid prevention and control method provided in this solution inputs the current actual value of regional active power output into a preset stability assessment model, which outputs the power system operation prediction result. When the power system operation prediction result indicates power system instability, the current actual value of regional active power output is input into a preset local proxy model. This model identifies key features affecting power system stability. Based on these key features, linear constraints on the power grid safety boundary are generated. Based on these constraints, a DC optimal power flow method considering network losses is used to adjust the active power flow of the power system, thereby stabilizing its operation. This method eliminates the need for mechanistic modeling of the power system. The trained model can directly and in real-time perform transient stability assessment and prevention and control generation, supporting online applications and solving the problem of slow computation speed in traditional methods.
[0049] 2) The power grid prevention and control method provided in this solution can cope with the diversity and uncertainty of power system operation modes, and perform adaptive extraction of operation characteristics, avoiding the complex modeling process of mechanism models.
[0050] 3) This solution uses an interpretable local proxy model for cause analysis of the results, which can help users grasp the important basis for model decision-making and avoid the decision-making risks of the model.
[0051] 4) In the model building step, this scheme uses SMOTE technology to balance the samples, which improves the training effect of machine learning under imbalanced sample conditions. Attached Figure Description
[0052] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0053] Figure 1 This is a schematic diagram of a two-region interconnection system in an embodiment of the present invention;
[0054] Figure 2 This is a schematic diagram of a binary classification decision tree and its two-dimensional region partitioning diagram in an embodiment of the present invention; wherein, (a) is a binary classification decision tree, and (b) is a two-dimensional region partitioning;
[0055] Figure 3 This is a flowchart of the online power grid stability prevention and control based on an interpretable surrogate model in an embodiment of the present invention;
[0056] Figure 4This is a schematic diagram of the SMOTE algorithm in an embodiment of the present invention; where (a) is the selection of k nearest neighbor samples, and (b) is the synthesis of minority class samples;
[0057] Figure 5 This is a frequency distribution histogram of the results of partitioned sampling and random sampling in an embodiment of the present invention;
[0058] Figure 6 This is a feature contribution diagram affecting the stability of the IEEE 39-node system in an embodiment of the present invention.
[0059] Figure 7 This is a diagram showing the active power output of the IEEE 39-node system before and after preventive control adjustments in an embodiment of the present invention.
[0060] Figure 8 The following is a simulation curve diagram before fault prevention control of IEEE 39 system branch 16-17 in this embodiment of the invention; where (a) is the synchronous motor power angle curve and (b) is the system node voltage amplitude curve.
[0061] Figure 9 The following is a simulation curve diagram after fault prevention control of IEEE 39 system branch 16-17 in an embodiment of the present invention; wherein, (a) is the synchronous motor power angle curve, and (b) is the system node voltage amplitude curve.
[0062] Figure 10 This is a structural block diagram of a power grid prevention and control device according to an embodiment of the present invention;
[0063] Figure 11 This is a structural block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0064] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0065] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0066] Example 1
[0067] This proposal suggests a power grid preventive control method based on the limit gradient boosting tree algorithm, employing an interpretable surrogate model for cause analysis of decision results. It can learn deeper intrinsic patterns between measured data and stability margins without human feature extraction, fitting the mapping relationship between generator output and stability. It boasts strong convergence and good generalization capabilities, realizing a data-driven approach to optimizing generator rescheduling preventive control strategies under anticipated fault set constraints, aiming to minimize control costs. This helps power grid operators promptly identify power grid operational risks and provide decision-making suggestions, demonstrating significant potential for widespread application.
[0068] like Figure 3 As shown, a power grid prevention and control method includes the following steps:
[0069] S1. Constructing a sample set of power system operation modes required for model training.
[0070] In this scheme, a partitioned sampling method is used to obtain a sample set of power system operating modes. During sampling, data such as generator active power output required for sampling are obtained from raw data such as load forecasting.
[0071] Specifically, it includes the following steps:
[0072] First, considering all generators within the region, Latin hypercube sampling is performed on the region's active power output to obtain a sample of the total active power output of the region; for example... Figure 1 The diagram shows a two-region interconnection system. During sampling, region A1 and region A2 are considered together.
[0073] Then, a random sample of the generators within the region is taken to obtain a sample of the generator's active power output; such as Figure 1 As shown, random sampling is performed on generators in regions A1 and A2 respectively.
[0074] Next, the active power output values of each power plant in the region are configured, and the values of the generator active power output samples are adjusted so that the sum of the adjusted generator active power output samples is equal to the total active power output sample of the region.
[0075] Then, based on the adjusted generator active power output sample, the branch active power flow exceeding the limit is diagnosed and adjusted, and a sample set of operating modes with converged power flow calculation and reasonable node voltage amplitude can be obtained.
[0076] The input characteristics of the operation mode samples are shown in Table 1.
[0077] Table 1 Steady-state characteristic quantities of the sample input for the operating mode
[0078]
[0079] Finally, transient stability simulation calculations are performed based on a preset fault set, and the output labels of the operating mode samples in the operating mode sample set are labeled. If an operating mode sample can remain stable under any fault in the preset fault set, the output label of the operating mode sample is a stable sample; otherwise, it is an unstable sample.
[0080] In some embodiments, there is an imbalance between unstable and stable samples. To balance the number of unstable and stable samples, the SMOTE method is used for oversampling.
[0081] For minority class sample features x i SMOTE calculates the Euclidean distance from a sample to other samples in the minority class sample set to obtain its k nearest neighbors. Several samples are randomly selected from these k nearest neighbors and compared with x. i New minority class samples are synthesized in a random proportion to increase the number of minority class samples. These new minority class samples are then added to the power system operation mode sample set to obtain a power system operation mode sample set with balanced quantity.
[0082] Specifically, the expression for calculating the k-nearest neighbor sample is:
[0083]
[0084] In the formula: For minority class samples x i k-nearest neighbor samples; For x i and A new minority class sample synthesized in a random proportion; ξ is a random number that follows a uniform distribution in the interval (0,1).
[0085] In this scheme, whether the transient power angle is unstable is used as the standard for whether the operating mode sample remains stable.
[0086] Specifically, the simulation time is set to 20 seconds, and the criterion for transient power angle instability is:
[0087]
[0088] In the formula: Δδ max , These represent the maximum power angle difference and its maximum allowable value between each synchronous motor at the end of the simulation. In this scheme... The value is set to 500°.
[0089] S2, Training Stability Evaluation Model
[0090] For the obtained sample set of power system operation modes, construct an XGBoost model;
[0091] The XGBoost model constructed in this scheme is a decision tree forest model composed of K decision trees. The output of the decision tree forest model is:
[0092]
[0093] In the formula: x i f is a feature of the i-th operating mode sample; k (·) represents the leaf node value of the input feature for the k-th decision tree pair.
[0094] 1) For the {0,1} binary classification problem involving stability and instability, firstly, the output value z of the decision tree forest model is... i Transform it into a probability value between 0 and 1 using the Logistic function. The expression is:
[0095]
[0096] 2) Select the logarithmic loss function as the loss function, and its expression is:
[0097]
[0098] In the formula: y i Let be the label of the i-th sample; log(·) is the natural logarithm function. The output value z of the decision tree forest model i The probability is converted to a value between 0 and 1 using the Logistic function.
[0099] 3) The objective function for training the decision tree forest model is determined as follows:
[0100]
[0101]
[0102] In the formula: N and K are the number of samples and the number of decision trees, respectively; Ω is the L2 regularization term of the decision tree; T is the number of leaf nodes of the decision tree; ω j Let be the value of the j-th leaf node; γ and λ are the regularization coefficients. f is the loss function; k is the leaf node value of the input feature for the k-th decision tree pair.
[0103] 4) Iterative training is performed based on the limit gradient boosting tree algorithm.
[0104] In the t-th iteration of the gradient boosting process, f is obtained through training. t And add it to the current decision tree forest, then the objective function in this iteration of training is:
[0105]
[0106] Performing a second-order Taylor expansion on the above equation yields:
[0107]
[0108] Where: g i h is the first derivative of the loss function of the decision tree. i Let be the second derivative of the loss function of the decision tree.
[0109] Remove the invariant values in equation (9) The approximate expression for the objective function is obtained as follows:
[0110]
[0111] Further simplification of the above equation yields:
[0112]
[0113] In the formula: I j Let j be the set of numbers of all samples mapped to leaf node j.
[0114] During the tree structure generation process, a leaf node is transformed into a branch node and its two corresponding leaf nodes. The newly generated branch node should test all features. For each feature, a linear search is performed on the split points to obtain the optimal split position that maximizes the objective function gain. Then, the optimal feature with the maximum objective function gain and its corresponding optimal split position are used to form a new branch node.
[0115] The expression for the gain of the objective function is:
[0116]
[0117] In the formula: I L I R Let I be the set of indices of all samples mapped to the newly generated left and right leaf nodes, respectively; L I R The union of .
[0118] The stability assessment model is trained through the above steps, and then used to identify the current actual value of regional power generation output and predict whether the power system is unstable.
[0119] S3. Construct a local proxy model
[0120] In this scheme, a classification regression tree model is used to construct a decision tree proxy model.
[0121] It should be noted that the CART classification tree used in this scheme is a binary tree, with each branch node having two child nodes. It can be used for classification problems or regression problems. When used for classification, it is called a classification tree, and when used for regression, it is called a regression tree.
[0122] For binary classification problems involving stability and instability, a schematic diagram of the classification decision tree and its corresponding two-dimensional region partitioning is shown below. Figure 2 As shown: (I) indicates that the category is unstable and the area is insecure; (S) indicates that the category is stable and the area is secure.
[0123] This method acquires samples of local operating modes of the power system. For a given sample of local operating modes, the process proceeds from the root node to its child nodes based on the branching conditions of each branch node, until finally reaching a leaf node. The category corresponding to the leaf node is then the predicted category of this sample. In this scheme, the key features affecting the stability of power grid operation are determined based on the predicted category.
[0124] The CART classification tree is constructed as follows:
[0125] First, based on the Gini index, select the best features and the best split points suitable for the CART classification tree.
[0126] The Gini index is expressed as follows:
[0127]
[0128] In the formula: D is the sample set; p c Let p be the probability of a sample of class c in D (estimated by sample frequency), and p be the probability of each class. c The sum is 1; C is the number of categories, which is 2 in the stable or unstable classification problem in this scheme.
[0129] Then, the sample set D is split into sample sets D1 and D2 based on whether feature a is less than the split point A. The Gini index expression corresponding to this split is:
[0130]
[0131] In the formula: |D|, |D1|, and |D2| are the number of samples in the sample sets D, D1, and D2, respectively.
[0132] In this scheme, to alleviate overfitting of the decision tree model and enhance its generalization performance, CART uses a cost-complexity pruning algorithm to cut some subtrees from the bottom of the fully grown decision tree. The loss function expression for pruning is as follows:
[0133] Cα(T t )=C(T t)+α|T t | (15)
[0134] In the formula: T t The subtree rooted at node t; |T t |For T t The number of leaf nodes; C(·) is the prediction error of the training data, measured by the Gini index in classification trees; α is the regularization coefficient. If the subtree rooted at t is pruned, the root node t becomes a unique leaf node, and the loss function is:
[0135] C α (t)=C(t)+α (16)
[0136] If pruning the subtree rooted at node t does not increase the value of the loss function, then it should be pruned; that is, the pruning condition is C. α (t)≤C α (T t From this, we can obtain:
[0137]
[0138] For a given α value, the optimal subtree corresponding to this α value can be obtained by pruning according to equation (17).
[0139] After optimization through the above steps, a local proxy model is obtained, which is used to identify key features affecting the stability of power system operation based on local operation mode samples, and serves as the stability assessment result.
[0140] S4. Generate prevention and control strategies based on stability assessment results.
[0141] In this scheme, the objective function for active power flow optimization and adjustment in transient stability prevention and control is set as follows:
[0142]
[0143] In the formula: S G It is a set of controllable power generation nodes; P G,i These represent the active power output of the controllable power generation node i before and after adjustment.
[0144] The power grid prevention and control method provided by this invention first samples and generates power system operation mode samples, obtaining steady-state characteristics of the operation mode samples through power flow calculation. Time-domain simulation calculations are performed based on a preset fault set to label the operation mode samples. If an operation mode sample remains stable under any preset fault, the sample is labeled as stable; otherwise, it is labeled as unstable. A stability assessment model is trained based on the operation mode sample data. This stability assessment model is a complex, high-performance transient stability assessment machine learning black-box model, such as a decision tree forest model or a multi-layer neural network model, for online transient stability assessment. When the online transient stability assessment result shows instability, a local surrogate model is used to identify key features affecting the stability of the power system operation. Finally, a prevention and control strategy is generated based on the stability assessment results.
[0145] The following describes this solution in further detail with reference to specific application examples.
[0146] Step 1: Construct the sample set of the running modes required for model training
[0147] In step 1, since instability in power systems is generally not easy to occur, the samples generated by sampling are usually mostly stable samples. The number of unstable samples is small, the categories are unbalanced, and the proportion of unstable samples in the total loss function is very small, which can easily lead to poor classification performance of the trained model on unstable samples.
[0148] This scheme considers a dataset to be imbalanced if the class imbalance ratio exceeds 4:1, moderately imbalanced if the ratio is around 20:1, and severely imbalanced if the ratio exceeds 100:1.
[0149] In this scheme, the Synthetic Minority Over-Sampling Technique (SMOTE) is used to interpolate and generate new minority class samples from the minority class samples, such as... Figure 4 As shown.
[0150] In terms of sample generation, this scheme employs a zonal sampling method. For example... Figure 1 As shown, the generators within the region are first aggregated and considered. After Latin hypercube sampling of the region's active power output, the active power output of each power plant within the region is further allocated through random sampling and adjustments to the total power generation. The results are as follows. Figure 5 As shown.
[0151] Compared with the method of direct random sampling, the total active power output of regions A1 and A2 and the transmission power of the transmission section between the two regions obtained by the partition sampling method in this scheme have a wider range and are not overly concentrated, which shows the advantages of the partition sampling method.
[0152] Step 2: Train the stability evaluation model
[0153] This scheme was used to conduct stability assessments on IEEE 39, IEEE 118, and a provincial-level power grid system. The performance data are shown in Table 2. It can be seen that this scheme can meet the stability screening requirements under power grid fault conditions.
[0154] Table 2. Stability evaluation performance indicators on different test systems.
[0155]
[0156]
[0157] Step 3: Construct a local proxy model
[0158] By constructing a local proxy model, key features that significantly impact power grid stability are identified. Taking the IEEE 39-node model as an example, the results are as follows: Figure 6 As shown, the feature contribution degree affecting the stability of the IEEE 39-node system is obtained, thus revealing the key features affecting power grid stability.
[0159] Step 4: Generate prevention and control strategies based on stability assessment results
[0160] Based on a local proxy model, linear constraints for the power grid safety boundary are generated. An optimal DC power flow method considering network losses is used for active power flow adjustment. The corresponding generation output adjustment is as follows: Figure 7 As shown in Table 3, it can be observed that the output of generators at nodes 33, 34, 35, and 36 decreases, while the output of other generators increases. The output adjustment of each generator is relatively small, indicating that the sample to be explained is close to the safety boundary.
[0161] Combination Figure 7 It is evident that such an adjustment can reduce the transmission power from the bottom right to the top left in the system diagram, which is consistent with the fact that the key to the instability of the current operating mode lies in the excessive transmission power from the bottom right to the top left in the system diagram.
[0162] Table 3. Active power adjustment results for preventive control in sample 1 of the IEEE 39-bus system (to be explained)
[0163]
[0164] The time-domain simulation curves of the IEEE 39-node system before and after preventive control under the anticipated fault in branch 16-17 are as follows: Figure 8 and Figure 9 As shown in the image.
[0165] Time-domain simulation verification revealed that the power grid would become unstable under the anticipated fault in branch 16-17, but would not become unstable under the anticipated faults in branch 2-1 or branch 26-29. The system after preventative control measures showed no instability under the anticipated faults in branch 16-17, branch 2-1, or branch 26-29. Therefore, it is evident that after implementing this preventative control scheme, the power grid system returns to a safe state and can maintain stable operation under the anticipated fault in branch 16-17.
[0166] Example 2
[0167] like Figure 10 As shown, based on the same inventive concept as the above embodiments, this solution also provides a power grid prevention and control device, including:
[0168] The acquisition module is used to obtain the current actual value of the active power output of the regional power generation.
[0169] The prediction module is used to input the current actual value of regional power generation output into a preset stability assessment model, and the stability assessment model outputs the power system operation prediction results.
[0170] In the prediction module, the stability assessment model is trained as follows: obtain a sample set of power system operation modes; construct an XGBoost model; wherein the XGBoost model is a decision tree forest model composed of K decision trees; determine the objective function for training the decision tree forest model, and iteratively train it based on the sample set of operation modes using gradient boosting, and finally obtain the trained stability assessment model.
[0171] The steps for obtaining the power system operation mode sample set are as follows: Aggregate generators within the region; perform Latin hypercube sampling on the aggregated generators to obtain a sample of the total active power output of the region; randomly sample generators within the region to obtain a sample of generator active power output; adjust the generator active power output sample based on the sample of the total active power output of the region, so that the sum of the adjusted generator active power output samples is equal to the total active power output sample of the region; diagnose and adjust the branch active power flow exceeding limits on the adjusted generator active power output sample to obtain the power system operation mode sample set; wherein, the power system operation mode sample set includes unstable samples and stable samples. After obtaining the power system operation mode sample set, if the unstable and stable samples in the power system operation mode sample set are unbalanced, and the unstable or stable samples are minority class samples, then the SMOTE method is used to generate k-nearest neighbor samples of the minority class samples; several samples are randomly selected from the k-nearest neighbor samples and combined with the minority class samples in a random proportion to form new minority class samples; the new minority class samples are added to the power system operation mode sample set to obtain a balanced operation mode sample set.
[0172] The objective function for training the decision tree forest model is defined as J:
[0173]
[0174] In the formula: N and K are the number of samples and the number of decision trees, respectively; Ω is the L2 regularization term of the decision tree; f is the loss function; k is the leaf node value of the input feature for the k-th decision tree pair.
[0175] The identification module is used to input the current actual value of regional power generation output into a preset local proxy model when the power system operation prediction result indicates that the power system is unstable. The preset local proxy model is then used to identify the key features affecting the stability of the power system operation.
[0176] In the identification module, the local proxy model is constructed using a classification regression tree. The classification regression tree is a binary tree, and each branch node of the binary tree has two child nodes. Samples of local operating modes of the power system are obtained. For the features of the local operating mode samples, starting from the root node of the binary tree, the model proceeds to its child nodes according to the branching conditions of each branch node until it finally reaches the leaf node. The category corresponding to the leaf node is the predicted category of the features of this sample. Based on the predicted category, the key features affecting the stability of power grid operation are determined.
[0177] The generation module is used to generate linear constraints for power grid security boundaries based on key features.
[0178] The operation adjustment module is used to adjust the active power flow of the power system based on the linear constraints of the power grid security boundary and the DC optimal power flow method that takes into account network losses, so as to stabilize the operation of the power system.
[0179] In the operation and adjustment module, the objective function for active power flow adjustment using the DC optimal power flow method is:
[0180]
[0181] In the formula: S G It is a set of controllable power generation nodes; P G,i These represent the active power output of the controllable power generation node i before and after adjustment.
[0182] Example 3
[0183] like Figure 11As shown, the present invention also provides an electronic device 100 for implementing a power grid prevention and control method; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104. The memory 101 can be used to store the computer program 103, and the processor 102 implements the steps of the power grid prevention and control method of Embodiment 1 by running or executing the computer program stored in the memory 101 and calling data stored in the memory 101. The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 101 may include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0184] At least one processor 102 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 102 may be a microprocessor or any conventional processor. Processor 102 is the control center of electronic device 100, connecting various parts of electronic device 100 via various interfaces and lines.
[0185] The memory 101 in the electronic device 100 stores multiple instructions to implement a power grid prevention and control method, and the processor 102 can execute multiple instructions to achieve the following:
[0186] Obtain the current actual value of the active power output of the region's power generation;
[0187] The current actual value of the active power output of the region is input into a preset stability assessment model, and the stability assessment model outputs the power system operation prediction results.
[0188] When the power system operation prediction result indicates that the power system is unstable, the current actual value of the active power output of the regional power generation is input into a preset local proxy model, and the preset local proxy model is used to identify the key features affecting the stability of the power system operation.
[0189] Based on the aforementioned key features, linear constraints for power grid security boundaries are generated.
[0190] Based on the linear constraints of the power grid security boundary, the DC optimal power flow method considering network losses is used to adjust the active power flow of the power system, thereby stabilizing the operation of the power system.
[0191] Example 4
[0192] If the modules / units integrated in the electronic device 100 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, and read-only memory (ROM).
[0193] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0194] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0195] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0196] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A power grid prevention and control method, characterized in that, Includes the following steps: A power system operation mode sample set is obtained and a stability assessment model is trained. The process includes: aggregating generators within a region; performing Latin hypercube sampling on the aggregated generators to obtain a sample of the total active power output of the region; randomly sampling generators within the region to obtain a sample of their active power output; adjusting the generator active power output samples based on the total active power output samples of the region, so that the sum of the adjusted generator active power output samples is equal to the total active power output samples of the region; diagnosing and adjusting branch active power flow exceeding limits on the adjusted generator active power output samples to obtain an operation mode sample set including unstable and stable samples. The training of the stability assessment model includes constructing an XGBoost model composed of K decision trees and iteratively training it using a gradient boosting method based on the operation mode sample set to obtain a trained stability assessment model. Obtain the current actual value of the active power output of the region's power generation; The current actual value of the active power output of the region is input into the stability assessment model, and the stability assessment model outputs the power system operation prediction result. When the power system operation prediction result indicates power system instability, a local operation mode sample of the power system is obtained. The current actual value of the active power output of the region is input into a preset local proxy model. The local proxy model is used to identify key features affecting the stability of the power system operation. The local proxy model is used to perform local cause analysis on the instability results output by the stability assessment model. The local proxy model is constructed using a classification regression tree, which is a binary tree, with each branch node having two child nodes. The construction of the local proxy model includes: selecting the optimal feature from the local operation mode sample based on the Gini index. The sample set is segmented based on whether the optimal feature is less than the corresponding optimal segmentation point. A cost-complexity pruning algorithm is used to prune the fully grown classification and regression tree, resulting in a local surrogate model for interpreting local stability. For the features of the local operating mode samples, starting from the root node of the classification and regression tree, the tree proceeds to its child nodes according to the branching conditions of each branch node until it finally reaches a leaf node. The category corresponding to the leaf node is used as the predicted category of the local operating mode sample. Key features affecting the stability of the power grid operation are determined based on the features in the branch path from the root node to the leaf node that forms the predicted category. Based on the aforementioned key features, linear constraints for power grid security boundaries are generated. Based on the linear constraints of the power grid safety boundary, the DC optimal power flow method considering network losses is used to adjust the active power flow of the power system to ensure stable operation of the power system; wherein, the DC optimal power flow method takes the minimum of the sum of squares of the active power output deviations before and after the adjustment of controllable generation nodes as the objective function.
2. The power grid prevention and control method according to claim 1, characterized in that, The steady-state characteristic quantities of the operating mode sample input in the operating mode sample set include node characteristics and branch characteristics; the node characteristics include active and reactive power of generation, active and reactive power of load, amplitude and phase angle of node voltage; the branch characteristics include active and reactive power of branch, phase angle difference of voltage at both ends of branch, and magnitude of branch impedance.
3. The power grid prevention and control method according to claim 1, characterized in that, The output labels of the operation mode samples in the operation mode sample set are determined by transient stability simulation calculation based on a preset fault set. If the operation mode sample can remain stable under any fault in the preset fault set, then the output label of the operation mode sample is a stable sample; otherwise, it is an unstable sample.
4. The power grid prevention and control method according to claim 1, characterized in that, After obtaining the power system operation mode sample set, the method further includes: when the unstable samples and stable samples in the operation mode sample set are unbalanced, the unstable samples or stable samples are minority class samples; using the SMOTE method to generate k-nearest neighbor samples of the minority class samples; randomly selecting several samples from the k-nearest neighbor samples and combining them with the minority class samples in a random proportion to synthesize new minority class samples; adding the new minority class samples to the operation mode sample set to obtain an operation mode sample set with balanced quantity.
5. The power grid prevention and control method according to claim 1, characterized in that, The objective function J in the training of the XGBoost model is: In the formula: N and M are the number of samples and the number of decision trees, respectively; For the L2 regularization term of the decision tree; The loss function; Let be the leaf node value of the input feature for the m-th decision tree pair; The output value of the decision tree forest model Convert the values to probability values between 0 and 1 using the Logistic function; Let be the label of the i-th sample.
6. The power grid prevention and control method according to claim 1, characterized in that, The step of selecting the best feature and the best split point from the features of the local operation mode samples based on the Gini index includes: splitting the sample set D into sample sets D1 and D2 based on whether feature a is less than split point A, and determining the best feature and the best split point based on the Gini index of the split sample sets D1 and D2; the step of pruning the fully grown classification and regression tree using a cost complexity pruning algorithm includes: pruning the subtree rooted at node t when the loss function value does not increase after pruning the subtree to obtain the corresponding optimal subtree.
7. The power grid prevention and control method according to claim 1, characterized in that, The objective function for active power flow adjustment in the DC optimal power flow method is: In the formula: It is a set of controllable power generation nodes; , These represent the active power output of the generator before and after the adjustment of the controllable generator node j.
8. A power grid prevention and control device, characterized in that, include: A sample training module is used to acquire a sample set of power system operation modes and train a stability assessment model. Specifically, the module aggregates generators within a region, performs Latin hypercube sampling on the aggregated generators to obtain a sample of the total active power output of the region; randomly samples generators within the region to obtain generator active power output samples; adjusts the generator active power output samples based on the total active power output samples of the region, ensuring that the sum of the adjusted generator active power output samples equals the total active power output samples of the region; diagnoses and adjusts branch active power flow exceeding limits on the adjusted generator active power output samples, resulting in a sample set of operation modes including unstable and stable samples; and constructs an XGBoost model composed of K decision trees, iteratively training it using a gradient boosting method based on the sample set of operation modes to obtain a trained stability assessment model. The acquisition module is used to obtain the current actual value of the active power output of the regional power generation. The prediction module is used to input the current actual value of the active power output of the region into the stability assessment model, and the stability assessment model outputs the power system operation prediction result; The identification module is used to acquire local operating mode samples of the power system when the power system operation prediction result indicates power system instability. It inputs the current actual value of the active power output of the region into a preset local proxy model and uses the local proxy model to identify key features affecting the stability of the power system operation. The local proxy model is used to perform local cause analysis on the instability results output by the stability assessment model. The local proxy model is constructed using a classification regression tree, which is a binary tree, with each branch node having two child nodes. The construction of the local proxy model includes: selecting features from the local operating mode samples based on the Gini index. The optimal feature and the optimal split point are selected, and the sample set is split based on whether the optimal feature is less than the corresponding optimal split point. The fully grown classification and regression tree is pruned using a cost complexity pruning algorithm to obtain a classification and regression tree local surrogate model for interpreting local stability. For the features of the local operation mode sample, starting from the root node of the classification and regression tree, the tree proceeds to its child nodes according to the branch conditions of each branch node until it finally reaches the leaf node. The category corresponding to the leaf node is taken as the predicted category of the local operation mode sample, and the key features affecting the stability of power grid operation are determined based on the features in the branch path from the root node to the leaf node that forms the predicted category. The generation module is used to generate linear constraints for the power grid security boundary based on the key features; The operation adjustment module is used to adjust the active power flow of the power system based on the linear constraints of the power grid safety boundary and using the DC optimal power flow method that considers network losses, so as to stabilize the operation of the power system; wherein, the DC optimal power flow method takes the minimum of the sum of squares of the deviations in active power output of controllable generation nodes before and after adjustment as the objective function.
9. An electronic device, characterized in that, It includes a processor and a memory, the processor being used to execute a computer program stored in the memory to implement the power grid prevention and control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the power grid prevention and control method as described in any one of claims 1 to 7.