Power distribution network frame topology identification method based on improved graph neural network
By improving the dynamic weighting and multi-scale feature fusion of graph neural networks, combined with incremental learning mechanism and loss function optimization, the accuracy and efficiency of distribution network topology recognition in a dynamic environment is solved, and efficient topological structure recognition and dynamic adaptation are achieved.
Patent Information
- Application Number
- CN202510712678.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-05-30
AI Technical Summary
The existing distribution network topology identification methods have low accuracy when facing dynamic topology changes and hidden nodes, and deep learning methods are difficult to deploy efficiently in resource-constrained edge computing devices, and cannot effectively deal with complex topology structures, data loss and noise interference.
The improved graph neural network is adopted, and the edge weighting is adjusted in combination with the graph attention network, the high-dimensional features of nodes and edges are extracted, the incremental learning mechanism is used to handle dynamic changes, and the model performance is optimized in combination with the loss function, and the node connection relationship and confidence score are output.
It significantly improves the accuracy and efficiency of topological identification of distribution networks, adapts to complex dynamic environments, achieves the improvement of real-time and generalization capabilities, and ensures the efficient operation of the model under dynamic changes.
Smart Images

Figure CN120262400A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system topology structure identification, and in particular to a method for identifying the topology of a distribution network grid based on an improved graph neural network. Background Art
[0002] As an important part of the power system, the operation state of the distribution network is directly related to the power supply quality and the electricity consumption safety of users. With the access of new loads such as distributed energy sources (such as photovoltaic and energy storage devices) and electric vehicles, as well as the frequent occurrence of load changes and network topology reconstruction, the structure of the distribution network has become more complex and dynamic. Therefore, accurately obtaining the topology structure of the distribution network is crucial for management functions such as power flow calculation, state estimation, fault location, and optimal scheduling.
[0003] The existing distribution network topology identification methods mainly rely on the SCADA system and graph theory algorithms. These methods have high requirements for the integrity and accuracy of data collection, but have low accuracy when facing hidden nodes, complex topology structures, as well as data missing and noise interference. In addition, existing distribution network topology network identification schemes such as Chinese Patent Applications CN202111360101.6 and CN202411372407.7, although the deep learning method can automatically extract features, rely heavily on computing resources, are difficult to be efficiently deployed in resource-constrained edge computing devices, and have limited adaptability to dynamic topology changes. Summary of the Invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned existing technologies that cannot effectively handle dynamic topology changes and hidden node problems, and to provide a method for identifying the topology of a distribution network based on an improved graph neural network.
[0005] The purpose of the present invention can be achieved by the following technical solutions: A method for identifying the topology of a distribution network grid based on an improved graph neural network, the steps include: Collect real-time electrical quantity data of the nodes and edges of the distribution network, and model the distribution network graph structure in the way of a weighted graph and a hypergraph; Construct node, edge, and hyperedge feature matrices with the real-time collected data, and input them into a trained improved graph neural network topology identification model. The improved graph neural network topology identification model dynamically adjusts the edge weights through a graph attention network, and splices and fuses local topology features and global topology features to generate a predicted adjacency matrix; When the distribution network undergoes dynamic changes, locate the changed area through the difference of the adjacency matrix, and extract subgraphs for incremental update; Construct the topology structure of the distribution network based on the final adjacency matrix, and output the physical positions of the nodes and the connection relationships of the edges.
[0006] As a preferred technical solution, the modeling of the distribution network graph structure is specifically implemented as follows: Model the distribution network as a weighted graph , where is the set of nodes, representing devices; E is the set of edges, representing physical connection relationships; is the set of edge weights, representing the physical parameters of the lines; Each node is characterized by its electrical quantity information, forming a node feature vector , and the electrical quantity information includes: node voltage, node current, and active and reactive powers of the node; The weight of each edge is determined by the electrical characteristics of the line: , where: is the comprehensive impedance of the line, i.e., the weight, is the resistance of the line, is the reactance of the line; For complex equipment groups, use a hypergraph to represent, where is the set of nodes, representing devices; is the set of hyperedges, a hyperedge is associated with multiple nodes at the same time, and the feature of each hyperedge includes the aggregation result of the attributes of the associated nodes and the line parameters: , , where is the hyperedge feature vector, is the node feature vector, is the number of nodes associated with the hyperedge.
[0007] As a preferred technical solution, the improved graph neural network topology identification model highlights key devices by dynamically adjusting edge weights, and the specific implementation is as follows: Map the node features to a high-dimensional space through a linear transformation, and dynamically calculate the attention weight for each edge : , where is the activation function; and are the features of nodes and after mapping, is the feature concatenation operation, is the attention vector; Adjust the importance of information propagation according to the similarity of node and edge features, and aggregate node features using attention weights: , Where: is the activation function, is the learnable weight matrix of the th layer, is the node feature of the th layer.
[0008] As a preferred technical solution, the improved graph neural network topology identification model splices and fuses local topology features and global topology features, and the specific implementation is as follows: Use a graph convolutional network to extract local topology features. Through the neighborhood aggregation mechanism, update the features of each node to the weighted sum of the features of its neighbor nodes: , Where: is the node feature matrix of the th layer, that is, the local topology feature; is the normalized adjacency matrix; is the node feature matrix of the th layer; is the learnable weight matrix of the th layer; is the activation function; Use global average pooling to summarize the features of the entire graph to extract global topology features: , Where: is the global feature of node , is the total number of nodes, is the global embedding vector; Fuse the local feature and the global feature through the splicing mechanism: , Where: is the multi-scale feature, is the local feature, is the global feature, is the splicing operation; Use a fully connected layer to further fuse the spliced features: , Where, is the weight of the fully connected layer, is the bias of the fully connected layer, is the activation function.
[0009] As a preferred technical solution, the output of the improved graph neural network topology identification model includes: The high-dimensional feature representation of each node, including the attributes of the node itself and the structural information of the node in the topological network, that is, the vector of each node ; Edge embedding representation, including the attributes of the edge and the information interaction characteristics between two nodes, reflecting the physical characteristics of the line, the connection strength between two nodes, the power flow direction and status; Node connection relationship, that is, the topological structure inferred by the improved graph neural network topology identification model, representing the physical connection relationship between nodes in the network, through the adjacency matrix represented; Confidence score of the topological structure, generating a confidence score for the topological structure identified by the model, indicating the reliability of the prediction result.
[0010] As a preferred technical solution, the loss function of the distribution network topology identification model comprehensively considers factors such as topological consistency, node embedding distribution, and model prediction confidence, and is specifically expressed as follows: , where, is the topological consistency loss, is the node characteristic consistency loss; is the global embedding alignment loss; , is the weight hyperparameter of the loss term; The topological consistency loss is used to quantify the difference between the model-predicted topology and the true topology , and at the same time consider the prediction confidence . The topological consistency loss function is as follows: , where, is the connection probability between nodes and in the predicted adjacency matrix; is the connection status in the true adjacency matrix; is the confidence score output by the model; The node characteristic consistency loss is used to ensure the similarity of adjacent node embeddings in the feature space and enhance the model's ability to express local topology. The node characteristic consistency loss function is as follows: , where, is the set of all edges in the graph, and are the nodes and Embedded representation; The global embedding alignment loss is used to ensure that the distribution of the global embedding is consistent with the target distribution. The global embedding alignment loss function is as follows: , where represents aligning the global embedding through KL divergence, is the predicted global embedding distribution, is the target distribution; the target distribution is the global feature distribution extracted from historical operation data for the actual distribution network topology. By statistically analyzing the distribution network data, calculating the mean and covariance matrix of the global features, the generated distribution is as follows: , where is the historical mean of the global embedding features, representing the center of the distribution; is the covariance matrix of the global embedding features, describing the correlation between features in different dimensions; is the multi-dimensional normal distribution.
[0011] As a preferred technical solution, the improved graph neural network topology identification model uses the topology identification accuracy, F1 score, and AUC-ROC curve to evaluate the model performance. The calculation methods of each index are as follows: The topology identification accuracy is obtained by comparing each element in the adjacency matrix predicted by the model with the true adjacency matrix to measure the matching degree between the adjacency matrix predicted by the model and the true adjacency matrix , representing the proportion of correct predictions among all predictions: , In the formula, TP is the number of edges correctly predicted by the model as connected; TN is the number of edges correctly predicted by the model as unconnected; FP is the number of edges wrongly predicted by the model as connected; FN is the number of edges wrongly predicted by the model as unconnected; The F1 score is the harmonic mean of the precision and recall, used to comprehensively evaluate the precision and coverage ability of the model: , , , In the formula, is the precision; is the recall; AUC is the area under the ROC curve, used to measure the ability of the model to distinguish positive and negative samples, Among them, the horizontal axis of the ROC curve is the false positive rate FPR, and the calculation method is as follows: , The vertical axis is the true positive rate TPR, and the calculation method is as follows: , The ROC curve is drawn by adjusting the classification threshold, and the area under the curve AUC is calculated by numerical integration: , Among them, is the classification threshold.
[0012] As a preferred technical solution, when the distribution network undergoes dynamic changes, the topology is dynamically updated as follows: Compare the current adjacency matrix with the initial adjacency matrix to obtain the added or removed edges; Identify the nodes and edges directly affected by the dynamic changes of the distribution network according to the switch positions, and extract the affected subgraph from the whole graph ; When it is found that there are added or removed edges in the topology, for the affected subgraph re-collect the node feature matrix and the edge feature matrix , and construct the initial adjacency matrix of the subgraph ; Use the trained improved graph neural network topology identification model to only perform inference on the affected subgraph and output the local predicted adjacency matrix , and generate a confidence score for each edge in the subgraph ; According to the confidence score , judge the area that does not meet the set confidence threshold as an abnormal area, re-collect real-time data for the abnormal area, and update the node and edge features for topology identification; Output the final adjacency matrix , and record the time point, affected area, low-confidence annotation and correction situation of the topology dynamic change.
[0013] As a preferred technical solution, the topological structure of the distribution network is constructed based on the final adjacency matrix, and the specific process is as follows: Generate a node set according to the dimension of the final adjacency matrix ; Traverse the final adjacency matrix , find the elements of, and obtain the edge set ; Optimize the node layout using the force-directed algorithm, simulate the node positions through a physical model, and output the physical positions of the nodes and the connection relationships of the edges.
[0014] As a preferred technical solution, the process of the force-directed algorithm is as follows: Based on the node set V and the edge set , generate an initial position for each node ; For each node , synthesize the results of the repulsive force and the gravitational force to obtain the resultant force : , where is the repulsive force between nodes ; is the gravitational force between nodes ; For each pair of nodes , the repulsive force is calculated as follows: , where is the ideal distance between nodes, and are the positions of nodes and , is the Euclidean distance between the two nodes; For each pair of nodes , the gravitational force is calculated as follows: , In each iteration, calculate the resultant force of each node, and adjust the position of the node according to the resultant force; When the resultant force of all nodes is less than the set threshold, stop the iteration and output the positions of all nodes and the connection relationships of the edges .
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1) The present invention proposes an improved graph neural network topology identification model, which utilizes a dynamic weighting mechanism and multi-scale feature fusion. The edge weights are adjusted through the dynamic weighting mechanism to highlight the role of key devices, and the attention weights are calculated through the graph attention network to achieve information propagation. In addition, the model combines local topological features reflecting direct connection relationships and global features reflecting the overall dependence of the network structure, and uses multi-scale feature splicing and fusion to enhance the expression ability. And it combines an incremental learning mechanism to efficiently process the dynamically changing local topology. It significantly improves the real-time performance, generalization ability and applicability of the model, and solves the problems of accuracy and efficiency of distribution network topology identification in a dynamic environment.
[0016] 2) The present invention also designs a comprehensive loss function and adjusts parameters to train the improved graph neural network to accurately identify the distribution network topology. The loss function combines topological consistency, node characteristics and global embedding alignment, taking into account both local and global characteristics. The training process includes forward propagation, loss calculation and iterative optimization, and the performance is evaluated through accuracy, F1 score and AUC to ensure the generalization ability and robustness of the model in a complex dynamic environment.
[0017] 3) To adapt to dynamic changes, the present invention adopts an incremental learning mechanism to efficiently process the dynamically changing local topology, locates the changing area through the difference of the adjacency matrix, extracts the subgraph for incremental update. A threshold is set for the low-confidence area and the data is resampled to correct the anomalies, and the final adjacency matrix is output. At the same time, the time points and affected areas of the dynamic changes are recorded to ensure the accuracy and efficiency of real-time topology identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is the flowchart of the distribution network grid topology self-identification method based on the improved graph neural network of the present invention; Figure 2 is the flowchart of the topology graph drawing based on the force-directed algorithm of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0019] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and the detailed implementation manners and specific operation processes are given, but the protection scope of the present invention is not limited to the following embodiments.
[0020] Embodiment 1 The present invention proposes an efficient identification method for the distribution network topology based on an improved graph neural network. Through a dynamic weighting mechanism and multi-scale feature fusion, high-dimensional features of nodes and edges are accurately extracted, taking into account both local and global topological characteristics. With the support of the dynamic update mechanism, it can quickly adapt to complex scenarios such as topology switching and new device addition, and output accurate adjacency matrices and confidence scores. Finally, the force-directed algorithm is used to intuitively display the network structure, providing reliable support for real-time monitoring and optimal scheduling. AsFigure 1 As shown in Figure 1 , the overall process of the proposed power distribution network topology identification method based on the improved graph neural network is as follows.
[0021] Step 1: Data collection and preprocessing. Based on smart meters, SCADA systems, or power consumption collection systems, collect real-time electrical quantity data of power distribution network nodes (such as transformers, loads) and edges (such as lines, switches), including data such as voltage, current, power factor, and switch status, and perform preprocessing, including cleaning abnormal data (such as noise, missing values) and normalizing to ensure data consistency, and extracting features from time series data (such as historical voltage changes), encoding the time series information as embedding vectors to provide dynamic feature support for subsequent model input.
[0022] Step 2: Power distribution network graph structure modeling. Represent the power distribution network as a weighted graph, define the node set to represent devices, the edge set to represent the physical connection relationship between devices, and the edge weights to reflect line parameters. Use hypergraph modeling for complex device groups (such as parallel lines), associating multiple nodes with a hyperedge.
[0023] Step 3: Improved graph neural network model design. Taking the node, edge, and hyperedge feature matrices as input, the goal is to extract high-dimensional features to reflect the topological relationship and dynamic changes of the power distribution network. Adjust the edge weights through a dynamic weighting mechanism to highlight the role of key devices, and calculate the attention weights through the graph attention network (GAT) to achieve information propagation. In addition, the model combines local topological features (reflecting the direct connection relationship through neighborhood aggregation) and global features (capturing the overall dependence of the network structure through global average pooling), and uses multi-scale feature splicing and fusion to enhance the expression ability. Finally, the model output includes high-dimensional embedding representations of nodes, edge embedding representations, inferred adjacency matrices, and confidence scores of the topological structure, providing accurate and reliable results for complex power distribution network topology identification.
[0024] Step 4: Model training and optimization. By annotating historical data, designing a comprehensive loss function, and adjusting parameters, train the improved graph neural network to accurately identify the power distribution network topology. The loss function combines topological consistency, node characteristics, and global embedding alignment, taking into account both local and global characteristics. The training process includes forward propagation, loss calculation, and iterative optimization, and evaluates the performance through accuracy, F1 score, and AUC to ensure the generalization ability and robustness of the model in complex dynamic environments.
[0025] Step 5, Topology Identification and Dynamic Update: Construct an input matrix by collecting data in real time, generate a predicted adjacency matrix using the trained graph neural network, and generate a topological structure through thresholding. To adapt to dynamic changes (such as topology switching and new device addition), locate the changed area through the difference in the adjacency matrix, extract subgraphs for incremental update. Set a threshold for low-confidence regions and resample data to correct anomalies, output the final adjacency matrix, and record the time points and affected areas of dynamic changes to ensure the accuracy and efficiency of real-time topology identification.
[0026] Step 6, Output Topology Identification Results: Construct the topological structure of the distribution network through the final adjacency matrix, generate a node set and an edge set, and use the force-directed algorithm to optimize the node layout, output the physical positions of the nodes and the connection relationships of the edges to visually display the network structure of the distribution network.
[0027] Embodiment 2 As one of the specific implementation methods of the present invention, the specific implementation of each step in the distribution network grid topology self-identification method based on the improved graph neural network proposed by the present invention is as follows: Step 1: Data Collection and Preprocessing 1.1) Data collection: The data sources include smart meters, SCADA systems, and user acquisition systems, etc. Obtain data for each node, including electrical parameters of transformers and loads, historical voltage and current change sequences; obtain edge data, including line impedance, power flow direction, and switch status.
[0028] 1.2) Data preprocessing: Specifically includes outlier detection, missing value filling, normalization processing, and feature extraction, etc. (Since it is not a patent protection point, it will not be elaborated here).
[0029] After Step 1, two types of data inputs are finally generated. One is the node feature matrix , which contains multi-dimensional features such as voltage, current, and time embedding. The other is the edge feature matrix , which contains relationship information such as line impedance and power flow direction.
[0030] Step 2: Distribution Network Graph Structure Modeling: Aims to convert the actual distribution network into a mathematical representation form for the subsequent application and optimization analysis of algorithms. By constructing a weighted graph and a hypergraph, the node and edge information in the distribution network is quantified and standardized.
[0031] 2.1) Model the distribution network as a weighted graph , where is the node set, representing devices (such as transformers, substation JP cabinets, and user meter boxes). is the edge set, representing physical connection relationships (such as lines and switches). is a set of edge weights, representing the physical parameters of the line (such as line impedance, cable length).
[0032] Each edge weight is determined by the electrical characteristics of the line:
[0033] Among them, is the comprehensive impedance of the line, that is, the weight, is the resistance of the line, is the reactance of the line.
[0034] Each node feature is composed of its electrical quantity information, forming a node feature vector:
[0035] Among them, is the node voltage, is the node current, and are the active power and reactive power of the node respectively.
[0036] 2.2) Hypergraph Modeling For complex equipment groups (such as parallel lines, switch groups), use a hypergraph to represent, where is the set of nodes, the same as the nodes in the weighted graph, is the set of hyperedges. A hyperedge can be associated with multiple nodes at the same time (for example, if a switch group connects nodes , then define the hyperedge ).
[0037] The feature of each hyperedge includes the attributes of the associated nodes and the aggregation result of the line parameters:
[0038]
[0039] Among them, is the hyperedge feature vector, is the node feature vector, is the number of nodes associated with the hyperedge.
[0040] 2.3) Initial Feature Representation of the Graph The adjacency matrix A of the weighted graph is defined as:
[0041] The node degree matrix D is a diagonal matrix, representing the connection strength of each node:
[0042] To avoid the influence of node degree on feature propagation, the normalized adjacency matrix is defined as:
[0043] 2.4) Graph feature extraction The node feature matrix includes the electrical quantities and time series features of each node:
[0044] The edge feature matrix includes the impedance, cable length, and power flow direction of each edge:
[0045] The hyperedge feature matrix represents the aggregated features of complex equipment groups:
[0046] 2.5) Output of graph modeling results The weighted graph model , which contains the node set, edge set, and edge weight information, constructs a complete distribution network topology.
[0047] The hypergraph model , processes the association relationships of complex equipment groups and enhances the network expression ability.
[0048] The feature matrix: includes the node feature matrix , the edge feature matrix , and the hyperedge feature matrix .
[0049] Step 3: Improve the design of the graph neural network topology identification model 3.1) Model input The input data includes the node feature matrix , the edge feature matrix , and the hyperedge feature matrix . The goal is to extract the high-dimensional features of nodes and edges through the graph neural network to reflect the topological relationship and dynamic changes.
[0050] 3.2) Dynamic weighted information propagation mechanism By dynamically adjusting the edge weights, the influence of key equipment (such as main transformers and branch switches) is highlighted, and the attention weight is dynamically calculated for each edge . According to the similarity of node and edge features, the importance of information propagation is adjusted. The calculation steps are as follows: (3.2.1) Node feature transformation, mapping node features to a high-dimensional space through a linear transformation:
[0051] Among them, is a learnable parameter matrix.
[0052] (3.2.2) Attention weight calculation For the edge , the attention weight is calculated as follows:
[0053] Among them, is a variant of the activation function, which solves the problem that the traditional function will cause the gradient to be zero when the input is negative by introducing a certain negative slope; and are the transformed features of nodes and , is the feature concatenation operation, is the attention vector.
[0054] (3.2.3) Information propagation and update Aggregate node features using attention weights:
[0055] Among them, is the activation function; is the learnable weight matrix of the layer; is the node feature of the layer.
[0056] 3.3) Fusion of local and global topological information In the topological identification of the distribution network, local topological information reflects the direct connection relationship between devices (such as the relationship between branch switches and loads), while global topological information describes the overall network structure (such as the topology of the backbone network). Organically combining the two can improve the expression ability of complex networks, especially in the case of multi-branch, multi-loop or dynamic topology.
[0057] (3.3.1) Local topological feature extraction Use a graph convolutional network (GCN) to process local characteristics. Through the neighborhood aggregation mechanism, the features of each node are updated to the weighted sum of the features of its neighbor nodes, capturing the connection relationship between each node and its direct neighbors, and reflecting the local topological characteristics of the distribution network, as shown in the following formula:
[0058] Among them, is the node feature matrix of the th layer, that is, the local topological feature; is the normalized adjacency matrix; is the node feature matrix of the th layer; is the learnable weight matrix of the th layer; is the activation function.
[0059] (3.3.2) Global topological feature extraction Use global average pooling to summarize the features of the entire graph to reflect the global structure of the entire distribution network and capture the potential dependencies between long-distance nodes. The implementation formula of global average pooling is as follows:
[0060] Among them, is the global feature of node , is the total number of nodes, is the global embedding vector.
[0061] (3.3.3) Multi-scale feature splicing Further fuse the local features and global features through the concat mechanism:
[0062] Among them, is the multi-scale feature, is the local feature, is the global feature, is the splicing operation.
[0063] (3.3.4) Feature fusion Use a fully connected layer to fuse the spliced features:
[0064] Among them, is the weight of the fully connected layer, is the bias of the fully connected layer, is the activation function.
[0065] 3.4) Model output The output of the model is the core result of the distribution network topology identification, mainly including four points: First, the high-dimensional feature representation of each node, which contains the attributes (electrical quantities) of the node itself and its structural information in the topological network, that is, the embedding vector of each node :
[0066] In the formula: is the dimension of the embedding vector. Combining the node embedding representation, the device type and the operating state of the node can be inferred.
[0067] Second is the edge embedding representation, which represents the relationship between two nodes and includes the attributes of the edge and the information interaction characteristics between the two nodes. The embedding vector of each edge is expressed as:
[0068] Among them, is the dimension of the edge feature. The edge embedding representation can reflect: the physical characteristics of the line, the connection strength between two nodes, the power flow direction and state.
[0069] Third is the node connection relationship, that is, the topological structure obtained by model inference, which represents the physical connection relationship between nodes in the network. Through the adjacency matrix it is represented as:
[0070] Among them, represents node and have a direct connection, represents no connection.
[0071] Fourth is the confidence score of the topological structure, which generates a confidence score for the topological structure identified by the model and represents the reliability of the prediction result. The confidence of each edge is:
[0072] Among them, represents the confidence score of edge , and the closer it is to 1, the more reliable the prediction result is.
[0073] Step 4: Model training and optimization Model training and optimization is a key step in improving the topological identification of graph neural networks. The purpose is to train the network with historical data so that it can accurately identify the topological structure of the distribution network and optimize the model performance to improve the generalization ability and robustness.
[0074] 4.1) Training data preparation Based on the data obtained in Step 1, data annotation is performed, including the true topological structure of the distribution network, as the labeled data for supervised learning . On the basis of data annotation, the data set is divided into a training set, a validation set and a test set.
[0075] 4.2) Loss function design To better optimize the distribution network topology identification model, a new loss function is designed, comprehensively considering factors such as topological consistency, node embedding distribution, and model prediction confidence, aiming to improve the accuracy and robustness of the model.
[0076] (4.2.1) Topological consistency loss Used to quantify the difference between the model-predicted topology and the true topology , while considering the confidence of the prediction , the topological consistency loss function is as follows:
[0077] where is the connection probability between nodes and in the predicted adjacency matrix; is the connection status in the true adjacency matrix; is the confidence score output by the model.
[0078] (4.2.2)Node feature consistency loss To ensure the similarity of adjacent node embeddings in the feature space and enhance the model's ability to represent local topology, the node feature consistency loss function is as follows:
[0079] where is the set of all edges in the graph, and are the embedding representations of nodes and respectively.
[0080] (4.2.3)Global embedding alignment loss To ensure that the distribution of the global embedding is consistent with the target distribution and enhance the understanding of the global topological structure. Here, the global embedding vector is generated by aggregating the node features in the entire graph to form a high-dimensional vector representing the global characteristics of the graph and is obtained through global average pooling in step 3.
[0081] The global embedding alignment loss function is as follows:
[0082] where represents aligning the global embedding through KL divergence, is the predicted global embedding distribution, is the target distribution.
[0083] Here, the target distribution To extract the global feature distribution of the actual distribution network topology from historical operation data, by statistically analyzing a large amount of distribution network data, calculate the mean and covariance matrix of global features (such as voltage, current, power flow), and generate the distribution as shown below:
[0084] Among them, is the historical mean of the global embedding features, representing the center of the distribution; is the covariance matrix of the global embedding features, describing the correlation between features in different dimensions; is the multi-dimensional normal distribution.
[0085] Combining the above three loss functions, the loss function for designing the improved graph neural network topology identification model is:
[0086] Among them, , is the weight hyperparameter of the loss term, used to adjust the importance of each part.
[0087] 4.3) Model training process (4.3.1) Forward propagation Input node features, edge features, and adjacency matrix, through the improved graph neural network topology identification model, output node embeddings , edge embeddings and the predicted adjacency matrix .
[0088] (4.3.2) Loss calculation According to the total loss function , calculate the error between the model prediction result and the real data.
[0089] (4.3.3) Backward propagation Update the model parameters through the gradient descent algorithm.
[0090] (4.3.4) Iterative training Continue to perform multiple rounds of iteration until the following stopping conditions are met: the loss function of the validation set no longer decreases in consecutive multiple iterations; or reach the set maximum number of training times.
[0091] 4.4) Model verification and tuning Evaluate the model performance on the validation set, and use the topology identification accuracy (Accuracy), F1 score, and AUC-ROC curve to evaluate the model performance. The calculation methods of each index are as follows: Topology identification accuracy (Accuracy): Measure the predicted adjacency matrix of the model Degree of matching with the true adjacency matrix which represents the proportion of correct predictions among all predictions:
[0092] where TP is the number of edges correctly predicted by the model as connected (true value is 1, predicted value is 1); TN is the number of edges correctly predicted by the model as unconnected (true value is 0, predicted value is 0); FP is the number of edges wrongly predicted by the model as connected (true value is 0, predicted value is 1); FN is the number of edges wrongly predicted by the model as unconnected (true value is 1, predicted value is 0), obtained by comparing each element in the adjacency matrix predicted by the model with the true adjacency matrix for each element in the true adjacency matrix
[0093] F1 score: It is the harmonic mean of precision and recall, used to comprehensively evaluate the precision and coverage ability of the model:
[0094]
[0095]
[0096] AUC (Area Under Curve) is the area under the ROC curve (Receiver Operating Characteristic Curve), used to measure the ability of the model to distinguish positive and negative samples
[0097] where the horizontal axis (false positive rate FPR) of the ROC curve is calculated as follows:
[0098] The vertical axis is the true positive rate TPR, calculated in the same way as Recall:
[0099] The ROC curve is drawn by adjusting the classification threshold (e.g., from 0 to 1), and the area under the curve AUC can be calculated by numerical integration:
[0100] where is the classification threshold, and the value range of AUC is , and the closer it is to 1, the stronger the model's topological recognition ability
[0101] Optimize the model performance by adjusting the learning rate, loss function weight, and embedding vector dimension, calculate various indicators, and find the optimal parameter settings
[0102] 4.5) Model Testing Verify the generalization ability of the model on the test set and evaluate it using the same metrics as in model validation.
[0103] Step 5: Topology Identification and Dynamic Update 5.1) Input Real-time Data Collect data in real time from smart meters, SCADA systems, or online monitoring devices to construct a node feature matrix , an edge feature matrix , an initial adjacency matrix . If there are complex device groups, further construct a hyper-edge feature matrix as the model input.
[0104] 5.2) Model Inference Use the trained improved graph neural network topology identification model to generate a predicted adjacency matrix , to reflect the connection probability between nodes.
[0105] 5.3) Generate Topology Structure Using Thresholding According to the element values in the predicted adjacency matrix , set a threshold T to binarize it:
[0106] Generate the final output proximity matrix , representing all connection relationships in the generated distribution network topology.
[0107] 5.4) Topology Dynamic Update Mechanism The goal of topology dynamic update is to efficiently handle the dynamic changes of the distribution network (such as topology switching, new devices, or data anomalies), and timely update the topology structure output by the model, while avoiding retraining the entire model to save computing resources.
[0108] (5.4.1) By comparing the current adjacency matrix with the initial adjacency matrix , find the newly added or removed edges.
[0109] 5.4.2) Localization of Dynamic Changes Determine the scope of influence of the dynamic changes and confine them to a local area to reduce the update scope. Identify the directly affected nodes and edges according to the switch positions and construct the affected subgraph , extract the affected subgraph from the full graph G , where is the set of nodes in the dynamic change area, is the set of edges in the dynamic change area.
[0110] (5.4.3) Sub - graph Incremental Update and Outlier Correction When new or removed edges are found in the topology, for the affected sub - graphs , re - collect the node feature matrix and the edge feature matrix , construct the initial adjacency matrix of the sub - graph , reflecting the physical connection information.
[0111] Use the trained GNN model to perform inference only on the affected sub - graphs, and output the local prediction adjacency matrix :
[0112] And generate a confidence score for each edge in the sub - graph , for subsequent outlier correction. Here, the confidence score directly uses the probability that there is a connection between nodes i and j in the predicted proximity matrix:
[0113] To prevent over - reliance on a single information source (such as node embeddings or edge features), regularize the confidence scores:
[0114] Where and are the maximum and minimum values in the local prediction adjacency matrix respectively.
[0115] For the convenience of outlier detection and correction, set a threshold according to the confidence score , and judge the area that satisfies the following formula as the outlier area:
[0116] Re - collect real - time data for the outlier area, and update the node and edge features for topology recognition.
[0117] (5.4.4) Result Output after Dynamic Update Output the final adjacency matrix , including the connection relationships of all nodes, and record the time points, affected areas, low - confidence annotations, and correction situations of topological dynamic changes.
[0118] Step 6: Output the Final Topology Identification Result Based on the final adjacency matrix output in Step 5 , construct an intuitive network structure representation to reflect the node and edge relationships of the distribution network. The specific process is as follows: 6.1) Input the adjacency matrix ; 6.2) Generate the node set directly according to the dimension of the adjacency matrix ; 6.3) Traverse the adjacency matrix Find out elements of, to obtain the edge set ; 6.4) Based on the force-directed algorithm, simulate the node positions through a physical model.
[0119] As Figure 2 shown, the force-directed algorithm process is as follows: (6.4.1) Initialization Based on the node set V and the edge set , generate the initial position for each node .
[0120] (6.4.2) Calculate the forces For each pair of nodes , calculate the repulsive force :
[0121] where k is the ideal distance between nodes, and are the positions of nodes and , is the Euclidean distance between the two nodes.
[0122] For each pair of nodes , calculate the attractive force :
[0123] For each node , synthesize the results of the repulsive force and the attractive force to obtain the resultant force :
[0124] (6.4.3) Position update In each iteration, calculate the resultant force of each node, and adjust the position of the node according to the force:
[0125]
[0126] where is the learning rate.
[0127] When the resultant force When it is less than the set threshold value, stop the iteration:
[0128] Output the positions of all nodes and the connection relationships of the edges .
[0129] The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and variations based on the concept of the present invention without creative efforts. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field of the present invention through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the protection scope determined by the claims.
Claims
1. A method for identifying the topological structure of a distribution network based on an improved graph neural network, characterized in that the steps Including: Collect real-time electrical quantity data of the nodes and edges of the distribution network, and model the graph structure of the distribution network using weighted graphs and hypergraphs; Construct node, edge, and hyperedge feature matrices with the real-time collected data, and input them into the trained improved graph neural network topology identification model. The improved graph neural network topology identification model dynamically adjusts the edge weights through a graph attention network, and splices and fuses local topology features and global topology features to generate a predicted adjacency matrix; When the distribution network undergoes dynamic changes, locate the changed area through the difference in the adjacency matrix, and extract subgraphs for incremental update; Construct the topology of the distribution network based on the final adjacency matrix, and output the physical positions of the nodes and the connection relationships of the edges.
2. The method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, wherein The specific implementation of the modeling of the distribution network graph structure is as follows: Model the distribution network as a weighted graph , where is the set of nodes, representing devices; E is the set of edges, representing physical connection relationships; is the set of edge weights, representing the physical parameters of the lines; Each node is characterized by its electrical quantity information, forming a node feature vector , and the electrical quantity information includes: node voltage, node current, and active and reactive power of the node; Each edge has a weight determined by the electrical characteristics of the line: , Wherein: is the comprehensive impedance of the line, i.e., the weight, is the resistance of the line, is the reactance of the line; For complex device groups, hypergraphs are used to represent, where is a set of nodes, representing devices; is a set of hyperedges. A hyperedge is associated with multiple nodes simultaneously, and the characteristics of each hyperedge include the aggregation results of the attributes of the associated nodes and the line parameters: , , Among them, is the hyperedge feature vector, is the node feature vector, is the number of nodes associated with the hyperedge.
3. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that, The improved graph neural network topology identification model highlights key devices by dynamically adjusting edge weights. The specific implementation is as follows: Map the node features to a high-dimensional space through a linear transformation, and for each edge Dynamically calculate the attention weights : , Among them, is the activation function; and are the features after mapping of nodes and ; is the feature concatenation operation, is the attention vector; Adjust the importance of information propagation according to the similarity of node and edge features, and aggregate node features using attention weights: , Wherein: is an activation function, is the learnable weight matrix of the th layer, is the node feature of the th layer.
4. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that, The improved graph neural network topology identification model splices and fuses local topology features and global topology features. The specific implementation is as follows: Use a graph convolutional network to extract local topology features. Through a neighborhood aggregation mechanism, update the features of each node to the weighted sum of the features of its neighbor nodes: , Wherein: is the node feature matrix of the layer, that is, the local topological feature; is the normalized adjacency matrix; is the node feature matrix of the layer; is the learnable weight matrix of the layer; is the activation function; Use global average pooling to summarize the features of the entire graph to extract global topology features: , Wherein: is the global feature of the node , is the total number of nodes is the global embedding vector; Fuse local features and global features through a splicing mechanism: , Wherein: is a multi-scale feature, is a local feature, is a global feature, is a splicing operation; Use a fully connected layer to further fuse the spliced features: , Among them, is the weight of the fully connected layer, is the bias of the fully connected layer, is the activation function.
5. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that, The output of the improved graph neural network topology identification model includes: The high-dimensional feature representation of each node, including the attributes of the node itself and the structural information of the node in the topological network, that is, the vector of each node ; Edge embedding representation, which contains the attributes of the edge and the information interaction characteristics between two nodes, reflects the physical characteristics of the line, the connection strength between two nodes, the power flow direction, and the state; The node connection relationship, that is, the topological structure inferred by the improved graph neural network topology identification model, represents the physical connection relationship between nodes in the network and is represented by an adjacency matrix is represented by; Confidence score of the topology structure, which generates a confidence score for the topology structure identified by the model, indicating the reliability of the prediction result.
6. The method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that, The loss function of the improved graph neural network topology identification model comprehensively considers factors such as topology consistency, node embedding distribution, and model prediction confidence. The specific expression is as follows: , Among them, is the topological consistency loss, is the node feature consistency loss; is the global embedding alignment loss; , is the weight hyperparameter of the loss term; The topological consistency loss is used to quantify the topological prediction of the model and the true topology difference, while considering the confidence of the prediction , and the topological consistency loss function is as follows: , Among them, is the connection probability between nodes and in the predicted adjacency matrix; is the connection state in the true adjacency matrix; is the confidence score output by the model; The node feature consistency loss is used to ensure the similarity of adjacent node embeddings in the feature space and enhance the model's expression ability for local topology. The node feature consistency loss function is as follows: , Among them, is the set of all edges in the graph, and are the embedding representations of nodes and respectively; The global embedding alignment loss is used to ensure that the distribution of the global embedding is consistent with the target distribution. The global embedding alignment loss function is shown as follows: , Among them, represents aligning the global embedding through the KL divergence, is the predicted global embedding distribution, is the target distribution; the target distribution is the global feature distribution of the actual distribution network topology extracted from historical operation data. By statistically analyzing the distribution network data, calculating the mean and covariance matrix of the global features, the generated distribution is as follows: , Among them, is the historical mean of the global embedding features, representing the center of the distribution; is the covariance matrix of the global embedding features, describing the correlation between features in different dimensions; is a multi-dimensional normal distribution.
7. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that The improved graph neural network topology identification model uses topology identification accuracy, F1 score, and AUC-ROC curve to evaluate the model performance. The calculation methods of each index are as follows: The topological identification accuracy rate is obtained by comparing the adjacency matrix predicted by the model with the true adjacency matrix For each element in, the matching degree between the adjacency matrix predicted by the model and the true adjacency matrix is measured, representing the proportion of correct predictions among all predictions: , In the formula, TP is the number of edges correctly predicted by the model as connected; TN is the number of edges correctly predicted by the model as not connected; FP is the number of edges wrongly predicted by the model as connected; FN is the number of edges wrongly predicted by the model as not connected; The F1 score is the harmonic mean of precision and recall, and is used to comprehensively evaluate the accuracy and coverage ability of the model: , , , Wherein, is the precision rate; is the recall rate; AUC is the area under the ROC curve, which is used to measure the ability of the model to distinguish positive and negative samples. Among them, the horizontal axis of the ROC curve is the false positive rate FPR, and the calculation method is as follows: , The vertical axis is the true positive rate TPR, and the calculation method is as follows: , The ROC curve is drawn by adjusting the classification threshold, and the area AUC under the curve is calculated using numerical integration: , Among them, is the classification threshold.
8. The method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, wherein When the distribution network undergoes dynamic changes, the topology is updated dynamically as follows: Compare the current adjacency matrix with the initial adjacency matrix to obtain the newly added or removed edges; Identify the nodes and edges directly affected by the dynamic changes of the distribution network according to the switch positions, and extract the affected subgraphs from the entire graph ; When new or removed edges are found in the topology, for the affected subgraph re - collect the node feature matrix and the edge feature matrix , construct the initial adjacency matrix of the subgraph ; Use the trained improved graph neural network topology identification model to only perform inference on the affected subgraphs and output the local prediction adjacency matrix , and generate confidence scores for each edge in the subgraph ; According to the confidence score , the area that does not meet the set confidence threshold is determined as an abnormal area. Real-time data is re-collected for the abnormal area, and the node and edge features are updated for topology recognition; Output the final adjacency matrix , and record the time points, affected areas, low-confidence annotations, and correction situations of topological dynamic changes.
9. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 1, characterized in that, Construct the topology of the distribution network based on the final adjacency matrix. The specific process is as follows: Generate a node set according to the dimension of the final adjacency matrix ; ; Traverse the final adjacency matrix , find out 's elements to obtain the edge set ; Use the force-directed algorithm to optimize the node layout, simulate the node positions through a physical model, and output the physical positions of the nodes and the connection relationships of the edges.
10. A method for identifying the topological structure of a distribution network grid based on an improved graph neural network according to claim 9, characterized in that, The process of the force-directed algorithm is as follows: Based on the node set V and the edge set , generate an initial position for each node ; For each node the resultant of the repulsive and attractive forces is synthesized to obtain the resultant force : , Among them, is the repulsive force between nodes ; is the gravitational force between nodes ; For each pair of nodes , the repulsive force is calculated as follows: , Among them, is the ideal distance between nodes, and is the position of node and respectively, and is the Euclidean distance between the two nodes; For each pair of nodes , the gravitational force is calculated as follows: , In each iteration, calculate the resultant force of each node , and adjust the position of the node according to the resultant force; When the resultant force of all nodes is less than the set threshold, stop the iteration and output the positions of all nodes and the connection relationships of the edges .
Citation Information
Patent Citations
Power distribution network topology identification method based on attention mechanism and convolutional neural network
CN114048819A
Active distribution network topology identification method and related device based on multi-task graph learning
CN118889428B
Topology real-time identification method and system based on power distribution network
CN117421571A
Branch connection state identification method and device of distribution network topological graph, equipment and medium
CN117743980A
Power distribution network line fault diagnosis method, system and equipment based on graph neural network, and medium
CN118858834A
Cited By
Medium-voltage distribution network load prediction method and device, terminal and medium
CN120454058A
Power distribution network fault positioning method and system
CN120468591A
GNN-based G3-PLC communication topology reduction power distribution network physical topology method
CN120724635A
G3-plc communication topology based on gnn to restore power grid physical topology method
CN120724635B
Coal mining power grid operation optimization method and system based on intelligent analysis
CN120810600A