A power distribution network framework topology identification method based on an improved graph neural network

By improving the topology identification method of graph neural networks, combining weighted graph and hypergraph modeling, dynamically adjusting edge weights, integrating local and global features, and designing a comprehensive loss function, the problems of dynamic topology changes and hidden nodes in existing technologies are solved, and efficient and accurate distribution network topology identification is achieved.

CN120262400BActive Publication Date: 2025-10-24STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510712678.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-24
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

Existing power distribution network topology identification methods have low accuracy when faced with dynamic topology changes and hidden nodes, and deep learning methods are difficult to deploy efficiently on resource-constrained edge computing devices, making them unable to effectively adapt to complex and dynamic network structures.

Method used

An improved graph neural network is used for topology identification. By modeling with weighted graphs and hypergraphs, and combining graph attention networks to dynamically adjust edge weights, local and global topological features are integrated. A comprehensive loss function is designed to improve the accuracy and robustness of the model, and an incremental learning mechanism is used to handle dynamic changes.

Benefits of technology

It significantly improves the accuracy and efficiency of distribution network topology identification, can quickly adapt to dynamic environments, and provides real-time, reliable topology monitoring and optimization support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120262400B_ABST
    Figure CN120262400B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of power system topology identification, in particular to a power distribution network framework topology identification method based on an improved graph neural network, which comprises the following steps: collecting real-time electrical quantity data of nodes and edges of a power distribution network, and modeling a power distribution network graph structure; constructing node, edge and hyperedge feature matrices by using real-time acquisition data, inputting the improved graph neural network topology identification model, dynamically weighting and adjusting edge weights through a graph attention network, splicing and fusing local topology features and global topology features, and generating a predicted adjacency matrix; when a dynamic change occurs in the power distribution network, locating a change area through adjacency matrix differences, and extracting a subgraph for incremental updating; constructing a topology structure of the power distribution network based on the final adjacency matrix, and outputting physical positions of nodes and connection relationships of edges. Compared with the prior art, the application significantly improves the real-time performance, generalization ability and applicability of the model, and solves the accuracy and efficiency problems of power distribution network topology identification in a dynamic environment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of power system topology identification, in particular to a power distribution network framework topology identification method based on an improved graph neural network. BACKGROUND

[0002] As an important part of the power system, the operation state of the power distribution network is directly related to the power supply quality and the safety of the user. With the access of new types of loads such as distributed energy (such as photovoltaic and energy storage equipment), electric vehicles, and the frequent occurrence of load changes and network topology reconstruction, the structure of the power distribution network becomes more complex and dynamic. Therefore, accurately obtaining the topology structure of the power distribution network is crucial for the management functions such as power flow calculation, state estimation, fault location, and optimal scheduling.

[0003] Existing power distribution network topology identification methods mainly rely on SCADA systems and graph theory algorithms. These methods have high requirements for the completeness and accuracy of data collection, but have low accuracy when facing hidden nodes, complex topology structures, and data missing and noise interference. In addition, existing power distribution network topology network identification schemes such as Chinese patent applications CN202111360101.6 and CN202411372407.7 use deep learning methods, which can automatically extract features, but are highly dependent on computing resources, difficult to efficiently deploy in resource-constrained edge computing devices, and have limited adaptability to dynamic topology changes. SUMMARY

[0004] The purpose of the present application is to overcome the defects of the prior art that cannot effectively handle dynamic topology changes and hidden nodes, and to provide a power distribution network topology identification method based on an improved graph neural network.

[0005] The purpose of the present application can be achieved by the following technical solutions:

[0006] A power distribution network framework topology identification method based on an improved graph neural network, comprising the following steps:

[0007] Collecting real-time electrical quantity data of nodes and edges of the power distribution network, and modeling the power distribution network graph structure in the form of weighted graphs and hypergraphs;

[0008] Constructing node, edge and hyperedge feature matrices from real-time collected data, and inputting them into the trained improved graph neural network topology identification model. The improved graph neural network topology identification model dynamically adjusts the edge weight through the graph attention network, and splices and fuses the local topology features and global topology features to generate a predicted adjacency matrix;

[0009] When the power distribution network undergoes dynamic changes, locate the change area through the adjacency matrix difference, and extract the subgraph for incremental update;

[0010] Based on the final adjacency matrix, the topology structure of the power distribution network is constructed, and the physical position of the output node and the connection relationship of the edge are output.

[0011] As a preferred technical solution, the power distribution network graph structure modeling is implemented as follows:

[0012] The power distribution network is modeled as a weighted graph , wherein, is a node set, representing equipment; E is an edge set, representing a physical connection relationship; is an edge weight set, representing the physical parameters of the line;

[0013] Each node is characterized by its electrical quantity information, forming a node feature vector , the electrical quantity information includes: node voltage, node current, and active power and reactive power of the node;

[0014] The weight of each edge is determined by the electrical characteristics of the line:

[0015] ,

[0016] wherein: is the comprehensive impedance of the line, i.e. the weight, is the resistance of the line, is the reactance of the line;

[0017] For complex equipment groups, use a hypergraph to represent, wherein, is a node set, representing equipment; is a hyperedge set, a hyperedge is associated with multiple nodes at the same time, and the feature of each hyperedge includes the attribute of the associated node and the aggregation result of the line parameter:

[0018] ,

[0019] ,

[0020] wherein, is a hyperedge feature vector, is a node feature vector, is the number of nodes associated with the hyperedge.

[0021] As a preferred technical solution, the improved graph neural network topology identification model highlights key equipment by dynamically adjusting edge weights, which is implemented as follows:

[0022] Map the node features to a high-dimensional space through linear transformation, and for each edge Dynamic calculation of attention weights :

[0023] ,

[0024] wherein, is an activation function; and is a node and mapped feature, is a feature concatenation operation, is an attention vector;

[0025] According to the similarity of node and edge features, the importance of information propagation is adjusted, and the node features are aggregated using attention weights:

[0026] ,

[0027] wherein: is an activation function, is a learnable weight matrix of the i-th layer, is a node feature of the i-th layer.

[0028] As a preferred technical solution, the improved graph neural network topology identification model splices and fuses local topology features and global topology features, which is specifically implemented as follows:

[0029] Local topology features are extracted using a graph convolution network, and the feature of each node is updated to the weighted sum of the features of its neighbor nodes through a neighborhood aggregation mechanism:

[0030] ,

[0031] wherein: is a node feature matrix of the i-th layer, i.e., a local topology feature; is a normalized adjacency matrix; is a node feature matrix of the i-th layer; is a learnable weight matrix of the i-th layer; is an activation function;

[0032] Global topology features are extracted by using global average pooling to summarize the features of the entire graph:

[0033] ,

[0034] wherein: is a global feature of a node , is the total number of nodes, is the global embedding vector;

[0035] The local features and global features are integrated through the splicing mechanism:

[0036] ,

[0037] in: is a multi-scale feature, is a local feature, is a global feature, For splicing operation;

[0038] Use the fully connected layer to further fuse the concatenated features:

[0039] ,

[0040] in, is the weight of the fully connected layer, is the bias of the fully connected layer, is the activation function.

[0041] As a preferred technical solution, the output of the improved graph neural network topology recognition model includes:

[0042] The high-dimensional feature representation of each node includes the attributes of the node itself and the structural information of the node in the topological network, that is, the vector of each node ;

[0043] Edge embedding representation includes the attributes of the edge and the information interaction characteristics between the two nodes, reflecting the physical characteristics of the line, the connection strength between the two nodes, and the flow direction and status;

[0044] The node connection relationship, that is, the topological structure obtained by inference of the improved graph neural network topology recognition model, represents the physical connection relationship between nodes in the network, through the adjacency matrix express;

[0045] The confidence score of the topology structure generates a confidence score for the topology structure identified by the model, indicating the reliability of the prediction result.

[0046] As a preferred technical solution, the loss function of the distribution network topology identification model comprehensively considers topological consistency, node embedding distribution, and model prediction confidence factors, and is specifically expressed as follows:

[0047] ,

[0048] in, is the topological consistency loss, is the node feature consistency loss; a global embedding alignment loss; , a weight hyper-parameter of the loss term;

[0049] the topology consistency loss, used to quantify the difference between the model predicted topology and the real topology , while considering the confidence of the prediction , the topology consistency loss function is as follows:

[0050] ,

[0051] wherein, is the connection probability of nodes and in the predicted adjacency matrix; is the connection state in the real adjacency matrix; is the confidence score of the model output;

[0052] the node property consistency loss, 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 property consistency loss function is as follows:

[0053] ,

[0054] wherein, is the set of all edges in the graph, and are the embedding representations of nodes and , respectively;

[0055] the global embedding alignment loss, used to ensure that the distribution of global embedding is consistent with the target distribution, the global embedding alignment loss function is as follows:

[0056] ,

[0057] wherein, represents the alignment of global embedding by KL divergence, is the predicted global embedding distribution, is the target distribution; the target distribution is the global feature distribution of the actual power distribution network topology extracted from historical operation data, by statistical power distribution network data, the mean and covariance matrix of global features are calculated to generate the distribution as follows:

[0058] ,

[0059] wherein, is the historical mean of global embedding features, representing the center of the distribution; is the covariance matrix of the global embedding feature, which describes the correlation between features of different dimensions; is a multidimensional normal distribution.

[0060] As a preferred technical solution, the improved graph neural network topology recognition model uses topology recognition accuracy, F1 score, and AUC-ROC curve to evaluate model performance. The calculation method of each indicator is as follows:

[0061] The topology recognition accuracy is determined by comparing the adjacency matrix predicted by the model With the true adjacency matrix Each element in the adjacency matrix measures the model's prediction With the true adjacency matrix The degree of match is expressed as the proportion of correct predictions among all predictions:

[0062] ,

[0063] Where 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 incorrectly predicted by the model as connected; FN is the number of edges incorrectly predicted by the model as not connected.

[0064] The F1 score is the harmonic average of precision and recall, and is used to comprehensively evaluate the accuracy and coverage of the model:

[0065] ,

[0066] ,

[0067] ,

[0068] Where, is the accuracy rate; is the recall rate;

[0069] AUC is the area under the ROC curve, which is used to measure the ability of the model to distinguish between positive and negative samples.

[0070] The horizontal axis of the ROC curve is the false positive rate FPR, which is calculated as follows:

[0071] ,

[0072] The vertical axis is the true positive rate (TPR), which is calculated as follows:

[0073] ,

[0074] The ROC curve is drawn by adjusting the classification threshold, and the area under the curve (AUC) is calculated using numerical integration:

[0075] ,

[0076] wherein, is a classification threshold.

[0077] As a preferred technical solution, when the power distribution network has a dynamic change, the topology is dynamically updated as follows:

[0078] Compare the difference between the current adjacency matrix and the initial adjacency matrix to obtain the added or removed edges;

[0079] According to the switch position, identify the nodes and edges directly affected by the dynamic change of the power distribution network, and extract the affected subgraph from the full graph ;

[0080] When new or removed edges are found in the topology, re-collect the node feature matrix and the edge feature matrix , and construct the initial adjacency matrix of the subgraph ;

[0081] Use the trained improved graph neural network topology identification model to only infer the affected subgraph , output the local predicted adjacency matrix , and generate a confidence score for each edge in the subgraph ;

[0082] According to the confidence score , areas that do not meet the set confidence threshold are judged as abnormal areas, real-time data is re-collected for the abnormal areas, and node and edge features are updated for topology identification;

[0083] Output the final adjacency matrix , and record the time point of the topology dynamic change, the affected area, the low confidence label, and the correction situation.

[0084] As a preferred technical solution, the topology structure of the power distribution network is constructed based on the final adjacency matrix, and the specific process is as follows:

[0085] Generate a node set according to the dimension of the final adjacency matrix ;

[0086] Iterate through the final adjacency matrix to find the elements , and obtain an edge set ;

[0087] ​Use force-directed algorithm to optimize node layout, simulate node positions through physical models, and output the physical positions of nodes and edge connection relationships.

[0088] As an optimal technical solution, the force-directed algorithm process is as follows:

[0089] In the node set V and edge set Based on this, an initial position is generated for each node ;

[0090] For each node , the result of synthesizing the repulsive force and the attractive force is the resultant force :

[0091] ,

[0092] in, For nodes repulsive force between For nodes The attraction between

[0093] For each pair of nodes , repulsive force The calculation is as follows:

[0094] ,

[0095] in, is the ideal distance between nodes, and For nodes and location, is the Euclidean distance between two nodes;

[0096] For each pair of nodes ,gravitational The calculation is as follows:

[0097] ,

[0098] In each iteration, the resultant force at each node is calculated , and adjust the position of the node according to the resultant force;

[0099] When the total force of all nodes When it is less than the set threshold, stop the iteration and output all node positions Connection relationship with edges .

[0100] Compared with the prior art, the present invention has the following beneficial effects:

[0101] 1) The application proposes an improved graph neural network topology identification model, which uses a dynamic weighting mechanism and multi-scale feature fusion. The edge weight is adjusted by the dynamic weighting mechanism to highlight the role of key devices, and the information propagation is realized by calculating the attention weight through the graph attention network. In addition, the model combines local topological features reflecting direct connection relationships and global features reflecting overall dependence of network structure, adopts multi-scale feature splicing and fusion to improve expression ability. And combined with the incremental learning mechanism, it efficiently processes the dynamic changes of local topology. The real-time performance, generalization ability and applicability of the model are significantly improved, and the accuracy and efficiency of power distribution network topology identification in dynamic environment are solved.

[0102] 2) The application also designs a comprehensive loss function and adjusts parameters to train the improved graph neural network to accurately identify the topology of the power distribution network. The loss function combines topology consistency, node characteristics and global embedding alignment, and considers local and global characteristics. The training process includes forward propagation, loss calculation and iterative optimization, and the performance is evaluated by accuracy, F1 score and AUC to ensure the generalization ability and robustness of the model in complex dynamic environment.

[0103] 3) The application adopts an incremental learning mechanism to efficiently process the dynamic changes of local topology, locates the change area through the difference of adjacency matrix, extracts subgraph for incremental update. Set threshold for low confidence area and resample data to correct abnormality, output the final adjacency matrix, record the time point and influence area of dynamic change, ensure the accuracy and efficiency of real-time topology identification. BRIEF DESCRIPTION OF DRAWINGS

[0104] Figure 1 The application is based on the improved graph neural network power distribution network topology self-identification method flow chart;

[0105] Figure 2 The application is based on the force-directed algorithm topology graph drawing flow chart. DETAILED DESCRIPTION

[0106] The application will be described in detail below in combination with the drawings and specific embodiments. The present embodiment is based on the technical solution of the present application and gives a detailed implementation and specific operation process, but the protection scope of the present application is not limited to the following examples.

[0107] Example 1

[0108] The application proposes a high-efficiency power distribution network topology identification method 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 topology characteristics. With the support of a dynamic updating mechanism, it can quickly adapt to complex scenarios such as topology switching and new equipment, 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. Figure 1 As shown in the figure, the overall process of the power distribution network topology identification method based on the improved graph neural network is as follows.

[0109] Step 1, data collection and preprocessing, based on intelligent electric meters, SCADA systems or use sampling systems, collect real-time electrical quantity data of power distribution network nodes (such as transformers, loads) and edges (such as lines, switches), including voltage, current, power factor, switch state data, etc., and perform preprocessing, including cleaning abnormal data (such as noise, missing values) and normalization processing to ensure data consistency, and feature extraction on time series data (such as historical voltage changes) to encode time series information into embedding vectors to provide dynamic characteristic support for subsequent model input.

[0110] Step 2, power distribution network graph structure modeling, representing the power distribution network as a weighted graph, defining the node set as the device and the edge set as the physical connection relationship between devices, and the edge weight reflecting the line parameters. For complex device groups (such as parallel lines), use hypergraph modeling to associate multiple nodes with a hyperedge.

[0111] Step 3, improved graph neural network model design, taking node, edge and hyperedge feature matrix as input, the goal is to extract high-dimensional features to reflect the topology relationship and dynamic changes of the power distribution network. Through a dynamic weighting mechanism to adjust the edge weight, highlighting the role of key devices, and through a graph attention network (GAT) to calculate attention weights to realize information propagation. In addition, the model combines local topology features (reflecting direct connection relationships through neighborhood aggregation) and global features (capturing the overall dependence of network structure through global average pooling), and uses multi-scale feature splicing and fusion to enhance expression ability. Finally, the model outputs include high-dimensional embedding representation of nodes, edge embedding representation, inferred adjacency matrix, and confidence score of topology structure, providing accurate and reliable results for complex power distribution network topology identification.

[0112] Step 4, model training and optimization, through labeling historical data, designing a comprehensive loss function and adjusting parameters, training the improved graph neural network to accurately identify the power distribution network topology. The loss function combines topology 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 by accuracy, F1 score and AUC to ensure the generalization ability and robustness of the model in complex dynamic environments.

[0113] Step 5, topology recognition and dynamic update, by collecting data in real time to construct the input matrix, using the trained graph neural network to generate the predicted adjacency matrix, and through thresholding processing to generate the topology structure. To adapt to dynamic changes (such as topology switching, new equipment), locate the change area through the adjacency matrix difference, extract the subgraph for incremental update. Set a threshold for low confidence areas and resample data to correct abnormalities, output the final adjacency matrix, and record the time point and impact area of dynamic changes to ensure the accuracy and efficiency of real-time topology recognition.

[0114] Step 6, output the topology recognition result, construct the topology structure of the power distribution network through the final adjacency matrix, generate the node set and edge set, and use the force-directed algorithm to optimize the node layout, output the physical location of the node and the connection relationship of the edge, to intuitively show the network structure of the power distribution network.

[0115] Example 2

[0116] As one of the specific implementation methods of the present application, the steps of the power distribution network grid topology self-recognition method based on the improved graph neural network proposed by the present application are implemented as follows:

[0117] Step 1: Data collection and preprocessing

[0118] 1.1) Data collection, data sources include smart meters, SCADA systems, and meter reading systems. Get the data of each node, including the electrical parameters of transformers and loads, historical voltage and current change sequences; get edge data, including line impedance, power flow direction, and switch state.

[0119] 1.2) Data preprocessing, including anomaly detection, missing value filling, normalization processing, and feature extraction (as it is not a patent protection point, it will not be described in detail here).

[0120] After step 1, two types of data inputs are finally generated, one is the node feature matrix , containing voltage, current, time embedding and other multi-dimensional features. The second is the edge feature matrix , containing line impedance, power flow direction and other relationship information.

[0121] Step 2: Power distribution network graph structure modeling, which aims to convert the actual power distribution network into a mathematical representation for subsequent algorithm application and optimization analysis. By constructing a weighted graph and a hypergraph, the node and edge information in the power distribution network is quantified and standardized.

[0122] 2.1) Model the power distribution network as a weighted graph , where is the node set, representing devices such as transformers, JP cabinets, and user meter boxes. is the set of edges, representing physical connection relationships (e.g. lines, switches). is the set of edge weights, representing physical parameters of lines (e.g. line impedance, cable length).

[0123] The weight of each edge is determined by the electrical characteristics of the line:

[0124]

[0125] where is the overall impedance of the line, i.e. the weight, is the resistance of the line, is the reactance of the line.

[0126] The characteristics of each node are composed of its electrical quantity information, forming the node feature vector:

[0127]

[0128] where is the node voltage, is the node current, and are the active and reactive power of the node, respectively.

[0129] 2.2) Hypergraph Modeling

[0130] For complex device groups (e.g. parallel lines, switch groups), a hypergraph is used to represent, where is the set of nodes, same as in the weighted graph, is the set of hyperedges, a hyperedge can be associated with multiple nodes (e.g. if a switch group connects nodes , then a hyperedge is defined).

[0131] The characteristics of each hyperedge include the attributes of the associated nodes and the aggregation results of the line parameters:

[0132]

[0133]

[0134] where is the hyperedge feature vector, is the node feature vector, is the number of nodes associated with the hyperedge.

[0135] 2.3) Initial Feature Representation of Graph ​

[0136] The adjacency matrix A of the weighted graph is defined as:

[0137]

[0138] The node degree matrix D is a diagonal matrix, representing the connection strength of each node:

[0139]

[0140] To avoid the influence of node degree on feature propagation, the normalized adjacency matrix is defined as:

[0141]

[0142] 2.4) Graph feature extraction

[0143] The node feature matrix includes the electrical quantity and time series features of each node:

[0144]

[0145] The edge feature matrix includes the impedance, cable length, and power flow direction of each edge:

[0146]

[0147] The hyperedge feature matrix represents the aggregated features of complex device groups:

[0148]

[0149] 2.5) Graph modeling result output

[0150] The weighted graph model contains node sets, edge sets, and edge weight information, and builds a complete power distribution network topology.

[0151] The hypergraph model handles the association relationships of complex device groups and enhances the network expression capability.

[0152] Feature matrix: including node feature matrix , edge feature matrix , and hyperedge feature matrix .

[0153] Step 3: Improve the design of graph neural network topology identification model

[0154] 3.1) Model input

[0155] Input data includes node feature matrix , edge feature matrix , superedge feature matrix , the goal is to extract high-dimensional features of nodes and edges through graph neural networks, reflecting topological relationships and dynamic changes.

[0156] 3.2) Dynamic weighted information propagation mechanism

[0157] By dynamically adjusting the edge weight, the influence of key devices (such as main transformers, branch switches) is highlighted, and the importance of information propagation is adjusted according to the similarity of node and edge features. The calculation steps are as follows: Dynamic calculation of attention weight , according to the similarity of node and edge features, adjust the importance of information propagation, the calculation steps are as follows:

[0158] (3.2.1) Node feature transformation, map the node feature to a high-dimensional space through linear transformation:

[0159]

[0160] where, is a learnable parameter matrix.

[0161] (3.2.2) Attention weight calculation

[0162] For edge , the calculation method of attention weight is as follows:

[0163]

[0164] where, is an activation function variant, which introduces a certain negative slope to solve the problem that the traditional function will cause the gradient to be zero when the input is negative; and are the transformed features of nodes and , is the feature concatenation operation, is the attention vector.

[0165] (3.2.3) Information propagation update

[0166] Use the attention weight to aggregate the node features:

[0167]

[0168] where, is an activation function; is the learnable weight matrix of the layer; is the node feature of the layer.

[0169] 3.3) Fusion of local and global topology information

[0170] In power distribution network topology identification, local topology information reflects the direct connection relationship between devices (such as the relationship between branch switches and loads), while global topology information describes the structure of the overall network (such as the topology of the backbone network). The combination of the two can enhance the expression ability of complex networks, especially in the case of multi-branch, multi-loop or dynamic topology.

[0171] (3.3.1) Local topology feature extraction

[0172] The graph convolution network (GCN) is used to process local characteristics. Through the neighborhood aggregation mechanism, the feature of each node is updated to the weighted sum of the features of its neighbor nodes, capturing the connection relationship between each node and its direct neighbor, reflecting the local topology characteristics of the power distribution network, as shown in the following formula:

[0173]

[0174] where, is the node feature matrix of the layer, i.e. the local topology 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.

[0175] (3.3.2) Global topology feature extraction

[0176] Global average pooling is used to summarize the features of the entire graph to reflect the global structure of the entire power distribution network and capture the potential dependency relationship between long-distance nodes. The implementation formula of global average pooling is as follows:

[0177]

[0178] where, is the global feature of node , is the total number of nodes, is the global embedding vector. (3.3.3) Multi-scale feature concatenation

[0179] Local and global features are further fused through the concat mechanism:

[0180]

[0181] where,

[0182] ​for multi-scale features, for local features, for global features, for stitching operation.

[0183] (3.3.4) Feature fusion

[0184] The fused features are fused using a fully connected layer:

[0185]

[0186] where, is the weight of the fully connected layer, is the bias of the fully connected layer, is the activation function.

[0187] 3.4) Model output

[0188] The output of the model is the core result of power grid topology identification, mainly including four points:

[0189] First, the high-dimensional feature representation of each node, including the attributes (electrical quantities) of the node itself and the structural information in the topology network, i.e. the embedding vector of each node :

[0190]

[0191] where, is the dimension of the embedding vector. Combined with the node embedding representation, the device type and the operating state of the node can be inferred.

[0192] Second, the edge embedding representation, which represents the relationship between two nodes and contains the attributes of the edge and the information interaction characteristics between the two nodes. The embedding vector of each edge is represented as:

[0193]

[0194] where, is the dimension of the edge feature. The edge embedding representation can reflect: the physical characteristics of the line, the connection strength between the two nodes, the direction and state of the power flow.

[0195] Third, the node connection relationship, i.e. the topology structure obtained by the model reasoning, represents the physical connection relationship between nodes in the network. It is represented by the adjacency matrix :

[0196]

[0197] where, indicates that the nodes and have a direct connection, Indicates no connection.

[0198] Fourth, the confidence score of the topology structure, which generates a confidence score for the model-identified topology structure, indicating the reliability of the prediction result. The confidence score of each edge is:

[0199]

[0200] where, represents the confidence score of the edge , the closer to 1 indicates the more reliable the prediction result.

[0201] Step 4: Model training and optimization

[0202] Model training and optimization is a key step to improve the topology identification of graph neural networks. The purpose is to train the network through historical data, so that it can accurately identify the topology structure of the distribution network, and optimize the model performance to improve the generalization ability and robustness.

[0203] 4.1) Training data preparation

[0204] Based on the data obtained in step 1, data labeling is performed, including the real topology structure of the distribution network, which is used as the label data for supervised learning . On the basis of data labeling, the data set is divided into training set, validation set and test set.

[0205] 4.2) Loss function design

[0206] In order to better optimize the distribution network topology identification model, a new type of loss function is designed, which considers factors such as topology consistency, node embedding distribution and model prediction confidence, aiming to improve the accuracy and robustness of the model.

[0207] (4.2.1) Topology consistency loss

[0208] is used to quantify the difference between the model-predicted topology and the real topology , while considering the prediction confidence , the topology consistency loss function is as follows:

[0209]

[0210] where, is the connection probability of nodes and in the predicted adjacency matrix; is the connection state in the real adjacency matrix; is the confidence score output by the model.

[0211] (4.2.2) Node property consistency loss

[0212] To ensure the similarity of adjacent nodes embedded in the feature space and enhance the model's expression ability of local topology, the node property consistency loss function is as follows:

[0213]

[0214] where, is the set of all edges in the graph, and are the embedding representations of nodes and , respectively.

[0215] (4.2.3) Global embedding alignment loss

[0216] To ensure the distribution of global embedding is consistent with the target distribution and enhance the understanding of global topology structure. Here, the global embedding vector is generated by aggregating the node properties in the entire graph, representing the global properties of the graph, and is obtained by global average pooling in step 3.

[0217] The global embedding alignment loss function is as follows:

[0218]

[0219] where, represents the alignment of global embedding by KL divergence, is the predicted global embedding distribution, is the target distribution.

[0220] Here, the target distribution is the global feature distribution of the actual power distribution network topology extracted from historical running data. By statistically analyzing a large amount of power distribution network data, the mean and covariance matrix of global features (such as voltage, current, and power flow) are calculated to generate the distribution as follows:

[0221]

[0222] where, is the historical mean of global embedding features, representing the center of the distribution; is the covariance matrix of global embedding features, describing the correlation between different dimensions of features; is a multi-dimensional normal distribution.

[0223] Combining the above three loss functions, the loss function of the improved graph neural network topology identification model is designed as follows:

[0224]

[0225] where, , is the weight hyperparameter of the loss term, used to adjust the importance of each part.

[0226] 4.3) Model training process

[0227] (4.3.1) Forward propagation

[0228] Input node features, edge features, and adjacency matrix, pass through the improved graph neural network topology identification model, output node embedding , edge embedding and predicted adjacency matrix .

[0229] (4.3.2) Loss calculation

[0230] According to the total loss function , calculate the error between the model prediction result and the real data.

[0231] (4.3.3) Back propagation

[0232] Through the gradient descent algorithm, update the model parameters.

[0233] (4.3.4) Iterative training

[0234] Continue to carry out multiple iterations until the following stopping conditions are met: the loss function of the validation set no longer decreases in consecutive multiple iterations; or reaches the set maximum number of training times.

[0235] 4.4) Model verification and optimization

[0236] Evaluate the model performance on the validation set, use topology identification accuracy (Accuracy), F1 score, AUC-ROC curve to evaluate the model performance, the calculation method of each index is as follows:

[0237] Topology identification accuracy (Accuracy): measure the matching degree of the model predicted adjacency matrix and the real adjacency matrix , represents the proportion of correct prediction in all predictions:

[0238]

[0239] 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 incorrectly predicted by the model as connected (true value is 0, predicted value is 1); FN is the number of edges incorrectly predicted by the model as unconnected (true value is 1, predicted value is 0). By comparing the adjacency matrix predicted by the model with the true adjacency matrix , each element is obtained.

[0240] F1 score: is the harmonic mean of precision and recall, used to evaluate the accuracy and coverage of the model:

[0241]

[0242]

[0243]

[0244] 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 between positive and negative samples.

[0245] Where the ROC curve horizontal axis (false positive rate FPR) is calculated as follows:

[0246]

[0247] The vertical axis is the true positive rate TPR, which is calculated in the same way as Recall:

[0248]

[0249] The ROC curve is drawn by adjusting the classification threshold (such as from 0 to 1), and the area AUC under the curve can be calculated by numerical integration:

[0250]

[0251] Where, is the classification threshold, and the value of AUC ranges from , the closer to 1 indicates that the model topology recognition ability is stronger.

[0252] By adjusting the learning rate, loss function weight, embedding vector dimension to optimize the performance of the model, calculate each index, find the optimal parameter setting.

[0253] 4.5) Model testing

[0254] The generalization ability of the model is verified on the test set, and the same indicators as in model verification are used for evaluation.

[0255] Step 5: Topology identification and dynamic update

[0256] 5.1) Input real-time data

[0257] Collect data from smart meters, SCADA systems or online monitoring devices in real time, and construct node feature matrix , edge feature matrix , initial adjacency matrix , if there are complex device groups, further construct hyperedge feature matrix as model input.

[0258] 5.2) Model inference

[0259] Use the trained improved graph neural network topology identification model to generate the predicted adjacency matrix to reflect the connection probability between nodes.

[0260] 5.3) Generate topology structure using thresholding process

[0261] According to the element value in the predicted adjacency matrix , set the threshold T to binary it:

[0262]

[0263] Generate the final output adjacency matrix , representing all connection relationships in the generated power grid topology.

[0264] 5.4) Topology dynamic update mechanism

[0265] The goal of topology dynamic update is to efficiently handle the dynamic changes of the power grid (such as topology switching, new devices or data anomalies), and update the topology structure output by the model in a timely manner, while avoiding retraining the entire model to save computing resources.

[0266] (5.4.1) Find new or removed edges by comparing the difference between the current adjacency matrix and the initial adjacency matrix .

[0267] (5.4.2) Localization of dynamic changes

[0268] Determine the impact range of dynamic changes and limit it to a local area to reduce the update range. According to the switch position, identify the nodes and edges directly affected, and construct the affected subgraph , extract the affected subgraph from the full graph G For the node set in the dynamically changing area, For the edge set in the dynamically changing area.

[0269] (5.4.3) Subgraph incremental update and outlier correction

[0270] When a newly added or removed edge is found in the topology, , the node feature matrix and the edge feature matrix are re-collected , and the initial adjacency matrix of the subgraph is constructed , reflecting the physical connection information.

[0271] Using the trained GNN model, only the affected subgraph is inferred, and the local predicted adjacency matrix is output:

[0272]

[0273] And generate a confidence score for each edge in the subgraph for subsequent anomaly correction, where the confidence score directly uses the probability of the existence of a connection between nodes i and j in the predicted adjacency matrix:

[0274]

[0275] To prevent excessive reliance on a certain information source (such as node embedding or edge features), the confidence score is regularized:

[0276]

[0277] where and are the maximum and minimum values in the local predicted adjacency matrix , respectively.

[0278] In order to facilitate anomaly detection and correction, according to the confidence score , set a threshold , and judge the area that meets the following formula as an abnormal area:

[0279]

[0280] Re-collect real-time data for the abnormal area and update node and edge features for topology identification.

[0281] (5.4.4) Output of the result after dynamic update

[0282] Output the final adjacency matrix , including the connection relationship of all nodes, and record the time point of topology dynamic change, the affected area, the low confidence label, and the correction situation.

[0283] Step 6: Output the final topology identification result

[0284] Based on the final adjacency matrix output in step 5 , construct an intuitive network structure representation to reflect the node and edge relationship of the power distribution network, the specific process is as follows:

[0285] 6.1) Input the adjacency matrix ;

[0286] 6.2) Directly generate the node set according to the dimension of the adjacency matrix ;

[0287] 6.3) Traverse the adjacency matrix to find the elements of , and get the edge set ;

[0288] 6.4) Based on the force-directed algorithm, simulate the node position through the physical model.

[0289] As shown in Figure 2 , the force-directed algorithm process is as follows:

[0290] (6.4.1) Initialization

[0291] On the basis of the node set V and the edge set , generate the initial position for each node.

[0292] (6.4.2) Calculate the force

[0293] For each pair of nodes , calculate the repulsive force :

[0294]

[0295] Where k is the ideal distance between nodes, and are the positions of nodes and , and is the Euclidean distance between the two nodes.

[0296] For each pair of nodes , calculate the attractive force :

[0297]

[0298] For each node , synthesize the results of repulsive force and attractive force to get the resultant force :

[0299]

[0300] (6.4.3) Position update

[0301] In each iteration, the force of each node is calculated , and the position of the node is adjusted according to the force:

[0302]

[0303]

[0304] wherein, is the learning rate.

[0305] When the force of all nodes is less than the set threshold, stop iteration:

[0306]

[0307] (6.4.4) Output all node positions and the connection relationship of the edges .

[0308] The above detailed the preferred embodiments of the present application. It should be understood that those of ordinary skill in the art without creative work can make many modifications and changes according to the concept of the present application. Therefore, any technical solutions obtained by logical analysis, reasoning or limited experiments on the basis of the prior art according to the concept of the present application should be within the protection scope determined by the claims.

Claims

1. A power distribution network grid topology identification method based on an improved graph neural network, characterized by the steps of The method comprises the following steps: Collect real-time electrical quantity data of nodes and edges of a power distribution network, and model the power distribution network graph structure in the form of a weighted graph and a hypergraph; Construct node, edge and hyperedge feature matrices using real-time collected data, and input the trained improved graph neural network topology identification model, which dynamically adjusts edge weights through a graph attention network, and fuses local topology features and global topology features to generate a predicted adjacency matrix; When the power distribution network undergoes dynamic changes, locate the change area through the difference in the adjacency matrix, and extract a subgraph for incremental updating; Construct the topology structure of the power distribution network based on the final adjacency matrix, and output the physical location of the nodes and the connection relationship of the edges.

2. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The power distribution network graph structure is modeled as follows: Modeling power distribution network as a weighted graph wherein, is a set of nodes, representing devices; E is a set of edges, representing physical connection relationship; is a set of edge weights, representing physical parameters of lines; Each node is characterized by its electrical quantity information, which includes node voltage, node current, and active power and reactive power of the node, forming a node feature vector ​ each edge weight of determined by the electrical properties of the line: , wherein: is the overall 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 are represented, where, is a set of nodes, representing devices; is a set of hyperedges, a hyperedge simultaneously relating multiple nodes, each hyperedge characterized by including the aggregation of attributes and line parameters of the related nodes: , , wherein, is a super-edge feature vector, is the number of nodes associated with the super-edge.

3. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The improved graph neural network topology identification model dynamically adjusts the edge weights to highlight key devices, which is implemented as follows: The node features are mapped to a high-dimensional space by a linear transformation, for each edge Dynamic computation of attention weights : , wherein, is an activation function; with is a node and mapped features, is a feature concatenation operation, is an 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 a learnable weight matrix of the layer, is a learnable weight matrix of the layer node feature.

4. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The improved graph neural network topology identification model fuses local topology features and global topology features, which is implemented as follows: Use a graph convolution network to extract local topology features, and update the features of each node to the weighted sum of the features of its neighbor nodes through a neighborhood aggregation mechanism: , wherein: is the node feature matrix of the layer, i.e., the local topological features; 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 a global feature of the node , is the total number of nodes, is a global embedding vector; Fuse local features and global features through a concatenation mechanism: , wherein: is a multi-scale feature, is a local feature, is a global feature, is a stitching operation; Further fuse the concatenated features using a fully connected layer: , wherein, is a weight of the fully connected layer, is a bias of the fully connected layer, is an activation function.

5. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The output of the improved graph neural network topology identification model includes: high-dimensional feature representation of each node, containing the attributes of the node itself and the structural information of the node in the topological network, i.e., the vector of each node ; Edge embedding representation, including the attributes of the edge and the information interaction characteristics between the two nodes, reflecting the physical characteristics of the line, the connection strength between the two nodes, the power flow direction and state; The node connection relationship, i.e., the topological structure obtained by inference of the improved graph neural network topological identification model, represents the physical connection relationship between nodes in the network, and is represented by an adjacency matrix ; The confidence score of the topology structure generates a confidence score for the topology structure identified by the model, indicating the reliability of the prediction result.

6. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The loss function of the improved graph neural network topology identification model considers the topology consistency, node embedding distribution and model prediction confidence factors, and is specifically represented as follows: , wherein, is a topological consistency loss, is a node property consistency loss; is a global embedding alignment loss; , is a weight hyperparameter for the loss term; the topological consistency loss, configured to quantify the difference between the predicted topology and the real topology , while considering the confidence of the prediction The topological consistency loss function is as follows: , wherein, is the connection probability of a node and in the adjacency matrix; is the connection state in the real adjacency matrix; is the confidence score of the model output; The node characteristic consistency loss is used to ensure the similarity of adjacent node embeddings in the feature space and enhance the expression ability of the model for local topology, and the node characteristic consistency loss function is as follows: , wherein, is the set of all edges in the graph, and are the embedding representations of nodes and respectively. The global embedding alignment loss is configured to ensure that the distribution of the global embedding is consistent with a target distribution. The global embedding alignment loss function is shown as follows: , wherein, represents aligning the global embedding by KL divergence, is a predicted global embedding distribution, is a target distribution; the target distribution is a global feature distribution of the actual power distribution network topology extracted from historical operation data, by counting the power distribution network data, the mean and covariance matrix of the global feature are calculated, and the distribution is generated 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 different dimensions of features; is a multi-dimensional normal distribution.

7. The power grid topology identification method based on the 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 performance of the model, and the calculation methods of the indexes are as follows: The topology recognition accuracy is measured by comparing each element of the model-predicted adjacency matrix with the true adjacency matrix The topology recognition accuracy is measured by comparing each element of the model-predicted adjacency matrix with the true adjacency matrix The topology recognition accuracy is measured by comparing each element of the model-predicted adjacency matrix with the true adjacency matrix and represents the proportion of all predictions that are correctly predicted: , Where 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 incorrectly predicted by the model as connected; and FN is the number of edges incorrectly predicted by the model as unconnected; The F1 score is the harmonic mean of precision and recall, which is used to comprehensively evaluate the precision and coverage ability of the model: , , , In the formula, Precision; Recall; AUC is the area under the ROC curve, which is used to measure the ability of the model to distinguish positive and negative samples, Where the horizontal axis of the ROC curve is the false positive rate FPR, which is calculated as follows: , The vertical axis is the true positive rate TPR, which is calculated as follows: , The ROC curve is drawn by adjusting the classification threshold, and the area AUC under the curve is calculated by numerical integration: , wherein, is a classification threshold.

8. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, When the power distribution network changes dynamically, the topology is updated dynamically as follows: differences between the current adjacency matrix and the initial adjacency matrix resulting in added or removed edges; According to the switch position, the nodes and edges directly affected by the dynamic change of the power distribution network are identified, and the affected subgraph is extracted from the whole graph ; When a new edge or a removed edge is found in the topology, the affected subgraph re-collecting the node feature matrix and the edge feature matrix , constructing the initial adjacency matrix of the subgraph ; using the trained improved graph neural network topology recognition model, only on the affected subgraph performing inference, outputting a local prediction adjacency matrix and generating a confidence score for each edge in the subgraph ; According to the confidence score If the region does not satisfy the set confidence threshold, the region is determined as an abnormal region, real-time data is re-collected for the abnormal region, and node and edge features are updated for topology identification. outputting the final adjacency matrix And record the time point of the topology dynamic change, the impact area, the low confidence annotation and the correction situation.

9. The power grid topology identification method based on the improved graph neural network according to claim 1, characterized in that, The topology structure of the power distribution network is constructed based on the final adjacency matrix, and the specific process is as follows: According to the final adjacency matrix of the dimension generating node set ; traversing the final adjacency matrix , finding the elements of , obtaining the edge set The force-directed algorithm is used to optimize the node layout, and the physical model is used to simulate the node position, and the physical position of the node and the connection relationship of the edge are output.

10. The power grid topology identification method based on the improved graph neural network according to claim 9, characterized in that, The force-directed algorithm process is as follows: On the basis of the node set V and the edge set E , an initial position of each node is generated ; For each node , the resultant of the repulsive and attractive forces : , wherein, is a repulsive force between nodes ; is an attractive force between nodes ; For each pair of nodes , repulsive force is calculated as follows: , wherein, is the ideal distance between nodes, and is the position of the node and is the position of the node is the Euclidean distance between two nodes; For each pair of nodes , the gravitational force is calculated as follows: , In each iteration, the resultant force of each node is calculated and the position of the node is adjusted according to the resultant force; When the resultant force of all nodes is less than a set threshold, stop iteration and output all node positions and edge connection relationships .

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

  • Power distribution network line fault diagnosis method, system and equipment based on graph neural network, and medium

    CN118858834A