Fault diagnosis method and system
Patent Information
- Application Number
- CN202610804199.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-10-20
AI Technical Summary
[0015]本申请的有益效果:本申请提出的故障诊断方法及系统,该方法包括:获取外部输入的故障诊断查询语句;对故障诊断查询语句进行分词,得到分词结果;将分词结果中的多个词元分别与预设的领域术语词典中的术语词汇进行匹配,得到匹配结果,匹配结果包括:故障诊断查询语句中的故障类型、设备类型、监测指标,以及设备运行状态描述数据;基于故障诊断查询语句,进行时间语义解析,得到故障诊断的待查询时间信息;根据匹配结果和待查询时间信息,确定查询意图向量;基于查询意图向量,进行SQL生成,得到初始SQL语句;利用初始SQL语句,完成故障诊断。该方法能够有助于改善在低速重载间歇式运行机械设备的故障诊断应用场景中技术术语理解能力不足的情况,有助于提升该应用场景中Text-to-SQL的转换准确率,即得到精准度较高的初始SQL语句。并且,该方法能够有助于提高故障诊断准确率,成本较低,可实施性较强。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a fault diagnosis method and system. Background Technology
[0002] Low-speed, heavy-duty, intermittently operating mechanical equipment (such as metallurgical continuous casting ladle turrets, converter tilting machines, large mining machinery, and port cranes) are core supports in modern industrial production systems, and their operational status directly affects the efficiency and safety of the entire industrial chain. Because such equipment operates under complex and variable conditions for extended periods and its operation is discontinuous, fault diagnosis has become an indispensable part of its core maintenance. In actual operation, such equipment generates massive amounts of time-series data related to fault diagnosis (such as sensor data). To enable non-professional maintenance personnel to efficiently extract this time-series data, Text-to-SQL (Natural Language to SQL) technology has been introduced into this field. This technology aims to allow users to perform accurate queries on complex databases using natural language, thereby shortening the diagnostic decision-making process.
[0003] However, Text-to-SQL technology still has significant shortcomings in fault diagnosis applications for low-speed, heavy-load, intermittently operating mechanical equipment. Firstly, general Text-to-SQL models lack understanding of fault diagnosis terminology related to low-speed, heavy-load equipment (such as tilting and jamming), and cannot accurately identify the fault query intent in natural language and the corresponding equipment monitoring data fields. Secondly, it struggles to effectively identify specific time-related expressions associated with faults in intermittent operation scenarios (such as stress wave monitoring data from the three most recent operating phases, bearing noise during start-up and shutdown). Furthermore, it has not been optimized for the special syntax of domestic time-series databases such as InfluxDB (an open-source time-series database) (e.g., Flux dialect), making it difficult to quickly obtain the data required for fault diagnosis. Summary of the Invention
[0004] This application provides a fault diagnosis method and system to solve the technical problem that the accuracy of Text-to-SQL is low in the fault diagnosis application scenario of low-speed, heavy-load, intermittently operating mechanical equipment, resulting in low accuracy of fault query and diagnosis.
[0005] The fault diagnosis method provided in this application includes: Obtain fault diagnosis query statements from external input; The fault diagnosis query statement is segmented into words to obtain the segmentation results; The word segmentation results are matched with terms in a preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement. Based on the fault diagnosis query statement, time semantic parsing is performed to obtain the query time information for fault diagnosis; Based on the matching results and the time information to be queried, a query intent vector is determined; Based on the query intent vector, SQL is generated to obtain the initial SQL statement; Use the initial SQL statement to complete the fault diagnosis.
[0006] In one embodiment of this application, before obtaining the externally input fault diagnosis query statement, the method further includes: Collect terminology in the field of fault diagnosis of low-speed, heavy-load, intermittently operating mechanical equipment. The terminology includes: fault type terminology, equipment type terminology, monitoring indicator terminology, and equipment operating status terminology. Based on the collected terminology, a domain terminology dictionary is constructed; Obtain the anomaly determination rules corresponding to the monitoring indicator terms, and establish a relationship table among the fault type terms, the monitoring indicator terms, and the anomaly determination rules. Construct a structured description document, which includes: database identifier, table name, field information, foreign key information, and time partition information. The table name includes the sensor data table. The field information includes the field name, data type, example value, and field description. The field description is used to characterize the correspondence between the current field and the monitoring indicator. The foreign key information includes the association between the device ID and the sensor ID, and the association between the device ID and the fault type ID. The time partition information is used to characterize the time period in which the field is located. Both the relationship table and the structured description document are used to generate the initial SQL statement.
[0007] In one embodiment of this application, the step of generating SQL based on the query intent vector to obtain an initial SQL statement includes: Based on the device type and fault type in the query intent vector, the corresponding target database identifier, target table name, and target foreign key information are determined from the structured description document; Based on the monitoring metrics in the query intent vector, determine the target fields corresponding to the monitoring metrics from the structured description document; Based on the time information to be queried and the time partition information, the time period in which the target field is located is determined; Based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located, SQL is generated to obtain the initial SQL statement.
[0008] In one embodiment of this application, the step of generating the initial SQL statement based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located includes: The monitoring indicators in the query intent vector are determined as the indicators to be queried, and the anomaly judgment rules corresponding to the indicators to be queried in the relationship table are determined as the target anomaly judgment rules. Based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located, SQL is generated, and the target anomaly judgment rule is embedded into the generated transitional SQL statement to obtain the initial SQL statement.
[0009] In one embodiment of this application, the step of performing time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis includes: The time field in the fault diagnosis query statement is determined as the target time field; If the target time field is an absolute time expression, then the target time field is directly converted into an SQL time range condition. The absolute time expression means that the target time field includes the start time and end time of the data to be queried. If the target time field is a relative time expression, then the target time field is converted into the SQL time range condition through a preset class function. The relative time expression refers to a time range that is pushed back from the current time point. If the target time field is a time representation associated with the device operating status, then the target time window is determined by identifying the device operating status label carried in the target field; The SQL time range condition and the target time window are both the time information to be queried.
[0010] In one embodiment of this application, determining the query intent vector based on the matching result and the query time information includes: Based on the matching results and the time information to be queried, the query intent is parsed to obtain the initial query intent information; The initial query intent information is structured to obtain the query intent vector.
[0011] In one embodiment of this application, generating SQL based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located includes: Based on the target database identifier, the target table name, the target foreign key information, the target field, the time period in which the target field is located, and the matching result in the query intent vector, SQL is generated to obtain intermediate SQL data; If the query intent vector includes a requirement for fault feature statistics, then a first type of function is inserted into the intermediate SQL data. The first type of function includes a mean function, a peak function, or a standard deviation function. If the query intent vector includes a fault evolution trend analysis requirement, then a second type of function is inserted into the intermediate SQL data. The second type of function includes a hysteresis function or a sorting function. The intermediate SQL data inserted by the completion function is identified as the transitional SQL statement.
[0012] In one embodiment of this application, the step of using the initial SQL statement to complete fault diagnosis includes: Based on the target database identifier in the initial SQL statement and the preset SQL syntax adjustment rules, the initial SQL statement is syntax adjusted to obtain the target SQL statement. The SQL syntax adjustment rules include a syntax adjustment method that corresponds one-to-one with the database. Based on the target SQL statement, fault diagnosis is completed. Specifically, the amount of data to be queried is determined based on the target SQL statement. If the amount of data to be queried exceeds a preset data volume threshold, data query and fault diagnosis are completed through downsampling.
[0013] In one embodiment of this application, the step of completing fault diagnosis based on the target SQL statement includes: Execute the target SQL statement; If the execution fails, an error message will be returned, and the generation strategy of the target SQL statement will be adjusted. If the execution is successful, the retrieved sensor data and the diagnostic results obtained based on the retrieved sensor data are acquired; noise filtering is performed on the retrieved sensor data to obtain target data; the target data and the diagnostic results are fed back to the preset terminal.
[0014] This application also provides a fault diagnosis system, the system comprising: The fault diagnosis query statement acquisition module is used to acquire externally input fault diagnosis query statements. The word segmentation module is used to segment the fault diagnosis query statement into words and obtain the word segmentation results. The terminology matching module is used to match multiple word elements in the word segmentation results with terms in a preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement. The time semantic parsing module is used to perform time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis. The query intent determination module is used to determine a query intent vector based on the matching results and the query time information; The SQL generation module is used to generate SQL based on the query intent vector to obtain an initial SQL statement; The fault diagnosis module is used to complete fault diagnosis using the initial SQL statement.
[0015] The beneficial effects of this application are as follows: The fault diagnosis method and system proposed in this application include: acquiring an externally input fault diagnosis query statement; segmenting the fault diagnosis query statement into words to obtain segmentation results; matching multiple word units in the segmentation results with terms in a preset domain terminology dictionary to obtain matching results, which include fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement; performing time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis; determining the query intent vector based on the matching results and the query time information; generating SQL based on the query intent vector to obtain an initial SQL statement; and using the initial SQL statement to complete the fault diagnosis. This method can help improve the insufficient understanding of technical terms in fault diagnosis application scenarios of low-speed, heavy-load, intermittently operating mechanical equipment, and help improve the accuracy of Text-to-SQL conversion in this application scenario, i.e., obtaining a highly accurate initial SQL statement. Furthermore, this method can help improve the accuracy of fault diagnosis, has low cost, and is highly feasible. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0017] In the attached diagram: Figure 1This is a flowchart illustrating a fault diagnosis method provided in one embodiment of this application; Figure 2 This is a schematic diagram of the process for obtaining time information to be queried in a fault diagnosis method provided in one embodiment of this application; Figure 3 This is a flowchart illustrating the process of completing fault diagnosis based on a target SQL statement in a fault diagnosis method provided in one embodiment of this application. Figure 4 This is a schematic diagram of the structure of a fault diagnosis system provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0018] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating a fault diagnosis method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes: S110: Obtain the fault diagnosis query statement from external input.
[0022] In some examples of this embodiment, the fault diagnosis query statement can be natural language text entered by the user, such as querying bearing wear-related data for the most recent tilting operation of the converter tilting equipment.
[0023] S120: Perform word segmentation on the fault diagnosis query statement to obtain the word segmentation results.
[0024] S130: Match multiple word elements in the word segmentation results with terms in the preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement.
[0025] Understandably, pre-setting a domain terminology dictionary can help identify terms and words in fault diagnosis queries, thereby improving the accuracy of subsequent Text-to-SQL conversion.
[0026] S140: Based on the fault diagnosis query statement, perform time semantic parsing to obtain the time information to be queried for fault diagnosis.
[0027] In some examples of this embodiment, the time information to be queried refers to the time period in which the sensor data (sensor data used for fault diagnosis) to be queried is located.
[0028] Understandably, performing time semantic parsing on the fault diagnosis query statement can help improve the accuracy of the obtained time information.
[0029] S150: Determine the query intent vector based on the matching results and the time information to be queried.
[0030] Understandably, obtaining this query intent vector can help improve the accuracy of the initial SQL statement generated subsequently.
[0031] S160: Based on the query intent vector, generate SQL to obtain the initial SQL statement.
[0032] S170: Use the initial SQL statement to complete the fault diagnosis.
[0033] Understandably, the fault diagnosis method in this embodiment can help improve the understanding of technical terminology in fault diagnosis applications of low-speed, heavy-load, intermittently operating mechanical equipment, and help improve the accuracy of Text-to-SQL conversion in this application scenario, i.e., obtaining a more accurate initial SQL statement. Furthermore, this method can help improve the accuracy of fault diagnosis.
[0034] In some embodiments, before obtaining the fault diagnosis query statement input from the outside, the method further includes: First, we collected terminology in the field of fault diagnosis for low-speed, heavy-load, intermittently operating mechanical equipment. The terminology included: fault type terms, equipment type terms, monitoring indicator terms, and equipment operating status terms.
[0035] In some examples of this embodiment, fault type terms include: wear, excessive impact load, slewing bearing jamming, and abnormal noise from the slewing table bearing. Equipment type terms include: continuous casting ladle slewing table and converter. Monitoring index terms include: vibration amplitude, stress wave energy value, tilting angle, tilting speed, bearing temperature, motor current, and hydraulic system pressure. Equipment operating status terms include: startup, heavy load operation, and shutdown.
[0036] Secondly, a domain terminology dictionary is constructed based on the collected terms and phrases.
[0037] Understandably, building a terminology dictionary for this field can help understand the relevant terms in fault diagnosis queries during subsequent Text-to-SQL processes, thereby improving the accuracy of Text-to-SQL conversion.
[0038] Then, obtain the anomaly determination rules corresponding to the monitoring indicator terms, and establish a relationship table among the fault type terms, monitoring indicator terms, and anomaly determination rules. The relationship table can be found in Table 1 below: Table 1. Example table of relationships
[0039] In this context, ° / s represents degrees per second, and mm / s represents millimeters per second.
[0040] Finally, a structured description document (structured schema) is constructed. This document includes: database identifier, table names, field information, foreign key information, and time partitioning information. Table names include the sensor data table; field information includes field names, data types, sample values, and field descriptions. Field descriptions represent the correspondence between the current field and the monitoring indicators; foreign key information includes the association between device IDs and sensor IDs, and the association between device IDs and fault type IDs; and time partitioning information represents the time period in which the field exists. Both the relationship table and the structured description document are used to generate the initial SQL statement.
[0041] In some examples of this embodiment, the association between each term in the domain terminology dictionary and the field information in the structured schema can also be established.
[0042] In some embodiments, SQL is generated based on the query intent vector to obtain an initial SQL statement, including: S1601: Based on the device type and fault type in the query intent vector, determine the corresponding target database identifier, target table name, and target foreign key information from the structured description document.
[0043] S1602: Based on the monitoring metrics in the query intent vector, determine the target fields corresponding to the monitoring metrics from the structured description document.
[0044] In some examples of this embodiment, the target field is the sensor data corresponding to the monitoring indicator in the data table corresponding to the target table name.
[0045] S1603: Determine the time period of the target field based on the time information to be queried and the time partition information.
[0046] S1604: Based on the query intent vector, target database identifier, target table name, target foreign key information, target field, and the time period in which the target field is located, generate the initial SQL statement.
[0047] Understandably, adopting the above method can help improve the accuracy of the initial SQL statement obtained.
[0048] In some embodiments, SQL is generated based on the query intent vector, target database identifier, target table name, target foreign key information, target field, and the time period in which the target field is located, to obtain an initial SQL statement, including: S16041: The monitoring indicators in the query intent vector are identified as the indicators to be queried, and the anomaly judgment rules corresponding to the indicators to be queried in the relationship table are identified as the target anomaly judgment rules.
[0049] S16042: Based on the query intent vector, target database identifier, target table name, target foreign key information, target field, and the time period in which the target field is located, generate SQL and embed the target anomaly judgment rules into the generated transitional SQL statement to obtain the initial SQL statement.
[0050] Understandably, adopting the above methods facilitates fault diagnosis.
[0051] Please refer to Figure 2 In some embodiments, based on the fault diagnosis query statement, time semantic parsing is performed to obtain the query time information for fault diagnosis, including: S1401: Determine the time field in the fault diagnosis query statement as the target time field.
[0052] S1402: If the target time field is an absolute time expression, then the target time field will be directly converted into an SQL time range condition. An absolute time expression means that the target time field includes the start time and end time of the data to be queried.
[0053] For example, if the target time field is 2026-01-05 08:00-16:00 related data of slewing bearing jamming, then 2026-01-05 08:00-16:00 can be directly converted into SQL time range conditions.
[0054] S1403: If the target time field is a relative time expression, then the target time field will be converted into an SQL time range condition through a preset class function. The relative time expression refers to a time range that is pushed back from the current time point.
[0055] For example, if the target time field is data related to the wear of converter tilting trunnion bearings over the past 7 days, then a function can be used to convert the target time field into an SQL time range condition.
[0056] S1404: If the target time field is a time representation associated with the device's operating status, then the target time window is determined by identifying the device operating status label carried in the target field.
[0057] For example, assuming the target time field is bearing noise data from the three most recent operating phases, the target time window can be extracted by identifying equipment operating status tags carried in the target field, such as heavy load operation tags.
[0058] In this embodiment, both the SQL time range condition and the target time window are the time information to be queried.
[0059] In some embodiments, determining a query intent vector based on the matching results and the time information to be queried includes: S1501: Based on the matching results and the time information to be queried, perform query intent parsing to obtain initial query intent information.
[0060] In some instances of this embodiment, a preset neural network model can be used to parse the query intent from the matching result and the time information to be queried, so as to obtain the initial query intent information.
[0061] S1502: Perform structured processing on the initial query intent information to obtain the query intent vector.
[0062] In some embodiments, SQL generation is performed based on the query intent vector, target database identifier, target table name, target foreign key information, target field, and the time period in which the target field is located, including: First, based on the target database identifier, target table name, target foreign key information, target field, time period of the target field, and matching results in the query intent vector, SQL is generated to obtain intermediate SQL data.
[0063] 2. If the query intent vector includes the requirement for statistical analysis of fault characteristics, then insert the first type of function into the intermediate SQL data. The first type of function includes the mean function, the peak function, or the standard deviation function.
[0064] 3. If the query intent vector includes the requirement for fault evolution trend analysis, then insert a second type of function into the intermediate SQL data. The second type of function includes hysteresis function or sorting function.
[0065] Fourth, the intermediate SQL data inserted by the completion function is identified as the transitional SQL statement.
[0066] Understandably, adopting the above method can help improve the accuracy of the obtained transitional SQL statements.
[0067] In some embodiments, fault diagnosis is performed using an initial SQL statement, including: S1701: Based on the target database identifier in the initial SQL statement and the preset SQL syntax adjustment rules, the initial SQL statement is syntax adjusted to obtain the target SQL statement. The SQL syntax adjustment rules include a syntax adjustment method that corresponds one-to-one with the database.
[0068] In some examples of this embodiment, for the InfluxDB database, a TIME clause can be added to support flux dialect (a query and scripting language specifically for the time-series database InfluxDB) conversion; For the TimescaleDB database, the time_bucket function (time bucketing function) can be added to quickly locate data during the fault period; For KWDB / TDengine databases, the query syntax for time series tables TAGS can be adapted, and the query statements for multi-mode fault association can be optimized.
[0069] InfluxDB, TimescaleDB, and KWDB / TDengine are all existing open-source time-series databases.
[0070] Understandably, by adopting the above methods, it is possible to better adapt to the dialects of mainstream industrial time-series databases and support the construction of an independent and controllable data query system.
[0071] S1702: Based on the target SQL statement, complete the fault diagnosis. Specifically, based on the target SQL statement, determine the amount of data to be queried. If the amount of data to be queried exceeds the preset data volume threshold (such as 100,000 records), then complete the data query and fault diagnosis through downsampling.
[0072] Understandably, by adopting the above method, query efficiency can be improved while ensuring that fault characteristics are not lost.
[0073] Please refer to Figure 3 In some embodiments, fault diagnosis is performed based on the target SQL statement, including: S17021: Execute the target SQL statement.
[0074] In some examples of this embodiment, the syntax correctness and execution validity of the target SQL statement are verified simultaneously while the target SQL statement is executed.
[0075] S17022: If execution fails, return an error message and adjust the generation strategy of the target SQL statement (such as adjusting the time conditions associated with the fault).
[0076] S17023: If the execution is successful, the queried sensor data and the diagnostic results obtained based on the queried sensor data are obtained; noise filtering is performed on the queried sensor data to obtain the target data; the target data and diagnostic results are fed back to the preset terminal.
[0077] In some examples of this embodiment, noise filtering can be applied to the retrieved sensor data to eliminate abnormal data caused by environmental interference, sensor malfunctions, or other reasons, such as data with vibration amplitudes exceeding the sensor's range. This ensures the accuracy of the target sensor data (time-series data). By employing the above method, the accuracy of the target data can be improved.
[0078] The fault diagnosis method described in the above embodiments will be explained and illustrated below with a specific example: First, assume the target equipment is the slewing bearing of a continuous casting ladle slewing table (intermittent operation, including three stages: start-up, heavy-load operation, and shutdown); the fault diagnosis requirement is to query the vibration peak value and stress wave energy value during the heavy-load operation stage to determine whether there is an abnormal friction / impact fault; the monitoring indicators are vibration amplitude (unit: mm / s) and stress wave energy value (dimensionless unit); the time series database is TimescaleDB (containing the time series table lady_turntable_monitor, the time partition field ts, the tag field lady_turntable_id, and the data fields vibration_amp (vibration amplitude), stresswave_energy (stress wave energy), and running_state (equipment operating status)).
[0079] Secondly, a fault diagnosis-oriented domain knowledge graph and structured schema are constructed. This domain knowledge graph includes a domain terminology dictionary, as well as a table showing the relationships between fault type terms, monitoring indicator terms, and anomaly determination rules. The terminology dictionary includes terms such as slewing bearing, stress wave energy value, vibration amplitude, heavy-load operation, and abnormal friction / impact faults.
[0080] Next, the system receives fault diagnosis query statements input by the user, such as "Query the stress wave energy values of the slewing bearing of the continuous casting ladle slewing table during the last three heavy-load operation phases to determine whether there is abnormal friction".
[0081] Next, natural language fault query parsing is performed, which includes word segmentation, term matching, temporal semantic parsing, and clarifying the query intent, etc., which will not be elaborated here.
[0082] Then, based on the results of natural language fault query parsing, an initial SQL statement is generated and database adaptation optimization (i.e., database dialect adaptation) is performed to obtain the target SQL statement.
[0083] Finally, the target SQL statement is executed to obtain the vibration peak value and fault risk assessment results for three heavy-load periods; abnormal interference data exceeding the sensor range is filtered out; the "vibration peak value / stress wave energy value data + fault diagnosis result" is returned to the user; and the "fault diagnosis query statement - target SQL statement - fault diagnosis result" triple is added to the training dataset to facilitate subsequent model iteration.
[0084] Understandably, if database replacement is to be performed, target SQL statements related to fault diagnosis can be generated through dialect adaptation and optimization.
[0085] Please refer to Figure 4 This embodiment also provides a fault diagnosis system, the system including: The fault diagnosis query statement acquisition module 410 is used to acquire externally input fault diagnosis query statements; The word segmentation module 420 is used to segment the fault diagnosis query statement into words and obtain the segmentation results; The terminology matching module 430 is used to match multiple word elements in the word segmentation results with terms in the preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement. The time semantic parsing module 440 is used to perform time semantic parsing based on the fault diagnosis query statement to obtain the query time information of the fault diagnosis. The query intent determination module 450 is used to determine the query intent vector based on the matching results and the query time information; The SQL generation module 460 is used to generate SQL based on the query intent vector to obtain the initial SQL statement; The fault diagnosis module 470 is used to complete fault diagnosis using initial SQL statements. The fault diagnosis system in this embodiment can achieve the technical effects achieved by the fault diagnosis methods in the above embodiments, which will not be elaborated here.
[0086] It should be noted that the fault diagnosis method and fault diagnosis system provided in the above embodiments belong to the same concept, and the specific way in which each module performs its operation has been described in detail in the method embodiments, and will not be repeated here. In practical applications, the fault diagnosis system provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above, and this is not a limitation.
[0087] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a fault diagnosis method. This method includes: acquiring an externally input fault diagnosis query statement; segmenting the fault diagnosis query statement into words to obtain segmentation results; matching multiple tokens in the segmentation results with terms in a preset domain terminology dictionary to obtain matching results, which include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement; performing time semantic analysis based on the fault diagnosis query statement to obtain the query time information for fault diagnosis; determining a query intent vector based on the matching results and the query time information; generating an initial SQL statement based on the query intent vector; and using the initial SQL statement to complete the fault diagnosis.
[0088] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented in the form of software functional units. When sold or used as independent products, these software functional units can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] Furthermore, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the fault diagnosis method provided by the above methods. The method includes: acquiring an externally input fault diagnosis query statement; segmenting the fault diagnosis query statement into words to obtain segmentation results; matching multiple word elements in the segmentation results with terms in a preset domain terminology dictionary to obtain matching results, the matching results including: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement; performing time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis; determining a query intent vector based on the matching results and the query time information; generating SQL based on the query intent vector to obtain an initial SQL statement; and using the initial SQL statement to complete the fault diagnosis.
[0090] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0092] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A fault diagnosis method, characterized in that, The method includes: Obtain fault diagnosis query statements from external input; The fault diagnosis query statement is segmented into words to obtain the segmentation results; The word segmentation results are matched with terms in a preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement. Based on the fault diagnosis query statement, time semantic parsing is performed to obtain the query time information for fault diagnosis; Based on the matching results and the time information to be queried, a query intent vector is determined; Based on the query intent vector, SQL is generated to obtain the initial SQL statement; Use the initial SQL statement to complete the fault diagnosis.
2. The fault diagnosis method according to claim 1, characterized in that, Before obtaining the fault diagnosis query statement from external input, it also includes: Collect terminology in the field of fault diagnosis of low-speed, heavy-load, intermittently operating mechanical equipment. The terminology includes: fault type terminology, equipment type terminology, monitoring indicator terminology, and equipment operating status terminology. Based on the collected terminology, a domain terminology dictionary is constructed; Obtain the anomaly determination rules corresponding to the monitoring indicator terms, and establish a relationship table among the fault type terms, the monitoring indicator terms, and the anomaly determination rules. Construct a structured description document, which includes: database identifier, table name, field information, foreign key information, and time partition information. The table name includes the sensor data table. The field information includes the field name, data type, example value, and field description. The field description is used to characterize the correspondence between the current field and the monitoring indicator. The foreign key information includes the association between the device ID and the sensor ID, and the association between the device ID and the fault type ID. The time partition information is used to characterize the time period in which the field is located. Both the relationship table and the structured description document are used to generate the initial SQL statement.
3. The fault diagnosis method according to claim 2, characterized in that, The process of generating an initial SQL statement based on the query intent vector includes: Based on the device type and fault type in the query intent vector, the corresponding target database identifier, target table name, and target foreign key information are determined from the structured description document; Based on the monitoring metrics in the query intent vector, determine the target fields corresponding to the monitoring metrics from the structured description document; Based on the time information to be queried and the time partition information, the time period in which the target field is located is determined; Based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located, SQL is generated to obtain the initial SQL statement.
4. The fault diagnosis method according to claim 3, characterized in that, The initial SQL statement is generated based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located, including: The monitoring indicators in the query intent vector are determined as the indicators to be queried, and the anomaly judgment rules corresponding to the indicators to be queried in the relationship table are determined as the target anomaly judgment rules. Based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located, SQL is generated, and the target anomaly judgment rule is embedded into the generated transitional SQL statement to obtain the initial SQL statement.
5. The fault diagnosis method according to claim 3, characterized in that, The process involves performing time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis, including: The time field in the fault diagnosis query statement is determined as the target time field; If the target time field is an absolute time expression, then the target time field is directly converted into an SQL time range condition. The absolute time expression means that the target time field includes the start time and end time of the data to be queried. If the target time field is a relative time expression, then the target time field is converted into the SQL time range condition through a preset class function. The relative time expression refers to a time range that is pushed back from the current time point. If the target time field is a time representation associated with the device operating status, then the target time window is determined by identifying the device operating status label carried in the target field; The SQL time range condition and the target time window are both the time information to be queried.
6. The fault diagnosis method according to claim 4, characterized in that, The step of determining the query intent vector based on the matching result and the query time information includes: Based on the matching results and the time information to be queried, the query intent is parsed to obtain the initial query intent information; The initial query intent information is structured to obtain the query intent vector.
7. The fault diagnosis method according to claim 6, characterized in that, The step of generating SQL based on the query intent vector, the target database identifier, the target table name, the target foreign key information, the target field, and the time period in which the target field is located includes: Based on the target database identifier, the target table name, the target foreign key information, the target field, the time period in which the target field is located, and the matching result in the query intent vector, SQL is generated to obtain intermediate SQL data; If the query intent vector includes a requirement for fault feature statistics, then a first type of function is inserted into the intermediate SQL data. The first type of function includes a mean function, a peak function, or a standard deviation function. If the query intent vector includes a fault evolution trend analysis requirement, then a second type of function is inserted into the intermediate SQL data. The second type of function includes a hysteresis function or a sorting function. The intermediate SQL data inserted by the completion function is identified as the transitional SQL statement.
8. The fault diagnosis method according to claim 6, characterized in that, The process of using the initial SQL statement to complete fault diagnosis includes: Based on the target database identifier in the initial SQL statement and the preset SQL syntax adjustment rules, the initial SQL statement is syntax adjusted to obtain the target SQL statement. The SQL syntax adjustment rules include a syntax adjustment method that corresponds one-to-one with the database. Based on the target SQL statement, fault diagnosis is completed. Specifically, the amount of data to be queried is determined based on the target SQL statement. If the amount of data to be queried exceeds a preset data volume threshold, data query and fault diagnosis are completed through downsampling.
9. The fault diagnosis method according to claim 8, characterized in that, The step of completing fault diagnosis based on the target SQL statement includes: Execute the target SQL statement; If the execution fails, an error message is returned, and the generation strategy of the target SQL statement is adjusted. If the execution is successful, the retrieved sensor data and the diagnostic results obtained based on the retrieved sensor data are acquired; noise filtering is performed on the retrieved sensor data to obtain target data; the target data and the diagnostic results are fed back to the preset terminal.
10. A fault diagnosis system, characterized in that, The system includes: The fault diagnosis query statement acquisition module is used to acquire externally input fault diagnosis query statements. The word segmentation module is used to segment the fault diagnosis query statement into words and obtain the word segmentation results. The terminology matching module is used to match multiple word elements in the word segmentation results with terms in a preset domain terminology dictionary to obtain matching results. The matching results include: fault type, equipment type, monitoring indicators, and equipment operating status description data in the fault diagnosis query statement. The time semantic parsing module is used to perform time semantic parsing based on the fault diagnosis query statement to obtain the query time information for fault diagnosis. The query intent determination module is used to determine a query intent vector based on the matching results and the query time information; The SQL generation module is used to generate SQL based on the query intent vector to obtain an initial SQL statement; The fault diagnosis module is used to complete fault diagnosis using the initial SQL statement.