Natural language-driven thermodynamic calculation script automatic generation method and system

Through the automated process of the intent parsing module and the rule engine, calculation scripts that conform to thermodynamic specifications are generated, which solves the problems of high threshold and error rate of manually writing scripts and realizes efficient and reliable thermodynamic calculations.

CN121328542APending Publication Date: 2026-01-13RESEARCH INSTITUTE OF ADVANCED MATERIALS (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511881551.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies heavily rely on researchers manually writing thermodynamic calculation scripts, which is difficult, inefficient, and prone to errors. General natural language conversion technology cannot accurately analyze material thermodynamics terminology and verify the rationality of parameters, resulting in a high risk of generating invalid or erroneous scripts.

Method used

The system uses an intent parsing module to parse natural language commands, a rule engine to perform grammatical and physical rule verification, and a feedback optimizer to record historical computational context, thereby generating scripts that conform to thermodynamic calculation specifications.

Benefits of technology

It lowers the barrier to entry for thermodynamic calculations, improves computational efficiency and result reliability, supports multi-round iterative optimization, and reduces human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328542A_ABST
    Figure CN121328542A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of material science and computers, in particular to a natural language driven thermodynamic calculation script automatic generation method and system.The method comprises the steps that firstly, a natural language query instruction input by a user is received, core parameters are extracted through an intention analysis module, and the core parameters are converted into structured data; performing grammar and physical rule verification based on thermodynamic law and material science knowledge on the structured data by adopting a rule engine; a script generator is adopted to generate a calculation script through a multi-template dynamic assembly mechanism based on the verified structured data; and recording and maintaining a historical calculation context by adopting a feedback optimizer, and when an incremental modification instruction is received, performing incremental updating in combination with the context and driving a script generator to update a calculation script. According to the method, the use threshold of thermodynamic calculation can be remarkably reduced, the calculation efficiency is improved, the scientificity and reliability of a calculation result are guaranteed, and efficient multi-round iterative analysis is supported.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of material science and computer technology, and particularly relates to a natural language driven thermodynamic calculation script automatic generation method and system. BACKGROUND

[0002] Material thermodynamic calculation is a key link of new material design and performance prediction, and a specific type of thermodynamic calculation software is widely used. However, the existing technology seriously depends on manual writing of calculation scripts by scientific researchers in accordance with specific syntax specifications. This method has the following defects: first, the technical threshold is high, and the operator needs to have deep thermodynamic professional knowledge and programming skills, which limits the popularization of the tool; second, the script writing process is tedious and inefficient, and human errors are easily introduced due to parameter configuration errors, syntax omissions, etc., resulting in calculation failure or distorted results; finally, when performing multiple rounds of exploratory calculations, researchers need to manually manage and adjust parameters, and lack of memory of historical calculation context, making the iterative optimization process very inconvenient.

[0003] In recent years, although there are technologies for converting natural language into general code or instructions, these technologies usually lack deep understanding of specific scientific fields. In the professional field of material thermodynamic calculation, general models cannot accurately analyze professional terms in the field, and more importantly, their verification capabilities are usually limited to syntax or general logic level, and cannot effectively verify whether the parameter combination of the generated script meets the basic laws of thermodynamics and the material physics constraints, so it is difficult to directly apply to generate physically valid and reliable calculation scripts, and there is a risk of generating invalid or even erroneous scripts. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a natural language driven thermodynamic calculation script automatic generation method and system to overcome the problems existing in the prior art.

[0005] To achieve the above purpose, the technical scheme adopted by the present application is as follows: On the one hand, the present application provides a natural language driven thermodynamic calculation script automatic generation method, comprising: Step S1, receiving a natural language query instruction input by a user, and using an intent analysis module to analyze the natural language query instruction to extract core parameters related to thermodynamic calculation, and converting the core parameters into standardized structured data; Step S2, using a rule engine to perform parameter verification and physical constraint injection on the structured data, the parameter verification including syntax rule verification and physical rule verification, the physical rule verification being based on the basic laws of thermodynamics and material science professional knowledge; Step S3, using a script generator to generate a calculation script conforming to the syntax specification of the thermodynamic calculation engine based on the structured data that passes the verification through a multi-template driven dynamic assembly mechanism; Step S4, using a feedback optimizer to record and maintain the historical calculation context, when receiving the user's incremental modification instruction, incrementally updating the core parameters in combination with the historical calculation context, and driving the script generator to update the calculation script.

[0006] Further, the above-mentioned method, the core parameters at least include: element system, thermodynamic condition and calculation target.

[0007] Further, the above-mentioned method, the intention analysis module uses a named entity recognition technology enhanced by domain knowledge to analyze the natural language query instruction; or, the intention analysis module uses a large language model fine-tuned by domain knowledge to analyze the natural language query instruction.

[0008] Further, the above-mentioned method, the syntax rule verification in step S2 includes: unit conversion and numerical range check; the physical rule verification includes: checking whether the sum of the mole fraction of each element in the multi-element system is 1.

[0009] Further, the above-mentioned method, the physical rule verification further includes: detecting whether there is a logical conflict between the calculation target and the variable condition defined in the core parameters, and returning prompt information to the user when there is a logical conflict.

[0010] Further, the above-mentioned method, the multi-template driven dynamic assembly mechanism in step S3 includes: dynamically combining a pre-set basic template, a material template and a calculation template based on the calculation target and the material system, and injecting the parameters in the structured data into the combined template.

[0011] Further, the above-mentioned method, in step S4, the feedback optimizer records and maintains the historical calculation context through a context state vector.

[0012] On the other hand, the present application provides a natural language driven thermodynamic calculation script automatic generation system, comprising: An intention analysis module is configured to receive a natural language query instruction input by a user, analyze the natural language query instruction to extract core parameters related to thermodynamic calculation, and convert the core parameters into standardized structured data. a rule engine, connected with the intention analysis module, for parameter checking and physical constraint injection on the structured data, the parameter checking including syntax rule checking and physical rule checking, the physical rule checking based on the basic laws of thermodynamics and professional knowledge of material science; a script generator, connected with the rule engine, for generating a calculation script conforming to the syntax specification of the thermodynamic calculation engine through a multi-template driven dynamic assembly mechanism based on the structured data that passes the checking; a feedback optimizer, connected with the intention analysis module and the script generator respectively, for recording and maintaining a historical calculation context, and when receiving an incremental modification instruction from a user, performing incremental update on the core parameters in combination with the historical calculation context, and driving the script generator to update the calculation script.

[0013] Further, the system described above, the intention analysis module is specifically a deep learning model combining bidirectional long short-term memory network and conditional random field, or a large language model fine-tuned by domain knowledge.

[0014] Further, the system described above, the multi-template driven dynamic assembly mechanism of the script generator includes: dynamically combining a preset basic template, a material template and a calculation template based on the calculation target and the material system, and injecting the parameters in the structured data into the combined templates. The present application has the following advantages: Through the automatic process of the intention analysis module and the script generator, the user can complete complex script generation through natural language only, significantly reducing the use threshold of thermodynamic calculation, freeing researchers from tedious programming work, and greatly improving the calculation efficiency; through the built-in rule engine for checking the input parameters in terms of the laws of thermodynamics and material science knowledge, physical errors and parameter configuration errors caused by human negligence can be avoided from the source, ensuring the scientificity of the generated script and the reliability of the calculation results; through the feedback optimizer to remember and utilize the historical calculation context, the user can continuously and incrementally adjust the calculation task in a dialogue manner, greatly improving the work efficiency and continuity in exploratory research and parameter optimization scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0016] Figure 1is a flow chart of an embodiment of a natural language driven thermodynamic calculation script automatic generation method provided by the present application; Figure 2 is a structural schematic diagram of an embodiment of a natural language driven thermodynamic calculation script automatic generation system provided by the present application; Figure 3 is an architecture schematic diagram of an embodiment of a natural language driven thermodynamic calculation script automatic generation system provided by the present application; Figure 4 is a flow chart of another embodiment of a natural language driven thermodynamic calculation script automatic generation method provided by the present application. DETAILED DESCRIPTION

[0017] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described in detail below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.

[0018] Figure 1 is a flow chart of an embodiment of a natural language driven thermodynamic calculation script automatic generation method provided by the present application. Please refer to Figure 1 , the embodiment can include the following steps: Step S1, receiving a natural language query instruction input by a user, and using an intent analysis module to analyze the natural language query instruction to extract core parameters related to thermodynamic calculation, and converting the core parameters into standardized structured data; Step S2, using a rule engine to perform parameter verification and physical constraint injection on the structured data, the parameter verification including syntax rule verification and physical rule verification, the physical rule verification being based on basic laws of thermodynamics and professional knowledge of material science; Step S3, using a script generator to generate a calculation script conforming to the syntax specification of a thermodynamic calculation engine based on the verified structured data, through a multi-template driven dynamic assembly mechanism; Step S4, using a feedback optimizer to record and maintain a historical calculation context, when receiving an incremental modification instruction of the user, updating the core parameters incrementally in combination with the historical calculation context, and driving the script generator to update the calculation script.

[0019] Preferably, the core parameters at least include: an element system, thermodynamic conditions and a calculation target.

[0020] Preferably, the intention analysis module parses the natural language query instruction by adopting a named entity recognition technology enhanced by domain knowledge, or parses the natural language query instruction by adopting a large language model fine-tuned by domain knowledge.

[0021] Preferably, the syntax rule checking in step S2 includes unit conversion and numerical range checking, and the physical rule checking includes checking whether the sum of the mole fractions of each element in the multicomponent system is 1.

[0022] Preferably, the physical rule checking further includes detecting whether there is a logical conflict between the calculation target and the variable conditions defined in the core parameters, and returning prompt information to the user when there is a logical conflict.

[0023] Preferably, the multi-template driven dynamic assembly mechanism in step S3 includes dynamically combining the preset basic template, material template and calculation template based on the calculation target and material system, and injecting the parameters in the structured data into the combined template.

[0024] Preferably, in step S4, the feedback optimizer records and maintains the historical calculation context through the context state vector.

[0025] The application also provides a natural language driven thermodynamic calculation script automatic generation system for implementing the above method embodiments. Figure 2 is a structural schematic diagram provided by an embodiment of a natural language driven thermodynamic calculation script automatic generation system. As shown in Figure 2 , it comprises: an intention analysis module 1, configured to receive a natural language query instruction input by a user, analyze the natural language query instruction, extract core parameters related to thermodynamic calculation, and convert the core parameters into standardized structured data; a rule engine 2, connected with the intention analysis module 1, configured to perform parameter checking and physical constraint injection on the structured data, wherein the parameter checking includes syntax rule checking and physical rule checking, and the physical rule checking is based on basic laws of thermodynamics and professional knowledge of material science; a script generator 3, connected with the rule engine 2, configured to generate a calculation script conforming to the syntax specification of a thermodynamic calculation engine based on the structured data that passes the checking, by a multi-template driven dynamic assembly mechanism; a feedback optimizer 4, connected with the intention analysis module 1 and the script generator 3 respectively, configured to record and maintain a historical calculation context, and perform incremental update on the core parameters in combination with the historical calculation context when receiving an incremental modification instruction from the user, and drive the script generator 3 to update the calculation script.

[0026] Preferably, the intent resolution module 1 is a deep learning model that fuses a bidirectional long short-term memory network and a conditional random field, or a large language model that is fine-tuned by domain knowledge.

[0027] Preferably, the multi-template driven dynamic assembly mechanism of the script generator 3 includes dynamically combining preset basic templates, material templates and calculation templates based on the calculation target and the material system, and injecting parameters in the structured data into the combined templates.

[0028] In specific practice: Embodiment One Figure 3 An architectural schematic diagram of a natural language driven thermodynamic calculation script automatic generation system is provided in the embodiments of the present application. The system can be deployed on a cloud server or a local workstation. In terms of hardware environment, the system can include a high-performance central processor, a large-capacity memory and a high-speed solid-state disk to ensure the efficiency of data processing and model operation. In terms of software environment, the system can be based on a Linux operating system, use a high-level programming language such as Python as the main development language, and integrate multiple open-source frameworks and libraries.

[0029] In the present embodiment, the system architecture can be divided into three levels: an interaction layer 10, a function layer 20 and a model layer 30. Among them, the interaction layer 10, as the front-end interface for the system to interact with the user, can be a web-based graphical user interface or a command line terminal, responsible for receiving natural language input from the user and displaying the calculation results in the form of graphics or text. The function layer 20 is the core of the implementation of the technical solution of the present application, which can be internally constructed as a complex intelligent agent system 21. The intelligent agent system 21 is composed of multiple software modules or services working cooperatively, including a master intelligent agent 211 responsible for overall task scheduling and process control, an intent resolution intelligent agent 212 dedicated to natural language understanding, and one or more sub-intelligent agents 213 responsible for executing specific calculation tasks. As an optional implementation, different sub-intelligent agents 213 can be set up for different types of calculation tasks (such as isotherm section calculation, vertical section calculation, phase property calculation, etc.). The model layer 30 is used to provide various algorithm models and knowledge bases required for the operation of the function layer 20, such as natural language processing models, material science knowledge graphs, thermodynamic rule bases, etc. The function layer 20 communicates with external material calculation software 40 through standardized application programming interfaces. It should be noted that the material calculation software 40 is the backend engine that performs actual thermodynamic calculations, such as a calculation software that can interpret and execute specific script files. The function layer 20 sends the generated calculation script to the material calculation software 40 and receives the calculation data or image files returned by it.

[0030] The following will be described in conjunction with Figure 4The execution steps of the natural language driven thermodynamic calculation script automatic generation method provided by the embodiments of the present application are described in detail through a specific application scenario according to the flowchart shown.

[0031] Suppose a materials researcher wants to calculate the phase diagram of the Fe-Cr-Ni ternary stainless steel system at a specific temperature to guide alloy design.

[0032] Specifically, in the user input step S100, the user inputs a natural language query instruction "calculate the isothermal section phase diagram of Fe-Cr-Ni at 1200K" through the input box of the interaction layer 10.

[0033] After receiving the instruction, the process enters the intent analysis step S200. The interaction layer 10 passes the instruction to the intent analysis agent 212 in the function layer 20 (its function corresponds to the intent analysis module 1) through the internal message queue or application programming interface call. It can be understood that in this embodiment, the intent analysis module 1 can be implemented by using a named entity recognition technology enhanced by domain knowledge. Specifically, a deep learning model combining bidirectional long short-term memory network and conditional random field can be constructed. The model is trained on a large amount of annotated materials science literature and calculation script corpus, so that it can accurately identify entities related to thermodynamic calculation. When receiving the above instruction, the model will perform word segmentation and part-of-speech tagging on the sentence, and use its network structure to capture context information, and finally identify the following core parameters: Element system: The model identifies "Fe", "Cr", and "Ni" as chemical element symbols and combines them into a list.

[0034] Thermodynamic condition: The model identifies "1200K" as a temperature value and extracts the value "1200" and the unit "K".

[0035] Calculation target: The model maps the phrase "isothermal section phase diagram" to a system pre-defined calculation task identifier.

[0036] After extracting these core parameters, the intent analysis module 1 organizes them into a standardized structured data format, such as JavaScript Object Notation format data. This way eliminates the ambiguity of natural language and provides uniform and explicit input for subsequent programmatic processing.

[0037] The structured data is then passed to the master agent 211 for further processing.

[0038] Then, the process enters the rule checking step S300. The master agent 211 distributes the received structured data to the module responsible for checking, i.e., the rule engine 2. The rule engine 2 is a key link to guarantee the scientificity of calculation, which has a rich built-in syntax rule library and physical rule library. This process includes two levels of checking: Syntax rule checking: The rule engine 2 first checks whether the format and unit of the parameters conform to the specification. For example, it checks whether the temperature unit “K” is the standard unit accepted by the system. If the user inputs “1200 degrees Celsius”, the engine will automatically perform unit conversion to convert it to 1473.15 K. It also performs numerical range checking, for example, queries the built-in knowledge base to confirm whether 1200 K is within the recommended calculation temperature range (e.g., 300 K to 3000 K) of the selected thermodynamic database (such as a commercial thermodynamic database TCFE9). In this example, 1200 K is a valid value, and the checking passes.

[0039] Physical rule checking: Next, the rule engine 2 performs a deeper physical reasonableness judgment. It accesses the materials science knowledge base in the model layer 30 to query whether the Fe-Cr-Ni ternary system is supported in the selected thermodynamic database and whether there are valid thermodynamic parameters required for calculating the system. In this example, Fe-Cr-Ni is a typical stainless steel system that is well supported in mainstream databases, so the checking passes. In addition, for calculations involving component definition, the physical rule checking also checks whether the sum of the mole fractions of each element in a multi-component system is 1, which is a basic physical constraint.

[0040] After the checking passes, the rule engine 2 may perform physical constraint injection on the structured data, such as adding default step size or precision settings for the plotting range. The structured data after checking and injection is returned to the master agent 211.

[0041] After the checking is completed, the process enters the script generation step S400. The master agent 211 selects and activates a sub-agent 213 specialized in handling isothermal section calculation according to the calculation target in the structured data. The sub-agent 213 internally integrates the function of the script generator 3. In this embodiment, the script generator 3 adopts a multi-template driven dynamic assembly mechanism. It selects an isothermal section calculation template according to the calculation target. The template is a text file containing placeholders, for example, written in a Jinja2 template engine syntax based on Python language.

[0042] The script generator 3 fills the parameters in the structured data after checking (such as element list, temperature value) and system default parameters (such as database name, default plotting step size, etc.) into the placeholders in the template, and finally dynamically generates a calculation script file completely consistent with the syntax specifications of the materials calculation software 40.

[0043] Accordingly, the flow enters the script execution step S500. The child agent 213 sends the generated script to the material calculation software through the application programming interface and instructs it to execute.

[0044] The calculation engine executes the script to perform complex thermodynamic equilibrium calculations, which may take several seconds to several minutes. After the calculation is completed, the calculation engine returns the generated phase diagram picture file or data file to the functional layer 20 in the result output step S600. The functional layer 20 presents the result to the user through the interactive layer 10.

[0045] At this point, a complete calculation process is completed. It should be noted that one of the advantages of the technical solution of the present application is to support efficient multi-round iterative analysis.

[0046] Now, suppose that the user wants to explore the situation at a higher temperature after viewing the phase diagram at 1200K and inputs an incremental modification instruction: “Temperature is changed to 1300K”.

[0047] At this time, the system enters the feedback optimization loop step S700. The instruction is sent to the feedback optimizer 4. The feedback optimizer 4 is the core module for realizing multi-round interaction, which continuously records and maintains the historical calculation context during the entire session. In this embodiment, such context information can be recorded and maintained through a context state vector, which is a data structure that stores all core parameters of the last successful calculation (including the element system, all thermodynamic conditions, the calculation target, the used database, the generated script, etc.).

[0048] When the feedback optimizer 4 receives the new instruction “Temperature is changed to 1300K” (corresponding to the signaling 7 in Figure 3 , it will perform the following operations: First, the intent analysis module 1 is called to perform lightweight analysis on the new instruction, and it is identified that it is a modification operation, the target parameter is “temperature”, and the new value is “1300K”.

[0049] Then, combined with the currently maintained context state vector, incremental update is performed. That is, it locates to the field storing the temperature in the vector and updates its value from 1200 to 1300, while all other parameters (such as the element system, the calculation target) remain unchanged.

[0050] After updating the parameters, the feedback optimizer 4 directly drives the script generator 3 to regenerate the script using the updated parameter set. Since only the temperature has changed, the script generator 3 can very efficiently complete the task, only needing to pass in the new temperature value when rendering the template.

[0051] The new script is then sent to the computation engine for execution, and the new computation result is returned to the user.

[0052] In this way, the user does not need to repeatedly input all the background information such as "calculate the isothermal section phase diagram of Fe-Cr-Ni", and can realize continuous adjustment of the calculation task through simple natural language instructions, greatly improving the efficiency and experience of exploratory research.

[0053] Embodiment Two This embodiment details how the script generator 3 generates highly customized calculation scripts for complex, specific material and calculation task requests through its core "multi-template driven dynamic assembly mechanism".

[0054] The overall architecture and method flow of the system are similar to those of Embodiment One. The focus of this embodiment is on the working details of the script generator 3 in the script generation step S400. The template library of the script generator 3 does not store only a single, complete script template, but maintains a structured template system that includes at least the following three types of reusable template segments: Basic template: defines the basic process framework that must be followed for any calculation, including loading the database, setting calculation options, ending the task, and other general instruction structures. It reserves slots or blocks for the embedding of other templates.

[0055] Material template: a predefined template for some common, complex composition standard grade alloys (such as T91 steel, Inconel 718 high-temperature alloy, etc.). Each material template precisely defines the chemical composition of the material (molar or mass fraction of all elements) and all possible precipitated phases that need to be considered in the calculation.

[0056] Calculation template: a specific instruction sequence defined for different calculation goals (such as heat capacity calculation, solidification simulation, phase precipitation dynamics, etc.). For example, a heat capacity calculation template will include instructions to set up a temperature step cycle, calculate the heat capacity of the system at each temperature point, and output the results to a file.

[0057] Now, consider a more advanced application scenario. An engineer needs to evaluate the heat capacity changes of a heat-resistant steel called "T91" in a specific working temperature range. The user inputs the instruction through the interaction layer 10: "Calculate the heat capacity of T91 steel in the range of 300 to 1200 degrees Celsius".

[0058] After the intent analysis step S200 and the rule verification step S300, the script generator 3 receives a structured data containing the following information: Material system, calculation target, and thermodynamic conditions: temperature range from 300°C to 1200°C (converted from 573.15 K to 1473.15 K by rule engine 2) After receiving the data, the script generator 3 starts the dynamic assembly process: Load base template: Load a common base template file.

[0059] Identify and load material template: The script generator 3 identifies the material system as a special identifier, and then loads the corresponding material template from the template library.

[0060] Identify and load calculation template: Next, the script generator 3 identifies the calculation target and loads the corresponding calculation template.

[0061] Dynamic assembly and parameter injection: Finally, the script generator 3 performs the most critical step. It fills the content of the material template into the corresponding block of the base template, and fills the content of the calculation template into the corresponding block of the base template. At the same time, it injects specific parameters in the structured data into the corresponding placeholders in the calculation template.

[0062] Through this series of dynamic assembly and filling, a complete, highly customized, and directly executable calculation script is finally generated. This script not only contains the correct calculation process, but also accurately defines the complex material system of T91 steel and the specific heat capacity calculation logic.

[0063] It can be understood that this multi-template dynamic assembly mechanism greatly enhances the flexibility and scalability of the system. When a new material needs to be supported, only a new material template needs to be added; when a new calculation type needs to be supported, only a new calculation template needs to be added. The system can automatically combine them with existing templates, thereby supporting almost infinite combinations of calculation tasks with minimal development cost, without the need to hard-code a complete script generation logic for each possible combination.

[0064] It can be understood that the same or similar parts in the above embodiments can be mutually referred to, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0065] It should be noted that in the description of the present application, the terms "first", "second", etc. are only for the purpose of description, and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is at least two.

[0066] Any procedural or methodological descriptions in flow charts or otherwise described herein can be understood to represent modules, segments, or portions of code that include executable instructions for implementing the specific logical functions or steps, and the scope of preferred embodiments of the present application includes additional implementations in which the functions are performed in a different order, including substantially simultaneously, or in reverse order, as will be understood by those skilled in the art to which embodiments of the present application pertain.

[0067] It should be understood that portions of the present application can be implemented in hardware, software, firmware, or combinations thereof. In the above-described embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and as in another embodiment, implementation can be in any one or a combination of the following technologies, which are all well known in the art: discrete logic circuitry having logic gates for implementing logic functions upon an application of data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0068] Those skilled in the art can understand that all or part of the steps carried out by the above-described embodiments can be completed by programs instructing relevant hardware, and the programs can be stored in a computer readable storage medium, and when executed, include one or a combination of steps of the method embodiments.

[0069] In addition, each functional unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0070] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

[0071] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0072] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that variations, modifications, substitutions and changes can be made by those skilled in the art without departing from the scope of the present application.

Claims

1. A method for automatically generating thermodynamic calculation scripts driven by natural language, characterized in that, include: Step S1: Receive the natural language query command input by the user, and use the intent parsing module to parse the natural language query command to extract the core parameters related to thermodynamic calculation, and convert the core parameters into standardized structured data; Step S2: The structured data is validated by a rule engine and physical constraints are injected. The parameter validation includes syntax rule validation and physical rule validation. The physical rule validation is based on the fundamental laws of thermodynamics and professional knowledge of materials science. Step S3: Using a script generator, a calculation script conforming to the syntax specification of the thermodynamic calculation engine is generated based on the verified structured data through a multi-template driven dynamic assembly mechanism. Step S4: The feedback optimizer records and maintains the historical computation context. When an incremental modification instruction from the user is received, the core parameters are incrementally updated in conjunction with the historical computation context, and the script generator is driven to update the computation script.

2. The method according to claim 1, characterized in that, The core parameters include at least: elemental system, thermodynamic conditions, and calculation objectives.

3. The method according to claim 2, characterized in that, The intent parsing module uses domain knowledge-enhanced named entity recognition technology to parse the natural language query command; or, the intent parsing module uses a large language model finely tuned with domain knowledge to parse the natural language query command.

4. The method according to claim 1, characterized in that, The syntax rule verification in step S2 includes: unit conversion and numerical range checking; the physical rule verification includes: verifying whether the sum of the mole fractions of each element in the multivariate system is 1.

5. The method according to claim 4, characterized in that, The physical rule verification also includes: detecting whether there is a logical conflict between the calculation target and the variable conditions defined in the core parameters, and returning a prompt message to the user when there is a logical conflict.

6. The method according to claim 1, characterized in that, The multi-template driven dynamic assembly mechanism in step S3 includes: dynamically combining the preset basic template, material template and calculation template based on the calculation target and material system, and injecting the parameters in the structured data into the combined template.

7. The method according to claim 1, characterized in that, In step S4, the feedback optimizer records and maintains the historical computation context through the context state vector.

8. A natural language-driven automatic generation system for thermodynamic calculation scripts, characterized in that, include: The intent parsing module is used to receive natural language query instructions input by the user, parse the natural language query instructions to extract core parameters related to thermodynamic calculations, and convert the core parameters into standardized structured data. The rules engine, connected to the intent parsing module, is used to perform parameter validation and physical constraint injection on the structured data. The parameter validation includes syntax rule validation and physical rule validation, and the physical rule validation is based on the basic laws of thermodynamics and materials science expertise. A script generator, connected to the rule engine, is used to generate calculation scripts that conform to the syntax specifications of the thermodynamic calculation engine based on the validated structured data through a multi-template driven dynamic assembly mechanism. The feedback optimizer, connected to both the intent parsing module and the script generator, records and maintains historical computation context. When it receives an incremental modification instruction from the user, it incrementally updates the core parameters based on the historical computation context and drives the script generator to update the computation script.

9. The system according to claim 8, characterized in that, The intent parsing module is specifically a deep learning model that integrates a bidirectional long short-term memory network and a conditional random field, or a large language model fine-tuned with domain knowledge.

10. The system according to claim 8, characterized in that, The multi-template driven dynamic assembly mechanism of the script generator includes: dynamically combining preset basic templates, material templates, and calculation templates based on the calculation target and material system, and injecting the parameters in the structured data into the combined template.

Citation Information

Patent Citations

  • Rendering adjustment method of three-dimensional model, rendering adjustment method of medical three-dimensional model and computer equipment

    CN119131217A

  • Natural language-oriented fuel performance analysis method

    CN120299558A

  • Information reply method and related device

    CN120687551A

  • Driving processing method and device, storage medium and electronic equipment

    CN120851158A

  • Thermodynamic diagram generating method, device and system

    WO2019033852A1