Rapid N-1 fault analysis method and system based on graph neural network
Through the fast N-1 fault analysis method based on graph neural network, the particle swarm algorithm and topological adaptive graph convolution are used, combined with the physical constraints of the power system, and the GNN model is trained to predict the current distribution after the fault, solving the problem of excessive computational burden in the traditional method, and achieving efficient and accurate power system analysis.
Patent Information
- Application Number
- CN202510610369.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Traditional N-1 safety analysis is too burdensome in large-scale power systems, making it difficult to meet real-time operation requirements. With the integration of renewable energy and demand-side flexibility, the complexity of the power system increases and the computing bottleneck intensifies.
The fast N-1 fault analysis method based on graph neural network is adopted, and the transmission line parameter identification is performed through particle swarm algorithm to build a power system diagram, and the mask encoder is used to enhance the features, and a graph neural network architecture of topological adaptive graph convolution is constructed, and the physical constraints of the power system are embedded into the loss function. The dedicated GNN model is trained to predict the current distribution after the failure.
It significantly improves computing efficiency, reduces repeated online trend calculations, improves analysis speed and accuracy, and enhances the operating safety and reliability of the power grid.
Smart Images

Figure CN120492848A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to power system safety analysis technology, and in particular to a fast N-1 fault analysis method and system based on graph neural network. Background Art
[0002] N-1 safety analysis, also known as the single-fault safety criterion, is a criterion for determining power system safety. Specifically, it states that, under normal power system operation, if any single component (such as a generator, transmission line, or transformer) in the system fails and is removed, the power system should be able to maintain stable operation without overloading, short-circuiting, or damaging other components, without affecting the normal power supply to important users or causing voltage collapse or other accidents.
[0003] Traditional N-1 security analysis relies on repeated power flow calculations, which imposes a significant computational burden on large-scale power systems and makes it difficult to meet the demands of real-time operation. With the increasing integration of renewable energy and demand-side flexibility, power systems are becoming more complex, and the demand for security analysis is growing, further exacerbating computational bottlenecks.
[0004] In recent years, the development of artificial intelligence and machine learning technologies has provided new insights into addressing this problem. Graph Neural Networks (GNNs), with their ability to capture complex network relationships, have shown great potential in power system analysis. By leveraging the graph structure of power systems, GNNs can learn the patterns between voltage and power flow, enabling efficient and accurate power flow calculations. Previous studies have demonstrated that GNNs have achieved significant results in tasks such as state estimation and fault location.
[0005] Therefore, there is an urgent need to develop GNN-based fast N-1 fault analysis technology to avoid repeated online power flow calculations, reduce the computational burden, achieve real-time safety analysis, and enhance the resilience and operational decision-making capabilities of the power grid. Summary of the Invention
[0006] In response to the shortcomings of the existing technology, the present invention provides a fast N-1 fault analysis method and system based on graph neural network. By training a special GNN model to predict the branch flow after the fault, it avoids the repeated online flow calculation in the traditional method and significantly improves the computing efficiency.
[0007] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions:
[0008] In a first aspect, a fast N-1 fault analysis method based on a graph neural network comprises the following steps:
[0009] Use particle swarm optimization to identify transmission line parameters based on real-time measurement data;
[0010] Each busbar in the power system is considered as a node in the graph, and each transmission line is considered as an edge connecting two nodes in the graph. Node features and edge features are extracted based on the transmission line parameter identification results to construct the power system graph.
[0011] According to whether the node features in the power system diagram are known, the mask encoder is used to enhance the features of the unknown part to obtain the encoded feature vector;
[0012] A graph neural network architecture based on topological adaptive graph convolution is constructed. The graph neural network architecture includes a message passing part and a topological adaptive graph convolution part. In the message passing part, each node in the lth layer receives information from its neighboring nodes and performs local calculations, and then passes the updated information to its neighboring nodes and transmits the feature vector after message passing. With the original eigenvector X l Add them together to get a new feature vector; in the topology adaptive graph convolution part, the new feature vector is processed by the K-hop topology adaptive graph convolution layer to get the l+1 layer feature vector;
[0013] The node power balance constraints and node voltage amplitude constraints of the power system are embedded in the loss function of the graph neural network in the form of soft constraints. For each credible N-1 fault, a dedicated graph neural network model is trained using power flow solution data containing normal operating conditions and accident conditions.
[0014] According to each credible N-1 fault, the corresponding trained graph neural network model is used to predict the power system flow distribution after the fault for subsequent analysis.
[0015] Furthermore, the particle swarm algorithm is used to identify transmission line parameters based on real-time measurement data. The steps are as follows:
[0016] (1) Initialize the particle swarm: each particle represents a set of candidate parameters μ h =[G h ,B h ], randomly generate H particles, 1≤h≤H, and randomly set the initial velocity v of each particle h ; Among them G h represents the line conductance, B h represents line susceptance;
[0017] (2) Define the fitness function: The fitness function is the root mean square RMSE of the measurement error:
[0018]
[0019] Where h(·) is the line model equation, z p is the measurement data of the pth sample, P is the total number of measurement data samples, u p The input for calculating the predicted value of the p-th sample;
[0020] Use the current particle parameters μ h , calculate the predicted value h(μ h ,u p ), compare the predicted value with the actual measured value z p , calculate RMSE;
[0021] (3) At each iteration, the fitness value of each particle is calculated. If the current fitness value is better than the historical optimal value, the individual optimal value p is updated. best =μ h , select the particle with the best fitness in the population as the global optimal value g best ; Update the velocity and position of each particle according to the following formula:
[0022]
[0023] Among them, ω is the inertia weight, c1 and c2 are learning factors, and r1 and r2 are random numbers in [0,1].
[0024] If the parameter exceeds the search space, it is forced to retract to the boundary;
[0025] (4) The process terminates when the maximum number of iterations is reached or the change in the global optimal fitness is less than the threshold.
[0026] Furthermore, the power system diagram G is expressed as:
[0027] G=(N,ε,x,e)
[0028] Where N represents the node set, ε represents the edge set, x represents the node feature set, and e represents the edge feature set;
[0029] For node n i , node feature vector x i Expressed as:
[0030] x i =[P i ,Q i ,|V i |,θ i ]
[0031] Among them, P i is the load active power, Q i is the load reactive power, |V i | is the voltage amplitude, θ i is the voltage phase angle;
[0032] For each edge ε ij , the edge eigenvector is expressed as:
[0033] e ij =[G ij ,B ij ]
[0034] Among them G ij is the line conductance obtained after parameter identification, B ij is the line susceptance obtained after parameter identification.
[0035] Furthermore, the mask encoder is used to enhance the features of the unknown part, including:
[0036] For each node n i , define a mask vector m i ∈{0,1} d , where d is the number of node features; the mask vector m i The element indicates whether the corresponding feature is known, 0 means known, 1 means unknown;
[0037] Use the mask encoder to transform the mask vector m i Converted into a continuous feature vector m i ′, use the fully connected layer to achieve:
[0038] m i ′=W1(σ(W0m i +b0))+b1
[0039] Where W0 and W1 are weight matrices, b0 and b1 are bias terms, and σ is the activation function;
[0040] The output m of the mask encoder is i ′ and the original feature x i Perform concatenation or addition operations to obtain the encoded feature vector x i ″:
[0041] x i ″=x i +m i '
[0042] Encoded feature vector x i ″ contains the known and unknown parts of the node features, where the unknown part is masked by the encoding vector m i ’ Enhanced.
[0043] Furthermore, in the message transmission part, for each node i, the message it receives is calculated by the following formula:
[0044]
[0045] in, represents the feature vector of node i in layer l, and N(i) represents the set of neighbor nodes of node i; represents the feature vector of edge (i, j), including the conductance and susceptance of the line; σ represents the nonlinear activation function; is a trainable parameter; [·] represents feature concatenation.
[0046] Furthermore, in the topology-adaptive graph convolution part, the feature vector calculation formula is as follows:
[0047]
[0048] Where S = D -1 / 2 AD -1 / 2 is the normalized adjacency matrix, K is the order of the adjacency matrix A, is the learnable weight at each stage, and σ represents the nonlinear activation function.
[0049] Furthermore, the node power balance constraint and node voltage amplitude constraint of the power system are embedded into the loss function of the graph neural network in the form of soft constraints, as follows:
[0050] (1) Define the basic loss function for fitting the tidal data:
[0051]
[0052] Where M is the total number of samples in the graph neural network training set, is the trend of the mth sample predicted by the graph neural network, y m is the true value;
[0053] (2) Define the physical constraint loss function:
[0054] Node power balance constraints: predicted power flow Node power balance must be met:
[0055] L power =||P calc -P inj || 2 +||Q calc -Q inj || 2
[0056] Among them, P calc , Q calc is the active and reactive injection power vector calculated by the AC power flow equation; P inj , Q injare the known active and reactive injection power vectors; the active and reactive injection power calculation formulas for the i-th node in the power network are as follows:
[0057]
[0058] Where j is the node connected to node i, θ ij =θ i -θ j is the phase angle difference between node i and node j, G ij 、B ij are the conductance and susceptance of branch ij respectively;
[0059] Voltage amplitude constraint: The node voltage must meet the voltage amplitude constraint:
[0060]
[0061] in is the node voltage amplitude predicted by the graph neural network, V max 、V min are the maximum and minimum node voltages, respectively;
[0062] (3) Define the joint loss function:
[0063] L total =L data +λ1L power +λ2L voltage
[0064] Among them, λ1 and λ2 are weight hyperparameters used to balance fitting accuracy and physical consistency.
[0065] The second aspect is a fast N-1 fault analysis system based on graph neural network, including:
[0066] Line parameter identification module, used to identify transmission line parameters based on real-time measurement data using particle swarm optimization;
[0067] The power system diagram construction module is used to regard each bus in the power system as a node in the diagram, and each transmission line as an edge connecting two nodes in the diagram. It extracts node features and edge features based on the transmission line parameter identification results to construct the power system diagram;
[0068] The mask encoder module is used to enhance the features of the unknown parts using the mask encoder according to whether the node features in the power system diagram are known, and obtain the encoded feature vector;
[0069] The network construction module is used to construct a graph neural network architecture based on topological adaptive graph convolution. The graph neural network architecture includes a message passing part and a topological adaptive graph convolution part. In the message passing part, each node in the lth layer receives information from its neighboring nodes and performs local calculations, and then passes the updated information to its neighboring nodes and sends the feature vector after the message passing. With the original eigenvector X l Add them together to get a new feature vector; in the topology adaptive graph convolution part, the new feature vector is processed by the K-hop topology adaptive graph convolution layer to get the l+1 layer feature vector;
[0070] The network training module is used to embed the power system's node power balance constraints and node voltage amplitude constraints into the graph neural network's loss function as soft constraints. For each credible N-1 fault scenario, a dedicated graph neural network model is trained using power flow solution data covering both normal operating and accident states.
[0071] The power flow prediction module is used to predict the power flow distribution of the power system after the fault based on each credible N-1 fault using the corresponding trained graph neural network model for subsequent analysis.
[0072] In a third aspect, the present invention also provides a computer device comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the fast N-1 fault analysis method based on graph neural network as described in the first aspect is implemented.
[0073] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the fast N-1 fault analysis method based on graph neural network as described in the first aspect.
[0074] Compared with the prior art, the present invention has the following beneficial effects:
[0075] (1) Transmission line parameters are identified based on real-time measurement data to ensure the accuracy of the physical parameters of the power system diagram; the power system is converted into a graph structure, which can naturally represent the complex topological relationships and electrical connections between the various components in the power system, providing a more suitable model basis for subsequent fault analysis; the mask encoder enhances the node features of the unknown part, thereby improving the model's ability to handle incomplete or uncertain information.
[0076] (2) A graph neural network architecture based on topology-adaptive graph convolution is adopted, which can automatically adapt to the topological changes of the power system. In the message passing part, local electrical characteristics are captured through the interaction and integration of neighbor node information. In the topology-adaptive graph convolution part, the K-hop topology-adaptive graph convolution layer is used to process feature vectors, which can capture long-range dependencies in the power system and better reflect the global characteristics of the power system.
[0077] (3) During training, the node power balance constraints and node voltage amplitude constraints of the power system are embedded in the loss function of the graph neural network in the form of soft constraints, combining physical knowledge with data-driven methods. This not only utilizes a large amount of power flow solution data, but also ensures that the model's prediction results conform to the physical laws of the power system, thereby improving the model's reliability and generalization ability.
[0078] (4) By training a specialized GNN model to predict branch currents after a fault, the repeated online current calculations in traditional methods are avoided, and computational efficiency is significantly improved. By leveraging the powerful learning ability of GNN and the effective use of the power system graph structure, it is possible to accurately predict branch currents after a fault, meeting the needs of practical applications.
[0079] (5) The proposed GNN model has good scalability and can be applied to larger-scale power systems. In addition, the framework proposed in this paper can be combined with other relevant factors (such as dynamic stability assessment) to further expand its scope of application. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 Flow chart of the method of the present invention;
[0081] Figure 2 This is the structure diagram of the mask encoder;
[0082] Figure 3 This is a diagram of the graph neural network architecture based on topology adaptive graph convolution. DETAILED DESCRIPTION
[0083] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings.
[0084] The embodiment of the present invention provides a fast N-1 fault analysis method based on graph neural network, referring to Figure 1 , the method comprises the following steps:
[0085] Step 1: Transmission line parameter identification. This involves using a particle swarm optimization algorithm based on real-time measurement data to ensure the accuracy of the physical parameters in the power system diagram. This includes the following steps:
[0086] 11) Initialize the particle swarm. Each particle represents a set of candidate parameters μh =[G h ,B h ], where G h represents the line conductance, B h Represents the line susceptance; randomly generate H particles (1≤h≤H), and randomly set the initial velocity v of each particle h ;
[0087] 12) Define the fitness function. The fitness function is the root mean square error (RMSE):
[0088]
[0089] Where h(·) is the line model equation, z p is the measurement data of the pth sample (voltage V, current I, active power P, reactive power Q), P is the total number of measurement data samples, u p The input for calculating the predicted value of the p-th sample.
[0090] Use the current particle parameters μ h , calculate the predicted value h(μ h ,u p ), compare the predicted value with the actual measured value z p , calculate RMSE;
[0091] 13) At each iteration, calculate the fitness value of each particle. If the current fitness is better than the historical optimal value, update the individual optimal value p best =μ h , select the particle with the best fitness in the population as the global optimal value g best . Update the velocity and position of each particle as follows:
[0092]
[0093] Among them, ω is the inertia weight, c1 and c2 are learning factors, and r1 and r2 are random numbers in [0,1].
[0094] If the parameter exceeds the search space, it is forced to retract to the boundary;
[0095] 14) The process terminates when the maximum number of iterations is reached or the change in the global optimal fitness is less than the threshold.
[0096] Step 2: Construct a power system diagram, represent the busbars and transmission lines in the power system as nodes and edges in the diagram, and extract node and edge features. This includes the following steps:
[0097] 21) Create nodes and edges.
[0098] Consider each bus in the system as a node in the graph, denoted by n i (i=1,2,...,N), where N is the total number of buses. For each transmission line, it is considered as an edge connecting two nodes in the graph, denoted by ε ij (i, j = 1, 2, ..., N), where i and j are the numbers of the two nodes connected by the edge.
[0099] 22) Extract node features.
[0100] For each node n i , extract load active power P i , load reactive power Q i , voltage amplitude |V i | and voltage phase angle θ i As the basic feature. Therefore, the node feature vector x i It can be expressed as;
[0101] x i =[P i ,Q i ,|V i |,θ i ] (4)
[0102] 23) Extract edge features.
[0103] For each edge ε ij , extract the line conductance G that describes its physical characteristics ij and line susceptance B ij As a basic feature. Here G ij and B ij These are the results obtained from parameter identification in step 1. Therefore, the edge eigenvector can be expressed as;
[0104] e ij =[G ij ,B ij ] (5)
[0105] 24) Establish the relationship between nodes and edges.
[0106] According to the actual connection of the power system, the connection relationship between nodes and edges is established using the adjacency matrix. The element A in the i-th row and j-th column of the adjacency matrix is ij =1 means there is an edge between node i and node j, A ij =0 means there is no edge between node i and node j.
[0107] 25) Complete the construction of the power system diagram.
[0108] All nodes, edges and feature information are integrated together to form a complete power system graph G, which can be expressed as;
[0109] G=(N,ε,x,e) (6)
[0110] Where N represents the node set, ε represents the edge set, x represents the node feature set, and e represents the edge feature set.
[0111] Step 3: Combine the mask encoder to process known and unknown features, including the following steps:
[0112] 31) Define the mask vector.
[0113] For each node n i , define a mask vector
[0114] m i ∈{0,1} d (7)
[0115] Where d is the number of node features; the mask vector m i The elements of indicate whether the corresponding feature is known. If the feature is known, the corresponding element is 0; if the feature is unknown, the corresponding element is 1. For example, for a node with 4 features, if the first two features are known and the last two features are unknown, the mask vector m i is [0,0,1,1]; note that edge features are known fixed features and do not require mask processing.
[0116] 32) Transform the mask vector.
[0117] Use the mask encoder to transform the mask vector m i Converted into a continuous feature vector m i ′, we can use the fully connected layer to achieve:
[0118] m i ′=W1(σ(W0m i +b0))+b1 (8)
[0119] Where W0 and W1 are weight matrices, b0 and b1 are bias terms, and σ is an activation function such as ReLU or sigmoid;
[0120] 33) Fuse the output of the mask encoder with the original features.
[0121] The output m of the mask encoder will be i ′ and the original feature x i Perform concatenation or addition operations to obtain the encoded feature vector x i ″:
[0122] x i ″=x i +m i ′ (9)
[0123] Encoded feature vector x i ″ contains the known and unknown parts of the node features, where the unknown part is masked by the encoding vector m i 'enhancement;
[0124] 34) Input the encoded feature vector into the graph neural network for subsequent processing.
[0125] The mask encoder structure is as follows Figure 2 shown.
[0126] Step 4: Build a graph neural network architecture based on topological adaptive graph convolution, including the following steps:
[0127] 41) One-hop message passing. Each node receives information from its neighboring nodes, performs local calculations, and then passes the updated information to its neighboring nodes;
[0128] For each node i, the number of messages it receives is calculated by the following formula:
[0129]
[0130] in, represents the feature vector of node i in the lth layer, and N(i) represents the set of neighbor nodes of node i. The feature vector of edge (i, j), including the conductance and susceptance of the line. σ represents a nonlinear activation function, such as ReLU. is a trainable parameter. [·] represents feature concatenation.
[0131] The feature vector after message delivery With the original eigenvector X l Add them together to get the new eigenvector:
[0132]
[0133] 42) Use the K-hop topology adaptive graph convolution layer to process the new feature vector to obtain the feature vector of the next layer;
[0134] The formula is as follows:
[0135]
[0136] Where S = D -1 / 2 AD -1 / 2 is the normalized adjacency matrix, K is the order of the adjacency matrix A established in step 24), is the learnable weight at each stage, and σ represents a nonlinear activation function, such as ReLU.
[0137] 43) Repeat steps 41) and 42) until the predetermined number of layers L is reached.
[0138] 44) In the last layer (L), only step 41) is used, without step 42), to obtain the final node feature vector. The final node feature vector is the power flow distribution of the power system predicted by the neural network in the figure below for a credible N-1 fault.
[0139] The graph neural network architecture based on topological adaptive graph convolution is as follows Figure 3 As shown, the encoded diagram refers to the power system diagram after processing in step three, and the output diagram is the power system diagram after processing in step four.
[0140] Step 5: Embed the node power balance constraints and node voltage amplitude constraints of the power system into the loss function of the graph neural network in the form of soft constraints, including the following steps:
[0141] 51) Define the basic loss function, and traditional supervised loss (such as mean square error) is used to fit the power flow data.
[0142]
[0143] Where M is the total number of samples in the graph neural network training set, is the trend of the mth sample predicted by the graph neural network, y m is the true value.
[0144] 52) Define the physical constraint loss function.
[0145] Node power balance constraints: predicted power flow Node power balance (Kirchhoff's law) must be met.
[0146] L power =||P calc -P inj || 2 +||Q calc -Q inj || 2 (14)
[0147] Among them, P calc , Q calc is the active and reactive injection power vector calculated by the AC power flow equation. inj , Q inj is the known active and reactive injection power vector. The active and reactive injection power calculation formulas for the i-th node in the power network are as follows:
[0148]
[0149] Where j is the node connected to node i, θij =θ i -θ j is the phase angle difference between node i and node j, G ij 、B ij are the conductance and susceptance of branch ij respectively.
[0150] Voltage amplitude constraint: The node voltage must meet the voltage amplitude constraint.
[0151]
[0152] in is the node voltage amplitude predicted by the graph neural network, V max 、V min are the maximum and minimum node voltages, respectively.
[0153] 53) Define the joint loss function.
[0154] L total =L data +λ1L power +λ2L voltage (18)
[0155] Among them, λ1 and λ2 are weight hyperparameters used to balance fitting accuracy and physical consistency.
[0156] Step 6: Train a dedicated graph neural network model for each credible N-1 fault, including the following steps:
[0157] 61) Data preparation. Collect power flow solution data under normal operating conditions. For each credible N-1 fault scenario, collect power flow solution data under the corresponding accident state. Perform necessary data preprocessing.
[0158] 62) Divide the dataset into training, validation, and test sets.
[0159] 63) Construct a power system diagram, combine it with a mask encoder to process known and unknown features, and build a graph neural network architecture based on topology-adaptive graph convolution;
[0160] 64) The node power balance constraint and node voltage amplitude constraint of the power system are embedded into the loss function of the graph neural network in the form of soft constraints;
[0161] 65) Train the model. Train the model using the training set data. At the end of each epoch, evaluate the model's performance using the validation set and adjust hyperparameters as needed. Stop training when the model's performance on the validation set no longer improves.
[0162] 66) Apply the model. For each credible N-1 fault, use the trained graph neural network model to predict the power system flow distribution after the fault for subsequent analysis.
[0163] The prediction results of various types of power flows under N-1 fault conditions in systems of different scales using the fast N-1 fault analysis method and system based on graph neural networks are shown in Table 1. RMSE is the root mean square error.
[0164] Table 1 Power flow prediction results under N-1 fault conditions for different scale systems
[0165]
[0166] Table 2 shows the overall performance of power flow prediction under N-1 fault conditions for systems of different scales using a fast N-1 fault analysis method and system based on a graph neural network. GraphSAGE, GAT, and GCN are all graph neural network algorithms, but their specific implementations differ from the method proposed in this paper. MAPE is the mean absolute percentage error.
[0167] Table 2 Overall power flow prediction results under N-1 fault conditions for different scale systems
[0168]
[0169] It can be seen from Table 2 that the method proposed in this invention has smaller prediction error and better prediction effect than other graph neural network algorithms.
[0170] The computation time of 30,000 test samples for a 118-node system using the fast N-1 fault analysis method and system based on graph neural networks is shown in Table 3. NR is the iterative method used to solve nonlinear equation systems in numerical analysis.
[0171] Table 3 Computation time of 30,000 test samples for a 118-node system
[0172]
[0173] It can be seen from Table 3 that the method proposed in the present invention has an excellent computational speed advantage over the numerical analysis iterative solution.
[0174] The efficient computing and accurate prediction capabilities of the present invention make real-time N-1 safety analysis possible, providing grid operators with more timely information, helping them to quickly identify potential risks and take effective measures, thereby improving the operational safety and reliability of the grid.
[0175] Based on the same technical concept as the method embodiment, another embodiment of the present invention provides a fast N-1 fault analysis system based on a graph neural network, including:
[0176] Line parameter identification module, used to identify transmission line parameters based on real-time measurement data using particle swarm optimization;
[0177] The power system diagram construction module is used to regard each bus in the power system as a node in the diagram, and each transmission line as an edge connecting two nodes in the diagram. It extracts node features and edge features based on the transmission line parameter identification results to construct the power system diagram;
[0178] The mask encoder module is used to enhance the features of the unknown parts using the mask encoder according to whether the node features in the power system diagram are known, and obtain the encoded feature vector;
[0179] The network construction module is used to construct a graph neural network architecture based on topological adaptive graph convolution. The graph neural network architecture includes a message passing part and a topological adaptive graph convolution part. In the message passing part, each node in the lth layer receives information from its neighboring nodes and performs local calculations, and then passes the updated information to its neighboring nodes and sends the feature vector after the message passing. With the original eigenvector X l Add them together to get a new feature vector; in the topology adaptive graph convolution part, the new feature vector is processed by the K-hop topology adaptive graph convolution layer to get the l+1 layer feature vector;
[0180] The network training module is used to embed the power system's node power balance constraints and node voltage amplitude constraints into the graph neural network's loss function as soft constraints. For each credible N-1 fault scenario, a dedicated graph neural network model is trained using power flow solution data covering both normal operating and accident states.
[0181] The power flow prediction module is used to predict the power flow distribution of the power system after the fault based on each credible N-1 fault using the corresponding trained graph neural network model for subsequent analysis.
[0182] It should be understood that the graph neural network-based fast N-1 fault analysis system in this embodiment can implement all the technical solutions in the above-mentioned method embodiments, and the functions of its various functional modules can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description in the above-mentioned embodiments, and will not be repeated here.
[0183] Another embodiment of the present invention provides a computer device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, implement the above-mentioned fast N-1 fault analysis method based on graph neural network.
[0184] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the fast N-1 fault analysis method based on graph neural network as described above is implemented.
[0185] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus (systems), computer devices, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0186] The present invention is described with reference to flowcharts of methods according to embodiments of the present invention. It should be understood that each process in the flowcharts and combinations of processes in the flowcharts can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts. Figure 1 A device that specifies functions in a process or multiple processes.
[0187] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.
[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
Claims
1. A fast N-1 fault analysis method based on graph neural network, characterized in that: The following steps are involved: Use particle swarm optimization to identify transmission line parameters based on real-time measurement data; Each busbar in the power system is considered as a node in the graph, and each transmission line is considered as an edge connecting two nodes in the graph. Node features and edge features are extracted based on the transmission line parameter identification results to construct the power system graph. According to whether the node features in the power system diagram are known, the mask encoder is used to enhance the features of the unknown part to obtain the encoded feature vector; A graph neural network architecture based on topological adaptive graph convolution is constructed. The graph neural network architecture includes a message passing part and a topological adaptive graph convolution part. In the message passing part, each node in the lth layer receives information from its neighboring nodes and performs local calculations, and then passes the updated information to its neighboring nodes and transmits the feature vector after message passing. With the original eigenvector X l Add them together to get a new feature vector; in the topology adaptive graph convolution part, the new feature vector is processed by the K-hop topology adaptive graph convolution layer to get the l+1 layer feature vector; The node power balance constraints and node voltage amplitude constraints of the power system are embedded in the loss function of the graph neural network in the form of soft constraints. For each credible N-1 fault, a dedicated graph neural network model is trained using power flow solution data containing normal operating conditions and accident conditions. According to each credible N-1 fault, the corresponding trained graph neural network model is used to predict the power system flow distribution after the fault for subsequent analysis.
2. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: The particle swarm algorithm is used to identify transmission line parameters based on real-time measurement data. The steps are as follows: (1) Initialize the particle swarm: Each particle represents a set of candidate parameters μ h =[G h ,B h ], randomly generate H particles, 1≤h≤H, and randomly set the initial velocity v of each particle h ; Among them G h represents the line conductance, B h represents line susceptance; (2) Define the fitness function: The fitness function is the root mean square RMSE of the measurement error: where h(·) is the line model equation, z p is the measurement data of the pth sample, P is the total number of measurement data samples, u p The input for calculating the predicted value of the p-th sample; Use the current particle parameters μ h , calculate the predicted value h(μ h ,u p ), compare the predicted value with the actual measured value z p , calculate RMSE; (3) At each iteration, the fitness value of each particle is calculated. If the current fitness value is better than the historical optimal value, the individual optimal value p is updated. best =μ h , select the particle with the best fitness in the population as the global optimal value g best ; Update the velocity and position of each particle according to the following formula: Among them, ω is the inertia weight, c1 and c2 are learning factors, and r1 and r2 are random numbers in [0,1]. If the parameter exceeds the search space, it is forced to retract to the boundary; (4) The process terminates when the maximum number of iterations is reached or the change in the global optimal fitness is less than the threshold.
3. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: The power system diagram G is represented as: G=(N,ε,x,e) Where N represents the node set, ε represents the edge set, x represents the node feature set, and e represents the edge feature set; For node n i , node feature vector x i Expressed as: x i =[P i ,Q i ,|V i |,θ i ] Among them, P i is the load active power, Q i is the load reactive power, |V i | is the voltage amplitude, θ i is the voltage phase angle; For each edge ε ij , the edge eigenvector is expressed as: e ij =[G ij ,B ij ] Among them G ij is the line conductance obtained after parameter identification, B ij is the line susceptance obtained after parameter identification.
4. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: The mask encoder is used to enhance the features of the unknown part, including: For each node n i , define a mask vector m i ∈{0,1} d , where d is the number of node features; the mask vector m i The element indicates whether the corresponding feature is known, 0 means known, 1 means unknown; Use the mask encoder to transform the mask vector m i Converted into a continuous feature vector m i ′, use the fully connected layer to achieve: m i ′=W1(σ(W0m i +b0))+b1 Where W0 and W1 are weight matrices, b0 and b1 are bias terms, and σ is the activation function; The output m of the mask encoder is i ′ and the original feature x i Perform concatenation or addition operations to obtain the encoded feature vector x i ″: x i ″=x i +m i ′ Encoded feature vector x i ″ contains the known and unknown parts of the node features, where the unknown part is masked by the encoding vector m i ’ Enhanced.
5. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: In the message passing part, for each node i, the message it receives is calculated by the following formula: in, represents the feature vector of node i in layer l, and N(i) represents the set of neighbor nodes of node i; represents the feature vector of edge (i, j), including the conductance and susceptance of the line; σ represents the nonlinear activation function; is a trainable parameter; [·] represents feature concatenation.
6. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: In the topology-adaptive graph convolution part, the feature vector calculation formula is as follows: Where S = D -1 / 2 AD -1 / 2 is the normalized adjacency matrix, K is the order of the adjacency matrix A, is the learnable weight at each stage, and σ represents the nonlinear activation function.
7. The fast N-1 fault analysis method based on graph neural network according to claim 1 is characterized in that: The node power balance constraint and node voltage amplitude constraint of the power system are embedded in the loss function of the graph neural network in the form of soft constraints, as follows: (1) Define the basic loss function for fitting the tidal data: Where M is the total number of samples in the graph neural network training set, is the trend of the mth sample predicted by the graph neural network, y m is the true value; (2) Define the physical constraint loss function: Node power balance constraints: predicted power flow Node power balance must be met: 50 power =||P calc -P inj ‖ 2 +‖Q calc -Q inj ‖ 2 Among them, P calc , Q calc is the active and reactive injection power vector calculated by the AC power flow equation; P inj , Q inj are the known active and reactive injection power vectors; the active and reactive injection power calculation formulas for the i-th node in the power network are as follows: Where j is the node connected to node i, θ ij =θ i -θ j is the phase angle difference between node i and node j, G ij 、B ij are the conductance and susceptance of branch ij respectively; Voltage amplitude constraint: The node voltage must meet the voltage amplitude constraint: in is the node voltage amplitude predicted by the graph neural network, V max 、V min are the maximum and minimum node voltages, respectively; (3) Define the joint loss function: L total =L data +λ1L power +λ2L voltage Among them, λ1 and λ2 are weight hyperparameters used to balance fitting accuracy and physical consistency.
8. A fast N-1 fault analysis system based on graph neural network, characterized in that: include: Line parameter identification module, used to identify transmission line parameters based on real-time measurement data using particle swarm optimization; The power system diagram construction module is used to regard each bus in the power system as a node in the diagram, and each transmission line as an edge connecting two nodes in the diagram. It extracts node features and edge features based on the transmission line parameter identification results to construct the power system diagram; The mask encoder module is used to enhance the features of the unknown parts using the mask encoder according to whether the node features in the power system diagram are known, and obtain the encoded feature vector; The network construction module is used to construct a graph neural network architecture based on topological adaptive graph convolution. The graph neural network architecture includes a message passing part and a topological adaptive graph convolution part. In the message passing part, each node in the lth layer receives information from its neighboring nodes and performs local calculations, and then passes the updated information to its neighboring nodes and sends the feature vector after the message passing. With the original eigenvector X l Add them together to get a new feature vector; in the topology adaptive graph convolution part, the new feature vector is processed by the K-hop topology adaptive graph convolution layer to get the l+1 layer feature vector; The network training module is used to embed the power system's node power balance constraints and node voltage amplitude constraints into the graph neural network's loss function as soft constraints. For each credible N-1 fault scenario, a dedicated graph neural network model is trained using power flow solution data covering both normal operating and accident states. The power flow prediction module is used to predict the power flow distribution of the power system after the fault based on each credible N-1 fault using the corresponding trained graph neural network model for subsequent analysis.
9. A computer device comprising: one or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the fast N-1 fault analysis method based on graph neural network as described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for fast N-1 fault analysis based on graph neural network according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Power distribution network fault accurate positioning method based on graph neural network double-layer model under novel power system
CN119165291A
Topological parameter joint identification method based on tidal current diagram convolutional network and related equipment
CN119558016A
Power distribution network topology identification and state estimation method based on message passing neural network and online deep learning
CN119598655A
Graph theory-based method and device for locating instability fault source in direct-current microgrid
US12235311B1
Distribution Fault Location Using Graph Neural Network with both Node and Link Attributes
US20220268827A1
Cited By
Photovoltaic module performance degradation prediction method and system based on GNN and LSTM
CN121211931A
Power system state estimation method, device and equipment and storage medium
CN121598010A
Collaborative analysis method, system and equipment for main and distribution networks and storage medium
CN121614813A
Self-adaptive accelerated solution method and system for clearing electric power spot market
CN121836962A
Intelligent energy operation optimization method based on AI analysis
CN122118692A