A method and system for intelligent diagnosis of sonar faults based on knowledge graphs and large language models
By introducing a fault description completeness assessment and interactive guidance mechanism into the sonar fault diagnosis system, and combining large language models and knowledge graphs for joint reasoning, the problem of decreased diagnostic accuracy caused by incomplete input from non-professional users is solved, achieving efficient and stable fault diagnosis, which is suitable for sonar equipment in variable environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING HYDRO TECH MARINE TECH CO LTD
- Filing Date
- 2025-07-28
- Publication Date
- 2026-05-26
AI Technical Summary
When existing sonar fault diagnosis systems provide vague or incomplete fault descriptions from non-professional users, their diagnostic accuracy decreases, making it difficult to achieve accurate diagnosis and limiting their practical value and reliability in real-world engineering applications.
A fault description integrity assessment and interactive guidance mechanism is introduced. The initial fault description is received through a natural language interactive interface, and its integrity is analyzed. If it is incomplete, the user is guided to supplement key information. The system combines a large language model and a sonar fault knowledge graph for joint reasoning to generate a structured diagnostic report. The system also selects the most suitable diagnostic path through a scene-aware reasoning model.
It improves the system's adaptability to input from non-professional users, enhances the accuracy and stability of fault diagnosis, lowers the barrier to entry, is suitable for sonar fault diagnosis in variable environments, and has self-optimization capabilities to continuously improve diagnostic capabilities.
Smart Images

Figure CN120973917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of side-scan sonar fault detection technology, and in particular to a sonar fault intelligent diagnosis method and system based on knowledge graph and large language model. Background Technology
[0002] Sonar, as a key device for underwater detection, communication, and target identification, has a complex structure and operates in variable environments. Once a malfunction occurs, it is often difficult to quickly and accurately pinpoint the root cause of the problem. Traditional sonar fault diagnosis mainly relies on experienced experts or cumbersome troubleshooting manuals, which suffers from low efficiency, high skill requirements for personnel, and difficulties in knowledge transfer.
[0003] In recent years, with the development of artificial intelligence technology, using knowledge graphs to structurally represent equipment fault knowledge and combining it with natural language processing for intelligent question answering has become a research hotspot in the field of fault diagnosis. For example, existing technologies have proposed constructing knowledge graphs from information such as sonar equipment manuals, maintenance records, and historical fault cases. Users can describe fault phenomena using natural language, and the system uses a large language model to understand the user's intent, mapping it to the knowledge graph for querying and reasoning, ultimately providing diagnostic suggestions. This method, to a certain extent, achieves systematic management of fault knowledge and facilitates human-computer interaction.
[0004] However, our research has revealed a significant technical flaw in existing solutions: they heavily rely on the quality of user input. Specifically, when users (especially non-professional field operators) input vague, incomplete, or non-standard descriptions of fault phenomena, the existing system's large language model struggles to accurately map these low-quality natural language inputs to precise entities or relationships in the knowledge graph. For example, a user might only input "the sonar seems broken" or "the image is unclear," lacking crucial information such as the specific component causing the fault, the specific manifestation of the anomaly (e.g., "the image has fan-shaped interference" or "it's generally blurry"), the time of the fault, the sea conditions at the time, or the equipment's operating mode. This ambiguity and lack of information in the input leads to deviations in the semantic parsing of the large language model, making it impossible to locate the correct fault path in the knowledge graph. Ultimately, this results in a significant decrease in the accuracy and reliability of the diagnosis, unstable diagnostic results, and severely limits the practical value and credibility of such intelligent diagnostic systems in real-world engineering applications.
[0005] Therefore, how to solve the problem of decreased diagnostic accuracy caused by vague or incomplete user input descriptions, and improve the system's robustness and adaptability to input from non-professional users, is a technical challenge that urgently needs to be addressed in this field. Summary of the Invention
[0006] To address the technical problems existing in the prior art, the present invention aims to provide a sonar fault intelligent diagnosis method and system based on knowledge graphs and large language models. By introducing a fault description completeness assessment and interactive guidance mechanism, the invention solves the problem of decreased system diagnostic accuracy caused by vague or incomplete user input fault descriptions in the prior art, improves the system's adaptability to input from non-professional users, and thus enhances the overall diagnostic accuracy and stability.
[0007] To achieve the above-mentioned objectives, this invention provides an intelligent sonar fault diagnosis method based on knowledge graphs and large language models, comprising the following steps:
[0008] Step S1: Receive the initial fault description text input by the user through the natural language interactive interface;
[0009] Step S2: Perform a completeness analysis on the initial fault description text to determine whether it contains all the preset key information dimensions; the key information dimensions include at least the faulty device, fault phenomenon, fault occurrence time, and environmental conditions;
[0010] Step S3: If the judgment result of the integrity analysis is negative, the interactive guidance mechanism is activated. Through the natural language interaction interface, targeted questions are generated and raised to the user to guide the user to supplement the missing key information until the complete fault description text is obtained.
[0011] Step S4: Based on the complete fault description text, reasoning is performed using a large language model that has been pre-trained and configured with a sonar fault knowledge graph.
[0012] Step S5: Based on the conclusion of joint reasoning, generate and output a structured fault diagnosis report, which includes the fault type, potential causes and maintenance recommendations.
[0013] According to one technical solution of the present invention, before step S1 and after step S4, the scene parameters input by the user are obtained;
[0014] In step S4, when the complete fault description text is input into the large language model, the scene parameters are simultaneously input into the scene-aware reasoning model. The large language model and the scene-aware reasoning model perform joint reasoning based on the sonar fault knowledge graph, the complete fault description text, and the scene parameters to obtain a fault diagnosis conclusion.
[0015] According to a technical solution of the present invention, the intelligent diagnosis method for sonar faults based on knowledge graphs and large language models further includes:
[0016] Step S6: After the user performs the repair operation based on the diagnostic report, receive the repair feedback information input by the user;
[0017] Step S7: Based on the repair feedback information, dynamically update the sonar fault knowledge graph.
[0018] According to a technical solution of the present invention, in step S4, the joint reasoning process of the large language model and the scene-aware reasoning model includes the following steps:
[0019] Step S41: Perform semantic parsing on the complete fault description text and map it to one or more standardized fault entities in the sonar fault knowledge graph;
[0020] Step S42: Based on the standardized fault entities, perform semantic reasoning in the sonar fault knowledge graph, and combine the large language model's ability to understand contextual information to generate at least one candidate diagnostic conclusion.
[0021] Step S43: The scene-aware reasoning model uses a multilayer perceptron and attention mechanism to perform weighted matching calculations on the multiple predefined diagnostic path templates and select the diagnostic path with the highest score.
[0022] Step S44: The large language model performs reasoning along the selected diagnostic path template in the knowledge graph to generate diagnostic conclusions that are highly relevant to the current usage scenario.
[0023] According to one technical solution of the present invention, step S43 specifically includes:
[0024] Step S431: Integrate the scene parameters into a structured scene feature vector. S =[ d , t , m , p , n , e ], where d represents water depth, t represents temperature, m represents installation method, p represents detection mode, n represents noise level, and e represents operating experience;
[0025] Step S432: Input the scene feature vector and the mapped standardized fault entity into the scene perception reasoning model;
[0026] Step S433: Based on the scene feature vector, the scene-aware reasoning model performs weighted matching on multiple predefined diagnostic path templates adapted to different scenes, and selects the diagnostic path template with the highest score.
[0027] The parameter dynamic weight allocation model completes the weight allocation of parameters in the feature vectors of the different scenarios, as shown below:
[0028]
[0029] in, Let i be the weight of parameter i in the t-th diagnosis. For the current scene parameters, Let σ represent the historical repair success rate, and σ be the activation function. , These are learnable parameters.
[0030] According to one technical solution of the present invention, in step S7, if the feedback is that the repair is successful, the weight of the diagnostic path used in this diagnosis is increased; if the feedback is that the repair fails, the current diagnostic process is recorded as a negative sample, and a correction reasoning mechanism is started to generate correction suggestions.
[0031] According to one aspect of the present invention, a sonar fault intelligent diagnosis system based on knowledge graph and large language model is proposed, comprising:
[0032] The interaction module is used to receive the initial fault description text input by the user through the natural language interaction interface;
[0033] The fault description integrity assessment module is used to perform integrity analysis on the initial fault description text to determine whether it contains all the preset key information dimensions; the key information dimensions include at least the faulty equipment, fault phenomenon, fault occurrence time and environmental conditions.
[0034] The interactive guidance module is used to: if the judgment result of the integrity analysis is negative, then activate the interactive guidance mechanism, generate and raise targeted questions to the user through the natural language interactive interface, so as to guide the user to supplement the missing key information until the complete fault description text is obtained;
[0035] The intelligent reasoning and fault diagnosis module is used to perform reasoning based on the complete fault description text using a large language model that has been pre-trained and configured with a sonar fault knowledge graph.
[0036] The output module is used to generate and output a structured fault diagnosis report based on the conclusions of joint reasoning. The fault diagnosis report includes the fault type, potential causes, and maintenance recommendations.
[0037] According to one technical solution of the present invention, the interaction module is further configured to receive repair feedback information input by the user after the user performs repair operations based on the diagnostic report;
[0038] The update module is used to dynamically update the sonar fault knowledge graph based on the repair feedback information.
[0039] According to one aspect of the present invention, an electronic device is provided, comprising: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory; when the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any of the above technical solutions.
[0040] According to one aspect of the present invention, a computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any of the above technical solutions.
[0041] Compared with the prior art, the present invention has the following advantages:
[0042] This invention proposes an intelligent sonar fault diagnosis method and system based on knowledge graphs and large language models. By introducing a fault description completeness assessment and interactive guidance mechanism, it solves the problem of decreased system diagnostic accuracy caused by fuzzy or incomplete user input fault descriptions in existing technologies. It improves the system's adaptability to input from non-professional users, avoids erroneous mapping and reasoning from the source, and thus fundamentally improves the accuracy and stability of fault diagnosis results.
[0043] The interactive guidance mechanism of this invention makes the system more intelligent. Even non-professional users who are not very familiar with sonar technology can easily complete high-quality fault descriptions under the guidance of the system. It lowers the threshold for using the system, enhances the user's willingness and efficiency to interact with the system, and is particularly suitable for remote or on-site operation scenarios that lack expert support, thereby improving the system's practicality and ease of use.
[0044] By introducing user-defined usage scenario parameters and a scenario-aware dynamic diagnostic path selection mechanism, this invention makes the diagnostic process no longer static and isolated, but can fully consider the specific environment and working status of the device, achieving accurate diagnosis that is "tailored to local conditions" and "tailored to time". This makes the system of this invention extremely valuable in sonar applications with variable working environments.
[0045] By introducing a closed-loop learning and knowledge update mechanism based on user feedback, this invention features continuous learning and self-optimization. The system can continuously accumulate knowledge and experience in practical applications, dynamically update its knowledge graph and reasoning model, and enhance its diagnostic capabilities over time, demonstrating promising prospects for intelligent and engineering applications. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating the intelligent sonar fault diagnosis method based on knowledge graph and large language model in an embodiment of the present invention.
[0048] Figure 2 This is a schematic diagram of the composition of the sonar fault intelligent diagnosis system based on knowledge graph and large language model in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the overall architecture of the intelligent sonar fault diagnosis system based on knowledge graph and large language model in an embodiment of the present invention.
[0050] Figure 4 This is a flowchart illustrating the closed-loop self-learning update process of the sonar fault intelligent diagnosis method based on knowledge graphs and large language models in this embodiment of the invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] Due to the specialized nature of the sonar industry, the use of sonar equipment currently requires a certain level of professional knowledge. Because field operators often lack this knowledge, troubleshooting in such cases largely relies on manual methods, resulting in low efficiency. In practical applications, describing the fault symptoms to field personnel can pinpoint the cause of most malfunctions and guide them in resolving them. Compared to other industries, the sonar industry has unique characteristics. Besides inherent equipment issues, sonar equipment is easily affected by factors such as the underwater environment, the mounting environment, and the acoustic environment. Furthermore, parameter settings during use can also influence detection performance. Therefore, there is a need to design more intelligent and accurate sonar fault diagnosis methods and systems to address these issues.
[0053] Example 1
[0054] like Figure 1As shown, this invention provides an intelligent sonar fault diagnosis method based on knowledge graphs and large language models, comprising the following steps:
[0055] Step S1: Receive the initial fault description text input by the user through the natural language interactive interface;
[0056] The intelligent diagnostic system receives user-input descriptions of fault phenomena through a natural language interactive interface (such as a text dialog box or voice input interface). The input format is unstructured natural language, such as "abnormal sonar echo," "decreased detection range," or more ambiguous expressions (such as "the sonar is not working properly"). The system supports multimodal input interfaces, but initially relies primarily on text interaction, subsequently incorporating sensor data or image information. Based on this step, the present invention breaks through the traditional limitation of relying on input from professional personnel, allowing non-professional users to initiate diagnostic requests using natural language, improving system usability. Even if the original input may be ambiguous, optimized diagnostic results can still be obtained through subsequent processing.
[0057] Step S2: Perform a completeness analysis on the initial fault description text to determine whether it contains all the preset key information dimensions;
[0058] Key information dimensions include at least the faulty equipment (e.g., transmitting transducer, signal processor), fault phenomena (e.g., echo distortion, shortened detection range), occurrence time (e.g., "this morning," "lasting 3 days"), and environmental conditions (water depth, temperature, noise level, installation method, etc.). Named Entity Recognition (NER) is performed on the input text using a large language model (e.g., GPT-4, Tongyi Qianwen) to extract entity keywords. For example, from "weak echo from the ship's bottom sonar for the past 3 days," the keywords are identified as "ship's bottom sonar" (faulty equipment), "past 3 days" (time), and "weak echo" (phenomenon). The extracted entities are compared with preset dimensions; if any dimension is missing (e.g., water depth or installation method is not mentioned), it is considered "incomplete information."
[0059] Step S3: If the judgment result of the integrity analysis is negative, the interactive guidance mechanism is activated. Through the natural language interaction interface, targeted questions are generated and raised to the user to guide the user to supplement the missing key information until the complete fault description text is obtained.
[0060] The system generates targeted guiding questions using a large language model. For example, if the faulty device is missing: "Which component of the sonar is experiencing the fault? (e.g., transducer, signal processing module)"; if environmental conditions are missing: "Is the sonar currently installed as a fixed-bottom or towed type?" After the user answers, the system performs a completeness assessment again until all key dimensions are complete. For example: the user initially inputs "the sonar image is blurry" → the system asks, "Is the blurry image accompanied by a decrease in detection range?" → the user adds, "The detection range has decreased to 50%" → the system continues to ask, "What is the equipment deployment depth and noise level?" → until a complete description is obtained.
[0061] Text integrity analysis can avoid diagnostic biases caused by incomplete information, ensuring the completeness of inference data from the source. It addresses the issue of inconsistent user input quality in existing technologies, making diagnostic input more accurate; it also reduces the requirement for users' professional knowledge, allowing non-experts to provide effective information through guidance, thus improving system adaptability.
[0062] Step S4: Based on the complete fault description text, reasoning is performed using a pre-trained large language model configured with a sonar fault knowledge graph, including:
[0063] Step S41: Perform semantic parsing on the complete fault description text and map it to one or more standardized fault entities in the sonar fault knowledge graph, such as "detection distance decrease" → knowledge graph entity "detection distance decrease", and associate its attributes (such as normal threshold, influencing factors).
[0064] Step S42: Based on the standardized fault entities, perform semantic reasoning in the sonar fault knowledge graph, and combine the large language model's ability to understand contextual information to generate at least one candidate diagnostic conclusion.
[0065] By using SPARQL queries or the OWL inference engine, you can search for possible causes of failure along the entity relationship chain. For example, starting with "decrease in detection range", you can query for the entities that cause the failure (such as "transducer aging" or "signal interference"), and then obtain the corresponding maintenance measures.
[0066] Step S43: The scene-aware reasoning model uses a multilayer perceptron and attention mechanism to perform weighted matching calculations on the multiple predefined diagnostic path templates and select the diagnostic path with the highest score. Step S43 specifically includes:
[0067] Step S431: Integrate the scene parameters into a structured scene feature vector. S =[ d , t , m , p , n, e ], where d represents water depth, t represents temperature, m represents installation method (e.g., fixed type at the bottom of the ship is coded as 1), p represents detection mode (active detection is coded as 1), n represents noise level (low, medium, and high are coded as 0, 1, and 2 respectively), and e represents operating experience (basic experience, intermediate experience, and advanced experience are coded as 0, 1, and 2 respectively).
[0068] Step S432: Input the scene feature vector and the mapped standardized fault entity into the scene perception reasoning model;
[0069] Step S433: The scene-aware reasoning model performs weighted matching on multiple predefined diagnostic path templates adapted to different scenes based on the scene feature vector, and selects the diagnostic path template with the highest score.
[0070] In some embodiments of the present invention, the parameter dynamic weight allocation model completes the weight allocation of parameters in the feature vectors of the different scenarios, as expressed as:
[0071]
[0072] in, Let i be the weight of parameter i in the t-th diagnosis. For the current scene parameters, Let σ represent the historical repair success rate, and σ be the activation function. , These are learnable parameters.
[0073] The system inputs the user-input usage scenario feature vector and fault phenomenon into the "Scene-Aware Reasoning Model". This model is based on multilayer perceptron (MLP) and attention mechanism, and performs weighted matching on multiple predefined diagnostic path templates to dynamically select the fault reasoning path that is most suitable for the current usage environment.
[0074] For example, a user is using sonar equipment for underwater topographic mapping. The equipment is deployed in a nearshore area with a water depth of approximately 40 meters and an ambient temperature of 20°C. The sonar is installed on the bottom of a ship and uses an active detection mode. During operation, the user finds that "the sonar image is blurry and the detection range has decreased to 60% of the normal value" and wants the system to dynamically adjust the diagnostic path based on the current usage scenario, rather than using general inference logic.
[0075] The system provides a user-configurable interface for setting usage scenario parameters. When submitting a fault description, users can set the following usage scenario parameters through drop-down menus, sliders, and text input boxes:
[0076] Water depth: 40 meters
[0077] Ambient temperature: 20°C
[0078] Installation method: Bottom-fixed
[0079] Detection mode: Active detection
[0080] Background noise: Medium (Users should select according to system prompts)
[0081] Operator experience level: Intermediate
[0082] The system receives the above parameters and structures them into a feature vector for the use case. S =[ 40 , 20 , 1 , 1 , 1 , 1 ].
[0083] This feature vector, together with the user inputs "image blur" and "decreased detection distance," constitutes the input features, which are then fed into the scene-aware inference model. This model, based on a multilayer perceptron (MLP) and attention mechanism, matches and scores multiple predefined diagnostic path templates, selecting the diagnostic path most suitable for the current usage environment.
[0084] For example, the system predefines three diagnostic path templates:
[0085] Path A: Transducer aging leads to signal attenuation (suitable for high water depth and high noise environments)
[0086] Path B: Signal processing module interference (adapted for moderate noise, active detection mode)
[0087] Path C: Poor electrode contact (suitable for intermediate operators and bottom-mounted installation)
[0088] The model scores each path based on the feature vector S of the usage scenario:
[0089] Eigenvector scoring formula:
[0090]
[0091] S represents the overall score. This represents the weight of the i-th feature. Let represent the eigenvalue of the i-th feature, and n represent the dimension of the feature vector.
[0092] Path A score: 0.65;
[0093] Path B score: 0.82;
[0094] Path C score: 0.58;
[0095] Ultimately, path B was chosen as the optimal diagnostic path for the current scenario.
[0096] Meanwhile, the system also receives sensor data (such as abnormal echoes and signal attenuation) and user text descriptions (such as "image blurry" and "decrease in detection distance"), combines knowledge graphs and large language models for joint reasoning, generates multiple candidate diagnostic paths, and determines the optimal path through a weighted fusion mechanism.
[0097] The system inputs the diagnostic path and equipment structure diagram into the fault propagation modeling module based on graph attention network (GAT). The fault propagation modeling module is equipped with a scene-aware reasoning model to simulate the propagation path of faults between different components, identify possible secondary fault points, and improve the accuracy and robustness of diagnosis.
[0098] Step S44: The large language model performs reasoning along the selected diagnostic path template in the knowledge graph to generate diagnostic conclusions that are highly relevant to the current usage scenario.
[0099] Step S5: Based on the conclusions of joint reasoning, generate and output a structured fault diagnosis report. The fault diagnosis report includes fault type, potential causes, maintenance suggestions and applicable scenario tags. Combined with the propagation path visualization of the GNN model and the natural language interpretation capability of the large language model, generate multimodal explanation content combining text and graphics to improve the user's understanding and trust in the diagnosis results.
[0100] Step S6: After the user performs the repair operation based on the diagnostic report, receive the repair feedback information input by the user;
[0101] Step S7: Based on the repair feedback information, dynamically update the sonar fault knowledge graph.
[0102] like Figure 4 As shown, after receiving the diagnostic report, users typically perform sonar repairs based on the report. After the user performs the repair, the system acquires sensor data and user feedback to obtain the repaired equipment status and user satisfaction information. If the repair fails, the system compares the original diagnostic path with the current usage scenario and repair feedback to identify the type of repair deviation and invokes the correction inference mechanism to generate correction suggestions adapted to the current scenario.
[0103] The system generates correction suggestions based on repair feedback and scenario characteristics, including re-diagnosis results, operational guidance adjustments, and suggestions for required tools or accessories. It also feeds back the correction path and results to the knowledge graph and model training modules to achieve continuous optimization and adaptive evolution of the diagnostic logic.
[0104] In some embodiments of the present invention, scene parameters input by the user are obtained before step S1 and after step S4;
[0105] In step S4, when the complete fault description text is input into the large language model, the scene parameters are simultaneously input into the scene-aware reasoning model. The large language model and the scene-aware reasoning model perform joint reasoning based on the sonar fault knowledge graph, the complete fault description text, and the scene parameters to obtain a fault diagnosis conclusion.
[0106] Example 2
[0107] This embodiment details the complete implementation process of a sonar fault intelligent diagnosis method based on knowledge graphs and large language models, which is implemented based on a sonar fault intelligent diagnosis system. (Refer to...) Figure 3 The hardware environment of the sonar fault intelligent diagnosis system 100 based on knowledge graphs and large language models in this embodiment may include, but is not limited to, servers, industrial control computers, or embedded devices. Its core consists of one or more processors 101 and a memory 102. The memory 102 stores computer program instructions for implementing the method of this invention. The system is logically divided into multiple functional modules, which work together to complete the intelligent diagnosis task.
[0108] like Figure 2 As shown, the intelligent sonar fault diagnosis system based on knowledge graph and large language model mainly includes: an interaction module, a fault description and processing module, a diagnostic reasoning engine, a knowledge base, and a self-learning and updating module.
[0109] Interaction module: Provides a natural language interaction interface, which can be a text dialog box, voice input interface, etc., and is also used to receive user input and display diagnostic results.
[0110] The fault description processing module includes a fault description integrity assessment module and an interactive guidance module. It can perform integrity analysis on the initial fault description text to determine whether it contains all the preset key information dimensions. If the integrity analysis result is negative, the interactive guidance mechanism is activated. Through the natural language interaction interface, targeted questions are generated and raised to the user to guide the user to supplement the missing key information until the complete fault description text is obtained.
[0111] Intelligent Reasoning and Fault Diagnosis Module: This module is used to perform reasoning based on the complete fault description text, utilizing a large language model that has been pre-trained and configured with a sonar fault knowledge graph.
[0112] Knowledge base: The knowledge hub of the system, containing a sonar fault knowledge graph and a domain knowledge corpus to support reasoning in large language models.
[0113] The update module is used to dynamically update the sonar fault knowledge graph based on the repair feedback information, and is responsible for the continuous optimization of the system. It includes a feedback collection module and a knowledge update module.
[0114] Furthermore, the sonar fault intelligent diagnosis method based on knowledge graph and large language model of the present invention needs to complete intelligent diagnosis based on sonar fault knowledge graph. The knowledge graph provides a structured semantic foundation for large language model (LLM). Therefore, the sonar fault intelligent diagnosis method or system of this application needs to be constructed to support subsequent model training and inference before it is used or implemented.
[0115] Therefore, this system also includes a sonar fault knowledge graph construction module, which is responsible for the offline construction and management of knowledge. Through multi-source heterogeneous data fusion technology, knowledge is extracted from structured and unstructured data such as equipment manuals, historical maintenance records, fault logs, and online technical forums to extract key entities and relationships. Specifically, advanced natural language processing technologies, such as Named Entity Recognition (NER) technology based on BERT or ERNIE, are used to identify key entities in the text, such as "transducer", "signal processor", "detection range decrease", "echo signal attenuation", and "unstable power supply voltage". Then, a relation extraction model (such as a classification model based on an attention mechanism) is used to identify the complex relationships between these entities. For example, from a maintenance record, triples are extracted: "<detection range decrease, fault cause, transducer aging>" and "<transducer aging, solution, replace transducer module>". All extracted knowledge, in the form of RDF triples, is loaded into a graph database (such as Neo4j or Amazon Neptune) for storage and management, forming an interconnected sonar fault knowledge network, i.e., a sonar fault knowledge graph.
[0116] The sonar fault knowledge graph also introduces ontology alignment and version control mechanisms to facilitate subsequent system upgrades and knowledge updates, ensuring the consistency and traceability of knowledge.
[0117] The interaction module, acting as a bridge between the system and the user, builds a natural language understanding interface based on pre-trained large language models (such as GPT-4, Qwen, and ChatGLM), allowing users to input sonar fault phenomena in natural language. The system employs PromptEngineering and Few-ShotLearning strategies to improve the model's generalization ability in small-sample scenarios. Simultaneously, by combining entity and relation structures from the knowledge graph, the model can generate entity recognition results that conform to the semantic constraints of the graph, providing a semantic foundation for subsequent reasoning. This module also supports multi-turn dialogue interaction, enhancing the user experience.
[0118] For example, a user inputs a natural language description on the ship's operating terminal: "The sonar detection range has shortened significantly in recent days, and the echo signal strength has also decreased." The system calls a pre-trained large language model (such as Tongyi Qianwen) to perform semantic parsing, identify the fault phenomenon entities, and map them to standardized fault entities in the knowledge graph.
[0119] The fault description processing module is divided into a fault description completeness assessment module and an interactive guidance module. The fault description completeness assessment module analyzes the completeness and accuracy of the input text using a large language model after user input, determining whether it contains key information such as the faulty equipment, the symptom, the time of occurrence, and environmental conditions. The interactive guidance module guides the user to supplement the missing information through natural language interaction if the assessment results indicate incomplete input. For example, it might ask, "In which frequency band does the sonar echo anomaly occur?" or "Is it accompanied by temperature anomalies?"
[0120] The intelligent reasoning and fault diagnosis module, as the core of the entire system, integrates the symbolic reasoning capabilities of knowledge graphs and the semantic reasoning capabilities of large language models to achieve multi-dimensional intelligent diagnosis of sonar faults. The overall process is as follows: First, a graph reasoning engine (such as OWLReasoner or SPARQL rule reasoning) identifies the fault mode and potential cause chain corresponding to the input fault phenomenon. Then, a large language model is used to perform deep semantic analysis on the contextual information, combining historical cases and maintenance experience to generate multiple candidate diagnostic solutions. The system employs a fault propagation modeling method based on graph neural networks (GNNs) to simulate the transmission path of faults between system components, enhancing the accuracy and robustness of the diagnosis and obtaining diagnostic conclusions highly relevant to the current usage scenario. Finally, the system uses the output module to output a structured diagnostic report based on the diagnostic conclusions, including the fault type, possible causes, scope of impact, and preliminary maintenance suggestions. This module supports multimodal input, such as joint reasoning combining sensor data and text descriptions.
[0121] The update module utilizes a continuous learning mechanism to dynamically update the knowledge graph and continuously optimize the system's diagnostic capabilities. After each diagnosis, the system automatically records the diagnostic process and results, and performs semantic parsing and structured transformation on new cases using a large language model. An incremental learning strategy is employed, injecting new knowledge into the knowledge graph in the form of triples, and maintaining consistency and logical integrity between entities through a graph evolution algorithm. The system introduces a reinforcement learning-based feedback mechanism, adjusting inference weights based on user evaluations of the diagnostic results to improve the model's diagnostic accuracy in similar scenarios. Furthermore, the module supports integration with equipment monitoring systems, automatically collecting sensor data and abnormal event logs to achieve automated knowledge updates and closed-loop optimization.
[0122] The present invention will be further illustrated below with detailed examples.
[0123] In this embodiment, taking the "decrease in detection range" fault phenomenon that occurred in a certain type of shipborne active sonar system during ocean voyage as the background, the implementation process of the sonar fault intelligent diagnosis method and platform based on knowledge graph and large language model is described in detail.
[0124] 1. Sonar Fault Knowledge Graph Construction Phase
[0125] The system first extracts structured knowledge from multi-source heterogeneous data to construct a sonar fault knowledge graph. Specifically, it includes the following data sources:
[0126] • Equipment manual: Extract information such as the components of the sonar system (e.g., transmitting transducers, receiving arrays, signal processors, etc.) and their normal operating parameter ranges;
[0127] • Maintenance records: Extract failure modes (such as "signal attenuation", "unstable echo"), failure causes (such as "transducer aging", "signal interference"), and maintenance measures (such as "module replacement", "recalibration") from historical failure cases.
[0128] • Technical documentation and forum discussions: Identifying fault descriptions and solutions in unstructured text using natural language processing techniques.
[0129] Named Entity Recognition (NER) technology is used to identify key entities in the above text, and relation extraction models (such as BERT-based relation classifiers) are used to identify relationships between entities. For example, triples are extracted from a maintenance record:
[0130] <Decreased detection range, cause of failure, transducer aging>
[0131] <Transducer aging, solutions, transducer module replacement>
[0132] All triples are stored in a graph database (such as Neo4j) to construct a sonar fault knowledge graph, supporting semantic querying and reasoning based on SPARQL.
[0133] 2. Large Language Model Natural Language Interaction Stage
[0134] The user inputs a natural language description on the ship's operating terminal: "The sonar detection range has shortened significantly in the past few days, and the echo signal strength has also decreased." The system calls a pre-trained large language model (such as Tongyi Qianwen) to perform semantic parsing, identify the fault phenomenon entities, and map them to standardized fault entities in the knowledge graph.
[0135] The specific process is as follows:
[0136] • Intent recognition: The model determines that the user input is a description of a fault rather than a routine inquiry;
[0137] • Entity recognition: Two fault phenomena were identified: "shortened detection distance" and "decreased echo signal strength";
[0138] • Semantic mapping: Map "shortened detection distance" to the entity "decreased detection distance" in the knowledge graph, and map "decreased echo signal strength" to the entity "unstable echo".
[0139] This process guides the model output in a structured format through Prompt Engineering, such as:
[0140] {
[0141] User input: "The sonar detection range has noticeably shortened in the past few days, and the echo signal strength has also decreased."
[0142] "Entity Identification": ["Detection range decreased", "Echo unstable"],
[0143] Possible Failure Modes: ["Signal Attenuation", "Transducer Performance Degradation"]
[0144] }
[0145] 3. Intelligent Reasoning and Fault Diagnosis Phase
[0146] The system generates preliminary fault diagnosis suggestions based on joint reasoning using knowledge graphs and large language models.
[0147] 3.1 Knowledge Graph Reasoning
[0148] Use the query language of the graph database for semantic reasoning to find fault modes and cause chains related to "decreased detection range" and "unstable echo". For example, execute the following SPARQL query:
[0149] SELECT ?cause ?solution
[0150] WHERE {
[0151] <Decreased detection range> <Cause of failure>?
[0152] ?cause<solution>?solution.
[0153] }
[0154] The query results return multiple possible causes of the failure, such as:
[0155] • Transducer aging → Replace transducer module
[0156] • Signal interference → Check nearby electronic devices
[0157] • Unstable power supply voltage → Adjust the power supply module
[0158] 3.2 Semantic Reasoning Based on Large Language Models
[0159] Simultaneously, the system combines user input with structured entities in the knowledge graph to form a Prompt, which is then input into a large language model to guide it in generating supplementary suggestions based on historical maintenance experience. For example:
[0160] User description: Detection range decreased, echo became unstable.
[0161] Structured entities: Reduced detection range, unstable echo.
[0162] Based on your past repair experience, please provide possible causes of the malfunction and suggestions.
[0163] The model output includes the following supplementary suggestions:
[0164] "Based on past experience, this situation may also be related to the installation angle deviation of the sonar array. It is recommended to check whether the array fixing device is loose. In addition, if there are a large number of bubbles or suspended objects in the navigation area, it may also affect signal propagation."
[0165] 3.3 Comprehensive Diagnostic Output
[0166] The system integrates the knowledge graph reasoning results with the output of the large language model to generate a structured diagnostic report.
[0167] {
[0168] Fault symptoms: ["Decreased detection range", "Unstable echo"],
[0169] Possible causes: [
[0170] "Transducer aging"
[0171] "Signal interference",
[0172] "Unstable power supply voltage"
[0173] "Array angle offset",
[0174] "Underwater environmental interference"
[0175] ],
[0176] Recommended measures: [
[0177] "Check if the transducer output power meets the standard"
[0178] "Check for sources of strong electromagnetic interference in the vicinity."
[0179] "Measure whether the power supply voltage is stable",
[0180] "Check the installation angle of the sonar array",
[0181] "Assess the impact of current marine hydrological conditions on the signal" ]
[0183] }
[0184] 4. Self-learning and knowledge updating mechanism stage
[0185] After completing this diagnosis, the system automatically records the diagnostic process and user feedback. If the user subsequently reports that "the problem was resolved after replacing the transducer," the system will structure this new case and update it to the knowledge graph.
[0186] <Decreased detection range, cause of failure, transducer aging>
[0187] <Transducer aging, frequent occurrences, long-term high-load operation>
[0188] Meanwhile, the large language model updates its understanding of cases related to "decreased detection distance" through a continuous learning module, improving diagnostic accuracy in similar scenarios in the future.
[0189] 5. Multimodal fusion and interaction support stage
[0190] The system supports real-time integration with shipborne sonar monitoring systems, automatically acquiring sensor data (such as voltage, temperature, signal strength, etc.) and performing joint analysis with user-input text descriptions.
[0191] For example, if the system detects that the current transducer output voltage is 4.2V (lower than the standard value of 5.0V), and combines this with the user input of "decreased detection distance," the system can further confirm "power module malfunction" as a possible cause, and highlight it in the diagnostic report, such as:
[0192] Note: The current transducer supply voltage is lower than the standard value (4.2V < 5.0V). It is recommended to check the power supply module first.
[0193] According to one aspect of the present invention, an electronic device is provided, comprising: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory; when the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any of the above technical solutions.
[0194] According to one aspect of the present invention, a computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any of the above technical solutions.
[0195] Computer-readable storage media can include any medium capable of storing or transmitting information. Examples of computer-readable storage media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. Code segments can be downloaded via computer networks such as the Internet and intranets.
[0196] Furthermore, it should be noted that the present invention can be provided as a method, apparatus, or computer program product. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0197] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0198] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0199] It should also be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0200] Finally, it should be noted that the above description represents a preferred embodiment of the present invention. It should be pointed out that although preferred embodiments have been described, those skilled in the art, once they understand the basic inventive concept of the present invention, can make various improvements and modifications without departing from the principles described herein. These improvements and modifications should also be considered within the scope of protection of the present invention. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
Claims
1. A method for intelligent diagnosis of sonar faults based on knowledge graphs and large language models, characterized in that, Includes the following steps: Step S1: Receive the initial fault description text input by the user through the natural language interactive interface; Step S2: Perform a completeness analysis on the initial fault description text to determine whether it contains all the preset key information dimensions; the key information dimensions include at least the faulty device, fault phenomenon, fault occurrence time, and environmental conditions; Step S3: If the judgment result of the integrity analysis is negative, the interactive guidance mechanism is activated. Through the natural language interaction interface, targeted questions are generated and raised to the user to guide the user to supplement the missing key information until the complete fault description text is obtained. Step S4: Obtain the scene parameters input by the user; based on the complete fault description text and the scene parameters, perform joint reasoning using a pre-trained large language model configured with a sonar fault knowledge graph and a scene-aware reasoning model. The joint reasoning includes: Step S41: Perform semantic parsing on the complete fault description text and map it to one or more standardized fault entities in the sonar fault knowledge graph; Step S42: Based on the standardized fault entities, perform semantic reasoning in the sonar fault knowledge graph, and combine the large language model's ability to understand contextual information to generate at least one candidate diagnostic conclusion. Step S43: The scene-aware reasoning model employs a multilayer perceptron and attention mechanism to perform weighted matching calculations on multiple predefined diagnostic path templates, selecting the diagnostic path with the highest score. Specifically, this includes: Step S431: Integrate the scene parameters into a structured scene feature vector S=[d,t,m,p,n,e], where d represents water depth, t represents temperature, m represents installation method, p represents detection mode, n represents noise level, and e represents operational experience. Step S432: Input the scene feature vector and the mapped standardized fault entity into the scene perception reasoning model; Step S433: Based on the scene feature vector, the scene-aware reasoning model performs weighted matching on multiple predefined diagnostic path templates adapted to different scenes, and selects the diagnostic path template with the highest score. The parameter dynamic weight allocation model completes the weight allocation of parameters in the feature vectors of the different scenarios, as shown below: in, Let i be the weight of parameter i in the t-th diagnosis. For the current scene parameters, Let σ represent the historical repair success rate, and σ be the activation function. , These are learnable parameters; Step S44: The large language model performs reasoning in the knowledge graph along the selected diagnostic path template to generate diagnostic conclusions that are highly relevant to the current usage scenario; Step S5: Based on the conclusion of joint reasoning, generate and output a structured fault diagnosis report, which includes the fault type, potential causes and maintenance recommendations.
2. The intelligent sonar fault diagnosis method based on knowledge graph and large language model according to claim 1, characterized in that, Also includes: Step S6: After the user performs the repair operation based on the diagnostic report, receive the repair feedback information input by the user; Step S7: Based on the repair feedback information, dynamically update the sonar fault knowledge graph.
3. The intelligent sonar fault diagnosis method based on knowledge graph and large language model according to claim 2, characterized in that, In step S7, if the feedback indicates successful repair, the weight of the diagnostic path used in this diagnosis is increased; if the feedback indicates failed repair, this diagnostic process is recorded as a negative sample, and a correction reasoning mechanism is initiated to generate correction suggestions.
4. A sonar fault intelligent diagnosis system for implementing the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any one of claims 1 to 3, characterized in that, include: The interaction module is used to receive the initial fault description text input by the user through the natural language interaction interface; The fault description integrity assessment module is used to perform integrity analysis on the initial fault description text to determine whether it contains all the preset key information dimensions; the key information dimensions include at least the faulty equipment, fault phenomenon, fault occurrence time and environmental conditions. The interactive guidance module is used to: if the judgment result of the integrity analysis is negative, then activate the interactive guidance mechanism, generate and raise targeted questions to the user through the natural language interactive interface, so as to guide the user to supplement the missing key information until the complete fault description text is obtained; The intelligent reasoning and fault diagnosis module is used to perform reasoning based on the complete fault description text using a large language model that has been pre-trained and configured with a sonar fault knowledge graph. The output module is used to generate and output a structured fault diagnosis report based on the conclusions of joint reasoning. The fault diagnosis report includes the fault type, potential causes, and maintenance recommendations.
5. The intelligent sonar fault diagnosis system based on knowledge graph and large language model according to claim 4, characterized in that, The interaction module is also used to receive repair feedback information input by the user after the user performs repair operations based on the diagnostic report; The update module is used to dynamically update the sonar fault knowledge graph based on the repair feedback information.
6. An electronic device, characterized in that, include: One or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, implement the sonar fault intelligent diagnosis method based on knowledge graph and large language model as described in any one of claims 1 to 3.