Power grid knowledge graph construction method fusing hybrid expert network model and semantic segmentation
Patent Information
- Application Number
- CN202610816354.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-08
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334438A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid knowledge graph technology, and in particular to a method for constructing a power grid knowledge graph that integrates a hybrid expert network model and semantic segmentation. Background Technology
[0002] In the intelligent body of the knowledge base for power grid construction, the knowledge graph is the core data support. It provides accurate entity and relationship evidence for core functions such as knowledge retrieval and AI professional question answering, and provides users with a visualized knowledge relationship network.
[0003] Currently, the construction process of power grid knowledge graphs, represented by Graph RAG, mainly adopts the following technical path: fine-grained segmentation of the input document into multiple small text blocks of fixed length; sequentially calling a large model to extract entities and relationships from each text block; and embedding the extracted results into vectorized form to construct a graph index. This process has the following technical problems: First, entity relationship extraction is inefficient. Because the document is segmented into numerous small text blocks, each block requires independent calls to the large model for extraction, resulting in frequent large model calls. Furthermore, to compensate for omissions during extraction, the existing process typically requires a second call to the large model to verify the results, further increasing the number of large model calls and leading to a long overall construction time.
[0004] Second, there are biases in the understanding of the content of power industry texts. Fixed-length, fine-grained segmentation disrupts the semantic coherence of the text, making it difficult for the model to fully capture long-distance semantic dependencies in power documents (such as cross-paragraph equipment and parameter correspondences, and fault chains described in multiple sentences), resulting in problems such as misjudgment of entity relationships and loss of cross-paragraph relationships.
[0005] Third, vectorized embedding incurs unnecessary computational overhead. The existing process performs full vectorized embedding on all extracted entities and relations without filtering out illegal or invalid entities (such as garbled characters or meaningless words), resulting in a significant waste of computational resources and unnecessary storage space.
[0006] The aforementioned issues have resulted in low efficiency, accuracy, and resource utilization efficiency in the construction of the power grid knowledge graph, necessitating targeted optimization of the construction process. Summary of the Invention
[0007] This invention aims to solve the technical problems of slow generation speed and inadequate understanding of power industry content in existing power grid knowledge graph construction methods, and provides a power grid knowledge graph construction method that integrates hybrid expert network model and semantic block division.
[0008] To achieve the above objectives, this invention provides a method for constructing a power grid knowledge graph that integrates a hybrid expert network model and semantic segmentation, comprising the following steps: Step 1: Perform semantically aware segmentation on the input power document and set dynamic overlapping regions between adjacent document blocks to obtain multiple document blocks; Step 2: Input the multiple document blocks obtained in Step 1 into a hybrid expert network model fine-tuned by power grid domain instructions. The hybrid expert network model extracts entities and relations for each document block and outputs a set of entity-relation-entity triples. When the average confidence level output by the hybrid expert network model is higher than a preset threshold, the secondary verification step of the triple set is omitted. Step 3: Before vectorizing the triple set output in Step 2, perform type validity checks on the entities in the triple set according to the predefined power grid graph schema, filter out triples containing invalid entities, and then perform vectorizing embedding on the remaining triple set to construct a power grid knowledge graph.
[0009] Further preferred, the semantic awareness segmentation in step one is as follows: loading a pre-built core terminology dictionary for the power industry; scanning the document and identifying the terms in the dictionary as indivisible whole units; based on this, segmenting the document by combining the natural paragraph boundaries, punctuation marks, and semantic integrity of the power document, and setting the size of the document block to 1000 to 2000 tokens.
[0010] Further preferred, the size of the overlapping area in step one is determined by the following method: analyzing the context of the document block boundary, if there is an unclosed clause, enumeration item or cross-sentence reference at the boundary, the overlapping area is expanded to the minimum length that can completely contain the semantic unit, with an upper limit not exceeding 20% of the size of the adjacent block; otherwise, the default 15% overlap ratio is adopted.
[0011] Further optimization involves the hybrid expert network model in step two employing a gated weighted fusion sparse activation mechanism. For each input token, the routing network not only selects some expert networks for activation but also assigns corresponding activation weights to each selected expert network. The final token representation is composed of the sum of the products of the outputs of each activated expert network and its corresponding weights.
[0012] Further preferably, the entity-relationship-entity triplet set output in step two has each triplet conforming to a predefined format, which includes an entity type field, a relation type field, and a confidence field.
[0013] Further preferred, in step three, the type legality verification is performed based on the predefined power grid schema. Specifically, the power grid schema not only contains a set of legal entity types, but also contains constraint rules between entities; the verification process not only checks individual entity types, but also checks whether triples violate the constraint rules.
[0014] Further preferably, the filtering of triples containing invalid entities in step three includes: removing triples containing entities containing garbled characters using regular expression rules, and removing triples containing entities containing low-frequency meaningless words or common stop words using a dual-tower Siamese lightweight classification model; the input of the dual-tower Siamese lightweight classification model includes the entity name and its local context window in the original text.
[0015] Further preferably, the predefined power grid schema in step three includes a set of legal entity types and a set of legal relationship types in the power grid domain. The set of legal entity types includes at least one of circuit breakers, transmission lines, transformers, busbars, and load nodes.
[0016] Further preferred, after filtering out triples containing invalid entities in step three, the method further includes: before vectorizing and embedding the remaining set of triples after filtering, normalizing the entity names and units in the triples to unify the naming format and unit representation.
[0017] The present invention also 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 implement the method for constructing a power grid knowledge graph that integrates a hybrid expert network model and semantic blocks.
[0018] Compared with the prior art, the present invention has the following beneficial effects: This invention reduces the single token generation latency through a gated weighted fusion mechanism of a hybrid expert network model, and eliminates the secondary verification step by combining the average confidence of the model output, thereby significantly reducing the number of large model calls and effectively solving the core pain point of slow generation speed in existing technologies.
[0019] This invention, through a semantically aware segmentation and dynamic overlap mechanism based on an enhanced dictionary in the power industry, accurately preserves the integrity of professional terminology in power texts and complex semantic dependencies across segmentation boundaries, solving the problem of misinterpretation caused by context fragmentation and significantly improving the accuracy of entity relationship extraction.
[0020] In the pre-filtering stage, this invention performs verification based on the power grid schema containing constraint rules, and removes invalid entities by combining a lightweight model with context, avoiding vectorized calculation of invalid data, saving computing and storage resources, and preventing dirty data from entering the schema database. Attached Figure Description
[0021] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in detail below. It should be noted that the embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0023] Example 1
[0024] like Figure 1 As shown, this embodiment provides a method for constructing a power grid map that integrates a hybrid expert network model and semantically aware block decomposition. The method includes the following steps: Step 1: Perform semantically aware segmentation on the input power document and set dynamic overlapping regions between adjacent document blocks to obtain multiple document blocks; Step 2: Input the multiple document blocks obtained in Step 1 into a hybrid expert network model fine-tuned by power grid domain instructions. The hybrid expert network model extracts entities and relations for each document block and outputs a set of entity-relation-entity triples. Each triple contains an entity type field, a relation type field, and a confidence field. When the average confidence score output by the hybrid expert network model is higher than a preset threshold, the secondary verification step of the triple set is omitted. The hybrid expert network model (MoE) is a large model architecture that includes multiple expert networks and routing networks. Step 3: Before vectorizing the triple set output in Step 2, perform type validity checks on the entities in the triple set according to the predefined power grid graph schema, filter out triples containing invalid entities, and then perform vectorizing embedding on the remaining triple set to construct a power grid knowledge graph.
[0025] In step one of this embodiment, to eliminate the disruption of semantic coherence of power industry text caused by fixed-length fine-grained segmentation, a semantically aware segmentation and dynamic overlap mechanism based on a power industry-specific dictionary is introduced. The specific processing procedure is as follows: 1. Acquire and preprocess power documents: Acquire power documents to be processed (such as power grid equipment manuals, transmission line design reports, etc.) and perform text cleaning.
[0026] 2. Load domain dictionary: Load a pre-built core terminology dictionary for the power industry, which includes compound terms such as equipment names (e.g., "500kV ultra-high voltage transmission line") and professional actions (e.g., "relay protection action").
[0027] 3. Perform semantic chunking with dictionary protection: The system first scans the document, identifies all terms belonging to the core terminology dictionary of the power industry, and treats them as indivisible whole units. Based on this, it segments the document using natural paragraph boundaries and punctuation marks (periods, semicolons). The target block size is set to 1000 to 2000 tokens. If a natural paragraph or a core term crosses the target block boundary, its integrity is prioritized, allowing the final block size to fluctuate within this range.
[0028] 4. Setting Dynamic Overlapping Regions: An overlapping region is set between two adjacent document blocks. In this embodiment, the size of the overlapping region is not a fixed ratio but is dynamically calculated. The system analyzes the context of the block boundaries; if there are unclosed clauses, enumeration items, or cross-clause referential relationships (e.g., "the aforementioned devices...") at the boundary, the overlapping region is automatically expanded to the minimum length that can completely contain the semantic unit, with an upper limit not exceeding 20% of the adjacent block size. Otherwise, a default 15% overlap ratio is used. This dynamic overlapping mechanism can more accurately preserve complex semantic dependencies that cross segmentation boundaries, effectively solving the problem of "taking things out of context."
[0029] In step two, multiple document blocks are sequentially input into a hybrid expert network model (MoE model) fine-tuned for the power grid domain. The processing of this model includes the following sub-steps: 1. Model Fine-tuning: Based on the general large model, this hybrid expert network model (MoE) has undergone instruction fine-tuning (SFT) using a large amount of labeled data from the power grid field (including equipment parameters, fault reports, operating procedures, etc.), giving it stronger prior knowledge of entities and relationships in the power field. The total number of parameters in the hybrid expert network model is no less than 1 billion, and the number of expert networks is no less than 16.
[0030] 2. Perform sparse activation and implicit inference: For each input token, the routing network selects the Top-K (e.g., K=2) most relevant expert networks from N expert networks (e.g., N=64) for activation based on its contextual semantics. This embodiment uses gated weighted fusion instead of simple Top-K selection. The routing network outputs not only the index of the selected expert network but also the activation weight G of each selected expert network. i The final token representation is a weighted sum of the outputs of each activated expert network: Output = Σ(G i * Expert i (Input)), Experti (Input) represents the processing output of the $i$-th expert network for the input Input, where Input represents the vector representation or hidden state of the current Token input to the mixture-of-experts network model; Output represents the final Token representation after gated weighted fusion. The confidence field in each triple output by this model reflects the reliability score of this triple, which is used as the basis for the subsequent judgment to omit the review link. This method can more smoothly integrate the knowledge of different expert networks and improve the robustness of extraction. Inside the model, the complex reasoning process (such as "identifying the subject → judging the predicate → extracting the object") is transformed into implicit parameter calculations, and structured triples are directly output, avoiding the generation of a large number of intermediate reasoning Tokens. Thanks to the fine-tuning of the model on domain data and the gated weighted fusion mechanism, the accuracy of a single extraction is already high enough. Therefore, when the average confidence of the model output is higher than the preset threshold, the present invention directly omits the traditional secondary review link, significantly reducing the number of large model calls.
[0031] Step 3 aggregates the triple sets of all document blocks to obtain a candidate triple set. Before performing vectorized embedding, the system sequentially performs the following sub-steps: (1) Type legality verification based on Schema The system predefines a power grid graph ontology layer Schema. This Schema includes a set of legal entity types and a set of legal relationship types in the power grid domain, and also contains constraint rules between entities. For example, the "circuit breaker" entity must be connected to the "bus" or "transmission line" through the "connection" relationship. The verification process not only checks individual entity types but also checks whether the triples violate these basic constraints.
[0032] (2) Elimination of invalid entities based on rules and lightweight models For the triples that pass the type verification, further content-level filtering is performed: the triples containing entities with garbled characters are eliminated through regular rules. Specifically, regular expressions are used to match non-standard Chinese and English characters and unrecognized special symbols. If these characters are included in the entity string, the triple containing this entity is marked for filtering.
[0033] The triples containing entities with low-frequency meaningless words or general stop words are eliminated through a lightweight classification model. Low-frequency meaningless words include words with no practical meaning such as "de", "le", "this", "that", etc.; general stop words include "for example", "in short", etc. The lightweight classification model is based on rules or a simple neural network and outputs a judgment result on whether the entity is a valid entity, marking the triples containing invalid entities for filtering.
[0034] This lightweight classification model is a dual-tower Siamese network. It is trained to distinguish between "valid electrical entities" and "invalid noise." Its input includes not only the entity name but also a local context window of the entity in the original text (e.g., the five words before and after it). This allows the model to better understand the validity of an entity in a specific context; for example, it can distinguish between "switch" as a device name and "switch" as a general verb. Positive samples in the training data come from valid entities in the historical knowledge graph, while negative samples include random strings, stop words, and garbled text.
[0035] (III) Filtering Operation The system filters out all triples marked as unfiltered, retaining the remaining set of triples. The entities in these remaining triples are all of valid type and have valid content.
[0036] (iv) Normalization processing Before embedding the remaining set of triples after filtering into vectors, the entity names and units in the triples are normalized to unify the naming format and unit representation. For example, "500 kV", "500 kV", and "500 kV" are unified into "500 kV"; "transformer station", "substation", and "substation" are unified into "substation".
[0037] (v) Vectorized embedding The name or description text of each entity and relation in the processed triple set is converted into a fixed-dimensional vector through a vectorization model and stored in a vector database. At the same time, the structured data of the triples is stored in a graph database, and finally the power grid knowledge graph is constructed.
[0038] Through the coordinated execution of the above three steps, this embodiment achieves efficient and accurate construction of a power grid knowledge graph. Verified on an internal test set containing 100 typical power documents, compared to the traditional Graph RAG process, the document processing speed of this invention is improved by approximately 2.8 times, the F1 score of entity relation extraction is improved by approximately 12.5%, and the vector database storage space is reduced by approximately 35%. This is due to the adoption of a sparse activation mechanism using a hybrid expert network model and the omission of secondary verification; the effective preservation of cross-paragraph semantic dependencies through dictionary-enhanced semantic segmentation and dynamic overlap mechanisms; and the avoidance of vectorized computation of invalid data through pre-validation and invalid entity filtering.
[0039] Example 2
[0040] This embodiment provides an electronic device. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in Embodiment 1. The electronic device may be a server, a computer, or other device with computing capabilities.
[0041] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a power grid knowledge graph that integrates a hybrid expert network model and semantic segmentation, characterized in that, Includes the following steps: Step 1: Perform semantically aware segmentation on the input power document and set dynamic overlapping regions between adjacent document blocks to obtain multiple document blocks; Step 2: Input the multiple document blocks obtained in Step 1 into a hybrid expert network model fine-tuned by power grid domain instructions. The hybrid expert network model extracts entities and relations for each document block and outputs a set of entity-relation-entity triples. When the average confidence level output by the hybrid expert network model is higher than a preset threshold, the secondary verification step of the triple set is omitted. Step 3: Before vectorizing the triple set output in Step 2, perform type validity checks on the entities in the triple set according to the predefined power grid graph schema, filter out triples containing invalid entities, and then perform vectorizing embedding on the remaining triple set to construct a power grid knowledge graph.
2. The method according to claim 1, characterized in that, The semantic awareness segmentation in step one is as follows: load the pre-built core terminology dictionary of the power field, scan the power documents, identify the terms in the dictionary as indivisible whole units, and segment them in combination with the natural paragraph boundaries, punctuation marks and semantic integrity of the power documents.
3. The method according to claim 1, characterized in that, The size of the dynamic overlapping region in step one is determined as follows: Analyze the context of the document block boundary. If there is an unclosed clause, enumeration item, or cross-sentence reference at the boundary, the overlapping region is expanded to the minimum length that can completely contain the semantic unit, with an upper limit not exceeding 20% of the size of the adjacent block; otherwise, the default 15% overlap ratio is adopted.
4. The method according to claim 1, characterized in that, The hybrid expert network model in step two adopts a gated weighted fusion sparse activation mechanism. For each input Token, the routing network outputs the activation weights of the selected expert networks, and the final Token representation is the weighted sum of the outputs of each activated expert network.
5. The method according to claim 1, characterized in that, The entity-relationship-entity triplet set output in step two has each triplet conforming to a predefined format, which includes an entity type field, a relation type field, and a confidence field.
6. The method according to claim 1, characterized in that, In step three, type validity is verified based on a predefined power grid schema. Specifically, the power grid schema includes not only a set of valid entity types but also constraint rules between entities. The verification process checks not only individual entity types but also whether triples violate the constraint rules.
7. The method according to claim 1, characterized in that, Step three, which filters out triples containing invalid entities, includes: removing triples containing entities containing garbled characters using regular expression rules, and removing triples containing entities containing low-frequency meaningless words or common stop words using a dual-tower Siamese lightweight classification model; the input of the dual-tower Siamese lightweight classification model includes the entity name and its local context window in the original text.
8. The method according to claim 1, characterized in that, The predefined power grid schema in step three includes a set of legal entity types and a set of legal relationship types in the power grid domain. The set of legal entity types includes at least one of circuit breakers, transmission lines, transformers, busbars, and load nodes.
9. The method according to claim 1, characterized in that, After filtering out triples containing invalid entities in step three, the process further includes: before vectorizing and embedding the remaining set of triples, normalizing the entity names and units in the triples to unify the naming format and unit representation.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 9.