Power grid dispatching fault handling knowledge graph construction method based on large model

By constructing a knowledge graph for power grid dispatching fault handling based on a large model, the problems of low accuracy and poor timeliness of manual review of regulations in power grid fault handling are solved, realizing efficient and accurate response to power grid fault handling and improving the safety and reliability of the power grid.

CN121920488APending Publication Date: 2026-04-24NORTHWEST BRANCH OF STATE GRID POWER GRID CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHWEST BRANCH OF STATE GRID POWER GRID CO
Filing Date
2026-01-13
Publication Date
2026-04-24

Smart Images

  • Figure CN121920488A_ABST
    Figure CN121920488A_ABST
Patent Text Reader

Abstract

The invention relates to a power grid dispatching fault handling knowledge graph construction method based on a large model, which comprises the following steps: preprocessing document data to obtain short document data and long document data, and slicing the long document data; constructing a cue word template; performing preliminary information extraction on the preset text fragment through the large language model, and constructing a large language model fine adjustment data set; based on the large language model fine tuning data set, performing fine tuning on the large language model, and constructing an information extraction model; and based on the cue word template, performing information extraction on the preprocessed short document data and the sliced long document data by using an information extraction model, performing entity alignment on an extraction result, completing knowledge fusion, and realizing construction of the power grid fault disposal knowledge graph. The atlas constructed by the method can effectively support intelligent retrieval and cross-dimension correlation reasoning of regulation contents, assist dispatchers in quickly and accurately acquiring key information in complex scenes, and improve the power grid fault emergency response speed and the dispatching decision scientificity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, and in particular to a method for constructing a knowledge graph for power grid dispatching fault handling based on a large model. Background Technology

[0002] High electricity demand growth and energy structure optimization have directly led to the evolution of power grid topology from simple to complex. Faults are no longer singular in form, but exhibit new characteristics of diversity, suddenness, and interconnectedness, increasing the difficulty of prediction and handling. Therefore, ensuring the efficiency and capacity of the power grid to respond to sudden faults has gradually become a key issue in the control and defense of new power systems.

[0003] Currently, power grid dispatch and control systems primarily focus on monitoring power grid equipment status, analyzing fault points, and optimizing resources. Fault handling decisions and implementation still require dispatchers to manually search and review fault handling regulations, combining these with the post-fault power grid operation mode to find matching handling points for fault handling and recovery. Efficient power grid fault handling requires dispatchers to rapidly and accurately grasp multi-source data, including power grid equipment topology, fault handling regulations, dispatching procedures, and real-time equipment parameters. However, with the increasing diversity of power grid fault causes and types, and the continuous updating and accumulation of fault handling regulations and contingency plans, a vast system of fault handling regulations has been formed. Manual review relies heavily on experience, making it difficult to guarantee the accuracy, timeliness, and standardization of fault handling, seriously affecting the safe and reliable operation of the power grid. At present, the increasingly complex and diverse forms of power grid faults place higher demands on power grid fault handling work. To overcome the limitations of low accuracy and poor timeliness in manually reviewing regulations, it is urgent to introduce intelligent methods to integrate unstructured texts such as dispatch control management procedures, historical fault cases, and operational logic. This will allow for the full mining and fusion of multi-source data in power grid fault handling, refining it into systematic knowledge and constructing a knowledge graph for power grid fault handling. This will help dispatch personnel quickly and comprehensively grasp key information for fault handling, thereby improving the efficiency and response capabilities for handling sudden power grid faults. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for constructing a knowledge graph for power grid dispatching fault handling based on a large model, so as to overcome the problems of low accuracy and poor timeliness of manual review of regulations.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] A method for constructing a knowledge graph for power grid dispatching and fault handling based on a large model, comprising:

[0007] The document data is preprocessed to obtain short document data and long document data, wherein the document data is: multi-source original document data within the power company;

[0008] The long document data is sliced ​​using a long text document segmentation strategy;

[0009] Constructing prompt word templates for power fault knowledge graphs; wherein, the prompt word templates include: domain concept generation prompt word templates and information extraction task prompt word templates;

[0010] Preliminary information extraction is performed on preset text fragments using a large language model to construct a fine-tuning dataset for the large language model.

[0011] Based on the large language model fine-tuning dataset, the large language model is fine-tuned to construct an information extraction model.

[0012] Based on the aforementioned prompt word template, the information extraction model is used to extract information from preprocessed short document data and sliced ​​long document data. Entity alignment is performed on the extracted results to achieve knowledge fusion and construct a knowledge graph for power grid fault handling. Optionally, preprocessing of the document data includes:

[0013] The document data is categorized and selectively filtered to retain core documents in the power sector;

[0014] To address the diverse formats of the filtered documents, preprocessing is performed according to format classification, and all types of text information are uniformly converted into TXT format;

[0015] All TXT files will be divided according to a preset length threshold to obtain short document data and long document data.

[0016] Optionally, slicing the long document data using a long text document segmentation strategy includes:

[0017] Set the maximum allowed input token length for the large language model to L;

[0018] Find the chapter numbers in a long text document using regular expressions, replace them with a preset chapter number format, and assign heading levels to all headings in the document.

[0019] During the text segmentation stage, the document's logical structure is used as the primary basis for segmentation, and the text is segmented according to different levels of headings until the slice length is less than the maximum input token limit.

[0020] Optionally, in the prompt word template, the output mode of the domain concept prompt word template is used as the core constraint for large model entity recognition and triple extraction, guiding the large model to accurately output the domain knowledge architecture of power grid dispatching.

[0021] The prompts in the information extraction task prompt template include: background information, input text, task objective, and structured output.

[0022] Optionally, the information extraction task prompt word template includes the following for information extraction:

[0023] Phase 1: Identify predefined entity types and relation types in the input text to narrow the extraction scope of the second phase and reduce generation noise. Through explicit pattern cues, the model can focus on the semantic boundaries of the power system in complex procedural statements, providing a high-confidence type candidate set for subsequent phases.

[0024] Phase Two: Using the type set output from Phase One as constraints, guide the model to extract specific entities and relation triples from the specification text, and complete the structured output in one go while preserving the constraint transfer between phases.

[0025] Optionally, preliminary information extraction is performed on the preset text fragments using a large language model to construct a fine-tuning dataset for the large language model, including:

[0026] Preliminary information extraction is performed on preset text fragments using a large language model. After manual verification and review of the extraction results, a fine-tuning dataset for the large language model is constructed. The preset text fragments include representative text fragments selected from notification documents, implementation documents, and attachment documents.

[0027] Optionally, constructing an information extraction model includes:

[0028] A low-rank adaptation fine-tuning scheme is adopted, which freezes the pre-trained weights of the large language model, introduces a trainable low-rank matrix with a smaller number of parameters, and only updates the parameters of the low-rank matrix during training to fine-tune the large language model and build an information extraction model.

[0029] Optionally, entity alignment of the extracted results includes methods based on context constraints and similarity matching.

[0030] Optionally, constructing a knowledge graph for power grid fault handling includes:

[0031] After entity alignment, a structured analysis is performed on the core knowledge base. Matching is performed using the station name, equipment name, and fault type as association dimensions to establish a mapping relationship between dispatching procedure clauses and equipment entities. Based on the mapping relationship, the extracted knowledge bases from multiple document sources are merged to complete cross-document knowledge fusion and construct a knowledge graph for power grid fault handling. The core knowledge base includes: dispatching procedures and fault contingency plans.

[0032] The beneficial effects of this invention are as follows:

[0033] The proposed method for constructing a knowledge graph for power grid dispatching fault handling based on a large model achieves knowledge graph construction through multi-stage optimization design. Its core advantages and implementation process are as follows: First, document data is classified and targeted, focusing on core power domain documents and transforming them into standardized, high-quality power corpus, laying a solid data foundation for subsequent knowledge extraction and ensuring the professionalism and usability of the input data. Second, long documents are sliced, prioritizing the "document logical structure" as the dividing criterion until the length of all slices meets the maximum input token limit of the large language model, avoiding information fragmentation while ensuring the model can completely process the document content. Then, prompt word templates adapted to power grid dispatching control procedures are designed for domain concept generation and information extraction, respectively, improving the model's task adaptability and extraction targeting. Representative text fragments are selected, and after initial extraction by the large language model and manual verification, a fine-tuning dataset is constructed. A low-rank adaptation fine-tuning scheme is used to optimize the large language model. Finally, relying on the designed prompt word template, the model is finely tuned to efficiently complete information extraction; finally, entity alignment is achieved through context constraints and similarity matching, establishing a precise mapping relationship between scheduling procedure clauses and equipment entities, strengthening the consistency of entity association, and ultimately constructing a high-quality, highly adaptable power grid fault handling knowledge graph, providing strong knowledge support for rapid fault handling. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a schematic diagram of the process for constructing a knowledge graph for power grid dispatching fault handling based on a large model, according to an embodiment of the present invention.

[0036] Figure 2 This is a diagram illustrating the process of constructing a knowledge graph for power grid dispatching fault handling based on a large model, according to an embodiment of the present invention.

[0037] Figure 3 This is a visualization of a knowledge graph subgraph in an embodiment of the present invention. Detailed Implementation

[0038] 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 embodiments of the present invention, and not all embodiments. 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.

[0039] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] like Figures 1-2 As shown in the figure, this embodiment proposes a method for constructing a knowledge graph for power grid dispatching fault handling based on a large model, including:

[0041] The document data is preprocessed to obtain short document data and long document data, wherein the document data is: multi-source original document data within the power company;

[0042] The long document data is sliced ​​using a long text document segmentation strategy;

[0043] Constructing prompt word templates for power fault knowledge graphs; wherein, the prompt word templates include: domain concept generation prompt word templates and information extraction task prompt word templates;

[0044] Preliminary information extraction is performed on preset text fragments using a large language model to construct a fine-tuning dataset for the large language model.

[0045] Based on the large language model fine-tuning dataset, the large language model is fine-tuned to construct an information extraction model.

[0046] Based on the aforementioned prompt word template, the information extraction model is used to perform information extraction tasks on the preprocessed short document data and the sliced ​​long document data. The extracted results are then aligned with entities to complete knowledge fusion and realize the construction of a knowledge graph for power grid fault handling.

[0047] Specifically, in this embodiment, the proposed method for constructing a knowledge graph for power grid fault handling is as follows: First, document preprocessing is performed to classify and filter the original data, retaining core power domain documents and converting them into standardized, high-quality power corpus. Second, a long text document segmentation strategy is adopted, using "document logical structure" as the primary segmentation criterion, iteratively performing slicing until the length of all document slices meets the maximum input token limit of the large language model. Then, specialized prompt word templates for power grid dispatch control procedures are designed for domain concept generation and information extraction tasks, respectively. A large language model fine-tuning dataset is constructed, and a low-rank adaptation fine-tuning scheme is used to optimize and train the large language model. Finally, the fine-tuned large language model is used to complete information extraction, and entity alignment is achieved based on context constraints and similarity matching algorithms. Entities are associated and matched, and a precise mapping relationship is established between dispatch procedure clauses and equipment entities, ultimately completing the construction of the power grid fault handling knowledge graph.

[0048] Furthermore, preprocessing of the document data includes:

[0049] The document data is categorized and selectively filtered to retain core documents in the power sector;

[0050] To address the diverse formats of the filtered documents, preprocessing was performed according to format classification, and all types of text information were uniformly converted into TXT format;

[0051] All TXT files will be divided according to a preset length threshold to obtain short document data and long document data.

[0052] Specifically, in this embodiment, targeting the core application scenario of rapid power grid fault handling, multiple sources of original documents within power companies are transformed into standardized, high-quality power-related corpus capable of supporting subsequent knowledge extraction, laying the data foundation for the construction of a power-related knowledge base. The document data is classified and selectively filtered, retaining core power-related documents to ensure that the filtered data directly serves the goals of knowledge graph construction.

[0053] To address the diversity of the selected documents, standardized conversion was carried out according to their file formats.

[0054] For Word and Excel files, extract the text and structured data directly, store the image data separately, store the plain text data in a TXT file, and store the structured tables in a CSV file.

[0055] For PDF files, a fusion technology combining PDF structured parsing and optical character recognition (OCR) is used to extract document content. Editable text, including fault descriptions, scheduling instructions, and procedural clauses, is extracted using PDF structured parsing tools. During the PDF structured parsing process, table information and chart titles within the document are also extracted as text, resulting in table data or chart titles being mixed into the TXT file, disrupting the semantic coherence of the text. To address this issue, this embodiment converts the PDF document to a TXT file and then manually verifies and removes such redundant information to ensure the coherence of the text content. For table content, table recognition technology in PaddleOCR-2.0 is used to process the table data in the PDF and save it as a corresponding CSV file. For images in the PDF file, the complete page containing the image is extracted and stored as a separate file.

[0056] For the very few formulas in the document, after manual searching, formula recognition tools are used to rewrite the corresponding formulas in LaTeX format and replace the original extracted content in the TXT file.

[0057] All TXT files will be divided into short and long documents based on their logical structure and predetermined length thresholds, facilitating the development of slicing strategies for long documents. For power industry text extraction scenarios, layout parsing technology will be used to separate and extract chart data from text content. Furthermore, to achieve cross-modal data association, all chart files will use a unique naming convention of "source document ID + source document name + content type + sequence number," which will be replaced with the corresponding filename in the TXT reference, ensuring accurate association between TXT files and chart data and providing a reliable corpus for knowledge graph construction.

[0058] Furthermore, the long document data is sliced ​​using a long text document segmentation strategy, including:

[0059] Set the maximum allowed input token length for the large language model to L;

[0060] Find the chapter numbers in a long text document using regular expressions, replace them with a preset chapter number format, and assign heading levels to all headings in the document.

[0061] During the text segmentation stage, the document's logical structure is used as the primary segmentation criterion. Segments are made based on the first-level headings. If the length of the segmented text exceeds L, it is then segmented based on the second-level headings, until the slice length is less than the maximum input token limit.

[0062] Specifically, in this embodiment, a long text document segmentation strategy is used to slice the content of long documents. To maximize the preservation of the hierarchical structure and semantic coherence between documents, the maximum allowed input token length for the large language model is set to L. First, the chapter numbers in the document are identified using regular expressions and labeled with "##Chapter Number##", and each title in the document is assigned a title level. During the text segmentation stage, the "document logical structure" is prioritized as the segmentation benchmark, and segmentation is performed based on the first-level headings. If the length of the segmented text exceeds L, it is then segmented based on the second-level headings, until the slice length is less than the maximum input token limit. To optimize the semantic ability of the large language model to associate adjacent segments during knowledge extraction, a "document logical structure hint label" is added to the beginning of the slice, and "chapter number and title information" are added to the processed text to reduce knowledge fragmentation. During the knowledge extraction process, the string generated by concatenating the chapter numbers of each level of headings is used as a dictionary index, and the extracted knowledge is stored in the dictionary for easy subsequent knowledge fusion.

[0063] The first-level headings and second-level headings are as follows:

[0064] 1. General Provisions (Level 1 Heading);

[0065] 2. Dispatch Management Regulations (Level 1 Heading);

[0066] 2.1 (Second-level heading);

[0067] 2.2 (Second-level heading);

[0068] 2.2.1 (Third-level heading);

[0069] 2.2.2 (Third-level heading);

[0070] 2.3 (Second-level heading);

[0071] 3. Dispatch and Operation Procedures (Level 1 Heading);

[0072] The main steps are as follows: First, divide the document according to its first-level headings. If the length of a segment (such as the entire second chapter) exceeds the threshold L, then divide it according to the corresponding second-level headings (2.1, 2.2, and 2.3 are the three resulting segments after dividing the second chapter according to the second-level headings). If the length of the resulting segments still exceeds the threshold, then divide the segments that exceed the threshold according to the third-level headings, until the length of all slice text is less than the maximum input token limit.

[0073] Furthermore, in the prompt word template, the output mode of the domain concept prompt word template is used as the core constraint for large model entity recognition and triple extraction, guiding the large model to accurately output the knowledge architecture of the power grid dispatch domain;

[0074] The prompts in the information extraction task prompt template include: background information, input text, task objective, and structured output.

[0075] Specifically, this embodiment designs two sets of prompt word templates, both adapted to power grid dispatch control procedures and other power text information extraction scenarios, and used for domain concept generation and information extraction tasks respectively. The output mode of the domain concept generation template serves as the core constraint for entity recognition and triple extraction in the large model. Domain concept generation is a crucial prerequisite for constructing a knowledge graph for power grid dispatch fault handling. Its core objective is to guide the large model to accurately output the knowledge architecture of the power grid dispatch domain. Based on the domain concepts generated by the model, specific extraction paradigms and constraints are clarified for the subsequent information extraction stage, thereby improving extraction accuracy.

[0076] The prompts for data extraction include four parts: background information, input text, task objectives, and structured output. Background information provides the large language model with context and relevant auxiliary information for the extraction task, facilitating its better understanding of the task requirements. Providing the task context allows the large language model to focus on the target domain and generate output that meets the requirements. Auxiliary information, such as entity types and relation lists, can improve the accuracy of the large language model's extraction and reduce the chances of industry-specific terms in the input text not being recognized. Input text refers to the basic text that can be directly input into the large model after preprocessing. The task objectives clarify the specific tasks that the large language model needs to perform, such as entity extraction and triple extraction. Structured output defines the output specifications of the large language model, using JSON format. Specifically, the extraction process is divided into two stages:

[0077] Phase 1: Identify predefined entity and relation types from the input text to narrow down the extraction scope and reduce generation noise in the second phase. In the knowledge patterns of the power grid dispatching domain, entity and relation types are defined. Explicit cues from the patterns enable the model to focus on the semantic boundaries of the power system within complex procedural statements, providing a high-confidence set of type candidates for subsequent phases.

[0078] Phase Two: Using the type set output from Phase One as constraints, the model is guided to extract specific entities and relation triples from the procedure text. The multi-round question-and-answer process of Phase Two is changed to a single-round question-and-answer extraction, preserving the constraint propagation between phases while completing the structured output in one go. This improvement significantly reduces the number of interaction rounds and computation / token overhead, enhancing the extraction efficiency and stability for long, entity-relationship-dense procedure texts.

[0079] Furthermore, preliminary information extraction is performed on the preset text fragments using a large language model, and a fine-tuning dataset for the large language model is constructed, including:

[0080] Preliminary information extraction is performed on preset text fragments using a large language model. After manual verification and review of the extraction results, a fine-tuning dataset for the large language model is constructed. The preset text fragments include representative text fragments selected from notification documents, implementation documents, and attachment documents.

[0081] Furthermore, the construction of the information extraction model includes:

[0082] A low-rank adaptation fine-tuning scheme is adopted, which freezes the pre-trained weights of the large language model, introduces a trainable low-rank matrix with a smaller number of parameters, and only updates the parameters of the low-rank matrix during training to fine-tune the large language model and build an information extraction model.

[0083] Specifically, in this embodiment,

[0084] By fine-tuning the parameters of the large language model, we can adapt to the task requirements of the power grid fault handling knowledge graph and realize the construction of the fault handling knowledge graph.

[0085] Large language models have a massive number of parameters, making full parameter fine-tuning computationally expensive. Therefore, Low-Rank Adaptation (LoRA) is chosen as a fine-tuning scheme. LoRA freezes the pre-trained weights of the large language model and introduces a small number of trainable low-rank matrices. During training, only the parameters of these low-rank matrices are updated, achieving efficient fine-tuning of the large language model. Let the pre-trained weight matrix be... LoRA restricts its update method, making the incremental parameter matrix fine-tuned with all parameters... This can be represented as a low-rank approximation of two matrices, B and A, with fewer parameters. Model fine-tuning is achieved by training two learnable matrices A and B. B is initialized with zero. During the inference phase, the output of the standard large language model is superimposed with the output of the newly added layer to obtain the final output result, as shown in the formula:

[0086]

[0087] LoRA parameter fine-tuning has low memory requirements and can extend the application capabilities of large language models in the construction of knowledge graphs for power grid fault handling with low computational cost.

[0088] This embodiment selects representative text fragments (fault handling text fragments, notification text fragments, operation management text fragments, power grid operation regulation fragments, etc.) from notification documents, implementation documents, and attachment documents, totaling 200 fragments. Initial information extraction is performed using a large language model. After manual verification and review of the extraction results, a fine-tuning dataset of 2000 data entries is constructed, divided into training, validation, and test sets in a 7:1.5:1.5 ratio. The large language model is then fine-tuned using LoRA technology, and the fine-tuned model is used as the information extraction model for information extraction from the entire dataset.

[0089] Use the designed prompt template to complete the information extraction task and extract relation triples. Given the input sentence x to be extracted, construct the first-stage prompt words using the domain concept generation pattern. The input is fed into a large language model to obtain a list of relations R and entity types T:

[0090] ;

[0091] In the second stage, prompt words are constructed using the relation list R and entity type T as knowledge extraction constraints. Extract triples from sentence x :

[0092] ;

[0093] This represents the set of triples extracted from sentence x in the second stage. Through the designed prompt word templates, and considering the industry characteristics of power grid dispatch control procedures, the large model can achieve named entity recognition and relation triple extraction. The final extracted results are uniformly saved in JSON format files, facilitating subsequent knowledge graph construction and visualization.

[0094] Furthermore, entity alignment of the extracted results includes methods based on context constraints and similarity matching.

[0095] Specifically, in this embodiment, after extracting knowledge triples from all documents, entity alignment is achieved based on context constraints and similarity matching. First, entities in all single JSONs are merged, assigning the same encoded ID to identical entities. Then, for entities of the "equipment" type, based on their context, the name of the nearest preceding site is used as a constraint to complete the equipment entity information using "site name + voltage level + equipment name + equipment number," thereby resolving the naming conflict between different sites and ensuring the non-conflicting and consistent naming of equipment entities.

[0096] Knowledge fusion primarily focuses on entity alignment tasks. In power grid regulations, entity alignment mainly involves the use of full and abbreviated organization / equipment names. Considering all aspects of entity alignment, character-level similarity and word vector-level similarity are used to comprehensively determine the similarity between entities. Jaro-Winkler similarity and cosine similarity are calculated to describe the relationships between entities. Entity pairs are ranked based on the sum of these two similarities, and pairs exceeding a predetermined threshold are aligned. The formula for calculating the entity similarity score based on Jaro-Winkler is as follows:

[0097] ;

[0098] Where m represents the number of matched characters in the two entities. and Representing entities respectively and The string length is given by t, the number of transpositions is given by L, the length of the common prefix of the two strings is given by P, and the scaling factor constant is given by 0.1.

[0099] When calculating cosine similarity, entities are obtained using SimBERT. and The vectorized representation of the entity is then used to calculate the similarity score between entities using cosine similarity. The main calculation process is as follows:

[0100] .

[0101] Furthermore, the construction of the knowledge graph for power grid fault handling includes:

[0102] After entity alignment, a structured analysis is performed on the core knowledge base. Matching is performed using the station name, equipment name, and fault type as association dimensions to establish a mapping relationship between dispatching procedure clauses and equipment entities. Based on the mapping relationship, the extracted knowledge bases from multiple document sources are merged to complete cross-document knowledge fusion and realize the construction of a power grid fault handling knowledge graph. The core knowledge base includes: dispatching procedures and fault contingency plans.

[0103] Specifically, in this embodiment, after entity alignment, a structured analysis is first performed on the core knowledge base, including dispatching procedures and fault contingency plans. Then, matching is performed using station name, equipment name, and fault type as association dimensions to establish a mapping relationship between dispatching procedure clauses and equipment entities. Based on this mapping relationship, extraction knowledge bases from multiple document sources are further merged to complete cross-document knowledge fusion, ultimately completing the construction of a power grid fault handling knowledge graph. Figure 3 It demonstrates the visualization of knowledge graph subgraphs.

[0104] This embodiment first classifies and selectively filters the document data, retaining core power-related documents and transforming them into standardized, high-quality power-related corpus capable of supporting subsequent knowledge extraction. For core application scenarios involving rapid grid fault handling, the document data is classified and selectively filtered, retaining core power-related documents. To address the diversity of the filtered documents, standardization conversion is performed according to their file formats. All TXT files are divided into different ranges based on text length and stored accordingly, categorized into short and long documents based on preset length thresholds.

[0105] This embodiment first slices the long document content, prioritizing the "document logical structure" as the dividing criterion, until the slice length is less than the maximum input token limit.

[0106] This embodiment first designs prompt word templates for power grid dispatch control procedures, which are used to generate domain concepts and extract information. Based on the domain concepts generated by the large model, these concepts are then manually checked, supplemented, and deleted to provide extraction paradigms and constraints for the information extraction stage. The pattern of generating prompt words using domain concepts constrains the entity recognition and triple extraction of the large model.

[0107] This embodiment first selects representative text fragments and performs preliminary information extraction using a large language model. After manual verification and review of the extraction results, a fine-tuning dataset for the large language model is constructed. A low-rank adaptation fine-tuning scheme is used to fine-tune the large language model. Based on the designed prompt template, the fine-tuned large language model completes the information extraction task. Entity alignment is achieved based on context constraints and similarity matching methods. Entities are associated and matched, and a mapping relationship between scheduling procedure clauses and equipment entities is established, thus completing the construction of a knowledge graph for power grid fault handling.

[0108] This embodiment was implemented using Python 3.12.12 and selected two large language models primarily for Chinese: QwQ-32B and DeepSeek-R1-Distill-Qwen-32B, as the base models for unstructured information extraction. Figure 1 As shown, the method process of this embodiment is as follows.

[0109] Step 1: Transform the original documents from multiple sources within the power company into standardized, high-quality power-related corpus that can support subsequent knowledge extraction;

[0110] Step 1.1: For the core application scenario of rapid power grid fault handling, classify and target the document data, retain the core power field documents, and ensure that the filtered data directly serves the goal of knowledge graph construction;

[0111] Step 1.2: To address the diversity of the selected documents, standardize the conversion according to the document format distribution;

[0112] Step 1.3: All TXT files will be divided into short documents and long documents based on the directory structure and a preset length threshold;

[0113] Step 2: Use a long text document segmentation strategy to slice the long document content. Add "chapter number and title information" to the beginning of the text to be processed at the beginning of the slice, and introduce document logical structure prompt tags to ensure the integrity and logical coherence of the slice information and provide clear guidance for subsequent processing.

[0114] Step 3: Design prompt word templates for constructing a knowledge graph of power dispatching faults, which are used for generating domain concepts and extracting information respectively;

[0115] Step 3.1: Based on the domain concepts generated by the large model, these concepts are manually checked, supplemented, and deleted to provide extraction paradigms and constraints for the information extraction stage;

[0116] Step 3.2: Identify the predefined entity types and relation types in the pattern from the input text to narrow down the extraction scope of the second stage and reduce generation noise;

[0117] Step 3.3: Using the type set output in Step 3.2 as constraints, guide the model to extract specific entities and relation triples from the specification text.

[0118] Step 4: Select representative text fragments from notification documents, implementation documents, and attachment documents, extract preliminary information from them using a large language model, and construct a large language model fine-tuning dataset;

[0119] Step 5: Use LoRA to freeze the pre-trained weights of the large language model, introduce a trainable low-rank matrix with a smaller number of parameters, and only update the parameters of the low-rank matrix during training to fine-tune the large language model.

[0120] Step 6: Use the designed prompt template to complete the information extraction task, extract relation triples, and finally save the extracted results in a JSON format file.

[0121] Step 7: Implement entity alignment using a context-constraint and similarity matching method to resolve entity naming conflicts between different sites and ensure the non-conflict and consistency of equipment entity naming;

[0122] Step 8: After entity alignment, conduct structured analysis on core knowledge bases such as dispatching procedures and fault contingency plans. Matching is performed using station name, equipment name, and fault type as association dimensions to establish a mapping relationship between dispatching procedure clauses and equipment entities. Based on this mapping relationship, knowledge bases extracted from multiple document sources are merged to complete cross-document knowledge fusion. After manual verification to confirm accuracy, the final knowledge graph for power grid fault handling is constructed.

[0123] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for constructing a knowledge graph for power grid dispatching fault handling based on a large model, characterized in that, include: The document data is preprocessed to obtain short document data and long document data, wherein the document data is: multi-source original document data within the power company; The long document data is sliced ​​using a long text document segmentation strategy; Constructing prompt word templates for power fault knowledge graphs; wherein, the prompt word templates include: domain concept generation prompt word templates and information extraction task prompt word templates; Preliminary information extraction is performed on preset text fragments using a large language model to construct a fine-tuning dataset for the large language model. Based on the large language model fine-tuning dataset, the large language model is fine-tuned to construct an information extraction model. Based on the aforementioned prompt word template, the information extraction model is used to extract information from the preprocessed short document data and the sliced ​​long document data. The extracted results are then aligned with entities to achieve knowledge fusion and realize the construction of a knowledge graph for power grid fault handling.

2. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model as described in claim 1, characterized in that, Preprocessing document data includes: The document data is categorized and selectively filtered to retain core documents in the power sector; To address the diverse formats of the filtered documents, preprocessing is performed according to format classification, and all types of text information are uniformly converted into TXT format; All TXT files will be divided according to a preset length threshold to obtain short document data and long document data.

3. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model as described in claim 1, characterized in that, Slicing the long document data using a long text document segmentation strategy includes: Set the maximum allowed input token length for the large language model to L; Find the chapter numbers in a long text document using regular expressions, replace them with a preset chapter number format, and assign heading levels to all headings in the document. During the text segmentation stage, the document's logical structure is used as the primary basis for segmentation, and the text is segmented according to different levels of headings until the slice length is less than the maximum input token limit.

4. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model as described in claim 1, characterized in that, In the aforementioned prompt word template, the output mode of generating prompt word templates from domain concepts serves as the core constraint for entity recognition and triple extraction in the large model, guiding the large model to accurately output the domain knowledge architecture of power grid dispatching. The prompts in the information extraction task prompt template include: background information, input text, task objective, and structured output.

5. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model according to claim 1, characterized in that, The information extraction task prompt word template includes the following information extraction process: Phase 1: Identify predefined entity types and relation types in the input text to narrow the extraction scope of the second phase and reduce generation noise. Through explicit pattern cues, the model can focus on the semantic boundaries of the power system in complex procedural statements, providing a high-confidence type candidate set for subsequent phases. Phase Two: Using the type set output from Phase One as constraints, guide the model to extract specific entities and relation triples from the specification text, and complete the structured output in one go while preserving the constraint transfer between phases.

6. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model according to claim 1, characterized in that, The large language model is used to perform preliminary information extraction on preset text fragments, and a fine-tuning dataset for the large language model is constructed, including: Preliminary information extraction is performed on preset text fragments using a large language model. After manual verification and review of the extraction results, a fine-tuning dataset for the large language model is constructed. The preset text fragments include representative text fragments selected from notification documents, implementation documents, and attachment documents.

7. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model as described in claim 1, characterized in that, Building an information extraction model includes: A low-rank adaptation fine-tuning scheme is adopted, which freezes the pre-trained weights of the large language model, introduces a trainable low-rank matrix with a smaller number of parameters, and only updates the parameters of the low-rank matrix during training to fine-tune the large language model and build an information extraction model.

8. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model according to claim 1, characterized in that, Entity alignment of the extracted results includes methods based on context constraints and similarity matching.

9. The method for constructing a knowledge graph for power grid dispatching fault handling based on a large model according to claim 1, characterized in that, The construction of the knowledge graph for power grid fault handling includes: After entity alignment, a structured analysis is performed on the core knowledge base. Matching is performed using the station name, equipment name, and fault type as association dimensions to establish a mapping relationship between dispatching procedure clauses and equipment entities. Based on the mapping relationship, the extracted knowledge bases from multiple document sources are merged to complete cross-document knowledge fusion and realize the construction of a power grid fault handling knowledge graph. The core knowledge base includes: dispatching procedures and fault contingency plans.