Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 5, No. 1, 2023 273 Cases Integration System for Fault Diagnosis of CNC Machine Tools Based on Knowledge Graph Jiahai Wang1, Wenming Yin1, *, Jianxiang Gao1 1School of Mechanical Engineering, Tongji University, NO.4800 Caoan Road, Shanghai, P.R. China * Corresponding author: Wenming Yin (Email: 2030238@tongji.edu.cn) Abstract: Due to the time-consuming and labor-consuming maintenance required by appealing to service engineers during the diagnosis of CNC machine tool faults, the CNC machine tool fault diagnosis system has become the economical practical choice of intelligent workshop now, which can help CNC machine tool operators quickly locate and eliminate faults. Knowledge graph technology plays a great role in the use of structured data, and has also achieved a certain degree of research progress and good applications in other professional fields. This article focuses on how to extract semi-structured and unstructured fault knowledge from the abundant CNC machine tool fault cases, fault repair manuals and on-site maintenance logs on the market. A complete system is used to integrate this fault diagnosis knowledge with different formats and content but interrelated, so as to realize the structured application of fault diagnosis knowledge of CNC machine tools. This paper first fully analyzes the content and structural characteristics of these fault cases, and optimizes the design of a set of domain ontology for machine tool fault diagnosis, which contains 8 types of ontoly and 7 types of relation. Using the rule-based knowledge extraction method combined with the BiLSTM-CRF information extraction algorithm to extract effective information from this knowledge. Finally, the structured knowledge is stored through the Neo4J graph database for visualization. Under the application of a good ontology, the accuracy and effectiveness of the composite extraction algorithm have been proved to be greatly improved compared with the single information extraction algorithm in the experimental verification process. Keywords: CNC machine tool fault diagnosis, Composite Knowledge Extraction Algorithm, Domain Ontology, Knowledge Graph, Natural Language Processing. 1. Introduction When the CNC machine tool fails, the machine tool operator does not have good knowledge of machine tool fault diagnosis, and needs to ask the on-site engineer to solve the fault problem. This process is time-consuming and labor- intensive. How to help machine tool operators quickly locate faults and solve machine fault problems is a hot topic of current research. As a reliable system for rapid troubleshooting and diagnosis, the fault diagnosis system has been developed in the industry for many years, and a lot of important research on fault mechanisms and fault models has been accumulated. Mainly in the following aspects: (1) In-depth study of specific components of CNC machine tools; (2) According to the structural characteristics of the diagnosis object, combined with the specific content and phenomenon of the fault and the fault diagnosis experience of domain experts, construct the knowledge base of the fault diagnosis system; (3) Starting from the whole manufacturing process, combined with the connection of various factors, finally establish relevant simulation models, such as directed graph models [1]. Li Yeshun and others used knowledge discovery and data mining to build a power equipment fault diagnosis system, which solved the problem of directly obtaining knowledge from domain experts and knowledge engineers [2]. Liu Xuzhong and others used knowledge graph technology to extract, integrate and transform knowledge from the fault database, which improved the accuracy of fault judgment [3]. These studies have greatly enriched the information construction of expert machine tool fault diagnosis, and have guiding suggestions for the fusion of fault cases. Based on this, this paper fully analyzes the fault diagnosis information of different fault diagnosis maintenance manuals and fault diagnosis case sets on the market. Because of its superior structure and extensibility, knowledge graph technology has been well applied in other fields. Liu proposed a CNC fault diagnosis system that utilizes knowledge maps, marking the first time such technology was used in this field. However, the lack of relationship extraction links resulted in lower query efficiency [4]. Later, Wang introduced the attention mechanism to improve ontology construction, although there were still some issues that needed to be resolved [5]. Therefore, combining the characteristics of fault case information, how to construct a robust ontology model and design a set of good information extraction algorithms to effectively extract fault diagnosis information of CNC machine tools have become the two research focuses of this paper. 2. Source Data Analysis and Ontology Construction 2.1. Feature Analysis of Non-structured Case Set Books, literature materials, and maintenance manuals related to the diagnosis of CNC machine tool diagnosis and maintenance are analyzed. These analytical and research books include, but are not limited to the following: "Treasure Diagnosis and Maintenance Examples of CNC Machine Tools" written by Liu Caibao, "CNC Machine Tool Fault Diagnosis and Maintenance" written by Cai Bin, "Deng Sanpeng, "500 cases of CNC machine tool fault diagnosis and maintenance" written by Gong Zhonghua, "200 cases of Siemens CNC machine tools and electrical maintenance" 274 written by Han Hongzheng and"CNC Machine Tool Fault Diagnosis and Repair" written by Li Jingyan. The structure of the machine tool failure case, which contains four major parts, namely device information, fault symptom information, fault analysis information and fault measure information, is summarized. According to the characteristics of each part of the information, the main feature information in the content and format of each part of the information is summarized and summarized. It presents the following characteristics: 1. One or two types of information, including the CNC system type and the machine tool type, in the device information is explained. In addition, the data types of CNC system type information and machine tool type information are nouns. For example, the device information-"VMC-850 stand-up processing center with FANUC 0IC 0IC system" contains the CNC system information-"FANUC 0IC System" and the machine tool type information-"VMC-850 Establishment Processing Center"; the device information- "Siemens 802D processing center" contains only the CNC type information-"Siemens 802D processing center"; the device information-"certain CNC machine tools" contains only the machine tool type information-"CNC machine tools". 2. The fault symptom information briefly describes the fault phenomenon, which is characterized by explaining one or more fault location information. In addition, the data types of faulty symptom information are mostly complex text, and the data types of the fault position information are mostly noun phrases. For example, the faulty symptom information- "The running X-axis operation is unstable when the machine is running, and the specific manifestation is that when the X- axis stops at a certain position, it cannot stop." contains one fault position information-"X-axis"; the symptom information-"During the work process, the mechanical shift slip gear in the main spindle box is automatically separated from meshing, and main spindle stops." contains three pieces of fault position information-"the main spindle box", "the mechanical shift slip gear" and "main spindle". 3. In the fault analysis information, the cause of the possible failure was investigated one by one, and finally the cause of the real fault was locked according to the investigation information. The important feature of fault analysis information. One or more pieces of fault cause information and one or more pieces of fault locating information are given by fault analysis information, which is one of the essential features of it. In addition, the data type of fault analysis information is complex text, and the data types of the fault cause information and the fault locating information are mostly a data form that combines phrases or long sentences. For example, fault analysis information-"The shape and accuracy of the parts during processing cannot be guaranteed. The common reason is that the fault accuracy of the transmission mechanism or the rail fault accuracy is decreased. Failure positioning: ① Observe appearance. There are no obvious signs of damage to the sliding part and the plastic rail. ② Observe accuracy. The sliding part of the cast iron guide rails are maintained normally, and the accuracy of the plastic rail part has decreased. ③ According to the inspection results and inferences, due to the decline in the precision of the guide rail on the plastic part, the accuracy of the workbench has decreased. Causes the shape of the processing parts to decrease" contains 2 pieces of faulty cause information-"Driving mechanism failure" and "guide track failure accuracy decreases" and 3 pieces of fault locating information-"Observe appearance. There are no obvious signs of damage to the sliding part and the plastic rail", "Observe accuracy. The sliding part of the cast iron guide rails are maintained normally, and the accuracy of the plastic rail part has decreased" and "According to the inspection results and inferences, due to the decline in the precision of the guide rail on the plastic part, the accuracy of the workbench has decreased. Causes the shape of the processing parts to decrease." 4. The content of the fault measure information is how to take the correct measures to eliminate the fault after analyzing the cause of the fault. And the data type of fault measure information is complex text. For example, "Please replace the built-in encoder of the servo motor to restore the normal work of the machine" and "Please clean and carefully clean it according to the requirements of the raster ruler maintenance, the failure elimination" means fault measure information. Fault Symptom Fault Analysis Fault Measure Device Info. Explicit  info.Ie Implicit Info. CNC  type Machine  Tool Type Fault Position Fault Cause Fault Locating 1 1 1 1 1 n n n Pattern description: 1          1 to 1 n          1 to n a→b   a is connected  to b a=>b   b is extracted from a Figure 1. Relationship between explicit info. and implicit info. 2.2. Definition of explicit information and implicit information According to the different characteristics of different information types, several types of information mentioned above are now divided into two categories. As shown in figure 1. One category is explicit information, that is, the information that is intuitively reflected in the concentration of the case. There are obvious iconic logo characteristics. There are 4 types of explicit information in this article, which are device information, fault symptom information, fault analysis information and fault measure information. 275 Fault Symptom Fault Analyze Fault Measure Device Info. CNC  type Machine  Tool Type Fault Position Fault Cause Fault Locating → Figure 2. Ontology evolutionary The other category is implicit information, and such information needs to be extracted from explicit information. The implicit information in this article mainly refers to these five types of information: CNC systems type information, machine tool type information, fault position information, fault cause information and fault locating information. In addition, the quantitative relationship has been explained in the analysis of non-structural data features. 2.3. Ontology construction The body is not only the cornerstone of the knowledge map, but also the foundation of ensuring the structure of the knowledge diagram. Therefore, good ontology is not only essential to the correlation between information, but also essential for the integrity of information. According to the analysis of the characteristics of the case set, 8 types of body types are determined: fault symptom, CNC system, machine tool type, fault position, fault analysis, fault cause, fault positioning, failure measure. There are 7 types of relationships between 8 types of body types (Abbreviation in brackets): fault symptom_CNC system type (Sy_CNC), fault symptom_machine tool type (Sy_Ma), fault symptom_fault position (Sy_Po), fault symptom_fault analysis (Sy_An), fault symptom_fault cause (Sy_Ca), fault symptom_fault locating(Sy_Lo). As shown in figure 2. The reason for selecting each part as the ontology: 1. Fault symptom, as the core component of the knowledge map, plays a role in connecting all the fault information, so it is located in the core part of the knowledge map. 2. Location information includes the type of CNC system, the type of machine tool, and the fault location. This is the structural cornerstone of the macro knowledge map. Because a huge failure diagnostic system has a large amount of cross- coexisting information in these three fields, refining the location information into these three branches can unify all the fault cases as much as possible, in order to form a relatively complete structural system with exhaustive data. 3. The reason why not only fault analysis is reserved, but the cause and the fault locating from the fault analysis are also retained, is to ensure the integrity of the case information and the convenience of query. Integration: The latter two ontologies are mainly extracted from fault analysis information through a certain information extraction method, which will cause some details of the content to lose occasionally. Therefore, in order to prevent information loss from incorrect extraction, the three of them should be kept on the integrity and correctness of the case. Convenience of information query: If only the fault analysis is retained, it will cause trouble for the usage of the knowledge map because of the long text description of some cases' fault analysis. 4. Finding the reasonable measure is an essential link during the entire failure diagnosis process, because it is the purpose of subsequent fault diagnosis tasks. 3. Information Extraction 3.1. Information extraction task Information extraction refers to the use of useful information from semi-structured and non-alternative data, which mainly includes named entity extraction and relationship extraction. The task of information extraction in this article is to integrate the CNC machine tool fault diagnosis cases as much as possible according to the common characteristics and general laws of these on the market. Combining with advanced information extraction methods to study and design the appropriate process, 8 types and 7 relationships are extracted from the input fault diagnosis cases, providing structured data support for the establishment of the subsequent diagram database. 3.2. Source data input format The basic format requirements of a text of a fault diagnosis case are the case records that meet the basic specifications, which is, there are basic prompts. In detail, there are related structured characters about fault device, fault analysis, fault analysis, fault measure in the information description. The above specifications are reflected in the concentration of cases used. Here are examples of source data input samples: Please enter a fault diagnosis case (please satisfy the basic specifications for the case record): Fault device: CK6140 type control lathe with FANUC 0TE system. Fault phenomenon: During the process of turning, the X-axis occasionally appears the "Knives Planting" phenomenon. It is a large error in the processing workpiece of processing, and sometimes even scrap the workpiece. Fault analysis: "Knives Planting" is commonly used by operators. In fact, it refers to the error in the size of the workpiece. Due to the occasional occurrence and disappearance of the fault phenomenon, it is difficult to analyze the cause of the fault and diagnose the inspection. The common reason is that the feed servo system and feed transmission mechanism are faulty. ① Check the ball screw of the X axis. Use a dial indicator to measure the clearance of the lead screw, then make compensation, and then process. The fault phenomenon remains unchanged, indicating that the problem is not here. ② Check that the servo motor, conveyor belt, encoder, etc. of the X-axis are in a completely normal state. ③Because the 276 fault appears and disappears from time to time, it is inferred that there is a fault in the connection part, and the precision elastic coupling between the encoder and the ball screw is removed for inspection, and it is found that there is a small crack on one of its elastic pieces, and the elastic coupling has been damaged. According to the diagnosis structure, use the elastic coupling of the same type for replacement inspection. After installing it, turn it on for a test run, and the fault does not appear again. The elastic coupling was replaced in the bathroom for maintenance, and the intermittent "Knives Planting" fault was eliminated. 3.3. Information extraction method selection There are three main types of information extraction methods for unstructured knowledge that are popular at present: Knowledge rule-based approach: 1. This extraction method is mainly suitable for those unstructured data who have relatively complete or clear extraction rules, existing dictionary table information or relatively fixed domain knowledge in the data field, requiring high accuracy and are not suitable for machine learning training due to complex data types and insufficient data volume. 2. Methods based on mathematical statistics: The unstructured data targeted by this extraction method mainly has the following characteristics: no obvious extraction marks, the data field is not fixed or lacks knowledge in related fields, the amount of data is huge, which benefits the rule extraction for machine learning and can tolerate a certain degree of error rate. 3. Method based on deep learning: This method is suitable for extracting hidden information from complex texts. Due to the complexity of the algorithm network, the accuracy of extraction is deeply dependent on the complexity of the ontology and the huge amount of data. However, it has obvious disadvantages. For complex text, the extraction effect is proportional to the complexity and quantity of the model, and the calculation cost will also increase significantly. Print Case Text Start Case  Text Explicit Info.  Division Divided  Explicit  Info. Device Info. Fault Analysis Fault Symptom Fault Measure BiLSTM‐CRF Named Ontology  Extraction Fault Cause Fault Locating CNC Type Machine Tool  Type Rules Based  Information Extraction Relation  Combination Neo4j  Storage End Fault  Symptom Fault Position Figure 3. Overall Process Design 277 Comprehensive analysis: 1.Separation of explicit information: Separate device information, fault symptom information, fault analysis information and fault measure information from the text of a whole case. It is best to use the knowledge extraction method based on knowledge rules in this process, because the case information itself is not completely unstructured information. Rather, a case has made corresponding clarifications to these concepts in the process of establishing examples. For example, in "500 Cases of Fault Diagnosis and Maintenance of CNC Machine Tools" written by Gong Zhonghua, the case structure is often used to distinguish between different entity concepts: fault system, fault phenomenon, fault analysis and inspection, and fault handling. It can be found that the characteristics of these words have slight differences in names, but they are unified in content. For example, "fault analysis" and "fault analysis" represent a concept. Therefore, this part can first distinguish and classify these concepts by formulating a dictionary, and then use the extraction method based on rules to divide the cases into blocks in a correct, reasonable and standardized way. 2.Extraction of short information types in implicit information: the data types of the three types of ontologies of CNC system type information, machine tool type information and fault position information are all single or compound professional terms. This type of ontology information has the characteristics of relatively simple structure, relatively strong regularity, and relatively large amount of data. It is very suitable for the knowledge extraction method based on deep learning to extract from characteristic paragraphs. It can not only achieve high extraction efficiency and high extraction accuracy, but also control the extraction cost within a reasonable range. 3.Extraction of other data types of implicit information: the data type of fault cause and fault location is mostly a phrase or a combination of long and short sentences, and its extraction uses a rule-based knowledge extraction method. There are two main reasons for choosing this approach. First, these two types of ontologies are not suitable for extraction by means of mathematical statistics and deep learning. The main reason is that the amount of data is limited, the data structure is flexible, and the training is difficult. The second is that the rules for the extraction of these two types of ontology are relatively clear, and the corresponding information can be extracted directly by formulating perfect rules. 3.4. Information extraction process design 3.4.1. Overall Process Design The basic process of the overall design process is shown in figure 3. After entering the spec-compliant case field. The first step is to separate the explicit information of the case field. This process uses the rule-based knowledge extraction method to separate each part of the explicit fault information, including device information, fault symptom information, fault analysis information and fault measure information. In the second step, for the CNC system information, machine tool type information and fault position information, the BiLstm-CRF ontology extraction algorithm is used to extract this part of information from equipment model information and fault symptom information. The third step is to use a rule-based information extraction algorithm to extract fault cause information and fault locating information from fault analysis information. The fourth step is to combine the extracted entity types by means of relationship combination to form structural knowledge of entities and relationships. At this point, all the work of information extraction has been completed, and then the structural knowledge is stored in the Neo4j graph database. 3.4.2. BiLSTM-CRF named entity extraction BiLSTM is a type of LSTM that combines forward and backward LSTM to extract all the necessary information from a sentence. LSTM improves upon traditional RNN by introducing memory and forgetting units to avoid information loss and gradient explosion in deep learning [6]. The BIO marking method is used, where “B” denotes the start of an entity, “I” denotes other parts of the entity, and “O” denotes non-entity parts. LSTM calculates useful information for subsequent moments by forgetting irrelevant information and memorizing new information. See the figure for a visual representation of the LSTM principle. The principle of LSTM is shown in the figure 4. Figure 4. The principle of LSTM The LSTM structure includes three structures: forget gate, input gate, and output gate. First, calculate the forget gate and select the information to be forgotten: 𝑓 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (1) In the formula (1): 𝑓 is the value of the forget gate, ℎ is the state of the hidden layer at the previous moment, 𝑥 is the input word at the current moment, 𝜎 is activation function, 𝑊 is connection weight vector, 𝑏 is bias vector. Next, calculate the memory gate and select the information to be memorized: 𝑖 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (2) 𝐶 𝑡𝑎𝑛ℎ 𝑊 ∙ ℎ , 𝑥 𝑏 (3) In the formula (2) and (3): 𝑖 is the value of the memory gate, 𝐶 is provisional status. Calculate the current moment state as formula (4): 𝐶 𝑓 𝐶 𝑖 𝐶 (4) Finally, calculate the output gate and the hidden layer state at the current moment: 𝑂 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (5) ℎ 𝑂 ∙ tanh 𝐶 (6) 278 In the formula (5) and (6): 𝑂 is the value of the output gate, ℎ is hidden state. Finally, the hidden layer state ℎ , ℎ , … , ℎ of the same length as the sentence can be obtained. BiLSTM is a combination of forward LSTM and backward LSTM. It obtains the forward vector through the forward LSTM, obtains the backward vector through the backward LSTM, and concatenates the forward vector and the backward vector to obtain the final output vector [7]. Therefore, BiLSTM can better contain the information before and after the semantics, learn the bidirectional semantic information expressed in the context and improve the effect of named entity recognition. The principle of BiLSTM is shown in the figure 5. Figure 5. The principle of BiLSTM In the figure, 𝑥 , 𝑥 , 𝑥 are the original input vectors, input 𝑥 , 𝑥 , 𝑥 through the forward LSTML to get ℎ , ℎ , ℎ , and then input 𝑥 , 𝑥 , 𝑥 through LSTMR get ℎ , ℎ , ℎ and finally concatenate the forward hidden vector and the backward hidden vector to get ℎ , ℎ , ℎ , ℎ , ℎ , ℎ . Although the BiLSTM deep learning framework can distinguish named entities from non-named entities, named entities can be extracted from text sequences. However, the entity naming tags are different, and the BiLSTM deep learning model cannot distinguish different named entity tags, so the CRF reasoning layer is added. The CRF algorithm can learn the association information between tags, which can also be called constraint information. The accuracy of the prediction can be guaranteed through the CRF reasoning layer [8]. The algorithm is as follows. For an input CRF inference layer sequence 𝑥 𝑥 , 𝑥 , … , 𝑥 , there is a corresponding label sequence 𝑦 𝑦 , 𝑦 , … , 𝑦 , and its score can be obtained as formula (7): s 𝑥, 𝑦 ∑ 𝑂 , 𝑇 , 𝑇 , (7) In the formula: s 𝑥, 𝑦 is score value, 𝑂 , is the score of label 𝑦 corresponding to 𝑥 in sentence, 𝑇 is the transition matrix between labels; 𝑦 , 𝑦 is the sentence start and end markers. It can then be normalized by the softmax function, as shown in formula (8): 𝑝 𝑦|𝑥 , ∑ , ∈ (8) In the formula: 𝑦 is the true token value, 𝑌 represents the set of possible labels. Then the likelihood probability of maximizing the correct label sequence is obtained as formula (9): 𝑙𝑜 𝑔 𝑝 𝑦|𝑥 𝑠 𝑥, 𝑦 ∑ 𝑠 𝑥, 𝑦∈ (9) Finally, the Viterbi algorithm can be used to obtain the sequence with the highest predicted total score on all sequences, which is the labeling result of the final CNC machine tool fault entity recognition sequence. As shown in formula (10): 𝑦∗ 𝑎𝑟𝑔𝑚𝑎𝑥 ∈ 𝑆 𝑥, 𝑦 (10) evaluation standard: In this paper, accuracy (𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛, P), recall (𝑅𝑒𝑐𝑎𝑙𝑙, R), and 𝐹 (F1-score) are used as indicators for evaluating model performance. Given that the field of named entity recognition only considers accuracy and recall, it is often impossible to comprehensively analyze the performance of a model. The problem of high precision but low recall and high recall but low precision often arises. In order to comprehensively evaluate the performance of the model, this paper uses the F1 value as the evaluation index, and its as shown in formula (11), (12) and (13) : 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 100% (11) 𝑅𝑒𝑐𝑎𝑙𝑙 100% (12) 𝐹 100% (13) As in above formula, TP: True Positive, which predicts the positive category truly, FP: False Positive, which predicts the positive category falsely, TN: True Negative, which predicts the negative category truly, FN: False Negative, which predicts the negative category falsely. 3.4.3. Rule-based knowledge extraction The main rules of rule-based knowledge extraction of two parts of information include the following three points: 1. "Pre-guiding words", which have specific "pre-guiding words" for the fault cause and fault location fields. For example: "The common cause of this fault is improper parameter setting, and the connection part of the position detection device is faulty". The "common cause" in this sentence is the "pre-guiding word", indicating that the content of this field is the cause of the fault. 2. The "display words in sentence" of the fault location information field, especially the words "check", "observe", "inquire", "search", "judgment" and "doubt". For example, "Observe the vibration of the machine tool, the vibration frequency is not high, and there is no abnormal sound. It is suspected that the fault is related to the closed-loop parameters of the CNC system, such as the integration time setting is too large, the system gain is too high, etc.", the prompt word "observation" and "doubt" appear in this sentence. 3. The serial number, such as ①②③..., 123... and other serial numbers. Extraction process of explicit information, the detailed process is shown in the figure 6: 279 Start Cases Text End Search the  words from  the dictionary  1 in cases text The text is divided started  with the word number i as  symbol and ended with  the punctuation mark just  before the word number  i+1 as symbol, the  segmented text is labeled  with the word number i. Explicit  Info. "Label: Content"  data type is used to  save the searched  ontology : device  infomation, fault  symptom, fault  analysis and fault  measure. Figure 6. Rule based explicit information extraction process 1. Since the input fault case text basically conforms to the data specification, this part of information extraction only needs to create a dictionary 1 based on the "pre-leading words" of the four types of information: device information, fault symptom information, fault analysis information and fault measure information. 2. According to a certain extraction rule, after the segmentation of the source text of the fault case, four explicit information is extracted. Extraction of other data types of implicit information, the detailed process is shown in the figure 7: Start Fault  Analysis End Start with the searched "i‐th word" and  ending punctuation before the "i+1th  word" as the end to segment the text. The  last word ends at the end of the entire  field. And label this field as "i‐th word".  explicit  information Use the "label: content" key‐ value pair to save the entity  type of the search: fault cause,  fault location Have the  pre‐guiding words  related to "fault reason" in  dict2 in this field be  searched? Y Is there a  serial number in the  "fault cause"  section? Is there a  serial number in the  "fault locating"  section? Divide the "fault  cause" according to  the serial number Divide the "fault  locating" according  to the serial number Y Y N Does fault  analysis contain a serial  number? Have the  pre‐guiding words  related to "fault locating" in  dict2 in this field be  searched? Y N N Each sentence is  to be search, if display  words related to “fault  locating”in dict5 have been  searched in this  sentence ? Does the  auxiliary judgment symbol 1  equal to False? The auxiliary  judgment symbol  1 is set to True The auxiliary  judgment symbol  1 is set to False Split text by  sentence Y Each sentence is  to be search, if display words  related to “fault locating”in  dict5 have been searched in  this sentence ? All label  sequences  checked? If display  words related to “fault  cause”in dict4 have  been searched in this  sentence ? N Label this sentence  "fault cause". Y Label this sentence  "fault locating". Y N Mark all fields with  this serial number as  "fault locating" Mark all fields with  this serial number as  "fault cause" Y N Y Y N All label  sequences  checked? Split the text in units  of one sentence with  serial number N Y Figure 7. Extraction process of other data types of implicit information based on rules 280 1. Dictionary creation: This part of the information extraction process includes the extraction process of fault cause information and fault locating information. It is mainly based on the above rules to judge whether each condition is met. In this section, four important dictionaries are created,dict2: "pre-guiding words" related to "fault reason", dict3: "pre-guiding words" related to "fault locating", dict4: "display words in sentence" related to "fault reason", dict5: "display words in sentence" related to "fault locating". 2. Take fault analysis information in explicit information as input, and search for the relevant "pre-guiding words" about "fault cause" in dict2 in this field. If relevant information is found, continue to search for relevant "pre-guiding words" about "fault locating" in dict3 in this field. If the relevant information is also found, then start with the searched "i-th word" and ending punctuation before the "i+1th word" as the end to segment the text. The last word ends at the end of the entire field. And label this field as "i-th word". Then, according to the presence or absence of the serial number, the fault cause information and fault location information are divided. 3. Since the fault analysis field may contain only one type of invisible information, that is fault localization. If the relevant "pre-guiding words" of "fault location" cannot be found in dict 3, the next important judgment rule must be introduced, the presence or absence of serial numbers. If there is a serial number in the fault analysis information, then a sentence with a serial number is used as a unit to divide the text. Judge sentence by sentence whether the field with serial number contains "display words in sentence" related to "fault location" in dict 5. If it exists, then mark all the fields with the sequence number of the same serial as "fault location", otherwise mark all the fields with the sequence number of the same serial as "fault reason". Because in a piece of information with a serial number, the field contains meanwhile of the "display words in sentence" related to "fault locating" and the "display words in sentence" related to "fault cause" can only be fault location information. However, there may only be displayed the "display words in sentence" related to "fault reason" in fault cause information. 4. If the above two important rules are all ineffective, the text should be divided into one sentence, and the information in this paragraph may be judged sentence by sentence. Find out whether a sentence contains "display words in sentence" related to "fault locating" in dict 5, and if it exists, mark the sentence as "fault location". Otherwise, judge whether the sentence contains the "display words in sentence" about "fault reason" in dict 4, and if so, mark the sentence as "fault reason". 4. Storage of Knowledge After extracting the effective information in the failure cases of CNC machine tools, how to choose a suitable database to save the information is a very critical step. Neo4j, an open source graph database based on high performance, high reliability, and strong scalability, shows its advantages. It is not only a NoSQL graph database, but also a graph database that is currently widely used. The founders of Neo4j chose to use a graph model to store relationships, and implemented variable-length traversal operations in this system. The data storage form of Neo4j mainly uses nodes (Node) and edges (Edge) to organize data. Nodes represent entities in the knowledge graph, and edges represent relationships between entities. Relationships can have directions, and the two ends correspond to the start node and the end node. The preservation of information is inseparable from the problem of query, and how to better query is also an important step in choosing a database. Cypher, which works well with Neo4j, is a language specially designed for image databases. It is easy to understand, has rich expressiveness, can efficiently query and update graph data, and borrows from the SQL structure. It can be queried through a variety of rich composition patterns to express expected operations. Using the complex pattern of multiple relationships in the Cypher language can express arbitrary complex concepts, support the characteristics of various usage scenarios, and more efficiently add, delete, modify and query chemical safety knowledge data, and realize knowledge storage based on Neo4j. Table 1. Results of three types of extraction *Interpretation: Both left and right sides are “process concept”, indicating the same meaning, dark gray box indicates “process concept”, light gray box is the number of corresponding concept relative to different entity types. 5. Extraction Experiments and Results In this experiment, a total of 229 cases that conform to the basic format specification were selected and input into the system. The experimental results are shown in the table 1. 1.The results of explicit information extraction show that there are ideal results, and the number of four types of explicit information is 229. 2.For the extraction of short data types of implicit information, the training set and test set are delineated according to the ratio of 8:2. A total of 183 device information and 183 fault symptom information are selected as the Process concept Device info. entity CNC type entity Machine tool type entity Fault position entity Fault symptom entity Fault analysis entity Fault measure entity Fault cause entity Fault locating entity Process concept 229 229 229 229 Results of Explicit Information Extraction Training set 183 183 Test set 46 46 28 19 87 BiLSTM Ontology Extraction Training Set Manual Annotation Precision 96.55% 95% 91.01% Recall 93.33% 90.48% 88.04% 13 10 21 Results of BiLSTM Ontology Extraction Test Set Extraction Results of Rule-Based Entity Extraction 398 732 281 training set, and 46 device information and 46 fault symptom information are selected as the test set. Through multiple rounds of testing, the input parameters of the BiLSTM entity extraction model were determined. The batch size is 64, the epoch is 30, and the learning rate is 0.001. The training set has a total of manually labeled data as follows: the number of CNC system type entities is 28, the number of machine tool type entities is 19, and the number of fault position entities is 87. The accuracy rates of the algorithms are 96.55%, 95% and 91.01% respectively, and the recall rates are 93.33%, 90.48% and 88.04% respectively. It can be seen that the BiLSTM- CRF algorithm has a very significant effect on the extraction of the three types of information. Using the system to extract test set data, a total of 13 CNC system type entities, 10 machine tool type entities, and 21 fault location entities were extracted. 3.For the information extraction of other data structure types in invisible information, a total of 398 fault cause ontology types and 732 fault locating ontology types were extracted. This article utilizes the characteristics of a knowledge graph, where each entity serves as a node and each relationship serves as an edge connecting its head and tail entities. The Neo4j storage processing system is employed to recognize entities and their relationships. Given the vast amount of information in the knowledge graph, the article presents a selection of content for visual display to achieve greater clarity, as demonstrated in Figure 8. Figure 8. Visualization of part of the data stored by neo4j 6. Conclusion To address the inefficient utilization of non-structural knowledge resources in existing fault diagnosis methods, a new approach is proposed for CNC machine tool fault diagnosis using knowledge map technology inspired by other fields. By using rich case resources of CNC machine tool diagnosis and a full analysis of the characteristics of CNC machine tool failure diagnosis cases, the body structure in the field of CNC machine tool fault diagnosis is greatly optimized. Combined with advanced knowledge extraction algorithms and refined the process of information extraction, a set of rules-based information extraction algorithms integrated with the Bilstm-CRF extraction algorithm were designed. After experimental verification, the information extraction effect is more than the effect of the information extraction of a single BILSTM algorithm extraction. Finally, the storage of structural knowledge through NEO4J visualized the diagnosis of the CNC machine tool diagnosis. Because the database of this graph has good structural and good ductility, in the future, it will be increased in terms of the diagnosis of CNC machine tool faults and the knowledge retrieval of CNC machine tools. In addition, because there are not too many considerations of the relation extraction between the ontologies, taking root in the existing body structure, and optimizing the reasonable, efficient and accurate relationship extraction algorithm will be further research. Contribution: Wang Jiahai: Put forward the research direction and constructive suggestions. Yin Wenming: Completed the experiment and wrote the article. Gao Jianxiang: Assisted in the experiment. References [1] Y. Zhang, Research and Implementation of Knowledge Acquisition Method for Fault Diagnosis Expert System, Jilin University, 2015. [2] K. B. Yeshun Li, Shilei Zhao, Research on diagnostic expert system based on knowledge discovery and data mining technology, Electronic Technology & Software Engineering (1) (2018) 141-142. [3] J. Wang, J. Huang, B. Shen, Research status and prospect of intelligent fault diagnosis technology of CNC machine tools, Mechanical Manufacturing 52(5) (2014) 30-32. [4] Q. Xu, CNC Fault Diagnosis System Based on Knowledge Graph, Beijing University of Posts and Telecommunications (2020). [5] Q. Wang, Research on Question Answering System for CNC Machine Tool Fault on Knowledge Graph, Inner Mongolia University of Science & Technology (2022). [6] S. Dai, L. Li, Z. Li, Modeling vehicle interactions via modified LSTM models for trajectory prediction, IEEE Access 7 (2019) 38287-38296. [7] L. Huang, C. Pun, Audio replay spoof attack detection by joint segment-based linear filter bank feature extraction and attention-enhanced DenseNet-BiLSTM network, IEEE/ACM Transactions on Audio, Speech, and Language Processing 28 (2020) 1813-1825. [8] Z. Qiu, Y. Zhuang, H. Hu, W. Wang, Using stacked sparse auto-encoder and superpixel CRF for long-term visual scene understanding of UGVs, IEEE Transactions on Systems, Man, and Cybernetics: Systems 50(4) (2017) 1331-1342.