Method for constructing modelica model dataset based on execution feedback

By cleaning, labeling, and filtering the Modelica model library, generating models using large language models, and constructing an execution feedback dataset in conjunction with simulation testing, the quality and usability issues of the Modelica model dataset were resolved, enabling efficient dataset construction and application.

CN120781074BActive Publication Date: 2026-05-12ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2025-05-19
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

The existing Modelica model dataset has problems in terms of data volume, quality and availability, and lacks an effective annotation and transformation mechanism, which leads to difficulties in management and application.

Method used

By collecting Modelica model libraries, performing data cleaning, annotation, and filtering, generating prompt words, and using large language models to generate models, and combining model compilation and simulation testing to construct an execution feedback dataset, a high-quality Modelica model dataset is finally formed.

Benefits of technology

It enables automated and high-quality construction of Modelica model datasets, improves the adaptability and usability of data, and provides reliable data support for system modeling and engineering simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781074B_ABST
    Figure CN120781074B_ABST
Patent Text Reader

Abstract

The application discloses a Modelica model dataset construction method based on execution feedback. The application relates to the technical field of natural language processing and multi-field modeling. The method aims to process Modelica models by using an execution feedback method to generate available Modelica datasets. The method uses an open-source Modelica model library as initial data for data processing. The data processing process includes data cleaning, data filtering, data labeling, and data conversion based on execution feedback. The Modelica model library processed through the data processing is finally processed into an available Modelica dataset, which can be used as training data for a natural language processing task. The application realizes Modelica model dataset construction through natural language processing technology, improves the quality and applicability of the model dataset, and provides a new data source for the natural language processing field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to natural language processing and multi-domain modeling techniques, and in particular to a method for constructing the Modelica model dataset based on execution feedback. Background Technology

[0002] Modelica is a language for modeling and simulating complex physical systems, providing a standardized method for describing system behavior through mathematical equations. Modelica models are widely used in various research fields, including mechanical, electrical, electronic, hydraulic, thermal, control, power, and process control. As an equation-based, object-oriented, multi-domain modeling language, Modelica models are constructed through equations relating to components and their interactions. Therefore, Modelica provides a convenient, simple language and technology for engineering modeling, suitable for secondary development of simulation models.

[0003] The Modelica Standard Library is a model library developed and maintained by the Modelica Association, integrating commonly used component models from multiple engineering domains. It includes constants, types, connectors, abstract models, and component models, all centrally managed through corresponding packages. In addition to the Standard Library, there are many open-source or commercial component model libraries developed by model developers for various fields, covering a wide range of applications such as architecture, biochemistry, and drones. These libraries provide Modelica users with abundant model resources, enabling them to quickly build complex system models and perform simulations and analyses.

[0004] As engineering applications and system complexity increase, the number and complexity of Modelica models are also constantly rising, leading to a surge in demand for Modelica model datasets. However, existing Modelica model datasets still present numerous problems in terms of data volume, quality, and usability. Although the Modelica open-source community and some commercial organizations have accumulated a certain number of model libraries, these libraries are mostly scattered and lack systematic organization and extraction. Furthermore, existing technologies lack effective annotation and transformation mechanisms, making it impossible to effectively extract and reorganize information such as model functionality, parameters, and behavior, further complicating the management and application of Modelica model datasets.

[0005] Therefore, it is necessary to systematically organize and extract existing Modelica model datasets and establish standardized data annotation and transformation mechanisms to improve the quality and usability of model datasets and ensure that Modelica models can realize their potential in a wider range of application scenarios. Summary of the Invention

[0006] The purpose of this application is to provide a method for constructing a Modelica model dataset based on execution feedback, in order to solve the technical problems of Modelica dataset shortage, low data quality and availability, and lack of effective annotation and transformation mechanisms in related technologies.

[0007] According to a first aspect of the embodiments of this application, a method for constructing a Modelica model dataset based on execution feedback is provided, including:

[0008] Collect the Modelica model library and extract valid model samples from it as the initial dataset;

[0009] The data in the initial dataset is cleaned, and then the cleaned initial dataset is labeled.

[0010] For the initial dataset after data labeling, data filtering is performed based on the characteristics of each data point to remove models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that do not have executable modeling semantics.

[0011] Based on the Modelica model and its annotations in the filtered initial dataset, prompt words for the Modelica model are generated. The prompt words and the model are converted into data formats to form the original dataset. Then, the prompt words are used as input to the large language model to generate the corresponding Modelica model.

[0012] The generated Modelica model is compiled and simulated, and an execution feedback dataset is constructed. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, and thus the Modelica dataset is obtained. The Modelica dataset consists of the model dataset and the execution feedback dataset.

[0013] Optionally, collect the Modelica model library and extract valid model samples from it as the initial dataset, including:

[0014] Collect a diverse Modelica model library;

[0015] By traversing the .mo files in the Modelica open-source library, relevant models are extracted from the Modelica model library to form a structured initial dataset.

[0016] Optionally, the data in the initial dataset is cleaned, and then the cleaned initial dataset is labeled, including:

[0017] Regular expressions are used to clean the identified model content, removing non-encoded characters, redundant spaces and newlines from the model text, and also removing comments to make the model structure clearer;

[0018] The Modelica version information, model description, related documents, and source information reflecting the model's organization and hierarchy are labeled into each corresponding Modelica model data, forming data in a standard format.

[0019] Optionally, for the initial dataset after data labeling, data filtering is performed based on the characteristics of each data point to remove models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that lack executable modeling semantics, including:

[0020] First, models that lack both model descriptions and documentation in the labeled dataset are removed to ensure that each model in the dataset has a clear description of its function and purpose.

[0021] Then set a reasonable threshold for the number of characters or lines, and eliminate models whose length exceeds the set limit;

[0022] Finally, auxiliary modules or document samples that do not possess executable modeling semantics are removed from the Modelica model.

[0023] Optionally, generate prompt words for the Modelica model, and then use the prompt words as input to a large language model to generate the corresponding Modelica model, including:

[0024] Using a large language model, prompt words are created in batches on the model data in the dataset. These prompt words include the model's functions, key features, parameters, behavioral descriptions, and relevant contextual information, so as to provide sufficient guidance for the large language model and help it generate high-quality Modelica models.

[0025] The generated prompt words are then input into the large language model. Leveraging the large language model's generation capabilities, a Modelica model that matches the original model's functionality and structure is output based on the prompt words.

[0026] Optionally, the generated Modelica model is compiled and simulated for testing, and an execution feedback dataset is constructed. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, which includes:

[0027] The generated Modelica model is compiled and simulated. If the generated model fails the model compilation or simulation test, the error information in the compilation or simulation execution process is extracted, and the error information is associated with the corresponding error model sample to form an execution feedback dataset.

[0028] The model dataset is obtained by removing model samples involved in the execution feedback dataset from the original dataset. The final Modelica dataset consists of two parts: the model dataset that has passed simulation validation, and the execution feedback dataset that has not passed validation but whose execution feedback information has been merged.

[0029] The beneficial effects of this invention are as follows: This invention adopts a model generation and screening mechanism that combines large language models with simulation execution feedback. It can perform simulation verification on the generated Modelica model, automatically extract error information, and optimize data samples through execution feedback, thereby constructing a high-quality execution feedback dataset. Therefore, it effectively overcomes the technical problems of uncontrollable sample quality, difficulty in locating and utilizing erroneous models, and difficulty in meeting the needs of real modeling and simulation in the existing model data construction process. It thus realizes the automated and high-quality construction of Modelica model datasets, provides reliable data support for downstream tasks such as system modeling and engineering simulation, and improves the adaptability and effectiveness of data in cross-domain modeling tasks.

[0030] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0032] Figure 1 This is a flowchart illustrating a Modelica model dataset construction method based on execution feedback, according to an exemplary embodiment.

[0033] Figure 2 This is a flowchart illustrating the construction of the original dataset for the Modelica model, according to an exemplary embodiment.

[0034] Figure 3 This is a flowchart illustrating the construction of a Modelica model execution feedback dataset according to an exemplary embodiment.

[0035] Figure 4 This is a block diagram of a Modelica model dataset construction apparatus based on execution feedback, according to an exemplary embodiment. Detailed Implementation

[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0037] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0038] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0039] Figure 1 This is a flowchart illustrating a method for constructing a Modelica model dataset based on execution feedback, according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps:

[0040] S1: Collect the Modelica model library and extract valid model samples from it as the initial dataset; this step may include the following sub-steps:

[0041] S11: Collect a diverse Modelica model library;

[0042] Specifically, taking the Modelica standard library as an example, these libraries typically contain multiple pre-built components, models, and functions covering various engineering and scientific fields, such as thermodynamics, fluid mechanics, and power systems. Collecting these model libraries is used to build a diverse training dataset that can support different types of modeling needs and application scenarios.

[0043] S12: Extract relevant models from the Modelica model library by traversing the .mo files in the Modelica open-source library to form a structured initial dataset.

[0044] Specifically, for each Modelica model library, the text and related information from the .mo files, including Modelica version information, model descriptions, and related documentation, are saved to a JSON file.

[0045] S2: Clean the data in the initial dataset, and then label the cleaned initial dataset; this step may include the following sub-steps:

[0046] S21: Use regular expressions to clean the identified model content, remove non-encoded characters, redundant spaces and newlines from the model text, and also remove comments to make the model structure clearer;

[0047] S22: Label each Modelica model data entry with Modelica version information, model description, related documents, and source information that reflects the model's organization and hierarchy, forming data in a standard format.

[0048] Specifically, standard data formats include, for example, the following format: "{"model": "", "modelica version":"", "discrption": "", "documentation": "", "source": ""}. Converting data into a standard format ensures the consistency and readability of the dataset, facilitating subsequent data processing and model analysis.

[0049] S3: For the labeled dataset, based on the characteristics of each data point, perform data filtering to remove models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that lack executable modeling semantics. This step may include the following sub-steps:

[0050] S31: First, remove models in the dataset that lack both model description and documentation after data labeling to ensure that each model in the dataset has a clear description of its function and purpose.

[0051] Specifically, by checking the description and documentation fields of each model, if both fields are empty or missing, the model is removed from the dataset to improve the quality of the dataset and the interpretability of the models, thus providing a reliable data foundation for subsequent modeling and simulation.

[0052] S32: Then set a reasonable threshold for the number of characters or lines, and eliminate models whose length exceeds the set limit;

[0053] Specifically, the number of tokens for each model is calculated and compared with a set threshold. If the model length exceeds a predetermined range, it is removed from the dataset to avoid analysis and processing difficulties caused by excessive model complexity, thereby ensuring the operability of the dataset.

[0054] S33: Finally, remove auxiliary modules or document samples from the Modelica model that do not have executable modeling semantics.

[0055] Specifically, by identifying the path name of the model file, if the file path contains keywords such as "UserGuide" or "Icon", these samples are removed from the dataset, thereby improving the accuracy of data processing and model generation. These samples usually contain graphical representations or usage instructions, rather than actual modeling information.

[0056] S4: Based on the Modelica models and their annotations in the filtered initial dataset, generate prompt words for the Modelica models. Convert the data format of the prompt words and models to form the original dataset. Then, use the prompt words as input to the large language model to generate the corresponding Modelica model. This step may include the following sub-steps:

[0057] S41: Use the large language model to create cue words in batches for the model data in the dataset. These cue words include the model's functions, key features, parameters, behavioral descriptions, and related contextual information to provide sufficient guidance for the large language model and help it generate high-quality Modelica models.

[0058] Specifically, by analyzing the description, parameters, and document content of each model, and leveraging the text summarization and generation capabilities of the large language model, this information is organized into a cue word structure, thereby providing clear direction and contextual support for the model generation task. A cue word could be: "Generate a bouncing ball model. The ball has a radius of 0.1m, an initial height of 1m, and an initial velocity of 0m / s. Under the influence of gravity, the ball moves in free fall and bounces upwards upon hitting the ground. The coefficient of restitution during the collision is 0.1."

[0059] S42: Input the generated prompt words back into the large language model, and use the large language model's generation capabilities to output a Modelica model that matches the original model's function and structure based on the prompt words.

[0060] Specifically, common large language models include the GPT series, BERT, and T5. These models, through pre-training and learning from large-scale data, possess powerful natural language understanding and generation capabilities. When combined with Modelica, these models can automatically generate model code that conforms to Modelica syntax and design specifications based on prompt words, thereby improving the efficiency and accuracy of the system's modeling. An example of a Modelica model generated using GPT-4o with S41 prompt words is shown below:

[0061] model BouncingBall

[0062] / / Parameters

[0063] parameter Real radius = 0.1 "Radius of the ball";

[0064] parameter Real g = 9.81 "Acceleration due to gravity";

[0065] parameter Real e = 0.1 "Coefficient of restitution";

[0066] / / Initial conditions

[0067] parameter Real h0 = 1.0 "Initial height";

[0068] parameter Real v0 = 0.0 "Initial velocity";

[0069] / / State variables

[0070] Real h(start=h0) "Height of the ball";

[0071] Real v(start=v0) "Velocity of the ball";

[0072] / / Equations

[0073] equation

[0074] / / Free fall equation

[0075] der(h) = v;

[0076] der(v) = -g;

[0077] / / Event when the ball hits the ground

[0078] when h <= radius then

[0079] reinit(v, -e * v);

[0080] reinit(h, radius);

[0081] end when.

[0082] end BouncingBall;

[0083] Figure 2 This is a flowchart illustrating the construction of the original dataset for the Modelica model, according to an exemplary embodiment. The initial Moldeica model library undergoes the aforementioned data extraction, data cleaning, data labeling, data filtering, prompt word generation, and data transformation to ultimately obtain the original Modelica model dataset.

[0084] S5: Compile and simulate the generated Modelica model, and construct an execution feedback dataset. Then, remove the data corresponding to the Modelica model contained in the execution feedback dataset from the original dataset to obtain the model dataset, and thus the Modelica dataset. The Modelica dataset consists of the model dataset and the execution feedback dataset. This step may include the following sub-steps:

[0085] S51: Compile and simulate the generated Modelica model. If the generated model fails the model compilation or simulation test, extract the error information during the compilation or simulation execution process, associate the error information with the corresponding error model sample, and organize it into an execution feedback dataset.

[0086] Specifically, the generated Modelica model is tested by running the Modelica compilation and simulation tool, recording all error information that occurs during the simulation, including compilation errors and runtime errors. These error messages are then merged and stored with the corresponding generated model to create a feedback dataset containing all execution failure records. This allows for problem analysis and improvement of the model generation process in subsequent iterations. The execution feedback dataset has a format like the following: "{"instruction": "", "output": "", "source": "", "history": ""}", where the "history" field contains the input and output of the previous large language model and error information from the output model during simulation execution.

[0087] S52: Remove the model samples involved in the execution feedback dataset from the original dataset to obtain the model dataset. The final Modelica dataset consists of two parts: the model dataset that has passed simulation verification, and the execution feedback dataset that has not passed verification but whose execution feedback information has been merged.

[0088] Figure 3 This is a flowchart illustrating the construction of a Modelica model execution feedback dataset according to an exemplary embodiment. First, the original dataset is input into a large language model to generate corresponding prompt words and model text. Next, the generated model text is input into the Modelica compilation and simulation environment for compilation and simulation verification. If the model fails verification, the Modelica compiler outputs corresponding execution error information. Subsequently, these execution error messages are combined with the corresponding erroneous models and merged into the original model data, ultimately forming an execution feedback dataset.

[0089] As described in the above embodiments, this application implements a method for constructing a Modelica model dataset based on execution feedback through a large language model and execution feedback. This method first processes the component models in the Modelica model library to construct an original dataset, then generates an execution feedback dataset through execution feedback, and finally merges the two. Specifically, it optimizes the model data through preprocessing steps such as data cleaning, data labeling, and data filtering. Simultaneously, it leverages the interaction and execution feedback mechanism of the large language model to further improve the quality of the dataset, ultimately generating a complete and optimized Modelica model dataset. The high-quality dataset constructed by this method provides a solid foundation for engineering applications, system modeling, and simulation, significantly improving the effectiveness and reliability of data in modeling and simulation.

[0090] Corresponding to the aforementioned embodiments of the Modelica model dataset construction method based on execution feedback, this application also provides embodiments of the Modelica model dataset construction apparatus based on execution feedback.

[0091] Figure 4 This is a block diagram illustrating a Modelica model dataset construction apparatus based on execution feedback, according to an exemplary embodiment. (Refer to...) Figure 4 The device includes:

[0092] Initial dataset construction module 1 is used to collect the Modelica model library and extract valid model samples from it as the initial dataset;

[0093] The data cleaning and labeling module 2 is used to clean the data in the initial dataset and then label the cleaned initial dataset.

[0094] Data filtering module 3 is used to filter data based on the characteristics of each data point in the initial dataset after data labeling, removing models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that do not have executable modeling semantics.

[0095] Model generation module 4 is used to generate prompt words for the Modelica model based on the Modelica model and its annotation in the filtered initial dataset, convert the prompt words and model data format to form the original dataset, and then use the prompt words as input to the large language model to generate the corresponding Modelica model.

[0096] The final dataset construction module 5 is used to compile and simulate the generated Modelica model and construct the execution feedback dataset. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, and thus the Modelica dataset is obtained. The Modelica dataset consists of the model dataset and the execution feedback dataset.

[0097] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0098] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0099] Accordingly, this application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the Modelica model dataset construction method based on execution feedback as described above.

[0100] Accordingly, this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the Modelica model dataset construction method based on execution feedback as described above.

[0101] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0102] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for constructing a Modelica model dataset based on execution feedback, characterized in that, include: Collect the Modelica model library and extract valid model samples from it as the initial dataset; The data in the initial dataset is cleaned, and then the cleaned initial dataset is labeled. For the initial dataset after data labeling, data filtering is performed based on the characteristics of each data point to remove models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that do not have executable modeling semantics. Based on the Modelica model and its annotations in the filtered initial dataset, prompt words for the Modelica model are generated. The prompt words and the model are converted into data formats to form the original dataset. Then, the prompt words are used as input to the large language model to generate the corresponding Modelica model. The generated Modelica model is compiled and simulated, and an execution feedback dataset is constructed. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, and thus the Modelica dataset is obtained. The Modelica dataset consists of the model dataset and the execution feedback dataset.

2. The method according to claim 1, characterized in that, Collect the Modelica model library and extract valid model samples from it as the initial dataset, including: Collect a diverse Modelica model library; By traversing the .mo files in the Modelica open-source library, relevant models are extracted from the Modelica model library to form a structured initial dataset.

3. The method according to claim 1, characterized in that, The data in the initial dataset is cleaned, and then the cleaned initial dataset is labeled, including: Regular expressions are used to clean the identified model content, removing non-encoded characters, redundant spaces and newlines from the model text, and also removing comments to make the model structure clearer; The Modelica version information, model description, related documents, and source information reflecting the model's organization and hierarchy are labeled into each corresponding Modelica model data, forming data in a standard format.

4. The method according to claim 1, characterized in that, For the initial dataset after data labeling, data filtering is performed based on the characteristics of each data point. Models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that lack executable modeling semantics are removed, including: First, models in the labeled dataset that lack both model descriptions and documentation are removed to ensure that each model in the dataset has a clear description of its function and purpose. Then set a reasonable threshold for the number of characters or lines, and eliminate models whose length exceeds the set limit; Finally, auxiliary modules or document samples that do not possess executable modeling semantics are removed from the Modelica model.

5. The method according to claim 1, characterized in that, Generate prompt words for the Modelica model, and then use these prompt words as input to a large language model to generate the corresponding Modelica model, including: Using a large language model, prompt words are created in batches on the model data in the dataset. These prompt words include the model's functions, key features, parameters, behavioral descriptions, and relevant contextual information, so as to provide sufficient guidance for the large language model and help it generate high-quality Modelica models. The generated prompt words are then input into the large language model. Leveraging the large language model's generation capabilities, a Modelica model that matches the original model's functionality and structure is output based on the prompt words.

6. The method according to claim 1, characterized in that, The generated Modelica model is compiled and simulated for testing, and an execution feedback dataset is constructed. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, which includes: The generated Modelica model is compiled and simulated. If the generated model fails the model compilation or simulation test, the error information in the compilation or simulation execution process is extracted, and the error information is associated with the corresponding error model sample to form an execution feedback dataset. The model dataset is obtained by removing the model samples involved in the execution feedback dataset from the original dataset.

7. A Modelica model dataset construction device based on execution feedback, characterized in that, include: The initial dataset building module is used to collect the Modelica model library and extract valid model samples from it as the initial dataset; The data cleaning and labeling module is used to clean the data in the initial dataset and then label the cleaned initial dataset. The data filtering module is used to filter data based on the characteristics of each data point in the initial dataset after data labeling, removing models without text descriptions, models exceeding a set length threshold, and auxiliary modules or document samples from the Modelica model library that do not have executable modeling semantics. The model generation module is used to generate prompt words for the Modelica model based on the Modelica model and its annotation in the filtered initial dataset, convert the prompt words and the model into a data format to form the original dataset, and then use the prompt words as input to the large language model to generate the corresponding Modelica model. The final dataset construction module is used to compile and simulate the generated Modelica model and build an execution feedback dataset. Then, the data corresponding to the Modelica model contained in the execution feedback dataset is removed from the original dataset to obtain the model dataset, and thus the Modelica dataset is obtained. The Modelica dataset consists of the model dataset and the execution feedback dataset.

8. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-6.