Power grid equipment fault diagnosis method and system based on knowledge graph enhanced LLM illusion suppression model

By combining knowledge graphs and large language models, a power grid fault diagnosis method has been developed, which solves the problems of low efficiency and hallucination in traditional power grid diagnosis, and achieves efficient and accurate power grid fault diagnosis, reducing false alarm rate and response time.

CN121786368APending Publication Date: 2026-04-03STATE GRID FUJIAN ELECTRIC POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511892242.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional power grid fault diagnosis methods are inefficient, have a high false alarm rate, are difficult to handle multi-source data, and the application of large language models in the power field is prone to hallucinations, lacking customized hallucination suppression mechanisms.

Method used

By combining knowledge graphs and large language models, a preliminary diagnostic report is generated through multi-source data preprocessing, entity recognition and relation extraction, multi-hop knowledge retrieval and customized prompt words. Hallucinations are suppressed through semantic consistency verification and physical feature cross-validation, and finally accurate diagnostic results are output.

Benefits of technology

It has improved the accuracy and efficiency of power grid fault diagnosis, reduced fault response time from hours to minutes, reduced the risk of large-scale power outages, and improved the stable operation of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786368A_ABST
    Figure CN121786368A_ABST
Patent Text Reader

Abstract

The invention relates to a power grid equipment fault diagnosis method and system based on a knowledge graph enhanced LLM illusion suppression model, and belongs to the technical field of intelligent power grid operation and maintenance and artificial intelligence application. According to the method, a domain knowledge graph is constructed by integrating multi-source power grid data, and the output of a large language model LLM is optimized by adopting a knowledge-enhanced retrieval-inference-verification framework; the system comprises a knowledge graph construction module, a multi-source data acquisition preprocessing module, a knowledge enhancement diagnosis module, an illusion suppression verification module and a dynamic updating module, and can realize accurate positioning, reason analysis and solution generation of faults. The method provides an intelligent solution for power grid equipment fault diagnosis, and is suitable for fault processing scenes of various types of equipment such as transformers, insulators, cables and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart grid operation and maintenance and artificial intelligence application technology, and in particular relates to a method and system for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model. Background Technology

[0002] With the continuous expansion and increasing complexity of the power grid, equipment fault diagnosis faces unprecedented challenges from massive amounts of heterogeneous data. Traditional fault diagnosis methods, such as expert systems and artificial neural networks, while effective in certain scenarios, heavily rely on human experience and prior knowledge, making it difficult to efficiently process data from multiple sources, such as real-time equipment operating status, system alarm information, and image data collected during inspections. This limitation not only leads to low efficiency in the diagnostic process but also results in a high false alarm rate, severely impacting the stable operation and maintenance efficiency of the power grid.

[0003] In recent years, large language models have made significant progress in the field of natural language processing, demonstrating powerful text understanding and generation capabilities. However, directly applying these large language models to the field of power grid fault diagnosis, where reliability requirements are extremely high, still presents many risks and challenges. Among them, the most prominent problem is that the models are prone to "illusions," that is, generating false fault causes or non-existent problems, misleading diagnostic results. In addition, large language models have relatively insufficient professional knowledge in the power sector, making it difficult to accurately understand and handle complex problems in this specific domain.

[0004] Meanwhile, knowledge graph technology stores and manages professional knowledge in the power sector in a structured way, such as equipment models, fault modes, and historical maintenance cases, possessing strong interpretability and reasoning capabilities. However, knowledge graphs have significant shortcomings in natural language interaction, making it difficult to engage in fluent dialogue and information exchange with users. Existing fusion methods, such as retrieval-enhanced generation techniques, can alleviate the illusion problem of large language models to some extent, but they lack customized illusion suppression mechanisms for power grid fault diagnosis scenarios, making it difficult to fundamentally solve the problem. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model. This solution can effectively combine the reliability of knowledge graphs and the powerful generation capabilities of large language models, while also possessing active illusion suppression functionality, so as to comprehensively improve the accuracy and efficiency of power grid fault diagnosis and ensure the safe and stable operation of the power grid system.

[0006] To achieve the above objectives, the technical solution of the present invention is: a method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model, comprising the following steps:

[0007] Step S1, Multi-source data acquisition, preprocessing, and knowledge graph initialization: Data is acquired in real time through a sensor network deployed at key nodes of the power grid; the acquired data is sequentially processed by denoising, filtering, and normalization to eliminate data heterogeneity and generate a structured dataset; based on the power domain entity dictionary (E~dict~) and relation dictionary (R~dict~), entities and relations are extracted from the structured dataset to form a "entity-relation-entity" triple sample set;

[0008] Step S2, Knowledge-enhanced Retrieval Generation: The linking agent uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology; the retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set;

[0009] Step S3, Diagnosis Generation and Hallucination Suppression: Input the structured dataset and knowledge support set into the diagnosis generation agent. Guide the large language model LLM to generate a preliminary diagnosis report through customized prompt words. Calculate the semantic similarity between the report and the knowledge support set. If it is lower than the threshold, trigger a secondary retrieval. Combine real-time physical feature data for verification and correction, and finally output an accurate diagnosis result.

[0010] Step S4, Knowledge Graph Dynamic Update: Automatically collect user satisfaction feedback and review new diagnostic cases in conjunction with experts; for valid cases that pass the review, automatically extract entities and relationships and update them to the knowledge graph, while adjusting the weights of relevant reasoning paths; analyze the causes of hallucinations in erroneous cases and optimize search strategies and prompt word engineering.

[0011] Furthermore, in step S1, the knowledge graph is initialized, as follows:

[0012] Data preprocessing and feature engineering: First, the integrated unified structured state dataset is preprocessed, including data cleaning, missing value imputation, and format standardization; then feature engineering is performed to convert the characters in the text into numerical features that the model can process.

[0013] Entity recognition: Matching is performed using a predefined entity dictionary (E~dict~) in the power industry. The entity dictionary (E~dict~) includes entity types related to power grid equipment. A string matching algorithm is used to identify entities belonging to the entity types related to power grid equipment from the preprocessed data.

[0014] Relationship identification: Matching is performed using a predefined power domain relation dictionary (R~dict~), which defines the semantic relationships that may exist between devices. The relationships between entities are determined and extracted by analyzing the context and syntactic structure between entities or by using a pre-trained model for semantic understanding.

[0015] Triple assembly and verification: The identified entities and relations are combined to form a preliminary "entity-relationship-entity" triple. Then, the boundaries and logical consistency of the triple are verified through boundary alignment technology and cross-validation mechanism to ensure the integrity and rationality of the triple structure.

[0016] Further, step S2 includes:

[0017] S21. Entity Recognition and Knowledge Graph Association

[0018] (1) Key entity recognition based on BERT

[0019] (1.1) Input data formatting: The preprocessed multi-source data is converted into a natural language sequence S = ,in For data fields or values;

[0020] (1.2) BERT model fine-tuning and adaptation: The BERT model was fine-tuned using the power grid domain labeled corpus. The labeling system adopted the BIO format (B - entity start, I - entity interior, O - non-entity).

[0021] (1.3) Entity Boundary and Type Prediction: Input the sequence S into the fine-tuned BERT, predict the label of each word through the output layer, and extract continuous BI sequences as candidate entities. and indicate the entity type;

[0022] (1.4) Entity cleaning and deduplication: Based on rules, redundant entities are filtered and duplicate entities are merged to obtain the final key entity set. ;

[0023] (2) Entity link and knowledge graph node matching

[0024] (2.1) Knowledge graph entity index construction: Extract all entity nodes in the knowledge graph Build an inverted index that includes entity name, alias, and attributes;

[0025] (2.2) Entity similarity calculation: For key entity e_i* and graph entity n_j, the matching score is calculated from two dimensions: name similarity and attribute similarity;

[0026] (2.3) Optimal node association: The graph entity with the highest similarity score is taken as the matching result. If the score is greater than or equal to the preset threshold, an association mapping of e_i* → n_j is established; if it is less than the threshold, it is marked as "new entity candidate" and awaits further review.

[0027] (2.4) Output of association results: Generate entity-node association table M = [(e1*, n1), (e2*, n3),...], which serves as the starting point for input of the retrieval agent.

[0028] Furthermore, step S2 also includes:

[0029] S22. Multi-hop knowledge retrieval and support set construction

[0030] The retrieval agent starts with associated nodes and uses a Graph Convolutional Network (GCN) to mine multi-hop associations in the knowledge graph, distinguishing between positive and negative knowledge, and finally forming a structured support set, as follows:

[0031] (1) Knowledge graph encoding and subgraph extraction

[0032] (1.1) Graph structured representation: The power grid knowledge graph is represented as a multi-relation graph G = (V, R, E), where V is the set of entity nodes, R is the set of relations, and E = {(v_h, r, v_t)} is the set of triples;

[0033] (1.2) Subgraph extraction of associated nodes: Taking the graph nodes in the entity linking result M as the center, extract a subgraph G_sub = (V_sub, R_sub, E_sub) with a radius of H multi-hop steps;

[0034] (1.3) GCN initialization embedding: Initialize the embedding vector h_v for each node v ∈ V_sub in the subgraph. 0 , using pre-trained entity embeddings or randomly initialized vectors;

[0035] (2) Multi-hop feature propagation based on R-GCN

[0036] (2.1) Relationship-aware node update: The node embedding is updated iteratively using the relation graph convolutional network R-GCN. Each hop captures multi-hop semantic associations by aggregating the features and relation information of neighboring nodes.

[0037] (2.2) Multi-hop iteration termination: After H iterations, the final node embedding h_v is obtained. H At this point, the embedding vector has incorporated all the related knowledge within the H-hop;

[0038] (3) Positive / negative knowledge screening and support set generation

[0039] (3.1) Association strength calculation: For the target node v_target, calculate its cosine similarity with other nodes v in the subgraph, and use it as the association strength sim(v_target, v);

[0040] (3.2) Positive knowledge extraction: Select triples with association strength ≥ positive threshold θ_pos, and the relation type is positive relation including "cause", "accompany", and "correspond", to form a positive knowledge set K_pos = {(v_h, r_pos, v_t)};

[0041] (3.3) Negative knowledge extraction: Filter triples with association strength ≤ negative threshold θ_neg, or negative relations with relation type including "exclude" and "irrelevant", to form a negative knowledge set K_neg = {(v_h, r_neg, v_t)};

[0042] (3.4) Structured support set output: Merge K_pos and K_neg, arrange them in descending order of "association strength", and generate a structured knowledge support set K_support = K_pos ∪ K_neg.

[0043] Further, step S3 includes:

[0044] S31. Preliminary Diagnosis Report Generation

[0045] (1) The structured integration of input data transforms K_support = K_pos ∪ K_neg obtained from knowledge graph retrieval into natural language reasoning basis, merges the structured dataset D_std formed in step 1 with K_pos_desc and K_neg_desc, and generates a unified input text Input_LLM that can be parsed by LLM;

[0046] (2) Customized prompt word engineering design: The three-layer prompt word architecture of "role-constraint-task" is adopted to force LLM to reason according to the power grid fault diagnosis logic and avoid the generation of illusions;

[0047] (3) LLM drives the generation of preliminary diagnostic reports: Input the final prompt word Prompt_Final into the LLM for the power grid field to generate a structured preliminary report Report_init.

[0048] Furthermore, step S3 also includes:

[0049] S32, Hallucination Suppression Module - Dual Validation and Modified Hallucination Suppression Module

[0050] Through a closed-loop process of "semantic consistency verification - secondary retrieval - physical feature cross-validation - final correction", the system identifies and eliminates the illusory conclusions generated by LLM. The core of this approach is a double guarantee of "semantic matching + physical mechanism verification", as detailed below:

[0051] (1) Semantic consistency verification

[0052] (1.1) A Sentence-BERT model fine-tuned for the power grid domain is adopted to transform Report_init and K_support into semantic embedding vectors of a unified dimension:

[0053] For Report_init: Extract the core conclusion sentence and generate an embedding vector. ∈ R^768, where 768 is the embedding dimension;

[0054] For K_support: Concatenate K_pos_desc and K_neg_desc to form the complete text Text_K, generating an embedding vector. ∈ R^768;

[0055] (1.2) Quantification by cosine similarity and The semantic consistency is expressed by the following formula:

[0056]

[0057] in: The dot product of two vectors. The L2 norm is used to ensure that the similarity results fall within the [0,1] interval;

[0058] (1.3) Threshold determination rules

[0059] The preset semantic similarity threshold for the power grid scenario optimization is θ_sim = 0.7.

[0060] If sim ≥ θ_sim: determine that there is no significant hallucination, and proceed to physical feature cross-validation;

[0061] If sim < θ_sim: a risk of hallucination is detected, triggering a secondary search;

[0062] (2) Secondary retrieval - hallucination correction and supplementary knowledge

[0063] (2.1) Illusion keyword localization: The TF-IDF keyword extraction algorithm is used to extract words with large semantic deviation from K_support from Report_init, which are used as secondary search keywords Keywords_error;

[0064] (2.2) R-GCN Multi-hop Retrieval Model: Taking Keywords_error and the original associated nodes as the joint starting point, the number of multi-hop steps is expanded, and the knowledge graph is re-retrieved through the relational graph convolutional network R-GCN. The formula is as follows:

[0065]

[0066] in: Let v be the embedding vector of node v in the l-th layer; The set of neighbors of node v under relation r; Let r be the feature transformation matrix. σ is the initial feature transformation matrix; σ(·) is the ReLU activation function;

[0067] After updating the node embedding using the above formula, positive knowledge K_pos_supp with a correlation strength ≥ θ_pos_supp = 0.55 is selected to generate the updated knowledge support set K_support_new = K_support ∪ K_pos_supp;

[0068] (2.3) Preliminary report revision: Re-inject K_support_new into the diagnostic agent, repeat the process of stages (2.1)-(2.3), and generate the revised preliminary report Report_rev;

[0069] (3) Cross-validation of physical features

[0070] (3.1) Extraction of physical feature parameters: Select physical mechanism parameters directly related to the fault conclusion from D_std to form a physical feature set F_phys;

[0071] (3.2) Based on the physical mechanism of power grid equipment, a "fault conclusion - physical parameter" mapping rule base Rule_phys is constructed. The matching degree is calculated using a weighted Euclidean distance normalization model, as shown in the following formula:

[0072]

[0073] in: These are the standard values ​​of the physical parameters corresponding to the fault conclusion; These are the measured values ​​in F_phys; For parameter weights; , This represents the boundary of the normal range for the parameters; ∈ [0,1], the closer to 1, the stronger the physical consistency;

[0074] (3.3) Physical consistency determination: The preset physical matching degree threshold θ_match = 0.8

[0075] If match_score ≥ θ_match: the physical mechanism is considered consistent, and the process proceeds to the final review.

[0076] If match_score < θ_match: the judgment result conflicts with the physical characteristics, return to stage (2) to re-search and correct.

[0077] Further, step S4 includes:

[0078] S41. Feedback and Case Data Collection

[0079] The system automatically collects relevant data throughout the entire diagnostic process, forming a complete case data package to provide a foundation for subsequent updates, as detailed below:

[0080] (1) User satisfaction feedback collection: Through the operation and maintenance terminal pop-up window and the APP feedback entry, collect the satisfaction evaluation of users or operation and maintenance personnel on the final diagnostic report Report_final, using a combination of quantitative scoring and text feedback:

[0081] Quantitative scoring: Score_usr ∈ [1,5], 1 = completely inaccurate, 5 = completely accurate;

[0082] Text feedback: Feedback_usr;

[0083] (2) Full archiving of diagnostic cases: Automatically associate the full data corresponding to the diagnosis and generate a case data package Case = {D_std, K_support, Report_init, Report_final, Score_usr, Feedback_usr}, where: D_std is the structured dataset, K_support is the knowledge support set, Report_init is the preliminary diagnostic report, and Report_final is the final diagnostic report;

[0084] (3) Case screening: Set the satisfaction threshold θ_usr=3 and screen out candidate cases:

[0085] Valid case candidate: Score_usr ≥ θ_usr, user approval, proceed to review process;

[0086] Error case candidate: Score_usr < θ_usr, user denies, proceed to hallucination cause analysis process;

[0087] S42, Expert Collaborative Review

[0088] The "automated pre-review + expert final review" model ensures the validity of cases and the accuracy of knowledge, eliminating the need for manual intervention in basic data processing, as detailed below:

[0089] (1) Automated pre-audit

[0090] For valid candidate cases: "user misreview" cases are eliminated by comparing the physical matching score (match_score) and semantic similarity score (sim) between Report_final and D_std.

[0091] For candidate error cases: automatically extract the conflict points between Report_final and D_std, and generate a conflict analysis report Report_conflict;

[0092] (2) Expert final review interface

[0093] Valid cases, erroneous cases, and Report_conflicts that have passed the pre-review are pushed to the expert review platform. Experts only need to click "Approve", "Reject", or add supplementary annotations. The average review time is ≤3 minutes per case.

[0094] The expert review threshold is set to θ_exp=0.8. The final determination of valid cases (Case_valid) is: expert approval rate ≥ θ_exp; and incorrect cases (Case_error) are: expert approval rate < θ_exp.

[0095] S43. Automatic extraction of new entities and relationships

[0096] For Case_valid, the newly added entities and relationships are automatically extracted using "LLM prompt word extraction + rule validation" without manual annotation, as detailed below:

[0097] (3) Extracting target definition

[0098] New entity Entities_new: includes device sub-modules not in the existing knowledge graph, new fault types, and special environmental factors;

[0099] New Relations_new: Includes causal relationships and exclusionary relationships between entities;

[0100] (4) Rule validation and filtering

[0101] Entity validation: Filter invalid entities using regular expression matching;

[0102] Relationship verification: Based on the power grid physical mechanism rule base, unreasonable relationships are filtered out, and finally a clean extraction result is obtained: Extract_clean = {Entities_new, Relations_new}.

[0103] Furthermore, step S4 also includes:

[0104] S44. Knowledge Graph Iterative Update

[0105] This includes two parts: "Adding new entity relationships" and "Adjusting the weight of inference paths," ensuring the timeliness of graph knowledge and the accuracy of inference, as detailed below:

[0106] (1) Adding entities and relations

[0107] Add the entities in Entities_new to the corresponding node set of the knowledge graph according to their type, and initialize the embedding vector for the new entities;

[0108] Add the triples in Relations_new to the edge set E of the knowledge graph, and record the initial confidence level at the same time;

[0109] (2) Adjustment of inference path weights

[0110] Define the inference path as a multi-hop link of "feature entity → relation → faulty entity":

[0111] Suppose a reasoning path P = [e1→r1→e2→r2→...→ek] in a knowledge graph, where e is an entity, r is a relation, and the initial weights are... The product of the confidence scores of all relations in the path:

[0112]

[0113] Where conf(r_i) is the confidence level of relation r_i;

[0114] For inference paths validated as accurate in Case_valid, increase their path weight; for paths corroborated by Case_valid in historical cases, adjust their weights accordingly.

[0115]

[0116] Where: t is the update round; α is the weight adjustment coefficient; The credibility score for the case is calculated by weighting user satisfaction and expert review results:

[0117]

[0118] Where: β is the weighting coefficient; Rate user satisfaction. Score based on expert review;

[0119] To avoid unbounded growth of path weights, the path weights of all paths from the same head entity to the tail entity are normalized:

[0120]

[0121] in: The set of all inference paths from entity e_h to e_t is given, with normalized weights ranging from [0,1].

[0122] Furthermore, step S4 also includes:

[0123] S45. Optimization of Search and Suggestion Strategies

[0124] Analyzing the causes of hallucinations using Case_error, we reverse-engineered the search strategy and prompt word engineering to reduce the incidence of subsequent hallucinations from the source, as detailed below:

[0125] (1) Classification of the causes of hallucination

[0126] Insufficient retrieval type: Relevant knowledge exists in the knowledge graph, but the retrieval agent fails to retrieve it;

[0127] Knowledge gap type: No relevant knowledge exists in the knowledge graph, and LLM fabricates conclusions;

[0128] Vague prompts: The prompts are not clearly defined, allowing LLMs to be more flexible and adaptable.

[0129] (2) Targeted optimization

[0130] Search strategy optimization: Dynamically adjust R-GCN search parameters for "insufficient search" errors;

[0131] Knowledge Gap Marking: For "knowledge gap type" errors, mark the corresponding knowledge gap and trigger subsequent expert knowledge input reminders;

[0132] Prompt word optimization: For "fuzzy prompt word" errors, additional constraint rules were added and the Prompt_Final template was updated.

[0133] This invention also provides a power grid equipment fault diagnosis system based on a knowledge graph-enhanced LLM illusion suppression model, comprising:

[0134] The multi-source data acquisition and preprocessing module acquires data in real time through a sensor network deployed at key nodes of the power grid; it then performs noise reduction, filtering, and normalization processing on the acquired data in sequence to eliminate data heterogeneity and generate a structured dataset.

[0135] The knowledge graph construction module, based on the entity dictionary (E~dict~) and relation dictionary (R~dict~) in the power field, extracts entities and relations from the structured dataset to form a sample set of "entity-relation-entity" triples;

[0136] The knowledge enhancement diagnostic module uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology. The retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set.

[0137] The hallucination suppression verification module takes the structured dataset and knowledge support set as input for diagnosis and generates an intelligent agent. It guides the large language model LLM to generate a preliminary diagnostic report through customized prompt words. It calculates the semantic similarity between the report and the knowledge support set. If the similarity is lower than the threshold, it triggers a secondary retrieval. It combines real-time physical feature data for verification and correction, and finally outputs an accurate diagnostic result.

[0138] The dynamic update module automatically collects user satisfaction feedback and collaborates with experts to review new diagnostic cases. For valid cases that pass the review, it automatically extracts entities and relationships and updates them to the knowledge graph, while adjusting the weights of relevant reasoning paths. For erroneous cases, it analyzes the causes of hallucinations and optimizes search strategies and prompt word engineering.

[0139] Compared with the prior art, the present invention has the following beneficial effects:

[0140] (1) It solves the technical pain points of low knowledge organization efficiency, LLM is prone to illusion, and static knowledge framework has poor adaptability in traditional power grid fault diagnosis.

[0141] (2) Deeply integrate artificial intelligence technologies such as knowledge graphs, LLM, and graph convolutional networks (GCN) with power grid operation and maintenance technologies to form a replicable "AI + power equipment diagnosis" technology paradigm.

[0142] This invention has the following socio-economic benefits:

[0143] (1) The fault response time has been reduced from hours to minutes, significantly reducing the risk of large-scale power outages caused by power grid equipment failures.

[0144] (2) Provide practical scenarios for the cultivation of "AI + professional" compound talents in the field of power operation and maintenance. Through technology output and paradigm replication, drive the power industry to transform towards intelligent and digital operation and maintenance mode and improve the level of modernization of the industry. Attached Figure Description

[0145] Figure 1 This invention provides a diagnostic framework for hallucination suppression. Detailed Implementation

[0146] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0147] This invention provides a method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model, comprising the following steps:

[0148] Step S1, Multi-source data acquisition, preprocessing, and knowledge graph initialization: Data is acquired in real time through a sensor network deployed at key nodes of the power grid; the acquired data is sequentially processed by denoising, filtering, and normalization to eliminate data heterogeneity and generate a structured dataset; based on the power domain entity dictionary (E~dict~) and relation dictionary (R~dict~), entities and relations are extracted from the structured dataset to form a "entity-relation-entity" triple sample set;

[0149] Step S2, Knowledge-enhanced Retrieval Generation: The linking agent uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology; the retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set;

[0150] Step S3, Diagnosis Generation and Hallucination Suppression: Input the structured dataset and knowledge support set into the diagnosis generation agent. Guide the large language model LLM to generate a preliminary diagnosis report through customized prompt words. Calculate the semantic similarity between the report and the knowledge support set. If it is lower than the threshold, trigger a secondary retrieval. Combine real-time physical feature data for verification and correction, and finally output an accurate diagnosis result.

[0151] Step S4, Knowledge Graph Dynamic Update: Automatically collect user satisfaction feedback and review new diagnostic cases in conjunction with experts; for valid cases that pass the review, automatically extract entities and relationships and update them to the knowledge graph, while adjusting the weights of relevant reasoning paths; analyze the causes of hallucinations in erroneous cases and optimize search strategies and prompt word engineering.

[0152] This invention also provides a power grid equipment fault diagnosis system based on a knowledge graph-enhanced LLM illusion suppression model, comprising:

[0153] The multi-source data acquisition and preprocessing module acquires data in real time through a sensor network deployed at key nodes of the power grid; it then performs noise reduction, filtering, and normalization processing on the acquired data in sequence to eliminate data heterogeneity and generate a structured dataset.

[0154] The knowledge graph construction module, based on the entity dictionary (E~dict~) and relation dictionary (R~dict~) in the power field, extracts entities and relations from the structured dataset to form a sample set of "entity-relation-entity" triples;

[0155] The knowledge enhancement diagnostic module uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology. The retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set.

[0156] The hallucination suppression verification module takes the structured dataset and knowledge support set as input for diagnosis and generates an intelligent agent. It guides the large language model LLM to generate a preliminary diagnostic report through customized prompt words. It calculates the semantic similarity between the report and the knowledge support set. If the similarity is lower than the threshold, it triggers a secondary retrieval. It combines real-time physical feature data for verification and correction, and finally outputs an accurate diagnostic result.

[0157] The dynamic update module automatically collects user satisfaction feedback and collaborates with experts to review new diagnostic cases. For valid cases that pass the review, it automatically extracts entities and relationships and updates them to the knowledge graph, while adjusting the weights of relevant reasoning paths. For erroneous cases, it analyzes the causes of hallucinations and optimizes search strategies and prompt word engineering.

[0158] The following is a detailed implementation process of the present invention.

[0159] This invention integrates multi-source power grid data to construct a domain knowledge graph and employs a knowledge-enhanced retrieval-reasoning-verification framework to optimize the output of the Large Language Model (LLM). This addresses the technical pain points of existing diagnostic systems, such as low knowledge organization efficiency, poor adaptability to dynamic environments, and the tendency for LLM to generate illusions. The system includes a knowledge graph construction module, a multi-source data acquisition and preprocessing module, a knowledge-enhanced diagnostic module, an illusion suppression and verification module, and a dynamic update module, enabling precise fault location, cause analysis, and solution generation. This invention provides an intelligent solution for power grid equipment fault diagnosis and is applicable to fault handling scenarios for various types of equipment, including transformers, insulators, and cables.

[0160] like Figure 1 As shown, the present invention discloses a fault diagnosis method for power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model. The main implementation process includes the following steps:

[0161] Step 1 (Multi-source data acquisition, preprocessing, and knowledge graph initialization): Specific implementation techniques and methods:

[0162] (1) Data source collection

[0163] To construct a comprehensive and accurate knowledge graph for power grid equipment fault diagnosis, data needs to be collected from multiple dimensions. The specific data items required to construct a unified structured state data set S are listed below:

[0164] 1) Device operation dataset (S1)

[0165] Electrical operating parameters: three-phase current, voltage, active power, reactive power, frequency, and power factor;

[0166] Power flow and load data: power flow distribution of the line, transformer load rate, and equipment operating capacity;

[0167] Power quality data: harmonic content, voltage deviation, flicker;

[0168] 2) Equipment motion dataset (S2)

[0169] Switch operation record: opening / closing time of circuit breaker and disconnector, operation sequence, operation result (success / failure);

[0170] Protection device operation information: protection device start and operation signals, operation time, fault type (overcurrent, differential, etc.), fault phase, and fault location results;

[0171] Automated control commands: Commands issued by systems such as Automatic Generation Control (AGC) and Automatic Voltage Control (AVC) and their execution status;

[0172] 3) Device status dataset (S3)

[0173] Static ledger information: equipment model, manufacturer, commissioning date, rated parameters, technical specifications, and historical maintenance records;

[0174] Online monitoring data:

[0175] 1. Transformer: oil temperature, winding hot spot temperature, oil level, core grounding current, partial discharge, oil chromatography (content of gases such as hydrogen, methane, and acetylene).

[0176] 2. Circuit breaker: SF6 gas density, trace moisture content, opening and closing coil current waveform, travel-time characteristics.

[0177] 3. Surge arrester: total current, resistive current, number of operations.

[0178] 4. Cables: partial discharge, surface temperature, sheath grounding current, power flow distribution in the line, transformer load rate, and equipment operating capacity;

[0179] Inspection and test data: infrared thermograms (which can detect abnormalities such as overheating at connection points), ground wave detection data, insulation resistance test data, withstand voltage test data, etc.

[0180] Environmental and auxiliary data: ambient temperature, humidity, and on-site video monitoring information of equipment;

[0181] 4) Equipment control dataset (S4)

[0182] Setting information: Setting values ​​and setting zone numbers for various protection devices;

[0183] Control status signals: remote / local control signals, soft pressure plate activation / deactivation status, equipment interlock signals;

[0184] Adjustment commands: On-load tap changer tap position adjustment command, capacitor / reactor switching command;

[0185] 5) Alarm Dataset (S5)

[0186] Real-time alarm information: Alarm signals reported by the monitoring system in real time, including alarm name, occurrence time, device identifier, alarm level (such as emergency, important, general), and alarm content description;

[0187] Alarm dynamic information: alarm confirmation status, confirming personnel, confirmation time, alarm clearing time;

[0188] Performance limit over-limit alarm: An alarm triggered when operating parameters such as current and voltage exceed the set threshold.

[0189] (2) Knowledge graph initialization

[0190] The core of this invention is a dictionary-guided collaborative extraction framework, designed to automatically construct "entity-relationship-entity" triples from structured or semi-structured data of power grid equipment (such as equipment ledgers, fault records, and operation logs). Its core idea is to leverage domain prior knowledge to constrain and enhance the accuracy and efficiency of the extraction process. The specific steps are as follows:

[0191] 1) Data Preprocessing and Feature Engineering: First, the integrated unified structured state data set S (derived from datasets S1-S5) is preprocessed, including data cleaning, missing value imputation, and format standardization. Then, feature engineering is performed, such as generating dictionary identifiers (input_id) and position identifiers (position_id) for text data, converting characters in the text into numerical features that the model can process.

[0192] 2) Entity Recognition: Matching is performed using a predefined power industry entity dictionary (E~dict~). This dictionary contains entity types related to power grid equipment, such as "transformer," "circuit breaker," "protection device," "alarm signal," and their common aliases. A string matching algorithm is used to identify entities belonging to these categories from the preprocessed data. For example, from a record "main transformer A phase oil temperature too high action," the entities "main transformer" (referring to "transformer") and "oil temperature too high" can be identified.

[0193] 3) Relationship Identification: Matching is performed using a predefined power domain relation dictionary (R~dict~). This dictionary defines the semantic relationships that may exist between devices, such as "cause," "located in," "belongs to," and "associated with." Relationships between entities are determined and extracted by analyzing the context and syntactic structure between entities or by using pre-trained models for semantic understanding. For example, based on rules or model judgment, the relation "cause" is extracted from "insulator crack causes line tripping."

[0194] 4) Triple Assembly and Verification: The identified entities and relationships are combined to form preliminary "entity-relationship-entity" triples, such as (Transformer A, has state, oil temperature too high). Then, boundary alignment technology and cross-validation mechanisms are used to verify the boundaries and logical consistency of the triples, ensuring the integrity and rationality of the triple structure. For example, verifying whether "oil temperature too high" is a valid device state entity and whether it can indeed establish a "has state" relationship with "transformer".

[0195] Step Two (Knowledge-Enhanced Retrieval Generation): Specific Implementation Techniques

[0196] (1) Entity recognition and knowledge graph association

[0197] 1) Key entity recognition based on BERT

[0198] 1. Input data formatting: Convert the preprocessed multi-source data (including runtime data, status data, and environmental data) into a natural language sequence S = ,in For data fields or values ​​(such as "#1 Main Transformer", "Temperature", "118℃", "Fan Current", "0A").

[0199] 2. BERT Model Fine-tuning and Adaptation: The BERT model is fine-tuned using labeled corpora in the power grid domain (including labels for equipment entities, feature entities, event entities, etc.). The labeling system adopts the BIO format (B - Entity Start, I - Entity Inside, O - Non-Entity), for example, "B - Equipment I - Equipment OB - Feature OB - Value".

[0200] 3. Entity Boundary and Type Prediction: Input sequence S into the fine-tuned BERT, predict the label of each word through the output layer (fully connected + Softmax), and extract continuous BI sequences as candidate entities. And mark the entity type (e.g., e1="#1 main transformer" is an equipment entity, e2="temperature 118℃" is a feature entity).

[0201] 4. Entity Cleaning and Deduplication: Based on rules, redundant entities are filtered (e.g., excluding common terms like "data" and "monitoring"), and duplicate entities are merged (e.g., "main transformer" and "#1 main transformer" retain complete identifier entities), resulting in the final set of key entities. .

[0202] 2) Entity linking and knowledge graph node matching

[0203] 1. Knowledge Graph Entity Index Construction: Extracting all entity nodes from the knowledge graph. Build an inverted index that includes entity name, alias, and attributes (such as device model and parameter range).

[0204] 2. Entity similarity calculation: For key entity e_i* and graph entity n_j, the matching score is calculated from two dimensions: name similarity and attribute similarity.

[0205] 3. Optimal Node Association: The graph entity with the highest similarity score is selected as the matching result. If the score is greater than or equal to the preset threshold (e.g., 0.6), an association mapping of e_i* → n_j is established; if it is lower than the threshold, it is marked as "new entity candidate" for further review.

[0206] 4. Output of association results: Generate an entity-node association table M = [(e1*, n1), (e2*, n3), ...], which serves as the starting point for the input of the retrieval agent.

[0207] (2) Multi-hop knowledge retrieval and support set construction

[0208] The retrieval agent starts with associated nodes and mines multi-hop associations in the knowledge graph through graph convolutional networks (GCNs), distinguishing between positive and negative knowledge, and finally forming a structured support set.

[0209] 1) Knowledge Graph Encoding and Subgraph Extraction

[0210] 1. Graph-based Structured Representation: The power grid knowledge graph is represented as a multi-relation graph G = (V, R, E), where V is the set of entity nodes (including equipment, faults, features, etc.), R is the set of relations (including "cause", "accompany", "exclude", etc.), and E = {(v_h,r, v_t)} is the set of triples.

[0211] 2. Subgraph extraction of associated nodes: Taking the graph nodes in the entity linking result M as the center, extract a subgraph G_sub = (V_sub, R_sub, E_sub) with a radius of H (number of multi-hop steps, usually 2-3 hops in the power grid scenario) to reduce computational complexity.

[0212] 3. GCN initialization embedding: Initialize the embedding vector h_v for each node v ∈ V_sub in the subgraph. 0 Pre-trained entity embeddings (such as those generated by TransE) or randomly initialized vectors can be used.

[0213] 2) Multi-hop feature propagation based on R-GCN

[0214] 1. Relationship-aware node update: The node embedding is updated iteratively using a relational graph convolutional network (R-GCN). Each hop captures multi-hop semantic associations by aggregating the features and relational information of neighboring nodes.

[0215] 2. Multi-hop iteration termination: After H iterations, the final node embedding h_v is obtained. H At this point, the embedding vector has incorporated all the associated knowledge within the H hop.

[0216] 3) Positive / negative knowledge filtering and support set generation

[0217] 1. Association strength calculation: For the target node v_target (such as the "temperature anomaly" feature node), calculate its cosine similarity with other nodes v in the subgraph, and use it as the association strength sim(v_target, v).

[0218] 2. Positive knowledge extraction: Filter triples with a correlation strength greater than or equal to the positive threshold θ_pos (e.g., 0.5) and a relation type of "cause", "accompany", "correspond" or other positive relations to form a positive knowledge set K_pos = {(v_h, r_pos, v_t)} (e.g., "temperature 118℃ → cause → insulation aging").

[0219] 3. Negative knowledge extraction: Filter triples with a correlation strength ≤ negative threshold θ_neg (e.g., 0.2), or negative relations of type "exclude" or "irrelevant", to form a negative knowledge set K_neg = {(v_h, r_neg, v_t)} (e.g., "current balance → exclusion → winding short circuit").

[0220] 4. Structured support set output: Merge K_pos and K_neg, arrange them in descending order of "association strength", and generate a structured knowledge support set K_support = K_pos ∪ K_neg.

[0221] Step 3 (Diagnostic Agent Generation - Diagnostic Generation and Hallucination Suppression): Specific Implementation Techniques

[0222] The core of the diagnostic agent generation mechanism is a process of "structured data integration - customized cue word constraints - LLM reasoning generation," the specific process of which is as follows: Figure 1 As shown, this ensures that preliminary diagnostic reports are based on real data and knowledge, avoiding unfounded output.

[0223] (1) Generation of preliminary diagnostic report

[0224] 1) The structured integration of input data transforms the K_support = K_pos ∪ K_neg (positive knowledge + negative knowledge) obtained from the knowledge graph retrieval into a basis for natural language reasoning. It then merges D_std (the structured dataset from step one) with K_pos_desc and K_neg_desc to generate a unified input text Input_LLM that can be parsed by LLM, ensuring the traceability of the correlation between data and knowledge.

[0225] 2) Customized prompt word engineering design: Adopting a three-layer prompt word architecture of "role-constraint-task" to force LLM to reason according to the power grid fault diagnosis logic and avoid the generation of illusions.

[0226] 3) LLM-driven preliminary diagnostic report generation: Input Prompt_Final (prompt word) into the LLM for the power grid domain to generate a structured preliminary report Report_init.

[0227] (2) Hallucination Suppression Module - Dual Verification and Modified Hallucination Suppression Module

[0228] The closed-loop process of "semantic consistency verification - secondary retrieval - physical feature cross-validation - final correction" identifies and eliminates the illusory conclusions generated by LLM. The core is the double insurance of "semantic matching + physical mechanism verification".

[0229] 1) Semantic consistency verification

[0230] 1. A Sentence-BERT model fine-tuned for the power grid domain is adopted to transform Report_init and K_support into semantic embedding vectors of a unified dimension:

[0231] For Report_init: Extract the core conclusion sentence (such as "INS-058 Insulator surface pollution flashover accompanied by local breakdown") and generate an embedding vector. ∈ R^768 (768 is the embedding dimension, adapted to the default output of Sentence-BERT);

[0232] For K_support: Concatenate K_pos_desc and K_neg_desc to form the complete text Text_K, generating an embedding vector. ∈ R^768;

[0233] 2. Quantification using cosine similarity and The semantic consistency is expressed by the following formula:

[0234]

[0235] in: The dot product of two vectors. The L2 norm is used to ensure that the similarity results fall within the [0,1] interval.

[0236] 3. Threshold Determination Rules

[0237] The preset semantic similarity threshold for the power grid scenario optimization is θ_sim = 0.7.

[0238] If sim ≥ θ_sim: determine that there is no significant hallucination, and proceed to physical feature cross-validation;

[0239] If sim < θ_sim: it is determined that there is a risk of illusion (such as Report_init mentioning "internal cracks in insulators" but K_support has no relevant knowledge), triggering a secondary search.

[0240] 2) Secondary search - Hallucination correction supplementary knowledge

[0241] 1. Illusion Keyword Localization: The keyword extraction algorithm (TF-IDF) is used to extract words with significant semantic deviation from K_support from Report_init, which are then used as secondary search keywords Keywords_error.

[0242] 2. R-GCN Multi-hop Retrieval Model: Using Keywords_error and the original associated nodes as a joint starting point, the number of multi-hop steps is expanded, and the knowledge graph is re-retrieved through a relational graph convolutional network (R-GCN). The formula is as follows:

[0243]

[0244] in:

[0245] Let v be the embedding vector of node v in the l-th layer;

[0246] The set of neighbors of node v under relation r (such as "cause" or "exclude");

[0247] Let r be the feature transformation matrix of relation r;

[0248] σ(·) is the ReLU activation function, which enhances nonlinear expressive power;

[0249] After updating the node embedding using this formula, positive knowledge K_pos_supp with a correlation strength ≥ θ_pos_supp = 0.55 (higher than the initial retrieval of 0.5, ensuring the reliability of supplementary knowledge) is selected, and the updated knowledge support set K_support_new = K_support ∪ K_pos_supp is generated.

[0250] 3. Preliminary report revision: Re-inject K_support_new into the diagnostic agent, repeat steps 1-3, and generate the revised preliminary report Report_rev.

[0251] 3) Cross-validation of physical features

[0252] 1. Physical feature parameter extraction: Select physical mechanism parameters (non-general parameters) that are directly related to the fault conclusion from D_std to form a physical feature set F_phys.

[0253] 2. Based on the physical mechanism of power grid equipment, a "fault conclusion - physical parameter" mapping rule base, Rule_phys, is constructed. The matching degree is calculated using a weighted Euclidean distance normalization model, as shown in the following formula:

[0254] in:

[0255] These are the standard values ​​of the physical parameters corresponding to the fault conclusion;

[0256] These are the measured values ​​in F_phys;

[0257] For parameter weights;

[0258] , This represents the boundary of the normal range for the parameters;

[0259] ∈ [0,1], the closer to 1, the stronger the physical consistency;

[0260] 3. Physical consistency determination: Preset physical matching threshold θ_match = 0.8

[0261] If match_score ≥ θ_match: the physical mechanism is considered consistent, and the process proceeds to the final review.

[0262] If match_score < θ_match: The judgment result conflicts with the physical characteristics, return to stage 2) and re-search and correct.

[0263] Step Four (Dynamic Update of Knowledge Graph): Specific Implementation Techniques

[0264] The core objective of dynamic knowledge graph updates is to build a closed-loop mechanism of "feedback collection - case review - knowledge extraction - graph iteration - strategy optimization," which can be achieved without manual intervention: ① adding knowledge accumulation of valid fault cases; ② optimizing the reasoning weights of entity relationships in the knowledge graph; ③ correcting retrieval strategies and prompt word engineering based on fault cases, ultimately improving the accuracy and adaptability of system fault diagnosis.

[0265] (1) Feedback and case data collection

[0266] The system automatically collects relevant data throughout the entire diagnostic process, forming a complete case data package to provide a foundation for subsequent updates.

[0267] 1) User Satisfaction Feedback Collection: User (operations personnel) satisfaction ratings for the final diagnostic report, Report_final, are collected through pop-up windows on the operations and maintenance terminal and feedback entry points in the app. A combination of quantitative scoring and text feedback is used.

[0268] Quantitative scoring: Score_usr ∈ [1,5] (1 = completely inaccurate, 5 = completely accurate);

[0269] Text feedback: Feedback_usr (e.g., "The cause of the fault was accurately determined, but the repair suggestion did not mention wiring checks" or "The fan fault was misjudged as a control circuit problem").

[0270] 2) Full archiving of diagnostic cases: Automatically associates the full data corresponding to the diagnosis and generates a case data package Case ={D_std, K_support, Report_init, Report_final, Score_usr, Feedback_usr}, where: D_std is the structured dataset, K_support is the knowledge support set, Report_init is the preliminary diagnostic report, and Report_final is the final diagnostic report.

[0271] 3) Case screening: Set a satisfaction threshold θ_usr=3 (medium and above satisfaction) to screen candidate cases:

[0272] Valid case candidate: Score_usr ≥ θ_usr (user approved, proceed to review process);

[0273] Error case candidate: Score_usr < θ_usr (user denies, proceed to hallucination cause analysis process).

[0274] (2) Expert collaborative review

[0275] The "automated pre-review + expert final review" model ensures the validity of cases and the accuracy of knowledge, eliminating the need for manual intervention in basic data processing.

[0276] 1) Automated pre-audit

[0277] For valid case candidates: By comparing the physical matching score match_score (≥θ_match=0.8) and semantic similarity score sim (≥θ_sim=0.7) between Report_final and D_std, cases of "user misjudgment" (e.g., match_score<0.8 but Score_usr=5) are eliminated.

[0278] For candidate error cases: automatically extract the conflict points between Report_final and D_std, and generate a conflict analysis report Report_conflict.

[0279] 2) Expert Final Review Interface

[0280] The system will push the pre-approved valid cases, erroneous cases, and Report_conflict to the expert review platform. Experts only need to click "Approve", "Reject", or add supplementary annotations (such as correcting the fault type). The average review time is ≤3 minutes per case.

[0281] Set the expert review threshold θ_exp=0.8 (expert approval rate) to determine the final valid cases (Case_valid): expert approval rate ≥ θ_exp; and the erroneous cases (Case_error): expert approval rate < θ_exp (confirming the existence of hallucinations or diagnostic errors).

[0282] (3) Automatic extraction of new entities and relations

[0283] For Case_valid, the newly added entities and relationships are automatically extracted using "LLM prompt word extraction + rule validation," eliminating the need for manual annotation.

[0284] 1) Extract target definition

[0285] New entities include: device sub-modules not in the existing knowledge graph, new types of faults, and special environmental factors;

[0286] New relationships: causal relationships, exclusion relationships, etc. between entities;

[0287] 2) Rule validation and filtering

[0288] Entity validation: Filter invalid entities using regular expression matching;

[0289] Relationship verification: Based on the power grid physical mechanism rule base, unreasonable relationships are filtered out, and finally a clean extraction result is obtained: Extract_clean = {Entities_new, Relations_new}.

[0290] (4) Iterative updates of knowledge graph

[0291] It includes two parts: "adding new entity relationships" and "adjusting the weight of inference paths," ensuring the timeliness of graph knowledge and the accuracy of inference.

[0292] 1) Adding new entities and relations

[0293] 1. Add the entities in Entities_new to the corresponding node set of the knowledge graph according to their type, and initialize the embedding vector for the new entities;

[0294] 2. Add the triples in Relations_new to the edge set E of the knowledge graph, and record the initial confidence level.

[0295] 2) Adjustment of inference path weights

[0296] 1. Define the inference path as a multi-hop link of "feature entity → relation → faulty entity":

[0297] Suppose a reasoning path P = [e1→r1→e2→r2→...→ek] in a knowledge graph (where e is an entity and r is a relation), and its initial weight W(P) is the product of the confidence scores of all relations in the path:

[0298]

[0299] Where conf(r_i) is the confidence level of relation r_i;

[0300] 2. Increase the weight of inference paths validated as accurate in Case_valid; adjust the weight of paths corroborated by Case_valid in historical cases accordingly.

[0301]

[0302] Where: t is the update round; α is the weight adjustment coefficient;

[0303] The credibility score for the case is calculated by weighting user satisfaction and expert review results:

[0304]

[0305] Where: β is the weighting coefficient; Rate user satisfaction (1-5 points). The expert review score is 0 or 1, where 0 = rejection and 1 = pass.

[0306] 3. To avoid unbounded growth of path weights, the path weights of all paths from the same head entity to the same tail entity are normalized:

[0307]

[0308] in: The set of all inference paths from entity e_h to e_t is given, with normalized weights ranging from [0,1].

[0309] (5) Optimization of search and suggestion strategies

[0310] Analyzing the causes of hallucinations using Case_error, we reverse-engineered the search strategy and prompt word engineering to reduce the incidence of subsequent hallucinations from the source:

[0311] 1) Classification of the causes of hallucinations

[0312] Insufficient retrieval type: Relevant knowledge exists in the knowledge graph, but the retrieval agent fails to retrieve it (e.g., insufficient multi-hop steps, excessively high association strength threshold).

[0313] Knowledge gap type: No relevant knowledge exists in the knowledge graph, and LLM fabricates conclusions;

[0314] Vague prompts: The prompts are not clearly defined, allowing LLMs to be more flexible and adaptable.

[0315] 2) Targeted optimization

[0316] Search strategy optimization: For "insufficient retrieval" errors, dynamically adjust R-GCN search parameters (e.g., adjust the number of hops H from 2-3 hops to 3-4 hops, and reduce the positive association threshold θ_pos from 0.5 to 0.45).

[0317] Knowledge Gap Marking: For "knowledge gap type" errors, mark the corresponding knowledge gap (e.g., "knowledge gap in fault diagnosis of new superconducting transformers"), triggering a reminder for subsequent expert knowledge entry;

[0318] Prompt word optimization: For "fuzzy prompt word" errors, additional constraint rules were added and the Prompt_Final template was updated.

[0319] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model, characterized in that, Includes the following steps: Step S1, Multi-source data acquisition, preprocessing, and knowledge graph initialization: Data is acquired in real time through a sensor network deployed at key nodes of the power grid; the acquired data is then subjected to noise reduction, filtering, and normalization processes to eliminate data heterogeneity and generate a structured dataset. Based on the entity dictionary (E~dict~) and relation dictionary (R~dict~) in the power field, entities and relations are extracted from the structured dataset to form a sample set of "entity-relation-entity" triples; Step S2, Knowledge-enhanced Retrieval Generation: The linking agent uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology; the retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set; Step S3, Diagnosis Generation and Hallucination Suppression: Input the structured dataset and knowledge support set into the diagnosis generation agent. Guide the large language model LLM to generate a preliminary diagnosis report through customized prompt words. Calculate the semantic similarity between the report and the knowledge support set. If it is lower than the threshold, trigger a secondary retrieval. Combine real-time physical feature data for verification and correction, and finally output an accurate diagnosis result. Step S4, Knowledge Graph Dynamic Update: Automatically collect user satisfaction feedback and review new diagnostic cases in conjunction with experts; for valid cases that pass the review, automatically extract entities and relationships and update them to the knowledge graph, while adjusting the weights of relevant reasoning paths; analyze the causes of hallucinations in erroneous cases and optimize search strategies and prompt word engineering.

2. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 1, characterized in that, In step S1, the knowledge graph is initialized, as follows: Data preprocessing and feature engineering: First, the integrated unified structured state dataset is preprocessed, including data cleaning, missing value imputation, and format standardization; then feature engineering is performed to convert the characters in the text into numerical features that the model can process. Entity recognition: Matching is performed using a predefined entity dictionary (E~dict~) in the power industry. The entity dictionary (E~dict~) includes entity types related to power grid equipment. A string matching algorithm is used to identify entities belonging to the entity types related to power grid equipment from the preprocessed data. Relationship identification: Matching is performed using a predefined power domain relation dictionary (R~dict~), which defines the semantic relationships that may exist between devices. The relationships between entities are determined and extracted by analyzing the context and syntactic structure between entities or by using a pre-trained model for semantic understanding. Triple assembly and verification: The identified entities and relations are combined to form a preliminary "entity-relationship-entity" triple. Then, the boundaries and logical consistency of the triple are verified through boundary alignment technology and cross-validation mechanism to ensure the integrity and rationality of the triple structure.

3. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 1, characterized in that, Step S2 includes: S21. Entity Recognition and Knowledge Graph Association (1) Key entity recognition based on BERT (1.1) Input data formatting: The preprocessed multi-source data is converted into a natural language sequence S = ,in For data fields or values; (1.2) BERT model fine-tuning and adaptation: The BERT model was fine-tuned using the power grid domain labeled corpus. The labeling system adopted the BIO format (B - entity start, I - entity interior, O - non-entity). (1.3) Entity Boundary and Type Prediction: Input the sequence S into the fine-tuned BERT, predict the label of each word through the output layer, and extract continuous BI sequences as candidate entities. and indicate the entity type; (1.4) Entity cleaning and deduplication: Based on rules, redundant entities are filtered and duplicate entities are merged to obtain the final key entity set. ; (2) Entity link and knowledge graph node matching (2.1) Knowledge graph entity index construction: Extract all entity nodes in the knowledge graph Build an inverted index that includes entity name, alias, and attributes; (2.2) Entity similarity calculation: For key entity e_i* and graph entity n_j, the matching score is calculated from two dimensions: name similarity and attribute similarity; (2.3) Optimal node association: The graph entity with the highest similarity score is taken as the matching result. If the score is greater than or equal to the preset threshold, an association mapping of e_i* → n_j is established; if it is less than the threshold, it is marked as "new entity candidate" and awaits further review. (2.4) Output of association results: Generate entity-node association table M = [(e1*, n1), (e2*, n3), ...], which serves as the starting point for input of the retrieval agent.

4. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 3, characterized in that, Step S2 also includes: S22. Multi-hop knowledge retrieval and support set construction The retrieval agent starts with associated nodes and uses a Graph Convolutional Network (GCN) to mine multi-hop associations in the knowledge graph, distinguishing between positive and negative knowledge, and finally forming a structured support set, as follows: (1) Knowledge graph encoding and subgraph extraction (1.1) Graph structured representation: The power grid knowledge graph is represented as a multi-relation graph G = (V, R, E), where V is the set of entity nodes, R is the set of relations, and E = {(v_h, r, v_t)} is the set of triples; (1.2) Subgraph extraction of associated nodes: Taking the graph nodes in the entity linking result M as the center, extract a subgraph G_sub = (V_sub, R_sub, E_sub) with a radius of H multi-hop steps; (1.3) GCN initialization embedding: Initialize the embedding vector h_v for each node v ∈ V_sub in the subgraph. 0 , using pre-trained entity embeddings or randomly initialized vectors; (2) Multi-hop feature propagation based on R-GCN (2.1) Relationship-aware node update: The node embedding is updated iteratively using the relation graph convolutional network R-GCN. Each hop captures multi-hop semantic associations by aggregating the features and relation information of neighboring nodes. (2.2) Multi-hop iteration termination: After H iterations, the final node embedding h_v is obtained. H At this point, the embedding vector has incorporated all the related knowledge within the H-hop; (3) Positive / negative knowledge screening and support set generation (3.1) Association strength calculation: For the target node v_target, calculate its cosine similarity with other nodes v in the subgraph, and use it as the association strength sim(v_target, v); (3.2) Positive knowledge extraction: Select triples with association strength ≥ positive threshold θ_pos, and the relation type is a positive relation including "cause", "accompany", and "correspond", to form a positive knowledge set K_pos = {(v_h, r_pos, v_t)}; (3.3) Negative knowledge extraction: Filter triples with association strength ≤ negative threshold θ_neg, or negative relations with relation type including "exclude" and "irrelevant", to form a negative knowledge set K_neg = {(v_h, r_neg, v_t)}; (3.4) Structured support set output: Merge K_pos and K_neg, arrange them in descending order of "association strength", and generate a structured knowledge support set K_support = K_pos ∪ K_neg.

5. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 4, characterized in that, Step S3 includes: S31. Preliminary Diagnosis Report Generation (1) The structured integration of input data transforms K_support = K_pos ∪ K_neg obtained from knowledge graph retrieval into natural language reasoning basis, merges the structured dataset D_std formed in step 1 with K_pos_desc and K_neg_desc, and generates a unified input text Input_LLM that can be parsed by LLM; (2) Customized prompt word engineering design: The three-layer prompt word architecture of "role-constraint-task" is adopted to force LLM to reason according to the power grid fault diagnosis logic and avoid the generation of illusions; (3) LLM drives the generation of preliminary diagnostic reports: Input the final prompt word Prompt_Final into the LLM for the power grid field to generate a structured preliminary report Report_init.

6. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM hallucination suppression model according to claim 5, characterized in that, Step S3 also includes: S32, Hallucination Suppression Module - Dual Validation and Modified Hallucination Suppression Module Through a closed-loop process of "semantic consistency verification - secondary retrieval - physical feature cross-validation - final correction", the system identifies and eliminates the illusory conclusions generated by LLM. The core of this approach is a double guarantee of "semantic matching + physical mechanism verification", as detailed below: (1) Semantic consistency verification (1.1) A Sentence-BERT model fine-tuned for the power grid domain is adopted to transform Report_init and K_support into semantic embedding vectors of a unified dimension: For Report_init: Extract the core conclusion sentence and generate an embedding vector. ∈ R^768, where 768 is the embedding dimension; For K_support: Concatenate K_pos_desc and K_neg_desc to form the complete text Text_K, generating an embedding vector. ∈ R^768; (1.2) Quantification by cosine similarity and The semantic consistency is expressed by the following formula: in: The dot product of two vectors. The L2 norm is used to ensure that the similarity results fall within the [0,1] interval; (1.3) Threshold determination rules The preset semantic similarity threshold for the power grid scenario optimization is θ_sim = 0.

7. If sim ≥ θ_sim: determine that there is no significant hallucination, and proceed to physical feature cross-validation; If sim < θ_sim: a risk of hallucination is detected, triggering a secondary search; (2) Secondary retrieval - hallucination correction and supplementary knowledge (2.1) Illusion keyword localization: The TF-IDF keyword extraction algorithm is used to extract words with large semantic deviation from K_support from Report_init, which are used as secondary search keywords Keywords_error; (2.2) R-GCN Multi-hop Retrieval Model: Taking Keywords_error and the original associated nodes as the joint starting point, the number of multi-hop steps is expanded, and the knowledge graph is re-retrieved through the relational graph convolutional network R-GCN. The formula is as follows: in: Let v be the embedding vector of node v in the l-th layer; The set of neighbors of node v under relation r; Let r be the feature transformation matrix. σ is the initial feature transformation matrix; σ(·) is the ReLU activation function; After updating the node embedding using the above formula, positive knowledge K_pos_supp with a correlation strength ≥ θ_pos_supp = 0.55 is selected to generate the updated knowledge support set K_support_new = K_support ∪ K_pos_supp; (2.3) Preliminary report revision: Re-inject K_support_new into the diagnostic agent, repeat the process of stages (2.1)-(2.3), and generate the revised preliminary report Report_rev; (3) Cross-validation of physical features (3.1) Extraction of physical feature parameters: Select physical mechanism parameters directly related to the fault conclusion from D_std to form a physical feature set F_phys; (3.2) Based on the physical mechanism of power grid equipment, a "fault conclusion - physical parameter" mapping rule base Rule_phys is constructed. The matching degree is calculated using a weighted Euclidean distance normalization model, as shown in the following formula: in: These are the standard values ​​of the physical parameters corresponding to the fault conclusion; These are the measured values ​​in F_phys; For parameter weights; , This represents the boundary of the normal range for the parameters; ∈ [0,1], the closer to 1, the stronger the physical consistency; (3.3) Physical consistency determination: The preset physical matching degree threshold θ_match = 0.8 If match_score ≥ θ_match: the physical mechanism is considered consistent, and the process proceeds to the final review. If match_score < θ_match: the judgment result conflicts with the physical characteristics, return to stage (2) to re-search and correct.

7. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 6, characterized in that, Step S4 includes: S41. Feedback and Case Data Collection The system automatically collects relevant data throughout the entire diagnostic process, forming a complete case data package to provide a foundation for subsequent updates, as detailed below: (1) User satisfaction feedback collection: Through the operation and maintenance terminal pop-up window and the APP feedback entry, collect the satisfaction evaluation of users or operation and maintenance personnel on the final diagnostic report Report_final, using a combination of quantitative scoring and text feedback: Quantitative scoring: Score_usr ∈ [1,5], 1 = completely inaccurate, 5 = completely accurate; Text feedback: Feedback_usr; (2) Full archiving of diagnostic cases: Automatically associate the full data corresponding to the diagnosis and generate a case data package Case = {D_std, K_support, Report_init, Report_final, Score_usr, Feedback_usr}, where: D_std is the structured dataset, K_support is the knowledge support set, Report_init is the preliminary diagnostic report, and Report_final is the final diagnostic report; (3) Case screening: Set the satisfaction threshold θ_usr=3 and screen out candidate cases: Valid case candidate: Score_usr ≥ θ_usr, user approval, proceed to review process; Error case candidate: Score_usr < θ_usr, user denies, proceed to hallucination cause analysis process; S42, Expert Collaborative Review The "automated pre-review + expert final review" model ensures the validity of cases and the accuracy of knowledge, eliminating the need for manual intervention in basic data processing, as detailed below: (1) Automated pre-audit For valid case candidates: "user misreview" cases are eliminated by comparing the physical match score and semantic similarity score between Report_final and D_std. For candidate error cases: automatically extract the conflict points between Report_final and D_std, and generate a conflict analysis report Report_conflict; (2) Expert final review interface Valid cases, erroneous cases, and Report_conflicts that have passed the pre-review are pushed to the expert review platform. Experts only need to click "Approve", "Reject", or add supplementary annotations. The average review time is ≤3 minutes per case. The expert review threshold is set to θ_exp=0.

8. The final determination of valid cases (Case_valid) is: expert approval rate ≥ θ_exp; and incorrect cases (Case_error) are: expert approval rate < θ_exp. S43. Automatic extraction of new entities and relationships For Case_valid, the newly added entities and relationships are automatically extracted using "LLM prompt word extraction + rule validation" without manual annotation, as detailed below: (3) Extracting target definition New entity Entities_new: includes device sub-modules not in the existing knowledge graph, new fault types, and special environmental factors; New Relations_new: Includes causal relationships and exclusionary relationships between entities; (4) Rule validation and filtering Entity validation: Filter invalid entities using regular expression matching; Relationship verification: Based on the power grid physical mechanism rule base, unreasonable relationships are filtered out, and finally a clean extraction result is obtained: Extract_clean = {Entities_new, Relations_new}.

8. The method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 7, characterized in that, Step S4 also includes: S44. Knowledge Graph Iterative Update This includes two parts: "adding new entity relationships" and "adjusting the weights of inference paths," ensuring the timeliness of graph knowledge and the accuracy of inference, as detailed below: (1) Adding entities and relations Add the entities in Entities_new to the corresponding node set of the knowledge graph according to their type, and initialize the embedding vector for the new entities; Add the triples in Relations_new to the edge set E of the knowledge graph, and record the initial confidence level at the same time; (2) Adjustment of inference path weights Define the inference path as a multi-hop link of "feature entity → relation → faulty entity": Suppose a reasoning path P = [e1→r1→e2→r2→...→ek] in a knowledge graph, where e is an entity, r is a relation, and the initial weights are... The product of the confidence scores of all relations in the path: Where conf(r_i) is the confidence level of relation r_i; For inference paths validated as accurate in Case_valid, increase their path weight; for paths corroborated by Case_valid in historical cases, adjust their weights accordingly. Where: t is the update round; α is the weight adjustment coefficient; The credibility score for the case is calculated by weighting user satisfaction and expert review results: Where: β is the weighting coefficient; Rate user satisfaction. Score based on expert review; To avoid unbounded growth of path weights, the path weights of all paths from the same head entity to the tail entity are normalized: in: The set of all inference paths from entity e_h to e_t is given, with normalized weights ranging from [0,1].

9. A method for fault diagnosis of power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model according to claim 8, characterized in that, Step S4 also includes: S45. Optimization of Search and Suggestion Strategies Analyzing the causes of hallucinations using Case_error, we reverse-engineered the search strategy and prompt word engineering to reduce the incidence of subsequent hallucinations from the source, as detailed below: (1) Classification of the causes of hallucination Insufficient retrieval type: Relevant knowledge exists in the knowledge graph, but the retrieval agent fails to retrieve it; Knowledge gap type: No relevant knowledge exists in the knowledge graph, and LLM fabricates conclusions; Vague prompts: The prompts are not clearly defined, allowing LLMs to be more flexible and adaptable. (2) Targeted optimization Search strategy optimization: Dynamically adjust R-GCN search parameters for "insufficient search" errors; Knowledge Gap Marking: For "knowledge gap type" errors, mark the corresponding knowledge gap and trigger subsequent expert knowledge input reminders; Prompt word optimization: For the "fuzzy prompt word" error, additional constraint rules were added and the Prompt_Final template was updated.

10. A fault diagnosis system for power grid equipment based on a knowledge graph-enhanced LLM illusion suppression model, characterized in that, include: The multi-source data acquisition and preprocessing module acquires data in real time through a sensor network deployed at key nodes of the power grid; The collected data is processed sequentially by denoising, filtering, and normalization to eliminate data heterogeneity and generate a structured dataset. The knowledge graph construction module, based on the entity dictionary (E~dict~) and relation dictionary (R~dict~) in the power field, extracts entities and relations from the structured dataset to form a sample set of "entity-relation-entity" triples; The knowledge enhancement diagnostic module uses the BERT model to identify key entities in the structured dataset and establishes associations with corresponding nodes in the knowledge graph through entity linking technology. The retrieval agent uses graph convolutional networks to perform multi-hop retrieval based on the associated nodes, extracting positive association knowledge and negative exclusion knowledge to form a structured knowledge support set. The hallucination suppression verification module takes the structured dataset and knowledge support set as input for diagnosis and generates an intelligent agent. It guides the large language model LLM to generate a preliminary diagnostic report through customized prompt words. It calculates the semantic similarity between the report and the knowledge support set. If the similarity is lower than the threshold, it triggers a secondary retrieval. It combines real-time physical feature data for verification and correction, and finally outputs an accurate diagnostic result. The dynamic update module automatically collects user satisfaction feedback and collaborates with experts to review new diagnostic cases. For valid cases that pass the review, it automatically extracts entities and relationships and updates them to the knowledge graph, while adjusting the weights of relevant reasoning paths. For erroneous cases, it analyzes the causes of hallucinations and optimizes search strategies and prompt word engineering.