An operation order checking method based on a knowledge graph, topology analysis and RAG
By constructing a dynamic power grid knowledge graph and multi-source knowledge retrieval, and combining it with a large language model for cross-source causal reasoning, the accuracy problem of traditional power system operation ticket verification methods under complex operating conditions is solved, realizing full-chain safety assessment and cascading fault prevention for power grid operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID GANSU ELECTRIC POWER RESEARCH INSTITUTE
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional power system operation ticket verification methods cannot dynamically determine the feasibility of operation based on the current equipment status, resulting in inaccurate verification results under complex or abnormal operating conditions. They fail to effectively prevent cascading faults and do not consider indirect risks such as power flow shifts, voltage over-limits, or protection coordination failures that may occur after the operation.
A dynamic power grid knowledge graph is constructed that integrates static topology of power grid equipment, real-time operating status of SCADA, and physical operating constraints of the power grid. Structured operation sequences are generated through semantic parsing and topology analysis. Combined with power flow impact analysis and multi-source knowledge retrieval, cross-source causal reasoning is performed using a large language model to generate structured verification results containing risk scores. Finally, risk accumulation path analysis is performed through an operation risk propagation graph.
It achieves accurate semantic modeling of the power grid operation status, proactively identifies cascading risks caused by operations, improves the contextual understanding capability and expert-level decision-making level of the verification system, and effectively prevents cascading failures by leaping from single-step compliance to full-chain security.
Smart Images

Figure CN122246712A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, and in particular to an operation ticket verification method based on knowledge graphs, topology analysis, and RAG. Background Technology
[0002] Power system automation technology refers to a technical system that uses computer, communication, control and artificial intelligence technologies to automatically monitor, analyze, make decisions and control equipment and processes in power generation, transmission, transformation, distribution and consumption. Its core objective is to improve the safety, reliability, economy and intelligence of power grid operation. Typical applications include substation integrated automation, dispatch automation (SCADA / EMS), distribution network automation, relay protection automation and intelligent operation and maintenance, etc., and it is a key supporting technology for the construction of modern smart grids.
[0003] Traditional methods are based on fixed safety regulations for matching, which cannot dynamically determine the feasibility of operation based on the current equipment status. This leads to inaccurate verification results under complex or abnormal operating conditions. Furthermore, existing verification only verifies whether the object being operated is isolated, without considering indirect risks such as power flow shifts, voltage overruns, or protection coordination failures that may occur after the operation, making it difficult to prevent cascading failures. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an operation ticket verification method based on knowledge graphs, topology analysis, and RAG to solve the problem that traditional methods rely on fixed safety regulations for matching, which cannot dynamically determine the feasibility of operation based on the current equipment status. This leads to inaccurate verification results under complex or abnormal operating conditions. Furthermore, existing verification methods only verify whether the operation object is isolated, without considering indirect risks such as power flow shift, voltage over-limit, or protection coordination failure that may occur after the operation, making it difficult to prevent cascading failures.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for verifying operation tickets based on knowledge graphs, topological analysis, and RAG, comprising:
[0008] Construct a dynamic power grid knowledge graph that integrates the static topology of power grid equipment, the real-time operating status of SCADA systems, and the physical operating constraints of the power grid;
[0009] Receive operation tickets to be verified and perform semantic parsing on the operation steps, map the operation objects to equipment entities in the dynamic power grid knowledge graph, and obtain a structured operation sequence;
[0010] Based on the current equipment status and connection relationships of the dynamic power grid knowledge graph, a restricted topology traversal is performed on each operation step in the structured operation sequence, and the corresponding operation influence domain is generated by combining power flow impact analysis.
[0011] Based on the operation steps in the structured operation sequence, the real-time operating status of the corresponding devices in the operation impact domain, external risk information, and historical operation context, a contextualized query vector is constructed.
[0012] Contextualized query vectors are used to perform multi-source knowledge retrieval in the code clause database, historical accident case database, and expert experience database to obtain relevant knowledge fragments.
[0013] Relevant knowledge fragments and the current power grid operation scenario are input into the large language model, and structured verification results containing risk scores are generated through cross-source causal reasoning.
[0014] Based on the logical dependencies between the operation steps in the structured operation sequence, an operation risk propagation graph is constructed. Using the operation risk propagation graph, each operation step is treated as a node and the order of operations is treated as directed edges. Risk accumulation path analysis is performed based on the risk score of each node to identify the combination of steps in the operation sequence that may have the potential for risk exceeding limits or cascading failures. An operation ticket verification report containing an overall operation chain security assessment is output.
[0015] As a preferred embodiment of the operation ticket verification method based on knowledge graph, topology analysis, and RAG described in this invention, the construction of a dynamic power grid knowledge graph that integrates the static topology of power grid equipment, the real-time operating status of SCADA, and the physical operating constraints of the power grid specifically includes:
[0016] Define the entity types of core power grid equipment, including circuit breakers, disconnect switches, busbars, transformers, and transmission lines;
[0017] Establish electrical connection relationships, protection coordination relationships, and bay relationships between equipment entities based on entity type;
[0018] The system interface of SCADA acquires the switch opening status, voltage amplitude, current amplitude and active power of each device at fixed intervals, and writes the acquired data into the dynamic attribute field of the corresponding device entity.
[0019] Encode the physical rules of power grid operation into computable logical expressions and embed them into relational edge attributes;
[0020] For any circuit breaker Disconnecting switch directly connected in series with it Define the logical expression for operational safety constraints:
[0021] ;
[0022] in, Indicates circuit breaker The tripping status is indicated by a value of 1, which means the circuit is tripped, and a value of 0, which means the circuit is closed. Indicates disconnect switch The operability flag has a value of 1 indicating that the pulling and closing operation is allowed, and a value of 0 indicating that the operation is prohibited.
[0023] The thermal stability constraint of the transmission line is expressed as an inequality rule and associated with the corresponding line entity, that is, the real-time current of the line must not exceed its maximum allowable current carrying capacity, thus forming the physical operating boundary conditions.
[0024] Based on the physical operating boundary conditions, all entities, relationships, dynamic attributes, and constraint rules are stored in a graph database to form a dynamic power grid knowledge graph.
[0025] As a preferred embodiment of the operation ticket verification method based on knowledge graph, topology analysis, and RAG described in this invention, the step of receiving the operation ticket to be verified and performing semantic parsing on the operation steps to map the operation object to the equipment entity in the dynamic power grid knowledge graph, thereby obtaining a structured operation sequence, specifically includes:
[0026] Perform word segmentation and part-of-speech tagging on each sentence of the operation ticket text;
[0027] A pre-trained named entity recognition model in the power industry is used to extract operation verbs and equipment name strings from operation tickets after word segmentation and part-of-speech tagging.
[0028] Retrieve candidate device entities whose names contain the string of the device name in the dynamic power grid knowledge graph;
[0029] Candidate equipment entities are filtered based on the substation name, voltage level value, and bay identifier appearing in the operation ticket context, retaining the unique matching equipment entity and obtaining the equipment entity identifier.
[0030] The operation verbs are compared with a preset operation intent template library to determine the operation target type; the operation target type includes isolation, grounding, transfer for maintenance or restoration of operation;
[0031] Output a structured sequence of operations consisting of device entity identifiers, operation verbs, and operation target types, in the original order of the operation ticket.
[0032] As a preferred embodiment of the operation ticket verification method based on knowledge graph, topology analysis, and RAG described in this invention, wherein: based on the current equipment status and connection relationships of the dynamic power grid knowledge graph, a restricted topology traversal is performed on each operation step in the structured operation sequence, combined with power flow impact analysis, to generate a corresponding operation influence domain, specifically:
[0033] In the structured operation sequence, the first The target device of each operation step is the starting node. A breadth-first search is performed in the dynamic power grid knowledge graph to obtain a preliminary set of electrically connected devices. The breadth-first search includes: expanding only along the currently energized electrical paths that are not under maintenance, and terminating the traversal in that direction when a path branch with a tripped circuit breaker or a closed grounding switch is encountered.
[0034] Calculate the power flow transfer to adjacent lines caused by the operation of each transmission line in the initial set of electrically connected equipment. When the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity exceeds a preset sensitivity threshold, add that adjacent line and all its connected equipment to the influence range, forming an operational influence domain that includes directly operated equipment, electrically connected equipment, and power flow sensitive equipment. The expression comparing the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity with the preset sensitivity threshold is as follows:
[0035] ;
[0036] in, This indicates the change in adjacent line current caused by the current operation. This indicates the maximum allowable current carrying capacity of the adjacent line. This is the preset power flow sensitivity threshold.
[0037] As a preferred embodiment of the operation ticket verification method based on knowledge graphs, topology analysis, and RAG described in this invention, the construction of a contextualized query vector based on the operation steps, the real-time operating status of the corresponding equipment within the operation's influence domain, external risk information, and historical operation context specifically involves:
[0038] Semantic encoding of the operation steps yields the operation embedding vector;
[0039] The real-time operating status data of all devices within the operational influence domain are normalized and concatenated to form a status feature vector;
[0040] External risk alarm information that overlaps with the spatial location of the operational impact domain is obtained from the intelligent monitoring platform. The alarm type and confidence level of the alarm information are extracted and converted into risk semantic vectors through the embedding layer.
[0041] Retrieve historical verification records within the past 30 days that are similar to the current operational scenario, and calculate their average risk score as a historical context scalar.
[0042] The operation embedding vector, state feature vector, risk semantic vector and historical context scalar are fused into high-dimensional joint features;
[0043] Contextualized query vectors are generated by performing nonlinear transformations on high-dimensional joint features using a single-layer neural network.
[0044] The expression for the nonlinear transformation is:
[0045] ;
[0046] In the formula, This represents the concatenated high-dimensional joint feature vector. Represents the learnable weight matrix. This represents the bias vector. This represents the contextualized query vector of the final output. It is the hyperbolic tangent activation function.
[0047] As a preferred embodiment of the operation ticket verification method based on knowledge graphs, topology analysis, and RAG described in this invention, the method of using contextualized query vectors to perform multi-source knowledge retrieval in the procedure clause database, historical accident case database, and expert experience database to obtain relevant knowledge fragments specifically includes:
[0048] The text of national and enterprise dispatching procedures is segmented into independent clauses. Each clause is compressed into a semantic summary using a summary generation model, and then converted into a vector using a unified embedding model and stored in the procedure clause vector library.
[0049] The operational scenarios, causes of failures, and handling measures in historical accident reports are extracted into structured triples, which are then embedded after generating natural language descriptions and stored in the historical accident case vector library.
[0050] The text of typical operational taboos and emergency suggestions written by experts is directly embedded and stored in the expert experience vector library;
[0051] Using contextualized query vectors, maximum inner product search is performed in the code clause vector library, historical accident case vector library, and expert experience vector library, respectively. The original text content and source tags of the top five most similar items are retained in each library, forming three sets of knowledge fragments.
[0052] As a preferred embodiment of the operation ticket verification method based on knowledge graphs, topology analysis, and RAG described in this invention, the step of inputting relevant knowledge fragments and the current power grid operation scenario into a large language model, and generating a structured verification result containing risk scores through cross-source causal reasoning, specifically involves:
[0053] Organize the prompt text according to the preset template. The content includes a description of the current operation, a summary of the status of key equipment in the operation's impact domain, the type and confidence level of external risks, relevant procedural clauses, a summary of historical cases, and expert advice.
[0054] The prompt text is input into a large language model that has been fine-tuned with a power dispatch corpus.
[0055] The output of the constrained large language model is in standard JSON format, including a security judgment boolean value, an integer risk score, the cause of the natural language risk, and specific operational suggestions;
[0056] The model output is analyzed to obtain the structured verification results of the corresponding operation steps;
[0057] Introducing a knowledge credibility weighting mechanism to improve reasoning consistency, and defining a comprehensive risk scoring expression:
[0058] ;
[0059] in, This represents the risk component derived from the procedural clauses, which is quantified and output by the large language model based on the degree of matching between the retrieved procedural clauses and the current operation. This represents the risk component based on historical case matching, which is quantified and output by the large language model according to the similarity between historical accident cases and the current situation; This represents the risk component inferred from expert experience, which is quantified by the large language model based on the urgency and applicability of expert advice. , , The credibility weight of the corresponding knowledge source;
[0060] The credibility weight , , The system will be dynamically adjusted based on the current complexity of the power grid operation, specifically as follows:
[0061] When the power grid is in an N-1 fault or maintenance overlap state To enhance the reference value of historical cases, when the confidence level of external risk warnings exceeds 0.8, Increase the priority of expert experience.
[0062] As a preferred embodiment of the operation ticket verification method based on knowledge graphs, topology analysis, and RAG described in this invention, the following steps are described: An operation risk propagation graph is constructed based on the logical dependencies between operation steps in a structured operation sequence. Using this graph, each operation step is treated as a node, and the order of operations is represented by directed edges. Risk accumulation path analysis is performed based on the risk scores of each node to identify combinations of steps in the operation sequence that may exceed risk limits or experience cascading failures. An operation ticket verification report containing an overall operation chain security assessment is then output. Specifically:
[0063] A directed graph is constructed in the order of the structured operation sequence, with nodes corresponding to each operation step and directed edges representing the order of operations.
[0064] Assign a risk score from the structured verification results to each node;
[0065] The importance weight of the equipment is pre-set according to its voltage level and its pivotal role in the power grid;
[0066] The cumulative risk value is calculated recursively from front to back along the directed edge;
[0067] The accumulation process is described by the following risk propagation model, expressed as follows:
[0068] ;
[0069] in, Indicates the first The cumulative risk value of each step of the operation. This indicates the initial risk score for this step. This represents the cumulative risk value from the previous step. This is the historical risk attenuation coefficient. Indicates the first The importance weight of each step operation target device. This refers to the equipment weighting coefficient;
[0070] If any Exceeding the preset safety threshold If the risk scores of three consecutive operational steps show a strictly monotonically increasing trend, then the subsequence is marked as a high-risk operational chain.
[0071] List all high-risk operation chains and their corresponding cumulative risk values in the verification report, and insert manual confirmation points or adjust the operation sequence;
[0072] Introducing a risk growth rate indicator to quantify the probability of cascading failure, the expression is:
[0073] ;
[0074] in, This represents the average growth rate of risk over three consecutive operations. and If so, it is determined that there is a cascading risk upward trend. This is the preset growth rate threshold.
[0075] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the operation ticket verification method based on knowledge graph, topology analysis and RAG as described in the first aspect of the present invention.
[0076] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the operation ticket verification method based on knowledge graph, topology analysis and RAG as described in the first aspect of the present invention.
[0077] The beneficial effects of this invention are as follows: By constructing a dynamic power grid knowledge graph that integrates real-time status and physical constraints, accurate semantic modeling of the power grid operation status is achieved. The introduction of the Operation Influence Domain (OIZ) dynamic topology reasoning mechanism breaks through the limitations of traditional static topology verification and can proactively identify the chain risks caused by operations. Combined with RAG-driven multi-source knowledge collaborative retrieval and cross-source causal reasoning of large language models, the contextual understanding ability and expert-level decision-making level of the verification system are effectively improved. Through the operation risk propagation graph, the temporal risk accumulation analysis of the operation sequence is carried out, realizing the leap from single-step compliance to full-chain security. Attached Figure Description
[0078] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0079] Figure 1 This is a flowchart of the operation ticket verification method based on knowledge graph, topology analysis and RAG in Example 1. Detailed Implementation
[0080] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0081] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0082] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0083] Example 1, referring to Figure 1This is one embodiment of the present invention, which provides a method for verifying operation tickets based on knowledge graphs, topology analysis, and RAG, including the following steps:
[0084] S1. Construct a dynamic power grid knowledge graph that integrates the static topology of power grid equipment, the real-time operating status of SCADA, and the physical operating constraints of the power grid.
[0085] Furthermore, the entity types of core power grid equipment are defined, including circuit breakers, disconnectors, busbars, transformers, and transmission lines;
[0086] Establish electrical connection relationships, protection coordination relationships, and bay relationships between equipment entities based on entity type;
[0087] The system interface of SCADA acquires the switch opening status, voltage amplitude, current amplitude and active power of each device at fixed intervals, and writes the acquired data into the dynamic attribute field of the corresponding device entity.
[0088] Encode the physical rules of power grid operation into computable logical expressions and embed them into relational edge attributes;
[0089] For any circuit breaker Disconnecting switch directly connected in series with it Define the logical expression for operational safety constraints:
[0090] ;
[0091] in, Indicates circuit breaker The tripping status is indicated by a value of 1, which means the circuit is tripped, and a value of 0, which means the circuit is closed. Indicates disconnect switch The operability flag has a value of 1 indicating that the pulling and closing operation is allowed, and a value of 0 indicating that the operation is prohibited.
[0092] The thermal stability constraint of the transmission line is expressed as an inequality rule and associated with the corresponding line entity, that is, the real-time current of the line must not exceed its maximum allowable current carrying capacity, thus forming the physical operating boundary conditions.
[0093] Based on the physical operating boundary conditions, all entities, relationships, dynamic attributes, and constraint rules are stored in a graph database to form a dynamic power grid knowledge graph.
[0094] It should be noted that by deeply integrating the static topology of power grid equipment, real-time SCADA data, and physical operation constraints into a unified knowledge graph, not only is the semantic expression of equipment relationships realized, but the graph also possesses dynamic perception and rule-based reasoning capabilities. This dynamic power grid knowledge graph can reflect the real operating status of the power grid in real time and embeds operational safety boundaries, providing a high-fidelity, computable knowledge base for subsequent topology analysis and intelligent verification, effectively improving the accuracy and credibility of the verification results.
[0095] In particular, the construction of this dynamic power grid knowledge graph is not simply a matter of splicing static equipment ledgers with real-time data. Instead, it embeds physical operating rules into graph relation attributes in a computable form, giving the graph itself an inherent consistency verification capability. This design enables knowledge representation not only to describe what something is, but also to determine whether something is possible, thereby preventing instructions that violate basic operational logic from entering subsequent processes at the source. Its feasibility stems from the support of modern graph databases for attribute graph models and rule engines, as well as the widespread adoption of standardized interfaces for SCADA systems, making the synchronous updating of real-time status and semantic relationships possible.
[0096] S2. Receive the operation ticket to be verified and perform semantic parsing on the operation steps. Map the operation object to the equipment entity in the dynamic power grid knowledge graph to obtain a structured operation sequence.
[0097] Furthermore, the operation ticket text is segmented and tagged with parts of speech sentence by sentence;
[0098] A pre-trained named entity recognition model in the power industry is used to extract operation verbs and equipment name strings from operation tickets after word segmentation and part-of-speech tagging.
[0099] Retrieve candidate device entities whose names contain the string of the device name in the dynamic power grid knowledge graph;
[0100] Candidate equipment entities are filtered based on the substation name, voltage level value, and bay identifier appearing in the operation ticket context, retaining the unique matching equipment entity and obtaining the equipment entity identifier.
[0101] The operation verbs are compared with a preset operation intent template library to determine the operation target type; the operation target type includes isolation, grounding, transfer for maintenance or restoration of operation;
[0102] Output a structured sequence of operations consisting of device entity identifiers, operation verbs, and operation target types, in the original order of the operation ticket.
[0103] It should be noted that by using a pre-trained named entity recognition model in the power field combined with multi-dimensional context for equipment entity disambiguation, the problems of ambiguous equipment names, abbreviations, or the same name for different stations in the operation ticket are effectively solved. By generating structured operation sequences, unstructured natural language instructions are transformed into machine-understandable operation intent tuples, laying a data foundation for subsequent automated and accurate verification and avoiding misjudgments caused by semantic misunderstandings.
[0104] In particular, the semantic parsing process of the operation ticket adopts a multi-level context disambiguation mechanism. Its core lies in using the inherent hierarchical structure of the power system as a natural namespace to effectively isolate semantic conflicts between devices with the same name. The reason why this method can accurately map natural language to unique device entities is that the dispatch operation ticket itself has a highly structured and standardized writing style. Combined with the domain pre-trained model's ability to understand professional terms, the accuracy of entity linking is significantly higher than that of general text scenarios. This provides a reliable prerequisite for subsequent automated verification.
[0105] S3. Based on the current equipment status and connection relationship of the dynamic power grid knowledge graph, perform restricted topology traversal for each operation step in the structured operation sequence, and generate the corresponding operation influence domain by combining power flow influence analysis.
[0106] Furthermore, taking the first step in the structured operation sequence as an example... The target device of each operation step is the starting node. A breadth-first search is performed in the dynamic power grid knowledge graph to obtain a preliminary set of electrically connected devices. The breadth-first search includes: expanding only along the currently energized electrical paths that are not under maintenance, and terminating the traversal in that direction when a path branch with a tripped circuit breaker or a closed grounding switch is encountered.
[0107] Calculate the power flow transfer to adjacent lines caused by the operation of each transmission line in the initial set of electrically connected equipment. When the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity exceeds a preset sensitivity threshold, add that adjacent line and all its connected equipment to the influence range, forming an operational influence domain that includes directly operated equipment, electrically connected equipment, and power flow sensitive equipment. The expression comparing the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity with the preset sensitivity threshold is as follows:
[0108] ;
[0109] in, This indicates the change in adjacent line current caused by the current operation. This indicates the maximum allowable current carrying capacity of the adjacent line. This is the preset power flow sensitivity threshold.
[0110] It should be noted that the introduction of an operational influence domain generation mechanism that combines restricted topology traversal with power flow impact analysis breaks through the limitations of traditional static topology verification that relies solely on electrical connectivity. The method can not only identify directly electrically connected devices, but also capture indirect risk devices caused by power flow transfer, thereby comprehensively defining operational safety boundaries and effectively preventing cascading failures such as overload, undervoltage, or protection malfunctions caused by ignoring system-level coupling effects.
[0111] In particular, the generation of the operational influence domain integrates topological reachability and electrical coupling effects. Its underlying logic is to acknowledge that the power grid is a strongly coupled dynamic system, where changes in the state of a single device can trigger a global response through electromagnetic relationships. Traditional verification only focuses on electrical connectivity, ignoring devices that are not directly connected but are affected by power flow redistribution. This solution, however, introduces simplified power flow sensitivity analysis to efficiently identify potential risk areas without relying on complete power flow calculations. This design has good engineering feasibility because it only requires local topology and a small number of real-time measurements to complete an approximate assessment.
[0112] S4. Construct a contextualized query vector based on the operation steps in the structured operation sequence, the real-time operating status of the corresponding devices in the operation impact domain, external risk information, and historical operation context.
[0113] Furthermore, the operation steps are semantically encoded to obtain operation embedding vectors;
[0114] The real-time operating status data of all devices within the operational influence domain are normalized and concatenated to form a status feature vector;
[0115] External risk alarm information that overlaps with the spatial location of the operational impact domain is obtained from the intelligent monitoring platform. The alarm type and confidence level of the alarm information are extracted and converted into risk semantic vectors through the embedding layer.
[0116] Retrieve historical verification records within the past 30 days that are similar to the current operational scenario, and calculate their average risk score as a historical context scalar.
[0117] The operation embedding vector, state feature vector, risk semantic vector and historical context scalar are fused into high-dimensional joint features;
[0118] Contextualized query vectors are generated by performing nonlinear transformations on high-dimensional joint features using a single-layer neural network.
[0119] The expression for the nonlinear transformation is:
[0120] ;
[0121] In the formula, This represents the concatenated high-dimensional joint feature vector. Represents the learnable weight matrix. This represents the bias vector. This represents the contextualized query vector of the final output. It is the hyperbolic tangent activation function.
[0122] It should be noted that by integrating operational semantics, real-time device status, external visual risks, and historical context to construct contextualized query vectors, retrieval requests possess strong scene awareness capabilities. These vectors can accurately activate the knowledge fragments most relevant to the current complex operating conditions, effectively improving the relevance and targeting of RAG retrieval, avoiding the return of generalized or irrelevant entries in the massive procedure library, and providing reliable input for high-quality reasoning.
[0123] In particular, the construction of contextualized query vectors is essentially a multimodal context compression mechanism. Its innovation lies in mapping heterogeneous information to the same semantic space. This fusion is not a simple feature splicing, but rather a learning of the correlation weights between various modalities through neural networks, so that the final query vector can reflect the real risk situation of the current operation. The reason why the method is superior to traditional keyword retrieval is that it captures the deep semantics of under what conditions a certain rule applies, thereby activating more realistic knowledge fragments.
[0124] S5. Utilize contextualized query vectors to perform multi-source knowledge retrieval in the code clause database, historical accident case database, and expert experience database to obtain relevant knowledge fragments.
[0125] Furthermore, the text of national and enterprise dispatching procedures is segmented into independent clauses. Each clause is compressed into a semantic summary using a summary generation model, and then converted into a vector using a unified embedding model and stored in the procedure clause vector library.
[0126] The operational scenarios, causes of failures, and handling measures in historical accident reports are extracted into structured triples, which are then embedded after generating natural language descriptions and stored in the historical accident case vector library.
[0127] The text of typical operational taboos and emergency suggestions written by experts is directly embedded and stored in the expert experience vector library;
[0128] Using contextualized query vectors, maximum inner product search is performed in the code clause vector library, historical accident case vector library, and expert experience vector library, respectively. The original text content and source tags of the top five most similar items are retained in each library, forming three sets of knowledge fragments.
[0129] It should be noted that by constructing independent vector libraries for three types of heterogeneous knowledge—procedures, cases, and expert experience—and conducting parallel retrieval, decoupled management and collaborative invocation of multi-source knowledge are achieved. This design not only preserves the original semantic integrity of various types of knowledge but also supports weighted fusion as needed, making the verification basis both normative, empirical, and experiential, effectively improving the system's adaptability and robustness in complex, rare, or boundary scenarios.
[0130] In particular, the independent construction and parallel retrieval strategy of the three types of knowledge bases reflect respect for the essential differences between different types of knowledge: procedures are mandatory norms, cases are empirical experience, and expert advice is heuristic guidance; mixing the three in the same vector space will lead to semantic confusion and retrieval bias; after separate management, the system can dynamically decide which type of knowledge to trust based on the current situation, such as relying more on expert experience in the operation of new equipment and prioritizing the follow of procedures in routine switching operations; the decoupled design enhances the system's adaptability and interpretive transparency.
[0131] S6. Input relevant knowledge fragments and the current power grid operation scenario into the large language model, and generate structured verification results including risk scores through cross-source causal reasoning.
[0132] Furthermore, the prompt text is organized according to a preset template, including a description of the current operation, a summary of the status of key equipment in the operation's impact domain, the type and confidence level of external risks, relevant procedural clauses, a summary of historical cases, and expert advice.
[0133] Input the prompt text into a large language model that has been fine-tuned with a power dispatch corpus;
[0134] The output of the constrained large language model is in standard JSON format, including a security judgment boolean value, an integer risk score, the cause of the natural language risk, and specific operational suggestions;
[0135] The model output is analyzed to obtain the structured verification results of the corresponding operation steps;
[0136] Introducing a knowledge credibility weighting mechanism to improve reasoning consistency, and defining a comprehensive risk scoring expression:
[0137] ;
[0138] in, This represents the risk component derived from the procedural clauses, which is quantified and output by the large language model based on the degree of matching between the retrieved procedural clauses and the current operation. This represents the risk component based on historical case matching, which is quantified and output by the large language model according to the similarity between historical accident cases and the current situation; This represents the risk component inferred from expert experience, which is quantified by the large language model based on the urgency and applicability of expert advice. , , The credibility weight of the corresponding knowledge source;
[0139] The credibility weight , , The system will be dynamically adjusted based on the current complexity of the power grid operation, specifically as follows:
[0140] When the power grid is in an N-1 fault or maintenance overlap state To enhance the reference value of historical cases, when the confidence level of external risk warnings exceeds 0.8, Increase the priority of expert experience.
[0141] It should be noted that by using a large language model to perform cross-source causal reasoning on multi-source knowledge fragments and the current power grid context, and by introducing a credible weight mechanism that dynamically adjusts based on operational complexity, risk scoring is no longer a simple rule matching result, but a comprehensive judgment that integrates rule compliance, historical similarity, and the urgency of expert experience. The mechanism effectively suppresses the bias of a single knowledge source and automatically strengthens more reliable knowledge sources in high-risk scenarios such as N-1 faults and external construction, effectively improving the rationality of the verification conclusions and the decision support value.
[0142] Specifically, the large language model is not used as a black-box decision-maker, but as a comprehensive reasoning engine based on multi-source evidence. Its input consists of carefully organized prompt templates to ensure that the model focuses on safety verification tasks rather than being generated arbitrarily. By constraining the output format and introducing a credible weight mechanism, the model's reasoning process is made controllable and traceable. The design is feasible because the fine-tuned model has internalized the causal logic in a large amount of power dispatch corpus, enabling it to make reasonable risk attributions in a given context, rather than making conjectures out of thin air.
[0143] S7. Based on the logical dependencies between the operation steps in the structured operation sequence, construct an operation risk propagation graph. Using the operation risk propagation graph, with each operation step as a node and the order of operations as directed edges, perform risk accumulation path analysis based on the risk score of each node to identify the combination of steps in the operation sequence that may have the possibility of exceeding risk limits or cascading failures, and output an operation ticket verification report that includes an overall operation chain security assessment.
[0144] Furthermore, a directed graph is constructed in the order of the structured operation sequence, with nodes corresponding to each operation step and directed edges representing the order of operations.
[0145] Assign a risk score from the structured verification results to each node;
[0146] The importance weight of the equipment is pre-set according to its voltage level and its pivotal role in the power grid;
[0147] The cumulative risk value is calculated recursively from front to back along the directed edge;
[0148] The accumulation process is described by the following risk propagation model, expressed as:
[0149] ;
[0150] in, Indicates the first The cumulative risk value of each step of the operation. This indicates the initial risk score for this step. This represents the cumulative risk value from the previous step. This is the historical risk attenuation coefficient. Indicates the first The importance weight of each step operation target device. This refers to the equipment weighting coefficient;
[0151] If any Exceeding the preset safety threshold If the risk scores of three consecutive operational steps show a strictly monotonically increasing trend, then the subsequence is marked as a high-risk operational chain.
[0152] List all high-risk operation chains and their corresponding cumulative risk values in the verification report, and insert manual confirmation points or adjust the operation sequence;
[0153] Introducing a risk growth rate indicator to quantify the probability of cascading failure, the expression is:
[0154] ;
[0155] in, This represents the average growth rate of risk over three consecutive operations. and If so, it is determined that there is a cascading risk upward trend. This is the preset growth rate threshold.
[0156] It should be noted that an operational risk propagation graph is constructed with operational steps as nodes and risk scores as attributes. A cumulative risk recursive model and a risk growth rate indicator are introduced to achieve a temporal evolution analysis of the risk of the entire sequence of operational tickets. The method can proactively identify hidden high-risk operational chains that are compliant in a single step but dangerous overall, such as combinations of steps where risks continue to accumulate or accelerate. This prevents cascading operational accidents from the source and achieves a fundamental improvement from local verification to global safety assessment.
[0157] In particular, the introduction of the operational risk propagation graph marks a shift in the verification paradigm from point-based verification to chain-based evaluation. The underlying idea is that the security of an operational ticket depends not only on whether each step is compliant, but also on whether the interaction between steps accumulates risk. By constructing a directed graph and recursively calculating risk values, the system can simulate the overall review process of human experts on operational sequences. The method can discover operational patterns that seem reasonable on a single step, but lead to system vulnerability when combined.
[0158] This embodiment also provides a computer device applicable to the operation ticket verification method based on knowledge graph, topology analysis, and RAG, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the operation ticket verification method based on knowledge graph, topology analysis, and RAG as proposed in the above embodiment.
[0159] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0160] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements the operation ticket verification method based on knowledge graphs, topology analysis, and RAG as proposed in the above embodiments. The 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 Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0161] In summary, this invention achieves accurate semantic modeling of the power grid's operational status by constructing a dynamic power grid knowledge graph that integrates real-time state and physical constraints. It introduces an Operation Influence Domain (OIZ) dynamic topology reasoning mechanism, which overcomes the limitations of traditional static topology verification and can proactively identify cascading risks caused by operations. Combined with RAG-driven multi-source knowledge collaborative retrieval and cross-source causal reasoning using a large language model, it effectively improves the contextual understanding capability and expert-level decision-making level of the verification system. By performing temporal risk accumulation analysis on the operation sequence through an operation risk propagation graph, it achieves a leap from single-step compliance to full-chain security.
[0162] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for verifying operation tickets based on knowledge graphs, topology analysis, and RAG, characterized in that: include: Construct a dynamic power grid knowledge graph that integrates the static topology of power grid equipment, the real-time operating status of SCADA systems, and the physical operating constraints of the power grid; Receive operation tickets to be verified and perform semantic parsing on the operation steps, map the operation objects to equipment entities in the dynamic power grid knowledge graph, and obtain a structured operation sequence; Based on the current equipment status and connection relationships of the dynamic power grid knowledge graph, a restricted topology traversal is performed on each operation step in the structured operation sequence, and the corresponding operation influence domain is generated by combining power flow impact analysis. Based on the operation steps in the structured operation sequence, the real-time operating status of the corresponding devices in the operation impact domain, external risk information, and historical operation context, a contextualized query vector is constructed. Contextualized query vectors are used to perform multi-source knowledge retrieval in the code clause database, historical accident case database, and expert experience database to obtain relevant knowledge fragments. Relevant knowledge fragments and the current power grid operation scenario are input into the large language model, and structured verification results containing risk scores are generated through cross-source causal reasoning. Based on the logical dependencies between the operation steps in the structured operation sequence, an operation risk propagation graph is constructed. Using the operation risk propagation graph, each operation step is treated as a node and the order of operations is treated as directed edges. Risk accumulation path analysis is performed based on the risk score of each node to identify the combination of steps in the operation sequence that may have the potential for risk exceeding limits or cascading failures. An operation ticket verification report containing an overall operation chain security assessment is output.
2. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 1, characterized in that: The construction of a dynamic power grid knowledge graph that integrates the static topology of power grid equipment, the real-time operating status of SCADA systems, and the physical operating constraints of the power grid specifically involves: Define the entity types of core power grid equipment, including circuit breakers, disconnect switches, busbars, transformers, and transmission lines; Establish electrical connection relationships, protection coordination relationships, and bay relationships between equipment entities based on entity type; The system interface of SCADA acquires the switch opening status, voltage amplitude, current amplitude and active power of each device at fixed intervals, and writes the acquired data into the dynamic attribute field of the corresponding device entity. Encode the physical rules of power grid operation into computable logical expressions and embed them into relational edge attributes; For any circuit breaker Disconnecting switch directly connected in series with it Define the logical expression for operational safety constraints: ; in, Indicates circuit breaker The tripping status is indicated by a value of 1, which means the circuit is tripped, and a value of 0, which means the circuit is closed. Indicates disconnect switch The operability flag has a value of 1 indicating that the pulling and closing operation is allowed, and a value of 0 indicating that the operation is prohibited. The thermal stability constraint of the transmission line is expressed as an inequality rule and associated with the corresponding line entity, that is, the real-time current of the line must not exceed its maximum allowable current carrying capacity, thus forming the physical operating boundary conditions. Based on the physical operating boundary conditions, all entities, relationships, dynamic attributes, and constraint rules are stored in a graph database to form a dynamic power grid knowledge graph.
3. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 2, characterized in that: The process of receiving the operation ticket to be verified and performing semantic parsing on the operation steps, mapping the operation object to the equipment entity in the dynamic power grid knowledge graph, and obtaining a structured operation sequence is as follows: Perform word segmentation and part-of-speech tagging on each sentence of the operation ticket text; A pre-trained named entity recognition model in the power industry is used to extract operation verbs and equipment name strings from operation tickets after word segmentation and part-of-speech tagging. Retrieve candidate device entities whose names contain the string of the device name in the dynamic power grid knowledge graph; Candidate equipment entities are filtered based on the substation name, voltage level value, and bay identifier appearing in the operation ticket context, retaining the unique matching equipment entity and obtaining the equipment entity identifier. The operation verbs are compared with a preset operation intent template library to determine the type of operation target; The types of operational objectives include isolation, grounding, transfer for maintenance, or restoration of operation; Output a structured sequence of operations consisting of device entity identifiers, operation verbs, and operation target types, in the original order of the operation ticket.
4. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 3, characterized in that: The current device status and connection relationships based on the dynamic power grid knowledge graph are used to perform restricted topology traversal for each operation step in the structured operation sequence and combine it with power flow impact analysis to generate the corresponding operation influence domain, specifically: In the structured operation sequence, the first The target device of each operation step is the starting node. A breadth-first search is performed in the dynamic power grid knowledge graph to obtain a preliminary set of electrically connected devices. The breadth-first search includes: expanding only along the currently energized electrical paths that are not under maintenance, and terminating the traversal in that direction when a path branch with a tripped circuit breaker or a closed grounding switch is encountered. Calculate the power flow transfer to adjacent lines caused by the operation of each transmission line in the initial set of electrically connected equipment. When the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity exceeds a preset sensitivity threshold, add that adjacent line and all its connected equipment to the influence range, forming an operational influence domain that includes directly operated equipment, electrically connected equipment, and power flow sensitive equipment. The expression comparing the ratio of the power flow increment of an adjacent line to its maximum allowable current carrying capacity with the preset sensitivity threshold is as follows: ; in, This indicates the change in adjacent line current caused by the current operation. This indicates the maximum allowable current carrying capacity of the adjacent line. This is the preset power flow sensitivity threshold.
5. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 4, characterized in that: The process of constructing a contextualized query vector based on the operation steps, the real-time operating status of devices within the corresponding operation impact domain, external risk information, and historical operation context is as follows: Semantic encoding is performed on the operation steps to obtain the operation embedding vector; The real-time operating status data of all devices within the operational influence domain are normalized and concatenated to form a status feature vector; External risk alarm information that overlaps with the spatial location of the operational impact domain is obtained from the intelligent monitoring platform. The alarm type and confidence level of the alarm information are extracted and converted into risk semantic vectors through the embedding layer. Retrieve historical verification records within the past 30 days that are similar to the current operational scenario, and calculate their average risk score as a historical context scalar; The operation embedding vector, state feature vector, risk semantic vector and historical context scalar are fused into high-dimensional joint features; Contextualized query vectors are generated by performing nonlinear transformations on high-dimensional joint features using a single-layer neural network. The expression for the nonlinear transformation is: ; In the formula, This represents the concatenated high-dimensional joint feature vector. Represents the learnable weight matrix. This represents the bias vector. This represents the contextualized query vector of the final output. It is the hyperbolic tangent activation function.
6. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 5, characterized in that: The method of using contextualized query vectors to perform multi-source knowledge retrieval in the code clause database, historical accident case database, and expert experience database to obtain relevant knowledge fragments is as follows: The text of national and enterprise dispatching procedures is segmented into independent clauses. Each clause is compressed into a semantic summary using a summary generation model, and then converted into a vector using a unified embedding model and stored in the procedure clause vector library. The operational scenarios, causes of failures, and handling measures in historical accident reports are extracted into structured triples, which are then embedded after generating natural language descriptions and stored in the historical accident case vector library. The text of typical operational taboos and emergency suggestions written by experts is directly embedded and stored in the expert experience vector library; Using contextualized query vectors, maximum inner product search is performed in the code clause vector library, historical accident case vector library, and expert experience vector library, respectively. The original text content and source tags of the top five most similar items are retained in each library, forming three sets of knowledge fragments.
7. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 6, characterized in that: The process involves inputting relevant knowledge fragments and the current power grid operation scenario into a large language model, and generating structured verification results including risk scores through cross-source causal reasoning. Organize the prompt text according to the preset template. The content includes a description of the current operation, a summary of the status of key equipment in the operation's impact domain, the type and confidence level of external risks, relevant procedural clauses, a summary of historical cases, and expert advice. The prompt text is input into a large language model that has been fine-tuned with a power dispatch corpus. The output of the constrained large language model is in standard JSON format, including a security judgment boolean value, an integer risk score, the cause of the natural language risk, and specific operational suggestions; The model output is analyzed to obtain the structured verification results of the corresponding operation steps; Introducing a knowledge credibility weighting mechanism to improve reasoning consistency, and defining a comprehensive risk scoring expression: ; in, This represents the risk component derived from the procedural clauses, which is quantified and output by the large language model based on the degree of matching between the retrieved procedural clauses and the current operation. This represents the risk component based on historical case matching, which is quantified and output by the large language model according to the similarity between historical accident cases and the current situation; This represents the risk component inferred from expert experience, which is quantified by the large language model based on the urgency and applicability of expert advice. , , The credibility weight of the corresponding knowledge source; The credibility weight , , The system will be dynamically adjusted based on the current complexity of the power grid operation, specifically as follows: When the power grid is in an N-1 fault or maintenance overlap state To enhance the reference value of historical cases, when the confidence level of external risk warnings exceeds 0.8, Increase the priority of expert experience.
8. The operation ticket verification method based on knowledge graph, topology analysis, and RAG as described in claim 7, characterized in that: Based on the logical dependencies between operation steps in the structured operation sequence, an operation risk propagation graph is constructed. Using each operation step as a node and the order of operations as directed edges, risk accumulation path analysis is performed based on the risk score of each node to identify combinations of steps in the operation sequence that may exceed risk limits or experience cascading failures. An operation ticket verification report containing an overall operation chain security assessment is output, specifically: A directed graph is constructed in the order of the structured operation sequence, with nodes corresponding to each operation step and directed edges representing the order of operations. Assign a risk score from the structured verification results to each node; The importance weight of the equipment is pre-set according to its voltage level and its pivotal role in the power grid; The cumulative risk value is calculated recursively from front to back along the directed edge; The accumulation process is described by the following risk propagation model, expressed as follows: ; in, Indicates the first The cumulative risk value of each step of the operation. This indicates the initial risk score for this step. This represents the cumulative risk value from the previous step. This is the historical risk attenuation coefficient. Indicates the first The importance weight of each step operation target device. For equipment weighting coefficients; If any Exceeding the preset safety threshold If the risk scores of three consecutive operational steps show a strictly monotonically increasing trend, then the subsequence is marked as a high-risk operational chain. List all high-risk operation chains and their corresponding cumulative risk values in the verification report, and insert manual confirmation points or adjust the operation sequence; Introducing a risk growth rate indicator to quantify the probability of cascading failure, the expression is: ; in, This represents the average growth rate of risk over three consecutive operations. and If so, it is determined that there is a cascading risk upward trend. This is the preset growth rate threshold.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the operation ticket verification method based on knowledge graph, topology analysis and RAG as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the operation ticket verification method based on knowledge graph, topology analysis and RAG as described in any one of claims 1 to 8.