Fault diagnosis method and computer program product
By combining a large language model with a knowledge graph, the system automatically identifies the cause of the fault and recommends spare parts, solving the problems of existing fault diagnosis methods that rely on human experience and system fragmentation. This enables efficient and intelligent fault handling and spare parts recommendation, improving maintenance efficiency and user experience.
Patent Information
- Application Number
- CN202511662740.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-06
AI Technical Summary
Existing fault diagnosis methods rely on human experience, resulting in low diagnostic efficiency and large fluctuations in accuracy. Fault code mechanisms are difficult to understand, self-diagnosis systems have weak semantic recognition capabilities, fault diagnosis is disconnected from spare parts query systems, and there is a lack of spare parts alternatives, which affects maintenance efficiency and user experience.
By combining a large language model with a knowledge graph, the system automatically identifies the causes of equipment failures, recommends spare parts, and queries inventory and alternatives, thus achieving a closed-loop process for fault diagnosis and spare parts recommendation. It also utilizes SQLAgent and RPCInvoker components to access heterogeneous systems and constructs a multi-level knowledge graph with interconnected nodes for intelligent fault handling.
It improved fault handling efficiency, reduced misdiagnosis and missed diagnosis, enhanced user experience, improved the adaptability of spare parts recommendations and the system's adaptability, and simplified the maintenance process.
Smart Images

Figure CN121479332A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large language model, in particular to a fault diagnosis method and a computer program product. BACKGROUND
[0002] With the popularization of intelligent household appliances and the continuous improvement of technical complexity, the types of faults that may occur during the operation of the devices are increasingly diversified, and the difficulty of judging the causes of the faults also increases. The traditional fault diagnosis and maintenance support mode has been difficult to meet the urgent needs of high efficiency, accuracy and intelligent operation and maintenance.
[0003] In the prior art, a common fault diagnosis method is to rely on human experience. After-sales technical personnel usually need to rely on personal experience or consult limited technical documents to make fault judgments, which results in low diagnosis efficiency, and the accuracy of the diagnosis result depends on the experience level of the technical personnel, and there is great volatility. Especially when facing new devices or rare faults, the difficulty of manual judgment increases significantly, which is easy to misjudge or miss, and thus affects the maintenance efficiency and device availability.
[0004] Another existing fault diagnosis method is to use a fault diagnosis system for automatic judgment. However, in such a system, even if the fault cause can be identified, the user or the maintenance personnel still needs to judge whether the spare part needs to be replaced and manually find the available spare part information. This mechanism of separating diagnosis and spare part recommendation makes the fault handling process cumbersome and the response cycle prolonged, which seriously affects the maintenance efficiency and user experience. SUMMARY
[0005] The purpose of the present application is to provide a fault diagnosis method and a computer program product to solve the problems existing in the prior art.
[0006] Embodiments of the present application can be implemented as follows: In a first aspect, the present application provides a fault diagnosis method, comprising: obtaining a device type, a device model and fault information of a target device; determining a fault cause of the target device based on the device type, the device model and the fault information; based on the fault cause, finding out disposal data from a target knowledge graph corresponding to the device model; if the disposal data includes disposal measures and spare part identifiers of at least one recommended spare part, determining detailed information of each recommended spare part based on the device type and the device model of the target device and the spare part identifiers of each recommended spare part; outputting a fault diagnosis result based on the fault cause, the disposal measures and the detailed information of each recommended spare part.
[0007] In an optional implementation, in the target knowledge graph, the model number node has a unidirectional relationship with a plurality of cause nodes, each cause node has a unidirectional relationship with a maintenance node, at least one maintenance node has a unidirectional relationship with a standard spare part node, and at least one standard spare part has a unidirectional relationship with at least one compatible spare part node. The step of searching for disposal data from the target knowledge graph corresponding to the equipment model based on the fault cause comprises: From a plurality of preset knowledge graphs, a target knowledge graph in which the model number node matches the equipment model is searched for; From the target knowledge graph, a target cause node matching the fault cause is searched for; From the target knowledge graph, a target maintenance node having a unidirectional relationship with the target cause node is searched for, and the disposal measure is obtained from the node attribute of the target maintenance node; If the target maintenance node has a unidirectional relationship with a standard spare part node, a spare part identifier of a standard recommended spare part is obtained from the node attribute of a target standard spare part node associated with the target maintenance node; If the target standard spare part node has a unidirectional relationship with a compatible spare part node, a spare part identifier of a compatible recommended spare part is obtained from the node attribute of a target compatible spare part node associated with the target standard spare part node.
[0008] In an optional implementation, the step of determining detailed information of each recommended spare part based on the equipment type and the equipment model of the target equipment and the spare part identifier of each recommended spare part comprises: A large language model is called to construct a query parameter and determine a called target agent component based on the spare part identifier of each recommended spare part and the equipment type and the equipment model of the target equipment; The target agent component is called to obtain detailed information of each recommended spare part based on the query parameter.
[0009] In an optional implementation, when the target agent component is an SQLAgent component, the step of calling the target agent component to obtain detailed information of each recommended spare part based on the query parameter comprises: The SQLAgent component is called to generate an SQL query statement based on the query parameter, and detailed information of each recommended spare part is queried from a database based on the SQL query statement; When the target agent component is an RPCInvoker component, the step of calling the target agent component to obtain detailed information of each recommended spare part based on the query parameter comprises: The RPCInvoker component is invoked to generate an RPC request based on the query parameters, and to request detailed information of each recommended spare part from a corresponding internal service interface based on the RPC request.
[0010] In an optional embodiment, the fault information includes a fault code and / or a fault description; and the step of determining the fault cause of the target device based on the device type, the device model, and the fault information includes: filling the device type, the device model, and the fault information into a preset prompt template to obtain a generated prompt word; inputting the generated prompt word into a troubleshooting model to obtain a fault diagnosis result; the generated prompt word is used to instruct the troubleshooting model to perform fault analysis based on input information and a preset additional exclusion prompt, and to output the fault diagnosis result in a preset format; taking a main cause in the fault diagnosis result as the fault cause of the target device.
[0011] In an optional embodiment, the troubleshooting model is obtained by training in the following manner: obtaining an initial data set, the initial data set including a plurality of historical maintenance samples, the historical maintenance samples including device types, device models, historical fault information, and historical fault causes; unifying the historical fault causes in the initial data set into standardized descriptions based on a preset fault cause set to obtain an adjusted data set; fine-tuning a large language model using the adjusted data set to obtain the troubleshooting model.
[0012] In an optional embodiment, the fault cause set includes a plurality of standardized fault causes corresponding to each of a plurality of device types, and corresponding fault cause encodings and cause feature vectors; The step of unifying the historical fault causes in the initial data set into standardized descriptions based on the preset fault cause set to obtain the adjusted data set includes: for each of the historical maintenance samples, obtaining a historical fault cause and a device type from the historical maintenance sample; converting the obtained historical fault cause into a historical cause feature vector; performing similarity matching between the historical cause feature vector and each cause feature vector corresponding to the obtained device type in the fault cause set to determine a target cause feature vector most similar to the historical cause feature vector; replacing the historical fault cause in the historical maintenance sample with a standard fault cause corresponding to the target cause feature vector.
[0013] In an optional embodiment, the step of obtaining the device type, the device model and the fault information of the target device comprises: obtaining multi-source fault data; extracting the product name description, the model description and the fault information of the target device from the multi-source fault data; converting the product name description into the device type corresponding to the target device; converting the model description into the standardized device model.
[0014] In an optional embodiment, the method further comprises: recording a model conversion process when the device model is obtained; recording a fault diagnosis process when the fault cause is obtained; recording a spare part recommendation process when the detailed information of each recommended spare part is obtained; generating structured fault diagnosis data based on the device type, the device model, the fault information, the model conversion process, the fault diagnosis process and the spare part recommendation process.
[0015] In a second aspect, the present application provides a computer program product, which, when executed by a processor, implements the fault diagnosis method of the first aspect.
[0016] Compared with the prior art, the embodiments of the present application provide a fault diagnosis method and a computer program product. The method comprises the following steps: obtaining the device type, the device model and the fault information of a target device; then determining the fault cause of the target device based on the device type, the device model and the fault information, so as to automatically perform fault diagnosis without relying on human experience and to avoid misjudgment and missed judgment; then finding out disposal data from a target knowledge graph corresponding to the device model based on the fault cause; if the disposal data comprises disposal measures and spare part identifiers of at least one recommended spare part, then determining the detailed information of each recommended spare part based on the device type and the device model of the target device and the spare part identifiers of the recommended spare parts; and outputting a fault diagnosis result based on the fault cause, the disposal measures and the detailed information of each recommended spare part. The present application realizes spare part recommendation through a knowledge graph, so that the combination of fault diagnosis and spare part recommendation helps to improve fault processing efficiency and increase user experience. BRIEF DESCRIPTION OF DRAWINGS
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a fault diagnosis method provided in an embodiment of the present invention.
[0019] Figure 2 This is an example diagram of multi-source fault data provided in an embodiment of the present invention.
[0020] Figure 3 This is an example diagram of a preset prompt template provided in an embodiment of the present invention.
[0021] Figure 4 This is an example diagram of a storage structure for a fault cause set provided in an embodiment of the present invention.
[0022] Figure 5 This is an example diagram of a knowledge graph provided in an embodiment of the present invention. Detailed Implementation
[0023] 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, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0024] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0025] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0026] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.
[0027] Here, we will first introduce the keywords or key terms involved in this invention.
[0028] 1. SQLAgent Component: An intelligent database query agent component for accessing structured database systems (MySQL, PostgreSQL, etc.). This invention uses the SQLAgent component to convert natural language query requests into structured SQL (Structured Query Language) statements and send the SQL statements to the target database to obtain query results.
[0029] 2. RPCInvoker (Remote Procedure Call Invoker) component: A key component in the Remote Procedure Call (RPC) framework, also known as a remote interface call scheduler, it is a proxy module used to access remote interfaces or APIs in heterogeneous or historical systems. It can parse call requests in natural language, construct parameters according to predefined RPC templates, execute the call, and parse the return results.
[0030] Currently, mainstream fault handling mechanisms still have the following significant problems: (1) Fault diagnosis relies on human experience: After-sales technicians often need to make judgments based on past experience or by consulting limited technical documents, resulting in low diagnostic efficiency and large fluctuations in accuracy. The diagnostic process is even more difficult when facing new equipment or rare faults. (2) The fault code mechanism has limitations: Although some high-end equipment has introduced a fault code mechanism, these codes usually require professional personnel to interpret, and ordinary users find them difficult to understand. Furthermore, the mapping relationship between fault codes and actual fault causes is unclear, making it difficult to directly guide maintenance operations. (3) Weak semantic recognition capability of self-diagnosis system: The existing self-diagnosis system based on keyword matching cannot accurately understand the fault phenomenon described by the user, resulting in the recommended solution not matching the actual problem, which reduces the user experience and diagnostic efficiency; (4) Fault diagnosis and spare parts query system are disconnected: In the traditional maintenance process, users or technicians usually need to switch between different systems to query fault information and spare parts information, which leads to cumbersome process, slow response and affects maintenance efficiency. (5) Lack of support for spare parts alternatives: When the recommended standard spare parts are in short supply or out of stock, the existing system usually cannot provide recommendations for compatible alternative spare parts, causing maintenance delays and further extending equipment downtime.
[0031] Based on the discovery of the aforementioned technical problems, the inventors, through creative labor, proposed the following technical solutions to solve or improve these problems. It should be noted that the deficiencies in the solutions of the prior art are all results derived by the inventors after practical experience and careful research. Therefore, the discovery process of the aforementioned problems and the solutions proposed in the embodiments of this application below should be considered contributions made by the inventors to this application during the inventive process, and should not be construed as technical content known to those skilled in the art.
[0032] In view of this, embodiments of the present invention provide a fault diagnosis method that achieves rapid response and intelligent fault handling through a closed-loop fault handling system that integrates natural language understanding, intelligent fault diagnosis, fault handling measure determination, automatic spare parts recommendation and inventory and alternatives query capabilities.
[0033] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a fault diagnosis method provided in an embodiment of the present invention. The subject executing this method can be an electronic device such as a smartphone, personal laptop, personal computer, or server. The method includes the following steps S201 to S205.
[0034] S201. Obtain the equipment type, equipment model, and fault information of the target equipment.
[0035] In this embodiment, basic input parameters for subsequent analysis are first collected. Among them, the device type is used to distinguish different categories of devices, such as kitchen appliances such as range hoods, gas stoves, disinfection cabinets, steam ovens, and microwave ovens; the device model is used to identify the specific model of the target device; and the fault information is used to reflect the specific manifestation of the current device abnormality, which may include fault descriptions written by the user in natural language and / or fault codes automatically displayed by the device.
[0036] S202. Based on the equipment type, equipment model, and fault information, determine the cause of the target equipment's fault.
[0037] In this embodiment, the system uses the aforementioned input parameters for comprehensive analysis. By modeling the correlation between equipment operating characteristics, common fault modes and their semantic expressions, it derives the most likely root cause of the current fault phenomenon.
[0038] S203. Based on the cause of the fault, retrieve the handling data from the target knowledge graph corresponding to the equipment model.
[0039] The graph database stores a large number of knowledge graphs corresponding to different equipment models of different equipment types. These knowledge graphs reflect the handling measures taken for the corresponding equipment models under different fault causes.
[0040] S204. If the disposal data includes disposal measures and spare part identifiers for at least one recommended spare part, then based on the equipment type and model of the target equipment and the spare part identifiers for each recommended spare part, determine the detailed information for each recommended spare part.
[0041] The detailed information for recommended spare parts may include, but is not limited to, inventory quantity, price information, storage warehouse location, delivery cycle, physical dimensions, electrical parameters, compatibility notes, and whether it is a standard configuration part or a replacement part.
[0042] S205. Based on the cause of the fault, the corrective measures, and detailed information on each recommended spare part, output the fault diagnosis results.
[0043] In this embodiment, the aforementioned fault causes, handling measures, and detailed information on each recommended spare part are integrated and structured to form a complete technical guidance document or visual report for reference by maintenance personnel or end users.
[0044] The fault diagnosis method provided in this invention first obtains the equipment type, model, and fault information of the target equipment. Then, based on the equipment type, model, and fault information, it determines the cause of the fault, thus automatically diagnosing the fault without relying on human experience and avoiding misdiagnosis or missed diagnosis. Next, based on the fault cause, it retrieves handling data from the target knowledge graph corresponding to the equipment model. If the handling data includes handling measures and the spare part identifier of at least one recommended spare part, it determines the detailed information of each recommended spare part based on the equipment type and model of the target equipment and the spare part identifiers of each recommended spare part. Based on the fault cause, handling measures, and the detailed information of each recommended spare part, it outputs the fault diagnosis result. This invention achieves spare part recommendation through a knowledge graph, thus combining fault diagnosis with spare part recommendation, which helps improve fault handling efficiency and enhances user experience.
[0045] Optionally, the implementation process of step S201 above may include S2011~S20214: S2011. Obtain multi-source fault data.
[0046] Multi-source fault data may include, but is not limited to: (1) Fault inquiry text actively entered by users in APP, mini program, web page or voice terminal; (2) The fault call text obtained by speech recognition of the content of telephone customer service calls; (3) The fault description field in the user's problem in the historical maintenance work order; (4) Fault codes automatically reported by the device.
[0047] S2012. Extract the product name description, model description, and fault information of the target device from the multi-source fault data. S2013. Convert the product name description into the device type corresponding to the target device; S2014. Convert the model description into a standardized equipment model.
[0048] The extracted product name and model descriptions may be colloquial or simplified descriptions from users, and need to be converted into standardized device types and device models.
[0049] For example, a product name description like "range hood" is transformed into "range extractor," and a model description like "66A3S" is transformed into a complete equipment type like "CXW-260-66A3S." For instance, as... Figure 2 This is an example of structured data extracted from customer service call transcription. Figure 2 In this example, the text following / / indicates a comment. It should be noted that this example is for illustrative purposes only and is not intended to be limiting.
[0050] In an optional implementation, to quickly achieve intelligent fault diagnosis, fault diagnosis can be achieved by calling a fault diagnosis model obtained by fine-tuning a large language model. That is, the implementation process of step S202 above can include S2021~S2023.
[0051] S2021. Fill the device type, device model and fault information into the preset prompt template to obtain the generated prompt word.
[0052] The preset prompt template can include role settings, task description, input information to be filled, additional exclusion prompts (used to guide the model to actively avoid fault categories unrelated to the current input during inference), and output requirement examples. Optionally, a separate prompt template can be designed for each device type, or a single prompt template can be used for all device types.
[0053] For example, such as Figure 3 This is an example of a preset prompt template. Figure 3 The double curly braces indicate the content that needs to be replaced: {{product_category}} needs to be replaced with the device type, {{product_model}} needs to be replaced with the device model, {{description} needs to be replaced with the fault description, and {{fault_code}} needs to be replaced with the fault code. It should be noted that this example is for illustrative purposes only and is not intended to be limiting.
[0054] S2022. Input the generated prompt words into the fault diagnosis model to obtain the fault diagnosis results.
[0055] Among them, combined Figure 3 It can be seen that the generated prompt words can be used to instruct the fault diagnosis model to perform fault analysis based on the input information and preset additional troubleshooting prompts, and output the fault diagnosis results according to the preset format.
[0056] S2023. Take the main cause in the fault diagnosis result as the cause of the target equipment's fault.
[0057] In this embodiment, the obtained fault diagnosis results may include the primary cause and its confidence level, as well as secondary causes.
[0058] This invention introduces a guided reasoning mechanism based on prompting engineering, enabling the fault diagnosis model to complete highly reliable intelligent fault attribution judgments under limited output formats, providing a reliable prerequisite for subsequently searching for and handling data from the target knowledge graph.
[0059] Optionally, the fault diagnosis model can be trained through the following steps S101~S103.
[0060] S101. Obtain the initial dataset, which includes several historical maintenance samples. The historical maintenance samples include equipment type, equipment model, historical fault information, and historical fault cause.
[0061] The initial dataset can be obtained by extracting and labeling the following data: 1) Alignment sample of "user description + final repair record" exported from the work order system; 2) Product instruction manual; 3) Fault Code Explanation Manual (Mapping common fault codes and their causes); 4) Training materials for maintenance engineers; 5) Frequently Asked Questions for Engineers; This content is used to create a high-quality annotation set by combining template-based annotation with expert review, thereby enhancing the accuracy of diagnosis.
[0062] S102. Based on the preset set of fault causes, the historical fault causes in the initial dataset are standardized into a unified description to obtain the adjusted dataset.
[0063] Optionally, the fault cause set is a standardized terminology library, which may include multiple standardized fault causes corresponding to each equipment type, along with their corresponding fault cause codes, cause feature vectors, and Chinese semantic descriptions. For example, such as... Figure 4 This is an example diagram of a set of fault causes. Figure 4 The text only does not show the causal feature vector and Chinese semantic description for each standardized fault cause, but... Figure 4 The examples shown are merely illustrative and are not intended to be limiting.
[0064] Therefore, for each historical fault cause in the initial dataset, the corresponding standardized fault cause can be determined by similarity matching with the fault cause set. That is, for each historical maintenance sample in the initial dataset, the standardization transformation process may include: S1021. Obtain the historical fault causes and equipment types from this historical maintenance sample; S1022. Convert the acquired historical fault causes into historical cause feature vectors; S1023. Use the historical cause feature vector and the obtained device type to perform similarity matching on each cause feature vector in the fault cause set to determine the target cause feature vector that is most similar to the historical cause feature vector. S1024. Replace the historical fault causes in the historical maintenance samples with the standard fault causes corresponding to the target cause feature vector.
[0065] Standardizing the historical fault causes in the initial dataset ensures that the fault causes output by the subsequent fault diagnosis model are all standardized, facilitating spare parts search in the knowledge graph.
[0066] S103. Fine-tune the large language model using the adjusted dataset to obtain the fault diagnosis model.
[0067] Fine-tuning can be achieved through methods such as instruction tuning, supervised fine-tuning (SFT), or multi-task training.
[0068] In the optional implementation methods, each pre-defined knowledge graph can contain the following node types: 1) Model Node: The node attribute can reflect the device model (product_model), such as “CXW-260-66A3S”ProductModel; 2) Cause node: The node attribute can reflect the cause of the fault (fault_reason), such as "motor starting capacitor failure"; 3) Repair Nodes: Node attributes can reflect repair actions, such as "replace the starting capacitor"; 4) Standard Spare Part Node: Node attributes can reflect the spare part identifier (part_number) and specifications (spes) of the standard spare part, such as a capacitor with spare part identifier "SP-00123" and specification "CBB61 4.5μ". 5) Compatible Spare Part Node: Node attributes can reflect the spare part identifier (part_number) and specifications (spes) of the compatible spare part (substitute_part).
[0069] Furthermore, the edge relationships in a knowledge graph can include the following types: 1) has_fault_reason: Indicates the cause of the fault as indicated by the device model; 2) requires_action: Indicates the recommended maintenance action for a certain fault cause; 3) uses_part: Indicates the standard spare parts required for a certain maintenance operation; 4) has_substitute: indicates that a spare part has a compatible substitute or a compatible spare part that can be used for a certain maintenance action.
[0070] The knowledge graph construction process involves: acquiring source data, such as fault code manuals, historical work order corpora, and manual annotations; generating quadruples (equipment model, fault cause, maintenance action, and available spare parts) through entity recognition and relation extraction; and finally modeling entity nodes and edge relationships using a graph database (Neo4j). An example graph is provided.
[0071] Therefore, in the target knowledge graph, model nodes have unidirectional relationships with multiple cause nodes, each cause node has a unidirectional relationship with one maintenance node, at least one maintenance node has a unidirectional relationship with one standard spare part node, and at least one standard spare part has a unidirectional relationship with at least one compatible spare part node. For example... Figure 5 The knowledge graph shown; or, it could be a single node with unidirectional relationships to both standard spare parts nodes and compatible spare parts nodes, i.e. Figure 5 The maintenance node in the system points directly to the compatible spare parts node. Figure 5 The examples shown are merely illustrative and are not intended to be limiting.
[0072] Therefore, the implementation of step S203 above can include S2031 to S2035.
[0073] S2031. From several preset knowledge graphs, find the target knowledge graph that matches the model node with the equipment model.
[0074] Each device model corresponds to an independent knowledge graph, so the corresponding target knowledge graph can be determined based on the device model of the target device.
[0075] S2032. From the target knowledge graph, find the target cause node that matches the cause of the fault.
[0076] There are two ways to determine the target cause node: Method 1: Exact Name Match: Find the cause node that is exactly the same as the text description of the "Cause of Fault"; Method 2, Semantic Vector Similarity Matching: When the cause of the fault is not completely consistent with the terminology database, fuzzy matching is performed using vector similarity (e.g., the diagnostic output "motor capacitor failure" and "motor starting capacitor failure" in the terminology database).
[0077] S2033. From the target knowledge graph, find the target maintenance node that has a one-way relationship with the target cause node, and obtain the handling measures from the node attributes of the target maintenance node.
[0078] S2034. If there is a one-way relationship between the target maintenance node and the standard spare parts node, then obtain the spare parts identifier of the standard recommended spare parts from the node attributes of the target standard spare parts node associated with the target maintenance node.
[0079] S2035. If there is a one-way relationship between the target standard spare part node and the compatible spare part node, then obtain the spare part identifier of the compatible recommended spare part from the node attributes of the target compatible spare part node associated with the target standard spare part node.
[0080] For example, assuming the device model is "CXW-260-66A3S" and the fault cause determined in step S202 is "motor starting capacitor failure", then based on this, the search... Figure 5 The following processing data can then be obtained: { "repair_action": "Replace the startup capacitor", / / Repair measures "part": { / / Specify the spare parts identification and specifications.} "part_number": "SP-00123", "spec": "CBB61 4.5μF" }, "substitutes": [ / / Spare part identification and specifications for compatible spare parts] { "part_number": "SP-00124", "spec": "CBB61-A 4.5μF" } ] } It should be noted that this example is for illustrative purposes only and is not intended to be limiting.
[0081] This invention constructs a complete reasoning chain from equipment model through fault cause, maintenance action to standard and compatible spare parts by explicitly defining unidirectional associations between multi-level nodes in a knowledge graph. This structured data organization not only improves the retrieval accuracy of fault handling information and enables targeted retrieval, but also enhances the adaptability and practicality of spare parts recommendations.
[0082] In real-world enterprise operations and maintenance scenarios, companies may employ heterogeneous inventory management systems and price query systems for different product categories and sales channels, for example: 1) High-end models are integrated into a unified ERP (Enterprise Resource Planning) system; 2) Standard products are stored in a lightweight inventory database; 3) Customized RPC (Remote Pall Call) interfaces were used for historical models and after-sales channels; 4) Some price information comes from the pricing platform rather than the inventory system.
[0083] Therefore, to improve system versatility and query capabilities, this invention employs a large language model to drive the FunctionCall mechanism, intelligently scheduling components such as SQLAgent and RPCInvoker to achieve dynamic adaptation and access to different systems. That is, the implementation of step S204 above can include S2041~S2042.
[0084] S2041. Invoke the large language model, construct query parameters based on the spare part identifier of each recommended spare part and the device type and device model of the target device, and determine the target proxy component to be invoked.
[0085] In this embodiment, the large language model not only parses the input context to identify key query elements, but also determines the type of proxy component to be invoked, i.e., the target proxy component, based on a preset routing strategy. This target proxy component is a functional module with specific data access capabilities, capable of connecting to different types of backend service systems, thereby achieving a unified access point to heterogeneous data sources.
[0086] S2042. Invoke the target agent component to obtain detailed information for each recommended spare part based on the query parameters.
[0087] The structured instructions output by the large language model consist of two parts: first, standardized query parameters for subsequent queries, such as spare parts number, warehouse location, and equipment model; and second, the identifier of the target proxy component to be invoked, instructing the system scheduler to distribute the request to the corresponding execution unit. In practice, the system scheduler invokes the target proxy component based on this instruction and passes the constructed query parameters to its execution context, whereby the proxy component performs the actual data acquisition.
[0088] In one possible scenario, when the target agent component is the SQLAgent component, the SQLAgent component is invoked to generate an SQL query statement based on the query parameters, and then the SQL query statement is used to retrieve detailed information about each recommended spare part from the database.
[0089] For example, if the query parameters include the spare part identifier "SP-00123" and the warehouse name "Beijing Warehouse", the generated SQL query statement could be: "SELECT stock, price FROM parts_inventory WHERE part_number = 'SP-00123' AND warehouse = 'Beijing Warehouse'". This SQL query statement is then submitted to the corresponding relational database for execution, returning structured result data containing fields such as inventory quantity and unit price.
[0090] In another possible scenario, when the target proxy component is the RPCInvoker component, the RPCInvoker component is invoked to generate an RPC request based on the query parameters, and then uses this RPC request to request detailed information about each recommended spare part from the corresponding internal service interface. The RPCInvoker component constructs an RPC request conforming to a specific interface specification based on the query parameters. This RPC request typically organizes parameters in key-value pairs and specifies the target method name.
[0091] For example, if the query parameters include the spare part identifier "SP-00123" and the warehouse name "Beijing Warehouse", the RPC request can be: "{method: 'getPartInfo', params: {part_number: 'SP-00123', warehouse:'Beijing Warehouse'}}", and sent to the internal service interface via HTTP (Hypertext Transfer Protocol) or a proprietary protocol. After the server responds, the RPCInvoker component parses the returned JSON or XML format data and extracts the detailed information of the required spare part.
[0092] This invention introduces a dynamic agent selection mechanism driven by a large language model, and combines two types of agent components, SQLAgent and RPCInvoker, to achieve unified abstraction and intelligent access to multi-source heterogeneous inventory systems. This effectively improves the adaptability and integration efficiency of the fault handling system in complex enterprise environments, and avoids the functional fragmentation problem caused by the diversity of system architecture.
[0093] In an optional implementation, the present invention also records diagnostic thought processes during each fault diagnosis. That is, the method may further include: S301. When obtaining the equipment model, record the model conversion process; S302. When the cause of the fault is obtained, record the fault diagnosis process; S303. When obtaining detailed information for each recommended spare part, record the spare part recommendation process; S304. Based on equipment type, equipment model, fault information, model conversion process, fault diagnosis process, and spare parts recommendation process, structured fault diagnosis data is generated.
[0094] In this embodiment, the structured fault diagnosis data obtained from each fault diagnosis is stored with a timestamp as an index, which facilitates subsequent traceability or can be used to optimize the fault diagnosis process.
[0095] Specifically, when step S2014 is completed, step S301 can be executed; when step S2023 is completed, step S302 can be executed; and when step S2042 is completed, step S303 can be executed.
[0096] For example, combined Figure 2 The content is used for fault diagnosis, and the structured fault diagnosis data generated by the final thought process can be shown below (where the text after / / represents a comment): { "input": { "description": "Suction power weakened", "fault_code": "E05", "product_model": "CXW-260-66A3S" }, "reasoning_steps": [ / / diagnostic steps] "Normalized model number is CXW-260-66A3S", / / Model conversion process / / Fault diagnosis process "Fault code E05 is initially suspected to be a capacitor-related fault." "Based on the description of 'loud sound,' it is inferred that the starting capacitor has failed." The recommended repair is to replace the starter capacitor. / / Spare parts recommendation process "Recommended spare part SP-00123, but it is out of stock." "Recommended alternative SP-00124, 43 pieces in stock" ] } Based on the examples above, the structured fault diagnosis results obtained in step S205 can be as follows: { "final_diagnosis": "Motor starting capacitor failure", / / Cause of the fault "confidence": 0.94, "repair_action": "Replace the startup capacitor", / / Repair measures "parts": [ / / Recommended spare parts] { "part_number": "SP-00123", "type": "Standard spare parts", "spec": "CBB61 4.5μF", / / Specification "stock": 0, / / Inventory "price": 16.50, "warehouse": "Beijing warehouse" }, { "part_number": "SP-00124", "type": "Compatible Alternative", "spec": "CBB61-A 4.5μF", "stock": 43, "price": 15.80, "warehouse": "Beijing warehouse" }, { "part_number": "SP-00210", "type": "Compatible Alternative", "spec": "CBB61-B 5.0μF", "stock": 18, "price": 14.90, "warehouse": Tianjin warehouse } ], "explanation": "Several optional spare parts are recommended, but the standard parts inventory is 0. A compatible alternative is returned." } The examples above are merely illustrative and are not intended to be limiting.
[0097] This invention also provides a computer program product that, when executed by a processor, implements the fault diagnosis method disclosed in the above embodiments.
[0098] In summary, this invention provides a fault diagnosis method and computer program product. First, it obtains the device type, model, and fault information of the target device. Then, based on the device type, model, and fault information, it determines the cause of the fault, thus automatically diagnosing the fault without relying on human experience, avoiding misdiagnosis and missed diagnosis. Next, based on the fault cause, it retrieves handling data from the target knowledge graph corresponding to the device model. If the handling data includes handling measures and at least one recommended spare part identifier, it determines detailed information for each recommended spare part based on the device type and model of the target device and the spare part identifiers of each recommended spare part. Based on the fault cause, handling measures, and detailed information for each recommended spare part, it outputs the fault diagnosis result. This invention uses a knowledge graph to achieve spare part recommendation, combining fault diagnosis with spare part recommendation to improve fault handling efficiency and enhance user experience.
[0099] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A fault diagnosis method, characterized in that, include: Obtain the target device's device type, model, and fault information; Based on the device type, device model, and fault information, determine the cause of the target device's fault; Based on the cause of the fault, the handling data is retrieved from the target knowledge graph corresponding to the equipment model; If the disposal data includes disposal measures and spare part identifiers of at least one recommended spare part, then based on the equipment type and model of the target equipment and the spare part identifiers of each of the recommended spare parts, detailed information of each recommended spare part is determined; Based on the cause of the fault, the corrective measures, and detailed information on each recommended spare part, output the fault diagnosis result.
2. The fault diagnosis method according to claim 1, characterized in that, In the target knowledge graph, there is a one-way relationship between the model node and multiple cause nodes, a one-way relationship between each cause node and a maintenance node, a one-way relationship between at least one maintenance node and a standard spare part node, and a one-way relationship between at least one standard spare part and at least one compatible spare part node. The step of retrieving handling data from the target knowledge graph corresponding to the device model based on the cause of the fault includes: From a number of pre-defined knowledge graphs, find the target knowledge graph that matches the model node with the device model; From the target knowledge graph, find the target cause node that matches the cause of the fault; From the target knowledge graph, find the target maintenance node that has a one-way relationship with the target cause node, and obtain the handling measures from the node attributes of the target maintenance node; If there is a one-way relationship between the target maintenance node and the standard spare parts node, the spare parts identifier of the standard recommended spare parts is obtained from the node attributes of the target standard spare parts node associated with the target maintenance node. If there is a one-way relationship between the target standard spare part node and the compatible spare part node, then the spare part identifier of the compatible recommended spare part is obtained from the node attributes of the target compatible spare part node associated with the target standard spare part node.
3. The fault diagnosis method according to claim 1, characterized in that, The step of determining the detailed information of each recommended spare part based on the equipment type and model of the target equipment and the spare part identifier of each recommended spare part includes: The large language model is invoked, and based on the spare part identifiers of each of the recommended spare parts and the device type and device model of the target device, query parameters are constructed and the target proxy component to be invoked is determined. The target agent component is invoked to obtain detailed information for each of the recommended spare parts based on the query parameters.
4. The fault diagnosis method according to claim 3, characterized in that, When the target agent component is an SQLAgent component, the step of invoking the target agent component to obtain detailed information for each recommended spare part based on the query parameters includes: The SQLAgent component is invoked to generate an SQL query statement based on the query parameters, and the detailed information of each recommended spare part is retrieved from the database based on the SQL query statement. When the target proxy component is an RPCInvoker component, the step of invoking the target proxy component to obtain detailed information for each recommended spare part based on the query parameters includes: The RPCInvoker component is invoked to generate an RPC request based on the query parameters, and the RPC request is used to request detailed information of each recommended spare part from the corresponding internal service interface.
5. The fault diagnosis method according to claim 1, characterized in that, The fault information includes fault codes and / or fault descriptions; the step of determining the cause of the fault in the target device based on the device type, the device model, and the fault information includes: Fill the device type, device model, and fault information into the preset prompt template to generate the prompt word; The generated prompts are input into the fault diagnosis model to obtain the fault diagnosis results; the generated prompts are used to instruct the fault diagnosis model to perform fault analysis based on the input information and preset additional troubleshooting prompts, and to output the fault diagnosis results in a preset format. The main cause in the fault diagnosis results is taken as the fault cause of the target device.
6. The fault diagnosis method according to any one of claims 1-5, characterized in that, The fault diagnosis model was trained in the following way: Obtain an initial dataset, which includes several historical maintenance samples, including equipment type, equipment model, historical fault information, and historical fault cause. Based on a preset set of fault causes, the historical fault causes in the initial dataset are standardized into a unified description to obtain an adjusted dataset. The large language model was fine-tuned using the adjusted dataset to obtain the fault diagnosis model.
7. The fault diagnosis method according to claim 6, characterized in that, The fault cause set includes various standardized fault causes corresponding to various equipment types, as well as their corresponding fault cause codes and cause feature vectors; The step of standardizing historical fault causes in the initial dataset based on a preset fault cause set to obtain an adjusted dataset includes: For each historical maintenance sample, the historical fault cause and equipment type are obtained from the historical maintenance sample; Convert the acquired historical fault causes into historical cause feature vectors; The historical cause feature vector is used to perform similarity matching with the obtained device type corresponding to each cause feature vector in the fault cause set in order to determine the target cause feature vector that is most similar to the historical cause feature vector; Replace the historical fault causes in the historical maintenance samples with the standard fault causes corresponding to the target cause feature vector.
8. The fault diagnosis method according to claim 6, characterized in that, The steps for obtaining the device type, device model, and fault information of the target device include: Acquire multi-source fault data; Extract the product name description, model description, and fault information of the target device from the multi-source fault data; Convert the product name description into the device type corresponding to the target device; The model description is converted into the standardized device model.
9. The fault diagnosis method according to claim 8, characterized in that, The method further includes: When the device model is obtained, the model conversion process is recorded; When the cause of the fault is determined, the fault diagnosis process is recorded; The spare parts recommendation process is recorded when detailed information for each of the recommended spare parts is obtained; Structured fault diagnosis data is generated based on the equipment type, equipment model, fault information, model conversion process, fault diagnosis process, and spare parts recommendation process.
10. A computer program product, characterized in that, When the computer program product is executed by a processor, it implements the fault diagnosis method according to any one of claims 1-9.
