Power system transient power angle stability assessment method, system, device and medium
By adopting heterogeneous spatiotemporal neural network in the transient stability evaluation model of the power system, considering the bus type and cascade graph neural network and recurrent neural network, the accuracy loss problem caused by the existing model not taking into account the bus type during feature aggregation is solved, and a high-precision transient power angle stability evaluation is achieved.
Patent Information
- Application Number
- CN202411820179.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing power system transient stability evaluation model based on graph deep learning does not consider the bus type when aggregating graph node features, resulting in accuracy loss and it is difficult to effectively extract information in the system transient data.
Hetero-space-time neural network is used to cascade graph neural networks and recurrent neural networks, and the space-time characteristics mining of transient data of the power system is realized by marking bus types and constructing heterogeneous graph attention neural networks and gated recurrent unit neural networks.
By distinguishing and extracting transient data characteristics of different bus types, the accuracy reduction caused by the shared weight matrix of multiple types of equipment is avoided, the evaluation performance is improved, and high-precision evaluation of the stability of transient power angle under the "double high" power system is achieved.
Smart Images

Figure CN119294271B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electric power systems, and relates to transient power angle stability assessment of electric power systems, and in particular to a method, system, device and medium for transient power angle stability assessment of electric power systems. Background Art
[0002] With the access of a high proportion of new energy and power electronic equipment to the power grid, the modern power system has already shown a "double high" operation situation (a high proportion of renewable energy access and a high proportion of power electronic equipment). It is necessary to conduct a safety prevention assessment of the power system according to the planned or implemented operation mode to ensure its stable operation. Transient power angle stability assessment is one of the key links.
[0003] In recent years, the transient stability assessment technology of power systems based on graph deep learning technology has received widespread attention, such as China Invention Publication CN 111914486 A. Neural networks such as graph convolution and graph attention can mine the feature correlation between adjacent nodes and embed it into the high-dimensional feature aggregation process. The current common practice is to regard the busbars of the power system as type-indistinguished nodes and the branches as type-indistinguished connection edges, thereby modeling them as homogeneous graph models, which means that when the features are aggregated, all buses will share the parameter matrix. However, in actual power systems, each busbar will present greatly different transient characteristics due to the different connected devices, and it is difficult to use the shared parameter matrix to effectively extract the information contained in the system transient data, which in turn affects the evaluation accuracy and application value of the model. Summary of the invention
[0004] The purpose of the present invention is to provide a method, system, device and medium for evaluating the transient power angle stability of an electric power system, so as to reduce the accuracy loss caused by not considering the bus type when aggregating graph node features in a transient stability evaluation model of an electric power system based on graph deep learning. In addition, the present invention cascades a graph neural network and a recurrent neural network to achieve effective mining of the spatiotemporal characteristics of transient data of the electric power system, thereby further improving the evaluation accuracy of the model.
[0005] In order to achieve the purpose of the present invention, the present invention provides a method for evaluating the transient power angle stability of a power system based on a heterogeneous spatiotemporal neural network, comprising the following steps:
[0006] S1: Use the time domain simulation function of the power system simulation software to generate simulation results of the operation scenario as samples and include them in the sample set;
[0007] S2: Process the sample data, mark the bus types in the power system, and then convert the power system and the simulation results generated in step S1 into graph structure data, wherein the graph nodes are the buses of the power system, the types of the graph nodes are the bus types corresponding to the nodes, the edges of the graph are the branches connecting two buses in the power system, and the graph includes a bus data matrix, an adjacency matrix, and a transmission power matrix of the branches. For each sample, the maximum power angle difference between any two synchronous generators within the simulation time is calculated, and the maximum power angle difference is marked as a sample label;
[0008] S3: Divide the sample set into training set, validation set and test set;
[0009] S4: construct a heterogeneous spatiotemporal neural network model, including a heterogeneous graph attention neural network, a feature dimension reducer gated recurrent unit neural network, a feature dimension reducer and a classifier, wherein the heterogeneous graph attention neural network is used to mine the spatial features of transient data of the power system, the gated recurrent unit neural network is cascaded with the heterogeneous graph attention neural network, and is used to mine the temporal features of transient data of the power system, the feature dimension reducer is located between the heterogeneous graph attention neural network and the gated recurrent unit neural network, the feature dimension reducer is used to flatten the feature vectors of all buses output by the heterogeneous graph attention neural network into a one-dimensional vector, and reduce the dimension of the one-dimensional vector through a fully connected layer, and the classifier is used to perform transient stability evaluation according to the output of the last unit of the gated recurrent unit neural network, and output the evaluation result, which is the predicted value of the maximum power angle difference by the heterogeneous spatiotemporal neural network model;
[0010] S5: training the heterogeneous spatiotemporal neural network model;
[0011] S6: Input the data of the actual scenario to be evaluated into the trained heterogeneous spatiotemporal neural network model for evaluation to obtain the stability result.
[0012] Furthermore, when performing time domain simulation in step S1, the fault type set for each sample is a three-phase permanent short circuit fault, the fault location is on any transmission line, and the length from the head-end bus is any position of 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80% and 90%, the fault removal method is to disconnect the fault line, the fault occurrence time is the 50th cycle after the start of the simulation, the fault removal time is randomly selected between the 55th and 60th cycles after the start of the simulation, and the total simulation time is 500 cycles.
[0013] Furthermore, the bus types described in step S2 are divided into: a load bus for carrying loads, a synchronous machine bus for carrying synchronous generator sets, a connecting bus used only for transmitting power, and a new energy bus for carrying new energy generating sets.
[0014] Furthermore, the graph structure data in step S2 represents the state of each bus after the fault is cleared. T The bus data matrix of the operating status at each sampling time point The specific form is as follows:
[0015]
[0016] In the formula , Indicates busbar exist The moment Running information, Indicates busbar exist The moment Running information; Indicates the number of buses in the power grid; Since different types of buses often carry different amounts of operating information, the number of matrix columns is The value of ,function Indicates the type The number of operation information carried by the bus, so for any element in the matrix:
[0017]
[0018] Step S2 constructs an adjacency matrix based on the operating topology of the power grid after fault removal The form is as follows:
[0019]
[0020] The off-diagonal elements Indicates busbar and busbar The connection between ,and , whose value is the busbar in the power system node admittance matrix and busbar The branch admittance modulus and busbar between the nodes represented The ratio of the self-admittance norm of the represented node; the diagonal elements The value of is 1.
[0021] The graph structure data in step S2 represents the branches after the fault is cleared. T The transmission power matrix at each sampling time point The specific form is as follows:
[0022]
[0023]
[0024] In the formula Indicated by Moment bus pass 、 Transmission from branch to bus The active power, express Busbar pass , Transmission from branch to bus of reactive power.
[0025] Furthermore, in step S2, the voltage, phase angle, injected active power, injected reactive power of all buses, active power and reactive power transmitted on all branches, power angles of all synchronous generators, and label values of all samples are normalized according to the following formulas:
[0026]
[0027] In the formula, Indicates the value of the data after normalization; Represents the original value of the data, , Respectively represent the maximum and minimum values of the original values of this type of data.
[0028] Furthermore, step S3 divides the samples into training set, validation set and test set in a ratio of 7:2:1.
[0029] Further, in step S4, the heterogeneous graph attention neural network used includes a heterogeneous graph feature transformation layer and a plurality of stacked heterogeneous graph attention layers that apply a multi-head attention mechanism, wherein the heterogeneous graph feature transformation layer is expressed as:
[0030]
[0031] In the formula, To characterize the bus The original feature vector of the running state; It is the representation bus output by the heterogeneous graph feature transformation layer The characteristic vector of the operating state; Is a type mapping function, indicating the bus Type; Busbar type The corresponding linear transformation matrix; To characterize the connection bus , The active power and reactive power transmitted on the branch, The representation connection bus output by the heterogeneous graph feature transformation layer , The characteristic vector of the operating status of the branch, is the linear transformation matrix corresponding to the branch; after the heterogeneous graph feature transformation layer, all feature vectors representing the operating status of various buses and branches should have the same length.
[0032] A single heterogeneous graph attention layer is expressed as:
[0033]
[0034] In the formula, Indicates busbar The feature vector output after the heterogeneous graph attention layer; Indicates busbar Connected by lines and busbars The busbar set itself; is the corresponding element in the adjacency matrix; The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The eigenvector of Indicates busbar To busbar The resulting attention coefficient.
[0035] Furthermore, the busbar To busbar The attention coefficient generated The calculation formula is
[0036]
[0037] In the formula, , Busbar The query vector and the bus The key vector of Represents the connection bus of the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer , The eigenvector of the branch; represents the Hadamard product; and is the parameter matrix; Indicates busbar type The corresponding query vector calculation matrix, Indicates busbar type The corresponding key vector calculation matrix.
[0038] Furthermore, the gated recurrent unit neural network used in step S4 includes a plurality of gated recurrent units, and the number of gated recurrent units is equal to T , T is the number of sampling time points, and the forward propagation of a single unit can be expressed as:
[0039]
[0040] In the formula The feature vector representing the output of the heterogeneous graph attention neural network, represents the Hadamard product, tanh(·) is the hyperbolic tangent function, is the sigmoid function, , , , , and is the parameter matrix; , They represent the candidate hidden state and final hidden state generated by a single unit at the current time step respectively; To update the output of the gate at the current time step, decide the proportion of past information to retain; To reset the output of the gate at the current time step, determine the proportion of past information to be forgotten.
[0041] Furthermore, the hidden state of the last time step will be input into the classifier, which is a fully connected layer with an output dimension of 1, and is used to predict the maximum power angle difference between the synchronous machines in the corresponding operating scenario.
[0042] Preferably, in the heterogeneous spatiotemporal neural network model described in step S4, the bus and branch feature dimensions output by the heterogeneous graph feature transformation layer are 6; the heterogeneous graph attention layer adopts a multi-head attention mechanism, and the bus and branch feature dimensions output by a single attention head in each layer are both 16, there are 4 attention heads in total, and the layers are connected by the activation function ReLU; the output feature dimension of the dimensionality reduction fully connected layer is 64; and the hidden state feature dimension of the gated recurrent unit is 64.
[0043] Furthermore, step S5 uses minimizing the mean square error loss function shown in the following formula as the training objective of the model:
[0044]
[0045] In the formula, Indicates the first The mean square error of samples is is the number of samples for single batch training, Represent the predicted value and true value of the sample label respectively, It is the maximum predictable value of the maximum power angle difference between any two synchronous generators set artificially.
[0046] Preferably, the maximum number of training rounds is set to 200. When the evaluation accuracy of the validation set reaches the highest value in the training process and the value is not updated in the subsequent 20 rounds of training, the model corresponding to the maximum value is taken as the best model.
[0047] Furthermore, steps S5 and S6 measure the performance of the model based on the evaluation accuracy on the validation set and the test set respectively.
[0048] The evaluation accuracy is calculated based on the mean square error shown in the following formula:
[0049]
[0050] In the formula, Indicates the validation set or test set. The mean square error of samples is N Represents the total number of samples in the validation set or test set, Represent the predicted value and true value of the sample label in the validation set or test set, respectively. It is the maximum predictable value of the maximum power angle difference between any two synchronous generators set artificially.
[0051] Compared with the prior art, the present invention can at least achieve the following beneficial effects:
[0052] 1) The present invention can distinguish and extract transient data features of different bus types, thus avoiding the problem of decreased evaluation accuracy caused by sharing weight matrices of multiple types of equipment;
[0053] 2) The present invention can simultaneously capture the spatial distribution law and time correlation of each bus transient data, further improving the evaluation performance.
[0054] 3) The present invention can consider the differences in transient characteristics of different types of equipment in the power system, such as loads, synchronous generators, and new energy sources, by marking the bus type and adopting a heterogeneous spatiotemporal neural network model, thereby achieving a high-precision assessment of transient power angle stability in a "double-high" power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a working flow chart of a method for evaluating transient stability of a power system provided by an embodiment of the present invention.
[0056] Figure 2 It is a topological structure diagram of the IEEE-39 node system in an embodiment of the present invention.
[0057] Figure 3 It is a structural diagram of the transient power angle stability evaluation model described in an embodiment of the present invention.
[0058] Figure 4 It is a schematic diagram of the working mechanism of the heterogeneous graph attention layer described in an embodiment of the present invention.
[0059] Figure 5 Schematic diagram of the working mechanism of the gated recurrent unit described in an embodiment of the present invention.
[0060] Figure 6 It is a comparison chart of the loss curves of the power system transient power angle stability assessment method described in an embodiment of the present invention and other common deep learning-based algorithms during the training process.
[0061] Figure 7 It is a distribution frequency diagram of the evaluation error of the power system transient stability evaluation method described in the embodiment of the present invention on the test set. DETAILED DESCRIPTION
[0062] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution of the present invention will be further described below in conjunction with the drawings of the embodiments of the present invention.
[0063] refer to Figure 1 The method for evaluating transient power angle stability of a power system based on a heterogeneous spatiotemporal neural network provided in this embodiment includes the following steps:
[0064] S1: Use the time domain simulation function of the power system simulation software to generate simulation results of a large number of power system operation scenarios as samples and include them in the sample set.
[0065] The method provided by the present invention can be applied to all power systems.
[0066] In some embodiments of the present invention, a specific example of a power system is provided for ease of understanding. Use existing power system calculation and analysis software DSP (such as software developed by the Southern Power Grid Research Institute) to build a Figure 2 The modified IEEE-39 node system shown in the figure has synchronous generators connected to busbars 31-39. The synchronous generator of busbar 30 in the original IEEE-39 node system is replaced by a doubly-fed wind turbine. At the same time, buses 5, 6, 13, 14, 19 and 21 are also connected to doubly-fed wind turbines. When generating steady-state operation scenarios, the steady-state active output of the original synchronous unit is reduced to half of the original, and the maximum active output of the wind turbine is set to 120% of the active output arranged in steady state. The fully wired system, 20 operating topologies with one transmission line randomly disconnected, and 20 operating topologies with two transmission lines randomly disconnected are considered respectively. For each operating topology, the load level is modified in the range of 80%-120% of the baseline value with a step size of 2%, and the increased / reduced power is randomly allocated to each synchronous unit. A total of 861 steady-state operation scenarios are obtained.
[0067] For each steady-state operation scenario, all transmission lines are traversed, and a three-phase short-circuit fault is set at any position of 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80% and 90% from the head-end bus length. The fault occurs at the 50th cycle after the start of the simulation, and the fault is removed by disconnecting the fault line at the 55th-60th cycle. The total time domain simulation duration is 500 cycles, the sampling time interval is 0.5 cycle, and the system reference frequency is set to 50Hz.
[0068] According to the above process, the operating scenarios with isolated islands and non-convergent tidal currents are removed, and the final sample set contains 15,967 samples.
[0069] S2: Process the sample data, mark the bus types in the power system, and then convert the power system and the simulation results generated in step S1 into graph structure data, wherein the graph nodes are the buses of the power system, the types of the graph nodes are the bus types corresponding to the nodes, the edges of the graph are the branches connecting the two buses in the power system, and include the bus data matrix, the adjacency matrix and the transmission power matrix of the branches. For each sample, calculate the maximum power angle difference between any two synchronous generators during the simulation time, and mark the value of the maximum power angle difference as the sample label. Among them, each synchronous generator has a physical quantity called power angle at each moment, and the difference in power angle between each two synchronous generators is counted at each moment. The maximum difference obtained during the simulation time is called the maximum power angle difference.
[0070] The bus types include a load bus for carrying loads, a synchronous machine bus for carrying synchronous generator sets, a contact bus for transmitting power only, and a new energy bus for carrying new energy generator sets. In some embodiments of the present invention, Figure 2 In the system, buses 3, 4, 7, 8, 15, 18, 20, 21, 23, 24, 25, 26, 27, 28, and 29 are marked as load buses, and the number of operating information they carry is 4, including bus voltage amplitude, bus voltage phase, active power consumed by the load, and reactive power consumed by the load; buses 31, 32, 33, 34, 35, 36, 37, 38, and 39 are marked as synchronous machine buses, and the number of operating information they carry is 5, including bus voltage amplitude, bus voltage phase, active power consumed by the load, and reactive power consumed by the load. Line voltage phase, active power injected into the bus, and reactive power injected into the bus; mark buses 1, 2, 9, 10, 11, 12, 16, and 17 as interconnection buses, and carry 2 pieces of operation information, including bus voltage amplitude and bus voltage phase; mark buses 5, 6, 13, 14, 19, 22, and 30 as new energy buses, and carry 4 pieces of operation information, including bus voltage amplitude, bus voltage phase, active power injected into the bus, and reactive power injected into the bus.
[0071] In this step, the graph structure data in step S2 represents the busbar after the fault is cleared. T The bus data matrix of the operating status at each sampling time point The specific form is as follows:
[0072]
[0073] Adjacency matrix constructed based on the operating topology of the power grid after fault removal Expressed as
[0074]
[0075] T The transmission power matrix of the branch at each sampling time point Expressed as
[0076]
[0077] In the formula , Indicates busbar exist The moment Running information, Indicates busbar exist The moment Running information; Indicates the number of buses in the power grid; Since different types of buses often carry different amounts of operating information, the number of matrix columns is The value of ,function Indicates the type The number of operation information carried by the bus, so for any element in the matrix:
[0078]
[0079] Off-diagonal elements Indicates busbar and busbar The connection between ,and ; Its value is in the power system node admittance matrix, bus and busbar The branch admittance modulus and busbar between the nodes represented Ratio of self-admittance norms; diagonal elements The value of is 1; Indicated by Moment bus pass 、 Transmission from branch to bus The active power, express Busbar pass , Transmission from branch to bus The reactive power, Active Power and reactive power Vector composed of.
[0080] Specifically, in some embodiments of the present invention, the number of sampling time points is taken T =5, the sampling time interval of the sampling time point is 0.01s, and the bus data matrix, adjacency matrix and branch transmission power matrix representing the bus operation information after the samples are processed are respectively expressed as:
[0081]
[0082]
[0083]
[0084] The time domain simulation function of DSP can output the maximum power angle difference between synchronous generators corresponding to each sampling moment, count the maximum power angle difference between any two synchronous generators during the simulation time, and use the value as the label of the sample.
[0085] In order to reduce the impact of dimensions on the model, the voltage, phase angle, injected active power, injected reactive power of all buses, active power and reactive power transmitted on all branches, power angle of all synchronous generators and label values of all samples are standardized according to the maximum-minimum algorithm. The formula is as follows:
[0086]
[0087] In the formula, Indicates the value of the data after standardization; Represents the original value of the data, , Respectively represent the maximum and minimum values of the original values of this type of data.
[0088] S3: Divide the sample set into training set, validation set and test set according to the preset ratio.
[0089] In some embodiments of the present invention, the sample set is divided into a training set, a validation set, and a test set in a ratio of 7:2:1.
[0090] S4: Construct a heterogeneous spatiotemporal neural network model, including a heterogeneous graph attention neural network and a gated recurrent unit neural network, and a cascade of a heterogeneous graph attention neural network and a gated recurrent unit neural network.
[0091] Specifically, the heterogeneous spatiotemporal neural network model includes a heterogeneous graph attention neural network, a feature dimension reducer, a gated recurrent unit neural network and a classifier. The heterogeneous graph attention neural network, the feature dimension reducer and the gated recurrent unit neural network are connected in sequence. The heterogeneous graph attention neural network is used to mine the spatial characteristics of transient data of the power system. The feature dimension reducer is used to flatten the feature vectors of all buses output by the heterogeneous graph attention neural network into a one-dimensional vector, and reduce the dimension of the one-dimensional vector through a fully connected layer. The gated recurrent unit neural network is used to mine the time series characteristics of transient data of the power system. The classifier is used to perform transient stability evaluation according to the output of the last unit of the gated recurrent unit neural network and output the evaluation result.
[0092] The heterogeneous graph attention neural network includes a heterogeneous graph feature transformation layer and multiple stacked heterogeneous graph attention layers that apply a multi-head attention mechanism. The heterogeneous graph feature transformation layer is used to increase the node feature dimension to facilitate the subsequent extraction of rich information contained therein. The heterogeneous graph attention layer is used to realize the feature aggregation of all nodes and their neighboring nodes in the graph structure data. The specific construction steps are:
[0093] S41: Construct a heterogeneous graph feature transformation layer, expressed as:
[0094]
[0095] In the formula, To characterize the bus The original feature vector of the running state; Is a type mapping function, indicating the bus Type; Busbar type The corresponding linear transformation matrix; It is the representation bus output by the heterogeneous graph feature transformation layer The characteristic vector of the operating state; To characterize the connection bus , The active power and reactive power transmitted on the branch, The representation connection bus output by the heterogeneous graph feature transformation layer , The characteristic vector of the operating status of the branch, is the linear transformation matrix corresponding to the branch; after the heterogeneous graph feature transformation layer, all the feature vectors characterizing the operating status of various types of buses and branches have the same length. In some embodiments of the present invention, the dimension of all the feature vectors characterizing the operating status of various types of buses and branches is 6.
[0096] S42: Construct multiple heterogeneous graph attention layers, and use ReLU activation function to connect layers; the working mechanism of single-layer single-head heterogeneous graph attention (realizing the feature aggregation process of nodes) can be seen Figure 4 , that is, a single heterogeneous graph attention layer is expressed as:
[0097]
[0098] In the formula, Indicates busbar The feature vector output after the heterogeneous graph attention layer; Indicates busbar Connected by lines and busbars The busbar set itself; is the corresponding element in the adjacency matrix; The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The eigenvector of Indicates busbar To busbar The resulting attention coefficient is calculated by the following formula:
[0099]
[0100] In the formula, , Busbar The query vector and the bus The key vector of Represents the connection bus of the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer , The eigenvector of the branch; represents the Hadamard product; and All are parameter matrices; Indicates busbar type The corresponding query vector calculation matrix, Indicates busbar type The corresponding key vector calculation matrix, The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The characteristic vector of The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The feature vector of .
[0101] In some embodiments of the present invention, the heterogeneous graph attention neural network is provided with three stacked heterogeneous graph attention layers that apply a multi-head attention mechanism. Each layer adopts a multi-head attention mechanism, and the bus and branch feature dimensions output by a single attention head are both 16, with a total of 4 attention heads.
[0102] S43: Flatten the feature vectors of all buses output by the heterogeneous graph attention neural network into a one-dimensional vector, and reduce the dimension of the vector through a dimensionality reduction fully connected layer.
[0103] In some embodiments of the present invention, the output feature dimension of the dimensionality reduction fully connected layer is 64.
[0104] S44: Construct a gated recurrent unit neural network, including T The forward propagation of a single gated recurrent unit is as follows: Figure 5 As shown, it is expressed as:
[0105]
[0106] In the formula, To update the output of the gate at the current time step, decide the proportion of past information to retain; The feature vector representing the output of the heterogeneous graph attention neural network, represents the Hadamard product, tanh(·) is the hyperbolic tangent function, is the sigmoid function, , , , , and is the parameter matrix; , Respectively represent the current time step , candidate hidden states and final hidden states generated by a single gated recurrent unit; To reset the output of the gate at the current time step, determine the proportion of past information to be forgotten.
[0107] In some embodiments of the present invention, the gated recurrent unit neural network includes 5 gated recurrent units, and the hidden state dimension of a single gated recurrent unit is 64.
[0108] S45: Construct a classifier, which includes a fully connected layer, whose input is the hidden state of the last time step of the gated recurrent unit neural network, and whose output dimension is 1, and is used to predict the maximum power angle difference between the synchronous machines in the operating scenario.
[0109] S5: Training the heterogeneous spatiotemporal neural network model.
[0110] In this step, the data in the training set processed by steps S2 and S3 is input into the heterogeneous spatiotemporal neural network model constructed in S4 for training. After each round of training, the model accuracy is monitored on the validation set. When the accuracy of the heterogeneous spatiotemporal neural network model reaches the highest value and lasts for a certain number of training rounds, or the number of training rounds reaches the set upper limit, the training is stopped, otherwise it enters the next round of training.
[0111] In some embodiments of the present invention, The value is 300. When the model accuracy reaches the highest value and lasts for 20 training rounds, or the number of training rounds reaches the upper limit of 200 rounds, the training stops, otherwise it enters the next round of training.
[0112] During training, the training objective of the model is to minimize the mean square error loss function shown in the following formula:
[0113]
[0114] In the formula, Indicates the training batch The mean square error of samples is is the number of samples for single batch training, They represent the predicted value and true value of the sample label respectively.
[0115] Figure 6 The loss function value curves of the model on the training set and the validation set after each round of training are presented. It can be seen that as the training progresses, the prediction error of the model for the sample indicators gradually decreases and eventually converges to a lower level.
[0116] S6: Input the test set data into the trained model for evaluation to obtain the stability result, that is, the maximum power angle difference between the synchronous machines in the operating scenario.
[0117] In some embodiments of the present invention, steps S5 and S6 measure the performance of the model on the validation set and the test set according to the evaluation accuracy, and the evaluation accuracy is calculated using the mean square error shown in the following formula:
[0118]
[0119] In the formula, Indicates the validation set or test set. The mean square error of samples is N Represents the total number of samples in the validation set or test set, Represent the predicted value and true value of the sample label in the validation set or test set, respectively.
[0120] In some embodiments of the present invention, in the process of monitoring the performance of the validation set, it was found that the model achieved the best performance on the validation set after the 188th round of training, so the model obtained after the 188th round of training was taken as the best model.
[0121] The error distribution of the model evaluated on the test set is as follows Figure 7 As shown, it can be seen that 97.24% of the sample errors in the test set are between ±5%, indicating that the model has a good prediction ability for the maximum power angle difference of the synchronous machine after a transient fault in the power system, and the stability state and stability margin of the power system can be evaluated accordingly.
[0122] Through the aforementioned embodiments, the present application can consider the differences in transient characteristics of different types of equipment in the power system, such as loads, synchronous generators, and new energy, by marking the bus types and adopting a heterogeneous spatiotemporal neural network model, and distinguish and extract transient data characteristics of different bus types such as load buses, interconnection buses, synchronous buses equipped with synchronous generator sets, and new energy buses equipped with new energy units, thereby avoiding the problem of decreased evaluation accuracy caused by sharing weight matrices of multiple types of equipment, and achieving high-precision evaluation of transient power angle stability in a "double-high" power system.
[0123] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.
Claims
1. A method for evaluating transient power angle stability of a power system, characterized in that: The following steps are involved: S1: Use the time domain simulation function of the power system simulation software to generate simulation results of the operation scenario as samples and include them in the sample set; S2: Process the sample data, mark the bus types in the power system, and then convert the power system and the simulation results generated in step S1 into graph structure data, wherein the graph nodes of the graph structure data are the buses of the power system, the types of the graph nodes are the bus types corresponding to the nodes, the edges of the graph are the branches connecting two buses in the power system, and the graph includes a bus data matrix, an adjacency matrix, and a transmission power matrix of the branches. For each sample, the maximum power angle difference between any two synchronous generators within the simulation time is calculated, and the maximum power angle difference is marked as a sample label; S3: Divide the sample set into training set, validation set and test set; S4: Construct a heterogeneous spatiotemporal neural network model, including a heterogeneous graph attention neural network, a feature dimension reducer, a gated recurrent unit neural network and a classifier. The heterogeneous graph attention neural network is used to mine the spatial features of transient data of the power system. It includes a heterogeneous graph feature transformation layer and multiple stacked heterogeneous graph attention layers that apply a multi-head attention mechanism. The heterogeneous graph feature transformation layer is used to increase the node feature dimension. The heterogeneous graph attention layer is used to realize the feature aggregation of all nodes and corresponding neighbor nodes in the graph structure data, where: The heterogeneous graph feature transformation layer is expressed as: In the formula, To characterize the bus The original feature vector of the running state; It is the representation bus output by the heterogeneous graph feature transformation layer The characteristic vector of the operating state; Busbar type The corresponding linear transformation matrix; To characterize the connection bus , The active power and reactive power transmitted on the branch; The representation connection bus output by the heterogeneous graph feature transformation layer , The characteristic vector of the operating status of the branch, is the linear transformation matrix corresponding to the branch; A single heterogeneous graph attention layer is expressed as: In the formula, Indicates busbar The feature vector output after the heterogeneous graph attention layer; Indicates busbar Connected by lines and busbars The busbar set itself; The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The eigenvector of is the corresponding element in the adjacency matrix, representing the busbar and busbar The connection between Indicates busbar To busbar The attention coefficient generated; A gated recurrent unit neural network is cascaded with a heterogeneous graph attention neural network to mine the time series characteristics of transient data of the power system. A feature dimension reducer is located between the heterogeneous graph attention neural network and the gated recurrent unit neural network. The feature dimension reducer is used to flatten the feature vectors of all buses output by the heterogeneous graph attention neural network into a one-dimensional vector, and reduce the dimension of the one-dimensional vector through a fully connected layer. A classifier is used to perform transient stability evaluation according to the output of the last unit of the gated recurrent unit neural network and output an evaluation result, which is the predicted value of the maximum power angle difference by the heterogeneous spatiotemporal neural network model. S5: training the heterogeneous spatiotemporal neural network model; S6: Input the data of the actual scenario to be evaluated into the trained heterogeneous spatiotemporal neural network model for evaluation to obtain the stability result.
2. The method for evaluating transient power angle stability of a power system according to claim 1, characterized in that: In step S2, the busbar data matrix , adjacency matrix and the transmission power matrix The expression is In the formula, Indicates busbar exist The moment Running information, , Indicates the number of buses in the power grid; the number of matrix columns The value of ,function Indicates the type The number of operation information carried by the bus; the non-diagonal elements Indicates busbar and busbar The connection between ,and , off-diagonal elements The value of is in the power system node admittance matrix, the bus and busbar The branch admittance modulus and busbar between the nodes represented The ratio of the self-admittance norm of the represented node; the diagonal elements The value of is 1; Indicated by Moment bus Through busbar 、 Transmission from branch to bus Active power of express Busbar Through busbar , Transmission from branch to bus Reactive power; Active Power and reactive power The vector composed of T is the number of sampling time points.
3. The method for evaluating transient power angle stability of a power system according to claim 1, characterized in that: In step S2, the voltage, phase angle, injected active power, injected reactive power of all buses, active power and reactive power transmitted on all branches, power angles of all synchronous generators and label values of all samples are normalized.
4. The method for evaluating transient power angle stability of a power system according to claim 1, characterized in that: Busbar To busbar The attention coefficient generated The calculation formula is In the formula, , Busbar The query vector and bus The key vector of Represents the connection bus of the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer , The eigenvector of the branch; represents the Hadamard product; and is the parameter matrix; Indicates busbar type The corresponding query vector calculation matrix; Indicates busbar type The corresponding key vector calculation matrix; The busbar representing the output of the heterogeneous graph feature transformation layer or the previous heterogeneous graph attention layer The feature vector of .
5. The method for evaluating transient power angle stability of a power system according to claim 1, characterized in that: In step S4, the gated recurrent unit neural network includes a plurality of gated recurrent units, and the number of gated recurrent units is equal to T , T is the number of sampling time points, and the forward propagation of a single gated recurrent unit is expressed as: In the formula, To update the output of the gate at the current time step, decide the proportion of past information to retain; The feature vector representing the output of the heterogeneous graph attention neural network, represents the Hadamard product, tanh(·) is the hyperbolic tangent function, is the sigmoid function, , , , , and All are parameter matrices; , They represent the candidate hidden state and final hidden state generated by a single gated recurrent unit at the current time step respectively; To reset the output of the gate at the current time step, determine the proportion of past information to be forgotten; The hidden state of the last time step is input into the classifier, which is a fully connected layer and is used to predict the maximum power angle difference between the synchronous machines in the operating scenario.
6. The method for evaluating transient power angle stability of a power system according to any one of claims 1 to 5, characterized in that: Step S5 uses minimizing the mean square error loss function loss shown in the following formula as the training objective of the model: In the formula, Indicates a batch of training The mean square error of samples is is the number of samples for single batch training, Represent the predicted value and true value of the sample label respectively, It is the maximum predictable value of the maximum power angle difference between any two synchronous generators set artificially.
7. A power system transient power angle stability assessment system implementing the power system transient power angle stability assessment method according to claim 1, characterized in that: The system includes the following modules: A sample set building module is used to generate simulation results of operation scenarios as samples by using the time domain simulation function of the power system simulation software and include them in the sample set; A sample data processing module is used to process sample data, mark the bus types in the power system, and then convert the power system and the generated simulation results into graph structure data, wherein the graph nodes of the graph structure data are the buses of the power system, the types of the graph nodes are the bus types corresponding to the nodes, the edges of the graph are the branches connecting two buses in the power system, and the graph includes a bus data matrix, an adjacency matrix, and a transmission power matrix of the branches. For each sample, the maximum power angle difference between any two synchronous generators within the simulation time is calculated, and the maximum power angle difference is marked as a sample label; A sample set partitioning module is used to partition the sample set into a training set, a validation set, and a test set; A model building module, used to build a heterogeneous spatiotemporal neural network model, including a heterogeneous graph attention neural network, a feature dimension reducer, a gated recurrent unit neural network and a classifier, wherein the heterogeneous graph attention neural network is used to mine the spatial characteristics of transient data of the power system, the gated recurrent unit neural network is cascaded with the heterogeneous graph attention neural network, and is used to mine the temporal characteristics of transient data of the power system, the feature dimension reducer is located between the heterogeneous graph attention neural network and the gated recurrent unit neural network, the feature dimension reducer is used to flatten the feature vectors of all buses output by the heterogeneous graph attention neural network into a one-dimensional vector, and reduce the dimension of the one-dimensional vector through a fully connected layer, and the classifier is used to perform transient stability evaluation according to the output of the last unit of the gated recurrent unit neural network, and output the evaluation result, which is the predicted value of the maximum power angle difference by the heterogeneous spatiotemporal neural network model; A training module, used for training the heterogeneous spatiotemporal neural network model; The evaluation module is used to input the data of the actual scene to be evaluated into the trained heterogeneous spatiotemporal neural network model for evaluation to obtain stability results.
8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of any one of claims 1-7.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Transient stability evaluation method of electric power system based on graph attention network
CN111914486A
Hard bus prefabrication production line control method and system based on BIM model
CN118584925A
Data driving method suitable for multi-task transient stability evaluation of power system
CN118917194A