Power fault diagnosis method, system and equipment based on large model retrieval enhancement and medium
The power fault diagnosis method enhanced by large model retrieval solves the problems of traditional methods' strong dependence on training data and insufficient reasoning ability, and realizes efficient diagnosis and solution generation for complex faults, thereby improving the operational safety and reliability of the power system.
Patent Information
- Application Number
- CN202511214831.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-10-31
AI Technical Summary
Traditional intelligent fault detection methods rely heavily on large-scale training data, lack reasoning ability, struggle to handle novel or complex faults, and lack solutions in their diagnostic results, resulting in insufficient diagnostic efficiency and reliability.
A power fault diagnosis method based on large model retrieval enhancement is adopted. Through preprocessing, knowledge base retrieval, ranking optimization and rationality judgment, a large language model is used to generate power fault diagnosis results and solutions, including text normalization, vectorized retrieval, learning ranking and rationality verification of diagnosis results.
It improves adaptability to complex and novel fault scenarios, enhances the accuracy, reliability, and feasibility of diagnostic results, and reduces reliance on large-scale training data.
Smart Images

Figure CN120874599A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power fault diagnosis technology, specifically to a power fault diagnosis method, system, equipment, and medium based on large model retrieval enhancement. Background Technology
[0002] As power systems continue to expand in scale and become more complex, the number and types of power equipment are increasing, their operating states are becoming more diverse, and the types of faults are also becoming more varied and complex. Against this backdrop, the difficulty of fault detection and diagnosis in power systems has significantly increased; a fault in any single link can cause unstable system operation or even widespread power outages.
[0003] In existing technologies, operating parameters such as current, voltage, resistance, and environmental conditions are typically collected. Machine learning models are then used to model the operating characteristics of the power system, and fault categories are classified and identified based on training samples. While this type of method can identify common faults when the training sample coverage is sufficient, it still has the following shortcomings:
[0004] The model is highly dependent on large-scale training data. When the training samples are insufficient or the sample features are incomplete, the diagnostic accuracy will drop significantly.
[0005] The model is essentially a pattern recognition method, lacking reasoning ability, and often fails to output effective results for novel or complex faults outside the training sample range.
[0006] Existing methods are mostly limited to outputting fault categories and fail to provide corresponding handling measures or solutions. Power maintenance personnel still need to make manual judgments and handle the issues based on their experience, resulting in insufficient diagnostic efficiency and reliability. Summary of the Invention
[0007] In view of the above-mentioned problems, the present invention is proposed.
[0008] Therefore, the technical problem solved by this invention is that traditional intelligent fault detection mostly uses machine learning methods, which require a lot of training data to achieve strong model capabilities. At the same time, the reasoning ability of machine learning models also has problems.
[0009] To address the aforementioned technical problems, this invention provides the following technical solution: a power fault diagnosis method based on large model retrieval enhancement, comprising,
[0010] Obtain power fault problems input by power maintenance personnel;
[0011] The power failure problem is preprocessed, which includes rewriting and decomposing the power failure problem into subproblems;
[0012] Vectorized retrieval is performed on the power maintenance knowledge base for sub-problems. The power maintenance knowledge base is composed of power fault-related documents that are segmented, vectorized, and stored to obtain reference materials that match the sub-problems.
[0013] A secondary sorting is performed on the reference materials, and a learned ranking model is used to refine the retrieval results for each sub-question.
[0014] The results of the fine ranking of the sub-problems are merged and sorted, scores are assigned based on the reciprocal ranking and combined scores are calculated, and reference materials with scores below a preset threshold are removed to obtain an optimized reference set;
[0015] The optimized reference set and power fault problems are input into a large language model to generate power fault diagnosis results and solutions.
[0016] The reasonableness of the power fault diagnosis results is determined, and the final power fault diagnosis result is output when the reasonableness determination is passed.
[0017] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the rewriting and splitting of the problem includes: performing text normalization processing on the input power fault problem; the text normalization processing includes performing word segmentation and part-of-speech recognition on the problem statement, and replacing non-standard terms with power professional terms.
[0018] When the power failure problem contains multiple semantics, the power failure problem is split into multiple sub-problems based on semantic dependencies, and retrieval input is generated for each sub-problem.
[0019] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the execution of vectorized retrieval includes dividing power fault-related documents into document blocks according to preset multi-level delimiters, and adding context information to each document block after block division.
[0020] The document block is vectorized to obtain the question vector and document block vector corresponding to the sub-question;
[0021] The similarity between the question vector and the document block vector is used to retrieve reference materials that match the sub-question;
[0022] When updating the knowledge base, the newly generated document block vector is compared with the existing document block vector for similarity. If the preset update conditions are met, the new document block replaces the existing document block.
[0023] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the step of using a learning ranking model to finely rank the retrieval results of sub-problems includes combining sub-problems with corresponding candidate reference materials to form a ranked input.
[0024] The sorting input is provided to a sorting method based on a large language model, and the sorting method outputs a ranking result that reflects the relevance between the sub-problem and the candidate references according to a preset sorting prompt.
[0025] A refined sorted sequence is generated based on the ranking results.
[0026] The beneficial effects of this preferred technical solution are as follows: by adopting a ranking method based on a large language model to fine-tune the candidate references, the relevance of the ranking can be improved by utilizing the semantic understanding ability of the model without additional training data, ensuring that references more closely related to the sub-problems are presented first, avoiding the problems of high feature dependence and insufficient generalization ability of traditional ranking methods, thus improving the accuracy and reliability of retrieval results when dealing with semantically complex power fault problems.
[0027] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the step of merging and sorting the fine ranking results of sub-problems includes summarizing the fine ranking sequences corresponding to each sub-problem into multiple sorting lists.
[0028] Assign a reciprocal ranking score to each candidate reference in the sorting list, and introduce a preset constant term during the assignment to avoid the score being too high due to the list being too short;
[0029] The reciprocal scores of the same candidate references are weighted and summed to form a combined score;
[0030] Candidate reference materials are fused and sorted according to the combined scores, and candidate reference materials with combined scores lower than a preset threshold are removed after fusion and sorting to obtain an optimized reference set.
[0031] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the generation of power fault diagnosis results and solutions includes: performing sentence segmentation processing on the diagnosis results output by the large language model to obtain multiple semantic segments;
[0032] The semantic fragments are vectorized, and the reference materials in the optimized reference set are also vectorized.
[0033] The similarity between the semantic fragment vector and the reference data vector is calculated based on a preset similarity measurement method.
[0034] Based on the similarity calculation results, a correspondence between semantic fragments and reference materials is generated, and the correspondence is embedded into the diagnostic results to form a diagnostic result with source annotation.
[0035] The beneficial effects of this preferred technical solution are as follows: By segmenting the diagnostic results output by the large language model and aligning them with the vectorized reference materials, clear source annotations can be embedded in the diagnostic results, realizing the correspondence between the diagnostic content and the knowledge base evidence. This not only enhances the traceability and interpretability of the diagnostic results but also effectively reduces the risk of misjudgment caused by inconsistencies between the generated content and the reference materials.
[0036] As a preferred embodiment of the power fault diagnosis method based on large model retrieval enhancement described in this invention, the reasonableness determination of the power fault diagnosis result includes: vectorizing the diagnosis result and performing semantic similarity calculation with the vector representation of the input power fault problem to determine whether the diagnosis result covers the semantic range of the input problem.
[0037] The diagnostic results are vectorized and compared with the vector representations of the reference materials in the optimized reference set to determine whether the diagnostic results are logically consistent with the reference materials.
[0038] When both the semantic similarity calculation and consistency comparison meet the preset judgment conditions, the diagnostic result is output as the final power fault diagnosis result.
[0039] This invention provides a power fault diagnosis system based on large model retrieval enhancement.
[0040] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a power fault diagnosis system based on large model retrieval enhancement, comprising: a problem acquisition module, used to acquire power fault problems input by power maintenance personnel;
[0041] The preprocessing module is used to rewrite and break down the power failure problem into sub-problems;
[0042] The retrieval module is used to perform vectorized retrieval of the sub-problem in the power maintenance knowledge base, which is composed of power fault-related documents that are segmented, vectorized and stored to obtain reference materials that match the sub-problem.
[0043] The sorting module is used to perform a secondary sorting on the reference materials, and to fine-tune the retrieval results of the sub-questions using a learned sorting model.
[0044] The fusion module is used to merge and sort the results of the fine ranking of sub-problems, assign scores based on the reciprocal ranking and calculate the combined scores, remove reference materials with scores below a preset threshold, and generate an optimization reference set.
[0045] The generation module is used to input the optimized reference set and the power fault problem into the large language model to generate power fault diagnosis results and solutions.
[0046] The determination module is used to determine the reasonableness of the power fault diagnosis results and output the final power fault diagnosis result when the determination is successful.
[0047] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor executes the computer program to implement the steps of the power fault diagnosis method based on large model retrieval enhancement.
[0048] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the power fault diagnosis method based on large model retrieval enhancement.
[0049] The beneficial effects of this invention are as follows: By introducing a large-scale model reasoning method with enhanced retrieval during power fault diagnosis, the dependence on large-scale training samples can be reduced, improving adaptability to complex and novel fault scenarios; through the collaborative design of knowledge base construction, vectorized retrieval, secondary sorting, and fusion sorting stages, the relevance and conciseness of retrieval results are ensured, thereby improving the accuracy of diagnostic results; by establishing a correspondence with reference materials during the generation of diagnostic results and performing a rationality judgment before output, the traceability and consistency verification of diagnostic results are ensured, avoiding conclusions that do not conform to reference materials, thereby improving the reliability and feasibility of diagnostic results. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 The above is a flowchart of a power fault diagnosis method based on large model retrieval enhancement, provided as an embodiment of the present invention. Detailed Implementation
[0052] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0053] Example 1, referring to Figure 1 This is one embodiment of the present invention, which provides a power fault diagnosis method based on large model retrieval enhancement, including:
[0054] Step 1: Obtain the power fault problem input by the power maintenance personnel.
[0055] Step 2: Preprocess the power failure problem. Preprocessing includes rewriting and breaking down the power failure problem into subproblems.
[0056] Step 3: Perform vectorized retrieval in the power maintenance knowledge base for the sub-problem. The power maintenance knowledge base is composed of power fault-related documents that have been segmented, vectorized, and stored to obtain reference materials that match the sub-problem.
[0057] Step 4: Perform a secondary sort on the reference materials, and use a learned ranking model to fine-tune the retrieval results of the sub-questions.
[0058] Step 5: Merge and sort the results of the sub-problems, assign scores based on the reciprocal ranking and calculate the combined scores, remove reference materials with scores below the preset threshold, and obtain the optimized reference set.
[0059] Step 6: Input the optimized reference set and power fault problem into the large language model to generate power fault diagnosis results and solutions.
[0060] Step 7: Determine the reasonableness of the power fault diagnosis results, and output the final power fault diagnosis results when the reasonableness determination is passed.
[0061] In real-world power systems, power maintenance personnel frequently encounter complex fault diagnosis scenarios, such as abnormally high transformer temperatures, intermittent short circuits in cable lines, and abnormal actions of switchgear during load switching. These problems often involve multiple potential causes, potentially related to equipment aging or factors such as the operating environment and current / voltage fluctuations. Traditional diagnostic methods typically rely on human experience or machine learning models based on single features, making it difficult to cover novel, unseen fault categories and providing maintenance personnel with comprehensive solutions. The method described in this embodiment, by introducing a combination of preprocessing, knowledge base retrieval, and a large language model, can transform raw, colloquial power maintenance problems into structured, specialized sub-problems, thereby improving the accuracy of subsequent retrieval and diagnosis.
[0062] This method encompasses a complete process from acquiring power maintenance issues, standardizing and processing them, retrieving information from the knowledge base, optimizing the ranking, generating results, and determining their reasonableness. In the issue input stage, the natural language issues raised by maintenance personnel are standardized and segmented to make their semantics more closely resemble existing professional descriptions in the knowledge base. In the retrieval stage, power fault documents are segmented and encoded using a vectorization model to achieve accurate matching of the input issues; combined with secondary ranking and fusion ranking mechanisms, reference materials are further filtered and optimized, ensuring that the content input to the large language model is compact and highly relevant. In the generation stage, the large language model outputs power fault diagnosis results based on the optimized reference set, and the reasonableness determination stage ensures the results have engineering feasibility and logical reliability through semantic similarity comparison and consistency verification. The entire method forms a closed-loop automated diagnostic chain, effectively reducing reliance on manual intervention.
[0063] Furthermore, the retrieval enhancement mechanism and rationality judgment mechanism introduced in this embodiment enable power fault diagnosis to have dynamic updating and adaptive capabilities. During knowledge base maintenance, the multi-level delimiter-based block method and vectorized model processing enable continuous expansion and updating of new documents. During ranking optimization, a language model-based learning ranking method combined with a reciprocal ranking allocation strategy is used to uniformly evaluate the retrieval results of different sub-questions, ensuring that the most relevant information is prioritized for transmission to the diagnostic model. During result verification, semantic similarity calculation and reference consistency comparison are used to effectively eliminate unreasonable or false outputs. Through these technical solutions, power maintenance personnel can not only quickly obtain accurate diagnoses for common faults, but also receive reasonable diagnostic suggestions and actionable solutions when facing new and complex faults, thereby improving the operational safety and reliability of the power system.
[0064] Example 2, refer to Figure 1 As an embodiment of the present invention, based on the previous embodiment, a power fault diagnosis method based on large model retrieval enhancement is provided, including:
[0065] Step 1: Obtain the power fault problem input by the power maintenance personnel.
[0066] In practice, power maintenance personnel can submit fault information to the system through various input channels, including on-site operation terminals, mobile maintenance tablets, and industrial control computers in remote monitoring centers. The input from maintenance personnel can be natural language descriptions, such as "the transformer temperature suddenly rises when fully loaded" or "the switchgear trips frequently after closing," or structured inputs containing parameters, such as real-time data reports of current, voltage, and temperature. Upon receiving the input, the system uniformly encodes the text information and structured data and stores them in a processing queue to ensure that subsequent steps can be processed within the same semantic space.
[0067] Step 2: Preprocess the power failure problem. Preprocessing includes rewriting and decomposing the power failure problem to obtain subproblems, including the following steps A1-A2:
[0068] A1: Perform text normalization processing on the input power fault problem. The text normalization processing includes performing word segmentation and part-of-speech recognition on the problem statement and replacing non-standard terms with power professional terms.
[0069] A2: When the power failure problem contains multiple semantics, the power failure problem is split into multiple sub-problems based on semantic dependencies, and a retrieval input is generated for each sub-problem.
[0070] In this embodiment of the application, the text normalization process in step A1 includes the following steps A111-A115:
[0071] A111: Perform word segmentation and part-of-speech recognition on the input power fault problem "the high-voltage switch keeps tripping", and obtain the word sequence {high-voltage switch, keeps, tripping};
[0072] A112: The phrase "always tripping the circuit breaker" was identified as a colloquial expression and belongs to non-standard terminology.
[0073] A113: Input the non-standard term into the large language model, load the professional term mapping table of the power maintenance knowledge base, and output the corresponding standard term "frequent circuit breaker tripping";
[0074] A114: Reassemble the replaced result into "Frequent tripping of high-voltage switch circuit breaker";
[0075] A115: Input the standardized questions into the unified coding module and establish a correspondence with the structured operational data (such as current, voltage, and temperature) to ensure that subsequent searches can be performed in the same semantic space.
[0076] In an optional implementation, the text normalization process in step A1 includes the following steps A121-A125:
[0077] A121: Perform word segmentation on the input question "High-voltage switch keeps tripping" and obtain the word segmentation results;
[0078] A122: The pre-established power industry terminology lookup table is used for matching, and "always tripping" is identified as a non-standard term;
[0079] A123: According to the comparison table, replace "frequent tripping" with "circuit breaker tripping frequently";
[0080] A124: Perform a syntactic check on the replaced sentence to ensure that the sentence is semantically complete and without omissions;
[0081] A125: Input the issues found during the inspection into the subsequent search module.
[0082] Relying on a static terminology dictionary and rule table, normalization processing can be achieved in the deployment environment with low computing resources, making it suitable for application scenarios of this invention in edge devices or offline environments.
[0083] In another alternative implementation, the text normalization process in step A1 includes the following steps A131-A135:
[0084] A131: Perform word segmentation on the input question "The high-voltage switch keeps tripping" to obtain a word sequence;
[0085] A132: Call the word vector model trained on the corpus of the power field to calculate the semantic similarity between the word "always tripping" and the candidate power professional terms;
[0086] A133: If the similarity score exceeds 0.85, automatically select "frequent circuit breaker tripping" as the replacement result;
[0087] A134: Merge the replacement results with the original input to form a standardized problem input;
[0088] A135: Before outputting the normalization problem, add a similarity score as a confidence label to the replacement result so that subsequent steps can trigger manual correction when the similarity is insufficient.
[0089] Step 3: Perform vectorized retrieval in the power maintenance knowledge base for the sub-problem. The power maintenance knowledge base is composed of power fault-related documents that have been segmented, vectorized, and stored to obtain reference materials matching the sub-problem, including the following steps B1-B4:
[0090] B1: Divide power fault-related documents into document blocks according to preset multi-level delimiters, and add context information to each document block after block division;
[0091] B2: Vectorize the document block to obtain the question vector and document block vector corresponding to the sub-question;
[0092] B3: Based on the similarity between the question vector and the document block vector, a search is performed to determine the reference materials that match the sub-question;
[0093] B4: When updating the knowledge base, the newly generated document block vector is compared with the existing document block vector for similarity. If the preset update conditions are met, the new document block replaces the existing document block.
[0094] In this embodiment of the application, step B3, the similarity retrieval includes the following steps B311-B314:
[0095] In step B3, the similarity retrieval includes the following steps B311-B314:
[0096] B311: When power maintenance personnel input the sub-problem "the switchgear trips frequently after closing", the system first uses a vector encoder to generate a problem vector for the problem, and at the same time calls the document block vector formed by segmented documents in the knowledge base.
[0097] B312: Calculate the cosine similarity between the question vector and the vectors of each document block to obtain the relevance score between the sub-question and the knowledge base entry.
[0098] B313: Sort the cosine similarity scores and filter out candidate document blocks with scores higher than 0.9, such as document blocks containing "circuit breaker overcurrent protection action" and "bus current fluctuation".
[0099] B314: Extract the selected candidate document blocks and their adjacent context together to form complete candidate reference materials for further processing by the subsequent sorting module.
[0100] In an optional embodiment, step B3, the similarity retrieval includes the following steps B321-B324:
[0101] B321: In response to the sub-problem of "frequent tripping of switchgear" mentioned above, the system extracts a set of keywords, such as "switchgear", "tripping", "overcurrent" and "protection device", while generating the problem vector.
[0102] B322: The system calculates the cosine similarity score between the question vector and the document block vector respectively.
[0103] B323: In parallel, calculate the Jaccard similarity between the question keyword set and the document block keyword set to obtain the term matching score.
[0104] B324: Cosine similarity and Jaccard similarity are weighted and fused, for example, with a weight ratio of 0.7:0.3, to obtain a comprehensive similarity score. The final selected candidate document blocks are not only semantically relevant, but also highly consistent with the input question in terms of key terms in the power field.
[0105] In another alternative embodiment, step B3, the similarity retrieval includes the following steps B331-B334:
[0106] B331: For the sub-problem of "frequent tripping of switchgear", the system generates a problem vector and constructs a document block vector with context awareness. Each vector incorporates the semantic information of adjacent blocks during encoding in order to cover the implicit causal relationships described across paragraphs.
[0107] B332: The system calculates the cosine similarity between the question vector and the context-aware document block vector to obtain a context-enhanced relevance score.
[0108] B333: When sorting all candidate results, if consecutive document blocks are selected, they are merged into a larger reference unit. For example, the two paragraphs "Tripping Cause Analysis + Detection Method" are merged into one reference.
[0109] B334: The system uses these context-merged reference units as candidate reference data and passes them to the subsequent sorting stage to avoid the loss of fault mechanism information due to single-segment fragmentation.
[0110] Step 4: Perform a secondary ranking of the reference materials, and use a learned ranking model to refine the retrieval results for each sub-question, including the following steps C1-C3:
[0111] C1: Combine the subproblems with the corresponding candidate references to form a sorted input;
[0112] C2: The sorting input is provided to the sorting method based on the large language model, and the sorting method outputs a ranking result reflecting the relevance of the sub-problem to the candidate references according to the preset sorting prompts;
[0113] C3: Generate a refined sorted sequence based on the ranking results.
[0114] In step 4 of the implementation of this application, learning the ranking model includes the following steps C211-C214:
[0115] C211: Take the sub-problem "frequent tripping of switchgear after closing" as the query input, and concatenate it with the candidate reference materials to form a text pair, for example, [sub-problem: frequent tripping of switchgear] + [candidate reference paragraph].
[0116] C212: Input the concatenated text into the RankZephyr ranking method based on a large language model. This method infers the relevance of multiple candidate data through preset ranking hints.
[0117] C213: The sorting method outputs the relevance score for each candidate data, which reflects the degree to which the candidate data explains the problem of "frequent tripping of switchgear".
[0118] C214: Generate a refined sorting sequence based on the score results, placing data closely related to the tripping cause (such as "overcurrent protection action") in a higher position, while general data (such as "daily inspection of power equipment") is placed at the bottom.
[0119] In an optional embodiment, step 4, learning the ranking model, includes the following steps C221-C224:
[0120] C221: When splicing subproblems and candidate references, in addition to text information, metadata of candidate document blocks is also extracted, such as the equipment category (switch cabinet), document publication time, and continuity of context blocks.
[0121] C222: Use text vector similarity as the first feature, and device category matching degree and contextual continuity as the second feature.
[0122] C223: The learning ranking model is based on gradient boosting tree (GBDT) to train and infer the above multiple features, and outputs a comprehensive relevance score.
[0123] C224: Generate a finely ranked sequence based on the relevance score to ensure not only high semantic matching, but also reasonable equipment attributes and context that conform to the power maintenance logic.
[0124] In another alternative embodiment, step 4, learning the ranking model, includes the following steps C231-C234:
[0125] C231: Input the concatenated subproblems and candidate references into a Transformer-based neural network ranking model, which includes an encoding layer, an interaction layer, and an output layer.
[0126] C232: The encoding layer vectorizes the query and candidate data respectively; the interaction layer calculates the deep matching relationship between the two through an attention mechanism.
[0127] C233: The output layer normalizes the matching results and generates relevance scores for candidate references.
[0128] C234: The relevance score is used as the sorting criterion to generate a finely sorted sequence, and the parameters of the neural network can be continuously optimized through comparative learning.
[0129] Step 5: Merge and sort the results of the sub-problems, assign scores based on the reciprocal ranking and calculate the combined score, and remove reference materials with scores below a preset threshold to obtain the optimized reference set, including the following steps D1-D4:
[0130] D1: Summarize the fine sorting sequences corresponding to each subproblem into multiple sorted lists;
[0131] D2: Assign a reciprocal ranking score to each candidate reference in the sorting list, and introduce a preset constant term during the assignment to avoid the score being too high due to the list being too short;
[0132] D3: Weighted summation of the reciprocal scores of the same candidate references to form a combined score;
[0133] D4: Based on the combined scores, the candidate reference materials are merged and sorted, and after fusion and sorting, candidate reference materials with combined scores lower than a preset threshold are removed to obtain an optimized reference set.
[0134] Step 6: Input the optimized reference set and the power fault problem into the large language model to generate power fault diagnosis results and solutions, including the following steps E1-E4:
[0135] E1: The diagnostic results output by the large language model are processed into sentences to obtain multiple semantic segments;
[0136] E2: Vectorize the semantic fragments and vectorize the reference materials in the optimized reference set;
[0137] E3: Calculate the similarity between the semantic fragment vector and the reference data vector. The similarity calculation is based on a preset similarity measurement method.
[0138] E4: Generate the correspondence between semantic fragments and reference materials based on the similarity calculation results, and embed the correspondence into the diagnostic results to form a diagnostic result with source annotation.
[0139] In this embodiment of the application, step 6, the major language model, includes the following steps E11-E14:
[0140] E11: Combine highly relevant data from the optimized reference set (such as "switchgear tripping may be due to overcurrent protection action") with sub-problems entered by maintenance personnel into a unified input sequence.
[0141] E12: Input the input sequence into the large language model. The model, based on its built-in reasoning ability and combined with the contextual information of the reference set, performs step-by-step reasoning on the input question.
[0142] E13: The initial diagnostic results output by the large language model are processed into sentences, and the correspondence with the reference materials is embedded in each sentence, such as "possibly due to overcurrent protection action [Reference 1]".
[0143] E14: Integrate the diagnostic results after sentence segmentation to generate a complete diagnostic solution with source annotations, providing power maintenance personnel with a reference for the final solution path.
[0144] In an optional embodiment, step 6, the large language model, includes the following steps E21-E24:
[0145] E21: Group the optimization reference set according to the sub-problem dimension, and concatenate the data of each sub-problem with its input problem to form multiple sub-input sequences.
[0146] E22: The large language model processes each sub-input sequence separately and outputs partial diagnostic conclusions for each sub-problem.
[0147] E23: Merge multiple diagnostic conclusions using a logical fusion method (such as causal chain merging) to form an overall diagnostic path, such as "overcurrent protection action → circuit breaker tripping → frequent switchgear tripping".
[0148] E24: In the merged diagnostic results, the corresponding solution steps are automatically generated, such as "Check the overcurrent protection setting and detect the status of the circuit breaker contacts".
[0149] In another alternative embodiment, step 6, the large language model, includes the following steps E31-E34:
[0150] E31: When inputting optimization reference sets and problems, add specific prompts to the model, such as "Please generate actionable diagnostic steps based on maintenance knowledge base data".
[0151] E32: The large language model outputs structured diagnostic results based on prompts. The diagnostic results include three types of fields: "cause of failure", "verification method" and "solution".
[0152] E33: Compare the output structured content with the optimized reference set field by field to ensure that each field is supported by data.
[0153] E34: Output the comparison results as a diagnostic report with source annotations and step-by-step operation instructions, for example:
[0154] Cause of failure: [Overcurrent protection activated][Document 1];
[0155] Verification method: [Measure the circuit breaker current curve][Data 2];
[0156] Solution: [Adjust protection settings or replace circuit breaker] [Document 3].
[0157] Step 7: Determine the reasonableness of the power fault diagnosis results. If the reasonableness determination is passed, output the final power fault diagnosis results, including the following steps F1-F3:
[0158] F1: Vectorize the diagnostic results and perform semantic similarity calculation with the vector representation of the input power fault problem to determine whether the diagnostic results cover the semantic scope of the input problem;
[0159] F2: The diagnostic results are vectorized and compared with the vector representations of the reference materials in the optimized reference set to determine whether the diagnostic results are logically consistent with the reference materials.
[0160] F3: When the semantic similarity calculation and consistency comparison both meet the preset judgment conditions, the diagnostic result is output as the final power fault diagnosis result.
[0161] A large language model is used to detect and analyze power faults. By creating an intelligent agent, the reasoning ability of the large language model is fully utilized. At the same time, retrieval enhancement generation technology is used to provide additional reference materials for the large language model, which can make up for the lack of real-time data and the problem of illusion generation in the large language model. A two-level fine ranking mechanism is used to re-rank the retrieved reference materials, enhance the relevance of the retrieved materials, and improve the final answer effect.
[0162] Example 3, referring to Figure 1 As an embodiment of the present invention, based on the previous embodiment, a power fault diagnosis method based on large model retrieval enhancement is provided, including:
[0163] In this embodiment, by introducing the reAct intelligent agent mechanism, the entire power fault diagnosis process is made capable of dynamic adjustment and iterative optimization, thereby improving the accuracy and interpretability of the diagnosis results.
[0164] In step 2, during the preprocessing of power fault problems, in addition to performing text normalization (A1) and multi-semantic segmentation (A2) on the input problem, the reAct agent automatically determines whether repeated rewriting and segmentation are needed based on the complexity of the input problem during the "thinking" phase. For example, when the input problem is "abnormal transformer temperature causes frequent operation of protection devices," the system first performs word segmentation and part-of-speech recognition, replacing "frequent operation" with "repeated triggering of protection devices." Then, under semantic dependency analysis, the problem is split into two sub-problems: "abnormal transformer temperature" and "abnormal triggering of protection devices." The sub-problems are then uniformly encoded with structured operational data to ensure the accuracy of the retrieved input.
[0165] In step 3, when performing vectorized retrieval of sub-problems in the power maintenance knowledge base, power fault-related documents are sequentially divided into blocks using multi-level delimiters (B1), and contextual information is added after block division to enhance semantic continuity. The divided document blocks are vectorized using the BGE-M3 model to obtain problem vectors and document block vectors (B2). Subsequently, similarity retrieval is performed (B3), including calculating the cosine similarity between the problem vector and the document block vector, and weighted fusion using Jaccard similarity of the keyword set to improve matching accuracy. When cross-paragraph causal relationships are involved, context-enhanced document block vectors are introduced to avoid missing mechanisms due to information fragmentation. During the knowledge base update process (B4), newly generated document block vectors are compared with existing vectors. If the similarity is greater than 90% and the Jaccard similarity is greater than 0.7, the system replaces the old document block with the new one, and the knowledge base is dynamically updated through a scheduled task.
[0166] In step 4, during the secondary sorting of the reference materials, the system concatenates the sub-problems and candidate reference materials into a sorting input (C1), which is then input into a sorting method based on a large language model (C2), such as the RankZephyr model. This model infers the relevance of the candidate reference materials based on preset prompts and outputs a relevance score. The sorting results are then refined to form a sorting sequence (C3), prioritizing materials that explain the fault mechanism. In step 5, when the refined sorting results of the sub-problems are merged, the system aggregates multiple sorting sequences (D1), assigns a reciprocal ranking score to the candidate reference materials and introduces a constant term to avoid bias from an excessively short list (D2), weighted sums of scores for identical reference materials to form a combined score (D3), and removes reference materials with scores below 0.9 after merging the sorting, resulting in an optimized reference set (D4).
[0167] In step 6, when the optimized reference set and the power fault problem are input into the large language model, the system concatenates the optimized reference set and the input problem to form an input sequence (E1). The large language model generates an initial diagnostic result based on its reasoning ability. This result is processed into sentences (E1), and its similarity to the vectors of the reference materials is calculated through vectorization (E2, E3). The system establishes the correspondence between semantic segments and reference materials based on the calculation results and embeds it into the diagnostic result, forming an output with source annotation (E4). In addition, the large language model can output structured diagnostic content under prompt-driven conditions, including fields such as "fault cause," "verification method," and "solution," to generate an actionable diagnostic plan.
[0168] In step 7, when determining the reasonableness of the power fault diagnosis results, the system compares the semantic similarity between the diagnosis results and the input problem to ensure that the diagnosis content covers the input problem (F1); then, it compares the consistency between the diagnosis results and the optimization reference set to ensure logical reasonableness (F2). When both judgment conditions are met, the system outputs the final diagnosis result (F3); if not, the reAct agent triggers a rollback mechanism, re-entering the problem preprocessing or retrieval stage until a result that meets the conditions is output.
[0169] Specifically, dividing power fault-related documents into blocks includes the following steps:
[0170] Provide a list of delimiters, such as ["\n\n","\n","",""] (paragraph -> line -> word -> character).
[0171] First, try splitting the text using the first delimiter (\n\n).
[0172] If the resulting blocks are still too large, then use the next delimiter (\n) to further subdivide these "large blocks".
[0173] This process is repeated recursively until all blocks meet the size requirement.
[0174] The context text of each block is slid forward and backward, centered on the previous block, and stored as context information.
[0175] The BGE-M3 vector model is used to vectorize the power problem. This model is suitable for multilingual text and can solve problems involving mixed Chinese and English. The knowledge base contains at least the power problem, the solution text, and the power problem vector.
[0176] After constructing the vector database, it needs to be maintained and updated. New problems are added, and existing problems are updated. New data is vectorized and compared with data in the vector database using vector retrieval. If the vector similarity is greater than 90% and the Jaccard similarity is greater than 0.7, the new data replaces the old data. New data is added to the vector database daily via a scheduled task following the above method.
[0177] Leveraging the capabilities of the large model, user-submitted power maintenance questions are rewritten to more closely resemble the format of power maintenance questions in the knowledge base. Colloquial expressions such as "please ask" and "may I ask for your advice" are removed, and non-technical terms are replaced with technical terms to better match the content in the vector library, thereby improving the accuracy of vector retrieval. Complex questions are broken down into multiple sub-questions, refining the complex issues. Each sub-question is retrieved separately to address the user's questions from various perspectives. Finally, the retrieved content from all sub-questions is aggregated to construct the final response.
[0178] The RankZephyr model is used to perform a secondary ranking of the references for each subproblem, ensuring that references relevant to the subproblem rank higher. A hint is provided, and the RankZephyr model is invoked.
[0179] Hint: You are a smart assistant called Document Similarity Ranking, which ranks paragraphs based on their relevance to the query. I will provide you with {num} paragraphs, each represented by a numeric identifier []. Rank the paragraphs according to their relevance to the search query: {query}.
[0180] {Paragraph 1};
[0181] [2]{Paragraph 2}...;
[0182] [{num}]{paragraph{num}};
[0183] Search query: {query}.
[0184] Rank the {num} paragraphs above based on their relevance to the search query. All paragraphs should be included and listed in descending order of relevance using an identifier. The output format should be []>[], for example, [4]>[2]. Simply reply with the ranking results, without any further explanation or commentary.
[0185] Similar to the above prompt, invoke the RankZephyr model to generate new ranking results. The RankZephyr model is specifically optimized for zero-sample list re-ranking tasks, providing superior re-ranking performance compared to large proprietary models.
[0186] The references returned from all sub-problems are merged and sorted, and references with combined scores below a threshold are removed to avoid the input model having excessively long references, which could affect the model's accuracy.
[0187] Specifically, it includes:
[0188] (1): Return the search results for each sub-question to generate a list. The elements in the list are arranged in the order of the processed results to obtain a ranking list;
[0189] (2): Assign a reciprocal rank score to each search result in the ranking list:
[0190]
[0191] Where rank is the position of the search result in the ranking list, and k is a constant term to avoid elements in the ranking list with fewer search results having too high a score. This patent sets the value of k to 5.
[0192] Merge all ranking lists, add up the scores of identical search results, and obtain a new ranking.
[0193] The obtained scores are summed, and reference materials with scores below 0.9 (while also considering similarity scores and inverted index fusion scores) are removed as the final response reference materials. The above method can effectively combine reference materials from multiple sub-problems, avoiding the transmission of a large amount of low-relevance data to the large model, which would affect the final output results.
[0194] Attribution generation involves segmenting the model-generated results into sentences, vectorizing the segmented sentences, vectorizing the returned reference materials, calculating the similarity between the reference materials and the resulting sentence segments, and determining the source of the generated results.
[0195] Compared to traditional machine learning models and deep learning models (RNN, LSTM), the large language model applied to power fault diagnosis significantly improves the fault diagnosis rate by leveraging its own reasoning capabilities and relevant reference materials (RNN / LSTM rely excessively on sample features and require a large number of samples for training). The generated solutions are in human-readable natural language, improving work efficiency. The reAct intelligent agent scheme fully utilizes the reasoning capabilities of the large model. Furthermore, the content retrieved from the vectors undergoes two sorting processes, including multi-sub-problem data fusion and sorting, resulting in cleaner content fed to the large model and reducing the occurrence of illusions.
[0196] Example 4 is an embodiment of the present invention. This embodiment provides a power fault diagnosis system based on large model retrieval enhancement, including: a problem acquisition module, used to acquire power fault problems input by power maintenance personnel;
[0197] The preprocessing module is used to rewrite and break down the power failure problem into sub-problems;
[0198] The retrieval module is used to perform vectorized retrieval of the sub-problem in the power maintenance knowledge base, which is composed of power fault-related documents that are segmented, vectorized and stored to obtain reference materials that match the sub-problem.
[0199] The sorting module is used to perform a secondary sorting on the reference materials, and to fine-tune the retrieval results of the sub-questions using a learned sorting model.
[0200] The fusion module is used to merge and sort the results of the fine ranking of sub-problems, assign scores based on the reciprocal ranking and calculate the combined scores, remove reference materials with scores below a preset threshold, and generate an optimization reference set.
[0201] The generation module is used to input the optimized reference set and the power fault problem into the large language model to generate power fault diagnosis results and solutions.
[0202] The determination module is used to determine the reasonableness of the power fault diagnosis results and output the final power fault diagnosis result when the determination is successful.
[0203] This embodiment also provides an electronic device applicable to a power fault diagnosis method based on large model retrieval enhancement, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the power fault diagnosis method based on large model retrieval enhancement proposed in the above embodiment.
[0204] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements a power fault diagnosis method based on large model retrieval enhancement as proposed in the above embodiments.
[0205] The storage medium proposed in this embodiment belongs to the same inventive concept as the power fault diagnosis method based on large model retrieval enhancement proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0206] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0207] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A power fault diagnosis method based on large model retrieval enhancement, characterized in that: include, Obtain power fault problems input by power maintenance personnel; The power failure problem is preprocessed, which includes rewriting and decomposing the power failure problem into subproblems; Vectorized retrieval is performed on the power maintenance knowledge base for sub-problems. The power maintenance knowledge base is composed of power fault-related documents that are segmented, vectorized, and stored to obtain reference materials that match the sub-problems. A secondary sorting is performed on the reference materials, and a learned ranking model is used to refine the retrieval results for each sub-question. The results of the fine ranking of the sub-problems are merged and sorted, scores are assigned based on the reciprocal ranking and combined scores are calculated, and reference materials with scores below a preset threshold are removed to obtain an optimized reference set; The optimized reference set and power fault problems are input into a large language model to generate power fault diagnosis results and solutions. The reasonableness of the power fault diagnosis results is determined, and the final power fault diagnosis result is output when the reasonableness determination is passed.
2. The power fault diagnosis method based on large model retrieval enhancement as described in claim 1, characterized in that: The process of rewriting and splitting the problem includes performing text normalization processing on the input power fault problem. The text normalization processing includes performing word segmentation and part-of-speech recognition on the problem statement and replacing non-standard terms with power professional terms. When the power failure problem contains multiple semantics, the power failure problem is split into multiple sub-problems based on semantic dependencies, and retrieval input is generated for each sub-problem.
3. The power fault diagnosis method based on large model retrieval enhancement as described in claim 2, characterized in that: The execution of vectorized retrieval includes dividing power fault-related documents into document blocks according to preset multi-level delimiters, and adding context information to each document block after block division; The document block is vectorized to obtain the question vector and document block vector corresponding to the sub-question; The similarity between the question vector and the document block vector is used to retrieve reference materials that match the sub-question; When updating the knowledge base, the newly generated document block vector is compared with the existing document block vector for similarity. If the preset update conditions are met, the new document block replaces the existing document block.
4. The power fault diagnosis method based on large model retrieval enhancement as described in claim 3, characterized in that: The step of using a learning ranking model to fine-rank the retrieval results of sub-questions includes combining sub-questions with corresponding candidate references to form a ranking input. The sorting input is provided to a sorting method based on a large language model, and the sorting method outputs a ranking result that reflects the relevance between the sub-problem and the candidate references according to a preset sorting prompt. A refined sorted sequence is generated based on the ranking results.
5. The power fault diagnosis method based on large model retrieval enhancement as described in claim 4, characterized in that: The process of merging and sorting the fine-ranking results of the sub-problems includes summarizing the fine-ranking sequences corresponding to each sub-problem into multiple sorting lists. Assign a reciprocal ranking score to each candidate reference in the sorting list, and introduce a preset constant term during the assignment to avoid the score being too high due to the list being too short; The reciprocal scores of the same candidate references are weighted and summed to form a combined score; Candidate reference materials are fused and sorted according to the combined scores, and candidate reference materials with combined scores lower than a preset threshold are removed after fusion and sorting to obtain an optimized reference set.
6. The power fault diagnosis method based on large model retrieval enhancement as described in claim 5, characterized in that: The generation of power fault diagnosis results and solutions includes segmenting the diagnosis results output by the large language model into sentences to obtain multiple semantic fragments; The semantic fragments are vectorized, and the reference materials in the optimized reference set are also vectorized. The similarity between the semantic fragment vector and the reference data vector is calculated based on a preset similarity measurement method. Based on the similarity calculation results, a correspondence between semantic fragments and reference materials is generated, and the correspondence is embedded into the diagnostic results to form a diagnostic result with source annotation.
7. The power fault diagnosis method based on large model retrieval enhancement as described in claim 6, characterized in that: The rationality determination of the power fault diagnosis results includes vectorizing the diagnosis results and calculating the semantic similarity with the vector representation of the input power fault problem to determine whether the diagnosis results cover the semantic range of the input problem. The diagnostic results are vectorized and compared with the vector representations of the reference materials in the optimized reference set to determine whether the diagnostic results are logically consistent with the reference materials. When both the semantic similarity calculation and consistency comparison meet the preset judgment conditions, the diagnostic result is output as the final power fault diagnosis result.
8. A power fault diagnosis system based on large model retrieval enhancement, employing the power fault diagnosis method based on large model retrieval enhancement as described in any one of claims 1 to 7, characterized in that, include: The problem acquisition module is used to acquire power fault problems input by power maintenance personnel; The preprocessing module is used to rewrite and break down the power failure problem into sub-problems; The retrieval module is used to perform vectorized retrieval of the sub-problem in the power maintenance knowledge base, which is composed of power fault-related documents that are segmented, vectorized and stored to obtain reference materials that match the sub-problem. The sorting module is used to perform a secondary sorting on the reference materials, and to fine-tune the retrieval results of the sub-questions using a learned sorting model. The fusion module is used to merge and sort the results of the fine ranking of sub-problems, assign scores based on the reciprocal ranking and calculate the combined scores, remove reference materials with scores below a preset threshold, and generate an optimization reference set. The generation module is used to input the optimized reference set and the power fault problem into the large language model to generate power fault diagnosis results and solutions. The determination module is used to determine the reasonableness of the power fault diagnosis results and output the final power fault diagnosis result when the determination is successful.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the power fault diagnosis method based on large model retrieval enhancement as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the power fault diagnosis method based on large model retrieval enhancement as described in any one of claims 1 to 7.
