A method for diagnosing fault mechanism of hydroelectric generating set based on knowledge graph structure enhancement
By constructing a fault mechanism diagnosis method based on knowledge graphs, the problems of inconsistent mechanism logic, poor interpretability, and insufficient robustness in the fault diagnosis of hydropower units are solved, and a fault diagnosis with high accuracy and interpretability is achieved, which is applicable to the fault diagnosis of hydropower units.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA YANGTZE POWER
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-05
AI Technical Summary
Existing fault diagnosis methods for hydropower units ignore the inherent logical connections of fault mechanisms, resulting in inconsistent diagnostic results, lack of interpretability, and poor robustness. In particular, performance deteriorates when key information is missing.
A fault mechanism diagnosis method based on knowledge graph is constructed. By modeling the mechanism knowledge ontology and organizing triples, semantic similarity is calculated by combining the BM25 model, the structure consistency score is calculated by GraphSim, and a large language model is introduced to generate natural language explanation.
It achieves consistent diagnostic mechanism, improves Top-1 accuracy and average reciprocal ranking, enhances the interpretability and robustness of diagnosis, and ensures stable operation even under conditions of missing information.
Smart Images

Figure CN122153074A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial internet and intelligent operation and maintenance technology of hydroelectric equipment, and in particular relates to a method for diagnosing fault mechanisms of hydroelectric units based on knowledge graph structure enhancement. Background Technology
[0002] Hydropower units have complex structures and operate under variable conditions, and their mechanical failures often manifest as problems involving multiple components and coupled phenomena. Current mainstream fault diagnosis methods mainly rely on various monitoring data, using feature analysis or data-driven models to achieve condition identification and fault diagnosis. However, in engineering practice, some fault mechanisms cannot be fully reflected solely from numerical signals, and a large amount of key information related to fault causes and handling still exists in textual form, scattered in operating procedures, maintenance records, and equipment manuals.
[0003] There is relatively little research on diagnostic texts related to the operation and maintenance of electromechanical equipment in hydropower units. Existing text retrieval methods based on keywords or rules mainly rely on surface-level term similarity, which makes it difficult to characterize the intrinsic mechanistic relationships between equipment, phenomena, causes, and remedial measures. This can easily lead to inconsistent diagnostic results or a lack of explanatory basis. Existing technologies have the following defects and shortcomings: 1. Ignoring the underlying mechanism: Existing text retrieval methods only focus on the surface similarity of terms, which cannot guarantee the consistency of the recall results along the complete mechanism chain of "device-phenomenon-cause-treatment", which may lead to logically invalid diagnostic results.
[0004] 2. Lack of interpretability: The diagnostic process is a black box operation, which cannot provide a clear reasoning path for operation and maintenance personnel, making it difficult to gain trust and hindering decision support.
[0005] 3. Poor robustness: When key fields are missing in the fault description, the performance of traditional methods will drop significantly and they will not work stably.
[0006] Therefore, based on the aforementioned widespread technical problems, it is necessary to propose a fault mechanism diagnosis method for hydropower units based on knowledge graph structure enhancement to solve these problems. Summary of the Invention
[0007] The technical problem to be solved by this invention is to provide a fault mechanism diagnosis method for hydropower units based on knowledge graph structure enhancement. It aims to solve the problems of inconsistent diagnosis results, lack of interpretability, and poor robustness under conditions of missing information caused by ignoring the inherent logical relationship of fault mechanisms in the prior art. The invention provides a fault diagnosis method for hydropower units that can achieve consistent mechanism diagnosis, has high interpretability, and is robust.
[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for diagnosing fault mechanisms in hydropower units based on knowledge graph structure enhancement includes the following steps: S1. Construct a knowledge graph of fault mechanisms for hydropower units, including mechanism knowledge ontology modeling and mechanism knowledge generation. The mechanism knowledge graph includes multi-dimensional semantic units of equipment, faults, phenomena, causes and treatment measures. The mechanism knowledge ontology is organized in the form of triples, and expresses the evolution link of typical unit faults through entities, relations and semantic constraints. S2, design a retrieval framework based on knowledge graph structure enhancement, including: Obtain the text describing the fault to be diagnosed; Based on the fault description text, the BM25 model is used to calculate semantic similarity, and multiple candidate fault cases are recalled from the knowledge graph of hydropower unit fault mechanism to form a candidate set. Calculate the structural consistency score between each candidate fault case in the candidate set and the fault description text in four dimensions: equipment, phenomenon, cause, and handling measures. The candidate set is rearranged according to the structural consistency score, and the candidate fault case with the highest score is output as the final diagnosis result. S3 introduces a locally deployed large language model, which generates a natural language explanation for the final diagnostic results based on the established mechanistic links.
[0009] Preferably, in step S1, the mechanism knowledge ontology is organized in the form of triples, and the evolutionary link of typical unit faults is expressed through entities, relations, and semantic constraints as follows: ; In the formula, 't' and 't' represent the head entity and tail entity, respectively. Represents a set of entities. Represents a set of relations. Semantic relationships reflecting fault mechanisms. By organically combining a large number of triples, a relational network reflecting the global structure of domain knowledge can be constructed.
[0010] Preferably, in step S1, the generation of mechanism knowledge includes: Based on five dimensions—equipment, fault, phenomenon, cause, and handling measures—historical maintenance records are organized into fields. According to ontology constraints, unstructured text is transformed into triples with the structure (entity 1, relation, entity 2) and stored in graph databases such as Neo4j.
[0011] Preferably, in step S2, when obtaining the description text of the fault to be diagnosed, the description of the new fault is spliced into text using a method generated by mechanism knowledge.
[0012] Preferably, in step S2, when using the BM25 model to calculate semantic similarity and recalling the Top-N candidate faults from the knowledge graph, the BM25 scoring function is as follows: ; In the formula, For terms In the document Frequency of occurrence in For document length, The average length of the document collection. and Here is the length normalization parameter; the inverse document frequency of a term is given by the following formula: ; In the formula, Total number of documents For included terms The number of documents.
[0013] BM25 effectively measures the textual similarity between query fault descriptions and historical fault cases by comprehensively modeling term frequency and inverse document frequency, providing a high-recall candidate set for structural reordering.
[0014] Preferably, in step S2, when calculating the structural consistency score between each candidate fault case in the candidate set and the fault description text across the four dimensions of equipment, phenomenon, cause, and handling measures, GraphSim is used for calculation. The specific method is as follows: Define a four-dimensional consistency score using the following lightweight rules: 1 point is awarded for complete entity consistency, 0.8 points are awarded for inclusion relationships, and 0 points are awarded for all other cases; the final score is the average of the scores in the four dimensions. The structural similarity between the query sample and the candidate fault is measured from four dimensions: equipment, phenomenon, cause, and handling measures. Let the query sample With candidate samples The structured fields are respectively and The four-dimensional consistency structure similarity is defined as: ; In the formula, the scores for each dimension are... Calculated by soft-equal matching rules; the soft-equal mechanism assigns different consistency scores based on the containment relationship or semantic similarity between entities.
[0015] Preferably, in step S3, a locally deployed large language model is introduced, and a natural language explanation is generated for the final diagnostic result based on the established mechanistic links, including the following steps: After completing the structure-enhanced retrieval and mechanism-consistent rearrangement, a large language model is introduced as a diagnostic interaction module to serve as the interface for interpreting and interacting with the diagnostic results. The diagnostic interaction module is configured to execute the following process: Using the Top-1 fault mechanism chain returned by GraphSim as input, it organizes and explains the identified equipment, phenomena, causes and handling measures in natural language, without participating in the fault retrieval, similarity calculation or ranking decision process.
[0016] This approach provides maintenance personnel with a more intuitive and easy-to-understand explanation of the mechanism and interactive query capabilities without compromising the objectivity of the diagnostic results.
[0017] Preferably, a knowledge graph-based enhanced hydropower unit fault mechanism diagnosis system is provided to implement the knowledge graph-based enhanced hydropower unit fault mechanism diagnosis method; the system includes: The knowledge graph construction module is used to build and store the knowledge graph of hydropower unit failure mechanism. The knowledge graph is organized in the form of triples and covers the failure mechanism link with at least the dimensions of equipment, failure, phenomenon, cause and treatment measures. The semantic recall module is used to obtain the description text of the fault to be diagnosed, and to use a semantic retrieval model to recall multiple candidate fault cases from the knowledge graph to form a candidate set. The structural rearrangement module is used to calculate the structural consistency score between each candidate fault case and the fault description text in the dimensions of equipment, phenomenon, cause and handling measures for each candidate fault case in the candidate set, and rearrange the candidate set according to the score, and output the candidate fault case with the highest score as the final diagnosis result. The diagnostic interaction module introduces a large language model to serve as the interface for interpreting and interacting with diagnostic results. It takes the Top-1 fault mechanism link returned by the structure rearrangement module as input and organizes and explains the identified equipment, phenomena, causes and treatment measures in natural language.
[0018] Preferably, a computer device includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the aforementioned knowledge graph-based hydropower unit fault mechanism diagnosis method.
[0019] Preferably, a computer-readable storage medium stores computer instructions that cause a computer to execute the aforementioned knowledge graph-based hydropower unit fault mechanism diagnosis method.
[0020] The beneficial effects of this invention are as follows: 1. By introducing GraphSim, this invention forces candidate results to remain consistent across the complete mechanistic chain, significantly improving Top-1 accuracy and average reciprocal ranking (MRR). Experimental data show a significant performance improvement.
[0021] 2. The knowledge graph of this invention is itself an interpretable mechanism link. Combined with the explanation of the large language model, it makes the diagnostic process transparent and facilitates the understanding and adoption of maintenance personnel.
[0022] 3. Even when key fields are missing, the reordering mechanism based on structural consistency can still maintain stable performance, effectively making up for the shortcomings of text retrieval. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the flowchart of the present invention; Figure 2 This is a schematic diagram of the overall structure of the knowledge graph in an embodiment of the present invention; Figure 3 This is a typical fault mechanism sub-diagram in an embodiment of the present invention; Figure 4 This is a schematic diagram of the two-stage retrieval implementation process in an embodiment of the present invention; Figure 5 This is a schematic diagram of the local large model fault mechanism diagnosis interaction based on knowledge graph constraints in an embodiment of the present invention; Figure 6 This is a comparative diagram of the fault diagnosis hit rates Hit@1, Hit@3, and Hit@5 of different methods in embodiments of the present invention. Figure 7 This is a schematic diagram comparing the mean reciprocal ranking (MRR) of different methods in embodiments of the present invention; Figure 8 This is a schematic diagram comparing the average response times of different methods in embodiments of the present invention; Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0024] Example 1: like Figure 1 As shown, a method for diagnosing fault mechanisms in hydropower units based on knowledge graph structure enhancement includes the following steps: S1. Construct a knowledge graph of fault mechanisms for hydropower units, including mechanism knowledge ontology modeling and mechanism knowledge generation. The mechanism knowledge graph includes multi-dimensional semantic units of equipment, faults, phenomena, causes and treatment measures. The mechanism knowledge ontology is organized in the form of triples, and expresses the evolution link of typical unit faults through entities, relations and semantic constraints. S2, design a retrieval framework based on knowledge graph structure enhancement, including: Obtain the text describing the fault to be diagnosed; Based on the fault description text, the BM25 model is used to calculate semantic similarity, and multiple candidate fault cases are recalled from the knowledge graph of hydropower unit fault mechanism to form a candidate set. Calculate the structural consistency score between each candidate fault case in the candidate set and the fault description text in four dimensions: equipment, phenomenon, cause, and handling measures. The candidate set is rearranged according to the structural consistency score, and the candidate fault case with the highest score is output as the final diagnosis result. S3 introduces a locally deployed large language model, which generates a natural language explanation for the final diagnostic results based on the established mechanistic links.
[0025] like Figure 2 The diagram shows the overall structure of the knowledge graph of hydropower unit fault mechanisms, illustrating various entity nodes and their complex interactions. In step S1, the mechanism knowledge ontology is organized in the form of triples, expressing the evolutionary link of typical unit faults through entities, relationships, and semantic constraints as follows: ; In the formula, 't' and 't' represent the head entity and tail entity, respectively. Represents a set of entities. Represents a set of relations. Semantic relationships reflecting fault mechanisms. By organically combining a large number of triples, a relational network reflecting the global structure of domain knowledge can be constructed.
[0026] like Figure 3 The diagram shown is a mechanism sub-diagram of a typical fault in a speed control system, clearly presenting the equipment to which the fault belongs, the operating phenomena, the cause mechanism, and the corresponding maintenance measures.
[0027] Preferably, in step S1, the generation of mechanism knowledge includes: Based on five dimensions—equipment, fault, phenomenon, cause, and handling measures—historical maintenance records are organized into fields. According to ontology constraints, unstructured text is transformed into triples with the structure (entity 1, relation, entity 2) and stored in graph databases such as Neo4j.
[0028] Preferably, in step S2, when obtaining the description text of the fault to be diagnosed, the description of the new fault is spliced into text using a method generated by mechanism knowledge.
[0029] Preferably, in step S2, when using the BM25 model to calculate semantic similarity and recalling the Top-N candidate faults from the knowledge graph, the BM25 scoring function is as follows: ; In the formula, For terms In the document Frequency of occurrence in For document length, The average length of the document collection. and Here is the length normalization parameter; the inverse document frequency of a term is given by the following formula: ; In the formula, Total number of documents For included terms The number of documents.
[0030] BM25 effectively measures the textual similarity between query fault descriptions and historical fault cases by comprehensively modeling term frequency and inverse document frequency, providing a high-recall candidate set for structural reordering.
[0031] like Figure 4 As shown, in step S2, when calculating the structural consistency score between each candidate fault case and the fault description text in the candidate set across the four dimensions of equipment, phenomenon, cause, and handling measures, GraphSim is used for calculation. The specific method is as follows: Define a four-dimensional consistency score using the following lightweight rules: 1 point is awarded for complete entity consistency, 0.8 points are awarded for inclusion relationships, and 0 points are awarded for all other cases; the final score is the average of the scores in the four dimensions. The structural similarity between the query sample and the candidate fault is measured from four dimensions: equipment, phenomenon, cause, and handling measures. Let the query sample With candidate samples The structured fields are respectively and The four-dimensional consistency structure similarity is defined as: ; In the formula, the scores for each dimension are... Calculated by soft-equal matching rules; the soft-equal mechanism assigns different consistency scores based on the containment relationship or semantic similarity between entities.
[0032] like Figure 5 As shown, in step S3, a locally deployed large language model is introduced, and a natural language explanation is generated for the final diagnostic result based on the established mechanistic links. This includes the following steps: After completing the structure-enhanced retrieval and mechanism-consistent rearrangement, a large language model is introduced as a diagnostic interaction module to serve as the interface for interpreting and interacting with the diagnostic results. The diagnostic interaction module is configured to execute the following process: Using the Top-1 fault mechanism chain returned by GraphSim as input, it organizes and explains the identified equipment, phenomena, causes and handling measures in natural language, without participating in the fault retrieval, similarity calculation or ranking decision process.
[0033] This approach provides maintenance personnel with a more intuitive and easy-to-understand explanation of the mechanism and interactive query capabilities without compromising the objectivity of the diagnostic results.
[0034] Preferably, a knowledge graph-based enhanced hydropower unit fault mechanism diagnosis system is provided to implement the knowledge graph-based enhanced hydropower unit fault mechanism diagnosis method; the system includes: The knowledge graph construction module is used to build and store the knowledge graph of hydropower unit failure mechanism. The knowledge graph is organized in the form of triples and covers the failure mechanism link with at least the dimensions of equipment, failure, phenomenon, cause and treatment measures. The semantic recall module is used to obtain the description text of the fault to be diagnosed, and to use a semantic retrieval model to recall multiple candidate fault cases from the knowledge graph to form a candidate set. The structural rearrangement module is used to calculate the structural consistency score between each candidate fault case and the fault description text in the dimensions of equipment, phenomenon, cause and handling measures for each candidate fault case in the candidate set, and rearrange the candidate set according to the score, and output the candidate fault case with the highest score as the final diagnosis result. The diagnostic interaction module introduces a large language model to serve as the interface for interpreting and interacting with diagnostic results. It takes the Top-1 fault mechanism link returned by the structure rearrangement module as input and organizes and explains the identified equipment, phenomena, causes and treatment measures in natural language.
[0035] Preferably, a computer device includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the aforementioned knowledge graph-based hydropower unit fault mechanism diagnosis method.
[0036] Preferably, a computer-readable storage medium stores computer instructions that cause a computer to execute the aforementioned knowledge graph-based hydropower unit fault mechanism diagnosis method.
[0037] Example 2: This embodiment provides an example of applying this method to the fault mechanism diagnosis of a hydropower station, including the following process: Data preparation: 80 maintenance records of typical faults at a hydropower station were collected, cleaned, deduplicated, and processed into fields.
[0038] Knowledge graph construction: Using Python scripts, triples are generated based on field-based results and ontology models, and then imported into the Neo4j graph database.
[0039] System Implementation: A diagnostic system was developed. In the first stage, BM25 (based on jieba word segmentation) was used to recall the Top-10 candidates. In the second stage, four-dimensional information was extracted from the candidates, GraphSim scores were calculated, and the candidates were sorted by score.
[0040] Experimental validation: On the same dataset, our method was compared with baseline methods such as BM25 and TF-IDF, and the metrics such as Hit@1, Hit@3, Hit@5 and MRR were evaluated. The results show that our method has the best performance.
[0041] Interpretation of results: Based on the final diagnostic results, the locally deployed Qwen-7B large language model is invoked to generate a natural language explanation containing the "device-phenomenon-cause-treatment" chain.
[0042] The specific implementation process is as follows: 1. Application Scenarios and Data Preparation: Power station overview: A large hydropower station is equipped with five 700MW mixed-flow turbine generator units, with the speed regulation system being its core control component.
[0043] Data source: The power station collected maintenance records, defect reports and operation logs of the speed control system over the past 5 years (2020-2024), and obtained a total of 150 original text records.
[0044] Data cleaning and preparation: After removing 20 duplicate or invalid records, 130 valid records remain.
[0045] Structured labeling is performed using the five-dimensional fields of "equipment-fault-phenomenon-cause-handling".
[0046] The system constructs ternaries (e.g., <mechanical cabinet, occurrence, pulling>; <pulling, phenomenon is, relay swing>; <pulling, cause is, main pressure regulating valve jamming>; <main pressure regulating valve jamming, handling measures, cleaning valve core>), ultimately forming a knowledge graph containing 130 fault cases, more than 500 entities, and more than 1,500 relationships, which is then stored in the Neo4j database.
[0047] Test set construction: 30 records are randomly selected from 130 records as the test query set, and the remaining 100 records are used as the basic library of the knowledge graph, i.e., the retrieval source.
[0048] 2. Comparative experimental setup: Comparison method: Method A (this invention): BM25 recall (Top-10) + GraphSim structure rearrangement + local Qwen-7B interpretation generation.
[0049] Method B (Baseline 1): Pure BM25 search, directly returns Top-1 results.
[0050] Method C (baseline 2): Pure TF-IDF retrieval, directly returning Top-1 results.
[0051] Method D (ablation control): After BM25 recall, GraphSim rearrangement is not performed; instead, the results are randomly sorted and returned to Top-1 (to verify the necessity of the rearrangement module).
[0052] Evaluation indicators: Hit@k: The proportion of correct fault cases hit in the first k results (k=1,3,5).
[0053] MRR (Mean Reciprocal Rank): The average of the reciprocals of the correct result's position in the sorted list, measuring the quality of the sort.
[0054] 3. The experimental results are shown in Table 1 below: Table 1: Comparative experimental data;
[0055] As can be seen from Table 1 above, the method of this invention comprehensively surpasses the existing technology in key indicators; Figures 6-8 As can be seen, firstly, in terms of diagnostic accuracy, this invention achieves an accuracy of 86.7% Hit@1, which is 20% and 26.7% higher than pure BM25 and pure TF-IDF, respectively. This indicates that traditional methods that rely solely on term matching are prone to recalling cases that appear similar but do not have a valid mechanism. In contrast, this invention introduces the "device-phenomenon-cause-treatment" four-dimensional structural consistency rearrangement GraphSim, which forces the diagnostic results to be logically self-consistent on the complete fault mechanism chain, thereby significantly improving the probability of hitting the correct fault on the first attempt.
[0056] Secondly, in terms of sorting quality, the MRR value of this invention is as high as 0.912, far superior to other methods. In particular, the comparison with method D shows that the GraphSim reordering module is the key to improving the sorting effect, successfully promoting correct fault cases from the back of the candidate list to the front.
[0057] Although the average response time of this invention is slightly higher than that of pure text retrieval methods due to the addition of graph database queries and structural similarity calculations, it is still within the tolerance range of second-level response in industrial settings. More importantly, this method has strong robustness: even if the "reason" or "disposal" fields are missing in the test query, logically valid candidates can still be found based on the existing "equipment" and "phenomenon" through structural constraints, while the performance of traditional methods would drop sharply in this case.
[0058] In summary, this invention significantly improves the accuracy and interpretability of diagnosis while ensuring practical efficiency, and solves the long-standing pain point of missing mechanistic logic in the industry, demonstrating significant technical advantages.
[0059] Example 3: This invention also provides a computer device, such as... Figure 9 The diagram shown is a structural schematic of a computer device provided in an optional embodiment of the present invention. Figure 9 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory for displaying graphical information of a GUI on external input / output devices, such as display devices coupled to the interfaces. In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations, for example, as a server array, a group of blade servers, or a multiprocessor system. Figure 9 Take a processor 10 as an example.
[0060] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0061] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0062] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0063] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0064] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0065] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
Claims
1. A method for diagnosing fault mechanisms in hydropower units based on knowledge graph structure enhancement, characterized in that, Includes the following steps: S1. Construct a knowledge graph of fault mechanisms for hydropower units, including mechanism knowledge ontology modeling and mechanism knowledge generation. The mechanism knowledge graph includes multi-dimensional semantic units of equipment, faults, phenomena, causes and treatment measures. The mechanism knowledge ontology is organized in the form of triples, and expresses the evolution link of typical unit faults through entities, relations and semantic constraints. S2, design a retrieval framework based on knowledge graph structure enhancement, including: Obtain the text describing the fault to be diagnosed; Based on the fault description text, the BM25 model is used to calculate semantic similarity, and multiple candidate fault cases are recalled from the knowledge graph of hydropower unit fault mechanism to form a candidate set. Calculate the structural consistency score between each candidate fault case in the candidate set and the fault description text in four dimensions: equipment, phenomenon, cause, and handling measures. The candidate set is rearranged according to the structural consistency score, and the candidate fault case with the highest score is output as the final diagnosis result. S3 introduces a locally deployed large language model, which generates a natural language explanation for the final diagnostic results based on the established mechanistic links.
2. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 1, characterized in that, In step S1, the mechanism knowledge ontology is organized in the form of triples, and the evolutionary link of typical unit faults is expressed through entities, relations and semantic constraints as follows: ; In the formula, 't' and 't' represent the head entity and tail entity, respectively. Represents a set of entities. Represents a set of relations. Semantic relationships that reflect the fault mechanism.
3. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 2, characterized in that, In step S1, the generation of mechanistic knowledge includes: Based on five dimensions—equipment, fault, phenomenon, cause, and handling measures—historical maintenance records are organized into fields. According to ontology constraints, unstructured text is transformed into triples with the structure (entity 1, relation, entity 2) and stored in a graph database.
4. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 3, characterized in that, In step S2, when obtaining the description text of the fault to be diagnosed, the description of the new fault is concatenated into text using a method generated from mechanistic knowledge.
5. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 4, characterized in that, In step S2, the BM25 model is used to calculate semantic similarity. When recalling the Top-N candidate faults from the knowledge graph, the BM25 scoring function is as follows: ; In the formula, For terms In the document Frequency of occurrence in For document length, The average length of the document collection. and Here is the length normalization parameter; the inverse document frequency of a term is given by the following formula: ; In the formula, Total number of documents For included terms The number of documents.
6. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 1, characterized in that, In step S2, when calculating the structural consistency score between each candidate fault case and the fault description text in the candidate set across the four dimensions of equipment, phenomenon, cause, and handling measures, GraphSim is used for calculation. The specific method is as follows: Define a four-dimensional consistency score using the following lightweight rules: Different scores are assigned to cases where the entities are completely identical, there is an inclusion relationship, and other cases; the final score is the average of the scores in the four dimensions. The structural similarity between the query sample and the candidate fault is measured from four dimensions: equipment, phenomenon, cause, and handling measures. Let the query sample With candidate samples The structured fields are respectively and The four-dimensional consistency structure similarity is defined as: ; In the formula, the scores for each dimension are... Calculated by soft-equal matching rules; the soft-equal mechanism assigns different consistency scores based on the containment relationship or semantic similarity between entities.
7. The method for diagnosing fault mechanisms of hydropower units based on knowledge graph structure enhancement according to claim 1, characterized in that, In step S3, a locally deployed large language model is introduced. Based on the established mechanistic links, a natural language explanation is generated for the final diagnostic results, including the following steps: After completing the structure-enhanced retrieval and mechanism-consistent rearrangement, a large language model is introduced as a diagnostic interaction module to serve as the interface for interpreting and interacting with the diagnostic results. The diagnostic interaction module is configured to execute the following process: Using the Top-1 fault mechanism chain returned by GraphSim as input, it organizes and explains the identified equipment, phenomena, causes and handling measures in natural language, without participating in the fault retrieval, similarity calculation or ranking decision process.
8. A knowledge graph-based structure-enhanced hydropower unit fault mechanism diagnosis system, used to implement the knowledge graph-based structure-enhanced hydropower unit fault mechanism diagnosis method according to any one of claims 1-7, characterized in that, The system includes: The knowledge graph construction module is used to build and store the knowledge graph of hydropower unit failure mechanism. The knowledge graph is organized in the form of triples and covers the failure mechanism link with at least the dimensions of equipment, failure, phenomenon, cause and treatment measures. The semantic recall module is used to obtain the description text of the fault to be diagnosed, and to use a semantic retrieval model to recall multiple candidate fault cases from the knowledge graph to form a candidate set. The structural rearrangement module is used to calculate the structural consistency score between each candidate fault case and the fault description text in the dimensions of equipment, phenomenon, cause and handling measures for each candidate fault case in the candidate set, and rearrange the candidate set according to the score, and output the candidate fault case with the highest score as the final diagnosis result. The diagnostic interaction module introduces a large language model to serve as the interface for interpreting and interacting with diagnostic results. It takes the Top-1 fault mechanism link returned by the structure rearrangement module as input and organizes and explains the identified equipment, phenomena, causes and treatment measures in natural language.
9. A computer device, characterized in that, It includes a memory and a processor, which are interconnected and communicate with each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the hydropower unit fault mechanism diagnosis method based on knowledge graph structure enhancement as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the knowledge graph-based hydropower unit fault mechanism diagnosis method according to any one of claims 1 to 7.