Power grid knowledge graph construction method and system based on large language model
By combining large language models and graph databases, a power grid knowledge graph is constructed, which solves the problems of low efficiency and insufficient dynamic updates in the processing of unstructured documents in existing technologies, and realizes efficient and accurate knowledge extraction and decision support.
Patent Information
- Application Number
- CN202511347660.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-01-09
AI Technical Summary
Existing methods for constructing power grid knowledge graphs are inefficient and have low coverage when processing unstructured documents, lack dynamic update mechanisms, and cannot support accurate decision-making.
A large language model is used to perform semantic understanding and entity extraction on power grid specification documents. Combined with a graph database for dynamic updates, a multi-level knowledge graph is constructed to support multi-hop reasoning and natural language query.
It improves the accuracy and coverage of knowledge extraction from unstructured documents, dynamically adapts to changes in power grid specifications, and enhances the efficiency of fault decision-making.
Smart Images

Figure CN121301580A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and power system, specifically relating to a method and system for constructing a power grid knowledge graph based on a large language model, which is used to build an intelligent knowledge graph system to improve scheduling efficiency. Background Technology
[0002] In recent years, with the increasing demand for intelligent power systems, knowledge graph technology has gradually become a core tool for power grid knowledge management. Existing methods for constructing power grid knowledge graphs are mainly based on structured data (such as equipment parameters and operating records) and rule-driven entity relationship extraction techniques, achieving knowledge association through semantic networks. However, these methods have significant limitations when dealing with multi-source heterogeneous data in the power grid field (such as unstructured documents and historical fault reports): 1. Insufficient data integration capabilities: Traditional methods rely on manual annotation and rule bases, which are difficult to efficiently process massive amounts of unstructured text (such as normative documents such as the "Regulations on the Stability of UHV Interconnected Power Grids"), resulting in low knowledge extraction coverage and high costs.
[0003] 2. Limited semantic understanding depth: Existing systems mostly use keyword matching or shallow natural language processing (NLP) techniques, which cannot capture the complex contextual relationships in documents (such as the multi-hop logic of equipment and disposal processes), resulting in fragmented search results that are difficult to support accurate decision-making.
[0004] 3. Lack of dynamic update mechanism: Most power grid knowledge graphs rely on static knowledge bases and lack the ability to automatically adapt to standard revisions or new fault cases, requiring frequent manual maintenance and lacking timeliness.
[0005] The closest existing technologies include: Rule-based knowledge graph construction: This method extracts triples from structured data by predefining entity types and relationship templates (such as equipment-fault-handling process). While this method can guarantee accuracy, it requires the participation of many domain experts in rule design and is difficult to extend to unstructured text.
[0006] Semantic parsing based on traditional NLP: Entity relations are extracted using dependency parsing or word vector models (such as Word2Vec), but due to limitations in the model's generalization ability, the accuracy of semantic parsing for technical terms and long texts is relatively low.
[0007] Static knowledge graph systems, such as power equipment knowledge bases, can achieve basic retrieval functions, but lack linkage with real-time business data and cannot support dynamic reasoning and intelligent question answering.
[0008] Therefore, this invention proposes to combine large language models with dynamic knowledge graph technology to solve the above problems in the following ways: Multimodal data fusion: Utilize large language models to perform semantic segmentation and deep parsing of unstructured documents, extract fine-grained entities and association rules, and reduce reliance on manual annotation.
[0009] Dynamic knowledge updates: By combining the real-time relational query capabilities of graph databases, the knowledge graph can be automatically expanded and revised to adapt to the iterative updates of power grid standards.
[0010] Intelligent semantic interaction: Based on knowledge graph path reasoning technology, it supports dispatchers to directly locate fault handling procedures and relevant regulatory clauses through natural language dialogue, thereby improving emergency response efficiency.
[0011] A rule-driven method for constructing a knowledge graph of power grid equipment defects is presented. This method extracts triples from structured data (such as historical maintenance records and sensor data) by predefining entity types (e.g., equipment type, defect description) and relationship templates (e.g., "equipment-defect-handling process") to construct a static knowledge graph. The technical solution includes the following steps: 1. Data preprocessing: Cleaning, deduplicating, and standardizing structured data to form a dataset with a unified format; 2. Rule base design: Entity types and relationship mapping rules (such as "circuit breaker-voltage level-defect location") are manually defined by domain experts to guide entity and relationship extraction; 3. Knowledge Extraction: Based on the rule base, match data fields to generate triples related to equipment defects; 4. Knowledge Graph Construction: Store triples in a graph database and display the static knowledge graph using visualization tools.
[0012] This method mainly relies on manually labeled rule bases and is suitable for processing structured data, but it does not cover the semantic parsing and dynamic updating of non-normative documents (such as the "Regulations on the Stability of UHV Interconnected Power Grids").
[0013] The existing drawbacks are as follows: (1) Reliance on manual rules and limited scalability: This method requires domain experts to manually design entity types and relationship templates, which is difficult to adapt to the frequent revisions of power grid specification documents or the addition of fault scenarios, resulting in high costs for updating the knowledge graph.
[0014] (2) Insufficient unstructured text processing capabilities: Existing technologies are only designed for structured data (such as database records) and cannot effectively parse complex semantic relationships in unstructured documents (such as multi-hop logic between equipment and disposal processes), resulting in low knowledge coverage.
[0015] (3) Static knowledge base lacks timeliness: The constructed knowledge graph relies on static data and cannot automatically adapt to the iteration of power grid specifications or new fault cases. It requires manual maintenance and is difficult to meet the real-time scheduling requirements.
[0016] (4) Insufficient semantic understanding depth: Rule-based entity extraction methods have difficulty capturing the contextual meaning of professional terms (such as the dynamic adjustment clause in "stability regulations"), resulting in fragmented search results that cannot support accurate decision-making. Summary of the Invention
[0017] The technical problem to be solved by this invention is to address the shortcomings of the prior art by providing a method and system for constructing a power grid knowledge graph based on a large language model. By parsing normative documents that power grid dispatchers refer to daily (such as the "Regulations on Stability and Reactive Power and Voltage Dispatch Operation of UHV Interconnected Power Grids"), the invention utilizes a large language model to perform semantic understanding, entity extraction, and relationship mining on the document content, thereby constructing a structured knowledge graph. This addresses the technical problems of difficult semantic parsing, low knowledge extraction efficiency, and lagging dynamic updates of unstructured power grid documents (such as the "Regulations on Stability of UHV Interconnected Power Grids").
[0018] The present invention adopts the following technical solution: A method for constructing a power grid knowledge graph based on a large language model includes the following steps: Standardization preprocessing and semantic segmentation are performed on multi-source heterogeneous power grid specification documents to generate a set of semantic fragments with independent semantics; The set of semantic fragments is subjected to deep semantic parsing using a domain-fine-tuned large language model to extract power grid entities and their logical relationships, forming entity-relation triples. The entity-relation triples are stored in a graph database to construct a multi-level knowledge graph centered on power grid equipment. The system receives input natural language queries, performs multi-hop reasoning based on the multi-level knowledge graph, obtains power grid equipment information, operating procedures and historical cases associated with the natural language query, and outputs them to provide decision support.
[0019] Preferably, the semantic segmentation is based on a contextual coherence metric function, and segmentation is performed when the coherence score of a segment exceeds a preset threshold.
[0020] Preferably, let the partitioning function be... Contextual coherence measurement For the document Segmentation, semantic fragment set for:
[0021] in, Represents a single semantic fragment; This represents a function that measures the coherence of the internal context of a segment. This indicates the preset coherence threshold.
[0022] Preferably, the large language model employs a domain-adaptive attention mechanism, first applying an extraction function to the semantic segment s. Obtain the set of key entities Then, using a large language model, logical relationships between entities are mined, and relation triples are constructed. A domain-adaptive attention mechanism is introduced to perform weighted calculations on the semantic vectors, resulting in the... Attention score at each position .
[0023] Preferably, entity set for:
[0024] Where Θ represents the parameters of the large language model after domain fine-tuning; It represents a single entity that has been identified.
[0025] Preferably, relational triples :
[0026] in, To infer inter-entity relationships for large language models; A submodule based on LLM to determine the relationship between semantic fragments and candidate entities.
[0027] Preferably, the first Attention score at each position for:
[0028] in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension.
[0029] Preferably, the entity includes at least one of power grid equipment, fault type, and operating procedure.
[0030] Preferably, a dynamic update mechanism is implemented for the constructed multi-level knowledge graph. When a power grid specification update or a new fault case is detected, the knowledge graph is dynamically expanded based on an incremental learning mechanism, and the parameters of the large language model are updated online.
[0031] Preferably, in a multi-level knowledge graph, the knowledge graph is defined as a graph. Node V represents all extracted entities, and edges... For the corresponding relationship:
[0032]
[0033] in, For the set of key entities, For the set of key relationships, A collection of semantic fragments It is a semantic fragment.
[0034] Preferably, incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph:
[0035] And the parameters of the large language model are updated online:
[0036] in, Indicates the learning rate; For the loss function of new data, These represent the head entity / subject of the relation, the semantic relation / predicate connecting the head entity and the tail entity, and the tail entity / object of the relation, respectively. This represents the vector of gradients / partial derivatives with respect to the parameter Θ (the directional derivative of the loss function f with respect to the model parameter Θ).
[0037] Preferably, the dynamic update mechanism includes performing community detection on the graph structure and clustering entities using a modularity optimization algorithm.
[0038] Preferably, modularity for:
[0039] in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; This is an indicator function.
[0040] Preferably, the multi-hop reasoning is implemented based on path query of a graph database, and the returned results are displayed in the form of a visual path.
[0041] Secondly, embodiments of the present invention provide a power grid knowledge graph construction system based on a large language model, comprising: The preprocessing module performs standardized preprocessing and semantic segmentation on multi-source heterogeneous power grid specification documents, generating a set of semantic fragments with independent semantics; The knowledge module uses a domain-adjusted large language model to perform deep semantic parsing on the set of semantic fragments, extracting power grid entities and their logical relationships to form entity-relationship triples; The graph module stores the entity-relation triples in the graph database to construct a multi-level knowledge graph centered on power grid equipment. The reasoning module receives input natural language queries, performs multi-hop reasoning based on the multi-level knowledge graph, obtains power grid equipment information, operating procedures and historical cases associated with the natural language query, and outputs them to provide decision support.
[0042] Preferably, in the preprocessing module, the semantic segmentation is based on a contextual coherence metric function. Segmentation is performed when the coherence score of a segment exceeds a preset threshold. Let the segmentation function be... Contextual coherence measurement For the document Segmentation, semantic fragment set for:
[0043] in, Represents a single semantic fragment; This represents a function that measures the coherence of the internal context of a segment. This indicates the preset coherence threshold.
[0044] Preferably, in the knowledge module, the large language model employs a domain-adaptive attention mechanism, first applying an extraction function to the semantic fragment s. Obtain the set of key entities Then, using a large language model, logical relationships between entities are mined, and relation triples are constructed. A domain-adaptive attention mechanism is introduced to perform weighted calculations on the semantic vectors, resulting in the... Attention score at each position .
[0045] Preferably, entity set for:
[0046] Where Θ represents the parameters of the large language model after domain fine-tuning; Indicates a single entity that has been identified; relational triples :
[0047] in, To infer inter-entity relationships for large language models; A submodule that performs relational judgment on semantic fragments and candidate entities based on LLM; No. Attention score at each position for:
[0048] in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension; The entity includes at least one of power grid equipment, fault type, and operating procedure.
[0049] Preferably, a dynamic update mechanism is implemented for the constructed multi-level knowledge graph. When a power grid specification update or a new fault case is detected, the knowledge graph is dynamically expanded based on an incremental learning mechanism, and the parameters of the large language model are updated online.
[0050] Preferably, in a multi-level knowledge graph, the knowledge graph is defined as a graph. Node V represents all extracted entities, and edges... For the corresponding relationship:
[0051]
[0052] in, For the set of key entities, For the set of key relationships, A collection of semantic fragments It is a semantic fragment; Incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph:
[0053] And the parameters of the large language model are updated online:
[0054] in, Indicates the learning rate; For the loss function of new data, These represent the head entity / subject of the relation, the semantic relation / predicate connecting the head entity and the tail entity, and the tail entity / object of the relation, respectively. This represents the vector representing the gradient / partial derivative of the loss function f with respect to the model parameter Θ (the directional derivative of the loss function f with respect to the model parameter Θ). The dynamic update mechanism includes community detection of the graph structure, clustering entities using a modularity optimization algorithm, and modularity optimization. for:
[0055] in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; This is an indicator function.
[0056] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for constructing a power grid knowledge graph based on a large language model.
[0057] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described method for constructing a power grid knowledge graph based on a large language model.
[0058] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for constructing a power grid knowledge graph based on a large language model.
[0059] Sixthly, embodiments of the present invention provide an electronic device, including a computer program, which, when executed by the electronic device, implements the steps of the above-described method for constructing a power grid knowledge graph based on a large language model.
[0060] Compared with the prior art, the present invention has at least the following beneficial effects: A method for constructing a power grid knowledge graph based on a large language model (LLM) is proposed. This method employs a four-step process: multi-source document preprocessing and segmentation → LLM fine-grained knowledge extraction → graph construction and dynamic updating → semantic interactive reasoning. It integrates the deep semantic understanding capabilities of LLM with the structured storage characteristics of knowledge graphs, addressing the pain points of traditional methods such as reliance on structured data, shallow semantic parsing, and static graphs. The preprocessing stage eliminates format differences and redundant information in heterogeneous multi-source documents, while semantic segmentation ensures the semantic independence of text fragments, laying a precise foundation for subsequent extraction. The domain-adjusted LLM can deeply parse unstructured documents such as the "Regulations on Stability of UHV Interconnected Power Grids," accurately extracting entities such as equipment and faults, as well as their relationships, overcoming the semantic limitations of traditional keyword matching. The dynamic updating mechanism adapts to revisions in power grid regulations and new fault cases through incremental learning, avoiding the high costs of manual maintenance. Natural language multi-hop reasoning, based on graph database path queries, provides dispatchers with a complete chain of information on "equipment-fault-handling specifications," significantly improving fault decision-making efficiency and enhancing knowledge coverage compared to traditional retrieval systems.
[0061] Furthermore, semantic segmentation is achieved based on a contextual coherence metric function and a preset threshold. By quantifying the semantic relevance within a fragment, it determines whether to segment, avoiding semantic breaks caused by traditional fixed-length segmentation. The coherence function identifies textual semantic boundaries. For example, when processing the "Transformer Operation and Maintenance" section in power grid regulations, if a text block's coherence score exceeds the threshold, it is treated as an independent semantic fragment, ensuring that each fragment has a single theme and logical integrity. Experiments show that this segmentation method reduces noise in subsequent entity extraction, significantly improves the accuracy of knowledge extraction, and reduces the consumption of LLM computing power by invalid text.
[0062] Furthermore, the semantic segmentation process is quantified through mathematical formulas, clarifying the logical relationship between the set of semantic segments, the coherence function, and the threshold, making the segmentation rules reproducible and controllable, and defining the segmentation criteria.
[0063] Furthermore, LLM introduces a domain-adaptive attention mechanism, which first extracts the entity set, then mines the relationships to construct triples, and enhances the semantic capture capability of power grid professional terms through attention weighting, solving the problem of low sensitivity of general LLM to vertical domain terms. Through the attention mechanism, the vector weights of professional terms in semantic segments are weighted, so that LLM can prioritize focusing on key information.
[0064] Furthermore, by formalizing the generation process of entity and relation triples, the structured and consistent nature of knowledge extraction is ensured, providing standardized input for graph construction and facilitating subsequent storage and reasoning.
[0065] Furthermore, by employing an attention-weighted mechanism, the model's ability to focus on key terms is enhanced, irrelevant information is avoided as interference, and the model's performance and robustness in complex texts are improved.
[0066] Furthermore, please supplement the explanation of the purpose or benefits of the setting according to claim 7, and provide a principle analysis.
[0067] Furthermore, it clarifies that entities cover three core categories: power grid equipment, fault types, and operating procedures. This aligns with the "equipment-fault-handling" business logic of power grid dispatching, solves the problem of incomplete knowledge graphs caused by the single entity type in traditional solutions, covers core power grid knowledge elements, ensures the comprehensiveness and practicality of the graph content, supports multi-dimensional queries and reasoning, and meets the diverse needs of dispatchers in their actual work.
[0068] Furthermore, based on the incremental learning mechanism, when power grid specifications are updated or new fault cases are detected, the newly added entity-relationship triplet extended graph is automatically extracted, and the LLM parameters are updated online, solving the problems of poor timeliness of static graphs and high manual maintenance costs.
[0069] Furthermore, by using a modularity optimization algorithm to achieve graph community detection and clustering, the interpretability and usability of the graph structure are improved, making it easier to discover potential relationships between devices, faults, and specifications, and supporting more complex multi-hop reasoning and knowledge discovery.
[0070] Furthermore, multi-hop inference is based on graph database path queries, with results visualized and provided as an intuitive display of inference paths. This helps dispatchers quickly understand the fault handling logic and standard guidelines, improving decision-making efficiency and system availability.
[0071] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0072] In summary, this invention integrates the deep semantic understanding capabilities of large language models with the dynamic association technology of knowledge graphs to achieve automated extraction, structured storage, and intelligent retrieval of power grid knowledge, significantly improving the decision-making efficiency of dispatchers in fault handling.
[0073] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0074] Figure 1 This is a diagram illustrating the steps involved in creating the atlas of the present invention. Figure 2 GraphRag pattern flowchart; Figure 3 A schematic diagram of a computer device provided in an embodiment of the present invention; Figure 4 This is a block diagram of a chip provided according to an embodiment of the present invention.
[0075] Among them, 60. Computer equipment; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access memory unit; 6202. Cache memory unit; 6203. Read-only memory unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. Detailed Implementation
[0076] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0077] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0078] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0079] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.
[0080] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0081] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0082] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0083] This invention provides a method for constructing a power grid knowledge graph based on a large language model. First, multi-source heterogeneous documents undergo standardized preprocessing and semantic segmentation to form fine-grained text slices. Then, the large language model performs deep analysis of the slice content to extract key entities such as equipment, operating procedures, and fault handling rules, along with their relationships. Finally, a dynamically updated knowledge graph is constructed based on a graph database, supporting semantic retrieval and intelligent reasoning. When a fault occurs, dispatchers can directly locate relevant equipment information, handling procedures, and regulatory clauses in the graph through natural language interaction, quickly obtaining decision support. The advantages of this invention lie in its combination of the semantic understanding capabilities of a large language model with the structured expression of a knowledge graph, achieving efficient knowledge conversion of unstructured power grid documents. Compared to traditional keyword-matching retrieval systems, this method significantly improves the accuracy and coverage of knowledge retrieval through semantic association. Simultaneously, the dynamic update mechanism of the knowledge graph can adapt to iterative revisions of power grid regulations, ensuring the timeliness of the knowledge base. Furthermore, the system employs a lightweight fine-tuning strategy to optimize the large language model, reducing computational requirements while maintaining accurate parsing of specialized terminology, thus solving the problem of insufficient adaptability of general-purpose models in vertical domains.
[0084] Large Language Model (LLM): A large language model is a natural language processing model based on deep learning. It acquires general semantic understanding capabilities through pre-training on massive amounts of text data, enabling tasks such as text generation, semantic parsing, and entity relation extraction. In this invention, LLM is used to perform fine-grained semantic analysis on power grid specification documents to extract structured knowledge.
[0085] Knowledge Graph: A knowledge graph is a semantic network that represents entities and their relationships using a graph structure, containing nodes (entities), edges (relationships), and attribute triples. In this invention, the knowledge graph is used to store the relationships between entities such as power grid equipment, operating procedures, and fault handling rules, supporting efficient semantic retrieval and reasoning.
[0086] Entity: Refers to an objective thing or abstract concept in the knowledge graph that has independence and distinguishability, such as power grid equipment (transformers, circuit breakers) or regulatory clauses ("Regulations on the Stability of UHV Interconnected Power Grids"). Each entity is labeled with a unique identifier and is the basic building block of the knowledge graph.
[0087] Relation: Describes the semantic association between entities, such as "equipment-affiliation-substation" or "fault-corresponding handling process". Relation connects two entities through directed edges, forming a triple (head entity, relation, tail entity), which constitutes the logical link of the knowledge graph.
[0088] RAG (Retrieval-Augmented Generation): RAG is a retrieval-augmented generation technique that improves the output quality of Large Language Models (LLMs) by incorporating real-world information. It typically uses vector similarity as a retrieval technique, dividing text into chunks and storing them as vectors, then retrieving relevant text fragments to enhance the model's generation capabilities.
[0089] GraphRAG (Graph Retrieval-Augmented Generation): GraphRAG is a novel retrieval augmentation and generative model proposed by Microsoft, combining knowledge graphs and graph machine learning techniques. It is an extension and improvement of RAG. GraphRAG inherits the retrieval augmentation and generative approach of RAG, but introduces knowledge graph technology in the retrieval stage. Compared with traditional RAG, GraphRAG can better handle complex information, especially with the help of knowledge graphs, significantly improving question-answering performance and addressing the shortcomings of traditional RAG in handling complex relational reasoning, summarizing questions, and multi-hop problems.
[0090] Please see Figure 1 and Figure 2 This invention discloses a method for constructing a power grid knowledge graph based on a large language model, comprising the following steps: S1. Multi-source document standardization preprocessing and semantic segmentation The power grid specification documents are cleaned, formatted, and analyzed for contextual coherence. Semantic segmentation technology is used to divide long texts into independent semantic segments (such as "equipment parameters" and "fault handling procedures") to ensure the accuracy of subsequent entity extraction.
[0091] The input multi-source document D is cleaned and preprocessed to obtain a standardized document D'; then, a semantic segmentation algorithm is used to divide the long text into multiple semantic segments with contextual coherence.
[0092] S101, Document Preprocessing Given the original document Preprocessing function Generate standardized documents:
[0093] in, This includes cleaning and format standardization operations.
[0094] S102, Semantic Segmentation Let the partition function be... Contextual coherence measurement For the document The segments are divided to obtain a set of semantic fragments. :
[0095] in, Represents a single semantic fragment; It is a function that measures the coherence of the internal context of a segment; It is a preset continuity threshold.
[0096] S2, Fine-grained knowledge extraction driven by large language models Based on a fine-tuned large language model, semantic fragments are deeply parsed to extract key entities such as equipment names, fault types, and operating procedures, and logical relationships between entities are mined (e.g., "equipment-fault-handling rules"). By introducing a domain-adaptive attention mechanism, the semantic capture capability for technical terms (e.g., "reactive power regulation") is enhanced.
[0097] For each semantic fragment s, a large language model (LLM) enhanced with domain fine-tuning and attention mechanisms is used for deep parsing to extract key entities and the logical relationships between them.
[0098] S201, Fine-grained entity extraction semantic fragments Apply extraction function Obtain the set of key entities :
[0099] Where Θ represents the parameters of the large language model after domain fine-tuning; It represents a single entity that has been identified, such as "device name" or "fault type".
[0100] S202, Relational Triple Extraction Further explore the logical relationships between entities using a large language model and construct relation triples. :
[0101] in, For inferring inter-entity relationships for large language models, such as "fault-handling rules"; A submodule based on LLM to determine the relationship between semantic fragments and candidate entities.
[0102] S203, Domain-Adaptive Attention Mechanism To improve the ability to capture specialized terminology, a domain-adaptive attention mechanism is introduced to perform weighted calculations on semantic vectors:
[0103] in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension; For the first Attention scores at each position are used for weighted extraction of entities and relationships in subsequent processes.
[0104] S3. Dynamic Knowledge Graph Construction and Update The extracted entity and relation triples are stored in a graph database to construct a multi-level knowledge graph centered on devices. Combined with a real-time incremental learning mechanism, it automatically adapts to revisions in power grid specifications or the addition of new fault cases, and continuously updates the knowledge base through dynamic expansion of the graph structure.
[0105] The entity and relation triples extracted in step S2 are stored in a graph database to construct a multi-level knowledge graph centered on devices; at the same time, the graph structure is dynamically updated to adapt to changes in power grid specifications by combining a real-time incremental learning mechanism.
[0106] S301, Knowledge Graph Construction Define a knowledge graph as a graph Where node V represents all extracted entities, and edges For the corresponding relationship:
[0107]
[0108] S302, Dynamic Update of Atlas Incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph:
[0109] And the parameters of the large language model are updated online:
[0110] Where η represents the learning rate; This is the loss function for the new data.
[0111] S303, Map Community Detection To achieve automatic clustering of the internal structure of the graph, a module similar to the Leiden algorithm is adopted, using the module degree Q for community partitioning:
[0112] in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; For indicator functions, when It is set to 1 if it is true, otherwise it is set to 0.
[0113] S4, Intelligent Semantic Interaction and Decision Support When a fault occurs, the dispatcher can input queries via natural language (such as "UHV line tripping handling process"). The system performs multi-hop reasoning based on knowledge graphs, returns information on related equipment, operating procedures and historical cases, and displays the logical links in a visual path to assist in rapid decision-making.
[0114] In another embodiment of the present invention, a power grid knowledge graph construction system based on a large language model is provided. This system can be used to implement the above-mentioned power grid knowledge graph construction method based on a large language model. Specifically, the power grid knowledge graph construction system based on a large language model includes a preprocessing module, a knowledge module, a graph module, and a reasoning module.
[0115] The preprocessing module performs standardized preprocessing and semantic segmentation on multi-source heterogeneous power grid specification documents to generate a set of semantic fragments with independent semantics. The knowledge module uses a domain-adjusted large language model to perform deep semantic parsing on the set of semantic fragments, extracting power grid entities and their logical relationships to form entity-relationship triples; The graph module stores the entity-relation triples in the graph database to construct a multi-level knowledge graph centered on power grid equipment. The reasoning module receives input natural language queries, performs multi-hop reasoning based on the multi-level knowledge graph, obtains power grid equipment information, operating procedures and historical cases associated with the natural language query, and outputs them to provide decision support.
[0116] In the preprocessing module, semantic segmentation is performed based on a contextual coherence metric function. Segmentation is performed when the coherence score of a segment exceeds a preset threshold. Let the segmentation function be... Contextual coherence measurement For the document Segmentation, semantic fragment set for:
[0117] in, Represents a single semantic fragment; This represents a function that measures the coherence of the internal context of a segment. This indicates the preset coherence threshold.
[0118] In the knowledge module, the large language model employs a domain-adaptive attention mechanism, first applying an extraction function to the semantic fragment s. Obtain the set of key entities Then, using a large language model, logical relationships between entities are mined, and relation triples are constructed. A domain-adaptive attention mechanism is introduced to perform weighted calculations on the semantic vectors, resulting in the... Attention score at each position .
[0119] Entity Collection for:
[0120] Where Θ represents the parameters of the large language model after domain fine-tuning; Indicates a single entity that has been identified; relational triples :
[0121] in, To infer inter-entity relationships for large language models; A submodule that performs relational judgment on semantic fragments and candidate entities based on LLM; No. Attention score at each position for:
[0122] in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension; The entity includes at least one of power grid equipment, fault type, and operating procedure.
[0123] A dynamic update mechanism is implemented for the constructed multi-level knowledge graph. When power grid specification updates or new fault cases are detected, the knowledge graph is dynamically expanded based on an incremental learning mechanism, and the parameters of the large language model are updated online.
[0124] In a multi-level knowledge graph, a knowledge graph is defined as a graph. Node V represents all extracted entities, and edges... For the corresponding relationship:
[0125]
[0126] in, For the set of key entities, For the set of key relationships, A collection of semantic fragments It is a semantic fragment; Incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph:
[0127] And the parameters of the large language model are updated online:
[0128] in, Indicates the learning rate; For the loss function of new data, These represent the head entity / subject of the relation, the semantic relation / predicate connecting the head entity and the tail entity, and the tail entity / object of the relation, respectively. This represents the vector representing the gradient / partial derivative of the loss function f with respect to the model parameter Θ (the directional derivative of the loss function f with respect to the model parameter Θ). The dynamic update mechanism includes community detection of the graph structure, clustering entities using a modularity optimization algorithm, and modularity optimization. for:
[0129] in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; This is an indicator function.
[0130] This invention provides a terminal device comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions. The processor described in this embodiment can be used in the operation of a power grid knowledge graph construction method based on a large language model, including: Standardization preprocessing and semantic segmentation are performed on multi-source heterogeneous power grid specification documents to generate a set of semantic fragments with independent semantics. A domain-fine-tuned large language model is used to perform deep semantic parsing on the set of semantic fragments to extract power grid entities and their logical relationships, forming entity-relationship triples. These entity-relationship triples are stored in a graph database to construct a multi-level knowledge graph centered on power grid equipment. Input natural language queries are received, and multi-hop reasoning is performed based on the multi-level knowledge graph to obtain power grid equipment information, operating specifications, and historical cases associated with the natural language query, and output to provide decision support.
[0131] Please see Figure 3The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the method for estimating the concentration of radioactive iodine species in the containment structure after an accident, as described in this embodiment. To avoid repetition, these details are not elaborated here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the power grid knowledge graph construction system based on a large language model, as described in this embodiment. To avoid repetition, these details are not elaborated here.
[0132] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 3 This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.
[0133] The processor 61 may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0134] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or RAM of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device 60.
[0135] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.
[0136] Please see Figure 4 The terminal device is an electronic device 600, which is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0137] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.
[0138] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.
[0139] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0140] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0141] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem). This communication can be performed via input / output interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network, wide area network, and / or public network, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0142] Example 4 This invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the terminal device and extended storage media supported by the terminal device; it can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). More specific examples of the computer-readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical fiber, portable compact disk read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0143] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination thereof.
[0144] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0145] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the power grid knowledge graph construction method based on a large language model in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor in the following steps: Standardization preprocessing and semantic segmentation are performed on multi-source heterogeneous power grid specification documents to generate a set of semantic fragments with independent semantics. A domain-fine-tuned large language model is used to perform deep semantic parsing on the set of semantic fragments to extract power grid entities and their logical relationships, forming entity-relationship triples. These entity-relationship triples are stored in a graph database to construct a multi-level knowledge graph centered on power grid equipment. Input natural language queries are received, and multi-hop reasoning is performed based on the multi-level knowledge graph to obtain power grid equipment information, operating specifications, and historical cases associated with the natural language query, and output to provide decision support.
[0146] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0147] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0148] Example 5 By adopting a rule-driven technical approach, researchers can build a segmentation rule library that works in conjunction with regular expressions and a dictionary in the power field, based on the structural features of standard documents such as GB / T 30149-2013 "Guidelines for Condition-Based Maintenance of Power Grid Equipment".
[0149] Example 6 A pure machine learning alternative is adopted, using a pre-trained BERT model connected to a fully connected layer to build an end-to-end classifier. For example, text blocks are divided into standard paragraph types such as "definition" (e.g., terminology explanation section), "operation" (e.g., switching operation procedures), and "safety" (e.g., accident handling procedures).
[0150] Simulation experimental data (compared to traditional methods)
[0151] Experimental conditions: 1000 power grid documents were selected (including 80% unstructured text, such as "Regulations on Stability of UHV Interconnected Power Grids" and "Fault Handling Report"). The hardware was: CPU i7-13700K, GPU RTX 4090, and the LLM base model was Llama 2-7B.
[0152] Application Examples Application scenario: Dispatch Center of Central China Branch of State Grid Corporation of China (responsible for dispatching the UHV power grid in Central China, covering 6 provinces including Hubei and Henan, processing more than 100,000 power grid data entries per day, and handling about 50 faults per year).
[0153] Application effect: Fault handling efficiency: In 2024, three major faults, including "UHV line tripping" and "new energy grid connection failure", were handled. Dispatchers could query using natural language (such as "UHV line tripping handling process") and the system would return information on related equipment, handling procedures and three historical cases within 10 seconds. The fault assessment time was shortened from the traditional 40 minutes to 12 minutes, with a handling accuracy rate of 100% and no operational errors.
[0154] Standard updates and maintenance: The power grid standards were revised twice in 2024 ("Reactive power voltage regulation threshold" and "New energy grid connection protection rules"). The system automatically completed incremental updates, and the map expansion added 120 entities and 180 relationships. After the LLM parameters were updated, the entity extraction accuracy rate stabilized at over 92%, and the manual maintenance cost was reduced by 80% (traditionally 3 people / week, this solution only requires 1 person / 2 hours).
[0155] Training efficiency: In the training of new dispatchers, based on knowledge graph visualization interaction, the training cycle was shortened from the traditional 2 months to 1 month, the pass rate of assessment increased from 75% to 95%, and the time for new dispatchers to independently handle routine faults was shortened from 30 minutes to 15 minutes.
[0156] This invention achieves systematic optimization in the field of power knowledge management and intelligent applications. Through the deep integration of technological innovation and industry needs, it forms the following core values: By employing domain-adaptive technology, the physical laws and business logic of the power system are directly embedded into the knowledge processing flow, effectively addressing the pain point of the disconnect between traditional natural language processing technology and industry knowledge. This technical solution not only improves the semantic parsing accuracy of professional texts such as power regulations and dispatch instructions, but also significantly reduces manual annotation costs by automatically extracting equipment relationships and topological constraints, providing efficient support for the intelligent analysis of large-scale power grid documents.
[0157] An innovative knowledge collaborative update mechanism has been established to achieve real-time synchronization of dynamic information such as changes in technical standards and equipment upgrades, ensuring the timeliness and authority of the knowledge graph. A deep learning model constrained by the physical laws of the power grid is combined to avoid logical contradictions caused by algorithmic black boxes, making maintenance decisions such as fault impact range analysis and equipment historical operation tracing more credible and providing greater business guidance value.
[0158] This invention has broad application prospects in the field of intelligent power system dispatching. It can be applied to rapid response scenarios for power grid faults, providing dispatchers with real-time, accurate regulations and handling suggestions, significantly shortening fault assessment time. This method can also be used in power grid procedure training systems, improving training efficiency through the visual interaction of knowledge graphs. Furthermore, the system can be extended to the entire lifecycle management of power grid equipment, linking data from multiple stages such as design, operation and maintenance, and repair, enabling cross-departmental knowledge sharing and collaborative decision-making. The implementation of this patent will significantly improve the automation level of power grid dispatching, reduce the risk of human error, provide technical support for building new power systems, and facilitate the digital transformation of the energy industry.
[0159] In summary, this invention presents a method and system for constructing a power grid knowledge graph based on a large language model. By integrating the deep semantic understanding capabilities of the large language model with the structured association technology of the knowledge graph, it achieves a complete process for automatically extracting, constructing, and dynamically updating knowledge from multi-source heterogeneous power grid documents. This method not only addresses the core pain points of traditional methods—the difficulty in parsing unstructured professional text and low knowledge extraction efficiency—through domain-fine-tuned language models and adaptive attention mechanisms, but also ensures that the knowledge graph can respond in real-time to revisions of power grid specifications and the emergence of new fault cases, guaranteeing the timeliness and accuracy of the knowledge. Finally, by supporting intelligent interaction and multi-hop reasoning using natural language, this invention can provide power grid dispatchers with fast, accurate, and interpretable decision support, significantly improving the intelligence level of power grid operation and the efficiency of fault handling, and has significant practical application value.
[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0161] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0162] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0163] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0164] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0165] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0166] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random-access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0167] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0168] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0169] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0170] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for constructing a power grid knowledge graph based on a large language model, characterized in that, Includes the following steps: Standardization preprocessing and semantic segmentation are performed on multi-source heterogeneous power grid specification documents to generate a set of semantic fragments with independent semantics; The set of semantic fragments is subjected to deep semantic parsing using a domain-fine-tuned large language model to extract power grid entities and their logical relationships, forming entity-relation triples. The entity-relation triples are stored in a graph database to construct a multi-level knowledge graph centered on power grid equipment. The system receives input natural language queries, performs multi-hop reasoning based on the multi-level knowledge graph, obtains power grid equipment information, operating procedures and historical cases associated with the natural language query, and outputs them to provide decision support.
2. The method for constructing a power grid knowledge graph based on a large language model according to claim 1, characterized in that, The semantic segmentation is based on a context coherence metric function, and segments are made when the coherence score of a segment exceeds a preset threshold.
3. The method for constructing a power grid knowledge graph based on a large language model according to claim 2, characterized in that, Let the partition function be... Contextual coherence measurement For the document Segmentation, semantic fragment set for: in, Represents a single semantic fragment; This represents a function that measures the coherence of the internal context of a segment. This indicates the preset coherence threshold.
4. The method for constructing a power grid knowledge graph based on a large language model according to claim 1, characterized in that, The large language model employs a domain-adaptive attention mechanism, first applying an extraction function to the semantic fragment s. Obtain the set of key entities Then, the logical relationships between entities are mined using a large language model, and relation triples are constructed. A domain-adaptive attention mechanism is introduced to perform weighted calculations on the semantic vectors, resulting in the... Attention score at each position .
5. The method for constructing a power grid knowledge graph based on a large language model according to claim 4, characterized in that, Entity Collection for: Where Θ represents the parameters of the large language model after domain fine-tuning; It represents a single entity that has been identified.
6. The method for constructing a power grid knowledge graph based on a large language model according to claim 4, characterized in that, relational triples : in, To infer inter-entity relationships for large language models; A submodule based on LLM to determine the relationship between semantic fragments and candidate entities.
7. The method for constructing a power grid knowledge graph based on a large language model according to claim 4, characterized in that, No. Attention score at each position for: in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension.
8. The method for constructing a power grid knowledge graph based on a large language model according to claim 4, characterized in that, The entity includes at least one of power grid equipment, fault type, and operating procedure.
9. The method for constructing a power grid knowledge graph based on a large language model according to claim 1, characterized in that, A dynamic update mechanism is implemented for the constructed multi-level knowledge graph. When power grid specification updates or new fault cases are detected, the knowledge graph is dynamically expanded based on an incremental learning mechanism, and the parameters of the large language model are updated online.
10. The method for constructing a power grid knowledge graph based on a large language model according to claim 9, characterized in that, In a multi-level knowledge graph, a knowledge graph is defined as a graph. Node V represents all extracted entities, and edges... For the corresponding relationship: in, For the set of key entities, For the set of key relationships, A collection of semantic fragments It is a semantic fragment.
11. The method for constructing a power grid knowledge graph based on a large language model according to claim 9, characterized in that, Incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph: And the parameters of the large language model are updated online: in, Indicates the learning rate; For the loss function of new data, These represent the head entity / subject of the relation, the semantic relation / predicate connecting the head and tail entities, and the tail entity / object of the relation, respectively. This represents a vector representing the gradient / partial derivative with respect to the parameter Θ.
12. The method for constructing a power grid knowledge graph based on a large language model according to claim 9, characterized in that, The dynamic update mechanism includes community detection of the graph structure and clustering of entities using a modularity optimization algorithm.
13. The method for constructing a power grid knowledge graph based on a large language model according to claim 12, characterized in that, Modularity for: in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; This is an indicator function.
14. The method for constructing a power grid knowledge graph based on a large language model according to claim 1, characterized in that, The multi-hop inference is implemented based on path querying of a graph database, and the returned results are displayed in the form of a visual path.
15. A power grid knowledge graph construction system based on a large language model, characterized in that, include: The preprocessing module performs standardized preprocessing and semantic segmentation on multi-source heterogeneous power grid specification documents, generating a set of semantic fragments with independent semantics; The knowledge module uses a domain-adjusted large language model to perform deep semantic parsing on the set of semantic fragments, extracting power grid entities and their logical relationships to form entity-relationship triples; The graph module stores the entity-relation triples in the graph database to construct a multi-level knowledge graph centered on power grid equipment. The reasoning module receives input natural language queries, performs multi-hop reasoning based on the multi-level knowledge graph, obtains power grid equipment information, operating procedures and historical cases associated with the natural language query, and outputs them to provide decision support.
16. The power grid knowledge graph construction system based on a large language model according to claim 10, characterized in that, In the preprocessing module, semantic segmentation is performed based on a contextual coherence metric function. Segmentation is performed when the coherence score of a segment exceeds a preset threshold. Let the segmentation function be... Contextual coherence measurement For the document Segmentation, semantic fragment set for: in, Represents a single semantic fragment; This represents a function that measures the coherence of the internal context of a segment. This indicates the preset coherence threshold.
17. The power grid knowledge graph construction system based on a large language model according to claim 10, characterized in that, In the knowledge module, the large language model employs a domain-adaptive attention mechanism, first applying an extraction function to the semantic fragment s. Obtain the set of key entities Then, using a large language model, logical relationships between entities are mined, and relation triples are constructed. A domain-adaptive attention mechanism is introduced to perform weighted calculations on the semantic vectors, resulting in the... Attention score at each position .
18. The power grid knowledge graph construction system based on a large language model according to claim 10, characterized in that, Entity Collection for: Where Θ represents the parameters of the large language model after domain fine-tuning; Indicates a single entity that has been identified; relational triples : in, To infer inter-entity relationships for large language models; A submodule that performs relational judgment on semantic fragments and candidate entities based on LLM; No. Attention score at each position for: in, A query vector constructed for domain-specific terminology; These are the key vectors at various positions within a semantic segment; It is the vector dimension; The entity includes at least one of power grid equipment, fault type, and operating procedure.
19. The power grid knowledge graph construction system based on a large language model according to claim 10, characterized in that, A dynamic update mechanism is implemented for the constructed multi-level knowledge graph. When power grid specification updates or new fault cases are detected, the knowledge graph is dynamically expanded based on an incremental learning mechanism, and the parameters of the large language model are updated online.
20. The power grid knowledge graph construction system based on a large language model according to claim 10, characterized in that, In a multi-level knowledge graph, a knowledge graph is defined as a graph. Node V represents all extracted entities, and edges... For the corresponding relationship: in, For the set of key entities, For the set of key relationships, A collection of semantic fragments It is a semantic fragment; Incremental data is introduced when power grid specification updates or new fault cases are detected. Update the knowledge graph: And the parameters of the large language model are updated online: in, Indicates the learning rate; For the loss function of new data, These represent the head entity / subject of the relation, the semantic relation / predicate connecting the head and tail entities, and the tail entity / object of the relation, respectively. This represents a vector representing the gradient / partial derivative with respect to the parameter Θ. The dynamic update mechanism includes community detection of the graph structure, clustering entities using a modularity optimization algorithm, and modularity optimization. for: in, Let G be the adjacency matrix of graph G; and They are nodes and The degree of the graph; m is the total number of edges in the graph; and These are the communities to which the nodes belong; This is an indicator function.
21. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 14.
22. A computing device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including steps for performing the method of any one of claims 1 to 14.
Citation Information
Cited By
Tunnel fire intelligent decision support method and device and medium
CN121745257A
Method and device for generating knowledge graph of cross-level data processing activity
CN122088647A
Power equipment data quality rule automatic extraction and knowledge construction method and system
CN122311403A
Power grid knowledge graph construction method fusing hybrid expert network model and semantic partitioning
CN122334438A