Numerical control system fault diagnosis system and method fusing forward design and reverse case data

By building a knowledge graph that integrates forward design and reverse case data, combined with large models and multi-round dialogue technology, the ability to cope with new fault modes and multiple rounds of interaction problems in CNC system fault diagnosis is solved, and efficient and accurate fault diagnosis is achieved.

CN120233736APending Publication Date: 2025-07-01HUAZHONG UNIV OF SCI & TECH +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510383155.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The existing CNC system fault diagnosis methods lack the ability to respond to new fault modes, the diagnostic mechanism is not in-depth, and the multi-round interaction lacks targetedness and accuracy. The traditional knowledge base form is difficult to support the multi-round interaction between the big model and the user.

Method used

Combine forward design and reverse case data, build a knowledge graph, convert it into text corpus through PLC files and underlying alarm files, generate fault diagnosis results in combination with large models, and design task-oriented and role-oriented prompt words to support multiple rounds of dialogue.

Benefits of technology

It improves the accuracy and adaptability of fault diagnosis, optimizes multiple rounds of interaction capabilities, and improves the efficiency and accuracy of system diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120233736A_ABST
    Figure CN120233736A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of fault diagnosis, and particularly discloses a numerical control system fault diagnosis system and method fusing forward design and reverse case data, the numerical control system fault diagnosis system comprises a knowledge base and a large model, the knowledge base is used for determining cue words based on user questions, and the large model is used for outputting fault diagnosis results according to the cue words; the knowledge base is a fault diagnosis knowledge graph, a knowledge graph entity is extracted from forward design data and reverse case data of the numerical control system, the forward design data comprises a PLC file and a bottom layer alarm file of the numerical control system, and the reverse case data comprises historical fault diagnosis work order information of the numerical control system. According to the method, the interactivity and flexibility of the knowledge base can be improved, the multi-round interaction capability in the fault diagnosis process is optimized, and the method is of great significance in improving the system diagnosis efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of fault diagnosis, and more specifically, relates to a numerical control system fault diagnosis system and method that integrates forward design and reverse case data. Background Art

[0002] In recent years, with the rapid development of large model technology, new technical means have emerged in the field of numerical control system fault diagnosis. However, since large models are essentially "black box" systems and lack the explicit understanding ability of specific domain knowledge, they are prone to the "hallucination" problem in professional applications, that is, generating content that does not conform to the actual situation. To solve this problem, researchers have introduced Retrieval-Augmented Generation (RAG) technology, which provides factual support for the generation process of large models through knowledge base retrieval, thereby improving the accuracy and reliability of the generated content.

[0003] Traditional numerical control system fault diagnosis methods mainly rely on reverse case data to construct a knowledge base. When a system fails, the diagnosis system first retrieves cases similar to the current fault from the knowledge base and generates corresponding diagnostic suggestions through matching degree analysis. However, this method has certain limitations. First, the reverse diagnosis method can only diagnose existing fault cases, and its diagnosis mechanism is often relatively superficial and difficult to deeply analyze the root cause of the fault; second, reverse diagnosis heavily relies on a large case database, and the integrity and accuracy of the database directly affect the diagnosis effect. In the face of new fault modes or complex fault couplings, the model often lacks effective countermeasures.

[0004] Therefore, it is necessary to introduce a forward design method based on the existing mechanism. Forward design is essentially fault diagnosis based on a theoretical model. By constructing the mechanism and logical framework of system fault occurrence, it realizes fault prediction and diagnosis. Its core goal is to establish a complete causal chain for each potential fault path to ensure that when a fault occurs, the specific component and fault cause can be quickly located and corresponding solutions can be generated.

[0005] In addition, the traditional knowledge base form is difficult to support multi-round interactions between large models and users. In the existing framework, there may be multiple reasons corresponding to the same fault, and the system cannot dynamically select appropriate solutions through interactions with users, resulting in the answers of large models lacking pertinence and accuracy. Therefore, improving the interactivity and flexibility of the knowledge base and optimizing the multi-round interaction ability in the fault diagnosis process are of great significance for improving the system diagnosis efficiency and accuracy. Summary of the Invention

[0006] In view of the above defects or improvement requirements of the prior art, the present invention provides a CNC system fault diagnosis system and method that integrates forward design and reverse case data, aiming to improve the accuracy and adaptability of fault diagnosis Q&A.

[0007] To achieve the above object, according to one aspect of the present invention, a CNC system fault diagnosis system that integrates forward design and reverse case data is proposed, including a knowledge base and a large model, wherein:

[0008] The knowledge base is used to determine prompt words based on the user's question, and the large model is used to output a fault diagnosis result according to the prompt words;

[0009] The knowledge base is a fault diagnosis knowledge graph, and the entities of the knowledge graph are extracted from the CNC system forward design data and reverse case data. The forward design data includes the CNC system PLC file and the underlying alarm file, and the reverse case data includes the CNC system historical fault diagnosis work order information.

[0010] As a further preference, for the CNC system PLC file, first convert the PLC ladder diagram in the CNC system PLC file into text corpus, and then extract knowledge graph entities based on the text corpus.

[0011] As a further preference, the method of converting the PLC ladder diagram in the CNC system PLC file into text corpus is as follows:

[0012] Convert the PLC ladder diagram into a PLC statement list;

[0013] According to the PLC sequential program logic, convert the PLC statement list into a logical equation;

[0014] Match the logical equation in the PLC address database to obtain PLC corpus;

[0015] Input the PLC corpus into a large language model for optimization to obtain text corpus.

[0016] As a further preference, for the underlying alarm file, use a deep learning algorithm to extract knowledge from it to obtain the alarm corpus at the bottom layer of the CNC system, and then extract knowledge graph entities based on the alarm corpus.

[0017] As a further preference, in the knowledge graph, several entities are associated to form a fault diagnosis path, and the fault diagnosis path includes the following nodes: alarm number, alarm information, fault location, alarm phenomenon, fault cause, and solution.

[0018] As a further preference, the prompt words include task-oriented prompt words and role-oriented prompt words. Among them, the task-oriented prompt words are obtained from the knowledge graph according to the user's question, and the role-oriented prompt words are statements that limit the answers of the fault diagnosis system in the fault field.

[0019] As a further preference, the obtaining method of the task-oriented prompt words is as follows:

[0020] Perform intention recognition according to the user's question to determine the current question node, and then obtain the subsequent nodes associated with the current question node in the knowledge graph; encapsulate the subsequent nodes associated with the current question node as prompt words.

[0021] According to another aspect of the present invention, a fault diagnosis method is provided, including the following steps:

[0022] The user inputs the question into the above-mentioned CNC system fault diagnosis system that integrates forward design and reverse case data. The knowledge base queries the knowledge graph based on the user's question, encapsulates the query result as a prompt word, and the large model outputs the fault diagnosis result according to the prompt word.

[0023] As a further preference, it includes the following steps: The user asks further questions according to the fault diagnosis result. The fault diagnosis system accurately locates the user's question in combination with the historical conversation data and the current question, promotes the wandering of the fault diagnosis path, and outputs a new fault diagnosis result.

[0024] Generally speaking, compared with the prior art through the above technical solutions conceived by the present invention, the following technical advantages are mainly possessed:

[0025] 1. The present invention uses the CNC system PLC file and the CNC system bottom layer alarm file as forward design data, and combines the forward design data and reverse case data in the form of a knowledge graph to construct a diagnostic knowledge base for the large model RAG technology, greatly improving the accuracy and adaptability of fault diagnosis Q&A.

[0026] 2. Extracting the forward design data of the CNC system has high professional requirements, so it is difficult to apply the forward design data to the fault diagnosis of the CNC system; the present invention proposes a method for converting PLC ladder diagrams into text corpora for this problem, which can convert graphic information into text information and is convenient for integrating into the knowledge graph.

[0027] 3. The fault diagnosis system of the present invention based on the knowledge graph can accurately associate the context information in the diagnosis process and support multi-round conversations between the large model and the user, optimize the multi-round interaction ability in the fault diagnosis process, improve the interactivity and flexibility of the knowledge base, as well as the reasoning ability and accuracy in the fault diagnosis process. Description of the Drawings

[0028] Figure 1 Schematic diagram of the framework of the CNC system fault diagnosis system that integrates forward design and reverse case data in the embodiment of the present invention;

[0029] Figure 2 Flowchart of knowledge extraction from PLC alarm files in the embodiment of the present invention;

[0030] Figure 3 Flowchart of the fault diagnosis question - answering interaction in the embodiment of the present invention;

[0031] Figure 4 Example of a PLC ladder diagram in the embodiment of the present invention. Detailed implementation manners

[0032] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0033] A CNC system fault diagnosis system that integrates forward design and reverse case data provided by an embodiment of the present invention, as Figure 1 shown, includes a knowledge base and a large - model. The knowledge base is a knowledge graph including multiple fault diagnosis paths. The knowledge base is used to query based on the user's question to determine the prompt words, and the large - model is used to output the fault diagnosis result according to the prompt words.

[0034] Specifically, fault diagnosis paths are extracted from the forward design data and reverse case data, so as to combine the forward design data and reverse case data in the form of a knowledge graph. The forward design data includes the CNC system PLC file and the CNC system underlying alarm file, and the reverse case data includes the historical fault diagnosis work order information in the original case library.

[0035] Furthermore, for the CNC system PLC file: The alarm information in the PLC file is displayed in the form of a ladder diagram. Although it contains rich fault diagnosis knowledge, due to its graphical characteristics, it is difficult to directly process it as the corpus of the knowledge graph.

[0036] Based on the PLC logic, the present invention proposes a method for converting a PLC ladder diagram into text corpus, which can convert the graphical information into text information. The method for converting a PLC ladder diagram into text corpus, as Figure 2 shown, includes the following steps:

[0037] (1) Convert the PLC ladder diagram into a PLC statement table. Although the ladder diagram is intuitive and easy to understand, it is difficult for computers to understand the graphical representation. By combining the relevant logic of the PLC, the computer can extract sufficient information from the PLC statement table.

[0038] (2) According to the PLC sequential program logic, the PLC statement table is converted into a logical equation to further standardize the data structure.

[0039] (3) Pre-build a PLC address database, which stores PLC addresses and their corresponding Chinese meanings; match the logical equations in the PLC address database through the relevant matching method, so as to perform a preliminary translation of the PLC equations and generate preliminary PLC corpus.

[0040] (4) Since the preliminary corpus is directly converted from the sentence table, there are certain deficiencies in the fluency and accuracy of the language. With its excellent language generation ability and context understanding ability, the large language model can further optimize the initial corpus to obtain the text corpus. By using the large language model to polish the initial corpus, the final corpus that meets the grammatical and logical requirements can be generated, ensuring that the language expression is more accurate and fluent.

[0041] To facilitate understanding, a specific example is given. The initial PLC ladder diagram is as follows Figure 4 The converted PLC statement table is shown in Table 1; the PLC logic equation conversion process is shown in Table 2, and the specific PLC logic equation is G3010.0=(A+B+C)+D·E+F·G+H·I.

[0042] Table 1 PLC statement table

[0043]

[0044] Table 2 PLC logic equation conversion process

[0045]

[0046] The preliminary PLC corpus obtained is as follows:

[0047] The axis is not ready. Please check the conditions generated by the servo drive:

[0048] The servo enable status is abnormal;

[0049] X axis has an alarm;

[0050] There is an alarm on the Z axis;

[0051] Axis 3 servo alarms and the Huazhong servo tool holder is enabled;

[0052] Axis 4 servo alarm and the first power head is enabled;

[0053] Axis 6 servo alarm and the servo tailstock is enabled.

[0054] Furthermore, for the underlying alarm files of the numerical control system: by combining the alarm files with the experience of engineers and using deep learning algorithms for knowledge extraction, the alarm corpus at the underlying level of the numerical control system can be obtained. By combining these alarm corpora with the previously obtained PLC text corpora, a complete forward design dataset can be constructed.

[0055] Furthermore, according to the characteristics of the forward design data and the reverse case data, the present invention proposes an effective knowledge fusion method. Due to the differences in the structures of the forward design data and the reverse case data, it is difficult for traditional knowledge base methods to effectively combine the information of the two. Therefore, the present invention proposes to use a knowledge graph as a carrier to construct a more flexible and efficient knowledge base. The knowledge graph has a networked structural feature, enabling it to fully explore the associations between various types of information, thereby realizing the effective integration of the forward design data and the reverse case data.

[0056] In the knowledge graph, a complete fault diagnosis information should contain multiple key elements, namely multiple nodes: alarm number, alarm message, fault location, alarm phenomenon, fault cause, and solution. The relationships between the nodes form a complete fault diagnosis path. The constructed knowledge graph ontology is shown in Table 3, and this ontology structure can effectively fuse the forward design data and the reverse case data, providing comprehensive and accurate knowledge support for fault diagnosis.

[0057] Table 3 Numerical control system fault diagnosis knowledge graph ontology

[0058]

[0059] Furthermore, the quality of the answers generated by the large model depends to a large extent on the detail and specificity conveyed by the prompt words. Therefore, the present invention has deeply studied the design of the prompt words and divided them into task-oriented prompt words and role-oriented prompt words, and input them into the large model together.

[0060] For task-oriented prompts: They query from the knowledge graph according to the user's question and encapsulate the results. Specifically, based on the question input by the user, combined with the relevant results retrieved from the knowledge graph, they are used as the core content of the prompt, and a series of constraints are used to ensure that the answer highly matches the current requirements. For example, for a power module failure, the task-oriented prompt encapsulated according to the query results is: According to the alarm information of power module failure, the possible causes retrieved from the knowledge graph are: 1. Overcurrent in the servo IPM power module. 2. Fault in the servo IPM power module itself. Please answer the fault cause based on the above content. These constraints help limit the answer of the large model to only the information retrieved from the knowledge base, thus avoiding generating irrelevant or redundant content. In addition, task-oriented prompts play a key role in multi-round conversations, especially during the knowledge graph path traversal process, and can effectively guide the large model to generate more accurate responses in a specific direction.

[0061] For role-oriented prompts: They are statements that limit the answer range of the fault diagnosis system, usually pre-set by the system. For example, setting the role of the large model as an assistant specializing in CNC system fault diagnosis can enhance the response accuracy of the model in this field by clarifying the role positioning. This strategy enables the large model to focus on knowledge in a specific field, thereby improving the professionalism and reliability of problem-solving.

[0062] During the diagnosis process, the knowledge graph is retrieved by identifying the user's input intention, and the retrieved content and its associated nodes are given. Through multi-round conversations, it helps the user find a fault diagnosis path that meets the requirements and gives the corresponding solution. Specifically, the diagnosis process of the above-mentioned fault diagnosis system is as Figure 3 shown, including:

[0063] Identify the intention based on the user's input to determine whether the user is asking a question related to the diagnostic alarm number or alarm information.

[0064] The system determines whether the user input is a new round of conversation or a continuation of the historical conversation. If it is a historical conversation, the system will first obtain the historical conversation record and accurately locate the problem that the user needs to query in combination with the current input.

[0065] Based on the user's question, the system queries the CNC system fault diagnosis knowledge graph to obtain the subsequent nodes associated with the current node. Relying on the multi-hop question-answering mechanism, the subsequent nodes associated with the current problem node are stored in the query subgraph based on the user number. At the same time, the current problem node is encapsulated as a prompt word that conforms to the CNC system fault diagnosis field, and the encapsulated content is transmitted to the large model.

[0066] The large model generates responses based on the incoming prompt words. The system presents the answers of the large model to the user and stores the current conversation information in the history record at the same time.

[0067] Through the multi-round conversation method, the system promotes the traversal of the knowledge graph path to obtain the solution corresponding to the alarm information provided by the user, so as to help the user quickly locate and troubleshoot faults.

[0068] Those skilled in the art can easily understand that the above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A numerical control system fault diagnosis system integrating forward design and reverse case data, characterized in that: Includes knowledge base and large models, including: The knowledge base is used to determine prompt words based on user questions, and the large model is used to output fault diagnosis results according to the prompt words; The knowledge base is a fault diagnosis knowledge graph, and the knowledge graph entity is extracted from the forward design data and reverse case data of the CNC system. The forward design data includes the PLC file and the underlying alarm file of the CNC system, and the reverse case data includes the historical fault diagnosis work order information of the CNC system.

2. The numerical control system fault diagnosis system integrating forward design and reverse case data according to claim 1, characterized in that: For the CNC system PLC file, the PLC ladder diagram in the CNC system PLC file is first converted into text corpus, and then the knowledge graph entities are extracted based on the text corpus.

3. The numerical control system fault diagnosis system integrating forward design and reverse case data as claimed in claim 2, characterized in that: The method of converting the PLC ladder diagram in the CNC system PLC file into text corpus is: Convert PLC ladder diagram to PLC statement table; According to the PLC sequential program logic, convert the PLC statement table into a logical equation; Match the logical equations in the PLC address database to obtain the PLC corpus; The PLC corpus is input into the large language model for optimization to obtain the text corpus.

4. The numerical control system fault diagnosis system integrating forward design and reverse case data according to claim 1, characterized in that: For the underlying alarm files, a deep learning algorithm is used to extract knowledge from them to obtain the underlying alarm corpus of the CNC system, and then the knowledge graph entities are extracted based on the alarm corpus.

5. The numerical control system fault diagnosis system integrating forward design and reverse case data according to any one of claims 1 to 4, characterized in that: In the knowledge graph, several entities are associated to form a fault diagnosis path, which includes the following nodes: alarm number, alarm information, fault location, alarm phenomenon, fault cause and solution.

6. The numerical control system fault diagnosis system integrating forward design and reverse case data as claimed in claim 5, characterized in that: The prompt words include task-oriented prompt words and role-oriented prompt words, wherein the task-oriented prompt words are obtained from the knowledge graph according to the user's questions, and the role-oriented prompt words are sentences that limit the fault diagnosis system's answer to the fault field.

7. The numerical control system fault diagnosis system integrating forward design and reverse case data according to claim 6, characterized in that: The task-oriented prompt words are obtained as follows: Intent recognition is performed based on user questions to determine the current question node, and then the subsequent nodes associated with the current question node are obtained in the knowledge graph; the subsequent nodes associated with the current question node are encapsulated as prompt words.

8. A fault diagnosis method, characterized in that: The steps include: The user inputs the question into the CNC system fault diagnosis system integrating forward design and reverse case data as described in any one of claims 1 to 7, and the knowledge base encapsulates the query results as prompt words based on the user question query knowledge graph, and the large model outputs the fault diagnosis results according to the prompt words.

9. The fault diagnosis method according to claim 8, characterized in that: The steps include: The user asks further questions based on the fault diagnosis results. The fault diagnosis system combines historical conversation data and current questions to accurately locate the user's problem, promote the wandering of the fault diagnosis path, and output new fault diagnosis results.

Citation Information

Cited By

  • PLC program fault diagnosis method and system based on multi-modal large model, and medium

    CN120631954A

  • PLC program fault diagnosis method and system based on multi-modal large model and medium

    CN120631954B