General CAE solver file format conversion system based on large language model
Through a CAE solver file format general conversion system based on large language model, the LLM analysis conversion module, knowledge storage module and graph search module are automatically constructed and stored in the conversion path, which solves the high threshold and low efficiency of the development of the CAE solver file format conversion tool. The problem of the problem achieves flexibility and efficient conversion.
Patent Information
- Application Number
- CN202411254720.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The development threshold of existing CAE solver file format conversion tools is high and has poor scalability. The batch conversion tasks of 1 to N and N to 1 are difficult. After the conversion, a lot of manual intervention and verification are required, resulting in inefficiency.
The CAE solver file format general conversion system based on large language model, including LLM analysis conversion module, knowledge storage module, conversion algorithm module and graph search module, automatic conversion of file formats is realized through ChatGLM, Langchain, vector knowledge base and knowledge graph , build and store conversion paths to improve conversion efficiency.
It improves the flexibility of the CAE solver format conversion tool, lowers the development threshold, adapts to 1-to-N and N-to-1 batch conversion tasks, reduces manual intervention, and improves the accuracy and efficiency of the conversion.
Smart Images

Figure CN119166779A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of industrial digitalization, and in particular relates to a CAE solver file format universal conversion system based on a large language model. Background Art
[0002] The development of CAE (Computer Aided Engineering) solvers is often independent of the development of pre-processing software and post-processing software, and interacts with the two in the form of files. This has historical origins and practical engineering considerations. However, there is no specific industry standard in the field of solver development, so the final developed solver is highly dependent on the personal programming habits of the developer, which affects the compatibility between the solver and other third-party pre- and post-processing software. In particular, the mismatch of the input and output file content formats may directly lead to the solver being unable to connect with the pre- and post-processing.
[0003] Existing CAE solver file format conversion tools are usually built into commercial CAE software as black boxes. Developers cannot directly extend the tool, resulting in solver developers only being able to develop around the pre- and post-processing software specifications to be adopted, or writing an additional special converter for adaptation. The development of the converter involves complex subject backgrounds and programming knowledge, which limits the flexibility of solver development and reduces the efficiency of solver development. There are many open source CAE solver file format conversion tools, which have different reading and writing principles and programming languages, and it is difficult to integrate them all into one platform for management. The CAE solver file format conversion tools currently on the market will lose a lot of detailed information after the conversion of the model, and manual repair of the converted model is required when using it, which is extremely inefficient. In addition, existing CAE solver file format conversion tools often use tables to correspond the format themes of the files to be converted and the target files one by one, which is relatively complicated for batch conversion tasks of 1 to N and N to 1.
[0004] Therefore, there is an urgent need for a technical solution that can decouple the solver and pre- and post-processing software without affecting compatibility, further improve accuracy and reliability while ensuring flexible and convenient interaction, and be able to handle batch conversion tasks of 1 to N and N to 1. Summary of the invention
[0005] The present invention provides a CAE solver file format universal conversion system based on a large language model, which solves the technical problems of the prior art such as high technical threshold for development, poor scalability, difficulty in converting 1 to N and N to 1, and the need for a large amount of manual intervention and verification after conversion.
[0006] A general conversion system for CAE solver file formats based on a large language model, including an LLM analysis conversion module, a knowledge storage module, a conversion algorithm module, and a graph retrieval module;
[0007] The LLM analysis and conversion module applies ChatGLM to understand the conversion instructions, query and call the knowledge storage module and generate the target file content in combination with the document knowledge graph, and output the result file path for the user to view or call;
[0008] The knowledge storage module stores the file format template, domain knowledge, version information, and document knowledge graph of the CAE solver; the document knowledge graph marks whether there is a valid conversion path between files in the form of directed edges, which serves as the basis for the conversion algorithm switching algorithm process;
[0009] The graph retrieval module quickly indexes the document knowledge graph subgraphs related to the current topic format conversion during the file format conversion task, locates the conversion task keyword topic in combination with the conversion algorithm, and provides the current task background knowledge for the LLM analysis and conversion module;
[0010] The conversion algorithm module contains a conversion algorithm, realizes the construction and storage of new conversion paths in the document knowledge graph, combines with the graph retrieval module to realize the determination and positioning of the keyword theme of the conversion task, completes the conversion content filling, and connects the LLM analysis conversion module and the graph retrieval module in series.
[0011] Each module is further described below.
[0012] In the LLM analysis conversion module, the query call knowledge storage module refers to the knowledge stored in the form of vectors in the knowledge base connected through Langchain, which expands the knowledge content and related subject knowledge rules of ChatGLM in the solver file conversion business;
[0013] Combining the document knowledge graph means enriching the specific task background knowledge from the file format to be converted to the target file format, and the subject hierarchy and complex relationships in the target file format template by combining the template structure information supplemented by the document knowledge graph.
[0014] In the knowledge storage module, the file format template, domain knowledge, and version information of the CAE solver are efficiently stored in the form of vectors based on FAISS;
[0015] The document knowledge graph is based on Neo4j, classifies the content of the file template step by step in a bottom-up manner, and is constructed based on the classification results to show the complex relationship between the topics in the file template.
[0016] Furthermore, the file format template is stored in the knowledge base in the form of a vector before starting the conversion task. If it does not exist, the template should be created first. The template should include keywords and content structure examples of the corresponding keywords representing the subject;
[0017] Template keywords include node definition, element definition, material definition, property definition, boundary conditions, load definition, and analysis control.
[0018] In the knowledge storage module, common CAE solver file formats include .inp, .nas, .k, .mph, etc., which usually include node coordinates, material properties, boundary conditions, load step information, mesh information, solution control parameters, geometric models, calculation results, etc.; the domain knowledge includes mathematical models, algorithm theory, subject knowledge, engineering principles, etc.; the version archive refers to the config file and log file that save the ChatGLM model history, so that developers can trace and manually correct the model optimization effect.
[0019] The conversion path refers to the storage path of the target file template and the subject positioning table; the subject positioning table contains the relative positions of all keyword subjects in the template. The relative positions in the subject positioning table will float as the conversion result content under the keyword subject is filled in the specific conversion task.
[0020] A valid conversion path refers to the file template path and topic location table recorded in the solver format conversion process that has been successfully completed and can be replicated; format documents with valid conversion paths in the document knowledge graph are connected together through directed edges.
[0021] In the graph retrieval module, the document knowledge graph subgraph related to the current topic format is used to provide ChatGLM with complex relationships between file structures, alleviate the illusion phenomenon of ChatGLM in the solver file format conversion task, and improve efficiency when creating new conversion paths;
[0022] Fast indexing needs to work according to the conversion algorithm in combination with the document knowledge graph, the file to be converted, the target file format template and the subject positioning table; during the conversion task, the subject positioning table updates the relative position in the table according to the conversion algorithm process of the specific task.
[0023] In the conversion algorithm module, the construction and storage of new conversion paths in the document knowledge graph are realized, including:
[0024] The conversion algorithm locates the target file template and records the path; retrieves the subgraph with the highest relevance from the document knowledge graph related to the target file format template; obtains the topic location at the end node of the retrieved subgraph with the highest relevance and records it in the topic location table; creates a directed edge from the file to be converted to the target file, and marks the conversion path.
[0025] In the conversion algorithm module, the graph retrieval module is combined to realize the determination and positioning of the conversion task keyword theme. For tasks with effective path conversion, the following are included:
[0026] The valid path known by the graph retrieval can obtain the file format template path, create a copy after positioning, initialize the template theme counter i, the actual theme counter j, and the content counter count; according to the theme positioning table in the conversion path, the pointer is positioned to the internal theme position Pi=Pi+count of the file template copy, where count is used to compensate for the theme positioning fluctuation;
[0027] For tasks that do not have valid path conversions, these include:
[0028] According to the node where the document name is located, locate the path where the target file format template is located, and create a copy after recording the path, and initialize the content counter count to compensate for the positioning fluctuation; obtain the relative position of the file template where the minimum unit keyword theme is located from the terminal node of the graph retrieval, locate the keyword theme in the template copy, and record the theme position as P = current position - count.
[0029] In the conversion algorithm module, the conversion content filling is completed. For the conversion task with an effective conversion path, it includes:
[0030] ChatGLM is applied to analyze and classify the text of the file to be converted. If the content is a topic, first determine whether the initialized template topic counter i and the actual topic counter j point to the same topic. If not, an alarm is issued to wait for manual interaction. If it is the same topic, the topic structure example is extracted to the prompt to limit the ChatGLM behavior, and the structure example is deleted in the copy. If it is content, ChatGLM is applied to convert it according to the prompt that integrates the conversion instruction, knowledge storage module knowledge and rules, and related sub-graph information, and fills the generated conversion result content into the file template copy pointer. If it is EOF, a completion instruction is sent to the LLM analysis and conversion module.
[0031] For conversion tasks that do not have a valid conversion path, they include:
[0032] Use ChatGLM to perform LLM analysis and classification on the text to be converted. If the content is a topic, perform graph retrieval to obtain the subgraph with the highest average cosine similarity; obtain the relative position of the file template where the minimum unit keyword topic is located from the terminal node of the graph retrieval, and locate the keyword topic in the template copy; extract the structure example to the prompt, and delete the structure example in the copy; if it is content, apply ChatGLM to perform LLM conversion according to the prompt that is a fusion of conversion instructions, knowledge storage module knowledge and rules, and related subgraph information, and fill the generated result content into the file template copy pointer; if it is EOF, send a completion instruction to the LLM analysis and conversion module.
[0033] In the conversion algorithm module, the LLM analysis conversion module and the graph retrieval module are connected in series, including:
[0034] Retrieve the document knowledge graph to determine whether there is an effective conversion path from the to-be-converted file format to the target file format, and select different algorithm processes for topic positioning based on the results;
[0035] After the topic is successfully located, the algorithm calls ChatGLM to classify and analyze the text of the file to be converted, and selects content filling processing based on the results, continues topic positioning, and sends a conversion completion signal to the LLM analysis and conversion module.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention combines ChatGLM, Langchain, vector knowledge base, and knowledge graph to perform universal conversion of CAE solver file formats, thereby improving the flexibility of CAE solver format conversion tools, lowering the secondary development threshold of CAE solver format conversion tools, and adapting to 1-to-N and N-to-1 batch conversion tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 The overall architecture diagram of a CAE solver file format universal conversion system based on a large language model of the present invention;
[0039] Figure 2 It is a structural diagram of the knowledge storage module in the basic invention;
[0040] Figure 3 A flowchart of the solver format conversion in the present invention;
[0041] Figure 4 is the first flow chart of the conversion algorithm in the present invention;
[0042] Figure 5 is a second flow chart of the conversion algorithm in the present invention; DETAILED DESCRIPTION
[0043] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0044] like Figure 1 As shown, a general conversion system for CAE solver file formats based on a large language model includes an LLM analysis conversion module, a knowledge storage module, a conversion algorithm module, and a graph retrieval module.
[0045] LLM analysis conversion module, applies ChatGLM to understand conversion instructions, queries and calls the knowledge storage module and generates the target file content in combination with the document knowledge graph, and outputs the result file path for users to view or call;
[0046] Knowledge storage modules, such as Figure 2 As shown, the file format template, domain knowledge, version information, and document knowledge graph of the CAE solver are stored; the document knowledge graph marks whether there is a valid conversion path between each file in the form of directed edges, which serves as the basis for the conversion algorithm switching algorithm process;
[0047] The graph retrieval module quickly indexes the document knowledge graph subgraphs related to the current topic format conversion during the file format conversion task, locates the conversion task keyword topic in combination with the conversion algorithm, and provides the current task background knowledge for the LLM analysis and conversion module;
[0048] The conversion algorithm module contains the conversion algorithm, which realizes the construction and storage of new conversion paths in the document knowledge graph, combines with the graph retrieval module to determine and locate the keyword topics of the conversion task, completes the conversion content filling, and connects the LLM analysis conversion module and the graph retrieval module in series.
[0049] like Figure 3 As shown, the method for converting the CAE solver file format using the CAE solver file format universal conversion system of the present invention comprises the following steps:
[0050] S01, knowledge base construction and data processing, including building a vector knowledge base and document knowledge graph with rich CAE solver file formats and domain knowledge, and connecting to the ChatGLM model through the Langchain framework.
[0051] Among them, as shown in Table 1, data collection includes obtaining relevant data on various solver file formats from public resources such as public CAE solver documents, technical specifications, academic papers, technical blogs, etc.; as shown in Table 2, subject experts are invited to provide subject knowledge about solver file formats in specific subject areas through interviews, questionnaires, and participation in technical seminars.
[0052] Table 1: Examples of common solvers and their file formats
[0053]
[0054] Table 2: Examples of subject knowledge
[0055]
[0056] Among them, the establishment of the knowledge graph is based on Neo4j. The features of each part of the format file template are extracted according to the bottom-up method and classified step by step, and then constructed according to the classification results. The subsequent maintenance of the knowledge graph mainly lies in the addition, deletion, modification and query of directed edges and valid paths between documents that successfully complete the conversion task.
[0057] Among them, the knowledge base construction uses FAISS to store the above vectors to build a vector knowledge base, and uses Langchain to connect the vector knowledge base with the ChatGLM model.
[0058] S02, apply the ChatGLM model to obtain developer instructions and define file format conversion tasks. Developers put forward requirements for the CAE solver file format that needs to be converted, and send these requirements to ChatGLM in easy-to-understand natural language commands, such as "convert file format A to file format B".
[0059] After receiving the command, the ChatGLM model understands the specific intent of the command, matches these intents with the content in the vector knowledge base through the Langchain architecture, and searches and extracts knowledge and rules related to format A and format B in the knowledge base.
[0060] S03, searching the document knowledge graph to determine whether there is an effective conversion path from the to-be-converted file format to the target file format.
[0061] S04-1, if it exists, then proceed to Figure 4 The algorithm flow is shown.
[0062] The file format template path can be obtained from the known valid path. After locating, a copy is created, and the template topic counter i, actual topic counter j, and content counter count are initialized. The actual topic counter and content counter of the 1-to-N task can theoretically increase to N, and the initialization template topic counter and content counter of the N-to-1 task can theoretically increase to N.
[0063] According to the indication of the subject positioning table in the conversion path, the pointer is positioned to the subject position Pi=Pi+count inside the file template copy, where count is used to compensate for the subject positioning fluctuation.
[0064] ChatGLM is applied to analyze and classify the text of the file to be transferred. If the content is a topic, it is first determined whether topic i and topic j are the same topic. If not, an alarm is issued and manual interaction is required. If they are the same topic, the topic structure example is extracted to prompt to limit ChatGLM behavior, and the structure example is deleted in the copy, the pointer is moved, the template topic counter and the actual topic counter are increased by 1, and the analysis is returned to ChatGM for subsequent content processing.
[0065] If it is content, ChatGLM is applied to convert it according to prompt, and the generated conversion result content is filled into the file template copy pointer, and the pointer is moved to the end of the content, the content counter count = content position offset, and the pointer positioning step is returned.
[0066] If it is EOF, the process ends.
[0067] S04-2, if it does not exist, then proceed to Figure 5 The algorithm flow is shown.
[0068] According to the node where the document name is located, locate the path where the format file is located, and create a copy after recording the path, and initialize the content counter count to compensate for the positioning fluctuation. In the 1-to-N task and the N-to-1 task, if x (N≥x≥1) conversion paths do not exist, the content counter can theoretically be set to x.
[0069] Use ChatGLM to perform LLM analysis and classification on the text to be transferred. If the content is a topic, perform graph retrieval to obtain the subgraph with the highest average cosine similarity, and combine it with the vector knowledge base to expand context understanding. Obtain the relative position of the file template where the smallest unit keyword topic is located from the terminal node of the graph retrieval, locate the keyword topic in the template copy, and record the topic position as P = current position-count.
[0070] Extract the structure example to prompt, delete the structure example in the copy, loop to the LLM analysis step, and wait for the conversion results to be filled.
[0071] If it is content, apply ChatGLM to perform LLM conversion according to prompt, and fill the generated result content into the file template copy pointer, move the pointer to the end of the content, update count = content position offset, loop to the LLM analysis step, and process the subsequent content.
[0072] If it is EOF, the conversion path from the file to be converted to the target file is recorded and then ended, and a directed edge from the file to be converted to the target file is created in the document knowledge graph.
[0073] S05, the LLM analysis conversion module returns the result file path for the user to view or call.
[0074] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A CAE solver file format universal conversion system based on a large language model, characterized in that: It includes LLM analysis and conversion module, knowledge storage module, conversion algorithm module and graph retrieval module; The LLM analysis and conversion module applies ChatGLM to understand the conversion instructions, query and call the knowledge storage module and generate the target file content in combination with the document knowledge graph, and output the result file path for the user to view or call; The knowledge storage module stores the file format template, domain knowledge, version information, and document knowledge graph of the CAE solver; the document knowledge graph marks whether there is a valid conversion path between files in the form of directed edges, which serves as the basis for the conversion algorithm switching algorithm process; The graph retrieval module quickly indexes the document knowledge graph subgraphs related to the current topic format conversion during the file format conversion task, locates the conversion task keyword topic in combination with the conversion algorithm, and provides the current task background knowledge for the LLM analysis and conversion module; The conversion algorithm module contains a conversion algorithm, realizes the construction and storage of new conversion paths in the document knowledge graph, combines with the graph retrieval module to realize the determination and positioning of the keyword theme of the conversion task, completes the conversion content filling, and connects the LLM analysis conversion module and the graph retrieval module in series.
2. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the LLM analysis conversion module, the query call knowledge storage module refers to the knowledge stored in the form of vectors in the knowledge base connected through Langchain, which expands the knowledge content and related subject knowledge rules of ChatGLM in the solver file conversion business; Combining the document knowledge graph means enriching the specific task background knowledge from the file format to be converted to the target file format, and the subject hierarchy and complex relationships in the target file format template by combining the template structure information supplemented by the document knowledge graph.
3. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the knowledge storage module, the file format template, domain knowledge, and version information of the CAE solver are efficiently stored in the form of vectors based on FAISS; The document knowledge graph is based on Neo4j, classifies the content of the file template step by step in a bottom-up manner, and is constructed based on the classification results to show the complex relationship between the topics in the file template.
4. The CAE solver file format universal conversion system based on a large language model according to claim 3 is characterized in that: The file format template is stored in the knowledge base in the form of a vector before starting the conversion task. If it does not exist, the template should be created first. The template should include keywords and content structure examples of the corresponding keywords representing the subject; Template keywords include node definition, element definition, material definition, property definition, boundary conditions, load definition, and analysis control.
5. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the knowledge storage module, the effective conversion path refers to the file template path and subject location table recorded by the solver format conversion process that has been successfully completed and can be replicated; format documents with effective conversion paths in the document knowledge graph are connected together by directed edges.
6. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the graph retrieval module, the document knowledge graph subgraph related to the current topic format is used to provide ChatGLM with complex relationships between file structures, alleviate the illusion phenomenon of ChatGLM in the solver file format conversion task, and improve efficiency when creating new conversion paths; Fast indexing needs to work according to the conversion algorithm in combination with the document knowledge graph, the file to be converted, the target file format template and the subject positioning table; during the conversion task, the subject positioning table updates the relative position in the table according to the conversion algorithm process of the specific task.
7. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the conversion algorithm module, the construction and storage of new conversion paths in the document knowledge graph are realized, including: The conversion algorithm locates the target file template and records the path; retrieves the subgraph with the highest relevance from the document knowledge graph related to the target file format template; obtains the topic location at the end node of the retrieved subgraph with the highest relevance and records it in the topic location table; creates a directed edge from the file to be converted to the target file, and marks the conversion path.
8. The CAE solver file format universal conversion system based on a large language model according to claim 1 is characterized in that: In the conversion algorithm module, the graph retrieval module is combined to realize the determination and positioning of the conversion task keyword theme. For tasks with effective path conversion, the following are included: The valid path known by the graph retrieval can obtain the file format template path, create a copy after positioning, initialize the template theme counter i, the actual theme counter j, and the content counter count; according to the theme positioning table in the conversion path, the pointer is positioned to the internal theme position Pi=Pi+count of the file template copy, where count is used to compensate for the theme positioning fluctuation; For tasks that do not have valid path conversions, these include: According to the node where the document name is located, locate the path where the target file format template is located, and create a copy after recording the path, and initialize the content counter count to compensate for the positioning fluctuation; obtain the relative position of the file template where the minimum unit keyword theme is located from the terminal node of the graph retrieval, locate the keyword theme in the template copy, and record the theme position as P = current position - count.
9. The CAE solver file format universal conversion system based on a large language model according to claim 1, characterized in that: In the conversion algorithm module, the conversion content filling is completed. For the conversion task with an effective conversion path, it includes: ChatGLM is applied to analyze and classify the text of the file to be converted. If the content is a topic, first determine whether the initialized template topic counter i and the actual topic counter j point to the same topic. If not, an alarm is issued to wait for manual interaction. If it is the same topic, the topic structure example is extracted to the prompt to limit the ChatGLM behavior, and the structure example is deleted in the copy. If it is content, ChatGLM is applied to convert it according to the prompt that integrates the conversion instruction, knowledge storage module knowledge and rules, and related sub-graph information, and fills the generated conversion result content into the file template copy pointer. If it is EOF, a completion instruction is sent to the LLM analysis and conversion module. For conversion tasks that do not have a valid conversion path, they include: Use ChatGLM to perform LLM analysis and classification on the text to be converted. If the content is a topic, perform graph retrieval to obtain the subgraph with the highest average cosine similarity; obtain the relative position of the file template where the minimum unit keyword topic is located from the terminal node of the graph retrieval, and locate the keyword topic in the template copy; extract the structure example to the prompt, and delete the structure example in the copy; if it is content, apply ChatGLM to perform LLM conversion according to the prompt that is a fusion of conversion instructions, knowledge storage module knowledge and rules, and related subgraph information, and fill the generated result content into the file template copy pointer; if it is EOF, send a completion instruction to the LLM analysis and conversion module.
10. The CAE solver file format universal conversion system based on a large language model according to claim 1, characterized in that: In the conversion algorithm module, the LLM analysis conversion module and the graph retrieval module are connected in series, including: Retrieve the document knowledge graph to determine whether there is an effective conversion path from the to-be-converted file format to the target file format, and select different algorithm processes for topic positioning based on the results; After the topic is successfully located, the algorithm calls ChatGLM to classify and analyze the text of the file to be converted, and selects content filling processing based on the results, continues topic positioning, and sends a conversion completion signal to the LLM analysis and conversion module.
Citation Information
Patent Citations
Simulation calculation system, method and device, electronic equipment and readable storage medium
CN115904622A
Domain knowledge graph automatic construction method based on large language model and prompt project
CN117035076A
Cited By
System for designing large language model application workflows
TWI911018B
