Power grid fault handling plan knowledge retrieval method and related device
By constructing a knowledge graph database of power grid fault handling plans using large language models and knowledge graph technology, the problems of low efficiency and poor accuracy in existing retrieval methods are solved, achieving efficient and accurate knowledge retrieval of power grid fault handling plans and improving the management and maintenance level of the power system.
Patent Information
- Application Number
- CN202511169178.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-12-05
AI Technical Summary
Existing knowledge retrieval methods for power grid fault handling plans suffer from low query efficiency and poor accuracy. In particular, the lack of effective organization and expression methods in the power system leads to low retrieval efficiency and the need for users to further filter the information.
By combining a large language model with knowledge graph technology, seed entities are generated by identifying free text topics in the field of power grid faults, entity relationship triples are extracted, and integrated to construct a graph database. A multi-path voting mechanism is used to generate queries to improve retrieval efficiency and accuracy.
It enables efficient and accurate retrieval of knowledge in power grid fault handling plans, reduces the technical threshold for users, improves query efficiency and accuracy, enhances the response speed and accuracy of substation fault handling services, and optimizes the management and maintenance of the power system.
Smart Images

Figure CN121071197A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the cross field of artificial intelligence and power system, and particularly relates to a power grid fault disposal plan knowledge retrieval method and related device. BACKGROUND
[0002] In the power system, the substation disposal plan document contains rich expert knowledge, which is usually scattered in a large number of documents, lacks effective organization and expression, and has the problem of low retrieval efficiency.
[0003] At present, some industry experts have proposed a hybrid representation method, that is, modeling data through a concept hierarchy diagram and a knowledge framework to support knowledge sharing of industry personnel; however, this method still has the problem of too many retrieval results, which requires further screening by users, and reduces production efficiency.
[0004] As a special graph database, the knowledge graph can save different forms of dispatching knowledge in a structured triple form and support semantic retrieval, so that users can search by topic instead of string; however, the traditional knowledge graph retrieval method usually requires users to have high Cypher syntax knowledge, which limits its wide application. In addition, in the field of Natural Language Processing (NLP), Large Language Model (LLM) is attracting attention due to its powerful text generation and question answering capabilities; however, the knowledge of the large language model is completely dependent on its training data, and when facing private or unseen document sets, the large language model alone often has difficulty in efficiently retrieving relevant information; in order to solve the above problems, Retrieval-Augmented Generation (RAG) technology is proposed, which combines information retrieval and text generation, retrieves relevant information from external knowledge sources to enhance the generation capability of LLM, thereby improving the question answering performance on specific document sets.
[0005] In summary, how to apply technologies such as knowledge graph and large language model to the field of efficient retrieval of power grid fault disposal plan knowledge to improve query efficiency and accuracy has become a technical problem to be solved. SUMMARY
[0006] The purpose of the present application is to provide a power grid fault disposal plan knowledge retrieval method and related device to solve the technical problems of low query efficiency and poor accuracy existing in the prior art retrieval method.
[0007] To achieve the above purpose, the present application adopts the following technical solutions: The first aspect of the application provides a power grid fault handling plan knowledge retrieval method, comprising the following steps: Obtaining expressions; wherein the obtained expressions include prompt words, sample examples, questions and entity types and attributes involved in the questions; Based on the obtained expressions, a large language model is used to generate a query; Based on the generated query, retrieval is performed in the constructed graph database to obtain power grid fault handling plan knowledge retrieval results; Wherein the construction step of the graph database comprises: Identify each topic in the free text of the selected power grid fault field, and take the entity in each topic that best represents the topic as a seed entity; Based on the seed entity, a large language model is used to extract entity relationship triples in the free text as candidate triples; Based on the candidate triples, the integrated knowledge graph is obtained and stored to obtain the constructed graph database.
[0008] The further improvement of the technical scheme of the application is that the identification of each topic in the free text of the selected power grid fault field, and the entity in each topic that best represents the topic as a seed entity, comprises: First, use the selected topic modeling method to model the free text of the selected power grid fault field to obtain each topic in the free text; then, take the entity in each topic that best represents the topic as a seed entity.
[0009] The further improvement of the technical scheme of the application is that based on the seed entity, a large language model is used to extract entity relationship triples in the free text as candidate triples, comprising: Take the seed entity as a query entity, and obtain relevant documents containing the query entity from the free text through information retrieval; Based on the obtained relevant documents, a large language model is used to extract domain entities directly or indirectly associated with the query entity, and form candidate triples in triple format.
[0010] The further improvement of the technical scheme of the application is that in the process of integrating based on the candidate triples, obtaining the integrated knowledge graph and storing it to obtain the constructed graph database, the step of integrating based on the candidate triples comprises: Based on the candidate triples, integration is performed through entity merging, conflict resolution and new triple discovery; wherein entity merging is to identify and merge duplicate or similar entities; conflict resolution is to handle and resolve relationship conflicts in different sources or contexts; new triple discovery is to infer new relationships from existing triples.
[0011] Further improvement of the technical scheme of the application is that the large language model is used to generate a query based on the obtained expression, which includes: The large language model is used to generate a plurality of groups of queries according to different reasoning paths based on the obtained expression; Based on the generated plurality of groups of queries, a graph database is used for retrieval to obtain a result set returned by each query and preliminary screening is performed to obtain a query after preliminary screening; wherein, during preliminary screening, queries that cannot be normally executed or cause errors are excluded; queries that do not conform to logic are excluded; through comparison of the result sets returned by different queries, queries that do not conform to expectations or are inconsistent with the results of most other queries are identified and excluded; Based on the query after preliminary screening, the frequency of each query is counted, and the query with the highest frequency and consistent results is selected as the final generated query.
[0012] In a second aspect, the application provides a power grid fault handling plan knowledge retrieval system, which includes: An expression acquisition module is configured to acquire an expression; wherein the acquired expression includes a prompt word, a sample example, a question and an entity type and attribute involved in the question; A query generation module is configured to generate a query based on the acquired expression using a large language model; A retrieval module is configured to retrieve in a constructed graph database based on the generated query to obtain a power grid fault handling plan knowledge retrieval result; The construction of the graph database includes: Identify each topic in the free text of the selected power grid fault field, and use the entity in each topic that best represents the topic as a seed entity; Based on the seed entity, a large language model is used to extract entity relationship triples in the free text as candidate triples; Based on the candidate triples, the integrated knowledge graph is obtained and stored to obtain the constructed graph database.
[0013] Further improvement of the technical scheme of the application is that the large language model is used to generate a query based on the obtained expression, which includes: First, a selected topic modeling method is used to model the selected free text of the power grid fault field to obtain each topic in the free text; then, the entity in each topic that best represents the topic is used as a seed entity.
[0014] Further improvement of the technical scheme of the application is that the large language model is used to generate a query based on the obtained expression, which includes: Taking the seed entity as a query entity, relevant documents containing the query entity are obtained from free text through information retrieval; Based on the obtained relevant documents, a large language model is used to extract domain entities directly or indirectly associated with the query entity, and the candidate triples are formed in the form of triples.
[0015] Further improvement of the technical scheme of the application is that, in the process of integrating based on the candidate triples, obtaining the fused knowledge graph and storing, and obtaining the constructed graph database, the step of integrating based on the candidate triples includes: Integrating based on the candidate triples through entity merging, conflict resolution and new triple discovery; wherein, entity merging is to identify and merge duplicate or similar entities; conflict resolution is to handle and solve relationship conflicts in different sources or contexts; new triple discovery is to infer new relationships according to existing triples.
[0016] Further improvement of the technical scheme of the application is that, based on the obtained expressions, a large language model is used to generate queries, including: Based on the obtained expressions, a large language model is used to generate multiple groups of queries according to different reasoning paths; Based on the generated multiple groups of queries, a graph database is used to retrieve the result set returned by each query and perform preliminary screening to obtain queries after preliminary screening; wherein, during preliminary screening, queries that cannot be normally executed or cause errors are excluded; queries that do not conform to logic are excluded; by comparing the result sets returned by different queries, queries that do not conform to expectations or are inconsistent with the results of most other queries are identified and excluded; Based on the queries after preliminary screening, the frequency of each query is counted, and the query with the highest frequency and consistent results is selected as the final generated query.
[0017] In a third aspect, the application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to realize the power grid fault handling plan knowledge retrieval method according to any one of the first aspect.
[0018] In a fourth aspect, the application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to realize the power grid fault handling plan knowledge retrieval method according to any one of the first aspect.
[0019] Compared with the prior art, the application has the following beneficial effects: The application provides a power grid fault handling plan knowledge retrieval method, in particular to a power grid fault handling plan knowledge efficient retrieval method based on a large language model, which combines entity knowledge graph technology, can effectively expand on a large-scale text corpus, and can provide more comprehensive and diversified answers when answering global problems; at the same time, by introducing a large language model with strong semantic understanding ability, natural language to query conversion can be realized, the technical threshold of users is reduced, and non-professionals can also efficiently access and utilize the information in the dispatch plan knowledge graph, this combination not only improves the cleaning and processing capability of power grid equipment operation data, but also improves the query efficiency and accuracy, and enhances the response speed and accuracy of substation fault handling business. In summary, the application improves the plan retrieval, recommendation and generation of power grid equipment operation data, uses advanced large language models and graph retrieval technology, can more efficiently and accurately process and clean a large amount of operation data generated by power grid equipment, thereby optimizing the management and maintenance of the power system and improving the overall operation efficiency and reliability; the technical effect of improving the query efficiency and accuracy is realized, the technical problems of low query efficiency and poor accuracy of the existing retrieval method are solved, and the power grid fault handling plan knowledge retrieval is more efficient and accurate.
[0020] In the application, when constructing the graph database, the subject is recognized, the candidate triplets are extracted with seed entities, and integration is performed, and this refined construction method makes the knowledge structure in the graph database more clear and accurate, reduces redundant and error information, and in the retrieval process, the query generated based on the large language model is retrieved in the high-quality graph database, which can effectively avoid the return of a large number of irrelevant results and reduce the workload of further screening of users. Compared with the simple data modeling and retrieval method of the hybrid representation method, the technical scheme of the application optimizes the construction and retrieval process of the knowledge graph, improves the quality of the retrieval results from the source, more directly solves the problem of too many retrieval results, and has obvious technical progress.
[0021] In the application, in the process of constructing the graph database, the entity relationship triplets extracted from the free text are integrated, including entity merging, conflict resolution and new triplet discovery and the like, which helps to remove redundant and error information in the data, improve the quality and consistency of the data, and thus improve the cleaning and processing capability of the power grid equipment operation data. Further, high-quality data is the basis for accurate retrieval and analysis, and by improving the data cleaning and processing capability, more reliable data support is provided for subsequent query and decision, which helps to improve the query efficiency and accuracy.
[0022] In summary, the application comprehensively utilizes the advantages of the large language model and the knowledge graph, the large language model generates accurate and reasonable queries, the knowledge graph provides structured knowledge support, so that the retrieval process is more efficient and accurate; at the same time, the application preliminarily screens and finally selects the generated query, ensures that the used query is optimal, and further improves the quality of the retrieval result. The application directly solves the technical problems of low query efficiency and poor accuracy existing in the existing retrieval method, can quickly and accurately provide the required power grid fault disposal plan knowledge for the user, thereby enhancing the response speed and accuracy of the transformer substation fault disposal business, improving the management and maintenance level of the power system, and improving the overall operation efficiency and reliability. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description; obviously, the drawings in the following description are some embodiments of the application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0024] Figure 1 is a flowchart of a power grid fault disposal plan knowledge retrieval method in the embodiment of the application; Figure 2 is a flowchart of obtaining a seed entity in the embodiment of the application; Figure 3 is a flowchart of obtaining a candidate triple in the embodiment of the application; Figure 4 is a flowchart of obtaining a fused knowledge graph in the embodiment of the application; Figure 5 is a schematic diagram of a power grid fault disposal plan knowledge retrieval system in the embodiment of the application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the application more clear, the technical scheme in the application will be clearly and completely described below in combination with the drawings in the embodiment of the application; obviously, the described embodiment technical scheme is a part of the embodiments of the application, not all the embodiments.
[0026] All other embodiments obtained by those of ordinary skill in the art based on the technical solutions disclosed in the embodiments of the present application without creative labor fall within the scope of the present application. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Referring to Figure 1 The power grid fault handling plan knowledge retrieval method provided by the embodiments of the present application comprises: Step 1, obtaining a statement; wherein the obtained statement comprises a prompt word, a sample example, a question and an entity type and attribute involved in the question; Step 2, based on the statement obtained in step 1, generating a query using a large language model; Step 3, based on the query generated in step 2, searching in the constructed graph database to obtain a power grid fault handling plan knowledge retrieval result; Wherein, the construction step of the graph database comprises: Step (1), identifying each topic in the free text of the selected power grid fault field, taking the entity in each topic that best represents the topic as a seed entity; Step (2), based on the seed entity, extracting entity relationship triples in the above free text using a large language model to obtain candidate triples; Step (3), integrating the candidate triples obtained in step (2), and storing the fused knowledge graph to obtain a constructed graph database.
[0028] In the technical solution disclosed by the embodiment of the application, the graph enhanced retrieval generation and graph fusion technology are combined to improve the query efficiency and accuracy. Specifically, in the prior art, although the mixed representation method supports knowledge sharing, the retrieval results are too many, and the user needs to additionally screen, which reduces the production efficiency. In response to this, in step 1, the obtained expression covers prompt words, sample examples, questions and involved entity types and attributes. This comprehensive and detailed expression acquisition method lays a foundation for subsequent accurate query generation. For example, in the power grid fault disposal plan knowledge retrieval, the entity types and attributes involved in the question can avoid retrieving a large amount of irrelevant information and narrow the retrieval range. In addition, in step 2, the powerful text understanding and generation capability of the large language model is used to generate a query based on the expression obtained in step 1. The large language model can understand the user's intention and convert natural language into a query statement that is more suitable for retrieval requirements, further improving the pertinence of retrieval and reducing the occurrence of irrelevant results. In summary, by accurately obtaining the expression and using the large language model to generate the query, the number of retrieval results is effectively reduced, the user's screening of a large amount of irrelevant information is avoided, the query efficiency is improved, and the problem of too many retrieval results in the mixed representation method is solved. In the prior art, the traditional knowledge graph retrieval method requires the user to have high Cypher syntax knowledge, which limits its wide application. In response to this, the present application only needs to provide natural language expressions such as prompt words and questions, without the need to master complex Cypher syntax. In step 2, the large language model is used to generate a query from the user's natural language expression, realizing natural language interaction between the user and the system and reducing the use threshold. Further, the present application automatically completes the entire process from natural language expression to query generation and retrieval in the graph database, so that the user does not need to understand the internal structure and retrieval syntax of the graph database, enabling more industry personnel to conveniently use the system for power grid fault disposal plan knowledge retrieval. In summary, by natural language interaction and automatic query generation and retrieval, the present application solves the problem of high user syntax knowledge requirement in traditional knowledge graph retrieval, expands the application range of the system, and improves the practicality and ease of use of the system. In the prior art, the knowledge of the large language model completely depends on the training data, and it is difficult for the large language model alone to efficiently retrieve relevant information when facing private or unseen document sets. In response to this, the present application constructs a graph database through steps (1) - (3). Step (1) identifies the theme in the free text and determines the seed entity, providing a key node for knowledge extraction. Step (2) uses a large language model to extract entity relationship triples, converting the knowledge in the free text into a structured triple form. Step (3) integrates and stores the candidate triples to form a complete graph database. By constructing a graph database and combining information retrieval and text generation, the present application solves the problem of low retrieval efficiency of the large language model when facing private or unseen document sets, improves the question and answer performance of the system for specific document sets, and enhances the adaptability and accuracy of the system.In summary, the technical scheme of the present application can accurately query and push digital plans according to natural language description, improving query efficiency and accuracy.
[0029] Please refer to Figure 2 In the construction steps of the graph database in the specific exemplary technical scheme of the present application, step (1) is performed to identify each topic in the free text of the selected power grid failure field, and the specific process of taking the entity that best represents each topic as a seed entity is as follows: Explanatorily, in the process of generating the "seed entity", the goal is to efficiently extract domain-specific entities from the free text, and this process is performed under a zero-shot setting, i.e., without a predefined entity list, which makes it very challenging to use large language models (LLM) to extract entities. Further explanatorily, traditional entity extraction methods are not only resource-intensive, but also can generate a large number of irrelevant entities or entities with too coarse granularity, thereby affecting the quality of extraction.
[0030] To solve the above problems, the embodiment of the present application specifically proposes a new seed entity generation method, which uses BERTopic (Bidirectional Encoder Representations from Transformers for Topic Modeling, a deep learning-based topic modeling method) technology to perform topic modeling to identify representative entities in each topic, and these representative entities are denoted as Q, which are used as seed entities. Effectively, the seed entities initialized in this way ensure a high degree of relevance and accuracy in the subsequent entity extraction process.
[0031] Specifically, in actual operation, first, BERTopic is used to process the free text, identify different topics, and select the entity that best represents each topic from each topic. These selected entities are used as seed entities to guide the subsequent entity extraction process. This method not only improves the relevance of entity extraction, but also reduces unnecessary consumption of computing resources, thereby improving overall efficiency.
[0032] In summary, the method of generating seed entities in the embodiment of the present application can more accurately extract key entities within the domain from free text, laying a solid foundation for subsequent knowledge graph construction.
[0033] Please refer to Figure 3 In the construction steps of the graph database in the specific exemplary technical scheme of the present application, step (2) is performed to extract entity relationship triples in the above-mentioned free text based on the seed entities using a large language model to obtain candidate triples, and the process is as follows: The original explanation extracts possible entity relationship triples from free text, a process that relies on the powerful semantic understanding and generation capabilities of large language models (LLMs). Specifically, this step first utilizes the seed entities obtained from the first-step seed entity generation phase as query entities; each time extraction, a seed entity query is input as a query entity, and information retrieval techniques are used to find documents containing the entity. The purpose of this is to extract any potential triples from these documents that contain the query entity.
[0034] To achieve the above objectives, the embodiment of the present application designs a Chain-of-Thought (CoT) prompting method, which includes: first, the LLM is instructed to extract entities within the domain from the context; then, the LLM identifies possible relationships between the extracted entities and the query entity query; in addition, the LLM is required to discover new triples, even if these triples do not initially contain the query entity query. This method ensures that seed entities play a leading role in guiding the domain entity extraction process, while also covering new entities.
[0035] A specific exemplary technical solution includes the following steps: 1) Extract query entities and domain entities: extract query entities query and related domain entities from the given context; 2) Determine relationships: identify relationships between query entities query and extracted entities, and represent them in triple format (<head entity>, <relationship>, <tail entity>); 3) Discover new triples: even if the query entity query is not initially in the triple, the LLM will attempt to discover new triples.
[0036] In summary, the embodiment of the present application can efficiently extract a large number of candidate triples from free text through the above technical means, providing a rich data foundation for subsequent knowledge fusion steps. This method not only improves the accuracy of entity relationship extraction, but also enhances the comprehensiveness and consistency of the knowledge graph.
[0037] Please refer to Figure 4 In the specific exemplary technical solution of the present application, the construction step of the graph database, step (3) integrates the candidate triples obtained in step (2), and stores the fused knowledge graph to obtain the constructed graph database as follows: This step addresses the limitations of local views by merging entities, resolving conflicts, and discovering new triples, providing a more comprehensive and consistent knowledge representation. Specifically, first, the subgraph related to the query entity query is obtained from the knowledge graph constructed from zero samples (ZS-KG); then, for each query entity query, the system performs the following operations: Entity merging: Identifies and merges duplicate or similar entities to ensure the uniqueness and consistency of entities in the knowledge graph. For example, if two different names actually refer to the same entity, the system will merge them into one entity.
[0038] Conflict resolution: Handles conflicts in relationships from different sources or contexts. For example, if there are conflicting relationships (such as "neural abstract method for abstract summary" and "neural abstract method is a hyponym of abstract summary"), the system will resolve the conflict based on context and semantics, selecting the most reasonable relationship.
[0039] New triple discovery: Based on existing triples, infer new relationships. For example, if the relationship between certain entities is known, the system can infer other possible relationships, thereby enriching the content of the knowledge graph.
[0040] In summary, the embodiment of the present application can integrate information from different text fragments to form a more complete and consistent knowledge graph. This method not only improves the quality of the knowledge graph but also enhances its performance in complex multi-layer relationship recognition. In addition, if there is an expert-labeled knowledge graph (GE), these expert knowledge can be combined to further improve the accuracy and reliability of the knowledge graph. In summary, the knowledge graph fusion step ensures that the generated knowledge graph is not only comprehensive but also consistent, thereby providing a solid foundation for subsequent applications. This process is particularly suitable for fields that require a global perspective and high-precision knowledge extraction, such as the construction of scientific knowledge graphs.
[0041] As a preferred embodiment of the technical scheme of the present application, after the knowledge graph fusion is completed, the process of retrieving the results from the graph is as follows: Prompt word design: Design clear query content sentences and guide sentences as prompt templates for the Neo4j graph database, and improve the prompt words by adding explanations to ensure that the entity attributes required by the problem are included. Clearly define the query intent, for example: "XX should handle the 10kV-42 bus fault occurring in the station?". Add background information such as "220kV XX substation full stop accident plan" to help better understand the problem background. Output a clear prompt template to ensure that it contains all relevant entity attribute requirements, such as station name, fault phenomenon, and solution.
[0042] Sample example design: design a small number of sample examples in a specific format as input prompt sentences for large language models, which include natural language expression questions, related graph database entity types and their attributes, entity connection relationships, and corresponding Cypher query statements.
[0043] Multi-path voting mechanism: in order to reduce the randomness of the content generated by the large language model, ensure that the final output Cypher query statement is consistent and correct, and improve the quality and reliability of the query result, the embodiment of the application introduces a multi-path voting mechanism. This mechanism realizes the purpose of selecting the best query from multiple reasoning paths through the steps of diversified query candidate generation, batch execution and preliminary screening, application of voting mechanism and post-processing optimization.
[0044] The specific exemplary technical solution includes the following steps: First, use the large language model to generate multiple sets of Cypher query statements according to different reasoning paths. Each path can be based on different prompt words, context information or background knowledge. To ensure that the generated queries have certain differences to cover a wider range of possibilities, the application adjusts the temperature parameter, p parameter and k parameter of LLM to control the diversity of the generated content.
[0045] Next, all generated Cypher query statements will be submitted to the Neo4j graph database for execution, and the result set returned by each query will be recorded. In this process, the performance indicators of the query, such as response time, resource consumption, etc. will be monitored to evaluate the actual running effect of different queries. For queries that cannot be executed normally or cause system errors, they will be directly excluded. In addition, it will also check whether each query is logical, such as whether there are syntax errors, unreasonable connection relationships or results that violate common sense. By comparing the result sets returned by different queries, those that obviously do not meet expectations or are inconsistent with the results of most other queries are identified, and these abnormal cases are further eliminated.
[0046] After preliminary screening, the application stage of the voting mechanism is entered. The frequency of each query statement is counted, and the query with the highest frequency and consistent results is selected as the potential best candidate.
[0047] In summary, the embodiment of the application proposes an improved GraphRAG-based power grid emergency plan intelligent recommendation technology, which integrates large language models, graph-enhanced retrieval generation and graph fusion key technologies, and addresses the problems of scattered plans, low retrieval efficiency and high understanding threshold in power grid emergency management. The structured organization, semantic understanding and intelligent recommendation of power grid emergency plans have significant technical effects and application advantages in many aspects: (1) Improve the structuring and organization quality of the pre-plan information; interpretively, the present application converts the originally scattered and unstructured pre-plan text into a unified graph database representation form through three steps of seed entity recognition, triple extraction and graph fusion. The present application method not only improves the structural integrity and semantic clarity of the pre-plan information, but also provides structured support for subsequent intelligent query and recommendation. Compared with the traditional pure text management method, the graph management is more conducive to theme classification, relationship tracking and multi-level logical reasoning.
[0048] (2) Enhance semantic retrieval capability and query flexibility; interpretively, by combining the improved graph retrieval enhancement mechanism, the present application allows users to propose complex queries in a natural language manner without mastering professional graph database language (such as Cypher); with the help of the understanding ability of large language model to context and the structure support of graph, the system can realize semantic level intent analysis and answer generation, significantly improving the flexibility and intelligence level of retrieval, and reducing the use threshold.
[0049] (3) Improve the relevance and practicality of pre-plan recommendation; interpretively, the present application considers multiple semantic entities and their associations such as device type, fault phenomenon, historical processing record, etc. in the recommendation process, and outputs more practical emergency pre-plan suggestions through knowledge graph and context alignment technology. Especially the introduction of multi-path voting mechanism helps to reduce the randomness of large model generation, improve the consistency and referenceability of the results, and ensure the logicality and accuracy of the recommended content.
[0050] (4) Optimize the response efficiency of emergency handling process; interpretively, with the help of the efficient retrieval ability of graph database and the language understanding advantage of large model, the present application helps to quickly obtain relevant processing information and recommended process in actual emergency scene, thereby shortening the personnel response time, reducing the workload of manual document review, indirectly improving the emergency handling efficiency, and reducing the risk of accident expansion.
[0051] The present application specifically exemplarily discloses an embodiment of realizing power generation equipment fault information diagnosis by constructing a knowledge graph of common problems of power generation equipment, to further illustrate the outstanding features and significant progress of the present application, the steps specifically include: Step 1: Seed entity generation. Specifically, a topic modeling technique (such as BERTopic) is used to process each text block and identify the most representative entities as seed entities. These seed entities are used to guide the subsequent knowledge graph construction process. The present application first preprocesses the text, extracts key information (such as fault codes, operation procedures, device models, etc.), and matches the extracted component to the corresponding ID number; then based on the knowledge graph ontology model, the entity and relationship are extracted, and the construction of the power equipment fault knowledge graph is completed. Through this method, it can be ensured that the final knowledge graph contains the most relevant entities, thereby improving the accuracy and relevance of subsequent processing.
[0052] Step 2: Candidate Triples Extraction. Specifically, when dealing with a 10kV-42 busbar fault occurring within the XX station, the present invention employs a large language model to extract entities and their descriptions related to the fault and identify relationships between these entities. First, the seed entity "10kV-42 busbar" is taken as the query entity (query), and information retrieval techniques are used to find relevant documents containing this entity; from these documents, the LLM begins to extract domain-specific entities directly associated with the "10kV-42 busbar" fault. For example, it identifies entities such as "circuit breaker operation records," "protection device action reports," and "maintenance personnel logs." This process is not just simple entity recognition, but rather a deep understanding of each entity's role and function in the power system, ensuring that the extracted entities have a high degree of relevance. Next, the LLM further analyzes the relationships between these extracted entities and the query entity "10kV-42 busbar," determining how "circuit breaker operation records" reflect the time point of fault occurrence, "protection device action reports" reveal which protection mechanisms were triggered, and "maintenance personnel logs" record the first response and preliminary diagnosis of the on-site technicians. Through this chain-of-thought prompting method, the LLM not only identifies direct relationships such as "10kV-42 busbar caused circuit breaker tripping," but also discovers indirect but important connections, such as "circuit breaker tripping affected the operating state of the downstream transformer." The LLM also evaluates the importance of each entity and its impact on fault handling. For example, it analyzes whether different types of protection devices effectively prevented the spread of the fault or whether the preliminary diagnosis of maintenance personnel was accurate and timely. In this way, the LLM ensures that the extracted triples not only accurately reflect the actual fault situation, but also contribute to the development of effective emergency response strategies. To select the appropriate emergency plan, the LLM integrates all extracted entities and their relationships. It takes into account the root cause of the fault, the status of affected equipment, and the response measures of the maintenance team, thereby providing a detailed fault handling guide for the XX station. For example, the LLM proposes a comprehensive plan including "immediately isolate the fault area to prevent the accident from expanding," "check and reset all related protection devices," and "restore power supply paths according to priority," among other specific steps.
[0053] Step 3: Knowledge graph fusion. Specifically, based on the previous elements and their relationships, a knowledge graph of power equipment failure information is created through a graph database such as Neo4j. Each node represents an entity in the failure information, and the edges represent the relationships between different entities. The Py2neo library is used to develop graph data storage functions, batch read and merge nodes, automatically ignore duplicate data, and complete efficient knowledge graph construction. For example, during the construction of the knowledge graph, data from different documents or records that actually refer to the same physical entity (such as the same type of busbar in different expressions) will be intelligently matched and merged to ensure that there is only one unified entity representation in the knowledge graph. This not only reduces the complexity of the graph, but also enhances query efficiency. Finally, by integrating this information, the system constructs a global perspective knowledge graph that not only contains explicit relationships in the original text but also adds new relationships derived through reasoning.
[0054] Step 4: After the completion of the knowledge graph, a complete retrieval query process includes prompt word design, sample example design, and the application of multi-path voting mechanisms to ensure that the final output Cypher query statement is consistent and correct, and to improve the quality and reliability of the query results; for example, as shown in Table 1.
[0055] Table 1. Specific exemplary applications of prompt words, sample examples, and questions, etc.
[0056] Finally, in the multi-path voting scenario, multiple sets of Cypher query statements are generated by large language models based on different reasoning paths. Each path can be based on different prompt words, context information, or background knowledge. The frequency of each query statement is counted, and the query with the highest frequency and consistent results is selected as the potential best candidate. A weighted voting mechanism is introduced to weight different queries based on voting, and the final optimal query is selected. For example, a query is not only generated multiple times, but also has very consistent results each time, with high execution efficiency and low resource consumption, so it will get a higher weight and is more likely to be the final choice.
[0057] Summarily, the core of the present application is to propose an efficient power grid fault disposal plan knowledge retrieval method combining large language model and graph retrieval enhanced generation mechanism, which is used for efficient query and intelligent push of power grid emergency plan. The specific key points of the present application are: (1) In view of the actual problem that the text format of power grid emergency plan is not unified and the structure is loose, the present application proposes a zero-shot graph construction method suitable for power business context. The seed entity in the power field is generated based on BERTopic, and the semantic triplets are automatically extracted and the plan knowledge graph is constructed by combining the chain thinking prompt large language model reasoning method. This mechanism does not require manual annotation of corpus or pre-defined word list, and can directly extract the relationship structure of core equipment, fault phenomenon and disposal scheme from actual dispatching and operation and maintenance documents, and has high migration and industry adaptability. The above seed entity generation and chain thinking prompt method, zero-shot graph construction method suitable for power grid emergency plan data, covers steps such as entity generation, relationship extraction and graph fusion, and adapts to the specific expression of unstructured dispatching document context. In view of the pain point that the traditional power grid plan system retrieval method relies on keywords and is difficult to accurately respond to complex business problems, the present application constructs a semantic recommendation system combining large language model and Neo4j graph database, introduces multi-path Cypher query generation and voting mechanism, which is used to improve the robustness and accuracy of natural language to structured graph query conversion. The system can generate multiple query paths according to the user input problem, filter the optimal query statement by voting, realize accurate matching with semantic entities such as power equipment, site and fault classification, greatly improve the plan matching quality, and is suitable for dispatching instruction aided decision making. The multi-path semantic voting mechanism based on large language model of the present application realizes the recommendation of emergency plan in the power grid fault scene in combination with the graph database query, and is suitable for complex power business question and answer tasks such as equipment fault classification and processing flow suggestion.
[0058] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment, please refer to the method embodiment of the present application.
[0059] Please refer to Figure 5 In the embodiment of the present application, a power grid fault disposal plan knowledge retrieval system is provided, which comprises: The expression acquisition module is used to acquire expressions, wherein the acquired expressions include prompt words, sample examples, question problems and entity types and attributes involved in the question problems; The query generation module is used to generate queries by using a large language model based on the acquired expressions; The retrieval module is used to retrieve in the constructed graph database based on the generated queries to obtain power grid fault disposal plan knowledge retrieval results; The construction steps of the graph database include: Identify each topic in the free text of the selected power grid fault field, and take the entity that best represents each topic as a seed entity in the topic; Based on the seed entity, a large language model is used to extract entity relationship triples in the free text as candidate triples; Based on the candidate triples, integration is performed to obtain a fused knowledge graph and store it to obtain a constructed graph database.
[0060] In an embodiment of the present application, a computer device is provided, which includes a processor and a memory, the memory being used to store a computer program, the computer program including program instructions, and the processor being used to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, and are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement a corresponding method flow or a corresponding function; the processor of the embodiment of the present application can be used to execute the operation of the power grid fault handling plan knowledge retrieval method.
[0061] In an embodiment of the present application, a storage medium, specifically a computer readable storage medium, is provided. The computer readable storage medium is a memory device in a computer device, and is configured to store programs and data. It should be understood that the computer readable storage medium can include an internal storage medium in the computer device, and can also include an external storage medium supported by the computer device. The computer readable storage medium provides a storage space, and the storage space stores an operating system of the terminal. In addition, one or more instructions adapted to be loaded and executed by the processor are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be understood that the computer readable storage medium can be a high-speed RAM (Random Access Memory) memory, or a non-volatile memory such as at least one disk memory. The one or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the power grid fault handling plan knowledge retrieval method in the above embodiment.
[0062] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. In addition, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0063] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device implemented in accordance with the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in the flow(s) or block(s).
[0064] These computer program instructions can also be stored in a computer readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 the function specified in the one or more blocks.
[0065] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, so that the instructions executed on the computer or other programmable data processing devices provide processes for implementing the flow Figure 1 one or more processes and / or blocks Figure 1 the function specified in the one or more blocks.
[0066] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, but not to limit it, although the above embodiments of the present application have been described in detail, those skilled in the art should understand: the specific embodiments of the present application can be modified or replaced by the same, without departing from the spirit and scope of the present application, any modification or equivalent replacement, which should be covered within the scope of protection of the claims of the present application.
Claims
1. A power system fault handling scenario knowledge retrieval method, characterized by, The method comprises the following steps: Obtaining expressions; wherein the obtained expressions include prompt words, sample examples, question problems and entity types and attributes involved in the question problems; Based on the obtained expressions, a large language model is used to generate a query; Based on the generated query, retrieval is performed in the constructed graph database to obtain a power grid fault disposal plan knowledge retrieval result; The construction of the graph database comprises: Identifying each topic in the free text of the selected power grid fault field, and taking the entity in each topic that best represents the topic as a seed entity; Based on the seed entity, a large language model is used to extract entity relationship triples in the free text as candidate triples; Based on the candidate triples, the integrated knowledge graph is obtained and stored to obtain the constructed graph database.
2. The power system fault handling scenario knowledge retrieval method according to claim 1, characterized in that, The identification of each topic in the free text of the selected power grid fault field, and taking the entity in each topic that best represents the topic as a seed entity, comprises: First, a selected topic modeling method is used to model the free text of the selected power grid fault field to obtain each topic in the free text; then, the entity in each topic that best represents the topic is taken as a seed entity.
3. The power grid fault handling scenario knowledge retrieval method of claim 1, wherein, The extraction of entity relationship triples in the free text based on the seed entity and the use of a large language model as candidate triples comprise: Taking the seed entity as a query entity, relevant documents containing the query entity are obtained from the free text through information retrieval; Based on the obtained relevant documents, a large language model is used to extract domain entities directly or indirectly associated with the query entity, and the candidate triples are formed in the form of triples.
4. The power grid failure handling scenario knowledge retrieval method of claim 1, wherein, In the process of integrating the candidate triples, obtaining the integrated knowledge graph and storing it to obtain the constructed graph database, the integration based on the candidate triples comprises: Based on the candidate triples, integration is performed through entity merging, conflict resolution and new triple discovery; wherein entity merging is to identify and merge duplicate or similar entities; conflict resolution is to handle and resolve relationship conflicts in different sources or contexts; new triple discovery is to infer new relationships from existing triples.
5. The grid fault handling scenario knowledge retrieval method of claim 1, wherein, The generation of a query based on the obtained expressions and the use of a large language model comprise: Based on the obtained expressions, a large language model is used to generate multiple groups of queries according to different reasoning paths; Based on the generated multiple groups of queries, the graph database is used for retrieval to obtain the result set returned by each query and perform preliminary screening to obtain the query after preliminary screening; wherein during preliminary screening, queries that cannot be normally executed or cause errors are excluded; queries that do not conform to logic are excluded; by comparing the result sets returned by different queries, queries that do not meet expectations or are inconsistent with the results of most other queries are identified and excluded; Based on the query after preliminary screening, the frequency of each query is counted, and the query with the highest frequency and consistent results is selected as the finally generated query.
6. A power system failure handling scenario knowledge retrieval system characterized by, It comprises: An expression acquisition module for acquiring expressions; wherein the obtained expressions include prompt words, sample examples, question problems and entity types and attributes involved in the question problems; A query generation module for generating a query based on the obtained expressions and using a large language model. The retrieval module is configured to perform retrieval in the constructed graph database based on the generated query to obtain a power grid fault handling plan knowledge retrieval result. The construction of the graph database comprises: identifying each topic in the free text of the selected power grid fault field, and taking the entity in each topic that best represents the topic as a seed entity; based on the seed entity, extracting entity relationship triples in the free text using a large language model and taking them as candidate triples; based on the candidate triples, integrating to obtain a fused knowledge graph and storing to obtain a constructed graph database.
7. The power grid failure handling scenario knowledge retrieval system of claim 6, wherein, The identification of each topic in the free text of the selected power grid fault field, and taking the entity in each topic that best represents the topic as a seed entity, comprises: first, using the selected topic modeling method to model the free text of the selected power grid fault field to obtain each topic in the free text; and then taking the entity in each topic that best represents the topic as a seed entity.
8. The power grid failure handling scenario knowledge retrieval system of claim 6, wherein, The extraction of entity relationship triples in the free text using a large language model based on the seed entity and taking them as candidate triples comprises: taking the seed entity as a query entity, and obtaining relevant documents containing the query entity from the free text through information retrieval; based on the obtained relevant documents, using a large language model to extract domain entities directly or indirectly associated with the query entity, and forming candidate triples in triple format.
9. The power grid failure handling scenario knowledge retrieval system of claim 6, wherein, In the process of integrating based on the candidate triples to obtain a fused knowledge graph and storing to obtain a constructed graph database, the step of integrating based on the candidate triples comprises: based on the candidate triples, integrating through entity merging, conflict resolution and new triple discovery; wherein entity merging is to identify and merge duplicate or similar entities; conflict resolution is to handle and resolve relationship conflicts in different sources or contexts; and new triple discovery is to infer new relationships from existing triples.
10. The power grid failure handling scenario knowledge retrieval system of claim 6, wherein, The generation of a query using a large language model based on the obtained expression comprises: based on the obtained expression, generating multiple groups of queries using a large language model according to different reasoning paths; based on the generated multiple groups of queries, using a graph database to perform retrieval to obtain the result set returned by each query and to perform preliminary screening to obtain a query after preliminary screening; wherein during preliminary screening, queries that cannot be normally executed or cause errors are excluded; queries that do not conform to logic are excluded; by comparing the result sets returned by different queries, queries that do not meet expectations or are inconsistent with the results of most other queries are identified and excluded; based on the query after preliminary screening, counting the frequency of each query, and selecting the query with the highest frequency and consistent results as the finally generated query.
11. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the power grid fault handling plan knowledge retrieval method of any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the power grid fault handling plan knowledge retrieval method of any one of claims 1 to 5.
Citation Information
Patent Citations
Power grid alarm information auxiliary decision-making method based on knowledge graph
CN116957236A
Power grid fault disposal plan retrieval method and system
CN118820269A
Knowledge graph open domain construction and RAG question and answer method and device and storage medium
CN119416882A
Metadata query method based on knowledge graph
CN119441386A
Large language model retrieval enhancement generation method for cyberspace security emergency intelligent analysis
CN120104649A
Cited By
Safety supervision work ticket intelligent generation method based on ReAct intelligent agent
CN121503703A
Vehicle test domain knowledge graph construction method and system based on global semantic driving
CN121835854A
Vehicle test field knowledge graph construction method and system based on global semantic driving
CN121835854B