Power grid N-k security checking method and device
Features are extracted in the power grid through data-driven models and high-order graph convolution networks, combined with power flow regressors and node power prediction networks, to solve the problems of difficulty in processing long-distance power flow transfer information and complexity of new energy scenarios in N-k safety verification of power grids. Improved verification accuracy and applicability.
Patent Information
- Application Number
- CN202410563050.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-08-23
AI Technical Summary
Existing deep learning models are difficult to effectively process long-distance power flow transfer information in large-scale power grids in N-k safety verification of power grids, and the strong randomness and volatility of new energy sources increase the complexity of scene distribution, resulting in large branch load prediction errors. affect the accuracy of the model.
Using a data-driven model, by constructing a feature set, using high-order graph convolution network to extract features, combined with the power flow regressor and node power prediction network, predict the active and reactive power of the branch, calculate the power flow distribution and load rate, and use Keel The Hough discriminator determines the validity of the prediction results and performs AC power flow calculations to improve the accuracy of the check.
The accuracy of the N-k safety check model is improved, the prediction ability of the power grid branch load rate is enhanced, the over-smoothing problem of the model is reduced, and the applicability in large-scale power grids is improved.
Smart Images

Figure CN118536801A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid safety verification, and in particular to a power grid Nk safety verification method and device. Background Art
[0002] The Nk safety check of the power system focuses on whether other lines have the risk of heavy overload and the risk level when one or more branches of the power grid fail and exit operation. With the development of modern power systems, the expansion of the power grid scale and the increase in the penetration rate of new energy have put forward higher requirements for Nk safety check based on deep learning. When a branch fault occurs in the power grid, it usually causes local power flow transfer, resulting in an increase in the risk of heavy overload of some branches. In a large-scale power grid, this part of the branch may be located in the high-order neighborhood of the fault branch. The commonly used GDL model can only achieve the aggregation of the first-order neighborhood in one convolution, and the ability to transmit long-distance power flow transfer information is insufficient. In theory, stacking a large number of first-order graph convolution layers can realize the extraction of high-order neighborhood information, but the stacking of a large number of convolution layers can easily cause the model to fall into the problem of over-smoothing, resulting in a decrease in performance. In addition, with the increase in the penetration rate of new energy, the strong randomness and volatility of new energy have led to a sharp increase in the number of operating scenarios of the power grid and a widening of the distribution of scenarios. It is difficult for current deep learning models to fully learn the power flow distribution laws of each scenario. Coupled with the inherent errors of deep learning models, in some scenarios, there may be large errors in the load prediction of individual branches, which will lead to the invalidation of the prediction results. Summary of the invention
[0003] In order to solve the above technical problems, an embodiment of the present invention provides a method and device for safety verification of power grid Nk, which uses a design data-driven model to predict the flow distribution, and then calculates the branch load rate of the power system according to the flow distribution results, thereby improving the accuracy of the Nk safety verification model.
[0004] A first aspect of an embodiment of the present invention provides a method for safety verification of a power grid Nk, the method comprising:
[0005] Constructing a feature set according to the operating status data of the power system to be verified;
[0006] Input the feature set into the data-driven model for prediction to obtain prediction results, wherein the prediction results include the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node;
[0007] The power flow distribution of the power system to be verified is obtained by using the prediction results, and the difference between the inflow power and the outflow power of each node in the power system to be verified is calculated according to the power flow distribution;
[0008] The difference of each node is compared with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is judged to be a valid sample. The prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is judged to be an uncertain sample. The AC flow calculation is performed on the prediction result to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified based on the branch load rate.
[0009] In a possible implementation of the first aspect, constructing a feature set according to operating status data of the power system to be verified includes:
[0010] Obtaining operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtaining a first power flow solution according to the operating status data under the initial scenario;
[0011] According to the first power flow solution and the operating status data under the target scenario, the second power flow solution is obtained, where the expression of the second power flow solution is:
[0012]
[0013] In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d;
[0014] The node power variation is obtained according to the second power flow solution and the first power flow solution. The node power variation and the first power flow solution are used for feature extraction to obtain a node feature matrix. The adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix. The node feature matrix and the adjacency matrix are determined as a feature set.
[0015] In a possible implementation of the first aspect, inputting the feature set into a data-driven model for prediction to obtain a prediction result includes:
[0016] A high-order graph convolutional network is used to extract features from the feature set to obtain an extracted feature set, where the extracted feature set is:
[0017] X′=f MPGCN (X,A)
[0018] In the formula, X′ represents the extracted feature set, f MPGCN (·) represents the mapping function of the high-order graph convolutional network, A represents the adjacency matrix, and X represents the node feature matrix;
[0019] The node features in the feature set are converted into branch features to obtain a branch feature matrix. The normal operating branches in the target scenario are determined according to the adjacency matrix. The branch features of the nodes at both ends of the normal operating branches are combined to obtain the feature vectors of each branch, where the feature vector is:
[0020]
[0021] Where P h is the total number of attention heads, p represents the pth attention head, W I (p) and They represent the feature transformation matrices of the first and last nodes of the branch under the pth attention head, and ⊙ represents the Hadamard product operation;
[0022] The power flow regressor is used to predict the characteristic vector of each branch to obtain the active power and reactive power of each branch;
[0023] The node power prediction network is used to predict the extracted feature set to obtain the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node.
[0024] In a possible implementation of the first aspect, obtaining the power flow distribution of the power system to be verified by using the prediction result includes:
[0025] The active power of each PQ node and the active power of each PV node in the initial scenario are respectively superimposed with the power fluctuation value in the target scenario to obtain the active power of all PQ nodes and PV nodes in the target scenario;
[0026] The reactive power of each PQ node in the initial scenario is superimposed with the power fluctuation value in the target scenario to obtain the reactive power of all PQ nodes in the target scenario;
[0027] Determine the active power of all PQ nodes and PV nodes under the target scenario, the reactive power of all PQ nodes under the target scenario, the reactive power of the balancing node, the active power of the balancing node and the reactive power of the PV node as the node power flow results;
[0028] The active power and reactive power of each branch are determined as the branch flow results, and the flow distribution is obtained according to the node flow results and the branch flow results.
[0029] In a possible implementation manner of the first aspect, calculating the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution includes:
[0030] The node power flow results and branch power flow results are used to calculate the difference between the inflow power and outflow power of each node. The calculation formula of the difference is:
[0031]
[0032] In the formula, |ΔS i | represents the difference between the inflow power and outflow power of node i, S i =P i +jQ i Represents the power of node i, which is the difference between the node's power generation and load power. represents the set of branches adjacent to node i, S L,.k =P L,k +jQ L,.k represents the power of branch k. When the power flows to node i, S L,.k When the real part is positive and the outflow node is i, S L,.k The real part is negative.
[0033] In a possible implementation manner of the first aspect, an expression of the preset error coefficient is:
[0034]
[0035] In the formula, ψ i represents the preset error coefficient, τ represents the coefficient, S N,k Indicates the rated power of branch k.
[0036] In a possible implementation of the first aspect, calculating the branch load rate by using a load rate calculation formula to calculate the prediction result includes:
[0037] The load rate calculation formula is used to calculate the predicted results to obtain the branch load rate, where the load rate calculation formula is:
[0038]
[0039] In the formula, w k is the load rate of branch k, P L,k and Q L,k They represent the active power and reactive power of branch k respectively, S N,k is the rated power of branch k, I N,k Indicates the maximum current, that is
[0040] In a possible implementation manner of the first aspect, performing AC power flow calculation on the prediction result to obtain the branch load rate includes:
[0041] Initialize the node power flow solution in the prediction result to obtain the initialization power flow solution, obtain the unbalanced quantity equation according to the active power and reactive power in the initialization power flow solution, iterate the unbalanced quantity equation to obtain the power unbalance;
[0042] The power imbalance is judged. If the power imbalance meets the preset conditions, the iteration ends and the final node power flow solution is output. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula;
[0043] If the power unbalance does not meet the preset conditions, the unbalance equation is modified to obtain the unbalance vector, where the unbalance vector is:
[0044]
[0045] Where ΔP and ΔQ represent the active unbalance vector and reactive unbalance vector of the node respectively, H, N, K and L represent the correction matrices, H is a (n-1)×(n-1)-order square matrix, N is a (n-1)×m-order matrix, K is an m×(n-1)-order matrix, and L is an m×m-order square matrix;
[0046] The correction amount of the node voltage is calculated using the unbalanced quantity vector, and the node voltage is corrected according to the correction amount to obtain the final node power flow solution. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula.
[0047] A second aspect of an embodiment of the present invention provides a power grid Nk safety verification device, the device comprising:
[0048] A construction module, used for constructing a feature set according to the operating status data of the power system to be verified;
[0049] A prediction module is used to input the feature set into the data-driven model for prediction to obtain prediction results, wherein the prediction results include the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node;
[0050] A difference calculation module is used to obtain the power flow distribution of the power system to be verified by using the prediction results, and calculate the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution;
[0051] The comparison module is used to compare the difference of each node with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is judged to be a valid sample, and the prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is judged to be an uncertain sample, and the AC flow calculation is performed on the prediction result to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified according to the branch load rate.
[0052] In a possible implementation manner of the second aspect, constructing a feature set according to the operating status data of the power system to be verified includes:
[0053] Obtaining operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtaining a first power flow solution according to the operating status data under the initial scenario;
[0054] According to the first power flow solution and the operating status data under the target scenario, the second power flow solution is obtained, where the expression of the second power flow solution is:
[0055]
[0056] In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d;
[0057] The node power variation is obtained according to the second power flow solution and the first power flow solution. The node power variation and the first power flow solution are used for feature extraction to obtain a node feature matrix. The adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix. The node feature matrix and the adjacency matrix are determined as a feature set.
[0058] The embodiment of the present invention constructs a feature set according to the operating status data of the power system to be verified, inputs the feature set into the data-driven model for prediction, and obtains the prediction result, wherein the prediction result includes the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node. The power flow distribution of the power system to be verified is obtained by using the prediction result, and the difference between the inflow power and the outflow power of each node in the power system to be verified is calculated according to the power flow distribution, and the difference of each node is compared with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is determined to be a valid sample, and the prediction result is calculated by using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is determined to be an uncertain sample, and the prediction result is calculated by AC power flow calculation to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified according to the branch load rate. The method improves the accuracy of the Nk safety verification model by using the designed data-physical hybrid driven Nk safety verification method to perform Nk safety verification on the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 : A modeling flow chart of an embodiment of the power grid Nk safety verification method provided by the present invention;
[0060] Figure 2 : A structural diagram of a data-physical hybrid-driven Nk safety verification model for an embodiment of a power grid Nk safety verification method provided by the present invention;
[0061] Figure 3 : A structural diagram of a data driving module of a data-physical hybrid drive of an embodiment of a power grid Nk safety verification method provided by the present invention;
[0062] Figure 4 : A schematic diagram of a high-order graph convolution driven by data-physics hybrid in an embodiment of the power grid Nk safety verification method provided by the present invention;
[0063] Figure 5 : A working diagram of a Kirchhoff discriminator driven by a data-physics hybrid in one embodiment of the power grid Nk safety verification method provided by the present invention;
[0064] Figure 6 : A modified IEEE39 node system topology diagram of a data-physical hybrid drive of an embodiment of the power grid Nk safety verification method provided by the present invention;
[0065] Figure 7 : A device block diagram of an embodiment of the power grid Nk safety verification method provided by the present invention. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] Please refer to Figure 1 , which is a flow chart of an embodiment of a method for safety verification of a power grid Nk provided by an embodiment of the present invention, including steps S101 to S104, each of which is specifically as follows:
[0068] S101. Construct a feature set according to the operating status data of the power system to be verified.
[0069] In this embodiment, the designed data-physical hybrid driven Nk safety verification model structure is used to perform Nk safety verification on the power system to be verified. The data-physical hybrid driven Nk safety verification model structure is as follows: Figure 2 As shown. Before Nk safety check, select an operating point of the power grid as a reference point and call it the initial scenario. When a local disturbance occurs in the power grid (including branch failure, new energy output fluctuation, load fluctuation, etc.), the power flow distribution of the power grid will change. The present invention calls this scenario the target scenario, that is, the scenario where the Nk safety check needs to be risk analyzed. Therefore, for Nk n nodes and N l The power system with branches can be used to obtain the operating status of the power system. and It is represented by The injected active Injection reactive power Node voltage and phase angle Composition, branch flow solution The transmission active power of all branches and reactive composition.
[0070] In some embodiments, step S101 includes but is not limited to the following steps:
[0071] Obtaining operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtaining a first power flow solution according to the operating status data under the initial scenario;
[0072] According to the first power flow solution and the operating status data under the target scenario, the second power flow solution is obtained, where the expression of the second power flow solution is:
[0073]
[0074] In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d;
[0075] The node power variation is obtained according to the second power flow solution and the first power flow solution. The node power variation and the first power flow solution are used for feature extraction to obtain a node feature matrix. The adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix. The node feature matrix and the adjacency matrix are determined as a feature set.
[0076] Specifically, it is worth explaining that the first power flow solution refers to the power flow solution obtained based on the operating status data of the power system to be verified under the initial scenario, and the second power flow solution refers to the power flow solution obtained by superimposing the initial scenario power flow result and the power flow change caused by the disturbance.
[0077] When the power system is subject to a local disturbance, it will lead to a change in the power flow solution. This scenario is called the target scenario. The power grid is considered as a graph G(v,ε), where ν represents the set of nodes in the power grid and ε represents the set of branches in the power grid.
[0078] The branch flow in the target scenario can be regarded as the superposition of the flow result of the initial scenario and the flow change caused by the disturbance:
[0079]
[0080] In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d;
[0081] Considering that the branch flow in the target scenario is composed of the flow in the initial scenario and the flow change caused by the disturbance, the features are extracted from the initial scenario and the target scenario to form the node input of the model, that is, the node feature matrix, where the node feature vector of node i is:
[0082] X i =[P i ,Qi ,V i ,θ i ,ΔP i ,ΔQ i ,|Δy i |]
[0083] In the formula, [P i ,Q i ,V i ,θ i ] is the power flow solution of node i in the initial scenario, ΔP i and ΔQ i is the change in injected power of node i in the target scenario relative to the initial scenario. For PV nodes and balance nodes, ΔQ i Set to 0, represents the modulus of the node admittance change caused by Nk fault, represents the set of branches adjacent to node i, represents the set of faulty branches, y k =G k +jB k is the admittance of branch k.
[0084] The topology of the target scenario power grid is denoted as G′(v′,ε′). The adjacency relationship between nodes is represented by the adjacency matrix A of the target scenario power grid. The adjacency matrix expression is:
[0085]
[0086] Where |y| max is the maximum value of the modulus of the node admittance matrix element, A ij Represents the adjacency matrix between node i and node j.
[0087] The node feature matrix X and the adjacency matrix A constructed according to the above method are used to obtain a feature set, and the feature set is used as the input of the data-driven model, namely, the Nk DPSA model.
[0088] S102, inputting the feature set into the data-driven model for prediction to obtain prediction results, wherein the prediction results include the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node.
[0089] In this embodiment, when a local disturbance occurs in the power grid, it will cause a change in the power flow solution. Relative to the initial scenario, the reactive power Q of the PV nodes and the balancing nodes and the active power P of the balancing nodes may change in the target scenario. Therefore, the data driving module needs to additionally output the reactive power Q of the PV nodes and the balancing nodes, and the active power P of the balancing nodes on the basis of predicting the branch power flow to facilitate the subsequent judgment of the physical driving module. Therefore, after obtaining the feature vector, the feature set is input into the data-driven model for prediction to obtain the prediction result, which includes the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node. The data driving module uses the active P of all normally operating branches in the target scenario as the input. L 、Reactive power Q L , and the reactive power Q of the PV node and the balancing node, and the active power P of the balancing node as the module output, that is:
[0090] X,A→P L ,Q L ,P,Q
[0091] Among them, X represents the node feature matrix, A represents the adjacency matrix, and P L Indicates active power, Q L Indicates reactive power.
[0092] In some embodiments, step S102 includes but is not limited to the following steps:
[0093] A high-order graph convolutional network is used to extract features from the feature set to obtain an extracted feature set, where the extracted feature set is:
[0094] X′=f MPGCN (X,A)
[0095] In the formula, X′ represents the extracted feature set, f MPGCN (·) represents the mapping function of the high-order graph convolutional network, A represents the adjacency matrix, and X represents the node feature matrix;
[0096] The node features in the feature set are converted into branch features to obtain a branch feature matrix. The normal operating branches in the target scenario are determined according to the adjacency matrix. The branch features of the nodes at both ends of the normal operating branches are combined to obtain the feature vectors of each branch, where the feature vector is:
[0097]
[0098] Where P h is the total number of attention heads, p represents the pth attention head, W I (p) and They represent the feature transformation matrices of the first and last nodes of the branch under the pth attention head, and ⊙ represents the Hadamard product operation;
[0099] The power flow regressor is used to predict the characteristic vector of each branch to obtain the active power and reactive power of each branch;
[0100] The node power prediction network is used to predict the extracted feature set to obtain the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node.
[0101] Specifically, Figure 3 As shown in the figure, the data-driven module consists of two parts: a graph feature extraction network and a regression prediction network. The graph feature extraction network consists of a three-layer high-order graph convolution network to extract the power flow characteristics of the power grid after the disturbance. The regression prediction network predicts the branch flow and node power based on the node features extracted by the graph feature extraction network. In the designed power grid disturbance feature extraction model based on high-order graph convolution, the expanded receptive field enables the model to extract the characteristics of long-distance power flow transfer, improves the prediction performance of the model, and reduces the over-smoothing problem caused by stacking a large number of convolutional layers, making the model applicable in large-scale power grids.
[0102] Remember f MPGCN (·) is the mapping function of the high-order graph convolutional network. After feature extraction by the high-order graph convolutional network, the node feature is Where F is the extracted node feature dimension:
[0103] X′=f MPGCN (X,A)
[0104] In the formula, X′ represents the extracted feature set, f MPGCN (·) represents the mapping function of the high-order graph convolutional network, A represents the adjacency matrix, and X represents the node feature matrix;
[0105] The regression prediction network consists of a branch power flow prediction network and a node power prediction network. In the branch power flow prediction network, the feature converter is used to convert the node features into branch features. The positions of the non-zero elements in the adjacency matrix A represent the branches of the normal operation of the power grid under the target scenario. After obtaining the positions of all non-zero elements, the branch feature representation is synthesized based on the features of the nodes at both ends of the branch. The feature vector of branch k is denoted as H k .
[0106]
[0107] Where P h is the total number of attention heads, p represents the pth attention head, W I (p)and They represent the feature transformation matrices of the first and last nodes of the branch under the pth attention head, and ⊙ represents the Hadamard product operation;
[0108] The branch power flow regressor (BPFR) is a multi-layer perceptron network that outputs the predicted value P of active power and reactive power of each branch. k and Q k , whose expression is:
[0109] [P k ,Q k ] = f BPFR (H k )
[0110] In the formula, f BPFR (H k ) indicates the prediction of the feature vector using BPFR, Pk indicates the predicted value of active power, and Qk indicates the predicted value of reactive power.
[0111] The bus power prediction network includes the bus active power regressor (BAPR) and the bus reactive power regressor (BRPR). Both are multi-layer perceptron networks. BAPR predicts the active power Pi of the balancing node, and BPRP predicts the reactive power Qi of all PV nodes and balancing nodes. The expression is:
[0112]
[0113] Where P i represents the active power predicted by the balancing node, Q i Represents the reactive power predicted by the PV node and the balancing node.
[0114] In addition, high-order graph convolutions such as Figure 4 Specifically, the node degree matrix of the power grid is D is a diagonal matrix. According to the degree matrix and adjacency matrix, the Laplacian matrix of the graph can be expressed as: L = D -1 / 2 AD -1 / 2 .
[0115] In order to enable the convolutional layer to extract the features of the node's high-order neighborhood, it is first necessary to obtain the node's high-order neighborhood representation. The present invention refers to the recursive form of Chebyshev polynomials to represent the node's high-order neighborhood information, and the receptive field of the convolutional layer is M (considering the feature aggregation of the M-order neighborhood). The connection weight of the m-order neighborhood can be expressed as:
[0116] T (m) =2LT (m-1) -T (m-2) ,T (0) =I,T (1) =L
[0117] Where, T (m) represents the mth-order neighborhood adjacency matrix, I is the identity matrix, L = 2L / L max -diag(2L / L max ), L max is the maximum value of the elements of L.
[0118] like Figure 4 (b) and Figure 4 As shown in (c), within the same order neighborhood, considering that the risk of heavy overload of some branches changes due to Nk failure, the attention coefficient β is defined to improve the model's ability to distinguish the degree of impact.
[0119]
[0120] In the formula, represents the weight coefficient of node i obtaining information from its mth-order neighbor node j, W K and W Q is the feature transformation matrix.
[0121] For neighborhoods of different orders, the model should also have different levels of attention, such as Figure 4 (a). After the above description, the feature extraction process of MPGCN is expressed as:
[0122]
[0123] Where W m is the bias vector for extracting the m-th order neighborhood features, α (m) , β (m) and b m is the model's attention coefficient to the m-th order neighborhood, α, β and b m The introduction of can further alleviate the over-smoothing risk of the model.
[0124] S103, using the prediction results to obtain the power flow distribution of the power system to be verified, and calculating the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution.
[0125] In this embodiment, the power flow distribution of the power system to be verified is obtained according to the prediction result, and the difference between the inflow power and the outflow power of each node in the power system to be verified is calculated according to the power flow distribution.
[0126] In some embodiments, step S103 includes but is not limited to the following steps:
[0127] The active power of each PQ node and the active power of each PV node in the initial scenario are respectively superimposed with the power fluctuation value in the target scenario to obtain the active power of all PQ nodes and PV nodes in the target scenario;
[0128] The reactive power of each PQ node in the initial scenario is superimposed with the power fluctuation value in the target scenario to obtain the reactive power of all PQ nodes in the target scenario;
[0129] Determine the active power of all PQ nodes and PV nodes under the target scenario, the reactive power of all PQ nodes under the target scenario, the reactive power of the balancing node, the active power of the balancing node and the reactive power of the PV node as the node power flow results;
[0130] The active power and reactive power of each branch are determined as the branch flow results, and the flow distribution is obtained according to the node flow results and the branch flow results.
[0131] Specifically, the workflow of Kirchhoff discriminator is as follows: Figure 5 As shown, firstly, the power flow distribution is obtained according to the prediction results, and the power flow distribution is composed of the node power flow results and the branch power flow results. For the node power flow results, the active power P of the unbalanced nodes, namely the PQ nodes and the PV nodes, under the target scenario can be obtained by superimposing the active power of the initial scenario and the power fluctuation of the target scenario; the reactive power Q of the PQ nodes can be obtained by superimposing the node reactive power of the initial scenario and the fluctuation amount under the target scenario. In addition to the node power flow results that can be directly obtained by the target scenario, the active power P of the balanced node, the reactive power Q of the PV node and the balanced node are obtained through the prediction results of the output of the data driving module. For the branch power flow results, all are obtained by the output prediction results of the data driving module.
[0132] Then calculate the difference between the power flowing into and out of the node. In the actual operation of the power grid, all nodes satisfy Kirchhoff's current law. In order to evaluate the rationality of the prediction results of the data-driven model, calculate the difference between the power flowing into and out of all nodes. The power flowing into includes the power generated by the node and the power flowing from other nodes to the node; the power flowing out includes the load power of the node and the power flowing from the node to other nodes. The specific calculation formula is:
[0133]
[0134] In the formula, |ΔS i | represents the difference between the inflow power and outflow power of node i, S i =P i +jQ i Represents the power of node i, which is the difference between the node's power generation and load power. represents the set of branches adjacent to node i, S L,.k =P L,k +jQ L,.k represents the power of branch k. When the power flows to node i, S L,.k When the real part is positive and the outflow node is i, S L,.k The real part is negative.
[0135] The Kirchhoff discriminator based on relaxed power flow constraints is used to judge the validity of the prediction results of the data-driven module according to Kirchhoff's current law, and divide the samples into valid samples and uncertain samples. For valid samples, the prediction results of the data-driven module are directly output; for uncertain samples, the results are output after AC power flow calculation, which clarifies the risk distribution of the samples and improves the accuracy of safety verification.
[0136] S104. Compare the difference of each node with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is determined to be a valid sample. The prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is determined to be an uncertain sample. The AC flow calculation is performed on the prediction result to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified according to the branch load rate.
[0137] In this embodiment, after calculating the difference between the inflow power and the outflow power of the node, when a certain parameter domain is not fully learned by the deep model, it may cause a large prediction error in the sample or branch flow in this parameter domain. The present invention uses the relaxed Kirchhoff's current law constraint to determine the validity of the output of the data drive module. The structure of the physical drive module is as follows Figure 2 As shown in the right part. The Kirchhoff discriminator judges the rationality of the results according to the output results of the data-driven module, and defines the samples with reasonable prediction results as valid samples, and defines them as uncertain samples if they are not. For valid samples, the branch load rate is directly output according to the prediction results of the data-driven module. The physical driving module judges the validity and rationality of the prediction results of the data-driven module based on the power flow constraints, thereby improving the reliability of the Nk safety verification model.
[0138] In the actual operation of the power grid, all nodes strictly follow Kirchhoff's current law. Considering the inherent error of the deep learning model, the present invention relaxes the constraints of Kirchhoff's current law and defines an error coefficient for each node. When |ΔS i | is less than or equal to this coefficient, the node is considered to satisfy Kirchhoff's current law. In the prediction results, if all nodes satisfy Kirchhoff's current law, the sample is considered to be a valid sample; otherwise, it is an uncertain sample, and the expression of the preset error coefficient is:
[0139]
[0140] In the formula, ψ i represents the preset error coefficient, τ represents the coefficient, S N,k Indicates the rated power of branch k.
[0141] It should be noted that ψ i It is set to τ times the branch with the smallest rated capacity connected to the node i. In the present invention, τ is preferably set to 0.05.
[0142] If the prediction result is a valid sample, the load rate calculation formula is used to calculate the prediction result to obtain the branch load rate. If it is an uncertain sample, the prediction result is used to calculate the AC flow to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified based on the branch load rate.
[0143] In some embodiments, step S104 includes but is not limited to the following steps:
[0144] The load rate calculation formula is used to calculate the predicted results to obtain the branch load rate, where the load rate calculation formula is:
[0145]
[0146] In the formula, w k is the load rate of branch k, P L,k and Q L,k They represent the active power and reactive power of branch k respectively, S N,k is the rated power of branch k, I N,k Indicates the maximum current, that is
[0147] Specifically, for valid samples, the branch load rate is directly output according to the prediction result of the data driving module, where the load rate calculation formula is:
[0148]
[0149] In the formula, w k is the load rate of branch k, P L,k and Q L,k They represent the active power and reactive power of branch k respectively, S N,k is the rated power of branch k, I N,k Indicates the maximum current, that is
[0150] In some embodiments, step S104 includes but is not limited to the following steps:
[0151] Initialize the node power flow solution in the prediction result to obtain the initialization power flow solution, obtain the unbalanced quantity equation according to the active power and reactive power in the initialization power flow solution, iterate the unbalanced quantity equation to obtain the power unbalance;
[0152] The power imbalance is judged. If the power imbalance meets the preset conditions, the iteration ends and the final node power flow solution is output. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula;
[0153] If the power unbalance does not meet the preset conditions, the unbalance equation is modified to obtain the unbalance vector, where the unbalance vector is:
[0154]
[0155] Where ΔP and ΔQ represent the active unbalance vector and reactive unbalance vector of the node respectively, H, N, K and L represent the correction matrices, H is a (n-1)×(n-1)-order square matrix, N is a (n-1)×m-order matrix, K is an m×(n-1)-order matrix, and L is an m×m-order square matrix;
[0156] The correction amount of the node voltage is calculated using the unbalanced quantity vector, and the node voltage is corrected according to the correction amount to obtain the final node power flow solution. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula.
[0157] Specifically, for uncertain samples, the load rate is output after the AC power flow calculation is performed on the uncertain samples. The specific process is as follows:
[0158] The node power flow solution of the power system can be expressed as [P i ,Q i ,V i ,θ i ], P i , Q i 、V i and θ i Respectively represent the active power, reactive power, voltage amplitude and phase angle of node i. Nodes in the power grid can usually be divided into three categories. Before the power flow calculation, two elements are known in the power flow solution of each node. Among them, the active power and reactive power of the PQ node are known, and its real power is recorded as P is and Q is , the active power and voltage amplitude of the PV node are known, and its real active power is recorded as P is ; The voltage amplitude and phase angle of the balance node are known.
[0159] The node power of the power system satisfies the following equation:
[0160]
[0161] In the formula, θ ij =θ i -θ j is the phase difference between the voltages at nodes i and j, G ij +jB ij is the element in the i-th row and j-th column of the node admittance matrix.
[0162] In a system with n nodes, assume that nodes 1 to m are PQ nodes, nodes m+1 to n-1 are PV nodes, and node n is a balance node. n and δ n is given, the voltage amplitude U of the PV node m+1 ~U n-1 is also given, so only the voltage phase angles of n-1 nodes are left, δ1, δ2, ..., δ n-1 and the voltage amplitudes of the m nodes U1,U2,...,U m It is an unknown quantity.
[0163] For each PQ node and each PV node, the active power unbalance equation is obtained:
[0164]
[0165] For each PQ node, the reactive power unbalance equation is obtained:
[0166]
[0167] According to the active power unbalance equation and reactive power unbalance equation, the correction equation is obtained:
[0168]
[0169] ΔP=[ΔP1 ΔP2 ... ΔP n-1 ] T
[0170] ΔQ=[ΔQ1 ΔQ2 ... ΔQ m ] T
[0171] Δδ=[Δθ1 Δθ2 ... Δθ n-1 ] T
[0172] ΔV=[ΔV1 ΔV2 ... ΔV m ] T
[0173] V D2 =diag([V1 V2 ... V m ])
[0174]
[0175] Where ΔP and ΔQ are the node active and reactive unbalance vectors calculated according to the active power unbalance equation and the reactive power unbalance equation, respectively. H, N, K and L represent correction matrices. H is a (n-1)×(n-1)-order square matrix, N is a (n-1)×m-order matrix, K is an m×(n-1)-order matrix, and L is an m×m-order square matrix.
[0176] By taking the derivatives of the active power unbalance equation and the reactive power unbalance equation respectively, we can get the expressions of the Jacobian matrix elements as follows:
[0177] When i≠j:
[0178] H ij =-V i V j (G ij sinθ ij -B ij cosθ ij )
[0179] N ij =-V i V j (G ij cosθ ij +B ij sinθ ij )
[0180] K ij =V i V j (G ij cosθ ij +B ij sinθ ij )
[0181] L ij =-V i V j (G ij sinθ ij -B ij cosθ ij )
[0182] When i=j:
[0183] H ii =V i 2 B ii +Q i
[0184] N ii =-Vi 2 G ii -P i
[0185] K ii =V i 2 G ii -P i
[0186] L ii =V i 2 B ii -Q i
[0187] The process of Newton-Raphson method power flow calculation is as follows:
[0188] (1) Based on the original data of the power grid, the node admittance matrix is constructed and the node power flow solution is initialized. Usually, the voltage amplitude and phase angle of the PQ node are initialized to 1 and 0; the reactive power and phase angle of the PV node are initialized to 0; the active power and reactive power of the balancing node are initialized to 0, and the number of iterations k is set to 0.
[0189] (2) Calculate the power imbalance ΔP at the kth iteration based on the active power imbalance equation and the reactive power imbalance equation: i (k) and
[0190] (3) Determine whether the calculation has converged according to the following formula. If it has converged, the iteration ends, the node power flow solution is output, and the branch power flow is calculated; otherwise, the iteration continues, where ε is usually taken as 10 -5 .
[0191]
[0192] (4) Calculate the elements of the Jacobian matrix based on the active power unbalance equation and the reactive power unbalance equation.
[0193] (5) Calculate the node voltage correction value ΔV according to the correction equation i (k) and
[0194] (6) Correct the voltage of each node according to the following formula, iterate the count k+1, and return to step (2). If the iteration count reaches the set maximum number of iterations, the power flow calculation is considered to be non-convergent.
[0195]
[0196] After obtaining the node power flow solution, the branch power flow is calculated according to the following formula:
[0197]
[0198] Where P L,K and Q L,K Respectively represent the active power and reactive power of the branch between node i and node j, V i V j (G ij cosθ ij +B ij sinθ ij ), V i V j (B ij cosθ ij -G ij sinθ ij ) is the Jacobian matrix element.
[0199] According to the branch flow solution, the branch load rate is calculated using the load rate calculation formula.
[0200] The present application also implements the technical solution provided in the embodiments of the present application, such as Figure 6 As shown in the figure, the proposed model is tested and analyzed in the modified IEEE39 node system. The system topology is as follows Figure 6 As shown in the figure, the system contains 39 nodes, of which 7 are thermal power plants and 3 are wind farms, with a new energy penetration rate of 31.22%. The system contains 46 branches. For the convenience of testing, the rated capacity of all AC lines is set to 800MW and the rated capacity of transformers is set to 1200MW.
[0201] Use PSD-BPA to perform power flow calculation on the sample to generate labels. The sample generation process is as follows:
[0202] (1) The system load level was adjusted in steps of 5% within the range of 80% to 150%, and the generator output was randomly adjusted to balance the system power. At each load level, 90 generator output modes were randomly sampled, and a total of 1350 initial operating modes were obtained.
[0203] (2) Under each initial operation mode, the N-1 disconnection of the branch, the fluctuation of the new energy output of ±40%, and the fluctuation of the node load of ±10% are considered at the same time, and several target modes that require static safety analysis are obtained, and the samples that produce islands and non-convergent currents are discarded.
[0204] All training and testing are based on computers with Intel(R) Core(TM) i7-13700KF 3.40GHz CPU, 32GB RAM and NVIDIA GeForce RTX 4070Ti 12G. A total of 44,238 samples were obtained. The samples were randomly divided into training set, test set and validation set in a ratio of 3:1:1. In terms of model parameters, the order M of MPGCN is set to 5, and the number of attention heads P of the data-driven module is set to 1. h Set to 6.
[0205] The loss of the data-driven module during training is measured using the smoothed mean absolute error. The error calculation method is as follows:
[0206]
[0207] In the formula, B t is the total number of training set samples, N is the number of each sample node or branch, and x represents the electrical quantity predicted by the model, including P, Q, P L and Q L , x represents the predicted value of x by the data-driven module, and δ is an adjustable hyperparameter, which is set to 0.5 in the model training of this paper.
[0208] During the training process, since the downstream network consists of three regressors, the loss also consists of three parts: and They represent the prediction losses of BPFR, BAPR and BRPR respectively, and the total loss is shown as follows:
[0209]
[0210] During the training process, the model parameter settings are shown in Table 1.
[0211] Table 1 Model parameter settings
[0212]
[0213] After the training is completed, a sample is randomly selected from the validation set for detailed analysis and testing. The N-1 fault that occurs in this sample is that branch 4-14 is out of operation.
[0214] The node feature matrix and adjacency matrix of the selected samples are shown in Table 2 and Table 3. In the display of the adjacency matrix in Table 3, the present invention only displays the upper triangular elements of the matrix.
[0215] Table 2 Node feature matrix list
[0216]
[0217]
[0218] Table 3 Normalized upper triangular elements of the adjacency matrix
[0219]
[0220]
[0221] Taking the first-layer high-order graph convolution model as an example, after sufficient training, the weight coefficients of nodes obtaining information from neighborhoods of different orders are shown in Table 4.
[0222] Table 4 Weight coefficients of neighborhoods of different orders
[0223] Degree 1 2 3 4 5 α 0.4374 0.0666 0.3387 0.0768 0.0805
[0224] In the same order neighborhood, the model obtains information from different nodes with different weights. Taking the first order neighborhood as an example, the present invention visualizes the weight coefficients of the information obtained by the node from its first order neighborhood in the form of a sparse matrix. The results are shown in Table 5.
[0225] Table 5 First-order neighborhood feature weights
[0226]
[0227]
[0228]
[0229] After feature extraction by 3 layers of MPGCN, the node feature matrix is shown in Table 6. Since the feature dimension is 512, the present invention only visualizes the first 10 dimensions.
[0230] Table 6 The first 10 dimensions of node features after 3-layer MPGCN feature extraction
[0231]
[0232]
[0233]
[0234] After the regression prediction of the regression prediction network of the data-driven module, the power flow of all branches under the target scenario is shown in Table 7. The reactive power of all PV nodes and balancing nodes is shown in Table 8. The predicted active power value of the balancing node is -328.6346MW.
[0235] Table 7 Target scenario branch power prediction results
[0236]
[0237]
[0238] Table 8 Predicted reactive power values of PV nodes and balancing nodes
[0239]
[0240] According to the prediction results of the data driving module, the Kirchhoff discriminator proposed in the present invention is used to determine whether all nodes meet the Kirchhoff current law constraint. The judgment results are shown in Table 9. Where ΔP represents the difference between the active power flowing into the node and the active power flowing out, and ΔQ represents the difference between the reactive power flowing into the node and the reactive power flowing out. |ΔS| can also be expressed as
[0241] Table 9 Data-driven module effectiveness judgment results
[0242]
[0243]
[0244]
[0245] According to Table 9, all nodes of the sample satisfy Kirchhoff's current law. It is considered that the data driving module is effective for the prediction result of the sample. The sample is a valid sample. The load rate of all branches in the sample can be directly calculated and output. Finally, the output result of the Nk DPSA model proposed by the present invention is shown in Table 10.
[0246] Table 10 Branch load rate prediction results
[0247]
[0248]
[0249]
[0250] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0251] In some embodiments, Figure 7 As shown, it shows a block diagram of a power grid Nk safety verification device 700 provided in an embodiment of the present application, including: a construction module 701, a prediction module 702, a difference calculation module 703 and a comparison module 704, wherein:
[0252] A construction module 701 is used to construct a feature set according to the operating status data of the power system to be verified;
[0253] A prediction module 702 is used to input the feature set into the data-driven model for prediction to obtain a prediction result, wherein the prediction result includes the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node;
[0254] The difference calculation module 703 is used to obtain the power flow distribution of the power system to be verified by using the prediction results, and calculate the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution;
[0255] The comparison module 704 is used to compare the difference of each node with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is judged to be a valid sample, and the prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is judged to be an uncertain sample, and the AC flow calculation is performed on the prediction result to obtain the branch load rate, so that the target personnel can perform safety verification on the power system to be verified according to the branch load rate.
[0256] In some embodiments, constructing a feature set according to the operating status data of the power system to be verified includes:
[0257] Obtaining operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtaining a first power flow solution according to the operating status data under the initial scenario;
[0258] According to the first power flow solution and the operating status data under the target scenario, the second power flow solution is obtained, where the expression of the second power flow solution is:
[0259]
[0260] In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d;
[0261] The node power variation is obtained according to the second power flow solution and the first power flow solution. The node power variation and the first power flow solution are used for feature extraction to obtain a node feature matrix. The adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix. The node feature matrix and the adjacency matrix are determined as a feature set.
[0262] In some embodiments, the feature set is input into the data-driven model for prediction to obtain a prediction result, including:
[0263] A high-order graph convolutional network is used to extract features from the feature set to obtain an extracted feature set, where the extracted feature set is:
[0264] X′=f MPGCN (X,A)
[0265] In the formula, X′ represents the extracted feature set, f MPGCN (·) represents the mapping function of the high-order graph convolutional network, A represents the adjacency matrix, and X represents the node feature matrix;
[0266] The node feature matrix in the feature set is converted into branch features to obtain a branch feature matrix. The normal operating branch in the target scenario is determined according to the adjacency matrix. The branch features of the nodes at both ends of the normal operating branch are combined to obtain the feature vectors of each branch, where the feature vector is:
[0267]
[0268] Where P h is the total number of attention heads, p represents the pth attention head, W I (p) and They represent the feature conversion matrices of the first and last nodes of the branch under the pth attention head, Represents the Hadamard product operation;
[0269] The power flow regressor is used to predict the characteristic vector of each branch to obtain the active power and reactive power of each branch;
[0270] The node power prediction network is used to predict the extracted feature set to obtain the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node.
[0271] In some embodiments, using the prediction results to obtain the power flow distribution of the power system to be verified includes:
[0272] The active power of each PQ node and the active power of each PV node in the initial scenario are respectively superimposed with the power fluctuation value in the target scenario to obtain the active power of all PQ nodes and PV nodes in the target scenario;
[0273] The reactive power of each PQ node in the initial scenario is superimposed with the power fluctuation value in the target scenario to obtain the reactive power of all PQ nodes in the target scenario;
[0274] Determine the active power of all PQ nodes and PV nodes under the target scenario, the reactive power of all PQ nodes under the target scenario, the reactive power of the balancing node, the active power of the balancing node and the reactive power of the PV node as the node power flow results;
[0275] The active power and reactive power of each branch are determined as the branch flow results, and the flow distribution is obtained according to the node flow results and the branch flow results.
[0276] In some embodiments, calculating the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution includes:
[0277] The node power flow results and branch power flow results are used to calculate the difference between the inflow power and outflow power of each node. The calculation formula of the difference is:
[0278]
[0279] In the formula, |ΔS i | represents the difference between the inflow power and outflow power of node i, S i =P i +jQ i Represents the power of node i, which is the difference between the node's power generation and load power. represents the set of branches adjacent to node i, S L,.k =P L,k +jQ L,.k represents the power of branch k. When the power flows to node i, S L,.k When the real part is positive and the outflow node is i, S L,.k The real part is negative.
[0280] In some embodiments, the expression of the preset error coefficient is:
[0281]
[0282] In the formula, ψ i represents the preset error coefficient, τ represents the coefficient, S N,k Indicates the rated power of branch k.
[0283] In some embodiments, the load rate calculation formula is used to calculate the predicted result to obtain the branch load rate, including:
[0284] The load rate calculation formula is used to calculate the predicted results to obtain the branch load rate, where the load rate calculation formula is:
[0285]
[0286] In the formula, w k is the load rate of branch k, P L,k and Q L,k They represent the active power and reactive power of branch k respectively, S N,k is the rated power of branch k, I N,k Indicates the maximum current, that is
[0287] In some embodiments, performing AC power flow calculation on the prediction results to obtain the branch load rate includes:
[0288] Initialize the node power flow solution in the prediction result to obtain the initialization power flow solution, obtain the unbalanced quantity equation according to the active power and reactive power in the initialization power flow solution, iterate the unbalanced quantity equation to obtain the power unbalance;
[0289] The power imbalance is judged. If the power imbalance meets the preset conditions, the iteration ends and the final node power flow solution is output. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula;
[0290] If the power unbalance does not meet the preset conditions, the unbalance equation is modified to obtain the unbalance vector, where the unbalance vector is:
[0291]
[0292] Where ΔP and ΔQ represent the active unbalance vector and reactive unbalance vector of the node respectively, H, N, K and L represent the correction matrices, H is a (n-1)×(n-1)-order square matrix, N is a (n-1)×m-order matrix, K is an m×(n-1)-order matrix, and L is an m×m-order square matrix;
[0293] The correction amount of the node voltage is calculated using the unbalanced quantity vector, and the node voltage is corrected according to the correction amount to obtain the final node power flow solution. According to the final node power flow solution, the branch load rate is calculated using the load rate calculation formula.
[0294] In one embodiment of the present application, a computer device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and the above steps are implemented when the processor executes the computer program; the computer device provided in this embodiment has an implementation principle and technical effects similar to those of the above method embodiments, and will not be repeated here.
[0295] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the above steps are implemented when the computer program is executed by a processor; the computer-readable storage medium provided in this embodiment has an implementation principle and technical effects similar to those of the above method embodiment, and will not be repeated here.
[0296] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0297] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0298] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for checking the safety of a power grid Nk, characterized in that: include: Constructing a feature set according to the operating status data of the power system to be verified; Inputting the feature set into a data-driven model for prediction to obtain a prediction result, wherein the prediction result includes the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node; Using the prediction results, the power flow distribution of the power system to be verified is obtained, and according to the power flow distribution, the difference between the inflow power and the outflow power of each node in the power system to be verified is calculated; The difference of each node is compared with the preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is determined to be a valid sample. The prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is determined to be an uncertain sample. The prediction result is subjected to AC flow calculation to obtain the branch load rate, so that the target personnel can perform a safety check on the power system to be checked according to the branch load rate.
2. The method for safety verification of power grid Nk according to claim 1, characterized in that: The step of constructing a feature set according to the operating status data of the power system to be verified includes: Acquire operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtain a first power flow solution according to the operating status data under the initial scenario; According to the first power flow solution and the operating status data in the target scenario, a second power flow solution is obtained, wherein the expression of the second power flow solution is: In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d; The node power change is obtained according to the second power flow solution and the first power flow solution, and the node power change and the first power flow solution are used to perform feature extraction to obtain a node feature matrix, and the adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix, and the node feature matrix and the adjacency matrix are determined to be a feature set.
3. The method for safety verification of power grid Nk according to claim 1, characterized in that: The feature set is input into the data-driven model for prediction to obtain prediction results, including: A high-order graph convolutional network is used to extract features from the feature set to obtain an extracted feature set, wherein the extracted feature set is: X′=f MPGCN (X,A) In the formula, X′ represents the extracted feature set, f MPGCN (·) represents the mapping function of the high-order graph convolutional network, A represents the adjacency matrix, and X represents the node feature matrix; The node features in the feature set are converted into branch features to obtain a branch feature matrix, the normal operating branch in the target scenario is determined according to the adjacency matrix, and the branch features of the nodes at both ends of the normal operating branch are combined to obtain a feature vector of each branch, wherein the feature vector is: Where P j is the total number of attention heads, p represents the pth attention head, W I (p) and They represent the feature transformation matrices of the first and last nodes of the branch under the pth attention head, and ⊙ represents the Hadamard product operation; Using a power flow regressor to predict the characteristic vectors of each branch, and obtain the active power and reactive power of each branch; The extracted feature set is predicted using a node power prediction network to obtain reactive power of each PV node, reactive power of a balancing node, and active power of a balancing node.
4. The method for safety verification of power grid Nk according to claim 1, characterized in that: The step of obtaining the power flow distribution of the power system to be verified by using the prediction result includes: The active power of each of the PQ nodes and the active power of each of the PV nodes in the initial scenario are respectively superimposed with the power fluctuation value in the target scenario to obtain the active power of all PQ nodes and PV nodes in the target scenario; The reactive power of each of the PQ nodes in the initial scenario is superimposed with the power fluctuation value in the target scenario to obtain the reactive power of all PQ nodes in the target scenario; Determine the active power of all PQ nodes and PV nodes in the target scenario, the reactive power of all PQ nodes in the target scenario, the reactive power of the balancing node, the active power of the balancing node and the reactive power of the PV node as the node power flow result; The active power and reactive power of each branch are determined as branch flow results, and the flow distribution is obtained according to the node flow results and the branch flow results.
5. The method for safety verification of power grid Nk according to claim 4, characterized in that: The calculating the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution includes: The node power flow result and the branch power flow result are used to calculate the difference between the inflow power and the outflow power of each node, wherein the calculation formula of the difference is: In the formula, |ΔS i | represents the difference between the inflow power and outflow power of node i, S i =P i +jQ i Represents the power of node i, which is the difference between the node's power generation and load power. represents the set of branches adjacent to node i, S L,.k =P L,k +jQ L,.k represents the power of branch k. When the power flows to node i, S L,.k When the real part is positive and the outflow node is i, S L,.k The real part is negative.
6. The method for safety verification of power grid Nk according to claim 4, characterized in that: The expression of the preset error coefficient is: In the formula, ψ i represents the preset error coefficient, τ represents the coefficient, S N,k Indicates the rated power of branch k.
7. The method for safety verification of power grid Nk according to claim 1, characterized in that: The method of calculating the branch load rate by using a load rate calculation formula to calculate the prediction result includes: The load rate calculation formula is used to calculate the prediction result to obtain the branch load rate, wherein the load rate calculation formula is: In the formula, w k is the load rate of branch k, P L,k and Q L,k They represent the active power and reactive power of branch k respectively, S N,k is the rated power of branch k, I N,k Indicates the maximum current, that is 8. The method for safety verification of power grid Nk according to claim 1, characterized in that: The performing AC power flow calculation on the prediction result to obtain the branch load rate includes: Initializing the node power flow solution in the prediction result to obtain an initialized power flow solution, obtaining an unbalanced quantity equation according to the active power and reactive power in the initialized power flow solution, and iteratively calculating the unbalanced quantity equation to obtain a power unbalance; The power imbalance is judged. If the power imbalance satisfies a preset condition, the iteration ends and a final node power flow solution is output. According to the final node power flow solution, the branch load rate is calculated using a load rate calculation formula; If the power imbalance does not meet the preset conditions, the imbalance equation is modified to obtain an imbalance vector, where the imbalance vector is: Where ΔP and ΔQ represent the active unbalance vector and reactive unbalance vector of the node respectively, H, N, K and L represent the correction matrices, H is a (n-1)×(n-1)-order square matrix, N is a (n-1)×m-order matrix, K is an m×(n-1)-order matrix, and L is an m×m-order square matrix; The correction amount of the node voltage is calculated using the unbalanced amount vector, and the node voltage is corrected according to the correction amount to obtain a final node power flow solution. According to the final node power flow solution, the branch load rate is calculated using a load rate calculation formula.
9. A power grid Nk safety verification device, characterized in that: include: A construction module, used for constructing a feature set according to the operating status data of the power system to be verified; A prediction module, used for inputting the feature set into a data-driven model for prediction to obtain a prediction result, wherein the prediction result includes the active power and reactive power of each branch, the reactive power of each PV node, the reactive power of the balancing node, and the active power of the balancing node; A difference calculation module, used to obtain the power flow distribution of the power system to be verified by using the prediction result, and calculate the difference between the inflow power and the outflow power of each node in the power system to be verified according to the power flow distribution; A comparison module is used to compare the difference of each node with a preset error coefficient. If the difference of all nodes is less than the preset error coefficient, the prediction result is determined to be a valid sample, and the prediction result is calculated using the load rate calculation formula to obtain the branch load rate. If there is a difference greater than the preset error coefficient, the prediction result is determined to be an uncertain sample, and the prediction result is subjected to AC flow calculation to obtain the branch load rate, so that the target personnel can perform a safety check on the power system to be checked according to the branch load rate.
10. The power grid Nk safety verification device according to claim 9, characterized in that: The step of constructing a feature set according to the operating status data of the power system to be verified includes: Acquire operating status data of the power system to be verified under an initial scenario and operating status data under a target scenario, and obtain a first power flow solution according to the operating status data under the initial scenario; According to the first power flow solution and the operating status data in the target scenario, a second power flow solution is obtained, wherein the expression of the second power flow solution is: In the formula, S L,k and S′ L,k They represent the power flow solutions of branch k in the initial scenario and the target scenario respectively, is the disturbance set, including Nk fault, new energy output fluctuation and load fluctuation, etc., ΔS L,d→k It represents the change of the power flow in branch k caused by disturbance d; The node power change is obtained according to the second power flow solution and the first power flow solution, and the node power change and the first power flow solution are used to perform feature extraction to obtain a node feature matrix, and the adjacency relationship between each node in the target scenario is calculated to obtain an adjacency matrix, and the node feature matrix and the adjacency matrix are determined to be a feature set.
