Power distribution network defect knowledge base construction method and device based on large language model
By combining a large language model with a power industry dictionary and LoRA technology, the problems of terminology ambiguity, heterogeneous multi-source data, and dynamic changes in the construction of the distribution network defect knowledge base were solved. This enabled efficient and accurate defect knowledge extraction and association, ensuring the consistency and reliability of the knowledge base.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID ANHUI ELECTRIC POWER CO LTD ELECTRIC POWER SCI RES INST
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies struggle to efficiently and accurately construct a distribution network defect knowledge base, facing challenges such as ambiguous terminology, multi-source heterogeneous data, complex relationships, dynamic evolution of defects, and information conflicts, resulting in inefficient and inconsistent knowledge base construction.
We employ a large language model combined with a terminology dictionary and a thesaurus for the power industry to enhance semantics. We use the LoRA low-rank adaptive method for domain adaptation and uncertainty calibration, introduce entity linking and attribute alignment strategies for knowledge fusion and conflict resolution, and design a dynamic update mechanism.
It achieves efficient and accurate extraction and association of defect knowledge, ensuring the consistency and reliability of the knowledge base, supporting dynamic updates, and improving the accuracy and operational efficiency of the knowledge base.
Smart Images

Figure CN122045327A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the intersection of distribution network operation and maintenance technology and natural language processing technology. Specifically, it relates to a method and apparatus for constructing a distribution network defect knowledge base based on a large language model. Background Technology
[0002] As the link between the main power grid and end users in the power system, the operation of the distribution network directly determines the reliability and quality of power supply. Given the large number and wide distribution of distribution network equipment, various defects inevitably arise during long-term operation due to factors such as environmental corrosion, mechanical wear, and load fluctuations. Failure to detect and address these defects in a timely manner may lead to power outages, causing significant economic losses and social impact.
[0003] The core of distribution network defect management lies in establishing a comprehensive, accurate, and efficient defect knowledge base to support defect identification, diagnosis, handling, and prevention. Traditional knowledge base construction methods heavily rely on manual compilation. Maintenance personnel must extract key information from massive amounts of defect records, maintenance reports, equipment manuals, and industry standards, manually constructing knowledge entries and establishing relationships. This method has significant drawbacks. First, manually processing massive amounts of text data is time-consuming and labor-intensive, making it difficult to keep up with the explosive growth of distribution network defect data. Second, manual extraction is susceptible to subjective factors, potentially leading to omissions, errors, or inconsistencies. Third, traditional knowledge bases often use structured tables to store data, making it difficult to capture the complex semantic relationships between defects and factors such as equipment type, operating environment, and corrective measures, resulting in low efficiency in knowledge retrieval and reuse. Finally, when industry standards evolve or new defect types emerge, manually updating the knowledge base requires a lengthy process, failing to meet real-time operational needs.
[0004] In recent years, Natural Language Processing (NLP) technology has made significant breakthroughs in the field of text processing. Some studies have attempted to apply NLP to knowledge extraction from distribution network defects, but existing methods mainly rely on traditional machine learning models or basic pre-trained models, which have a number of limitations. These include the fact that traditional machine learning models are highly dependent on feature engineering, making it difficult to handle the complex semantics in distribution network defect texts, such as technical terms and ambiguous expressions. Basic pre-trained models lack optimization for the distribution network domain, resulting in insufficient understanding of industry-specific knowledge, leading to low accuracy and recall in knowledge extraction, and failing to meet the professional requirements for knowledge base construction. Large language models (LLMs) such as GPT and LLaMA, with their powerful contextual semantic understanding and knowledge modeling capabilities, have shown great potential in professional domain text processing.
[0005] However, building a knowledge base for the field of distribution network defects still faces a series of challenges. First, defect text is highly specialized, containing numerous distribution network-specific terms and industry abbreviations. Second, multi-source defect data exhibits significant heterogeneity, with varying data granularity. While information is highly complementary, integration is difficult, leading to knowledge fragmentation. Third, defect relationships are complex. Distribution network defects are strongly correlated with equipment type, installation environment, operating years, and maintenance history, and there are chain reactions between defects. Traditional methods struggle to capture these multi-level, strongly coupled semantic relationships. Furthermore, defect information redundancy and conflicts are frequent. The same equipment defect may be recorded through multiple channels, resulting in inconsistent descriptions and conflicts between historical and current defect states, potentially leading to inconsistencies in the knowledge base. Finally, defect types evolve dynamically. The commissioning of new intelligent equipment in the distribution network and the impact of extreme weather can give rise to new defect types, requiring the knowledge base to quickly adapt to these dynamic changes.
[0006] Currently, there is no mature algorithm that can deeply integrate large-scale language models into the construction of a distribution network defect knowledge base. How to optimize the knowledge extraction and association capabilities of large-scale language models to cope with the professional and complex characteristics of distribution network defect texts, and thus build an efficient and accurate defect knowledge base, has become an urgent issue to be addressed in the field of distribution network operation and maintenance. Summary of the Invention
[0007] This invention relates to a method and apparatus for constructing a distribution network defect knowledge base based on a large language model. By optimizing the domain adaptability of the large language model, it achieves efficient extraction, accurate association, and dynamic updating of professional knowledge from distribution network defect texts. It specifically addresses the unique challenges in constructing a distribution network defect knowledge base, such as terminological ambiguity, multi-source heterogeneity, complex associations, defect evolution, and information conflicts.
[0008] The core idea of this invention is to first use a large language model to perform semantic enhancement and contextual completion on the original defective text; second, guide the model to identify key elements related to the defect through carefully designed prompt templates; ensure that the extracted results conform to predefined knowledge patterns through structured output constraints; and finally, introduce knowledge fusion and conflict resolution strategies to integrate the results extracted from multiple sources into a consistent and non-redundant knowledge base.
[0009] The technical solution of the present invention is as follows:
[0010] A method for constructing a distribution network defect knowledge base based on a large language model, characterized by the following steps:
[0011] S1: Knowledge Text Input: Obtain the distribution network defect knowledge text to be stored in the knowledge base, forming the original defect text set;
[0012] S2: Text Preprocessing and Semantic Enhancement: A semantic enhancement mechanism based on a power industry terminology dictionary and synonym mapping table is introduced. The Enhance function performs three core processes on a single defect text: terminology standardization, context completion, and semantic clarification.
[0013] S3: Defect Element Extraction: Clarify that the dimensions for extracting defect text are not limited to one or more of the following: the device where the defect is located, the defect attribute, the attribute value, the defect level, and the defect cause. These dimensions serve as a unified standard for element extraction. For the same defect description text, generate multiple candidate group outputs and use a multi-round verification mechanism to filter reliable extraction results.
[0014] S4: Domain Adaptation Fine-tuning and Uncertainty Calibration: The LoRA low-rank adaptive method is used to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples; the entropy value of each output field of the large language model is calculated, and low-confidence groups with entropy values exceeding the threshold are included in the manual review queue.
[0015] S5: Knowledge Fusion and Conflict Resolution: Based on entity linking and attribute alignment strategies, the initially extracted groups are clustered and fused. For conflict values of the same attribute within the same cluster, they are processed according to timestamp and source system permission priority rules. If it cannot be determined, a conflict marker is generated and pushed to the expert system.
[0016] S6: Dynamic update of knowledge base: Repeat the above steps for newly added / modified defect knowledge texts every day to achieve incremental updates of the knowledge base, while retaining historical version snapshots and change logs to complete version control.
[0017] Furthermore, the domain adaptation fine-tuning and uncertainty calibration in S4 specifically include: selecting a small number of high-quality labeled samples for typical defects in distribution networks and new equipment defect scenarios. , The LoRA low-rank adaptation method is used to fine-tune the attention weights of a large language model while maintaining the model's pre-training parameters. No change, only train the newly added low-rank increment matrix The core formula is ,in Achieved through low-rank decomposition , , Significantly reduce the amount of fine-tuning parameters to Domain adaptation is achieved without changing the model architecture; the entropy value is calculated for each output field using the following formula: If the entropy value of any field exceeds the preset threshold If the corresponding triple is not found, it will be marked as low confidence and sent to the manual review queue to further avoid the risk of misjudgment.
[0018] Furthermore, the aforementioned text preprocessing and semantic enhancement specifically include: assuming the original set of defective texts is... Each These are all unstructured texts from inspection reports, work order systems, or fault records, and a semantic enhancement formula is introduced:
[0019]
[0020] in, A terminology dictionary and thesaurus for the power industry The function performs three parts: terminology standardization, context completion, and semantic clarification.
[0021] Furthermore, the aforementioned defect element extraction specifically includes: based on a large language model, using a hierarchical prompt word template to guide the large model to gradually identify defect knowledge triples, whereby the defect knowledge pattern is defined as a group. :
[0022]
[0023] in, The device where the defect is located. It is a defect attribute. It is an attribute value. It is the defect level. That is a possible reason;
[0024] Generate multiple candidate outputs for the same text The most reliable result is selected through consensus voting.
[0025]
[0026] in This is an indicator function. If there are no consensus entries, the manual review interface is triggered.
[0027] Furthermore, the aforementioned domain adaptation fine-tuning specifically includes: using a lightweight domain adaptation fine-tuning strategy to cover typical defects in the power distribution network and defects in new equipment, and selecting a small number of high-quality labeled samples. We use the LoRA method to fine-tune some attention weights of a large language model, keeping the original parameters unchanged, and only train the low-rank increment matrix.
[0028] The core formula for LoRA fine-tuning is as follows:
[0029]
[0030]
[0031] in To reduce the computational cost of fine-tuning, the number of newly added parameter matrices is reduced from the pre-trained parameter matrix. And for the increment matrix Assuming low-rank decomposition, where matrices A and B are the parameters to be learned in LoRA fine-tuning, the number of parameters to be learned in LoRA fine-tuning is... .
[0032] Furthermore, the aforementioned uncertainty calibration includes: calculating the entropy of each output field of the large language model.
[0033]
[0034] in, Given the set of candidate values for this field, if the entropy value of any field exceeds the threshold... If the triple is not found, it will be marked as "low confidence" and added to the manual review queue.
[0035] Furthermore, the knowledge fusion and conflict resolution specifically include employing a fusion strategy based on entity links and attribute alignment, assuming that all initially extracted group sets are... A fusion strategy based on entity linking and attribute alignment is adopted to standardize and normalize Entity fields, utilizing database... Perform exact or fuzzy matching. If a match is successful, cluster all triples pointing to the same device:
[0036]
[0037] For the same attribute in the same cluster, if there is a conflict in the values, the following rules are followed to resolve it: if the timestamp of the source text is more recent, it should be used first; if the times are close, the permissions of the source system are compared; if it is still impossible to determine, a conflict flag is generated and pushed to the expert system.
[0038] Furthermore, the dynamic knowledge base is dynamically updated, specifically including: when new defective texts flow in, only newly added or modified triples are processed, and version differences are recorded. Let the knowledge base on day t be... The update operation is as follows:
[0039]
[0040] in This represents the knowledge items added / modified on that day.
[0041] A device for constructing a distribution network defect knowledge base based on a large language model, characterized in that it includes:
[0042] The text acquisition module is used to acquire the distribution network defect knowledge text to be stored in the knowledge base, forming an original defect text set.
[0043] The semantic enhancement processing module has a built-in power industry terminology dictionary and synonym mapping table, and is equipped with an Enhance function. The Enhance function performs three core processes on the single defect text obtained from the text, namely terminology standardization, context completion, and semantic clarification, to achieve text preprocessing and semantic enhancement.
[0044] The defect element extraction module presets defect text extraction dimensions. The extraction dimensions include at least one or more of the following: the device where the defect is located, the defect attribute, the attribute value, the defect level, and the defect cause, which serve as a unified standard for element extraction. The defect element extraction generates multiple candidate group outputs for the same defect description text and filters reliable extraction results through a built-in multi-round verification mechanism.
[0045] The adaptation fine-tuning and calibration module includes a domain adaptation unit and an uncertainty calibration unit. The domain adaptation unit adopts the LoRA low-rank adaptive method to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples. The uncertainty calibration unit is used to calculate the entropy value of each output field of the large language model and include low-confidence groups with entropy values exceeding a preset threshold into a manual review queue.
[0046] The knowledge fusion module, based on entity linking and attribute alignment strategies, clusters and fuses the initial extraction groups of the defective elements. For conflicting values of the same attribute within the same cluster, the knowledge fusion resolves the conflict according to timestamp priority rules and source system permission priority rules. If the conflict result cannot be determined, a conflict marker is generated and pushed to an external expert system.
[0047] The dynamic update module is used to capture the newly added / modified defect knowledge texts every day, and drive the text acquisition, semantic enhancement processing, defect element extraction, adaptation fine-tuning and calibration, and knowledge fusion to perform corresponding processes in sequence to achieve incremental updates of the knowledge base; the dynamic update is also used to retain historical version snapshots and change logs of the knowledge base to complete version control.
[0048] In the Enhance function of the semantic enhancement processing module, the terminology standardization processing specifically involves replacing non-standard terms in the defect text with domain-standard terms based on the built-in power domain terminology dictionary; the context completion processing specifically involves supplementing the missing key context information in the text by combining common sense about distribution network defect scenarios with a synonym mapping table; and the semantic clarification processing specifically involves resolving ambiguous expressions in the text and clarifying the core semantics of the defect description.
[0049] The beneficial effects of this invention are as follows:
[0050] A method for constructing a distribution network defect knowledge base based on a large language model is proposed. By combining the semantic understanding capabilities of the large language model with knowledge constraints in the electrical field, it can automatically and effectively extract structured defect information from massive amounts of unstructured text, avoiding the inefficiency and high error rate of traditional manual sorting or rule template methods. It specifically addresses the unique challenges in constructing a distribution network defect knowledge base, such as terminological ambiguity, heterogeneous multi-source data, weak correlations, dynamic defect evolution, and information conflicts. Experiments show that the accuracy of extracting key fields can reach over 90%. By utilizing terminology standardization, context completion, and forced structured output mechanisms, the originally fragmented and inconsistent defect descriptions are uniformly transformed into knowledge quintuples conforming to power operation and maintenance standards, providing a high-quality data foundation for subsequent intelligent analysis. An uncertainty calibration mechanism is introduced to automatically mark low-confidence extraction results and push them for manual review, which not only ensures the quality of the knowledge base but also enhances the trust of operation and maintenance personnel in the artificial intelligence system; simultaneously, all knowledge items retain their source, timestamp, and confidence level, supporting full-process traceability. By implementing a conflict resolution strategy based on time priority and data source permissions, we can effectively integrate duplicate or conflicting information from different channels to ensure the consistency and reliability of the knowledge base and avoid misjudgments caused by information conflicts. An incremental update and version management mechanism is designed to enable the knowledge base to continuously expand and optimize with new defect data, adapting to dynamic characteristics such as aging distribution network equipment and environmental changes, and maintaining long-term knowledge timeliness. In summary, this invention not only solves the pain points of fragmented knowledge, outdated updates, and high labor costs in current distribution network defect management, but also provides a solid knowledge foundation for advanced applications such as fault early warning, intelligent diagnosis, and maintenance decision-making. It has significant technical value and engineering application implications. Attached Figure Description
[0051] Figure 1 This is a flowchart outlining a method for constructing a distribution network defect knowledge base based on a large language model, as described in this invention.
[0052] Figure 2 This is a framework diagram of a method for constructing a distribution network defect knowledge base based on a large language model, as described in this invention.
[0053] Figure 3 This is a detailed flowchart of a method for constructing a distribution network defect knowledge base based on a large language model, as described in this invention. Detailed Implementation
[0054] The present invention will be further described below with reference to the accompanying drawings.
[0055] A method for constructing a distribution network defect knowledge base based on a large language model includes the following steps:
[0056] S1: Knowledge Text Input: Obtain the distribution network defect knowledge text to be stored in the knowledge base, forming the original defect text set;
[0057] S2: Text Preprocessing and Semantic Enhancement: A semantic enhancement mechanism based on a power industry terminology dictionary and synonym mapping table is introduced. The Enhance function performs three core processes on a single defect text: terminology standardization, context completion, and semantic clarification.
[0058] S3: Defect Element Extraction: Clarify that the dimensions for extracting defect text are not limited to one or more of the following: the device where the defect is located, the defect attribute, the attribute value, the defect level, and the defect cause. These dimensions serve as a unified standard for element extraction. For the same defect description text, generate multiple candidate group outputs and use a multi-round verification mechanism to filter reliable extraction results.
[0059] S4: Domain Adaptation Fine-tuning and Uncertainty Calibration: The LoRA low-rank adaptive method is used to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples; the entropy value of each output field of the large language model is calculated, and low-confidence groups with entropy values exceeding the threshold are included in the manual review queue.
[0060] S5: Knowledge Fusion and Conflict Resolution: Based on entity linking and attribute alignment strategies, the initially extracted groups are clustered and fused. For conflict values of the same attribute within the same cluster, they are processed according to timestamp and source system permission priority rules. If it cannot be determined, a conflict marker is generated and pushed to the expert system.
[0061] S6: Dynamic update of knowledge base: Repeat the above steps for newly added / modified defect knowledge texts every day to achieve incremental updates of the knowledge base, while retaining historical version snapshots and change logs to complete version control.
[0062] Furthermore, in another embodiment of the present invention, the domain adaptation fine-tuning and uncertainty calibration specifically include: selecting a small number of high-quality labeled samples for typical defects in power distribution networks and new equipment defect scenarios. , The LoRA low-rank adaptation method is used to fine-tune the attention weights of a large language model while maintaining the model's pre-training parameters. No change, only train the newly added low-rank increment matrix The core formula is ,in Achieved through low-rank decomposition , , Significantly reduce the amount of fine-tuning parameters to Domain adaptation is achieved without changing the model architecture; the entropy value is calculated for each output field using the following formula: If the entropy value of any field exceeds the preset threshold If the corresponding triple is not found, it will be marked as low confidence and sent to the manual review queue to further avoid the risk of misjudgment.
[0063] Furthermore, in another embodiment of the present invention, the aforementioned defect text preprocessing and semantic enhancement are used to specifically address the problem of non-standard distribution networks and missing context. Let the original defect text set be... Each These are all unstructured texts from inspection reports, work order systems, or fault records. Because real-world text often contains ambiguities, abbreviations, and missing context, directly inputting it into a large language model can easily lead to information loss. Therefore, this invention introduces a semantic enhancement method.
[0064]
[0065] in, A terminology dictionary and synonym mapping table for the power industry, such as "pole-mounted switch" and "pole-mounted circuit breaker" are considered equivalent. The function performs three parts: terminology standardization, context completion, and semantic clarification. Terminology standardization replaces colloquial or abbreviated terms with standard names; context completion supplements default values based on device encoding or history when key context is missing; and semantic clarification transforms vague expressions into quantitative descriptions. The enhanced text... It is more suitable for subsequent processing of large language models.
[0066] Furthermore, in another embodiment of the present invention, the defect element extraction based on prompting engineering is used to cover typical defects in the distribution network. Based on a large language model, a hierarchical prompt word template is used to guide the large model to progressively identify defect knowledge triples. Let the defect knowledge pattern be defined as a quintuple:
[0067]
[0068] in, The device where the defect is located. It is a defect attribute. It is an attribute value. It is the defect level. These are possible causes. For a complete example: ("10kV overhead line #23 pole", "Insulator damaged", "Crack length 5cm", "Severe", "Lightning strike or aging"). The prompt template is as follows: "You are a senior distribution network operation and maintenance expert. Please output the defect knowledge quintuple strictly according to the JSON format based on the following defect description. Only output JSON, without any explanation. Defect description: {d_i^{\text{enh}}} Output format: {"entity": "...", "attribute": "...", "value": "...", "severity": "...", "cause": "..."}."
[0069] This suggestion enhances the model's professionalism through role settings and imposes JSON format constraints on the output structure to avoid parsing difficulties caused by free text. To enhance the robustness of extraction, this invention further introduces a multi-round verification mechanism: generating multiple candidate outputs for the same text. The most reliable result is selected through consensus voting.
[0070]
[0071] in This is an indicator function. If there are no consensus entries, the manual review interface is triggered.
[0072] Furthermore, in another embodiment of the present invention, the aforementioned domain adaptation fine-tuning and uncertainty calibration are used to address the problem of misjudgment risk still existing in models under professional power scenarios. Through a lightweight domain adaptation fine-tuning strategy, typical defects in distribution networks and defects in new equipment are covered, and a small number of high-quality labeled samples are selected. We use the LoRA (Low-Rank Adaptation) method to fine-tune some attention weights of a large language model, keeping the original parameters unchanged, and only training the low-rank increment matrix.
[0073] LoRA (Local Area Refinement) is an advanced model fine-tuning technique that allows for low-order adaptive adjustments to specific layers of a model without altering its overall architecture. The core formula for LoRA fine-tuning is as follows:
[0074]
[0075]
[0076] in Given the pre-trained parameter matrix, we will not directly fine-tune it to reduce the computational cost of fine-tuning. Instead, it fine-tunes the amount of the newly added parameter matrix. And for the increment matrix We assume a low-rank decomposition. Here, matrices A and B are the parameters that need to be learned in LoRA fine-tuning. Therefore, the number of parameters that need to be learned in LoRA fine-tuning is... .
[0077] Furthermore, to evaluate the reliability of the model output, this invention introduces an uncertainty calibration mechanism. The entropy of each output field is calculated.
[0078]
[0079] in, This is the set of candidate values for the field, such as {Severity} for candidate values of {mild, moderate, severe, critical}. If the entropy value of any field exceeds the threshold... If the triple is not found, it will be marked as "low confidence" and added to the manual review queue.
[0080] Furthermore, in another embodiment of the present invention, the knowledge fusion and conflict resolution are used to address the problems of redundant defect information and frequent conflicts. Since the same defect may be recorded multiple times, such as reports from different teams or different texts describing different defects of the same device, knowledge fusion is necessary. The present invention employs a fusion strategy based on entity linking and attribute alignment, assuming that all initially extracted triple sets are... This invention employs a fusion strategy based on entity linking and attribute alignment. First, the Entity field is standardized and normalized using a database... Perform exact or fuzzy matching. After a successful match, cluster all triples pointing to the same device:
[0081]
[0082] If there are conflicting values for the same attribute within the same cluster, such as one record saying "insulator damaged" and another saying "insulator intact," the following rules apply: If the timestamp of the source text is more recent, it should be used first; if the timestamps are close, the permissions of the source systems are compared; if the conflict still cannot be determined, a conflict flag is generated and pushed to the expert system.
[0083] Furthermore, in another embodiment of the present invention, the dynamic knowledge base is dynamically updated to update the database daily in real time. The constructed knowledge base is not static and needs to support incremental updates to adapt to dynamic changes. When new defective texts flow in, the above process is repeated, processing only newly added or modified triples and recording version differences. Let the knowledge base on day t be... The update operation is as follows:
[0084]
[0085] in This represents the knowledge items added / modified on that day. Meanwhile, to support traceability analysis, the system retains historical version snapshots and establishes a change log to record the creator, time, source, and confidence level of each piece of knowledge.
[0086] Figure 1 This is a flowchart outlining a method for constructing a power distribution network defect knowledge base based on a large language model, as described in this invention. For the power distribution network defect knowledge text input to this method, text preprocessing and semantic enhancement are first performed. Then, defect elements are extracted based on prompt word engineering. Next, a domain-fine-tuned large language model is used for uncertainty calibration. Then, knowledge fusion and conflict resolution are performed, and finally, the knowledge base is dynamically updated.
[0087] Figure 2 This is a framework diagram of a method for constructing a distribution network defect knowledge base based on a large language model, as described in this invention. It details the following aspects of this invention: defect text preprocessing and semantic enhancement, defect element extraction based on prompting engineering, domain adaptation fine-tuning and uncertainty calibration, knowledge fusion and conflict resolution, and dynamic updating and version control of the knowledge base. These elements are combined to form the method of this invention.
[0088] Figure 3This is a detailed flowchart of a method for constructing a distribution network defect knowledge base based on a large language model, as described in this invention. The method first processes multi-source raw defect text data, including inspection reports, work order records, user maintenance requests, SCADA alarm logs, and other unstructured text. First, semantic enhancement preprocessing is used to standardize terminology, complete the context, and quantify fuzzy expressions in this data, generating standardized defect text to prepare for subsequent steps. Next, this preprocessed text is input into a large language model (LLM) processing engine. This engine first uses domain-adaptive fine-tuning techniques to fine-tune a general large language model with a small number of annotated samples, then uses a cue-driven engineering approach to guide the model to output standardized quintuples: device, attribute, value, level, and cause. Subsequently, it enters an uncertainty calibration and confidence filtering stage, calculating the confidence score for each field and determining whether the result directly proceeds to the next stage or requires manual review based on the confidence score. For high-confidence results, they are passed to knowledge fusion and conflict resolution, where equipment entity normalization, clustering of multiple defect records, and conflict judgment and resolution based on timestamps and data source permissions are performed, ultimately generating consistent and redundant fused knowledge entries. These fused knowledge items are stored in a graph database, forming a dynamically updated structured distribution network defect knowledge base for downstream applications such as intelligent diagnosis, risk warning, and maintenance decision-making. Furthermore, to continuously improve the system's accuracy and reliability, a feedback and iteration mechanism is designed so that manually reviewed results can be used for model retraining, and newly added knowledge can trigger optimization of model prompt templates. This process not only achieves end-to-end automated construction from raw text to a usable knowledge base but also ensures the reliability of human-machine collaboration throughout the process.
[0089] Example 2
[0090] A device for constructing a distribution network defect knowledge base based on a large language model, comprising:
[0091] The text acquisition module is used to acquire the distribution network defect knowledge text to be stored in the knowledge base, forming an original defect text set.
[0092] The semantic enhancement processing module has a built-in power industry terminology dictionary and synonym mapping table, and is equipped with an Enhance function. The Enhance function performs three core processes on a single defect text output by the text acquisition module: terminology standardization, context completion, and semantic clarification, thereby realizing text preprocessing and semantic enhancement.
[0093] The defect element extraction module presets defect text extraction dimensions. The extraction dimensions include at least one or more of the following: the device (Entity) where the defect is located, the defect attribute (Attribute), the attribute value (Value), the defect severity (Severity), and the defect cause (Cause), which serve as a unified standard for element extraction. The defect element extraction module generates multiple candidate group outputs for the same defect description text and filters reliable extraction results through a built-in multi-round verification mechanism.
[0094] The adaptation fine-tuning and calibration module includes a domain adaptation unit and an uncertainty calibration unit. The domain adaptation unit adopts the LoRA low-rank adaptive method to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples. The uncertainty calibration unit is used to calculate the entropy value of each output field of the large language model and include low-confidence groups with entropy values exceeding a preset threshold into a manual review queue.
[0095] The knowledge fusion module, based on entity linking and attribute alignment strategies, clusters and merges the preliminary extraction groups output by the defect element extraction module. For conflicting values of the same attribute within the same cluster, the knowledge fusion module resolves the conflict according to timestamp priority rules and source system permission priority rules. If the conflict result cannot be determined, a conflict marker is generated and pushed to an external expert system.
[0096] The dynamic update module is used to capture the newly added / modified defect knowledge texts every day, and drive the text acquisition module, semantic enhancement processing module, defect element extraction module, adaptation fine-tuning and calibration module, and knowledge fusion module to perform corresponding processing in sequence to achieve incremental updates of the knowledge base; the dynamic update module is also used to retain historical version snapshots and change logs of the knowledge base to complete version control.
[0097] In the Enhance function of the semantic enhancement processing module, the terminology standardization processing specifically involves replacing non-standard terms in the defect text with domain-standard terms based on the built-in power domain terminology dictionary; the context completion processing specifically involves supplementing the missing key context information in the text by combining common sense about distribution network defect scenarios with a synonym mapping table; and the semantic clarification processing specifically involves resolving ambiguous expressions in the text and clarifying the core semantics of the defect description.
[0098] Application examples
[0099] Taking a 10kV distribution network of a local power supply company as the application scenario, the data sources include graphic reports uploaded by the intelligent inspection APP, work orders from the PMS2.0 system, user repair records from 95598, and SCADA alarm logs, totaling approximately 120,000 original texts.
[0100] First, a terminology dictionary and equipment ledger mapping table for the power industry were constructed. First, standard terms were extracted from State Grid's "Distribution Network Equipment Naming Specifications" and "Defect Classification Standards," and an initial dictionary was built. For example: "Pole-type switch" → standard name: "Pole-type vacuum circuit breaker"; "Porcelain insulator" → standard name: "Pink-type insulator"; "Clamp overheating" → attribute name: "Connection accessory temperature abnormality." Simultaneously, the database was connected to the PMS2.0 equipment ledger database to obtain the unique code, geographical location, model parameters, and other information for all 10kV equipment, and a mapping from equipment name to unique ID was established. For example, "10kV Urban East Line #15 pole" corresponds to equipment ID: DEV-10kV-CD-015.
[0101] Then, the original defect text was preprocessed and semantically enhanced. For each original text, the following operations were performed: Regular expressions were used to identify equipment name keywords, such as "#XX pole," "box-type transformer," and "ring mains cabinet," which were matched against the database, and missing voltage levels or line names were filled in; non-standard terms were replaced using an initial dictionary; and ambiguous descriptions were quantified and transformed. For example, if the text was "cracked insulator," combined with image recognition results or historical statistics of similar defects, the phrase "longitudinal cracks exist in the insulator's porcelain skirt, with a length of approximately 3-5 cm" was added. After this processing, 98.7% of the 120,000 texts were successfully enhanced, while the remaining 1.3% were marked as "awaiting manual supplementation" due to severe information loss.
[0102] Next, a large language model was deployed and fine-tuned using LoRA, with an open-source large language model chosen as the base model. 500 high-quality labeled samples were collected, jointly labeled by three senior technicians, covering common defect types such as insulation damage, hardware corrosion, tree obstructions, and poor grounding. The LoRA method was used, inserting low-rank adapters with a rank r=16 into the model's Q, K, and V projection layers. Fine-tuning was performed using the AdamW optimizer with a learning rate of 2e-4, trained for 10 epochs, achieving an F1-score of 92.4% on the validation set, significantly outperforming the un-fine-tuned model (85.1%).
[0103] Next, as mentioned earlier, a hierarchical prompt template is constructed. To improve efficiency, batch processing is used, inputting 32 augmented texts (configuration: A100×4) to the GPU server each time. The model output must be in JSON format, and the backend parser automatically extracts the quintuples. Three sample outputs are generated for each text, and consensus voting is performed. Experiments show that this strategy improves the accuracy of key fields such as Entity and Severity by 4.2 percentage points.
[0104] Next, the entropy of the predicted distribution for each output field is calculated. A threshold τ = 1.2 is set. If the entropy value of any field exceeds τ, the entire record is sent to a manual review pool. Of the 120,000 entries, approximately 6.8% were marked as low confidence, primarily concentrated in the "Cause" field.
[0105] Secondly, all extracted results are normalized and clustered by entity. For example, device ID DEV-10KV-CD-015 received 5 records:
[0106] Record 1 (Inspection APP, November 1, 2025): "Insulator damaged"
[0107] Log 2 (Work Order System, November 5, 2025): "Insulator intact"
[0108] Record 3 (SCADA, November 6, 2025): "A-phase voltage abnormality"
[0109] The system first identifies the conflict between records 1 and 2. Since record 2 is the most recent and comes from an official work order, the term "intact insulator" is used. However, based on the voltage anomaly recorded in record 3, the system adds "potentially hidden insulation degradation" to the "Cause" field and marks it as "awaiting infrared retest".
[0110] Finally, approximately 89,000 structured knowledge entries were generated and imported into the Neo4j graph database. Node types include "device," "defect attribute," "fault level," and "trigger." Edge types include "has_defect," "caused_by," and "severity_level." This knowledge base connects to the company's intelligent operation monitoring platform via an API interface.
[0111] During the three-month trial operation, the intelligent diagnostics supported by the knowledge base improved the defect identification accuracy from 76% to 91% and reduced the average fault location time by 38%. Maintenance personnel reported that the structured information provided by the knowledge base significantly reduced the time spent manually reviewing documents, and the conflict resolution mechanism effectively avoided misjudgments.
[0112] In summary, this invention provides a practical, technologically advanced, and easily implementable method for constructing a distribution network defect knowledge base, which combines technological innovation with engineering practicality and has broad prospects for promotion and application.
[0113] In summary, this invention provides an efficient, robust, and environmentally adaptive method for screening the clarity of distribution network inspection images. Through multi-feature fusion and dynamic weighting mechanisms, it effectively solves the misjudgment problem of traditional methods in complex inspection scenarios, laying a high-quality data foundation for high-precision defect identification and possessing significant engineering application value.
[0114] The above description, in conjunction with specific / preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art can make various substitutions or modifications to these described embodiments without departing from the inventive concept, and all such substitutions or modifications should be considered within the scope of protection of the present invention.
[0115] The parts of this invention not described in detail are well-known to those skilled in the art.
Claims
1. A method for constructing a distribution network defect knowledge base based on a large language model, characterized in that, Includes the following steps: S1: Knowledge Text Input: Obtain the distribution network defect knowledge text to be stored in the knowledge base, forming the original defect text set; S2: Text Preprocessing and Semantic Enhancement: A semantic enhancement mechanism based on a power industry terminology dictionary and synonym mapping table is introduced. The Enhance function performs three core processes on a single defect text: terminology standardization, context completion, and semantic clarification. S3: Defect Element Extraction: Clarify that the dimensions for extracting defect text are not limited to one or more of the following: the device where the defect is located, the defect attribute, the attribute value, the defect level, and the defect cause. These dimensions serve as a unified standard for element extraction. For the same defect description text, generate multiple candidate group outputs and use a multi-round verification mechanism to filter reliable extraction results. S4: Domain Adaptation Fine-tuning and Uncertainty Calibration: The LoRA low-rank adaptive method is used to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples; the entropy value of each output field of the large language model is calculated, and low-confidence groups with entropy values exceeding the threshold are included in the manual review queue. S5: Knowledge Fusion and Conflict Resolution: Based on entity linking and attribute alignment strategies, the initially extracted groups are clustered and fused. For conflict values of the same attribute within the same cluster, they are processed according to timestamp and source system permission priority rules. If it cannot be determined, a conflict marker is generated and pushed to the expert system. S6: Dynamic update of knowledge base: Repeat the above steps for newly added / modified defect knowledge texts every day to achieve incremental updates of the knowledge base, while retaining historical version snapshots and change logs to complete version control.
2. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The aforementioned S4 domain adaptation fine-tuning and uncertainty calibration specifically includes: selecting a small number of high-quality labeled samples for typical defects in distribution networks and new equipment defect scenarios. , The LoRA low-rank adaptation method is used to fine-tune the attention weights of a large language model while maintaining the model's pre-training parameters. No change, only train the newly added low-rank increment matrix The core formula is ,in Achieved through low-rank decomposition , , Significantly reduce the amount of fine-tuning parameters to Domain adaptation is achieved without changing the model architecture; the entropy value is calculated for each output field using the following formula: If the entropy value of any field exceeds the preset threshold If the corresponding triple is not found, it will be marked as low confidence and sent to the manual review queue to further avoid the risk of misjudgment.
3. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The aforementioned text preprocessing and semantic enhancement specifically include: assuming the original set of defective texts is... Each These are all unstructured texts from inspection reports, work order systems, or fault records, and a semantic enhancement formula is introduced: in, A terminology dictionary and thesaurus for the power industry The function performs three parts: terminology standardization, context completion, and semantic clarification.
4. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The aforementioned defect element extraction specifically includes: based on a large language model, using a hierarchical prompt word template to guide the large model to gradually identify defect knowledge triples, whereby the defect knowledge pattern is defined as a group. : in, The device where the defect is located. It is a defect attribute. It is an attribute value. It is the defect level. That is a possible reason; Generate multiple candidate outputs for the same text The most reliable result is selected through consensus voting. in This is an indicator function that triggers the manual review interface if there are no majority of consistent entries.
5. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The aforementioned domain adaptation fine-tuning specifically includes: using a lightweight domain adaptation fine-tuning strategy to cover typical defects in the power distribution network and defects in new equipment, and selecting a small number of high-quality labeled samples. We use the LoRA method to fine-tune some attention weights of a large language model, keeping the original parameters unchanged, and only train the low-rank increment matrix. The core formula for LoRA fine-tuning is as follows: in To reduce the computational cost of fine-tuning, the number of newly added parameter matrices is reduced from the pre-trained parameter matrix. And for the increment matrix Assuming low-rank decomposition, where matrices A and B are the parameters to be learned in LoRA fine-tuning, the number of parameters to be learned in LoRA fine-tuning is... .
6. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 5, characterized in that, The aforementioned uncertainty calibration includes: the entropy of each output field of the computational language large model. in, Given the set of candidate values for this field, if the entropy value of any field exceeds the threshold... If the triple is not found, it will be marked as "low confidence" and added to the manual review queue.
7. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The knowledge fusion and conflict resolution specifically include employing a fusion strategy based on entity links and attribute alignment, assuming that all initially extracted group sets are... A fusion strategy based on entity linking and attribute alignment is adopted to standardize and normalize Entity fields, utilizing database... Perform exact or fuzzy matching. If a match is successful, cluster all triples pointing to the same device: For the same attribute within the same cluster, if values conflict, the following rule applies: if the timestamp of the source text is more recent, it should be used first; If the times are close, compare the permissions of the source systems; If the conflict still cannot be determined, a conflict flag is generated and pushed to the expert system.
8. The method for constructing a distribution network defect knowledge base based on a large language model according to claim 1, characterized in that, The dynamic knowledge base is dynamically updated, specifically including: when new defective texts flow in, only newly added or modified triples are processed, and version differences are recorded. Let the knowledge base on day t be... The update operation is as follows: in This represents the knowledge items added / modified on that day.
9. A device for constructing a distribution network defect knowledge base based on a large language model, characterized in that, include: The text acquisition module is used to acquire the distribution network defect knowledge text to be stored in the knowledge base, forming an original defect text set. The semantic enhancement processing module has a built-in power industry terminology dictionary and synonym mapping table, and is equipped with an Enhance function. The Enhance function performs three core processes on the single defect text obtained from the text, namely terminology standardization, context completion, and semantic clarification, to achieve text preprocessing and semantic enhancement. The defect element extraction module presets defect text extraction dimensions. The extraction dimensions include at least one or more of the following: the device where the defect is located, the defect attribute, the attribute value, the defect level, and the defect cause, which serve as a unified standard for element extraction. The defect element extraction generates multiple candidate group outputs for the same defect description text and filters reliable extraction results through a built-in multi-round verification mechanism. The adaptation fine-tuning and calibration module includes a domain adaptation unit and an uncertainty calibration unit. The domain adaptation unit adopts the LoRA low-rank adaptive method to perform lightweight domain adaptation on a large language model based on a small number of high-quality labeled samples. The uncertainty calibration unit is used to calculate the entropy value of each output field of the large language model and include low-confidence groups with entropy values exceeding a preset threshold into a manual review queue. The knowledge fusion module, based on entity linking and attribute alignment strategies, clusters and fuses the initial extraction groups of the defective elements. For conflicting values of the same attribute within the same cluster, the knowledge fusion resolves the conflict according to timestamp priority rules and source system permission priority rules. If the conflict result cannot be determined, a conflict marker is generated and pushed to an external expert system. The dynamic update module is used to capture the newly added / modified defect knowledge texts every day, and drive the text acquisition, semantic enhancement processing, defect element extraction, adaptation fine-tuning and calibration, and knowledge fusion to perform corresponding processes in sequence to achieve incremental updates of the knowledge base; the dynamic update is also used to retain historical version snapshots and change logs of the knowledge base to complete version control.
10. The apparatus according to claim 9, characterized in that, In the Enhance function of the semantic enhancement processing module, the terminology standardization processing specifically involves replacing non-standard terms in the defect text with domain-standard terms based on the built-in power domain terminology dictionary; the context completion processing specifically involves supplementing the missing key context information in the text by combining common sense about distribution network defect scenarios with a synonym mapping table; and the semantic clarification processing specifically involves resolving ambiguous expressions in the text and clarifying the core semantics of the defect description.