Method and device for constructing power grid alarm rule knowledge graph and electronic equipment
Patent Information
- Application Number
- CN202611014284.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-09-22
AI Technical Summary
[0065]本申请实施例提供的一种电网告警规则知识图谱的构建方法、装置及电子设备,通过获取电网告警规则数据,再基于预设的领域特定语法规范对电网告警规则数据进行解析,生成对应的抽象语法树,随后基于抽象语法树中各节点的语义类型与层级连接关系,构建电网告警规则知识图谱,使得电网告警规则数据中的复杂规则得到连续、一致的结构化表达,规则数据不再停留于文本记录或离散字段记录,而是形成可追溯、可关联的图结构模型,达到提升复杂规则之间关系的分析与管理能力的效果。
Smart Images

Figure CN122797701A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent power operation and maintenance technology, and in particular to a method, apparatus and electronic device for constructing a power grid alarm rule knowledge graph. Background Technology
[0002] In the context of smart grid construction, power grid monitoring systems use sensors and monitoring equipment deployed in substations, transmission lines and distribution networks to collect real-time data on equipment operating status, electrical parameters and environmental data, and trigger abnormal alarms based on preset alarm rules.
[0003] However, existing solutions mostly manage alarm rules using rule text or relational data, making it difficult to fully characterize complex logic, timing constraints, and device associations, resulting in easily fragmented rule semantics.
[0004] Existing solutions suffer from the problem of lost semantic information in rules, making it difficult to discover implicit associations. Summary of the Invention
[0005] This application provides a method, apparatus, and electronic device for constructing a power grid alarm rule knowledge graph, which can improve the ability to analyze and manage the relationships between complex rules.
[0006] In a first aspect, embodiments of this application provide a method for constructing a power grid alarm rule knowledge graph, including:
[0007] Obtain power grid alarm rule data.
[0008] The power grid alarm rule data is parsed based on a preset domain-specific syntax specification to generate a corresponding abstract syntax tree.
[0009] Based on the semantic types and hierarchical connections of each node in the abstract syntax tree, a knowledge graph of power grid alarm rules is constructed.
[0010] In one possible implementation, in conjunction with the first aspect, the nodes include leaf nodes at the bottom level of the abstract syntax tree, and non-leaf nodes at the upper levels of the leaf nodes; based on the semantic types and hierarchical connections of each node in the abstract syntax tree, a power grid alarm rule knowledge graph is constructed, including:
[0011] Based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to an entity of different types.
[0012] Based on the semantic type and hierarchical connection relationship of each non-leaf node, the semantic relationship edges between each entity are determined.
[0013] A knowledge graph of power grid alarm rules is constructed based on entities and semantic relationship edges.
[0014] In one possible implementation, in conjunction with the first aspect, based on the semantic type and hierarchical connection relationship of each non-leaf node, the semantic relationship edges between entities are determined, including:
[0015] Based on the hierarchical connection relationship of the non-leaf nodes, determine the subordinate leaf nodes located at the next lower level of the non-leaf nodes from each leaf node.
[0016] Based on the semantic type of the non-leaf nodes, determine the semantic relationship edges between the entities corresponding to each subordinate leaf node.
[0017] In one possible implementation, in conjunction with the first aspect, determining the semantic relationship edges between entities corresponding to each subordinate leaf node based on the semantic type of the non-leaf nodes includes:
[0018] If the semantic type of a non-leaf node is a logical composite node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined as triggering relationships.
[0019] If the semantic type of a non-leaf node is a time-constrained node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be time-series relationships.
[0020] If the semantic type of a non-leaf node is a topological predicate node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be spatial association relationships.
[0021] In one possible implementation, after constructing a power grid alarm rule knowledge graph in conjunction with the first aspect, the method further includes:
[0022] In response to new events in alarm rules or extensions in grammar rules, obtain the corresponding change data.
[0023] Update the power grid alarm rule knowledge graph based on changing data.
[0024] The updates include entity alignment, attribute synchronization, and edge relationship reconstruction.
[0025] In one possible implementation, after constructing a power grid alarm rule knowledge graph in conjunction with the first aspect, the method further includes:
[0026] Node embedding is performed on entities in the power grid alarm rule knowledge graph to obtain node embedding vectors.
[0027] Based on the node embedding vector and the semantic relationship edges corresponding to the entities, the aggregate embedding vector is obtained.
[0028] Based on the aggregated embedding vectors, path reasoning is performed on the knowledge graph of power grid alarm rules to obtain the reasoning results.
[0029] In one possible implementation, in conjunction with the first aspect, the reasoning results include rule consistency verification results, alarm correlation analysis results, and cross-layer root cause inference results.
[0030] In one possible implementation, in conjunction with the first aspect, based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to entities of different types, including:
[0031] Obtain multimodal auxiliary data sources; multimodal auxiliary data sources include power grid equipment topology diagrams, historical alarm logs, and real-time operating data.
[0032] Based on the semantic type of each leaf node, feature extraction and fusion are performed on the multimodal auxiliary data source to obtain the feature information of the entity corresponding to each leaf node.
[0033] Based on feature information, each leaf node is mapped to a different type of entity.
[0034] Secondly, embodiments of this application provide an apparatus for constructing a power grid alarm rule knowledge graph, comprising:
[0035] The acquisition module is used to acquire power grid alarm rule data.
[0036] The syntax tree generation module is used to parse power grid alarm rule data based on a preset domain-specific syntax specification and generate the corresponding abstract syntax tree.
[0037] The graph construction module is used to construct a knowledge graph of power grid alarm rules based on the semantic types and hierarchical connections of each node in the abstract syntax tree.
[0038] In one possible implementation, in conjunction with the second aspect, the nodes include leaf nodes at the bottom level of the abstract syntax tree, and non-leaf nodes at the upper levels above the leaf nodes; the graph construction module is specifically used for:
[0039] Based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to an entity of different types.
[0040] Based on the semantic type and hierarchical connection relationship of each non-leaf node, the semantic relationship edges between each entity are determined.
[0041] A knowledge graph of power grid alarm rules is constructed based on entities and semantic relationship edges.
[0042] In one possible implementation, in conjunction with the second aspect, the map construction module is further specifically used for:
[0043] Based on the hierarchical connection relationship of the non-leaf nodes, determine the subordinate leaf nodes located at the next lower level of the non-leaf nodes from each leaf node.
[0044] Based on the semantic type of the non-leaf nodes, determine the semantic relationship edges between the entities corresponding to each subordinate leaf node.
[0045] In one possible implementation, in conjunction with the second aspect, the map construction module is further specifically used for:
[0046] If the semantic type of a non-leaf node is a logical composite node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined as triggering relationships.
[0047] If the semantic type of a non-leaf node is a time-constrained node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be time-series relationships.
[0048] If the semantic type of a non-leaf node is a topological predicate node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be spatial association relationships.
[0049] In one possible implementation, in conjunction with the second aspect, the acquisition module is also used to acquire the corresponding change data in response to an alarm rule addition event or a grammar specification extension event.
[0050] Correspondingly, the graph construction module is also used to update the power grid alarm rule knowledge graph based on changing data; the update includes entity alignment, attribute synchronization and edge relationship reconstruction.
[0051] In one possible implementation, in conjunction with the second aspect, the device further includes a reasoning module, specifically used for:
[0052] Node embedding is performed on entities in the power grid alarm rule knowledge graph to obtain node embedding vectors.
[0053] Based on the node embedding vector and the semantic relationship edges corresponding to the entities, the aggregate embedding vector is obtained.
[0054] Based on the aggregated embedding vectors, path reasoning is performed on the knowledge graph of power grid alarm rules to obtain the reasoning results.
[0055] In one possible implementation, in conjunction with the second aspect, the reasoning results include rule consistency verification results, alarm correlation analysis results, and cross-layer root cause inference results.
[0056] In one possible implementation, in conjunction with the second aspect, the acquisition module is also used to acquire multimodal auxiliary data sources; the multimodal auxiliary data sources include power grid equipment topology diagrams, historical alarm logs, and real-time operating data.
[0057] Correspondingly, the map construction module is also specifically used for:
[0058] Based on the semantic type of each leaf node, feature extraction and fusion are performed on the multimodal auxiliary data source to obtain the feature information of the entity corresponding to each leaf node.
[0059] Based on feature information, each leaf node is mapped to a different type of entity.
[0060] Thirdly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor.
[0061] The memory stores the instructions that the computer executes.
[0062] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0063] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0064] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0065] This application provides a method, apparatus, and electronic device for constructing a power grid alarm rule knowledge graph. By acquiring power grid alarm rule data and then parsing it based on a preset domain-specific syntax specification, a corresponding abstract syntax tree is generated. Subsequently, based on the semantic types and hierarchical connections of each node in the abstract syntax tree, a power grid alarm rule knowledge graph is constructed. This allows complex rules in the power grid alarm rule data to be expressed in a continuous and consistent structure. The rule data no longer remains as text records or discrete field records, but forms a traceable and associative graph structure model, thereby improving the ability to analyze and manage relationships between complex rules. Attached Figure Description
[0066] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0067] Figure 1 A schematic diagram illustrating a scenario for constructing a power grid alarm rule knowledge graph provided in this application;
[0068] Figure 2 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 1 ;
[0069] Figure 3 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 2 ;
[0070] Figure 4 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 3 ;
[0071] Figure 5 A specific example diagram illustrating the method for constructing a power grid alarm rule knowledge graph provided in this application;
[0072] Figure 6 A schematic diagram of the structure of a device for constructing a power grid alarm rule knowledge graph provided in this application;
[0073] Figure 7 A schematic diagram of the structure of the electronic device provided in this application.
[0074] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0076] The application background of the embodiments of this application will be explained below:
[0077] In the context of smart grid construction, power grid monitoring systems utilize sensors and monitoring equipment deployed in substations, transmission lines, and distribution networks to collect real-time data on equipment operating status, electrical parameters, and environmental conditions, triggering abnormal alarms based on pre-defined alarm rules. However, existing solutions often manage alarm rules using rule text or relational data, making it difficult to fully characterize complex logic, timing constraints, and device relationships, resulting in fragmented rule semantics. Existing solutions suffer from the problem of lost rule semantic information, making it difficult to discover implicit associations.
[0078] To address the aforementioned issues, the inventors have developed a method for constructing a power grid alarm rule knowledge graph. This method involves acquiring power grid alarm rule data, parsing it based on a pre-defined domain-specific syntax specification, generating a corresponding abstract syntax tree, and then constructing a power grid alarm rule knowledge graph based on the semantic types and hierarchical connections of each node in the abstract syntax tree. This allows for a continuous and consistent structured expression of complex rules within the power grid alarm rule data. The rule data is no longer confined to text records or discrete field records, but forms a traceable and associative graph structure model, thereby enhancing the ability to analyze and manage relationships between complex rules.
[0079] Taking a regional power grid dispatch center scenario as an example, combined with Figure 1 This paper illustrates a specific application scenario for the power grid alarm rule knowledge graph construction method provided in this application. In this scenario, the alarm rules are numerous and come from a wide range of sources, involving not only single-device threshold judgments but also multi-device linkage, timing constraints, and device relationships, placing high demands on the unified management and accurate understanding of the rules. For example... Figure 1 As shown, the specific application scenario of this application includes a front-end data acquisition device 101, an alarm rule engine 102, and a back-end rule management platform 103. The alarm rule engine 102 acquires power grid alarm rule data through the front-end data acquisition device 101, parses the power grid alarm rule data based on preset domain-specific syntax specifications, constructs a power grid alarm rule knowledge graph, and then transmits the power grid alarm rule knowledge graph to the back-end rule management platform 103 for persistent storage.
[0080] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0081] Figure 2 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 1 ,like Figure 2 As shown, the method includes:
[0082] S201. Obtain power grid alarm rule data.
[0083] In this step, the power grid alarm rule data serves as the input for subsequent parsing processes, carrying the original rule content from the power grid monitoring system. This data can originate from existing rule files in the substation monitoring master station, transmission line monitoring platform, distribution automation system, Supervisory Control and Data Acquisition (SCADA) backend rule base, and rule management platform. It can also come from new rule content entered by maintenance personnel through the rule configuration interface, or from rule update data generated after power grid topology adjustments, equipment ledger changes, or alarm policy revisions.
[0084] In practical implementation, if the rules originate from a relational database, fields such as rule number, rule text, applicable voltage level, applicable equipment type, version number, and effective status are read and combined to form a unified rule record. If the rules originate from a text file, rule identifiers and rule expressions are extracted according to a predefined delimiter format. If the rules originate from manual input, character encoding standardization and basic format checks are performed on the input content before saving it to the rule record set. Power grid alarm rule data can include rule content characterizing alarm triggering conditions, alarm thresholds, logical relationships, time windows, equipment associations, and action objects, such as equipment measurement point over-limit rules, multi-measurement point combination judgment rules, and alarm rules with continuous duration constraints. This ensures subsequent parsing based on preset domain-specific syntax specifications.
[0085] In one possible implementation, the aggregated power grid alarm rule data undergoes a unified format processing, which specifically includes converting character encoding into a unified encoding format, mapping device identifiers from different systems to a unified device code, uniformly converting time units to seconds or milliseconds, standardizing logical operators and comparison operators, and removing redundant whitespace characters, comment fields, and display labels that do not participate in the semantic expression of the rules.
[0086] In another possible implementation, after the acquisition action is completed, a standardized power grid alarm rule dataset is generated, and each rule is appended with a unique rule identifier, source identifier, and version information to establish a traceable correspondence between rule nodes and sources during subsequent parsing and knowledge graph construction. Rule records lacking necessary fields are marked as rules to be corrected and do not enter the abstract syntax tree generation process; for rule records with complete fields but inconsistent expressions, expression normalization and lexical preprocessing continue. Based on this approach, subsequent steps deal with rule data objects with unified expression boundaries and basic metadata constraints, enabling different types of power grid alarm rules to be processed within the same syntactic framework.
[0087] Based on the above analysis, it can be seen that by completing source aggregation, field organization, and expression unification before the rules enter the parsing stage, rule content from different business scenarios can be transformed into a dataset with a consistent structure, thereby keeping the subsequent syntax recognition objects stable.
[0088] S202. Based on the preset domain-specific syntax specification, the power grid alarm rule data is parsed to generate the corresponding abstract syntax tree.
[0089] In this step, the domain-specific syntax specification is used to constrain the syntactic expression of power grid alarm rule data, enabling the rule text to be recognized and decomposed according to unified rules. This syntax specification is a predefined set of syntax rules for power grid alarm rules, including at least lexical unit definitions, operator precedence definitions, conditional expression structure definitions, time window expression definitions, device association expression definitions, and nested complex logic definitions. Lexical units can include device identifiers, measurement point names, comparison operators, logical connectors, numerical constants, time constants, and status enumeration values; operator precedence specifies the order of combination between parentheses, NOT operations, AND operations, and OR operations; conditional expression structure specifies that a basic judgment unit consists of an object, attribute, comparison relationship, and target value; time window expression specifies the syntactic position of duration, occurrence frequency, or statistical interval; and device association expression specifies the expression methods for master devices, associated devices, and topological relationships.
[0090] Specifically, lexical analysis is first performed on the rule text in the standardized rule dataset, segmenting the continuous character stream into a sequence of tokens and assigning a lexical category label to each token. Then, syntactic analysis is performed on the token sequences according to the production rules of the domain-specific grammar specification, identifying the semantic units and their combination relationships within the rules, and constructing an abstract syntax tree (AST) according to the grammatical nesting hierarchy. The AST is used to receive the rule parsing results, expressing the hierarchical structure and semantic information in the rules in a tree structure. Nodes in the tree can include multiple nodes representing the semantic units of the rules and their hierarchical relationships. The semantic type of a node represents the semantic content of the rule corresponding to that node, and the parent-child connection relationship between nodes represents subordinate, combination, or constraint relationships.
[0091] In one possible implementation, the extended Backus-Naur Form (EBNF) is used to describe the power grid alarm rules, forming a predefined domain-specific syntax specification. This predefined domain-specific syntax specification supports four core syntax structures: first, logical nested expressions, supporting arbitrary levels of nesting of the AND, OR, and NOT operators, defining operator precedence as... Secondly, the time window constraint expression supports three types of time operators, namely sliding window... Jump window With the session window ,in For window size, Step size, This is the offset. This refers to the session timeout period. Thirdly, it supports multi-source signal aggregation expressions, including various aggregation functions such as COUNT (counting function), SUM (summation function), AVG (average function), MAX (maximum value function), and MIN (minimum value function). It also supports various comparison operators, such as greater than, less than, equal to, and interval operators. Fourthly, it supports various topological relation predicates, such as the adjacency predicate ADJACENT(D1,D2), the path predicate PATH(D1,D2,L), and the substation-based predicate IN_SUBSTATION(D), used to implement neighborhood queries and path constraints based on grid equipment connection relationships. Based on the aforementioned predefined domain-specific syntax specifications, lexical analysis is performed on the grid alarm rule data to generate a token sequence. Then, recursive descent parsing is used to complete syntax verification and structure assembly, generating the corresponding abstract syntax tree.
[0092] S203. Based on the semantic types and hierarchical connections of each node in the abstract syntax tree, construct a knowledge graph of power grid alarm rules.
[0093] In this step, nodes include leaf nodes at the bottom level of the abstract syntax tree and non-leaf nodes at the upper level of the leaf nodes. Based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to different types of entities. Based on the semantic type and hierarchical connection relationship of each non-leaf node, the semantic relationship edges between entities are determined. Then, based on the entities and semantic relationship edges, a knowledge graph of power grid alarm rules is constructed.
[0094] In one possible implementation, based on the hierarchical node structure of the abstract syntax tree (API), entity extraction, relation mapping, and constraint encoding are completed by traversing all nodes of the API, transforming the hierarchical syntactic structure of the API into a structured semantic knowledge graph. First, for the leaf nodes at the bottom level of the API, based on their semantic types, a named entity recognition model based on a Bidirectional Long Short-Term Memory-Conditional Random Field (BiLSTM-CRF) network is used to extract three core entities: alarm source equipment entities, measurement point signal entities, and threshold parameter entities. The attributes of the alarm source equipment entity include equipment type, voltage level, affiliated substation, and unique identifier; the attributes of the measurement point signal entity include signal type, measurement unit, and sampling period; and the attributes of the threshold parameter entity include threshold value, comparison direction, and dynamic adjustment flag. Subsequently, for the non-leaf nodes (non-terminal symbol nodes) of the abstract syntax tree, based on their semantic types and hierarchical connections between nodes, different types of non-leaf nodes are automatically mapped to semantic relationship edges between entities in the knowledge graph: logical combination nodes (AND, OR, or NOT operators) are mapped to logical triggering relationships, time window nodes are mapped to temporal constraint relationships, topological predicate nodes are mapped to spatial association relationships, and numerical comparison nodes are mapped to numerical constraint relationships. Simultaneously, various constraint parameters in each node are standardized and encoded. For example, numerical constraints are encoded as scalar attributes, time window parameters are encoded as time interval vectors, and device attributes are encoded as a composite representation of one-hot vectors and embedded vectors, further enriching the attribute dimensions of entities and relationships and carrying complete rule constraint information. The constructed power grid alarm rule knowledge graph is stored in a preset graph database, supporting graph traversal and pattern matching operations through a preset query language, providing data support for subsequent semantic retrieval and inference calculations.
[0095] This application provides a method for constructing a power grid alarm rule knowledge graph. By acquiring power grid alarm rule data and then parsing the data based on a preset domain-specific syntax specification, a corresponding abstract syntax tree is generated. Subsequently, based on the semantic type and hierarchical connection relationship of each node in the abstract syntax tree, a power grid alarm rule knowledge graph is constructed. This allows the complex rules in the power grid alarm rule data to be expressed in a continuous and consistent structure. The rule data is no longer limited to text records or discrete field records, but forms a traceable and associative graph structure model, thereby improving the reliability of rule management.
[0096] Figure 3 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 2 ,like Figure 3As shown, in this embodiment... Figure 2 Based on the embodiments, a method for constructing a power grid alarm rule knowledge graph is described in detail. The method includes:
[0097] S301. Based on the semantic type of each leaf node, map each leaf node in the abstract syntax tree to entities of different types.
[0098] In this step, semantic type identification is first performed on the leaf nodes in the abstract syntax tree. Leaf nodes representing device names, alarm thresholds, time conditions, logical operation quantities, etc., are mapped to entities of the corresponding types, and a unified graph node identifier is configured for different semantic types. For example, they are mapped to alarm source device entities, measurement point signal entities, and threshold parameter entities. For leaf nodes with the same semantic type but different values, independent entities can be generated to preserve the differences between specific objects in the rules.
[0099] In one possible implementation, a multimodal auxiliary data source is acquired, including a power grid equipment topology map, historical alarm logs, and real-time operating data. Based on the semantic type of each leaf node, features are extracted and fused from the multimodal auxiliary data source to obtain feature information of the entity corresponding to each leaf node. Based on the feature information, each leaf node is mapped to different types of entities. The power grid equipment topology map represents the connection relationships of equipment such as substations and switches; historical alarm logs record equipment alarm-related information; and real-time operating data represents operating quantities such as voltage and current. The data source can come from a graph database, a time-series database, and a log storage system, with timestamp alignment and identifier unification completed before entity mapping. Specifically, candidate entity categories are determined based on the semantic type of each leaf node. Corresponding associated features are extracted from the multimodal data source and fused to obtain entity feature information: for leaf nodes of the equipment name type, topological features such as adjacent topological devices and voltage levels are extracted, combined with historical alarm frequency, level distribution, and real-time status change amplitude to form comprehensive features; for leaf nodes of the threshold and duration type, historical threshold trigger records, real-time data statistical distribution, and local structural features of associated equipment are extracted. Feature extraction can employ field encoding, vectorization, or graph structure encoding methods, while fusion can be achieved through feature concatenation, weighted aggregation, or normalized joint representation. Based on the matching degree between semantic type and feature information, each leaf node is mapped to a device entity, parameter entity, alarm entity, or relational constraint entity. Device entities are mapped to unique devices with consistent multi-source identifiers within the topology, while parameter entities are mapped to features primarily based on numerical or temporal constraints. This approach combines topological association, historical alarms, and real-time operational status to complete entity mapping, overcoming the limitations of pure text semantics. It can improve the consistency and accuracy of entity recognition under complex alarm rules, enhance the completeness of rule expression in the knowledge graph, and provide support for subsequent semantic relationship edge construction and graph generation.
[0100] S302. Based on the hierarchical connection relationship of the non-leaf nodes, determine the subordinate leaf nodes located at the next lower level of the non-leaf nodes from each leaf node.
[0101] In this step, the connection information between each non-leaf node and its child nodes is first read along the tree structure of the abstract syntax tree, and the branches to which each leaf node belongs are marked, thereby filtering out the leaf nodes located at the next lower level of the target non-leaf node. For leaf nodes within the control scope of the same non-leaf node, they are regarded as subordinate leaf nodes participating in the construction of the current semantic relationship, and the entity types and entity identifiers mapped to these leaf nodes are extracted.
[0102] S303. Based on the semantic type of the non-leaf nodes, determine the semantic relationship edges between the entities corresponding to each subordinate leaf node.
[0103] In this step, the connection method between entities corresponding to subordinate leaf nodes is determined based on the semantic type of the non-leaf node. If the non-leaf node represents parallel, containment, conditional association, or temporal association, it is mapped to the corresponding semantic relation edge, and the scope and direction of the semantic relation edge are determined in conjunction with the hierarchical connection relationship, so that the generated semantic relation edge is consistent with the structure in the abstract syntax tree. If there are multiple subordinate leaf nodes under the same non-leaf node, these entities can be associated pairwise according to the semantic type, or one entity can be used as the relation subject and another entity as the relation object, thereby forming semantic relation edges that can be used for knowledge graph storage and retrieval.
[0104] In one possible implementation, if the semantic type of a non-leaf node is a logical combination node, then the semantic relationship edge between the entities corresponding to each subordinate leaf node is determined to be a triggering relationship; if the semantic type of a non-leaf node is a time constraint node, then the semantic relationship edge between the entities corresponding to each subordinate leaf node is determined to be a temporal relationship; if the semantic type of a non-leaf node is a topological predicate node, then the semantic relationship edge between the entities corresponding to each subordinate leaf node is determined to be a spatial association relationship.
[0105] S304. Construct a knowledge graph of power grid alarm rules based on entity and semantic relationship edges.
[0106] This step summarizes the process of organizing entities and semantic relationships according to a graph structure, thus forming a power grid alarm rule knowledge graph. This graph can be stored in a graph database or an in-memory graph structure for subsequent querying, association analysis, and rule maintenance. In practical applications, entity types and relationship types can be further configured based on the domain thesaurus of power grid alarm rules; this application does not impose any limitations on this.
[0107] This application provides a method for constructing a power grid alarm rule knowledge graph. Based on the semantic type of each leaf node, the method maps each leaf node in the abstract syntax tree to different types of entities. Then, based on the hierarchical connection relationships of non-leaf nodes, it determines the subordinate leaf nodes at the next lower level of each non-leaf node. Subsequently, based on the semantic type of the non-leaf nodes, it determines the semantic relationship edges between the entities corresponding to each subordinate leaf node. Finally, based on the entities and semantic relationship edges, it constructs a power grid alarm rule knowledge graph. These technical means maintain consistent expression of the hierarchical and connection semantics of the rules, enabling complex alarm rules to be organized and presented in a unified knowledge graph, thereby improving the analysis and management capabilities of relationships between complex rules.
[0108] Figure 4 A flowchart illustrating a method for constructing a power grid alarm rule knowledge graph provided in this application. Figure 3 ,like Figure 4 As shown, this embodiment, based on any of the above embodiments, provides a detailed description of a method for constructing a power grid alarm rule knowledge graph. After constructing the power grid alarm rule knowledge graph, the method includes:
[0109] S401. Perform path reasoning on the knowledge graph of power grid alarm rules to obtain the reasoning results.
[0110] The reasoning results include rule consistency verification results, alarm correlation analysis results, and cross-layer root cause inference results.
[0111] In this step, the entities in the power grid alarm rule knowledge graph are embedded into nodes to obtain node embedding vectors. Based on the node embedding vectors and the semantic relationship edges corresponding to the entities, aggregate embedding vectors are obtained. Based on the aggregate embedding vectors, path reasoning is performed on the power grid alarm rule knowledge graph to obtain the reasoning results.
[0112] In the specific implementation, each entity in the knowledge graph is first assigned a unique identifier, and the entity's type, attribute values, and adjacency relationships are input into a graph representation learning model. This model can employ graph convolutional networks, graph attention networks, or random walk-based embedding models to encode entities as node embedding vectors with consistent dimensions. Subsequently, based on the semantic relationship edges corresponding to each entity, adjacent entity vectors within a one-hop or multi-hop neighborhood are weighted and aggregated. The weights can be determined by the relationship type, edge direction, edge confidence, and entity distance, resulting in an aggregated embedding vector. This aggregated embedding vector is then input into a path reasoning module. The path reasoning module scores and filters candidate paths and outputs reasoning results related to power grid alarm rules. These results can be used to represent inheritance, conflict, or linkage relationships between rules. In this process, node embedding preserves the semantic features of the entity itself, aggregated embedding vectors fuse entity adjacency semantics to form a more complete graph context representation, and path reasoning uses this representation to identify interpretable association links in the graph, thereby obtaining reasoning conclusions that can be used for rule analysis. After adopting the above method, entities are transformed from discrete symbols into computable vectors, the semantic associations between rules can be uniformly encoded, and the path reasoning results can reflect the implicit connections in the power grid alarm rules, thereby improving the expressive power of knowledge graphs in rule association analysis, conflict identification, and semantic query.
[0113] In one possible implementation, each entity node in the power grid alarm rule knowledge graph is used as input, and node embedding and neighborhood information aggregation are performed through a Relational Graph Attention Network Architecture (RGAT). The calculation of attention weights simultaneously integrates node attribute similarity and edge type semantic features; during message passing, independent message transformation matrices are configured for different types of semantic relationship edges, enabling various semantic relationships to have differentiated feature transformation capabilities. The node embedding update function is expressed as:
[0114]
[0115] in, For the first Layer nodes Embedded vector, A set of edge types, For nodes In relation The set of neighboring nodes below, For relationship Next node For nodes Attention weights For relationship The corresponding message transformation matrix, This is the activation function.
[0116] After multi-layer RGAT iterative aggregation, a node aggregation embedding vector with multi-hop neighborhood semantics is obtained. Based on the above node aggregation embedding vector, combined with the semantic relationship edges and topological path structure corresponding to each entity in the knowledge graph, multi-hop path reasoning is performed to mine the implicit semantic associations and logical conclusions in the graph, and finally output the rule consistency verification results, alarm association analysis results, and cross-layer root cause inference results.
[0117] In another possible implementation, a semantic reasoning engine based on a power grid alarm rule knowledge graph is constructed. Using a relational graph attention network as the core reasoning model, it mines implicit semantic relationships in the graph through multi-hop path reasoning on the graph structure, outputting three core reasoning results: rule consistency verification, alarm correlation analysis, and cross-layer root cause inference. The semantic reasoning engine employs a three-layer relational graph attention network as the core computational unit. Each layer aggregates neighbor information of nodes through a multi-head attention mechanism. The calculation of attention weights simultaneously integrates node attribute similarity and edge type semantic features. During message passing, independent message transformation matrices are configured for different types of relational edges, enabling various semantic relationships to possess differentiated feature transformation capabilities and ensuring the semantic accuracy of path reasoning. Based on the above semantic reasoning engine, combined with the topological path information of the knowledge graph, three core reasoning capabilities are realized, corresponding to the output of reasoning results in different dimensions:
[0118] Firstly, rule consistency verification. Consistency is determined by detecting logically contradictory loop structures in the knowledge graph. If a loop exists that starts from a rule node, returns to itself via a NOT edge, or forms a perpetually false loop via AND or OR edges, the corresponding power grid alarm rule data is deemed unsatisfactory. Simultaneously, rule conflict detection is supported. By comparing rule paths with the same triggering conditions but mutually exclusive conclusions, if the precondition subgraphs of two rule paths are isomorphic but their subsequent actions contradict each other, they are marked as potentially conflicting rule pairs.
[0119] Secondly, alarm association analysis. Based on the number of shared neighbors and the length of the connection path between alarm source entities in the knowledge graph, the association strength is calculated. The Random Walk with Restart (RWR) algorithm is used to calculate the semantic similarity between nodes, construct an alarm association network, and output the alarm association analysis results.
[0120] Third, cross-layer root cause inference. Utilizing the hierarchical path information from the primary equipment layer, secondary equipment layer to the communication layer in the graph, the root cause of the fault is traced upwards along the topological relationships; when multiple alarm entities share the same upstream root cause node, that root cause node is identified as the fault source, and the cross-layer root cause inference result is output.
[0121] S402. In response to new alarm rule events or grammar specification extension events, update the power grid alarm rule knowledge graph.
[0122] In this step, in response to new alarm rule events or grammar specification extension events, the corresponding change data is obtained, and the power grid alarm rule knowledge graph is updated based on the change data. This update includes entity alignment, attribute synchronization, and edge relationship reconstruction.
[0123] In practical implementation, the knowledge graph can be stored in a graph database, and the entity alignment module, attribute synchronization module, and edge relationship reconstruction module can be executed collaboratively within the rule management platform. Upon receiving a new or extended event, the system first extracts the changed data, then performs semantic parsing and version comparison on the changed data. Subsequently, it completes entity mapping, attribute write-back, and semantic relationship edge updates, and outputs the updated graph data for the alarm engine to use. Through the above processing, the power grid alarm rule knowledge graph can be continuously updated after rule additions or grammatical expansions. The entities, attributes, and semantic relationship edges in the graph can all reflect the latest rule content and syntax specifications, thereby maintaining the consistency and usability of rule expression.
[0124] In one possible implementation, in response to new alarm rule events and grammar specification expansion events, the system automatically completes local updates of the knowledge graph and adaptive adjustments to the inference engine after acquiring the corresponding changed data. The update process covers three core stages: entity alignment, attribute synchronization, and edge relationship reconstruction. The specific implementation is as follows:
[0125] First, grammar specification extension adaptation. Real-time monitoring of changes to preset domain-specific grammar specifications; when grammar specification extensions or new grammar rules are detected, the changed content is parsed to obtain the new grammar rules, while retaining backward compatibility with existing grammar rules, ensuring that the normal parsing of existing alarm rules is not affected.
[0126] Secondly, local incremental updates to the knowledge graph. The abstract syntax tree subgraph generated by parsing new alarm rules is mapped to the existing power grid alarm rule knowledge graph. A two-level entity alignment mechanism is used to detect duplicate entities: the first level performs coarse screening by calculating Jaccard similarity based on entity attributes, and the second level performs fine screening by calculating cosine similarity based on node embedding vectors generated by graph neural networks. For duplicate entities with similarity exceeding a preset threshold, attribute merging and entity identification unification are performed, and the reconstruction and topology splicing of corresponding semantic relationship edges are completed simultaneously, realizing local incremental updates to the knowledge graph.
[0127] Third, optimize the incremental invalidation of the inference cache. Maintain the mapping index between the inference results and each sub-region of the graph. When the incremental update affects the corresponding sub-region of the graph, only mark the inference cache item corresponding to that sub-region as invalid, triggering a local recalculation of the inference result corresponding to that region. This avoids the high computational overhead caused by re-inference of the entire graph and improves the inference response efficiency after the update.
[0128] This application provides a method for constructing a power grid alarm rule knowledge graph. By performing path reasoning on the power grid alarm rule knowledge graph, inference results are obtained, including rule consistency verification results, alarm association analysis results, and cross-layer root cause inference results. This effectively improves the execution accuracy and processing efficiency of rule association mining, logical conflict identification, and semantic query tasks. Simultaneously, the power grid alarm rule knowledge graph can be updated in response to new alarm rule events or grammar specification expansion events, thereby continuously ensuring the consistency of rule semantic expression and the business availability of the knowledge graph. This approach not only improves the intelligent processing level of core businesses such as rule verification, alarm association, and root cause inference, but also supports the dynamic evolution of the rule system and grammar specifications, adapting to the application needs of continuous iteration in power grid alarm services.
[0129] Based on any of the above embodiments, taking the intelligent alarm rule management system of a power grid dispatch center as an application scenario, provincial or regional power grid dispatch centers monitor thousands to tens of thousands of alarm rules in real time to detect risks such as equipment overload, voltage anomalies, and communication interruptions. A provincial power grid dispatch center deployed the technical solution of this application to manage the transformer temperature anomaly and voltage fluctuation alarm rules of a substation. This substation has multiple transformers and supporting equipment, including circuit breakers and voltage transformers. The rules processed by the monitoring system include "if the transformer T1 temperature > 80℃ and three voltage fluctuations occur within 10 minutes, an alarm is triggered." Below, in conjunction with... Figure 5 This paper provides a detailed explanation of a method for constructing a knowledge graph of power grid alarm rules through specific examples.
[0130] S501, Obtain power grid alarm rule data.
[0131] S502. Based on the preset domain-specific syntax specifications, perform custom complex syntax parsing on the power grid alarm rule data to generate the corresponding abstract syntax tree.
[0132] According to the preset grammar specifications, the extended Backus-Naur normal form is used to describe the grammar rules, covering logical operators AND, OR, NOT, time window operators (sliding window, session window), topological relation predicates (neighborhood query), and signal aggregation functions (threshold comparison). The rule data is sequentially subjected to lexical analysis to generate word sequences, and grammatical analysis to complete structured parsing, and finally the rule text is transformed into a structured abstract syntax tree.
[0133] Taking the rule "If the temperature of transformer T1 is >80℃ and there are 3 voltage fluctuations within 10 minutes, an alarm will be triggered" as an example, the abstract syntax tree generated by its parsing contains bottom-level leaf nodes and upper-level non-leaf nodes: "temperature >80℃" is parsed as a logical condition node, "3 voltage fluctuations within 10 minutes" is parsed as a time window node, and the logical operator "AND" is parsed as a combination node, which can explicitly express the logical nesting, time window constraints and topological dependencies in the rule.
[0134] S503. Based on the semantic types and hierarchical connections of each node in the abstract syntax tree, a knowledge graph of power grid alarm rules is generated through entity recognition, relation extraction, and attribute encoding.
[0135] By traversing the nodes of the abstract syntax tree, three types of processing are completed: entity recognition, relation extraction, and attribute encoding. Entities such as the alarm source device "Transformer T1" and the measurement signal "Temperature" are extracted, along with constraints such as the threshold "80℃" and the time window "10 minutes". "Transformer T1" is identified as the alarm source entity, and "Temperature > 80℃" is encoded as the threshold parameter entity. Entity recognition is implemented using a BiLSTM-CRF model. After mapping leaf nodes to entities, the semantic relationship edges between entities are determined by combining the semantic types and hierarchical connections of non-leaf nodes in the abstract syntax tree: the subordinate leaf nodes of non-leaf nodes are determined based on their hierarchical relationships, and then the relationship type between corresponding entities is determined based on the semantic types of the non-leaf nodes.
[0136] When a non-leaf node is a logical combination node, the semantic relationship edges between corresponding entities are determined as triggering relationships, such as mapping the "AND" logical operator to a triggering relationship edge; when a non-leaf node is a time constraint node, the corresponding relationship edges are determined as time-series relationships, such as mapping "3 voltage fluctuations within 10 minutes" to a time-series relationship edge; when a non-leaf node is a topological predicate node, the corresponding relationship edges are determined as spatial association relationships. After completing the mapping of all relationship edges by combining the non-terminal symbol node types of the abstract syntax tree, a power grid alarm rule knowledge graph containing alarm source entities, rule logic entities, time constraint entities, and topological association entities is finally constructed and stored in a preset graph database.
[0137] S504. Build a semantic reasoning engine based on the completed knowledge graph.
[0138] After the knowledge graph is constructed, the semantic reasoning engine uses RGAT as its core model. First, it calculates node embeddings for entities in the knowledge graph, obtaining node embedding vectors. Then, combining the semantic relationship edges corresponding to the entities, it performs multi-head attention aggregation on the neighboring node embedding vectors to obtain aggregated embedding vectors. Finally, it performs path reasoning in the knowledge graph based on the aggregated embedding vectors. Path reasoning, combined with a random walk restart algorithm, implements four types of reasoning tasks: rule consistency verification (logical contradiction loop detection), alarm association analysis, rule conflict detection, and cross-layer root cause inference, outputting rule consistency verification results, alarm association analysis results, a list of conflicting rules, and cross-layer root cause inference results. For example, if there is a path conflict between rule A "turn off the device" and rule B "turn on the device" in the knowledge graph, the engine calculates the embedding vector similarity using RGAT and marks them as potential conflicting rule pairs. If multiple alarms share the same upstream root cause node "transformer T1 overload", then this node is determined to be the fault source. Simultaneously, implicit associations between rules are mined through path traversal to form an alarm association network.
[0139] S505. Dynamically update the knowledge graph through an incremental update mechanism.
[0140] When a new alarm rule is added or a grammar specification is extended, the corresponding changed data is acquired, and the power grid alarm rule knowledge graph is updated. The update covers three stages: entity alignment, attribute synchronization, and edge relationship reconstruction. Taking the new rule "If the circuit breaker Q1 is in an abnormal state and the transformer T1 temperature is >80℃, then trigger an alarm" or a grammar extension scenario as an example, the incremental update mechanism automatically parses the abstract syntax tree subgraph corresponding to the new rule and maps it to the existing knowledge graph. After detecting a grammar change, the domain-specific syntax specification is regenerated while retaining compatibility with existing syntax rules. Duplicate entities are detected through a two-level entity alignment algorithm. First, Jaccard similarity is calculated based on entity attributes for coarse screening, and then cosine similarity is calculated based on embedding vectors for fine screening. For example, when "transformer T1" is detected as a duplicate entity, entity alignment is performed and attributes are merged, including the threshold attribute "temperature >80℃".
[0141] During the update process, an inference cache invalidation strategy is also adopted, only marking the graph sub-regions affected by incremental updates and triggering the recalculation of local inference results in the corresponding regions (such as re-verification of conflicting rule pairs), without performing full graph re-inference, thus avoiding the high overhead of full graph recalculation. For the 24 / 7 continuous operation of the power grid dispatch center, new features include rule access, grammar extension adaptation, entity alignment, attribute synchronization, edge relationship reconstruction, local inference recalculation, and compatibility processing with existing graphs. These are executed continuously within the same knowledge graph maintenance process, ensuring consistent correspondence between rule text, abstract syntax tree, graph database storage results, and inference results. This supports the provincial power grid dispatch center in the standardized management of the entire process for transformer T1, circuit breaker Q1, voltage transformers, and related voltage fluctuation alarms within substations.
[0142] S506 Output rule consistency report, alarm association network, root cause location results, and conflict rule list.
[0143] It should be noted that, in Figure 5 The processing steps S501-S506 shown in the embodiments do not constitute a specific limitation on a method for constructing a power grid alarm rule knowledge graph. In other embodiments of this application, a method for constructing a power grid alarm rule knowledge graph may include... Figure 5 The embodiments may include more or fewer steps; for example, a method for constructing a power grid alarm rule knowledge graph may include... Figure 5 Some steps in the embodiments, or, Figure 5 Some steps in the embodiments can be replaced by steps with the same function, or, Figure 5 Some steps in the embodiments can be broken down into multiple steps, etc.
[0144] Figure 6 A schematic diagram of the structure of a device for constructing a power grid alarm rule knowledge graph provided in this application is shown below. Figure 6 As shown, the power grid alarm rule knowledge graph construction device 60 provided in this embodiment includes:
[0145] The acquisition module 601 is used to acquire power grid alarm rule data.
[0146] The syntax tree generation module 602 is used to parse power grid alarm rule data based on a preset domain-specific syntax specification and generate a corresponding abstract syntax tree.
[0147] The graph construction module 603 is used to construct a knowledge graph of power grid alarm rules based on the semantic types and hierarchical connections of each node in the abstract syntax tree.
[0148] In one possible implementation, nodes include leaf nodes at the bottom level of the abstract syntax tree, and non-leaf nodes at the upper levels of the leaf nodes; the graph construction module 603 is specifically used for:
[0149] Based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to an entity of different types.
[0150] Based on the semantic type and hierarchical connection relationship of each non-leaf node, the semantic relationship edges between each entity are determined.
[0151] A knowledge graph of power grid alarm rules is constructed based on entities and semantic relationship edges.
[0152] In one possible implementation, the map construction module 603 is further specifically used for:
[0153] Based on the hierarchical connection relationship of the non-leaf nodes, determine the subordinate leaf nodes located at the next lower level of the non-leaf nodes from each leaf node.
[0154] Based on the semantic type of the non-leaf nodes, determine the semantic relationship edges between the entities corresponding to each subordinate leaf node.
[0155] In one possible implementation, the map construction module 603 is further specifically used for:
[0156] If the semantic type of a non-leaf node is a logical composite node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined as triggering relationships.
[0157] If the semantic type of a non-leaf node is a time-constrained node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be time-series relationships.
[0158] If the semantic type of a non-leaf node is a topological predicate node, then the semantic relationship edges between the entities corresponding to each subordinate leaf node are determined to be spatial association relationships.
[0159] In one possible implementation, the acquisition module 601 is further configured to acquire the corresponding change data in response to an alarm rule addition event or a grammar specification extension event.
[0160] Correspondingly, the graph construction module 603 is also used to update the power grid alarm rule knowledge graph based on the changing data; the update includes entity alignment, attribute synchronization and edge relationship reconstruction.
[0161] In one possible implementation, the device further includes a reasoning module, specifically used for:
[0162] Node embedding is performed on entities in the power grid alarm rule knowledge graph to obtain node embedding vectors.
[0163] Based on the node embedding vector and the semantic relationship edges corresponding to the entities, the aggregate embedding vector is obtained.
[0164] Based on the aggregated embedding vectors, path reasoning is performed on the knowledge graph of power grid alarm rules to obtain the reasoning results.
[0165] In one possible implementation, the inference results include rule consistency verification results, alarm correlation analysis results, and cross-layer root cause inference results.
[0166] In one possible implementation, the acquisition module 601 is further configured to acquire a multimodal auxiliary data source; the multimodal auxiliary data source includes a power grid equipment topology diagram, historical alarm logs, and real-time operating data.
[0167] Correspondingly, the map construction module 603 is also specifically used for:
[0168] Based on the semantic type of each leaf node, feature extraction and fusion are performed on the multimodal auxiliary data source to obtain the feature information of the entity corresponding to each leaf node.
[0169] Based on feature information, each leaf node is mapped to a different type of entity.
[0170] This embodiment provides a device for constructing a power grid alarm rule knowledge graph, which can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0171] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0172] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0173] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0174] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0175] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0176] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0177] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0178] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0179] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0180] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0181] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0182] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0183] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0184] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0185] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0186] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for constructing a knowledge graph of power grid alarm rules, characterized in that, include: Obtain power grid alarm rule data; The power grid alarm rule data is parsed based on a preset domain-specific syntax specification to generate a corresponding abstract syntax tree; Based on the semantic types and hierarchical connections of each node in the abstract syntax tree, a knowledge graph of power grid alarm rules is constructed.
2. The method according to claim 1, characterized in that, The node includes the leaf nodes at the bottom level of the abstract syntax tree, and the non-leaf nodes located at the upper level of the leaf nodes; The construction of a power grid alarm rule knowledge graph based on the semantic types and hierarchical connections of each node in the abstract syntax tree includes: Based on the semantic type of each leaf node, each leaf node in the abstract syntax tree is mapped to an entity of a different type. Based on the semantic type and hierarchical connection relationship of each of the non-leaf nodes, the semantic relationship edges between the entities are determined; Based on the entities and the semantic relationship edges, a knowledge graph of power grid alarm rules is constructed.
3. The method according to claim 2, characterized in that, The step of determining the semantic relationship edges between the entities based on the semantic type and hierarchical connection relationship of each of the non-leaf nodes includes: Based on the hierarchical connection relationship of the non-leaf nodes, determine the subordinate leaf nodes located at the next lower level of the non-leaf nodes from each of the leaf nodes; Based on the semantic type of the non-leaf nodes, determine the semantic relationship edges between the entities corresponding to each of the subordinate leaf nodes.
4. The method according to claim 3, characterized in that, The step of determining the semantic relationship edges between the entities corresponding to each subordinate leaf node based on the semantic type of the non-leaf node includes: If the semantic type of the non-leaf node is a logical composite node, then the semantic relationship edge between the entities corresponding to each subordinate leaf node is determined to be a trigger relationship; If the semantic type of the non-leaf node is a time-constrained node, then the semantic relationship edge between the entities corresponding to each of the subordinate leaf nodes is determined to be a temporal relationship; If the semantic type of the non-leaf node is a topological predicate node, then the semantic relationship edge between the entities corresponding to each subordinate leaf node is determined to be a spatial association relationship.
5. The method according to claim 2, characterized in that, After constructing the power grid alarm rule knowledge graph, the method further includes: In response to new events in alarm rules or extensions in grammar rules, obtain the corresponding change data; Based on the changed data, update the power grid alarm rule knowledge graph; The update includes entity alignment, attribute synchronization, and edge relationship reconstruction.
6. The method according to claim 2, characterized in that, After constructing the power grid alarm rule knowledge graph, the method further includes: Node embedding is performed on the entities in the power grid alarm rule knowledge graph to obtain node embedding vectors; Based on the node embedding vector and the semantic relationship edges corresponding to the entity, an aggregate embedding vector is obtained; Based on the aggregated embedding vector, path reasoning is performed on the power grid alarm rule knowledge graph to obtain the reasoning result.
7. The method according to claim 6, characterized in that, The reasoning results include rule consistency verification results, alarm correlation analysis results, and cross-layer root cause inference results.
8. The method according to claim 2, characterized in that, The step of mapping each leaf node in the abstract syntax tree to different types of entities based on the semantic type of each leaf node includes: Acquire multimodal auxiliary data sources; the multimodal auxiliary data sources include power grid equipment topology diagrams, historical alarm logs, and real-time operating data; Based on the semantic type of each leaf node, feature extraction and fusion are performed on the multimodal auxiliary data source to obtain the feature information of the entity corresponding to each leaf node; Based on the aforementioned feature information, each leaf node is mapped to an entity of a different type.
9. A device for constructing a knowledge graph of power grid alarm rules, characterized in that, include: The acquisition module is used to acquire power grid alarm rule data; The syntax tree generation module is used to parse the power grid alarm rule data based on a preset domain-specific syntax specification and generate a corresponding abstract syntax tree; The graph construction module is used to construct a knowledge graph of power grid alarm rules based on the semantic types and hierarchical connections of each node in the abstract syntax tree.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 8.