Power grid key asset identification method based on heterogeneous graph neural network
By constructing a heterogeneous graph model of the power system through a heterogeneous graph neural network, and combining adaptive frequency domain graph transformation and cross-view comparative learning, the shortcomings of dynamic and static methods in the identification of key nodes in the power grid are solved, achieving high accuracy and interpretability in the identification of key nodes, and improving the power grid's security protection capabilities.
Patent Information
- Application Number
- CN202511578739.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-02-03
AI Technical Summary
Existing technologies for identifying key nodes in power grids suffer from problems such as over-reliance on preset fault scenarios in dynamic methods, insufficient heterogeneous graph modeling in static methods, and poor interpretability of traditional black-box models, resulting in insufficient identification accuracy and topology correlation tracing capabilities.
A heterogeneous graph neural network-based approach is adopted to construct a heterogeneous graph model of the power system through adaptive frequency domain graph transformation, cross-view comparative learning, and gradient propagation mechanism. This enables multi-level coupled modeling of the topology and electrical characteristics of heterogeneous equipment in the power grid, improving the accuracy of key node identification and the ability to trace topological associations.
It effectively captures the long-range dependency characteristics of the power grid, improves the accuracy of key node identification, and provides multi-dimensional interpretable evidence, overcoming the limitations of traditional methods and enhancing the reliability of power grid security protection.
Smart Images

Figure CN121456746A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid data asset technology, and in particular to a method for identifying key power grid assets based on heterogeneous graph neural networks. Background Technology
[0002] With the increasing informatization of power systems, the security of cyberspace assets is becoming increasingly prominent. In large-scale power grids, natural disasters, deliberate attacks, and component failures can all lead to large-scale power outages. Typically, power outages are accompanied by the failure of one or more power grid components, which are referred to as critical components. As a complex infrastructure system, the modern power grid's assets encompass heterogeneous equipment such as generator sets, transmission lines, transformers, substations, and diverse load nodes. These assets exhibit multi-layered coupling relationships in terms of physical connections and electrical characteristics. Their failures will have a severe impact on the operation of the power grid, making the identification of critical nodes in the power grid crucial.
[0003] In the field of critical node identification in power grids, existing technologies are mainly divided into two categories: dynamic and static analysis methods. Dynamic methods typically identify critical nodes by referencing transmission line faults and load changes, focusing on the evolution of operating parameters. For example, they construct cascading failure models to assess node vulnerability by simulating the interaction between transmission line overload and hidden faults; or they employ transient process coupling quantification methods to locate critical nodes by combining fault impact propagation paths. Static methods focus on topological characteristics, primarily based on graph theory methods, such as complex network centrality and electrical betweenness, which are used to characterize the structural importance of nodes, and characterize power flow path correlations through bus dependency matrices. In addition, hybrid methods attempt to integrate topological and electrical features to establish a multi-index evaluation system.
[0004] Dynamic analysis methods identify critical nodes from the perspective of power grid operation characteristics. However, they not only ignore the inherent topology but also rely excessively on pre-defined fault scenarios. For example, cascading failure models require pre-defined N-1 / N-2 fault sets, placing high demands on the user's domain knowledge. Furthermore, the models have weak generalizability when facing dynamic network topologies. Static methods, on the other hand, lack the ability to model heterogeneous graphs. Traditional complex network indices simplify transmission lines and transformers into homogeneous edges, leading to errors in the calculation of electrical connection weights. In addition, if a black-box model is used to identify critical nodes, the results lack the ability to trace topological relationships. Although it can output the ranking of node importance, it cannot explain why a particular node is identified as critical, lacking interpretability. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for identifying critical assets in power grids based on heterogeneous graph neural networks. Using power system networks as the application scenario, this invention constructs a heterogeneous graph model of the power system to achieve multi-level coupled modeling of the topology and electrical characteristics of heterogeneous equipment in the power grid. This solves the problems of existing dynamic methods relying too heavily on pre-set fault scenarios, static methods lacking sufficient heterogeneous graph modeling capabilities, and traditional black-box models having poor interpretability. Through adaptive frequency domain graph transformation, cross-view comparative learning, and gradient propagation mechanisms, the accuracy of critical node identification and topology correlation tracing capabilities are improved, achieving a high identification accuracy rate and providing a reliable basis for power grid security protection.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] A method for identifying key power grid assets based on heterogeneous graph neural networks includes the following steps:
[0008] Step 1: Preprocessing and heterogeneous graph modeling of power grid operation data; collect power grid operation data and perform structured modeling, complete the data normalization and standardization of nodes and edges, and map power grid equipment and its physical and logical relationships into a heterogeneous graph with multiple types of nodes and multiple types of edges;
[0009] Specifically, this involves collecting power grid operation data, abstracting generators, loads, and buses as graph nodes from the collected data, and abstracting the connections between different nodes through transmission lines and transformers as edges, and then establishing a heterogeneous graph. ,in This represents the set of generation nodes and load nodes. This represents a set of transmission lines and transformer lines. The power system node parameters are converted into numerical feature vectors by filling missing values with the mean and standardization. Then, logarithmic transformation is used to construct edge features from resistance, reactance, inter-bus susceptance, and turns ratio. Finally, these features are encapsulated into a HeteroData object for further learning and training.
[0010] Step 2: Design an adaptive frequency domain graph transformation network to generate a meta-path adjacency matrix, perform learnable topological pattern filtering in the frequency domain, learn features and model higher-order relationships for different types of nodes and edges, fuse different types of topological relationships, and capture higher-order composite structure features.
[0011] Step 2.1: Based on a learnable weight mechanism, multiple predefined adjacency relationships are dynamically fused to generate a meta-path adjacency matrix that reflects higher-order semantics. This matrix is composed of multiple consecutive graph transformation layers. Each layer is responsible for learning a new composite adjacency matrix from the adjacency matrix obtained from the previous layer, representing a longer meta-path. Different edge types are automatically learned and combined to generate meta-paths that represent new semantic relationships, thereby transforming the original heterogeneous graph into multiple homogeneous graphs containing higher-order semantics.
[0012] Specifically, K predefined adjacency matrices are selected, where K is the number of edge types. Each graph transformation layer generates a new adjacency matrix through learnable weights.
[0013] ;
[0014] in, This represents the adjacency matrix for the k-th edge type. Let N be an N×N matrix over the real number field, where N is the total number of nodes in the heterogeneous graph; This is a 1×1 convolution kernel operation with K input channels and C output channels, which is the set hyperparameter. This represents the weight of the adjacency matrix of the l-th layer for the k-th edge type. The normalization function is used to convert the original weights into attention weights in probability distribution form, ensuring that the sum of the weights for all edge types is 1; then, a weighted aggregation is performed on the normalized adjacency matrix:
[0015] ;
[0016] in, For the first The weighted adjacency matrix after layer fusion It is a symmetric normalized adjacency matrix. for The degree matrix is defined as follows: ,in, For node indexing, For nodes Connected neighbor node index, This represents the weight of the adjacency matrix of the l-th layer with respect to the k-th edge type; then, a higher-order path adjacency matrix is generated by stacking multiple layers of adjacency relationships through matrix multiplication.
[0017] ;
[0018] Among them, the output Let L be the path adjacency matrix;
[0019] Step 2.2: For the meta-path adjacency matrix obtained from each graph transformation layer, design a learnable filter in the frequency domain to dynamically adjust the propagation weights of different frequency components and retain the topological patterns that are sensitive to the identification of key assets.
[0020] First, calculate the symmetric normalized Laplace matrix:
[0021] ;
[0022] in, for The degree matrix; The identity matrix is used; further decompose the Laplacian matrix and transform the nodal features to the frequency domain:
[0023] ;
[0024] in, The matrix consists of orthogonal eigenvectors. The diagonalized eigenvalue matrix represents the frequency components of the graph signal;
[0025] Node features Projected into the frequency domain:
[0026] ;
[0027] Then a learnable frequency domain filter is used. Controlling the weights of each frequency component:
[0028] ;
[0029] in, Let the filter order be . For the filter number The learnable parameter matrix corresponding to the order;
[0030] The frequency domain characteristics after filtering are:
[0031] ;
[0032] in The frequency domain characteristics after filtering. This is a frequency domain filter function; the spatial domain characteristics are then recovered through an inverse transform.
[0033] ;
[0034] Finally, residual connectivity and nonlinear activation are introduced to update node embeddings:
[0035] ;
[0036] in, For trainable weight matrix, The function is a non-linear activation function, and LayerNorm is a layer normalization operation; this yields node embeddings with frequency domain enhancement. ;
[0037] The weights of the adjacency matrix for the k-th edge type are applied through the l-th graph transformation layer. To achieve end-to-end learning of edge type weights and adapt to different power grid topologies, the first step is to achieve this through the second step. Order-order learnable parameter matrix Parametric filters capture low-frequency global topology and high-frequency local disturbance patterns to further learn the characteristics of the power grid topology.
[0038] Step 3: Employ a cross-view contrastive learning method to construct a pattern view and a meta-path view, calculate the cross-view contrastive loss, and enhance the model's ability to identify key nodes through multiple semantic perspectives.
[0039] Step 3.1: Construct the schema view and the meta-path view;
[0040] Constructing a modal view involves: First, calculating each neighbor type. Internal neighbor nodes For the target node Hierarchical importance weight :
[0041] ;
[0042] in, These are the nodes at the initial input. and of 3D feature vectors For the learnable parameter vector, exp() is the exponential function, LeakyReLU() is the activation function, introducing non-linearity, and the type-specific embedding is obtained by aggregating type neighbor information from nodes:
[0043] ;
[0044] Constructing the meta-path view involves: First, obtaining the adjacency matrix. As a graph structure, an attention mechanism is used to fuse the adjacency matrices of different layers to obtain semantic importance weights. The global feature representation of the corresponding graph transformation layer path is mapped to scalar weights through a multilayer perceptron (MLP), and then normalized using Softmax.
[0045] ;
[0046] In this process, MLP() learns the contribution of different meta-paths to downstream tasks. It is a two-layer fully connected network with GELU activation; This means taking the mean of the node feature matrices along the node dimension to obtain the global feature representation of the corresponding graph transformation layer:
[0047] ;
[0048] Step 3.2: Construct a dual-view encoding module to extract semantic information of nodes in different views through dual-channel graph convolution, preserving fine-grained associations between topology and features; specifically including a pattern view encoding module and a meta-path view encoding module;
[0049] The pattern view encoding module is based on a comprehensive adjacency matrix. A residual graph convolutional network is used to capture global topological features and obtain node embedding representations of the network view. :
[0050] ;
[0051] in, It is by Symmetric normalization yields, for Apply GCN; The learnable weight matrix of the graph convolutional layer. The learnable weight matrix is for the residual connection;
[0052] The meta-path view encoding module captures long-range meta-path dependencies through multi-hop information propagation and adaptive jump connections.
[0053] ;
[0054] A multi-order adjacency matrix is used to capture long-range dependencies, where, , The k-th layer weight matrix is used, and then multi-hop information is aggregated through skipping. A multilayer perceptron (MLP) is then used to generate the k-th layer weight matrix. Jump weights:
[0055] ;
[0056] Among them, multilayer perceptron Map it to a scalar score. Indicates the first The importance weight of the jump propagation results in the final embedding. This yields the node embedding representation of the meta-path view. :
[0057] ;
[0058] Step 3.3: Through cross-view comparative learning, maximize the similarity of positive sample pairs, suppress negative sample pairs, and enhance the ability to identify key nodes. Positive sample pairs refer to the same node. Embedding in two views and Negative sample pairs are pairs of different nodes across views. The loss function is as follows, where, Temperature parameter:
[0059] ;
[0060] Step 4: Introduce a gradient-based interpretability mechanism to record the adjacency matrix and filter function values generated at each layer. Analyze the importance of nodes through gradient evaluation to achieve efficient screening of key assets.
[0061] The gradient-based interpretability mechanism specifically involves: during backpropagation of the contrastive learning loss function, tracking the adjacency matrix generated by each graph transformation layer. The gradient of the filter, the magnitude of which reflects the sensitivity of matrix elements to changes in loss:
[0062] , ;
[0063] in, This represents the partial derivative of the loss with respect to the elements of the adjacency matrix. This represents the partial derivative of the loss with respect to the filter response.
[0064] The beneficial effects of adopting the above technical solution are as follows:
[0065] This invention provides a method for identifying key assets in a power grid based on heterogeneous graph neural networks, which has the following beneficial technical effects:
[0066] (1) This invention constructs a heterogeneous graph model of the power system, which breaks through the limitation of the traditional method of simplifying heterogeneous edges such as transmission lines and transformers into homogeneous connections. By encoding node types and modeling the relationship between multiple edge types, it realizes the differentiated feature expression of power generation, load and bus nodes, and solves the problem of topology modeling deviation in static methods.
[0067] (2) An adaptive frequency domain graph transformation network is proposed. It generates high-order element paths by dynamically fusing multiple connection relationships such as lines and transformers through learnable attention. Combined with the frequency domain filtering module, it selects key topology patterns, effectively captures the long-range dependence characteristics of the power grid, avoids the dependence of dynamic methods on preset fault scenarios, and significantly improves the generalization ability under complex topologies.
[0068] (3) A cross-view comparison learning framework was designed. The semantic comparison between the network pattern view and the meta-path view enhances the distinguishability of node representations. The gradient backpropagation mechanism is combined to quantify the contribution weights of the adjacency matrix and the frequency filter. While outputting the ranking of key nodes, it provides multi-dimensional interpretable evidence of topological association paths and electrical sensitive frequency bands, thus solving the problem of difficult decision tracing in traditional black box models. Attached Figure Description
[0069] Figure 1 The flowchart below illustrates a method for identifying key power grid assets based on heterogeneous graph neural networks, according to an embodiment of the present invention.
[0070] Figure 2 This is an overall architecture diagram of a method for identifying key power grid assets based on heterogeneous graph neural networks, according to an embodiment of the present invention. Detailed Implementation
[0071] The specific implementation methods of this application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0072] Example 1:
[0073] A method for identifying key power grid assets based on heterogeneous graph neural networks, such as Figure 1 The diagram shown is a flowchart illustrating a specific implementation of the power grid critical asset identification method based on a heterogeneous graph neural network according to the present invention. Figure 2 This is the overall architecture diagram of the method of the present invention, which includes the following steps:
[0074] Step 1: Preprocessing and heterogeneous graph modeling of power grid operation data; collect power grid operation data and perform structured modeling, complete the data normalization and standardization of nodes and edges, and map power grid equipment and its physical and logical relationships into a heterogeneous graph with multiple types of nodes and multiple types of edges;
[0075] Specifically, this involves collecting power grid operation data, abstracting generators, loads, and buses as graph nodes from the collected data, and abstracting the connections between different nodes through transmission lines and transformers as edges, and then establishing a heterogeneous graph. ,in This represents the set of generation nodes and load nodes. This represents a set of transmission lines and transformer lines. The power system node parameters are converted into numerical feature vectors by filling missing values with the mean and standardization. Then, logarithmic transformation is used to construct edge features from resistance, reactance, inter-bus susceptance, and turns ratio. Finally, these features are encapsulated into a HeteroData object for further learning and training.
[0076] In this embodiment, the raw data of the IEEE 118 power system network is stored in MATPOWER format, containing three types of entity data: bus, generator, and branch. First, identifiers in the text are identified using regular expressions, and the data is segmented into independent data blocks. The Pandas library is used to perform structured parsing on each data block. For example, for bus data, fields such as BUS_ID (bus number), TYPE (bus type, 1 for slack bus, 2 for generator bus, 3 for load bus), Vm (voltage amplitude), Va (voltage phase angle), Pd (active load), and Qd (reactive load) are extracted to generate a bus feature matrix.
[0077] The heterogeneous network of power grid data contains three types of nodes and three types of edges:
[0078] The first type is the bus node, where each bus corresponds to one node, and its characteristics include Vm, Va, Pd, Qd, and TYPE encoding. The second type is the generator node, where each generator is an independent node, and its characteristics include Pg, Qg, and output limits. The third type is the load node, created only when there is a load on the bus (Pd > 0), and its characteristics are consistent with the bus's Pd and Qd.
[0079] The three types of edges are physical connections and membership relationships: busbar connections are defined by branch data and are characterized by R, X, B, and RATE, reflecting the electrical parameters of the line; generator-busbar membership edges and load-busbar membership edges are determined by the generator connection relationship and the load node affiliation relationship.
[0080] Then, in order to enable features of different magnitudes to be computed, the features need to be standardized:
[0081] ;
[0082] After normalization, After preprocessing, all features are standardized to similar numerical ranges while preserving the physical characteristics of the power grid equipment. The structured data is then encapsulated into a PyTorch Geometric HeteroData object, containing the feature matrix. Adjacency matrix There are 118 nodes and 3 types of edges.
[0083] Step 2: Design an adaptive frequency domain graph transformation network to generate a meta-path adjacency matrix, perform learnable topological pattern filtering in the frequency domain, learn features and model higher-order relationships for different types of nodes and edges, fuse different types of topological relationships, and capture higher-order composite structure features.
[0084] Step 2.1: Based on a learnable weight mechanism, multiple predefined adjacency relationships are dynamically fused to generate a meta-path adjacency matrix that reflects higher-order semantics. This matrix is composed of multiple consecutive graph transformation layers. Each layer is responsible for learning a new composite adjacency matrix from the adjacency matrix obtained from the previous layer, representing a longer meta-path. Different edge types are automatically learned and combined to generate meta-paths that represent new semantic relationships, thereby transforming the original heterogeneous graph into multiple homogeneous graphs containing higher-order semantics.
[0085] Specifically, K predefined adjacency matrices are selected, where K is the number of edge types. Each graph transformation layer generates a new adjacency matrix through learnable weights.
[0086] ;
[0087] in, This represents the adjacency matrix for the k-th edge type. Let N be an N×N matrix over the real number field, where N is the total number of nodes in the heterogeneous graph; For a 1×1 convolution kernel operation, the number of input channels is K, and the number of output channels is the set hyperparameter C, indicating that the corresponding graph transformation layer will learn C different weights in parallel; This represents the weight of the adjacency matrix of the l-th layer for the k-th edge type. The normalization function is used to convert the original weights into attention weights in the form of a probability distribution, ensuring that the sum of the weights of all edge types is 1; then, the normalized adjacency matrix is weighted and aggregated.
[0088] ;
[0089] in, For the first The weighted adjacency matrix after layer fusion It is a symmetric normalized adjacency matrix. for The degree matrix is defined as follows: ,in, For node indexing, For nodes Connected neighbor node index, This represents the weight of the adjacency matrix of the l-th layer with respect to the k-th edge type; then, a higher-order path adjacency matrix is generated by stacking multiple layers of adjacency relationships through matrix multiplication.
[0090] ;
[0091] Among them, the output The path adjacency matrix is of order L, retaining intermediate variables. Used for gradient evaluation; intermediate variables are used for easier parameter description later. Also use express.
[0092] Step 2.2: For the meta-path adjacency matrix obtained from each graph transformation layer, design a learnable filter in the frequency domain to dynamically adjust the propagation weights of different frequency components and retain the topological patterns that are sensitive to the identification of key assets.
[0093] First, calculate the symmetric normalized Laplace matrix:
[0094] ;
[0095] in, for The degree matrix; The identity matrix is used; further decompose the Laplacian matrix and transform the nodal features to the frequency domain:
[0096] ;
[0097] in, The matrix consists of orthogonal eigenvectors. The diagonalized eigenvalue matrix represents the frequency components of the graph signal;
[0098] Node features Projected into the frequency domain:
[0099] ;
[0100] Then a learnable frequency domain filter is used. Controlling the weights of each frequency component:
[0101] ;
[0102] in, Let be the filter order. This function can be optimized through gradient descent to achieve adaptive preservation of key topological patterns. For the filter number The learnable parameter matrix corresponding to the layer level is used to adjust the response intensity of different frequency channels;
[0103] The frequency domain characteristics after filtering are:
[0104] ;
[0105] in The frequency domain characteristics after filtering. This is a frequency domain filter function; the spatial domain characteristics are then recovered through an inverse transform.
[0106] ;
[0107] Finally, residual connectivity and nonlinear activation are introduced to update node embeddings:
[0108] ;
[0109] in, For trainable weight matrix, The function is a non-linear activation function, and LayerNorm is a layer normalization operation; this yields node embeddings with frequency domain enhancement. ;
[0110] The weights of the adjacency matrix for the k-th edge type are applied through the l-th graph transformation layer. To achieve end-to-end learning of edge type weights and adapt to different power grid topologies, the first step is to achieve this through the second step. Order-order learnable parameter matrix Parametric filters capture low-frequency global topology and high-frequency local disturbance patterns to further learn the characteristics of the power grid topology.
[0111] This example uses a heterogeneous graph neural network to process the constructed heterogeneous graph. By dynamically fusing multiple types of power grid topology relationships and selecting key frequency components in the frequency domain, it achieves hierarchical representation learning of the embedded power grid nodes. Considering the differences between various types of nodes, such as the different weights of the influence of buses and generators on system stability, this invention designs an adaptive frequency domain graph transformation network layer, the technical implementation process of which is as follows:
[0112] For various predefined edge types (including inter-bus line connections, generator-bus connections, and load-bus attachments) in the heterogeneous graph of the power grid, an initial adjacency matrix set is constructed. ,in Indicates the first Class connection relationship (e.g.) For line connection, For generator connection, among which, By dynamically fusing different edge types using learnable weights, a higher-order semantic meta-path adjacency matrix is generated.
[0113] ;
[0114] in For the first Layer to the first The weight of the edge class, and This is a normalized adjacency matrix. The process extracts global statistical features of edge types through 1D convolution kernels, enabling the model to autonomously strengthen its focus on key connection patterns (such as trunk transmission channels and important power access points).
[0115] Stacking Layered networks generate higher-order metapath adjacency matrices: ;
[0116] This matrix encodes multi-hop relationships between devices (such as composite paths like "generator-bus-line-load"), reflecting potential vulnerabilities in power transmission paths. For example, when a certain meta-path consistently receives a high weight in multi-layer calculations, it indicates that its corresponding topology combination has a significant impact on the entire system and represents a critical line or node.
[0117] The metapath adjacency matrix Convert to a Graph Laplace matrix And perform eigenvalue decomposition to obtain the frequency domain basis. and eigenvalue diagonal matrix Among them, the eigenvalues Corresponding to different oscillation modes of the power grid, the low-frequency component (small) This reflects the overall power fluctuation between regions, with high-frequency components (large) It characterizes rapid disturbances in local devices.
[0118] Node features Perform Fourier transform:
[0119] ;
[0120] By designing a learnable frequency domain response function Selective enhancement of the spectrum, where For the first The layer's filter coefficient vector. This function can suppress high-frequency noise components while preserving crucial low-frequency oscillation information.
[0121] Inverse transform back to the spatial domain yields the filtered node features:
[0122] ;
[0123] This feature integrates the global dynamic characteristics of the power grid with local topological constraints, enabling key nodes to exhibit significant distinguishability in the embedded space.
[0124] To avoid information loss in deep networks, residual connections are used to fuse the original electrical quantity characteristics with the filtered output:
[0125] ;
[0126] in It is a linear transformation matrix. This is the GELU activation function. Through multi-layer stacking, node embedding gradually aggregates topological semantic information of different granularities—the bottom layer captures the direct coupling relationship between devices (such as the power balance between the generator and the access bus), and the top layer extracts indirect cross-regional correlations (such as the power transmission corridor formed by multiple parallel lines).
[0127] Final output node embedding matrix Each row vector encodes the corresponding equipment's functional importance, structural criticality, and dynamic vulnerability in the power grid, providing a differentiated representation basis for subsequent identification of key assets.
[0128] Step 3: Employ a cross-view contrastive learning method to construct a pattern view and a meta-path view, calculate the cross-view contrastive loss, and enhance the model's ability to identify key nodes through multiple semantic perspectives.
[0129] Step 3.1: Construct the schema view and the meta-path view;
[0130] Constructing a modal view involves: First, calculating each neighbor type. Internal neighbor nodes For the target node Hierarchical importance weight :
[0131] ;
[0132] in, These are the nodes at the initial input. and of 3D feature vectors The learnable parameter vector is exp(), which is the exponential function used to construct the Softmax normalization. LeakyReLU() is the activation function that introduces non-linearity. The type-specific embedding is obtained by aggregating type neighbor information from nodes.
[0133] ;
[0134] It is also possible to dynamically aggregate higher-order topological relationships based on the semantic importance of metapaths to construct a metapath view; the construction of a metapath view specifically involves: first, obtaining the adjacency matrix. As a graph structure, it captures long-range, high-order, complex semantic dependencies. An attention mechanism is used to fuse adjacency matrices from different layers to obtain semantic importance weights. The global feature representation of the corresponding graph transformation layer path is mapped to scalar weights through a multilayer perceptron (MLP), and then normalized using Softmax.
[0135] ;
[0136] In this process, MLP() learns the contribution of different meta-paths to downstream tasks. It is a two-layer fully connected network with GELU activation; This means taking the mean of the node feature matrices along the node dimension to obtain the global feature representation of the corresponding graph transformation layer:
[0137] ;
[0138] Step 3.2: Construct a dual-view encoding module to extract semantic information of nodes in different views through dual-channel graph convolution, preserving fine-grained associations between topology and features; specifically including a pattern view encoding module and a meta-path view encoding module;
[0139] The pattern view encoding module is based on a comprehensive adjacency matrix. A residual graph convolutional network is used to capture global topological features and obtain node embedding representations of the network view. :
[0140] ;
[0141] in, It is by Symmetric normalization yields, for Apply GCN; The learnable weight matrix of the graph convolutional layer is used to map input features to a new space. This is a learnable weight matrix for residual connections, used to preserve the original feature information;
[0142] The meta-path view encoding module captures long-range meta-path dependencies through multi-hop information propagation and adaptive jump connections.
[0143] ;
[0144] A multi-order adjacency matrix is used to capture long-range dependencies, where, , The k-th layer weight matrix is used, and then multi-hop information is aggregated through skipping. A multilayer perceptron (MLP) is then used to generate the k-th layer weight matrix. Jump weights:
[0145] ;
[0146] Among them, multilayer perceptron Map it to a scalar score. Indicates the first The importance weight of the jump propagation results in the final embedding. This yields the node embedding representation of the meta-path view. :
[0147] ;
[0148] Step 3.3: Through cross-view comparative learning, maximize the similarity of positive sample pairs, suppress negative sample pairs, and enhance the ability to identify key nodes. Positive sample pairs refer to the same node. Embedding in two views and Negative sample pairs are pairs of different nodes across views. The loss function is as follows, where, Temperature parameter:
[0149] ;
[0150] In this embodiment, for the node adjacency matrix and feature vector output by the heterogeneous graph neural network, this part constructs a network pattern view and a meta-path view of the power grid, and uses contrastive learning to capture the differences in the topological patterns of nodes under different semantics, thereby enhancing the ability to identify key assets (such as hub buses and vulnerable branches).
[0151] To address the complex correlation characteristics of heterogeneous power grid graphs, two complementary semantic views are constructed.
[0152] The sequence of meta-path adjacency matrices generated by the network pattern view synthesis multi-layer graph transformation network That is, the adaptive frequency map transform network layer mentioned above generates Through attention weights Dynamic aggregation:
[0153] ;
[0154] in The calculation combines the topological statistics and eigenvalues of the adjacency matrix, and the formula is as follows:
[0155] ;
[0156] in, Flatten the matrix into a vector. By averaging along the feature dimensions, this view enhances the physical connectivity patterns of the power grid, for example, when a certain layer... When corresponding to the transmission channel of "main line - hub bus", high The value indicates that this structure plays a decisive role in the stability of the system.
[0157] The meta-path view selects meta-path combinations with clear power system semantics (e.g., "generator → bus ← line → load"), and filters key paths through semantic-level attention:
[0158] ;
[0159] in The computation is performed using two layers of MLP, with features mapped to scalar weights via a multilayer perceptron (MLP), followed by Softmax normalization.
[0160] ;
[0161] This view captures the functional relationships between devices, such as height. The value may correspond to a power support mode in which "multiple generators are connected in parallel to the same bus".
[0162] Semantic information of nodes in different views is extracted by dual-channel graph convolution, preserving fine-grained associations between topology and features.
[0163] Network mode encoder After symmetric normalization, physical topological features are extracted through residual map convolution:
[0164] ;
[0165] ;
[0166] The meta-path encoder uses a multi-order adjacency matrix to capture long-range dependencies for each meta-path. Apply GCN independently, then fuse attention to perform multi-level feature propagation:
[0167] ;
[0168] ;
[0169] in Generated by feature adaptive weights, and finally passed Weighted fusion. This process enhances the consistency of representation of functionally related nodes, for example, by bringing generators and loads within the same power supply area closer together in the embedded space.
[0170] Finally, the representations of the same node in different views are selected as positive sample pairs, and different combinations of nodes in different views are selected as negative sample pairs. By maximizing the embedding similarity of the same node in different views, the model learns the essential features of cross-topology patterns of power grid nodes.
[0171] Positive sample pair: busbar In physical view With Function View Its characteristics reflect its dual attributes (such as being both a power transmission node and a load center).
[0172] Negative sample pairs: Combinations of different nodes across views, such as hub buses. With end load Embedded and pushed away.
[0173] The loss function is as follows:
[0174] ;
[0175] The goal of this step is to enable the model to capture common features across views, such as the topological centrality and functional centrality of hub buses, through multi-view semantic alignment, and to filter out as many differences as possible caused by occasional faults in a single line.
[0176] Step 4: Introduce a gradient-based interpretability mechanism to record the adjacency matrix and filter function values generated at each layer. Analyze the importance of nodes through gradient evaluation to achieve efficient screening of key assets.
[0177] The gradient-based interpretability mechanism specifically involves: during backpropagation of the contrastive learning loss function, tracking the adjacency matrix generated by each graph transformation layer. The gradient of the filter, the magnitude of which reflects the sensitivity of matrix elements to changes in loss:
[0178] , ;
[0179] in, This represents the absolute value of the partial derivative of the loss with respect to the elements of the adjacency matrix. This reflects the sensitivity of the matrix elements to changes in the final loss. This represents the partial derivative of the loss with respect to the filter response, reflecting the impact of different frequency components on the model's discriminative ability.
[0180] For each metapath, since both the filter and the metapath are included in the computation graph, the chain rule can be used to obtain each metapath and the gradients of different frequencies on the corresponding metapath reachable graph. This gradient information can not only help us obtain important assets, but also help us explain what kind of assets are important assets.
[0181] In this embodiment, during model training, the gradient information of the adjacency matrix and node features in the heterogeneous graph neural network is tracked through the backpropagation algorithm.
[0182] Cross-view contrast loss Regarding the metapath adjacency matrix Take the partial derivatives to obtain the topological sensitivity matrix:
[0183] ;
[0184] in Indicates busbar and The contribution of connectivity to the loss function. For example, when the absolute value of the gradient of a transmission line is large, it indicates that changes in its connectivity state will significantly affect the model's identification of key assets.
[0185] In summary, this invention proposes a method for identifying key power grid assets based on heterogeneous graph neural networks and cross-view comparative learning. Its core inventive points include:
[0186] 1. Heterogeneous graph dynamic modeling: Integrating the characteristics of multiple types of nodes such as buses, generators, and loads, as well as heterogeneous connection relationships such as lines and connections, to construct a multi-semantic topology expression of the power grid;
[0187] 2. Adaptive frequency domain graph filtering: Filters key oscillation modes of the power grid by using a learnable frequency domain response function, thereby enhancing the dynamic characteristics of vulnerable nodes;
[0188] 3. Gradient interpretability analysis: Highly sensitive devices are located using the inverse gradient of contrastive loss to identify key assets.
[0189] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0190] The scope of protection of this application is not limited to the embodiments described above. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from the scope and spirit of this disclosure. If such modifications and variations fall within the scope of the methods disclosed herein and their equivalents, then the intent of this disclosure also includes such modifications and variations.
Claims
1. A method for identifying key assets in a power grid based on heterogeneous graph neural networks, characterized in that, Includes the following steps: Step 1: Preprocessing and heterogeneous graph modeling of power grid operation data; Data on power grid operation is collected and structured modeled. Data normalization and standardization of nodes and edges are completed, and power grid equipment and its physical and logical relationships are mapped into a heterogeneous graph with multiple types of nodes and edges. Step 2: Design an adaptive frequency domain graph transformation network to generate a meta-path adjacency matrix, perform learnable topological pattern filtering in the frequency domain, learn features and model higher-order relationships for different types of nodes and edges, fuse different types of topological relationships, and capture higher-order composite structure features. Step 3: Employ a cross-view contrastive learning method to construct a pattern view and a meta-path view, calculate the cross-view contrastive loss, and enhance the model's ability to identify key nodes through multiple semantic perspectives. Step 4: Introduce a gradient-based interpretability mechanism to record the adjacency matrix and filter function values generated at each layer. Analyze the importance of nodes through gradient evaluation to achieve efficient screening of key assets.
2. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 1, characterized in that, Step 1 specifically involves: collecting power grid operation data; abstracting generators, loads, and buses as graph nodes from the collected data; abstracting the connections between different nodes via transmission lines and transformers as edges; and establishing a heterogeneous graph. ,in This represents the set of generation nodes and load nodes. It represents a set of transmission lines and transformer lines; by filling missing values with mean and standardizing, the power system node parameters are converted into numerical feature vectors, and then resistance, reactance, inter-bus susceptance, and turns ratio are constructed into edge features through logarithmic transformation, and finally encapsulated into a HeteroData object for further learning and training.
3. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 1, characterized in that, Step 2 includes the following steps: Step 2.1: Based on a learnable weight mechanism, multiple predefined adjacency relationships are dynamically fused to generate a meta-path adjacency matrix that reflects higher-order semantics. This matrix is composed of multiple consecutive graph transformation layers. Each layer is responsible for learning a new composite adjacency matrix from the adjacency matrix obtained from the previous layer, representing a longer meta-path. Different edge types are automatically learned and combined to generate meta-paths that represent new semantic relationships, thereby transforming the original heterogeneous graph into multiple homogeneous graphs containing higher-order semantics. Step 2.2: For the meta-path adjacency matrix obtained from each graph transformation layer, design a learnable filter in the frequency domain to dynamically adjust the propagation weights of different frequency components and retain the topological patterns that are sensitive to the identification of key assets.
4. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 3, characterized in that, Specifically, step 2.1 involves selecting from K predefined adjacency matrices, where K is the number of edge types. Each graph transformation layer generates a new adjacency matrix using learnable weights. ; in, This represents the adjacency matrix for the k-th edge type. Let N be an N×N matrix over the real number field, where N is the total number of nodes in the heterogeneous graph; This is a 1×1 convolution kernel operation with K input channels and C output channels, which is the set hyperparameter. This represents the weight of the adjacency matrix of the l-th layer for the k-th edge type. The normalization function is used to convert the original weights into attention weights in probability distribution form, ensuring that the sum of the weights for all edge types is 1; then, a weighted aggregation is performed on the normalized adjacency matrix: ; in, For the first The weighted adjacency matrix after layer fusion It is a symmetric normalized adjacency matrix. for The degree matrix is defined as follows: ,in, For node indexing, For nodes Connected neighbor node index, This represents the weight of the adjacency matrix of the l-th layer with respect to the k-th edge type; then, a higher-order path adjacency matrix is generated by stacking multiple layers of adjacency relationships through matrix multiplication. ; Among them, the output Let be the L-order element path adjacency matrix.
5. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 4, characterized in that, Step 2.2 first calculates the symmetric normalized Laplace matrix: ; in, for The degree matrix; The identity matrix is used; further decompose the Laplacian matrix and transform the nodal features to the frequency domain: ; in, The matrix consists of orthogonal eigenvectors. The diagonalized eigenvalue matrix represents the frequency components of the graph signal; Node features Projected into the frequency domain: ; Then a learnable frequency domain filter is used. Controlling the weights of each frequency component: ; in, Let the filter order be . For the filter number The learnable parameter matrix corresponding to the order; The frequency domain characteristics after filtering are: ; in The frequency domain characteristics after filtering. This is a frequency domain filter function; the spatial domain characteristics are then recovered through an inverse transform. ; Finally, residual connectivity and nonlinear activation are introduced to update node embeddings: ; in, For trainable weight matrix, The function is a non-linear activation function, and LayerNorm is a layer normalization operation; this yields node embeddings with frequency domain enhancement. ; The weights of the adjacency matrix for the k-th edge type are applied through the l-th graph transformation layer. To achieve end-to-end learning of edge type weights and adapt to different power grid topologies, the first step is to achieve this through the second step. Order-order learnable parameter matrix Parametric filters capture low-frequency global topology and high-frequency local disturbance patterns, further learning the characteristics of the power grid topology.
6. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 3.1: Construct the schema view and the meta-path view; Constructing a modal view involves: First, calculating each neighbor type. Internal neighbor nodes For the target node Hierarchical importance weight : ; in, These are the nodes at the initial input. and of 3D feature vectors For the learnable parameter vector, exp() is the exponential function, LeakyReLU() is the activation function, introducing non-linearity, and the type-specific embedding is obtained by aggregating type neighbor information from nodes: ; Constructing the meta-path view involves: First, obtaining the adjacency matrix. As a graph structure, an attention mechanism is used to fuse the adjacency matrices of different layers to obtain semantic importance weights. The global feature representation of the corresponding graph transformation layer path is mapped to scalar weights through a multilayer perceptron (MLP), and then normalized using Softmax. ; In this process, MLP() learns the contribution of different meta-paths to downstream tasks. It is a two-layer fully connected network with GELU activation; This means taking the mean of the node feature matrices along the node dimension to obtain the global feature representation of the corresponding graph transformation layer: ; Step 3.2: Construct a dual-view encoding module to extract semantic information of nodes in different views through dual-channel graph convolution, preserving fine-grained associations between topology and features; specifically including a pattern view encoding module and a meta-path view encoding module; The pattern view encoding module is based on a comprehensive adjacency matrix. A residual graph convolutional network is used to capture global topological features and obtain node embedding representations of the network view. : ; in, It is by Symmetric normalization yields, for Apply GCN; The learnable weight matrix of the graph convolutional layer. The learnable weight matrix is for the residual connection; The meta-path view encoding module captures long-range meta-path dependencies through multi-hop information propagation and adaptive jump connections. ; A multi-order adjacency matrix is used to capture long-range dependencies, where, , The k-th layer weight matrix is used, and then multi-hop information is aggregated through skipping. A multilayer perceptron (MLP) is then used to generate the k-th layer weight matrix. Jump weights: ; Among them, multilayer perceptron Map it to a scalar score. Indicates the first The importance weight of the jump propagation results in the final embedding; obtaining the node embedding representation of the meta-path view. : ; Step 3.3: Through cross-view comparative learning, maximize the similarity of positive sample pairs, suppress negative sample pairs, and enhance the ability to identify key nodes; where positive sample pairs are the same node. Embedding in two views and Negative sample pairs are pairs of different nodes across views. The loss function is as follows, where, Temperature parameter: 。 7. The method for identifying key power grid assets based on heterogeneous graph neural networks according to claim 6, characterized in that, The gradient-based interpretability mechanism described in step 4 specifically involves: during backpropagation of the contrastive learning loss function, tracking the adjacency matrix generated by each graph transformation layer. The gradient of the filter, the magnitude of which reflects the sensitivity of matrix elements to changes in loss: , ; in, This represents the partial derivative of the loss with respect to the elements of the adjacency matrix. This represents the partial derivative of the loss with respect to the filter response.