A method and system for automatically constructing a mechanism model based on a large model
Through the automatic construction method based on large models, retrieval statements, hybrid retrieval and pseudocode generation are generated, which solves the problem of cross-domain knowledge integration in mechanism model diagnosis, improves the efficiency and accuracy of fault diagnosis, and realizes the efficient construction and reliability of mechanism models.
Patent Information
- Application Number
- CN202511055696.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-07-30
AI Technical Summary
The existing mechanism model equipment fault diagnosis method has the problem of difficulty in integrating cross-domain knowledge, high false alarm and missed alarm rates, and low efficiency of traditional modeling processes, which makes it difficult to meet the dynamic update needs of intelligent equipment.
An automatic construction method based on a large model is adopted to automatically construct a mechanism model by generating retrieval statements, hybrid retrieval, clustering and pseudocode generation, including automatic extraction and logic generation of equipment type, fault information and fault logic. The large model is used to generate mechanism model pseudocode and convert it into DSL.
It improves the efficiency and accuracy of fault diagnosis, enhances the efficiency and accuracy of knowledge retrieval, improves the efficiency and reliability of mechanism model construction, and solves the problems of low efficiency and experience dependence of manual modeling in traditional methods.
Smart Images

Figure CN120561658B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mechanism model construction, and in particular to a method and system for automatically constructing a mechanism model based on a large model. Background Art
[0002] As a core tool for equipment fault diagnosis, mechanism models demonstrate significant advantages in industrial scenarios by deeply analyzing equipment operating mechanisms and solidifying fault logic. However, in practical applications, traditional mechanism model construction methods face three systemic challenges, which restrict their promotion and application in complex industrial scenarios.
[0003] Industrial equipment is diverse and highly heterogeneous, with variations in structural principles, measurement point layouts, and failure modes across manufacturers and models. Existing modeling methods rely on manual analysis of equipment schematics, fault tree construction, and parameter correlation derivation. Engineers spend significant time reviewing equipment manuals, industry standards, and historical failure case libraries, and face challenges integrating cross-domain knowledge.
[0004] The quality of model building is highly dependent on the experience of domain experts. Experienced engineers, with their deep understanding of equipment degradation patterns, can accurately capture the coupling relationships between key fault characteristic parameters. Inexperienced engineers, on the other hand, can easily miss important failure paths, leading to incomplete model building and a high rate of false positives and false negatives.
[0005] Traditional modeling processes face significant efficiency bottlenecks. Forty percent of the time spent on mechanistic model construction is spent on literature tracing and parameter verification. As industrial equipment becomes increasingly intelligent, the number of sensors is growing exponentially, making traditional manual modeling methods unable to meet the demands of dynamic updates. Furthermore, the fragmented nature of expert experience leads to poor model reusability. Porting mechanistic models to new equipment requires modifying numerous parameters and measurement points, resulting in a waste of knowledge assets. These pain points urgently require technological innovation to transform the mechanistic model construction paradigm. Summary of the Invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the technical problems solved by the present invention are: the existing mechanism model equipment fault diagnosis method has the problems of difficulty in integrating cross-domain knowledge, high false positive and false negative rates of the mechanism model, and how to improve the accuracy of the mechanism model logic.
[0008] To solve the above technical problems, the present invention provides the following technical solutions: a method for automatically constructing a mechanism model based on a large model, comprising generating a search statement about a target fault based on the equipment type and the extracted fault information; using a hybrid search method to retrieve relevant maintenance procedures and cluster them to obtain a new maintenance procedure set; using the large model to extract the fault judgment logic and elements in the maintenance procedure set, summarizing the judgment logic, and generating a mechanism model pseudocode; parsing the mechanism model pseudocode, converting it into a mechanism model DSL, and forming a mechanism model; the extracted fault information includes equipment monitoring parameters, specific manifestations of equipment failure, and specific logic for troubleshooting whether the fault exists; the mechanism model pseudocode is generated by the large model, and is an intermediate code that describes the equipment fault diagnosis logic in a structured grammar.
[0009] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the generation of a retrieval statement about a target fault includes constructing a retrieval statement generation template based on the collected equipment information and fault information, including equipment type, fault mode and operating condition parameters, and using the large model to perform synonymous expansion on the generated statement to obtain a query set consisting of candidate queries.
[0010] As a preferred solution of the large-model-based automatic construction method of the mechanism model described in the present invention, the hybrid retrieval method includes combining semantic matching and keyword relevance retrieval, dividing the document into paragraphs and generating embedding vectors, screening by calculating the relevance scores between the retrieval statements and the paragraphs, and then using the rearrangement model to calculate the semantic similarity between each retrieval statement and the corresponding paragraph candidate set, and combining the results of the two retrieval strategies to obtain the optimal matching paragraph.
[0011] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the clustering includes processing the high-dimensional embedding vector through a dimensionality reduction algorithm, and then using a density-based unsupervised clustering algorithm to automatically group semantically similar content into the same cluster, eliminate discrete noise points, and merge paragraphs belonging to the same cluster to obtain a new paragraph set.
[0012] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the generation of mechanism model pseudocode includes extracting equipment monitoring parameters, fault manifestations and troubleshooting logic from the large model, and generating pseudocode containing variable definitions, conditional judgments and function calls according to preset pseudocode rules.
[0013] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the preset pseudocode rules include: the equipment parameters that need to be used are defined by the var parameter name; the judgment branch needs to use condition to define the condition, and the if keyword is used for judgment; the judgment branches are combined using keywords, and the logical judgment function can also be used for auxiliary judgment.
[0014] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the method comprises parsing the pseudocode of the mechanism model, converting the pseudocode text generated by the large model into an abstract syntax tree through grammatical analysis, and identifying the key elements of variable definition, conditional judgment and function call.
[0015] As a preferred solution of the method for automatically constructing a mechanism model based on a large model described in the present invention, the abstract syntax tree includes an abstract representation of the source code syntax structure, displaying the syntax and jump logic of the source code through a tree structure, and extracting the basic structure of the operation process and judgment branch of the mechanism model based on the parsed syntax tree.
[0016] As a preferred solution of the large-model-based automatic construction method of the mechanism model described in the present invention, the formation of the mechanism model includes parsing a pseudocode string, converting it into an abstract syntax tree, identifying and extracting function calls, variable declarations, and judgment branches, converting the abstract syntax tree function calls into a mechanism model DSL using syntax parsing and node extraction, and generating an executable mechanism model template using rule checking and logic verification.
[0017] Another object of the present invention is to provide an automatic mechanism model construction system based on a large model, which can parse the mechanism model pseudocode, convert it into the mechanism model DSL, and form a mechanism model, thereby solving the problem of poor extraction accuracy of the mechanism model logic contained in the current mechanism model equipment fault diagnosis technology.
[0018] As a preferred solution of the automatic construction system of mechanism model based on large model described in the present invention, it includes: a knowledge retrieval module, a preprocessing module, a pseudocode generation module, a syntax analysis and conversion module, and a model verification and output module; the knowledge retrieval module is used to generate retrieval statements according to equipment type and fault mode, and use a hybrid retrieval method to retrieve relevant maintenance procedures from the knowledge base; the preprocessing module is used to cluster the maintenance procedures in the knowledge retrieval module, and after clustering, the semantically similar contents are summarized into the same cluster, and the paragraphs in the same cluster are merged to obtain a new maintenance procedure set, and the large model is used to screen the contents in the maintenance procedure set, including equipment monitoring parameters related to the fault, specific manifestations when the equipment fails, and specific logic for checking whether the fault exists; the pseudocode generation module is used to extract information from the preprocessed knowledge based on the large model, including equipment monitoring parameters related to the fault, specific manifestations when the fault occurs, and specific logical rules, and the extracted information will be used to extract the information. All fault judgment logic and elements are combined with the diagnostic functions supported by the mechanism model to generate a mechanism model pseudocode that conforms to the grammatical specification; the grammar parsing and conversion module is used to use the character string of the generated mechanism model pseudocode to parse into an abstract syntax tree, traverse the abstract syntax tree nodes, extract function calls, variable declarations and judgment branches, judge whether the function parameter quantities of the function calls and judgment branch call parameters in the abstract syntax tree nodes are correct, whether the function parameter types are correct, and whether the judgment branches are defined using condition, convert the abstract syntax tree function calls into function call nodes in DSL, convert the conditional logic into judgment branch nodes in DSL, and obtain a complete mechanism model DSL; the model verification and output module is used to import the generated mechanism model DSL into a mechanism model engine to perform logic verification, including whether there is a loop in the node connection, whether the connection between the nodes is complete, and whether the end node is the end node, output an executable mechanism model and provide a visual interactive interface.
[0019] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a step of a method for automatically constructing a mechanism model based on a large model.
[0020] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for automatically constructing a mechanism model based on a large model.
[0021] Beneficial effects of the present invention: The present invention provides a large-model-based automatic construction method for a mechanism model, which generates retrieval statements about target faults based on equipment type and extracted fault information. The retrieval efficiency and coverage of fault diagnosis are wider, and more comprehensive and accurate data support is provided. A hybrid retrieval method is used to retrieve relevant maintenance procedures and cluster them to obtain a new maintenance procedure set, thereby improving the efficiency of knowledge retrieval and making the accuracy and relevance of knowledge retrieval stronger. The large model is used to extract the fault judgment logic and elements in the maintenance procedure set, summarize the judgment logic, generate mechanism model pseudocode, significantly improve the development efficiency and accuracy of equipment fault diagnosis, parse the mechanism model pseudocode, convert it into a mechanism model DSL, form a mechanism model, improve the construction efficiency and reliability of the mechanism model, and improve the efficiency and flexibility of the model. The present invention achieves better results in terms of knowledge retrieval efficiency, accuracy, mechanism model logic accuracy and cross-domain knowledge integration. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 This is an overall flow chart of a method for automatically constructing a mechanism model based on a large model provided in Example 1 of the present invention.
[0024] Figure 2 This is a pseudo-code AST diagram of a mechanism model for a large-model-based automatic mechanism model construction method provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0025] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0026] Example 1, reference Figure 1-Figure 2 , as an embodiment of the present invention, provides a method for automatically constructing a mechanism model based on a large model, comprising:
[0027] S1: Generate a search statement about the target fault based on the device type and the extracted fault information.
[0028] Furthermore, generating a search statement about the target fault includes constructing a search statement generation template based on the collected equipment information and fault information, including equipment type, fault mode and operating condition parameters, and using a large model to perform synonymous expansion on the generated statement to obtain a query set consisting of candidate queries.
[0029] It should be noted that the relevant equipment information and fault information required to build the mechanism model are collected, including but not limited to the input equipment type, fault mode and operating parameters, and a search statement generation template is constructed. The template syntax includes but is not limited to "{equipment type}{fault mode} fault diagnosis procedure", "{equipment type}{failure mechanism} leads to {fault mode} processing method", "{equipment type}{operating parameter} abnormal {fault mode} troubleshooting process", and the generated sentence is synonymously expanded using the large model to obtain The query set consists of candidate queries ,Synonym expansion helps to improve the recall rate of retrieval when using vectors for retrieval, and alleviates the problem of missing key retrieval content due to incomplete template syntax.
[0030] It should also be noted that by constructing a search statement generation template and using a large model to perform synonymous expansion on the generated statements to form a diverse set of candidate queries, the conversion from structured fault information to efficient search statements can be achieved, solving the problems of low recall rate and missing key information caused by the single template syntax and expression differences in traditional retrieval, and significantly improving retrieval efficiency and coverage.
[0031] S2: Use a hybrid retrieval method to retrieve relevant maintenance procedures and cluster them to obtain a new maintenance procedure set.
[0032] Furthermore, hybrid retrieval methods include combining semantic matching and keyword relevance retrieval, dividing documents into paragraphs and generating embedding vectors, screening by calculating the relevance scores between retrieval statements and paragraphs, and then using a re-ranking model to calculate the semantic similarity between each retrieval statement and the corresponding paragraph candidate set. The results of the two retrieval strategies are combined to obtain the optimal matching paragraph.
[0033] It should be noted that clustering includes, after processing the high-dimensional embedding vector through a dimensionality reduction algorithm, using a density-based unsupervised clustering algorithm to automatically group semantically similar content into the same cluster, eliminate discrete noise points, and merge paragraphs belonging to the same cluster to obtain a new paragraph set.
[0034] It should also be noted that when retrieving relevant maintenance procedures from the knowledge base, the knowledge base documents to be used are sorted into fixed length Divided into paragraphs , segment the longer text, and use the embedding model to calculate the embedding vectors of all the segmented paragraphs and the search sentence , calculate the cosine distance between each search statement and all paragraphs respectively, expressed as:
[0035] ,
[0036] in, is the cosine distance between the search sentence and all paragraphs, For the segmented paragraphs, To segment the paragraph embedding vector, To segment the vector modulus of the paragraphs, we calculate the cosine distance to determine the semantic similarity. The higher the cosine distance, the higher the similarity in the meaning of the sentences. We then calculate the relevance of each search sentence to all paragraphs, expressed as:
[0037] ,
[0038] in, For each search statement and all paragraphs of the relevance, For the search statement, For segmented paragraphs, is the total number of paragraphs, For a single term in a search statement, To include terms The number of documents, For terms In paragraph The word frequency in To control the saturation of word frequency, To control the weight decay of long documents, is the number of words in the paragraph, is the average number of words in the paragraph, for each search statement , according to the cosine distance and correlation from high to low, take the first paragraphs and , after merging and removing duplicates, the candidate set of each query is formed, and then the semantic similarity between each search statement and the corresponding paragraph candidate set is calculated using the re-ranking model, and the top candidate set is selected in descending order. The predicted probability of a paragraph , merge all Then remove duplicates to form the final paragraph set.
[0039] It should also be noted that the maintenance procedures are clustered and the paragraph set is taken The corresponding embedding vector set , usually the dimension of the embedding vector is high, so it is necessary to use the principal component analysis algorithm (PCA) For dimensionality reduction, the PCA algorithm maps high-dimensional data to a low-dimensional space through linear transformation, retaining the main change pattern of the data, which can be expressed as:
[0040] ,
[0041] in, is the covariance matrix of the data, is the corresponding eigenvalue, For the eigenvector, sort the eigenvalues from large to small and select the first The eigenvector corresponding to the largest eigenvalue , forming the projection matrix , data through Projected into low-dimensional space, it is expressed as:
[0042] ,
[0043] in, is the set of embedded vectors with dimension after dimensionality reduction, is the set of embedding vectors, As the projection matrix, use the DBSCAN algorithm to Clustering is performed, and the clustering conditions are as follows:
[0044] ,
[0045] in, is the cluster during clustering, For the data points, for The neighborhood of is the minimum number of points in the cluster, For data points Neighborhood, for and The distance between is the neighborhood radius threshold. After clustering, semantically similar content will be grouped into the same cluster, and paragraphs in the same cluster will be merged to obtain a new paragraph set. The merging operation allows unrelated or highly different content to be processed separately, while related information can be merged.
[0046] It should also be noted that by combining semantic matching and keyword relevance retrieval and introducing rearrangement model optimization, efficient and accurate retrieval of maintenance procedures in the knowledge base can be achieved, solving the problems of low recall rate and low semantic understanding of traditional retrieval methods, automatically merging similar paragraphs and eliminating noise, generating a high-quality new set of maintenance procedures, significantly improving the construction efficiency of the maintenance knowledge base, and enhancing the semantic consistency and practicality of the maintenance procedures.
[0047] S3: Use the large model to extract the fault judgment logic and elements in the maintenance procedure set, summarize the judgment logic, and generate the mechanism model pseudo code.
[0048] Furthermore, generating the mechanism model pseudocode includes extracting the equipment monitoring parameters, fault manifestations and troubleshooting logic from the large model, and generating pseudocode containing variable definitions, conditional judgments and function calls according to preset pseudocode rules.
[0049] It should be noted that the preset pseudocode rules include the device parameters that need to be used, which are defined through the var parameter name. The judgment branch needs to use condition to define the condition, and the if keyword is used for judgment. The judgment branches are combined with keywords, and logical judgment functions can also be used for auxiliary judgment.
[0050] It should also be noted that by extracting information from the equipment maintenance procedures, we can obtain information including but not limited to equipment monitoring parameters related to the fault, the specific manifestations of the equipment when a fault occurs, and the specific logic for troubleshooting whether the fault exists. All the extracted fault judgment logic and elements are combined with all the diagnostic functions supported by the mechanism model. The large model is used to generate pseudocode, and all the equipment parameters that need to be used are defined through var (parameter name). The judgment branch needs to use condition (expr, count, duration, past_time) to define the condition, and use the if keyword to make a judgment. The judgment branch uses the and, or, and not keywords to combine. The m_n(), hold(), and r_s() logical judgment functions can also be used for auxiliary judgment. The overall pseudocode needs to be packaged into a function. The function definition starts with the function name then and ends with endfunction. The final judgment function needs to be returned through the return keyword.
[0051] It should also be noted that by parsing the fault parameters of the maintenance procedures through a large model, a standardized mechanism model pseudocode is generated based on structured pseudocode, and the automatic abstraction and code conversion of the fault diagnosis logic is realized, which solves the problems of low efficiency and incomplete rule extraction of traditional manual modeling, significantly improves the adaptability of the mechanism model to complex scenarios, and improves the accuracy of the large model in extracting fault information and mechanism logic.
[0052] S4: Parse the mechanism model pseudocode, convert it into mechanism model DSL, and form a mechanism model.
[0053] Furthermore, parsing the pseudocode of the mechanism model includes converting the pseudocode text generated by the large model into an abstract syntax tree through syntax analysis, and identifying the key elements of variable definition, conditional judgment and function call.
[0054] It should be noted that the abstract syntax tree includes an abstract representation of the source code syntax structure, displaying the syntax and jump logic of the source code through a tree structure, and extracting the operating process and judgment branch infrastructure of the mechanism model based on the parsed syntax tree.
[0055] It should also be noted that the formation of the mechanism model includes parsing the pseudocode string, converting it into an abstract syntax tree, identifying and extracting function calls, variable declarations and judgment branches, using syntax parsing and node extraction to convert the abstract syntax tree function calls into a mechanism model DSL, and using rule checking and logic verification to generate an executable mechanism model template.
[0056] It should also be noted that parsing a pseudocode string into an abstract syntax tree (AST) such as Figure 2 As shown, the basic structure is identified, the AST nodes are traversed, function calls, variable declarations, and judgment branches are extracted, and the call parameters of the function calls and judgment branches in the AST nodes are judged to be in compliance with the rules. The judgment rules include but are not limited to whether the number of function parameters is correct, whether the function parameter types are correct, and whether the judgment branch is defined using condition(). If all of the above conditions are met, the rules are met; if there are any unsatisfied items, the error location and the error cause are organized into text and passed to the large model. After it is regenerated, the above parsing steps are repeated. The AST function call is converted into a function call node in the DSL, and the conditional logic is converted into a judgment branch node in the DSL. A complete mechanism model DSL is formed. The DSL is imported into the mechanism model engine for logical verification. The logical verification includes but is not limited to whether there is a loop in the node connection, whether the connection between the nodes is complete, and whether the end node is the end node. If all of these are met, the verification passes. If there is an error, the error location and the error cause are organized into text and passed to the large model. After it is regenerated, the above parsing steps are repeated. If there are no errors, it is saved as a model template and displayed to the user for further fine-tuning.
[0057] It should also be noted that through abstract syntax tree parsing and rule verification, the code will be converted into a mechanism model DSL, realizing the automatic conversion from unstructured text to executable diagnostic models and the accurate extraction of mechanism model logic, solving the problems of low efficiency and easy errors in traditional mechanism model development, and significantly improving the construction efficiency and reliability of mechanism models.
[0058] Example 2 is an embodiment of the present invention, which provides a large-model-based automatic mechanism model construction system, including a knowledge retrieval module, a preprocessing module, a pseudocode generation module, a syntax parsing and conversion module, and a model verification and output module.
[0059] The knowledge retrieval module is used to generate a retrieval statement according to the equipment type and the failure mode, and to retrieve relevant maintenance procedures from the knowledge base using a hybrid retrieval method.
[0060] Among them, the preprocessing module is used to cluster the maintenance procedures in the knowledge retrieval module. After clustering, the semantically similar contents are summarized into the same cluster, and the paragraphs in the same cluster are merged to obtain a new set of maintenance procedures. The large model is used to screen the contents in the maintenance procedure set, including equipment monitoring parameters related to the fault, the specific manifestations when the equipment fails, and the specific logic for checking whether the fault exists.
[0061] Among them, the pseudocode generation module is used to extract information from the preprocessed knowledge based on the large model, including fault-related equipment monitoring parameters, specific manifestations at the time of failure and specific logical rules, and combine all the extracted fault judgment logic and elements with the diagnostic functions supported by the mechanism model to generate a mechanism model pseudocode that conforms to the grammatical specifications.
[0062] Among them, the syntax parsing and conversion module is used to use the generated mechanism model pseudocode string to parse into an abstract syntax tree, traverse the abstract syntax tree nodes, extract function calls, variable declarations and judgment branches, judge whether the function parameter quantities of the function calls and judgment branch call parameters in the abstract syntax tree nodes are correct, whether the function parameter types are correct, and whether the judgment branches are defined using conditions, convert the abstract syntax tree function calls into function call nodes in DSL, and convert the conditional logic into judgment branch nodes in DSL to obtain a complete mechanism model DSL.
[0063] Among them, the model verification and output module is used to import the generated mechanism model DSL into the mechanism model engine to perform logic verification, including whether there is a loop in the node connection, whether the front and back connections of the node are complete, and whether the end node is the end node, output an executable mechanism model and provide a visual interactive interface.
Claims
1. A method for automatically constructing a mechanism model based on a large model, characterized in that: include: Generate a search statement about the target fault based on the device type and the extracted fault information; Generating a search statement about the target fault includes: constructing a search statement generation template based on the collected equipment information and fault information, including equipment type, fault mode, and operating condition parameters; using a large model to perform synonymous expansion on the generated statement to obtain a query set consisting of candidate queries; Use hybrid retrieval method to retrieve related maintenance procedures and perform clustering to obtain a new maintenance procedure set; The hybrid retrieval method combines semantic matching and keyword relevance retrieval, dividing documents into paragraphs and generating embedding vectors. The relevance scores between search terms and paragraphs are then calculated for screening. A re-ranking model is then used to calculate the semantic similarity between each search term and the corresponding candidate paragraphs. The results of the two retrieval strategies are combined to obtain the optimal matching paragraph. Clustering involves processing high-dimensional embedding vectors with a dimensionality reduction algorithm, then using a density-based unsupervised clustering algorithm to automatically group semantically similar content into the same cluster, remove discrete noise points, and merge paragraphs within the same cluster to obtain a new paragraph set; Use the large model to extract the fault judgment logic and elements in the maintenance procedure set, summarize the judgment logic, and generate the mechanism model pseudo code; Generating pseudocode for the mechanism model involves extracting equipment monitoring parameters, fault manifestations, and troubleshooting logic from the large model, and generating pseudocode containing variable definitions, conditional judgments, and function calls according to preset pseudocode rules. Parse the mechanism model pseudocode, convert it into mechanism model DSL, and form a mechanism model; Parsing the pseudocode of the mechanism model involves converting the pseudocode text generated by the large model into an abstract syntax tree through syntax analysis, and identifying the key elements of variable definition, conditional judgment, and function call; Forming the mechanism model involves parsing the pseudocode string, converting it into an abstract syntax tree, identifying and extracting function calls, variable declarations, and decision branches, converting the abstract syntax tree function calls into a mechanism model DSL using syntax parsing and node extraction, and generating an executable mechanism model template using rule checking and logic verification. The extracted fault information includes equipment monitoring parameters, specific manifestations of equipment failure, and specific logic for troubleshooting whether the fault exists; The mechanism model pseudo code is generated through a large model and is an intermediate code that describes the equipment fault diagnosis logic in a structured syntax.
2. The method for automatically constructing a mechanism model based on a large model according to claim 1, characterized in that: The preset pseudocode rules include: The device parameters that need to be used are defined using the var parameter name. The judgment branch needs to use condition to define the condition, use the if keyword to make judgments, use keywords to combine judgment branches, and use logical judgment functions for auxiliary judgments.
3. The method for automatically constructing a mechanism model based on a large model according to claim 1, characterized in that: The abstract syntax tree includes: The source code syntax structure is abstractly represented, and the syntax and jump logic of the source code are displayed through a tree structure. Based on the parsed syntax tree, the operation process of the mechanism model and the basic structure of the judgment branch are extracted.
4. A system for automatically constructing a mechanism model based on a large model, using the method for automatically constructing a mechanism model based on a large model according to any one of claims 1 to 3, characterized in that: It includes knowledge retrieval module, preprocessing module, pseudo code generation module, syntax parsing and conversion module, model verification and output module; The knowledge retrieval module is used to generate a retrieval statement based on the equipment type and the fault mode, and retrieve relevant maintenance procedures from the knowledge base using a hybrid retrieval method; The pre-processing module is used to cluster the maintenance procedures in the knowledge retrieval module. After clustering, semantically similar content is grouped into the same cluster, and paragraphs within the same cluster are merged to obtain a new set of maintenance procedures. The large model is used to screen the content in the maintenance procedure set, including equipment monitoring parameters related to faults, specific manifestations of equipment faults, and specific logic for troubleshooting whether the fault exists. The pseudocode generation module is used to extract information from the preprocessed knowledge based on the large model, including fault-related equipment monitoring parameters, specific fault manifestations and specific logical rules, and combines all extracted fault judgment logic and elements with the diagnostic functions supported by the mechanism model to generate a mechanism model pseudocode that conforms to the grammatical specification; The syntax parsing and conversion module is used to parse the generated mechanism model pseudocode string into an abstract syntax tree, traverse the abstract syntax tree nodes, extract function calls, variable declarations and judgment branches, determine whether the function call parameters in the abstract syntax tree nodes and the judgment branch call parameters are correct, whether the function parameter types are correct, and whether the judgment branch uses a condition definition, convert the abstract syntax tree function call into a function call node in the DSL, and convert the conditional logic into a judgment branch node in the DSL to obtain a complete mechanism model DSL; The model verification and output module is used to import the generated mechanism model DSL into the mechanism model engine to perform logic verification, including whether there is a loop in the node connection, whether the front and back connections of the node are complete, and whether the end node is the end node, output an executable mechanism model and provide a visual interactive interface.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of a method for automatically constructing a mechanism model based on a large model according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for automatically constructing a mechanism model based on a large model according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Fault diagnosis method and system for intelligent electric meter, and electronic device
CN111985561A
Government affair information intelligent fusion system and method based on big data
CN116415203A