A method for detecting critical nodes in a power grid cascade fault based on intermediary centrality

By constructing a heterogeneous graph and assigning weights to different transmission sub-modes, the CBC value of the critical node in a cascading power grid fault is calculated, solving the problem of the inability to identify critical nodes in a heterogeneous graph and realizing the ability to quickly identify cascading power grid faults.

CN116643119BActive Publication Date: 2026-07-17SHANDONG UNIV +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2023-05-24
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies cannot directly use betweenness centrality to identify critical nodes in heterogeneous graphs of power networks, making it difficult to prevent large-scale cascading failures.

Method used

Construct a heterogeneous graph, define the transmission method between vertices of the same type through metapaths, assign weights to different transmission sub-methods, calculate the CBC value of vertices in the heterogeneous graph, and identify key nodes of cascaded power grid faults.

Benefits of technology

A method is provided to accurately calculate the vertex CBC value in heterogeneous graphs, quickly identify critical nodes of cascaded faults in power grids, improve identification efficiency, and is applicable to large-scale power networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116643119B_ABST
    Figure CN116643119B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of data mining technology, and specifically relates to a method for detecting critical nodes in cascading power grid faults based on betweenness centrality. The method includes: constructing a heterogeneous graph of numerous entities of different categories and their transmission relationships in a power network; selecting meta-paths as the transmission methods between vertices in the heterogeneous graph; classifying the transmission methods of the same type of vertices within the meta-paths into multiple transmission sub-methods based on the different influences of other types of vertices on the transmission methods between the same type of vertices; calculating the betweenness centrality (CBC) of the vertices in the heterogeneous graph, used to identify critical nodes in cascading power grid faults; and selecting the k vertices with the largest CBC values ​​in the heterogeneous graph as critical nodes in cascading power grid faults. The algorithm proposed in this invention can calculate the accurate CBC values ​​of all vertices in the heterogeneous graph and identify critical nodes in cascading power grid faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data mining technology, and specifically relates to a method for detecting critical nodes in cascaded power grid faults based on intermediary centrality. Background Technology

[0002] In the real world, various entities and relationships between them can typically be represented using a graph data structure. Entities are usually abstracted as vertices, and relationships between them as edges. Heterogeneous graphs contain multiple categories of vertices and edges.

[0003] Power networks contain various types of entities, such as power plants, step-up transformers, step-down transformers, power cables, residential users, and enterprise users, as well as various relationships in current transmission between these entities. Heterogeneous graphs can accurately and comprehensively model the complex information in power networks, so the analysis and research of heterogeneous graphs have important theoretical value and practical significance.

[0004] Identifying key vertices in a graph has always been a key research problem. Various metrics exist to measure vertex importance from different perspectives, such as degree centrality, proximity centrality, betweenness centrality, and feature centrality. Among these, betweenness centrality (BC value) measures a vertex's influence on the ability to transmit information between vertices in the graph. It considers the shortest paths between all vertices and is a global metric. The betweenness centrality value of a vertex is defined as the sum of probabilities of the shortest paths passing through that vertex among all pairs of vertices in the graph. Therefore, betweenness centrality measures a vertex's ability to act as an information transmission medium (i.e., a bridge) in the graph, and is used to identify such bridges between entities.

[0005] Maintaining the stable operation of power networks is crucial in power systems. For example, power flow calculations can determine the steady-state operating parameters of various parts of the power system. Identifying critical components in the power network that are prone to large-scale cascading failures can help prevent widespread power system collapses. Furthermore, betweenness centrality can be used to find critical nodes that are likely to cause large-scale cascading failures. Power networks can be modeled as heterogeneous graphs. However, in heterogeneous graphs, direct transmission between vertices of the same type is not possible. Therefore, transmission is usually achieved through vertices of other types, and the transmission method can be specified through metapaths.

[0006] In the transmission methods of the same type of vertex, vertices of other types have different effects on this transmission method, resulting in the same transmission method containing multiple transmission sub-methods with different influences. Therefore, it is not possible to directly use the betweenness centrality defined on the isomorphic graph to measure the ability of vertices in the heterogeneous graph to act as transmission bridges and to find transmission bridges in the heterogeneous graph. In other words, it is not possible to directly use the betweenness centrality defined on the isomorphic graph to identify key nodes in the power network that are prone to large-scale cascading failures. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention provides a method for detecting critical nodes in a power grid cascade fault based on intermediary centrality.

[0008] This invention is achieved through the following technical solution:

[0009] A method for detecting critical nodes in a cascaded power grid fault based on intermediation centrality, the method comprising the following steps:

[0010] S1. Construct a heterogeneous graph for the many different types of entities in the power network and the transmission relationships between them;

[0011] S2. Select a meta-path in the heterogeneous graph. Specify the transmission method between vertices of the same type; in the metapath Among the specified transmission methods for vertices of the same type, select a different type of vertex, and each vertex in the selected vertex type corresponds to a transmission sub-method;

[0012] The heterogeneous betweenness centrality (CBC) of any vertex v in the heterogeneous graph is defined as: the metapath in the heterogeneous graph... The sum of probabilities of passing through vertex v in the shortest path between all vertex pairs of the same type at both ends, based on the transport sub-mode weight; the betweenness centrality (CBC) value of vertex v is used to measure the ability of vertex v to act as a transport bridge between entities.

[0013] S3. Calculate the CBC value of the vertices in the heterogeneous graph to identify critical nodes in the power grid cascade fault;

[0014] S4. Select several vertices with the largest CBC values ​​in the heterogeneous graph as critical nodes for power grid cascade faults.

[0015] Further, in step S1, the constructed heterogeneous graph is as follows: ;

[0016] in, It is a set of vertices. It is a set of edges. It is a set of vertex categories. It is a set of edge categories. It defines the mapping from each vertex to its corresponding vertex class. The mapping from each edge to its corresponding edge category is defined;

[0017] Use heterogeneous graph pattern This represents the vertex category in the heterogeneous graph and the category of the edge between the vertex categories.

[0018] Power networks comprise various types of entities, including power plants, step-up transformers, step-down transformers, and circuit breakers. Therefore, a heterogeneous graph model is constructed to represent the power network, where vertices represent entities and edges represent the transmission relationships between entities. The heterogeneous graph model is a directed graph that stores all vertex categories in the heterogeneous graph and the categories of edges between these vertex categories.

[0019] Furthermore, in step S2, the heterogeneous graph mode is adopted. The path on the graph, i.e., the heterogeneous graph Metapath This specifies the transmission method between vertices.

[0020] Furthermore, in step S3, the method for calculating the CBC value of the vertices in the heterogeneous graph is one of the following three methods:

[0021] (1) Calculate the CBC value of all vertices in the heterogeneous graph using the basic algorithm;

[0022] (2) An optimization strategy of merging similar vertex calculation processes is adopted to accelerate the calculation of vertex CBC values;

[0023] (3) An optimization strategy of directly merging identical vertices is adopted to accelerate the calculation of the CBC value of vertices.

[0024] Furthermore, the method for calculating the CBC value of all vertices in the heterogeneous graph using the basic algorithm is as follows:

[0025] S3.1. Initialize the CBC value of each vertex in the heterogeneous graph to 0 and store it in the CBC array;

[0026] S3.2. Traverse each vertex in the heterogeneous graph and calculate the CBC value of each vertex. The specific steps are as follows:

[0027] S3.2.1. Using any meta-path in the heterogeneous graph The vertex of the endpoint category is the source vertex s. A breadth-first search is performed. The set stores the predecessor vertices of vertex v, where vertex v is the meta-path from the source vertex s in the heterogeneous graph. The path instance connects to other vertices; Represent the set of preceding vertices of vertex v in the breadth-first search process; calculate the number of shortest paths from source vertex s to vertex v based on the transport submethod. , The specific calculation steps are as follows:

[0028] S3.2.1.1. Calculate the weight of edge (u,v) based on the transport sub-method weight. :

[0029] = × ;

[0030] In the formula, for: The metapath selected in S2 It specifies the transmission method between vertices of the same type, where s is the source vertex mentioned above; based on metapaths. The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission mode; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0031] S3.2.1.2. According to the formula renew ;

[0032] This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from source point s to vertex u based on transport sub-methods;

[0033] Calculation method and same, In the calculation formula, u and v represent vertices with a parent-child relationship during the breadth-first search process, that is, vertex u is the predecessor vertex of vertex v; in the calculation At that time, Replace v with u in the formula, and replace u with the preceding vertex of u, that is, the vertex in pred(u);

[0034] S3.2.2. Traverse the vertices in reverse order of visiting vertices during breadth-first search, according to the formula. The cumulative contribution of s to the CBC value of other vertices v ;

[0035] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. These represent the contributions of source point s to the CBC value of vertex w. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods;

[0036] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When v is replaced with w in the formula, w is replaced with the vertex with w as the preceding vertex.

[0037] Calculation method and The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex;

[0038] When vertex w is not vertex s, the CBC value CBC[w] of vertex w is accumulated. .

[0039] Furthermore, the optimization strategy of merging similar vertices is used to accelerate the calculation of the betweenness centrality (CBC) value of the vertices; specifically:

[0040] (1) Identify all similar vertex sets in the heterogeneous graph;

[0041] (2) Traverse each set of similar vertices and perform the following operations:

[0042] ① Select the first vertex in the set of similar vertices as the representative source vertex s;

[0043] ② Perform a first-level breadth-first search, using the common neighbors of vertices in the similar vertex set as the vertices visited in the first-level breadth-first search, and calculate the weight of the edge (i,q) from each similar vertex i to its common neighbor vertex q. And the number of shortest paths based on transmission sub-mode Maintain a temporary stack S to store the access order of vertices;

[0044] in, The calculation formula is: = × ;

[0045] In the formula, vertex i is a similar vertex, and vertex q is the subsequent vertex of i; The number of transmission sub-modes between vertex i and vertex q; The weights for each transmission sub-mode t, Let represent the number of path instances where vertices i and q are transmitted using transport sub-mode t. This represents all vertices qi that have vertex i as their predecessor vertex during the breadth-first search process with i as the source vertex. This represents the number of path instances where vertices i and qi are transmitted using transport sub-mode t.

[0046] ③ Continue executing the breadth-first search process, according to the formula:

[0047] = × Calculate the weight of edge (u,v) ;

[0048] In the formula, vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0049] And for each similar vertex i, according to the formula Update the number of shortest paths from similar vertex i to vertex u based on transitive methods. ; This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from similar vertex i to vertex u based on transit submethods;

[0050] pass The set stores the predecessor vertices of vertex v, and the access order of vertices is stored in a temporary stack S;

[0051] ④ Traverse the vertices in reverse order of visiting vertices during breadth-first search, and for each similar vertex i, follow the formula... Calculate the contribution of each similar vertex i to the CBC value of other vertices v. And accumulate the CBC values ​​of the vertices;

[0052] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. This represents the number of shortest paths from similar vertex i to vertex w based on the transit sub-method. The calculation method is shown in step ③ of S. These represent the contributions of source point s to the CBC value of vertex w.

[0053] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When v is replaced with w in the formula, w is replaced with the vertex with w as the preceding vertex.

[0054] (3) Traverse all vertices not in the set of similar vertices. Take any vertex not in the set of similar vertices as the source vertex s, and execute steps S3.2.1-S3.2.2 to calculate the contribution of the source vertex s to the CBC values ​​of other vertices v. And add it to the CBC value CBC[v] of vertex v.

[0055] Furthermore, the optimization strategy of directly merging identical vertices is used to accelerate the calculation of the betweenness centrality (CBC) value of the vertices; specifically:

[0056] (1) Identify all sets of identical vertices in a heterogeneous graph;

[0057] (2) Merge each set of identical vertices into a representative vertex x, and use i_count[x] to record the number of vertices that vertex x represents that are the same as it;

[0058] (3) Traverse each vertex s in the heterogeneous graph and calculate the CBC value of each vertex. The specific operation is as follows:

[0059] ① Modify the formula for calculating the weight of transmission sub-mode t as follows: ,in This indicates the number of vertices that are identical to vertex vi;

[0060] This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0061] Will The updated formula is modified to ,in Indicate the number of vertices that vertex v represents that are identical to it, and execute step S3.2.1.1; if i_count[s] > 0, that is, the number of vertices that vertex s represents that are identical to it is > 0, and this is the first level breadth search, then calculate At this time, the vertex represented by s should also be regarded as the subsequent vertex of s;

[0062] ②According to the formula The cumulative contribution of s to the CBC value of v of other vertices ,in This represents the number of vertices that are identical to vertex w.

[0063] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods; These represent the contributions of source point s to the CBC value of vertex w.

[0064] The result has already been calculated in ①, and its calculation method is the same as... The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex;

[0065] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When v is replaced with w in the formula, w is replaced with the vertex with w as the preceding vertex.

[0066] When w is not equal to s, iterate through w and the vertex wi represented by w, and add s and the contribution of the vertex represented by s to the CBC value of vertex w to the CBC value CBC[w] of vertex w and the CBC value CBC[wi] of vertex wi. .

[0067] Furthermore, in step S4, the vertices are sorted from largest to smallest according to the calculated CBC value, and the k vertices with the largest CBC value are selected as the critical nodes of the power grid cascade fault; the specific value of k is set according to user requirements.

[0068] Beneficial technical effects of the present invention:

[0069] The method provided by this invention takes into account that vertices of other categories have different effects on the same type of vertices in the transmission method. It divides the same transmission method into different transmission sub-methods and assigns different influence weights to different transmission sub-methods. Based on this, a CBC metric for vertices in heterogeneous graphs is defined to find transmission bridges between entities.

[0070] The algorithm proposed in this invention can calculate the accurate CBC value of all vertices in a heterogeneous graph and identify key nodes in a power grid cascade fault.

[0071] The optimization strategy proposed in this invention greatly improves efficiency by identifying special vertices, reducing the size of the graph, and merging the calculation process. This enables the metric and calculation method to be applied to large-scale power networks and quickly identify key nodes of cascaded power grid faults. Attached Figure Description

[0072] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0073] Figure 1 This is a schematic diagram of the overall process of a method for detecting critical nodes in a power grid cascade fault based on intermediary centrality, as disclosed in an embodiment of the present invention.

[0074] Figure 2 This is a schematic diagram illustrating the process of calculating the CBC value of a vertex in a heterogeneous graph and identifying key nodes in a cascaded power grid fault in an embodiment of the present invention.

[0075] Figure 3 This is a flowchart illustrating the process of accelerating the calculation of the CBC value of a vertex in a heterogeneous graph and identifying key nodes of cascaded power grid faults in an embodiment of the present invention.

[0076] Figure 4 This is a simplified example diagram illustrating the identification of critical nodes in a cascading power grid fault using this invention. Detailed Implementation

[0077] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0078] Conversely, this invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of the invention as defined in the claims. Furthermore, to provide a better understanding of the invention, certain specific details are described in detail below. However, those skilled in the art will fully understand the invention even without these detailed descriptions.

[0079] Since the importance of vertices in heterogeneous graphs cannot be directly measured using the betweenness centrality defined on homogeneous graphs, and critical nodes in power networks prone to large-scale cascading faults cannot be identified, this invention provides a method for detecting critical nodes of cascading faults in power grids based on betweenness centrality. This method, targeting heterogeneous graphs, defines the transmission methods between vertices through meta-paths and considers the different influences of vertices of other categories on the transmission methods between vertices of the same category. This results in different transmission sub-methods within the same transmission method, and different influence weights are assigned to different transmission sub-methods. Based on this, a CBC metric for vertices in heterogeneous graphs is defined to find transmission bridges in heterogeneous graphs, i.e., critical nodes of cascading faults in power grids. A method for calculating vertex CBC values ​​and an optimization strategy are provided, which achieves an acceleration from 38.75 hours to 0.6 hours on large datasets.

[0080] This invention proposes an embodiment of a method for detecting critical nodes in a power grid cascade fault based on intermediary centrality, such as... Figure 1 As shown, the specific implementation is as follows:

[0081] S1 constructs heterogeneous networks:

[0082] The constructed heterogeneous graph is ;in, It is a set of vertices. It is a set of edges. It is a set of vertex categories. It is a set of edge categories. It defines the mapping from each vertex to its corresponding vertex class. The mapping from each edge to its corresponding edge category is defined;

[0083] like Figure 4 As shown, a power network includes various types of entities such as power plants, step-up transformers, step-down transformers, power cables, residential users, and enterprise users. Therefore, a heterogeneous graph model is constructed to represent the power network, where vertices represent entities and edges represent the transmission relationships between entities. The heterogeneous graph model is a directed graph that stores all vertex categories in the heterogeneous graph and the categories of edges between these vertex categories.

[0084] S2 Select transmission method

[0085] Use heterogeneous graph pattern This represents the vertex category in the heterogeneous graph and the category of the edge between the vertex categories.

[0086] Since there are no edges between vertices of the same type, direct transmission is not possible. Indirect transmission is usually required, which is achieved through vertices of other types as a medium. Metapaths can specify the vertex types and order in the transmission method. In heterogeneous graphs, a specific path that conforms to the vertex type and order specified by the metapath is called a path instance of the metapath.

[0087] S3 calculates the CBC value of the vertices.

[0088] In the transmission methods of the same type of vertices specified by the metapath, vertices of other types will have different impacts on this transmission method. The transmission method can be divided into different transmission sub-methods. To reflect the different influences of each transmission sub-method on the transmission between vertices, we assign different weights to them in subsequent calculations and calculate the shortest path number between each pair of vertices based on the weights of the transmission sub-methods. The CBC value of vertex v is defined as the sum of the probabilities of the shortest path between each pair of vertices passing through vertex v based on the transmission sub-method. It can be used to measure the ability of vertex v as a transmission bridge between entities. In a power grid, the stronger the vertex's ability to act as a transmission bridge, the more likely that vertex is to cause cascading failures.

[0089] In step S3, the CBC value of the vertices in the heterogeneous graph is calculated using one of the following three methods:

[0090] (1) Calculate the CBC value of all vertices in the heterogeneous graph using the basic algorithm;

[0091] (2) An optimization strategy of merging similar vertex calculation processes is adopted to accelerate the calculation of vertex CBC values;

[0092] (3) An optimization strategy of directly merging identical vertices is adopted to accelerate the calculation of the CBC value of vertices.

[0093] like Figure 2 As shown, the method for calculating the CBC value of all vertices in the heterogeneous graph using the basic algorithm is as follows:

[0094] (1) Initialize the CBC value of each vertex in the heterogeneous graph to 0 and store it in the CBC array.

[0095] (2) Traverse each vertex in the heterogeneous graph and calculate the CBC value of each vertex. The specific steps are as follows:

[0096] ① Perform a breadth-first search with s as the source point, through The set stores the predecessor vertices of vertex v, and a temporary stack structure is used to store the access order of the vertices. The number of shortest paths from s to vertex v based on the transit submethod is calculated. The specific steps are as follows:

[0097] i) ;

[0098] In the formula, for: The metapath selected in S2 This specifies the transmission method between vertices of the same type, where s is the source vertex mentioned above.

[0099] Based on metapath The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission mode; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0100] ii) According to the formula renew :

[0101] This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from source point s to vertex u based on transport sub-methods;

[0102] Calculation method and same, In the calculation formula, u and v represent vertices with a parent-child relationship during the breadth-first search process, that is, vertex u is the predecessor vertex of vertex v; in the calculation At that time, Replace v with u in the formula, and replace u with the preceding vertex of u, that is, the vertex in pred(u);

[0103] ② Traverse the vertices in reverse order of the breadth-first search (BFS) visits stored in the temporary stack S, pop each vertex from the stack as vertex w, and then apply the formula... The cumulative contribution of s to the CBC value of v of other vertices ;

[0104] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. These represent the contributions of source point s to the CBC value of vertex w. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods;

[0105] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... In this case, simply replace v with w in the formula, and replace w with the vertex whose preceding vertex is w.

[0106] Calculation method and The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex is sufficient;

[0107] When w is not equal to s, it is added to cbc[w]. .

[0108] like Figure 3 As shown, there are two strategies to accelerate the calculation of CBC values ​​of vertices in heterogeneous graphs: one is to merge the calculation process of similar vertices, and the other is to directly merge identical vertices.

[0109] In heterogeneous graphs, two vertices are considered similar if they share the same set of neighboring vertices. Vertices within the same set of similar vertices are all similar to each other. Breadth-search trees obtained by using similar vertices as source vertices are also identical.

[0110] The optimization strategy of merging similar vertices is used to accelerate the calculation of the CBC value of the vertex; specifically:

[0111] (1) Identify all similar vertex sets in the heterogeneous graph.

[0112] (2) Traverse each set of similar vertices and perform the following operations:

[0113] ① Select the first vertex in the set of similar vertices as the representative source point s.

[0114] ② Perform a first-level breadth-first search, using the common neighbors of vertices in the similar vertex set as the vertices visited in the first-level breadth-first search, and calculate the weight of the edge (i,q) from each similar vertex i to its common neighbor vertex q. And the number of shortest paths based on transmission sub-mode Maintain a temporary stack S to store the access order of vertices;

[0115] in, The calculation formula is: = × ;

[0116] In the formula, vertex i is a similar vertex, and vertex q is the subsequent vertex of i; The number of transmission sub-modes between vertex i and vertex q; The weights for each transmission sub-mode t, Let represent the number of path instances where vertices i and q are transmitted using transport sub-mode t. This represents all vertices qi that have vertex i as their predecessor vertex during the breadth-first search process with i as the source vertex. This represents the number of path instances where vertices i and qi are transmitted using transport sub-mode t.

[0117] ③ Continue executing the breadth-first search process, according to the formula:

[0118] = × Calculate the weight of edge (u,v) ;

[0119] In the formula, vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0120] And for each similar vertex i, according to the formula Update the number of shortest paths from similar vertex i to vertex u based on transitive methods. ; This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from similar vertex i to vertex u based on transit submethods;

[0121] pass The set stores the predecessor vertices of vertex v, and the access order of vertices is stored in a temporary stack S;

[0122] ④ Traverse the vertices in reverse order of visiting vertices during breadth-first search, and for each similar vertex i, follow the formula... Calculate the contribution of each similar vertex i to the CBC value of other vertices v. And accumulate the CBC values ​​of the vertices;

[0123] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. This represents the number of shortest paths from similar vertex i to vertex w based on the transit sub-method. The calculation method is shown in step ③ of S. These represent the contributions of source point s to the CBC value of vertex w.

[0124] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... To do this, simply replace v with w in the formula, and replace w with the vertex that has w as its preceding vertex.

[0125] (3) Traverse all vertices not in the set of similar vertices. Take any vertex not in the set of similar vertices as the source vertex s, and execute steps S3.2.1-S3.2.2 in the basic algorithm to calculate the contribution of the source vertex s to the CBC values ​​of other vertices v. And add it to the CBC value CBC[v] of vertex v.

[0126] Specifically, steps S3.2.1-S3.2.2 in the basic algorithm are as follows:

[0127] S3.2.1. Taking any vertex in the heterogeneous graph as the source vertex s, perform a breadth-first search. The set stores the preceding vertices of vertex v in the breadth-first search process. Vertex v is the meta-path from the source vertex s in the heterogeneous graph. The path instance connects to other vertices; calculate the number of shortest paths from source vertex s to vertex v based on transport submethod. , The specific calculation steps are as follows:

[0128] S3.2.1.1. Calculate the weight of edge (u,v) based on the transport sub-method weight. :

[0129] = × ;

[0130] In the formula, For: Based on meta-path The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission method; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0131] S3.2.1.2. According to the formula renew ;

[0132] This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from source point s to vertex u based on transport sub-methods;

[0133] Calculation method and same, In the calculation formula, u and v represent vertices with a parent-child relationship during the breadth-first search process, that is, vertex u is the predecessor vertex of vertex v; in the calculation At that time, Replace v with u in the formula, and replace u with the preceding vertex of u;

[0134] S3.2.2. Traverse the vertices in reverse order of visiting vertices during breadth-first search, according to the formula. The cumulative contribution of s to the CBC value of other vertices v ;

[0135] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. These represent the contributions of source point s to the CBC value of vertex w. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods;

[0136] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When v is replaced with w in the formula, w is replaced with the vertex with w as the preceding vertex.

[0137] Calculation method and The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex;

[0138] When vertex w is not vertex s, the CBC value CBC[w] of vertex w is accumulated. .

[0139] In this embodiment, "two vertices being the same" means that in a heterogeneous graph, two vertices are considered the same when they have the same set of neighboring vertices and the same transit mode as the same neighboring vertex. Vertices within the same set of vertices are identical to each other, and because their CBC values ​​are equal, they can be merged into a single vertex. The optimization strategy of directly merging identical vertices is used to accelerate the calculation of the CBC value of vertices; specifically:

[0140] (1) Identify all sets of identical vertices in a heterogeneous graph;

[0141] (2) Merge each set of identical vertices into a representative vertex x, and use i_count[x] to record the number of vertices that the vertex v represents that are the same as it;

[0142] (3) Traverse each vertex s in the heterogeneous graph and calculate the CBC value of each vertex. The specific operation is as follows:

[0143] ① Perform a breadth-first search with s as the source point, through The set stores the predecessor vertices of vertex v, and uses a temporary stack structure to store the access order of vertices. Let be the weight of the transmission sub-mode t, where This indicates the number of vertices that are identical to vertex vi;

[0144] This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0145] by for The update formula, where This indicates the number of vertices that vertex v represents that are identical to it;

[0146] implement:

[0147] Calculate the weight of edge (u,v) based on the transport sub-mode weight. : The metapath selected in S2 This specifies the transmission method between vertices of the same type, where s is the source vertex mentioned above.

[0148] = × ;

[0149] In the formula, For: Based on meta-path The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission mode; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t.

[0150] Calculate the distance from s to other vertices v. Note that if i_count[s] > 0 and this is the first level of breadth-first search, then calculate... The vertex represented by s should also be considered as the subsequent vertex of s.

[0151] ②According to the formula The cumulative contribution of s to the CBC value of v of other vertices

[0152] in This represents the number of vertices that are identical to vertex w.

[0153] In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source vertex. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods; These represent the contributions of source point s to the CBC value of vertex w.

[0154] The result has already been calculated in ①, and its calculation method is the same as... The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex is sufficient;

[0155] The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... In this case, simply replace v with w in the formula, and replace w with the vertex whose preceding vertex is w.

[0156] When w is not equal to s, iterate through w and the vertex wi represented by w, and add s and the contribution of the vertex represented by s to the CBC value of vertex w to the CBC value CBC[w] of vertex w and the CBC value CBC[wi] of vertex wi. .

[0157] S4 sorts the vertices from largest to smallest according to the calculated CBC value, and selects the k vertices with the largest CBC values ​​as critical nodes for power grid cascade faults; the specific value of k is set according to user requirements.

[0158] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting critical nodes in a cascaded power grid fault based on intermediary centrality, characterized in that, The method includes the following steps: S1. Construct a heterogeneous graph for the many different types of entities in the power network and the transmission relationships between them; S2. Select a meta-path in the heterogeneous graph. Specify the transmission method between vertices of the same type; in the metapath Among the specified transmission methods for vertices of the same type, select a different type of vertex, and each vertex in the selected vertex type corresponds to a transmission sub-method; The heterogeneous betweenness centrality (CBC) of any vertex in the heterogeneous graph is defined as: the metapath in the heterogeneous graph... The sum of probabilities of passing through the vertices in the shortest path based on the transit sub-method among all vertex pairs consisting of the same type of vertices at both ends; S3. Calculate the CBC value of the vertices in the heterogeneous graph to identify critical nodes in the power grid cascade fault; Traverse the vertices in the heterogeneous graph, perform a breadth-first search with s as the source vertex, and store the predecessor vertices of vertex v in the Pred(v) set. The weight of edge (u,v) is calculated based on the transport sub-method weight. : ; In the formula, For: Based on meta-path The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission method; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t. Calculate the number of shortest paths τ[v] from source point s to vertex v based on the transport sub-mode; Traverse the vertices in reverse order of the breadth-first search, accumulating the contribution of s to the CBC value of other vertices v. ; S4. Select several vertices with the largest CBC values ​​in the heterogeneous graph as critical nodes for power grid cascade faults.

2. The method for detecting critical nodes in a cascaded power grid fault based on intermediary centrality as described in claim 1, characterized in that, In step S1, the constructed heterogeneous graph is as follows: ; in, It is a set of vertices. It is a set of edges. It is a set of vertex categories. It is a set of edge categories. It defines the mapping from each vertex to its corresponding vertex class. The mapping from each edge to its corresponding edge category is defined; Use heterogeneous graph pattern This represents the vertex category in the heterogeneous graph and the category of the edge between the vertex categories.

3. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality according to claim 2, characterized in that, In step S2, the heterogeneous graph mode is adopted. The path on the graph, i.e., the heterogeneous graph Metapath This specifies the transmission method between vertices.

4. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality as described in claim 1, characterized in that, In step S3, the CBC value of the vertices in the heterogeneous graph is calculated using one of the following three methods: (1) Calculate the CBC value of all vertices in the heterogeneous graph using the basic algorithm; (2) An optimization strategy of merging similar vertex calculation processes is adopted to accelerate the calculation of vertex CBC values; (3) An optimization strategy of directly merging identical vertices is adopted to accelerate the calculation of the CBC value of vertices.

5. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality according to claim 4, characterized in that, The method for calculating the CBC value of all vertices in the heterogeneous graph using the basic algorithm is as follows: S3.

1. Initialize the CBC value of each vertex in the heterogeneous graph to 0 and store it in the CBC array; S3.

2. Traverse each vertex in the heterogeneous graph and calculate the CBC value of each vertex. The specific steps are as follows: S3.2.

1. Using any meta-path in the heterogeneous graph The vertex of the endpoint category is the source vertex s. A breadth-first search is performed. The set stores the preceding vertices of vertex v in the breadth-first search process. Vertex v is the meta-path from the source vertex s in the heterogeneous graph. The path instance connects to other vertices; calculate the number of shortest paths from source vertex s to vertex v based on transport submethod. , The specific calculation steps are as follows: S3.2.1.

1. Calculate the weight of edge (u,v) based on the transport sub-method weight. : ; In the formula, For: Based on meta-path The weight of edge (u,v) with s as the source vertex is calculated using the transmission sub-mode weight of the specified transmission method; vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t. S3.2.1.

2. According to the formula renew ; This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from source point s to vertex u based on transport sub-methods; Calculation method and same, In the calculation formula, u and v represent vertices with a parent-child relationship during the breadth-first search process, that is, vertex u is the predecessor vertex of vertex v; in the calculation At that time, Replace v with u in the formula, and replace u with the preceding vertex of u; S3.2.

2. Traverse the vertices in reverse order of visiting vertices during breadth-first search, according to the formula. The cumulative contribution of s to the CBC value of other vertices v ; In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source point. These represent the contributions of source point s to the CBC value of vertex w. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods; The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When, replace v with w in the formula, and replace w with the vertex with w as the preceding vertex; Calculation method and The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex; When vertex w is not the source vertex s, the CBC value CBC[w] of vertex w is accumulated. .

6. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality according to claim 5, characterized in that, The optimization strategy of merging similar vertices is used to accelerate the calculation of the CBC value of the vertex; specifically: (1) Identify all similar vertex sets in the heterogeneous graph; (2) Traverse each set of similar vertices and perform the following operations: ① Select the first vertex in the set of similar vertices as the representative source vertex s; ② Perform a first-level breadth-first search, using the common neighbors of vertices in the similar vertex set as the vertices visited in the first-level breadth-first search, and calculate the weight of the edge (i,q) from each similar vertex i to its common neighbor vertex q. And the number of shortest paths based on transmission sub-mode Maintain a temporary stack S to store the access order of vertices; in, The calculation formula is: ; In the formula, vertex i is a similar vertex, and vertex q is the subsequent vertex of i; The number of transmission sub-modes between vertex i and vertex q; The weights for each transmission sub-mode t, Let represent the number of path instances where vertices i and q are transmitted using transport sub-mode t. This represents all vertices qi that have vertex i as their predecessor vertex during the breadth-first search process with i as the source vertex. This represents the number of path instances where vertices i and qi are transmitted using transport sub-mode t. ③ Continue executing the breadth-first search process, according to the formula: Calculate the weight of edge (u,v) ; In the formula, vertex u is the predecessor vertex of vertex v; This represents the number of transmission sub-modes between vertices u and v; The weights for each transmission sub-mode t, This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t. And for each similar vertex i, according to the formula Update the number of shortest paths from similar vertex i to vertex u based on transitive methods. ; This represents all the preceding vertices u of vertex v during the breadth-first search process with s as the source point; This represents the number of shortest paths from similar vertex i to vertex u based on transit submethods; pass The set stores the predecessor vertices of vertex v, and the access order of vertices is stored in a temporary stack S; ④ Traverse the vertices in reverse order of visiting vertices during breadth-first search, and for each similar vertex i, follow the formula... Calculate the contribution of each similar vertex i to the CBC value of other vertices v. And accumulate the CBC values ​​of the vertices; In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source point. This represents the number of shortest paths from similar vertex i to vertex w based on the transit sub-method. The calculation method is shown in step ③. These represent the contributions of source point s to the CBC value of vertex w. The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When, replace v with w in the formula, and replace w with the vertex with w as the preceding vertex; (3) Traverse all vertices not in the set of similar vertices, and take any vertex not in the set of similar vertices as the source vertex s. Perform steps S3.2.1-S3.2.2 in claim 5 to calculate the contribution of the source vertex s to the CBC values ​​of other vertices v. And add it to the CBC value CBC[v] of vertex v.

7. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality according to claim 5, characterized in that, The optimization strategy of directly merging identical vertices is used to accelerate the calculation of the CBC value of vertices; specifically: (1) Identify all sets of identical vertices in a heterogeneous graph (2) Merge each set of identical vertices into a representative vertex x, and use i_count[x] to record the number of vertices that vertex x represents that are identical to it. (3) Traverse each source vertex s in the heterogeneous graph and calculate the CBC value of each vertex. The specific operation is as follows: ① Modify the formula for calculating the weight of transmission sub-mode t as follows: ,in This indicates the number of vertices that are identical to vertex vi; This represents the number of path instances where vertices u and v are transmitted using transport sub-mode t. This indicates that during the breadth-first search with s as the source point, all vertices vi with vertex u as the preceding vertex; This represents the number of path instances where vertices u and vi are transmitted using transport submode t. Will The updated formula is modified to ,in Indicate the number of vertices that are identical to vertex v, and execute step S3.2.1.1 in claim 5; if i_count[s] > 0, that is, the number of vertices that are identical to source vertex s > 0, and this is the first level breadth search, then calculate At this time, the vertex represented by s should also be regarded as the subsequent vertex of s; ②According to the formula The cumulative contribution of s to the CBC value of v of other vertices ,in This represents the number of vertices that are identical to vertex w. In the formula, This represents all vertices w whose predecessor is vertex v during the breadth-first search process with s as the source point. This represents the number of shortest paths from source point s to vertex w based on transport sub-methods; These represent the contributions of source point s to the CBC value of vertex w. Calculation method and The same, in calculation At that time, Replace v in the formula with Replace u with The preceding vertex; The calculation method and Same, formula In the diagram, vertices v and w represent vertices with a parent-child relationship during the breadth-first search (BFS), meaning vertex v is the predecessor of vertex w. In the computation... When, replace v with w in the formula, and replace w with the vertex with w as the preceding vertex; When w is not equal to s, iterate through w and the vertex wi represented by w, and add s and the contribution of the vertex represented by s to the CBC value of vertex w to the CBC value CBC[w] of vertex w and the CBC value CBC[wi] of vertex wi. .

8. The method for detecting critical nodes in a power grid cascade fault based on intermediary centrality according to claim 4, characterized in that, In step S4, the vertices are sorted from largest to smallest according to the calculated CBC value, and the k vertices with the largest CBC value are selected as the critical nodes of the power grid cascade fault.