MRO fault intelligent analysis system and method based on Text-to-SQL large model
By introducing the Text-to-SQL big model into MRO software, the failure analysis of industrial equipment is automated, and the problems of low efficiency of fault analysis and relying on manual services in the existing technology are solved, and the efficiency and accuracy of fault diagnosis and maintenance decisions are improved.
Patent Information
- Application Number
- CN202411604182.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-11-12
AI Technical Summary
The fault analysis methods of existing industrial equipment MRO software are limited, relying on data visualization and knowledge graphs, which are inefficient and highly dependent on manual services.
The MRO fault intelligent analysis system based on the Text-to-SQL large model is adopted. Through the coordinated work of the user interaction module, the MRO fault management module, the data retrieval module and the Text-to-SQL model service module, SQL statements are generated and executed to realize the automatic generation and display of the fault analysis results.
It greatly improves the efficiency of equipment failure statistical analysis in MRO business, reduces the dependence on manual analysis, and achieves more accurate and efficient fault diagnosis and maintenance decision support.
Smart Images

Figure CN119127973B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an MRO fault intelligent analysis system and method based on a Text-to-SQL large model, and belongs to the field of industrial equipment maintenance, repair, and operation (Maintenance Repair Operation, abbreviated as: MRO). Background Art
[0002] MRO fault management refers to the effective and systematic management of equipment or facility faults during maintenance, repair and operation, so as to ensure the continuous operation of equipment, reduce production interruptions and improve efficiency. Fault analysis refers to the analysis of equipment failure modes, fault phenomena, fault causes, fault resolution measures and fault records based on MRO fault management, so as to provide reference for equipment fault diagnosis and maintenance decision-making.
[0003] Text-to-SQL technology refers to the process of converting natural language questions or commands into SQL statements that can be executed on the database. This technology is designed to enable users to interact with the database using everyday language without the need for SQL syntax knowledge. With the rapid development of large language model technology in recent years, Text-to-SQL technology has also made great breakthroughs. For example, the Text-to-SQL data Spider dataset publicly released by the Department of Computer Science at Yale University, the large language model (Alibaba team) increased the accuracy of this dataset from 12.4% in 2019 to 86.6% in August 2023, which indicates that Text-to-SQL technology will become easier to use and more accurate in applications in database interaction and data-driven decision-making.
[0004] At present, most of the fault analysis methods of industrial equipment MRO software are to draw fault data statistics charts as a data visualization page for display based on common fault analysis needs; there are also software that builds a fault knowledge base based on knowledge graph technology, and then provides a search portal for users to query related fault knowledge based on a fault information. The above two common fault analysis methods can provide very limited information, and have high requirements for expert experience and manual services, so that in the maintenance of industrial equipment, consultation, fault diagnosis, and maintenance decision-making are highly dependent on manpower and inefficient. Summary of the invention
[0005] In order to solve the above problems, the present invention discloses an MRO fault intelligent analysis system and method based on a Text-to-SQL large model, and its specific technical solution is as follows:
[0006] The MRO fault intelligent analysis system based on the Text-to-SQL large model is characterized by including:
[0007] User interaction module: provides the front page of the fault intelligent analysis system, transmits the fault knowledge and fault records written by the user on the front page to the MRO fault management module, transmits the equipment fault analysis questions raised by the user on the front page to the data retrieval module, receives the fault analysis results generated by the retrieval and displays them on the front page;
[0008] MRO fault management module: receives the equipment fault information and fault record data written by the user in the user interaction module, provides the functions of adding, deleting, modifying and checking fault management business data, and stores the fault management business data in the relational database service for the data retrieval module to execute SQL statements;
[0009] Data retrieval module: based on the equipment fault analysis questions raised by the user in the user interaction module, the model service of the Text-to-SQL model service module is called to generate data retrieval SQL statements, the retrieval statements are run in the relational database storing the MRO fault data, and the retrieval results are converted into natural language text and transmitted to the user interaction module;
[0010] Text-to-SQL model service module: runs the Text-to-SQL large model and provides a model reasoning service interface. When the data retrieval module calls the model reasoning service, it infers the data retrieval SQL statement based on the fault analysis problem.
[0011] The connection relationship between the user interaction module, the MRO fault management module, the data retrieval module and the Text-to-SQL model service module is as follows:
[0012] The user interaction module is connected to the MRO fault management module, and transmits the equipment fault knowledge and equipment fault records input by the user on the front page to the MRO fault management module;
[0013] The user interaction module is connected to the data retrieval module, and transmits the fault analysis problem input by the user on the front page to the data retrieval module;
[0014] The data retrieval module is connected to the Text-to-SQL model service module and calls the model inference API published by the Text-to-SQL model service module;
[0015] The data retrieval module is connected to the MRO fault management module, accesses the backend relational database of the MRO fault management module, and runs SQL statements for fault analysis based on the fault business data in the database;
[0016] The data retrieval module is connected with the user interaction module and transmits the analysis result of the fault analysis problem to the user interaction module.
[0017] Furthermore, the MRO fault management module includes three sub-modules, namely: a fault mode sub-module, a fault code sub-module and a fault record sub-module. The fault mode sub-module is responsible for managing the equipment fault mode; the fault code sub-module is responsible for managing the fault code, fault phenomenon, fault cause, and fault solution measures; the fault record sub-module is responsible for managing the fault records during the use of the equipment, and the businesses among the three sub-modules are associated with each other.
[0018] Furthermore, the data retrieval module also includes a data retrieval unit, which is responsible for generating fault analysis results for the fault analysis questions raised by the user in the user interaction module and transmitting them back to the user interaction module for display. In this process, the following four interaction interfaces need to be managed and run, and the four interaction interfaces are: ① an interface for calling the Text-to-SQL model service API; ② an interface for accessing the MRO fault management module database and executing SQL statements; ③ an interface for receiving fault analysis questions transmitted by the user interaction module; and ④ an interface for sending fault analysis results to the user interaction module.
[0019] Furthermore, the data retrieval module also includes a text generation unit, which is responsible for generating natural language text according to business rules from statistical table data generated by executing fault analysis SQL statements on the database, and using the natural language text as the fault analysis result for the fault analysis question raised by the user.
[0020] Furthermore, the data retrieval module also includes a retrieval management unit, which is responsible for managing the priority of fault analysis questions and answers and fault analysis records. When multiple users ask questions at the same time, they are sorted and analyzed according to timestamps. After completing a fault analysis, the questions, SQL statements, analysis results, device information, user information, and time information of this analysis are stored in the database as analysis records.
[0021] Furthermore, the model used by the Text-to-SQL model service module is an autonomous business Text-to-SQL big model obtained by using the public big language model as a pre-training model and constructing the Text-to-SQL corpus using MRO fault management data for supervised training of model parameters. The autonomous business Text-to-SQL big model runs on a local server and publishes a model reasoning service API to the outside for the data retrieval module to call.
[0022] Furthermore, the steps for building the Text-to-SQL model service are as follows:
[0023] Step 1: Environment construction, the basic large model used is the Qwen-7B-Chat model;
[0024] Step 2: MRO fault analysis data annotation. Guided by the business model of MRO fault diagnosis and fault analysis, design more than 120 fault analysis questions and corresponding SQL query statements as training corpus; organize the descriptions of all business tables of the MRO fault management module, including table name, field name, field type, primary key and foreign key information, as auxiliary data for training corpus; in addition, prepare the public Text-to-SQL dataset Spider and merge it with the annotated MRO fault corpus. The merged dataset is divided into training set and test set;
[0025] Step 3: Data processing: process the training set and test set output in step 2 into the data format required by the Qwen-7B-Chat model. After the processing, output a training set json file and a test set json file.
[0026] Step 4: Text-to-SQL model SFT training, call the Qwen-7B-Chat model supervised training API, specify the training data set as the training set output in step 3 according to the API parameter description, use the Qlora supervised training method, start the Text-to-SQL model supervised training based on the Qwen-7B-Chat basic model, and save the model weight file generated by the training to the specified file directory;
[0027] Step 5: Evaluate the trained Text-to-SQL model. Use the test set output in step 3 as test data, use the trained Text-to-SQL model in step 4 to infer and generate SQL statements, and use the SQL execution accuracy EX as the evaluation criterion.
[0028] Step 6: Model merging: Merge the weight files of the trained Text-to-SQL model and the Qwen-7B-Chat basic model and output them to a new file directory. The merged weight file is the model weight file of the independent business Text-to-SQL large model.
[0029] Step 7: Publish the service, run the model publishing command, and specify the model weight file of the autonomous business Text-to-SQL large model output in step 6 as the publishing object. The publishing command will expose the program of the model reasoning part as a local API for other modules to call the autonomous business Text-to-SQL large model service through the API.
[0030] Furthermore, the prompt word Prompt is also designed in the MRO fault analysis data annotation process in step 2, with the aim of allowing the large model to have more prompt information when inferring SQL based on fault analysis problems. The data source for designing the prompt word Prompt is the description of all business tables in the MRO fault management module, including all information such as table name, field name, field type, primary key, and foreign key. The table structure, fields, internal and external keys involved in the fault analysis problem are described, and the autonomous business Text-to-SQL large model is clearly told that the goal of the reasoning task is to generate an SQL statement.
[0031] An MRO fault intelligent analysis method based on the above-mentioned MRO fault intelligent analysis system based on the Text-to-SQL large model includes the following steps:
[0032] Step 1: Transmitting questions: The user interaction module transmits the fault analysis questions written by the user on the front page to the data retrieval module;
[0033] Step 2: Generate SQL statements. The data retrieval module receives the fault analysis question, calls the reasoning service API of the Text-to-SQL model service module, uses the fault analysis question as the input of the reasoning task, and obtains the SQL statement output by the reasoning task.
[0034] Step 3: Execute the search. The data search module connects to the business database of the MRO fault management module, executes the SQL statement generated in step 2, and obtains the retrieved data.
[0035] Step 4: Text generation: the data retrieval module converts the retrieved data into a description text of the data retrieval results according to the fault analysis rules designed by the program, and combines the description text with the retrieved data obtained in step 3 as an answer to the fault analysis question passed in step 1;
[0036] Step 5: Front-end display: the data retrieval module transmits the fault analysis answer generated in step 4 back to the user interaction module and displays it on the front-end page;
[0037] Step 6: Fault analysis record management. The data retrieval module records the problem, SQL statement, retrieval result, analysis result, proposer, and proposal time of this analysis into the database.
[0038] The beneficial effects of the present invention are:
[0039] The present invention takes the Text-to-SQL (text to generate database query statements) type of big model as the technical orientation. According to the requirements of the MRO fault analysis scenario, the MRO fault management business data is used to construct a Text-to-SQL data set as the training corpus, and the public big language model is used as the pre-training model. On this basis, the model parameters are trained in a supervised manner to obtain a Text-to-SQL big model that can generate corresponding database retrieval SQL statements according to the equipment fault analysis text input.
[0040] The present invention develops a Text-to-SQL model service module based on a large Text-to-SQL model, and cooperates with a user interaction module, an MRO fault management module, and a data retrieval module to design and implement an MRO fault intelligent analysis system. Users can record and manage equipment fault information in the user interaction module. When users need to perform statistical analysis or fault diagnosis analysis on equipment faults, they can raise fault analysis questions in the user interaction module. The background data retrieval module will call the model reasoning service provided by the Text-to-SQL model service module to generate corresponding SQL statements, and then retrieve and generate readable fault analysis results in the database, and finally display the fault analysis results on the front page of the user interaction module. The present invention can greatly improve the efficiency of statistical analysis of equipment faults in MRO business and reduce the dependence of equipment fault diagnosis on manual analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of the framework of the present invention;
[0042] Figure 2 A flow chart for constructing a Text-to-SQL model service of the present invention;
[0043] Figure 3 It is a schematic diagram of the system operation of the present invention. DETAILED DESCRIPTION
[0044] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0045] Combined with Figure 1 It can be seen that the system of the present invention includes a user interaction module, an MRO fault management module, a data retrieval module and a Text-to-SQL model service module, and the following connections exist between the modules of the system:
[0046] Connection 1: The user interaction module is connected to the MRO fault management module to transmit the equipment fault knowledge (including fault code, fault mode) and equipment fault record input by the user on the front page to the module;
[0047] Connection 2: the user interaction module is connected to the data retrieval module to transmit the fault analysis problem input by the user on the front page to the data retrieval module;
[0048] Connection 3: The data retrieval module connects to the Text-to-SQL model service module and calls the model inference API it publishes;
[0049] Connection 4: The data retrieval module is connected to the MRO fault management module, accesses its backend relational database, and runs SQL statements for fault analysis based on the fault business data in the database;
[0050] Connection 5: The data retrieval module is connected to the user interaction module to transmit the analysis results of the fault analysis problem to it.
[0051] The following is combined with Figure 2 The method of constructing the Text-to-SQL model service of the present invention is demonstrated, and the MRO fault intelligent analysis of four types of industrial equipment A, B, C, and D is used as an example for explanation. The specific process is as follows:
[0052] Step 1.1: Environment deployment, deploy the operation and supervised training environment of the large language pre-training model on the local server, and prepare the server hardware resources as follows: GPU resources 12GB, CPU resources 24GB, hard disk storage 100GB. Download the pre-built Docker image provided by the Qwen official website, install the corresponding tool drivers and configure them one by one according to the requirements of the official website, and then download the Qwen-7B-Chat model and code to the local server.
[0053] Step 1.2: Data annotation. Based on the common needs in MRO fault diagnosis and fault analysis business, the MRO fault data of four types of industrial equipment A, B, C, and D are used as materials to design and annotate 120 fault analysis questions and corresponding SQL query statements as the training corpus of the Text-to-SQL model; in addition, the descriptions of all business tables of the MRO fault management module, including table name, field name, field type, primary key, and foreign key information, are sorted out as auxiliary data for the training corpus. In addition, the public Text-to-SQL type dataset Spider is prepared and merged with the above-annotated MRO fault analysis corpus. The merged data is divided into a training set and a test set. The training set and the test set consist of: 8669 data in the training set (8569 spider data and 100 MRO fault analysis data), and 1054 data in the test set (1034 spider data and 20 MRO fault analysis data).
[0054] Step 1.3: Data format processing, refer to the data input format specification of Qwen official website, that is, put all samples into a list and save them in a json file. Each sample corresponds to a dictionary, including id and conversation. Conversation is a dictionary that stores input, output, and instruction. Input corresponds to fault analysis questions, output corresponds to retrieval SQL statements, and instruction corresponds to Prompt prompts. After processing, a training set json file and a test set json file are output;
[0055] Step 1.4: Model SFT training, call the Qwen-7B-Chat model supervised training API, follow the API parameter description, specify the training data set as the training set output in step 1.3, use the Qlora training method, start model training based on the Qwen-7B-Chat basic model, and save the model weight file generated by the training to the specified file directory;
[0056] Step 1.5: Model evaluation. Use the test set output in step 1.3 as test data, and use the model trained in step 1.4 to generate SQL statements. Use the SQL execution accuracy (EX) as the evaluation standard. If the model meets the expected usage, it can be used.
[0057] Step 1.6: Model merging: merge the supervised training model and the weight file of the Qwen-7B-Chat basic model, and output them to a new file directory. The merged weight file is the merged model file;
[0058] Step 1.7: Publish the service, specify the merged model in step 1.6 as the published model, run the model publishing command, and publish the merged Text-to-SQL model as the model inference service local API.
[0059] Furthermore, the MRO fault analysis data annotation work described in step 1.2 follows the following principles when designing and constructing the corpus:
[0060] 1) Objectivity of questions. When designing fault analysis questions, try to use objective and mathematical language to ask questions, and do not use adjectives or ambiguous words and phrases. For example, use "What is the most frequent failure mode of type A equipment?" instead of "What is the most common failure mode of type A equipment?" to ask questions; use "Among the four types of equipment A, B, C, and D, which type of equipment has the most failures?" instead of "Among the four types of equipment A, B, C, and D, which type of equipment has the lowest reliability?" to ask questions.
[0061] 2) The entity descriptions in the questions are unified. When the questions involve equipment structure or fault descriptions, the questions need to be asked according to the descriptions of the equipment structure and faults in the MRO fault management module. For example, the structural description of a type A device bound to a fault code in the MRO fault management module is "power supply". When asking questions, "power supply" should also be used. Entity names with the same meaning, such as "battery, power supply component", cannot be used to ask questions.
[0062] 3) Question scope: Do not ask questions that are beyond the given data range, even if they are common sense questions. For example, "What are the fault symptoms of a C-type device when it is running in the desert?" The correct SQL statement is "SELECT ftpnm FROM faultrecordWHERE assetcode='C' And (ftreason LIKE '%High temperature%' OR ftreason LIKE '%Low humidity%')", but this requires the common sense question that "desert" corresponds to "high temperature and low humidity".
[0063] 4) Consistent SQL query mode: There may be multiple equivalent SQL query statements for the same fault analysis problem. In the SQL design, the present invention refers to the SQL design protocol of the Spider dataset to ensure that the SQL query mode of all problems is consistent.
[0064] In accordance with the above principles, a total of 120 fault analysis questions and corresponding SQL query statements were designed and annotated. According to the SQL complexity, they can be divided into three levels: simple, medium, and complex. The descriptions and examples are shown in Table 1 below:
[0065] Table 1 MRO fault analysis Text-to-SQL sample examples
[0066]
[0067] Furthermore, in addition to designing the fault analysis problem and the corresponding SQL, the MRO fault analysis data annotation process described in step 1.2 also requires the design of prompts (prompt words) in order to allow the big model to have more prompt information when reasoning SQL based on the fault analysis problem. The data source for designing prompts is the description of all business tables in the MRO fault management module, including table names, field names, field types, primary keys, and foreign keys. The design idea is to describe the table structure, fields, internal and external keys that may be involved in the fault analysis problem, and clearly tell the big model that the goal of the reasoning task is to generate an SQL statement, for example:
[0068] "I want you to act as a SQL terminal for the sample database. You just need to return SQL commands to me. Here are the instructions for the task:
[0069] Note: XXXX database contains OXX, PXX, QXX tables. AXX contains... fields, OX is the primary key of the table. PXX contains... fields, PX is the primary key of the table. QXX contains... fields, QX is the primary key of the table. OX of OXX table is the foreign key of OX of PXX table. "
[0070] Furthermore, in the supervised training of the Text-to-SQL model described in step 1.4, the present invention adopts the Qlora training method in the process. This method only updates the parameters of the adapter layer without updating the parameters of the original language model, which means that lower video memory overhead is allowed to be used for supervised training model parameters, and fewer resources are consumed during training. All supervised training parameter configurations are shown in Table 2 below:
[0071] Table 2 Text-to-SQL model supervised training parameter configuration
[0072]
[0073] Furthermore, the model evaluation described in step 1.5, the SQL execution accuracy (EX) of the model on all data in the test set and MRO fault analysis data is shown in Table 3 below. It can be seen that the overall EX of the model on all data is 0.706, and the overall EX on MRO fault analysis data is 0.708. Among them, the EX of the model in generating complex SQL is relatively low, only 0.542, and the EX in generating simple and medium SQL is relatively high, reaching 0.861 and 0.683 respectively. Overall, it meets the expectations of business needs for model accuracy and can be released as a Text-to-SQL service for use.
[0074] Table 3 Model test accuracy (EX)
[0075]
[0076] Furthermore, for the model release described in step 1.7, the present invention uses the Docker container deployment method to encapsulate the Text-to-SQL model after the supervised training merge into a Docker image, and then calls the release instruction to release it as an OpenAI type API. This release method can ensure the security and stability of the model service during the upgrade and iteration of the production environment.
[0077] After the Text-to-SQL model service is constructed, the detailed operation process between the user interaction module, MRO fault management module, data retrieval module and Text-to-SQL model service module of the present invention is as follows: Figure 3 shown.
[0078] Among them, the MRO fault management module contains three sub-modules: fault mode, fault code and fault record. The fault information managed by the three sub-modules are as follows:
[0079] The failure mode submodule is responsible for managing common failure modes of equipment, such as mechanical failure, electrical failure, hydraulic / pneumatic failure, control system failure, etc.
[0080] The fault code submodule is responsible for managing fault codes, fault phenomena, fault causes, and fault resolution measures; Table 4 shows a data example of a fault code.
[0081] Table 4 Fault code data example
[0082]
[0083] The fault information managed by the fault record submodule is a detailed record of a fault that occurs in the equipment. The recorded information includes: fault date, fault device, fault structure, fault code, fault phenomenon, fault mode, fault cause, fault resolution measures, and fault resolution time.
[0084] The data of the above three sub-modules are all stored in the data table of the relational database. The fault mode sub-module has two tables, named FAULTMODECLASS (fault mode classification table) and FAULTMODE (fault mode table); the fault code sub-module has four tables, named FAULTCODE (fault code table), FAULTPNMLIB (fault phenomenon table), FAULTREASON (fault cause table), FAULTSOLUTION (fault solution table), and the fault record sub-module has one table, named FAULTRECORD (fault record).
[0085] Based on the model service API provided by the Text-to-SQL model service module and the fault business data stored in the relational database by the MRO fault management module, the process of implementing MRO fault intelligent analysis in the present invention is as follows:
[0086] Step 2.1: Transmitting questions, the user interaction module transmits the fault analysis questions written by the user on the front page to the data retrieval module.
[0087] Step 2.2: Generate SQL. The data retrieval module receives the fault analysis question and calls the reasoning service API of the Text-to-SQL model service module. It uses the fault analysis question as the input of the reasoning task and obtains the SQL statement output by the reasoning task. At this time, if multiple users ask questions in the same period, they are sorted and answered according to the timestamp of the question.
[0088] Step 2.3: Execute the search. The data search module connects to the database where the MRO fault management module stores data. Execute the SQL statement generated in step 2.2 to obtain the retrieved data.
[0089] Step 2.4: Text generation. The data retrieval module converts the retrieved data into a description text of the data retrieval results according to the fault analysis rules designed by the program, and merges the description text with the retrieval data obtained in step 2.3 as an answer to the fault analysis question passed in step 2.1.
[0090] Step 2.5: Front-end display: the data retrieval module transmits the fault analysis answer generated in step 2.4 back to the user interaction module and displays it on the front-end page.
[0091] Step 2.6: Fault analysis record management, the data retrieval module records the problem, SQL statement, retrieval result, analysis result, proposer, and proposal time of this analysis into the database.
[0092] In the text generation described in step 2.4, the present invention has formulated some basic table-to-text rules, which can cover the text conversion of fault statistics (frequency, trend, model) and fault diagnosis (phenomenon-cause-solution) text conversion.
[0093] For example:
[0094] Question: What are the fault phenomena when the power supply of Type A equipment occurs more than 5 times?
[0095] Generate SQL: SELECT a. assetcode ,b.ftpnm,a.freq FROM (SELECT ftpnmid,COUNT(*) AS freq FROM faultrecord WHERE assetcode = 'A' GROUP BY ftpnmidHAVING COUNT(*)>2) a JOIN faulttpnmlib b ON a. ftpnmid=b. ftpnmid.
[0096] Search results:
[0097] assetcode:'A',
[0098] ftpnm:'Sensor antenna cover temperature is too high',
[0099] freq:'6'
[0100] }
[0101] Conversion rules (pseudocode): if assetcode:
[0102] Text.append("{assetcode} model device");
[0103] if ftpnm:
[0104] Text.append("Failure of '{ftpnm}' occurred");
[0105] if freq:
[0106] Text.append("The number of times is {freq} times");
[0107] Generated text: The number of times the fault phenomenon of 'sensing antenna cover temperature is too high' occurred in model A equipment is 6 times.
[0108] The above example shows the most basic fault statistics conversion rule. In addition to the field conversion shown in the above example, you can also add more statistical conditions such as equipment structure, year, month, day, and so on, as well as loop conversion. That is, when the query result contains multiple data, the fault analysis text is generated loopily.
[0109] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0110] The term “connection” as used in this application may mean a direct connection between components or an indirect connection between components via other components.
[0111] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. The MRO fault intelligent analysis system based on the Text-to-SQL large model is characterized by: include: User interaction module: provides the front page of the fault intelligent analysis system, transmits the fault knowledge and fault records written by the user on the front page to the MRO fault management module, transmits the equipment fault analysis questions raised by the user on the front page to the data retrieval module, receives the fault analysis results generated by the retrieval and displays them on the front page; MRO fault management module: receives the equipment fault information and fault record data written by the user in the user interaction module, provides the functions of adding, deleting, modifying and checking fault management business data, and stores the fault management business data in the relational database service for the data retrieval module to execute SQL statements; Data retrieval module: based on the equipment fault analysis questions raised by the user in the user interaction module, the model service of the Text-to-SQL model service module is called to generate data retrieval SQL statements, the retrieval statements are run in the relational database storing the MRO fault data, and the retrieval results are converted into natural language text and transmitted to the user interaction module; Text-to-SQL model service module: runs the Text-to-SQL large model and provides a model reasoning service interface. When the data retrieval module calls the model reasoning service, it infers the data retrieval SQL statement based on the fault analysis problem. The model used by the Text-to-SQL model service module is a large autonomous business Text-to-SQL model obtained by using a public large language model as a pre-training model and constructing a Text-to-SQL corpus using MRO fault management data for supervised training of model parameters. The large autonomous business Text-to-SQL model runs on a local server and publishes a model reasoning service API for external use for the data retrieval module to call; The connection relationship between the user interaction module, the MRO fault management module, the data retrieval module and the Text-to-SQL model service module is as follows: The user interaction module is connected to the MRO fault management module, and transmits the equipment fault knowledge and equipment fault records input by the user on the front page to the MRO fault management module; The user interaction module is connected to the data retrieval module, and transmits the fault analysis problem input by the user on the front page to the data retrieval module; The data retrieval module is connected to the Text-to-SQL model service module and calls the model inference API published by the Text-to-SQL model service module; The data retrieval module is connected to the MRO fault management module, accesses the backend relational database of the MRO fault management module, and runs SQL statements for fault analysis based on the fault business data in the database; The data retrieval module is connected with the user interaction module and transmits the analysis result of the fault analysis problem to the user interaction module.
2. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 1 is characterized in that: The MRO fault management module includes three sub-modules, namely: a fault mode sub-module, a fault code sub-module and a fault record sub-module. The fault mode sub-module is responsible for managing the equipment fault mode; the fault code sub-module is responsible for managing the fault code, fault phenomenon, fault cause, and fault solution measures; the fault record sub-module is responsible for managing the fault records during the use of the equipment. The businesses of the three sub-modules are associated with each other.
3. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 1 is characterized in that: The data retrieval module also includes a data retrieval unit, which is responsible for generating fault analysis results for the fault analysis questions raised by the user in the user interaction module and transmitting them back to the user interaction module for display. In this process, the following four interaction interfaces need to be managed and run, and the four interaction interfaces are: ① an interface for calling the Text-to-SQL model service API; ② an interface for accessing the MRO fault management module database and executing SQL statements; ③ an interface for receiving fault analysis questions transmitted by the user interaction module; and ④ an interface for sending fault analysis results to the user interaction module.
4. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 1 is characterized in that: The data retrieval module also includes a text generation unit, which is responsible for generating natural language text according to business rules from statistical table data generated by executing fault analysis SQL statements on the database, and using the natural language text as a fault analysis result for a fault analysis question raised by a user.
5. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 1 is characterized in that: The data retrieval module also includes a retrieval management unit, which is responsible for managing the priority of fault analysis questions and answers and fault analysis records. When multiple users ask questions at the same time, they are sorted and analyzed according to timestamps. After completing a fault analysis, the questions, SQL statements, analysis results, device information, user information, and time information of this analysis are stored in the database as analysis records.
6. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 1 is characterized in that: The steps for building the Text-to-SQL model service are as follows: Step 1: Environment construction, the basic large model used is the Qwen-7B-Chat model; Step 2: MRO fault analysis data annotation: Based on the business model of MRO fault diagnosis and fault analysis, more than 120 fault analysis questions and corresponding SQL query statements are designed as training corpus; Organize the descriptions of all business tables in the MRO fault management module, including table names, field names, field types, primary keys, and foreign keys, as auxiliary data for training corpus. In addition, prepare a public Text-to-SQL dataset Spider and merge it with the annotated MRO fault corpus. The merged dataset is divided into training set and test set. Step 3: Data processing: process the training set and test set output in step 2 into the data format required by the Qwen-7B-Chat model. After the processing, output a training set json file and a test set json file. Step 4: Text-to-SQL model SFT training, call the Qwen-7B-Chat model supervised training API, specify the training data set as the training set output in step 3 according to the API parameter description, use the Qlora supervised training method, start the Text-to-SQL model supervised training based on the Qwen-7B-Chat basic model, and save the model weight file generated by the training to the specified file directory; Step 5: Evaluate the trained Text-to-SQL model. Use the test set output in step 3 as test data, use the trained Text-to-SQL model in step 4 to infer and generate SQL statements, and use the SQL execution accuracy EX as the evaluation criterion. Step 6: Model merging: Merge the weight files of the trained Text-to-SQL model and the Qwen-7B-Chat basic model and output them to a new file directory. The merged weight file is the model weight file of the independent business Text-to-SQL large model. Step 7: Publish the service, run the model publishing command, and specify the model weight file of the autonomous business Text-to-SQL large model output in step 6 as the publishing object. The publishing command will expose the program of the model reasoning part as a local API for other modules to call the autonomous business Text-to-SQL large model service through the API.
7. The MRO fault intelligent analysis system based on the Text-to-SQL large model according to claim 6 is characterized in that: The MRO fault analysis data labeling process in step 2 also designs a prompt word Prompt, the purpose of which is to allow the big model to have more prompt information when inferring SQL based on the fault analysis problem. The data source for designing the prompt word Prompt is the description of all business tables in the MRO fault management module, including all information such as table name, field name, field type, primary key, and foreign key. The table structure, fields, internal and external keys involved in the fault analysis problem are described, and the autonomous business Text-to-SQL big model is clearly told that the goal of the reasoning task is to generate an SQL statement.
8. An MRO fault intelligent analysis method based on the MRO fault intelligent analysis system based on the Text-to-SQL large model according to any one of claims 1 to 7, characterized in that: The following steps are involved: Step 1: Transmitting questions: The user interaction module transmits the fault analysis questions written by the user on the front page to the data retrieval module; Step 2: Generate SQL statements. The data retrieval module receives the fault analysis question, calls the reasoning service API of the Text-to-SQL model service module, uses the fault analysis question as the input of the reasoning task, and obtains the SQL statement output by the reasoning task. Step 3: Execute the search. The data search module connects to the business database of the MRO fault management module, executes the SQL statement generated in step 2, and obtains the retrieved data. Step 4: Text generation: the data retrieval module converts the retrieved data into a description text of the data retrieval results according to the fault analysis rules designed by the program, and combines the description text with the retrieved data obtained in step 3 as an answer to the fault analysis question passed in step 1; Step 5: Front-end display: the data retrieval module transmits the fault analysis answer generated in step 4 back to the user interaction module and displays it on the front-end page; Step 6: Fault analysis record management. The data retrieval module records the problem, SQL statement, retrieval result, analysis result, proposer, and proposal time of this analysis into the database.
Citation Information
Patent Citations
Natural language-to-SQL interactive generation method based on large language model
CN117493379A
Text processing method and device based on large model, equipment, medium and product
CN118656479A