Simulink modeling method and device based on large model, equipment and medium

By acquiring and combining key information and fragments of Simulink modeling, and generating complete modeling instructions, the problem of time-consuming and flexible existing Simulink modeling technology is solved, and the ability to efficiently model and quickly respond to changes in demand is achieved.

CN119692184APending Publication Date: 2025-03-25VOYAH AUTOMOBILE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411760109.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing Simulink modeling technology is time-consuming and difficult to respond quickly to demand changes, reducing system flexibility.

Method used

By obtaining modeling key information, inputting preset construction models to generate multiple modeling fragments, combining these fragments to form a complete modeling instruction, and performing modeling operations based on the instruction.

Benefits of technology

The automated construction of Simulink models is realized, which improves modeling efficiency and model development speed, and enhances the flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692184A_ABST
    Figure CN119692184A_ABST
Patent Text Reader

Abstract

The invention discloses a simulink modeling method and device based on a large model, equipment and a medium, and relates to the technical field of modeling simulation, and the method comprises the steps: obtaining modeling key information, inputting the modeling key information into a preset construction model to obtain a plurality of modeling segments, combining the plurality of modeling segments to obtain a modeling complete instruction, and based on the modeling complete instruction, carrying out modeling on the modeling complete instruction to obtain a modeling complete instruction; and executing modeling operation. According to the method, automatic construction of the Simulink model is realized by analyzing the user demand and automatically generating the function module and the connection instruction, so that the modeling efficiency is improved, and the model development speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of modeling and simulation, and in particular to a simulink modeling method, device, equipment and medium based on a large model. Background Art

[0002] With the rapid development of industrial automation and control systems, Simulink, as a graphical programming environment based on MATLAB, has been widely used in multi-domain simulation and model design. It allows engineers and researchers to build, test and deploy models of complex systems in a graphical way.

[0003] Currently, Simulink modeling mainly relies on manual operations by users. Users need to manually add modules, set parameters, and connect modules through the graphical user interface (GUI) according to system requirements. This process requires users to have a deep understanding of Simulink's module library and be able to accurately understand system requirements to convert them into Simulink models.

[0004] Although the existing Simulink modeling technology has made some progress, it still has obvious shortcomings. First, the entire modeling process is very time-consuming, especially when dealing with large or complex systems, because it is necessary to manually select modules, set parameters and connect various modules. Secondly, when the requirements change, the model needs to be readjusted. The manual modeling method is difficult to respond quickly to the changes in requirements, which reduces the flexibility of the system. Therefore, a more efficient Simulink modeling method is urgently needed. Summary of the invention

[0005] The main purpose of this application is to provide a Simulink modeling method, device, equipment and medium based on a large model, aiming to solve the technical problem of how to improve the efficiency of Simulink modeling.

[0006] To achieve the above objectives, the present application proposes a Simulink modeling method based on a large model, the method comprising:

[0007] Obtain key information for modeling;

[0008] Input the key modeling information into a preset construction model to obtain multiple modeling fragments;

[0009] Combining a plurality of the modeling fragments to obtain a complete modeling instruction;

[0010] Based on the modeling complete instruction, a modeling operation is performed.

[0011] In one embodiment, the step of inputting the key modeling information into a preset construction model to obtain a plurality of modeling fragments includes:

[0012] According to the key modeling information, a requirement description and prompt words are obtained;

[0013] The requirement description and the prompt words are input into a preset large model for deduction to generate a plurality of modeling fragments, wherein the modeling fragments represent a single construction step in a Simulink model.

[0014] In one embodiment, the step of obtaining a requirement description and a prompt word according to the modeling key information includes:

[0015] Obtaining user information, including industry background, professional field knowledge and design requirements;

[0016] Analyze the user information to obtain user needs and preferences;

[0017] Generate a demand description and prompt words according to the user demand and the preference.

[0018] In one embodiment, the step of combining the plurality of modeling fragments to obtain a complete modeling instruction includes:

[0019] Performing detection and error correction on the plurality of modeling segments to obtain a plurality of correct modeling segments;

[0020] Identifying the plurality of correct modeling fragments by applying the first script to obtain a plurality of modeling fragments to be combined;

[0021] A plurality of the to-be-combined modeling fragments are combined by applying a second script to obtain a complete modeling instruction.

[0022] In one embodiment, the step of combining the plurality of modeling fragments to be combined by applying the second script to obtain a complete modeling instruction includes:

[0023] By applying a second script to parse the plurality of modeling fragments to be combined, the semantics and structures corresponding to the modeling fragments to be combined are obtained;

[0024] The semantics and the structure are sorted and combined to obtain a complete modeling instruction.

[0025] In one embodiment, after the step of combining the plurality of modeling fragments to be combined by applying the second script to obtain a complete modeling instruction, the step further includes:

[0026] The complete modeling instruction is judged to obtain a judgment result;

[0027] When the judgment result is that the complete modeling instruction meets the preset requirements of Simulink modeling, output the complete modeling instruction to Simulink software;

[0028] When the judgment result is that the complete modeling instruction does not meet the Simulink modeling preset requirement, the complete modeling instruction is reassembled until the Simulink modeling preset requirement is met.

[0029] In one embodiment, before the step of inputting the key modeling information into a preset construction model to obtain a plurality of modeling fragments, the step includes:

[0030] According to the modeling key sample information, a question-answer pair data set is obtained, wherein the questions in the question-answer pair data set represent modeling requirements, and the answers in the question-answer pair data set represent corresponding standard Simulink modeling instructions;

[0031] The data set is trained and fine-tuned based on the question and answer to obtain a preset construction model.

[0032] In addition, to achieve the above purpose, the present application also proposes a simulink modeling device based on a large model, and the simulink modeling device based on a large model includes:

[0033] Acquisition module, used to obtain key modeling information;

[0034] A calculation module, used for inputting the key modeling information into a preset construction model to obtain a plurality of modeling fragments;

[0035] The combination module is also used to combine a plurality of the modeling fragments to obtain a complete modeling instruction;

[0036] An execution module is used to execute a modeling operation based on the complete modeling instruction.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a medium, which is a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the Simulink modeling method based on a large model as described above are implemented.

[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the Simulink modeling method based on the large model as described above.

[0039] This application obtains key modeling information, inputs the key modeling information into the preset construction model, obtains multiple modeling fragments, combines the multiple modeling fragments, obtains complete modeling instructions, and executes modeling operations based on the complete modeling instructions. By analyzing user needs, automatically generating functional modules and connection instructions, the automated construction of Simulink models is realized, which improves modeling efficiency and speeds up model development. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 This is a flow chart of the first embodiment of the simulink modeling method based on a large model of the present application;

[0042] Figure 2 This is a flow chart of the second embodiment of the simulink modeling method based on a large model of the present application;

[0043] Figure 3 This is a flow chart of the third embodiment of the Simulink modeling method based on a large model of the present application;

[0044] Figure 4 This is a schematic diagram of the module structure of a simulink modeling device based on a large model in an embodiment of the present application;

[0045] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the Simulink modeling method based on the large model in the embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] The main solution of the embodiment of the present application is: obtain key modeling information, input the key modeling information into the preset construction model, obtain multiple modeling fragments, combine the multiple modeling fragments to obtain complete modeling instructions, and execute modeling operations based on the complete modeling instructions.

[0050] Based on this, the embodiment of the present application provides a simulink modeling method based on a large model, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the Simulink modeling method based on a large model of the present application.

[0051] In this embodiment, the simulink modeling method based on the large model includes steps S10 to S40:

[0052] Step S10, obtaining key modeling information.

[0053] It should be noted that through the demand description provided by the user, natural language processing technology is used to extract key information for modeling, including but not limited to input and output definitions, module types, parameter settings, etc. These key information will be further processed and converted into data that can guide the large model to generate specific modeling instructions, such as module addition commands, parameter configuration commands, and module connection commands.

[0054] Step S20, inputting the preset model into the preset model according to the key modeling information to obtain multiple modeling fragments.

[0055] It should be noted that the key information extracted from the user's demand description must first be converted into a format that the large model can understand and process. This key information includes the input and output definitions of the model, the types of modules required, the connection relationships between modules, and the parameter configuration of specific modules. The converted information is passed as input to the pre-trained large model. Based on these input information and the internally stored modeling knowledge and rules, the large model generates a series of preliminary modeling instructions. These instructions may include operations such as adding modules, setting parameters, and establishing connections. The generated preliminary modeling instructions will be further processed by the system and split into multiple small modeling fragments. Each fragment represents a step or part of the function in the model building process, such as adding an input port, configuring the parameter value of a module, or establishing a data flow connection between two modules. In order to ensure the accuracy and efficiency of modeling, the system will intelligently sort and optimize these modeling fragments to ensure that they can be combined in the correct logical order to obtain complete modeling instructions.

[0056] Furthermore, before step S20, it also includes: obtaining a question-answer pair dataset based on the key sample information for modeling, wherein the questions in the question-answer pair dataset represent the modeling requirements, and the answers in the question-answer pair dataset represent the corresponding standard Simulink modeling instructions, and training and fine-tuning are performed based on the question-answer pair dataset to obtain a preset construction model. The process of obtaining the question-answer pair dataset based on the key sample information for modeling involves extracting typical demand scenarios and their corresponding Simulink modeling instructions from existing successful modeling cases, and these sample information constitute the basis of the question-answer pair dataset, wherein the question part describes the specific modeling requirements, such as "how to select different output paths when the input data meets specific conditions", and the answer part provides standard Simulink modeling instructions to implement the requirements, such as "slcmd:AddBlock,Switch,SWITCH; slcmd:CfgBlock,SWITCH,Threshold,5; slcmd:AddLine,InputPort,1,SWITCH,1; slcmd:AddLine,SWITCH,1,OutputPortA,1; slcmd:AddLi ne,SWITCH,2,OutputPortB,1", the question-answer pair dataset constructed in this way not only covers a wide range of modeling scenarios, but also ensures that there is a clear one-to-one correspondence between each pair of questions and answers. Based on such a question-answer pair dataset, the preset large model can be trained and fine-tuned. During the training process, the large model learns how to accurately convert the requirement description in natural language form into Simulink modeling instructions, and the fine-tuning further optimizes the model performance to make it more suitable for specific modeling tasks. The preset construction model obtained after training and fine-tuning can understand and parse new modeling requirements, automatically generate corresponding modeling instructions, and realize automatic conversion from requirements to models.

[0057] Step S30, combining multiple modeling fragments to obtain a complete modeling instruction.

[0058] It should be understood that this process aims to orderly integrate the modeling fragments generated by the large model and representing different parts or functional units of the model to form complete instructions that can directly drive Simulink to perform modeling tasks.

[0059] Furthermore, each modeling fragment contains specific modeling operations, such as adding modules, configuring parameters, establishing connections, etc. In order to ensure that these operations can be executed in the correct logical order, all modeling fragments are first analyzed to identify the dependencies and execution order between them. For example, some configuration parameter operations must be performed after adding modules, and the operation of establishing connections depends on the existence and correct configuration of modules. Based on this dependency, an intelligent sorting algorithm is used to sort and optimize the modeling fragments to ensure that the final generated modeling instructions are both logical and efficient. In this process, it is also necessary to deal with possible conflicts and redundancies. For example, when multiple fragments try to perform the same or contradictory configurations on the same module, sufficient intelligence is required to solve these problems and ensure the consistency and correctness of the generated modeling instructions. In addition, in order to improve the transparency and controllability of the modeling process, real-time monitoring and feedback of modeling instructions are also supported, allowing users to view progress, check errors and make necessary adjustments during the modeling process. Once the modeling instruction sequence is correctly constructed, the API interface provided by Simulink will be called or a specially written scripting language will be used to execute these instructions one by one, starting with creating a new Simulink model file, adding the required modules, setting the necessary parameters, and establishing the correct connections until the entire model is built.

[0060] Step S40, executing a modeling operation based on the complete modeling instruction.

[0061] It should be noted that the previously generated modeling instruction sequence is converted into an actual Simulink model. The modeling instruction sequence includes a series of detailed instructions from creating model files to adding modules, configuring parameters, establishing connections, etc. Each instruction accurately specifies a specific operation in the modeling process. For example, "slcmd:AddBlock,Inport,Data_input" means adding an input port module named Data_input to the model, and "slcmd:CfgBlock,Data_input,OutDataTypeStr,double" means setting the data type of the input port to a double-precision floating point number. In order to ensure that these instructions can be executed correctly, the system will first preprocess the instruction sequence to check the grammatical correctness and logical consistency, and eliminate potential errors and conflicts. After the preprocessing is completed, the system executes the modeling instructions one by one by calling the API interface provided by Simu link or using a specially written script language. After each instruction is executed, the system will check the execution result to ensure that the operation is successfully completed. For some complex modeling tasks, hundreds or thousands of instructions may need to be executed. The system displays the modeling progress in real time through streaming output, allowing users to intuitively see the model building process.

[0062] Furthermore, in order to improve the reliability and fault tolerance of modeling, multiple mapping processing of module names, parameter names and parameter values ​​in modeling instructions is implemented, allowing multiple different expressions to point to the same Simulink object, so that even if the instructions generated by large models have a certain degree of randomness, they can be correctly identified and executed. In addition, it also supports real-time monitoring and debugging during the modeling process, allowing users to pause, resume or cancel modeling operations at any time, and even roll back and redo the executed parts. This series of measures not only ensures the efficiency and accuracy of modeling operations, but also provides users with great flexibility and convenience.

[0063] This embodiment provides a Simulink modeling method based on a large model, which obtains key modeling information, inputs the key modeling information into a preset construction model, obtains multiple modeling fragments, combines the multiple modeling fragments, obtains complete modeling instructions, and executes modeling operations based on the complete modeling instructions. By analyzing user needs, automatically generating functional modules and connection instructions, the automated construction of Simulink models is realized, the modeling efficiency is improved, and the model development speed is accelerated.

[0064] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 The simulink modeling method step S20 based on the large model also includes steps S201 to S202:

[0065] Step S201, obtaining a requirement description and prompt words according to the key modeling information.

[0066] It should be noted that, first of all, it is necessary to extract the key modeling information from the user's original needs. The key modeling information includes but is not limited to input and output definitions, required module types, parameter settings, and connection logic between modules. These elements constitute the key information for modeling. Through in-depth analysis and understanding of this information, a specific requirement description can be generated. The requirement description is a formal expression of user needs. It describes in detail the functions that the model should implement, the expected behaviors, and performance indicators in the form of natural language. At the same time, based on these key modeling information, prompt words are also obtained. Prompt words are a special instruction format used to guide the large model to generate specific modeling instructions. It contains a series of predefined commands and parameters, such as "slcmd:AddBlock,BlockName,BlockID" is used to instruct the large model to add a new module, and "slcmd:CfgBlock,BlockID,ParamterName,ParamterValue" is used to configure specific parameters of the module. The prompt words designed in this way can not only cover various operational requirements in the modeling process, but also ensure that the generated modeling instructions are highly standardized and executable.

[0067] Furthermore, before step S201, it also includes: obtaining user information, the user information includes industry background, professional knowledge and design requirements, analyzing the user information, obtaining user requirements and preferences, and then generating demand descriptions and prompt words according to the user requirements and preferences. Specifically, the process of obtaining user information involves collecting information such as the user's industry background, professional knowledge and specific design requirements, and deeply understanding the user's work environment, project characteristics and technical difficulties through questionnaires, face-to-face interviews or online forms. For example, for users from the automotive industry, it is necessary to focus on vehicle dynamics simulation, control system design and other requirements, while for users engaged in the communication field, they are more concerned about signal processing, network protocol simulation and other contents. The collected user information will be comprehensively analyzed by the system, and key demand points and preferences will be extracted from it using natural language processing and data analysis technology. For example, users may want the model to have high precision, fast running speed or easy expansion. Based on these analysis results, demand descriptions and prompt words that meet user needs and preferences can be generated.

[0068] Step S202, input the requirement description and prompt words into the preset large model for derivation to generate multiple modeling fragments, where the modeling fragments represent a single construction step in the Simulink model.

[0069] It should be noted that in order to enable the big model to generate modeling fragments more accurately, a large number of question-and-answer pair data sets will be prepared for training and fine-tuning. The questions in these question-and-answer pair data sets reflect typical modeling demand scenarios, and the answers are the corresponding standard modeling instructions. The big model trained in this way can automatically convert the user's demand description into a series of specific modeling instructions after receiving it, thereby realizing the automation of the entire process from demand description to model generation.

[0070] Furthermore, modeling snippets represent a single construction step in a Simulink model, and each snippet focuses on a specific aspect or operation of model construction. For example, a modeling snippet may focus on adding a specific type of module, such as "slcmd:AddBlock,Inport,Input_1", which means adding an input port module named Input_1 to the model; another snippet may be responsible for configuring the parameters of the module, such as "slcmd:CfgBlock,Input_1,OutDataTypeStr,double", which is used to set the data type of the input port to a double-precision floating point number; and there are snippets dedicated to establishing connections between modules, such as "slcmd:AddLine,Input_1,1,Sum,1", which means establishing a connection from the first output port of the Input_1 module to the first input port of the Sum module. By subdividing the modeling process into multiple such snippets, not only can the accuracy and independence of each operation be ensured, but it is also easy to manage and optimize the model building process.

[0071] In order to improve the accuracy and robustness of modeling, the system also performs multiple mapping processing on key elements in the modeling fragments, such as allowing multiple different module names or parameter names to correspond to the same Simulink object, so that even if the instructions generated by the large model have a certain degree of randomness or ambiguity, they can be correctly identified and executed.

[0072] This embodiment obtains the requirement description and prompt words according to the key modeling information, inputs the requirement description and prompt words into the preset large model for derivation, and generates multiple modeling fragments. Based on the key modeling information, the requirement description and prompt words are generated, and the large model is input to derive the modeling fragments, and the automated modeling process improves efficiency and enhances flexibility.

[0073] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 3 The simulink modeling method step S30 based on the large model also includes steps S301 to S303:

[0074] Step S301 , detecting and correcting errors of multiple modeling segments to obtain multiple correct modeling segments.

[0075] It should be noted that first, a comprehensive syntax and logic check is required for the modeling fragments generated by the large model to ensure that the command format in each fragment is correct, the parameter values ​​are reasonable, and there are no logical contradictions or conflicts. For example, check whether the module name is legal, whether the parameter value meets the requirements of Simulink, whether the connection relationship is reasonable, etc. Then, a series of predefined rules and pattern matching algorithms will be used to automatically identify potential errors. Detected problems will be automatically corrected, such as repairing illegal module names, adjusting unreasonable parameter values, or re-establishing the correct connection relationship. In addition to automatic correction, the system also supports manual intervention, allowing users to view the specific content of each modeling fragment during the detection process and manually correct possible omissions or misjudgments of the large model.

[0076] Step S302: Identify multiple correct modeling segments by applying the first script to obtain multiple modeling segments to be combined.

[0077] It should be noted that the first script is first used to conduct an in-depth analysis of the modeling fragments that have been detected and corrected to identify the functions and roles of each fragment, for example, which fragments are responsible for adding modules, which are responsible for configuring parameters, and which are responsible for establishing connections. The first script also checks the dependencies between fragments to ensure that all fragments can be combined in the correct order. For example, the fragment that adds modules must be executed before the fragment that configures parameters or establishes connections. In addition, the first script also classifies and marks the modeling fragments to facilitate subsequent combination operations. For example, all the fragments that add modules are classified into one category, and the fragments that configure parameters are classified into another category, so that the modeling fragments can be more conveniently managed and organized.

[0078] In order to improve the accuracy and efficiency of recognition, the first script uses a variety of technical means, such as regular expression matching, keyword recognition and pattern matching, which can help the script quickly identify key information in the modeling fragment, such as module name, parameter name and connection relationship. At the same time, the first script will also perform syntax and logic verification on the modeling fragment to ensure that each fragment can be executed correctly to avoid combination failure due to problems with the fragment itself. During the recognition process, the first script will also record the metadata information of each modeling fragment, such as fragment type, dependency and execution order, etc. This information will be used for subsequent fragment combination operations.

[0079] Step S303, combining multiple modeling fragments to be combined by applying the second script to obtain a complete modeling instruction.

[0080] It should be noted that the second script first reads the modeling fragments generated by the first script and their metadata information, including fragment types, dependencies, and execution order, and then sorts and combines the modeling fragments based on this information to ensure that each fragment is executed at the appropriate time point to obtain a complete modeling instruction. For example, the fragment for adding a module must be executed before the fragment for configuring parameters or establishing a connection, and the fragment for configuring parameters needs to be executed before the fragment for establishing a connection.

[0081] Furthermore, step S303 also includes: applying the second script to parse multiple modeling fragments to be combined, and obtaining the semantics and structures corresponding to the modeling fragments to be combined. Specifically, the second script first reads the modeling fragments generated by the first script and their metadata information, including the fragment type, dependency relationship and execution order, etc., and then deeply parses each modeling fragment to extract its semantic information and structural features. For example, for a fragment such as "slcmd:AddBlock,Inport,Input_1", the script will recognize that this is a command to add an input port module, the module name is Inport, and the unique identifier is Input_1. Similarly, for a fragment such as "slcmd:CfgBlock,Input_1,OutDataTypeStr,double", the script will parse that this is a command to configure module parameters, the target module is Input_1, the parameter name is OutDataTypeStr, and the parameter value is double. Through parsing, the second script builds a fragment information library to record the functions, parameters and dependencies of each fragment, which provides a solid foundation for subsequent fragment combination. In addition, the script checks the logical relationship between the fragments to ensure that the connections and dependencies between the fragments are correct, for example, confirming that all modules that require configuration parameters have been added in the previous steps.

[0082] Furthermore, the complete modeling instructions are obtained by sorting and combining based on semantics and structure. Specifically, to achieve this, the second script uses a variety of algorithms and techniques, such as topological sorting, dependency graph construction, etc. These techniques can help the script effectively manage the dependencies between modeling fragments and ensure that the generated modeling instruction sequence is logically consistent and conflict-free. During the combination process, the second script will further verify and optimize the modeling fragments, for example, check whether there are repeated fragments, redundant operations or unnecessary connections, to ensure that the generated modeling instruction sequence is concise and efficient. In addition, the second script also supports real-time monitoring and debugging of the combination process, allowing users to view progress, check intermediate results and make necessary adjustments during the combination process. For example, the user can pause the combination process, view the currently generated modeling instruction sequence, manually correct any problems found, and then continue the combination.

[0083] Furthermore, after step S303, it also includes: judging the complete modeling instruction to obtain a judgment result, and when the judgment result is that the complete modeling instruction meets the preset requirements of Simulink modeling, the above complete modeling instruction is output to the Simulink software. Specifically, the complete modeling instruction is verified through a series of predefined rules and checkpoints to ensure that the syntax of each instruction is correct, the parameter value is reasonable and the logic is consistent. For example, check whether all modules have been correctly added, whether the parameters have been correctly configured, whether the connection relationship meets the requirements of Simulink, etc. In addition, the modeling instruction is simulated and executed to observe the construction process of the model to ensure that the model can be smoothly generated and error-free. If all checks are passed, it shows that the complete modeling instruction meets the preset requirements of Simulink modeling. At this time, the complete modeling instruction is output to the Simulink software, and the Simulink execution modeling operation is directly controlled by calling the API interface of Simulink or using a scripting language. For example, the modeling instruction can be sent to Simulink using a MATLAB script, and these instructions are executed one by one, starting from creating a new model file, adding modules, configuring parameters, and establishing connections in sequence until the entire model is built.

[0084] When the judgment result is that the complete modeling instruction does not meet the preset requirements of Simulink modeling, the complete modeling instruction is recombined until the preset requirements of Simulink modeling are met. Specifically, when the judgment result is that the complete modeling instruction does not meet the preset requirements of Simulink modeling, the recombining process is started until the generated complete modeling instruction meets the requirements. First, record the problems existing in the current complete modeling instruction, such as syntax errors, improper parameter configuration, module connection errors, etc. Then, reorder and adjust the modeling fragments according to these problems to ensure that the dependencies and logical order between all fragments are correct. For example, if the parameters of a module are configured before the module is added, the system will adjust the order of the two to ensure that the module is added first and then the parameters are configured.

[0085] This embodiment detects and corrects errors in multiple modeling fragments to obtain multiple correct modeling fragments, identifies multiple correct modeling fragments by applying a first script to obtain multiple modeling fragments to be combined, and combines multiple modeling fragments to be combined by applying a second script to obtain complete modeling instructions. By detecting and correcting modeling fragments, identifying fragments to be combined, and combining to generate complete modeling instructions, modeling efficiency is improved.

[0086] This application also provides a simulink modeling device based on a large model, please refer to Figure 4 , the device comprises:

[0087] The acquisition module 10 is used to acquire key modeling information.

[0088] The calculation module 20 is used to input the preset construction model according to the key modeling information to obtain multiple modeling fragments.

[0089] The combining module 30 is further used to combine multiple modeling fragments to obtain a complete modeling instruction.

[0090] The execution module 40 is used to execute the modeling operation based on the complete modeling instruction.

[0091] The simulink modeling device based on a large model provided by the present application adopts the simulink modeling method based on a large model in the above-mentioned embodiment, and can solve the technical problem of how to improve the efficiency of Simulink modeling. Compared with the prior art, the beneficial effects of the simulink modeling device based on a large model provided by the present application are the same as the beneficial effects of the simulink modeling method based on a large model provided by the above-mentioned embodiment, and other technical features in the simulink modeling device based on a large model are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0092] In one embodiment, the calculation module 20 is also used to obtain a requirement description and prompt words based on the key modeling information; the requirement description and the prompt words are input into a preset large model for derivation to generate multiple modeling fragments, and the modeling fragments represent a single construction step in the Simulink model.

[0093] In one embodiment, the computing module 20 is also used to obtain user information, including industry background, professional field knowledge and design requirements; analyze the user information to obtain user needs and preferences; and generate demand descriptions and prompt words based on user needs and preferences.

[0094] In one embodiment, the combination module 30 is also used to detect and correct errors in multiple modeling fragments to obtain multiple correct modeling fragments; identify multiple correct modeling fragments by applying a first script to obtain multiple modeling fragments to be combined; and combine multiple modeling fragments to be combined by applying a second script to obtain complete modeling instructions.

[0095] In one embodiment, the combination module 30 is further used to parse multiple modeling fragments to be combined by applying a second script to obtain semantics and structures corresponding to the modeling fragments to be combined; and to sort and combine based on the semantics and the structure to obtain complete modeling instructions.

[0096] In one embodiment, the combination module 30 is also used to judge the complete modeling instruction and obtain a judgment result; when the judgment result is that the complete modeling instruction meets the Simulink modeling preset requirements, the complete modeling instruction is output to the Simulink software; when the judgment result is that the complete modeling instruction does not meet the Simulink modeling preset requirements, the complete modeling instruction is recombined until the Simulink modeling preset requirements are met.

[0097] In one embodiment, the computing module 20 is also used to obtain a question-and-answer pair data set based on key modeling sample information, wherein the questions in the question-and-answer pair data set represent modeling requirements, and the answers in the question-and-answer pair data set represent corresponding standard Simulink modeling instructions; training and fine-tuning are performed based on the question-and-answer pair data set to obtain a preset construction model.

[0098] The present application provides a Simulink modeling device based on a large model, and the Simulink modeling device based on a large model includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the Simulink modeling method based on the large model in the above-mentioned embodiment one.

[0099] Reference below Figure 5 , which shows a schematic diagram of the structure of a simulink modeling device based on a large model suitable for implementing the embodiment of the present application. The simulink modeling device based on a large model in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The large-model-based Simulink modeling device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.

[0100] like Figure 5As shown, the simulink modeling device based on the large model may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the simulink modeling device based on the large model are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the large-model-based simulink modeling device to communicate wirelessly or wired with other devices to exchange data. Although the large-model-based simulink modeling device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0101] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0102] The simulink modeling device based on a large model provided by the present application adopts the simulink modeling method based on a large model in the above-mentioned embodiment, which can solve the technical problem of how to improve the efficiency of Simulink modeling. Compared with the prior art, the beneficial effects of the simulink modeling device based on a large model provided by the present application are the same as the beneficial effects of the simulink modeling method based on a large model provided by the above-mentioned embodiment, and other technical features in the simulink modeling device based on a large model are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0103] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0104] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0105] The present application provides a computer-readable medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the large model-based Simulink modeling method in the above-mentioned embodiment.

[0106] The computer-readable medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0107] The computer-readable medium may be included in a Simulink modeling device based on a large model; or may exist independently without being assembled into the Simulink modeling device based on a large model.

[0108] The computer-readable medium carries one or more programs. When the one or more programs are executed by the large-model-based Simulink modeling device, the large-model-based Simulink modeling device can be written in one or more programming languages ​​or a combination thereof to write computer program codes for performing the operations of the present application. The programming languages ​​include object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0111] The readable medium provided by the present application is a computer-readable medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned Simulink modeling method based on a large model, and can solve the technical problem of how to improve the efficiency of Simulink modeling. Compared with the prior art, the beneficial effects of the computer-readable medium provided by the present application are the same as the beneficial effects of the Simulink modeling method based on a large model provided by the above-mentioned embodiment, and will not be repeated here.

[0112] The present application also provides a computer program product, including a computer program, which implements the steps of the Simulink modeling method based on a large model as described above when executed by a processor.

[0113] The computer program product provided by the present application can solve the technical problem of how to improve the efficiency of Simulink modeling. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the Simulink modeling method based on the large model provided by the above embodiment, which will not be repeated here.

[0114] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A simulink modeling method based on a large model, characterized in that: The method comprises: Obtain key information for modeling; Input the key modeling information into a preset construction model to obtain multiple modeling fragments; Combining a plurality of the modeling fragments to obtain a complete modeling instruction; Based on the modeling complete instruction, a modeling operation is performed.

2. The method according to claim 1, characterized in that The step of inputting the key modeling information into a preset construction model to obtain a plurality of modeling fragments includes: According to the key modeling information, a requirement description and prompt words are obtained; The requirement description and the prompt words are input into a preset large model for deduction to generate a plurality of modeling fragments, wherein the modeling fragments represent a single construction step in a Simulink model.

3. The method according to claim 2, characterized in that The step of obtaining the requirement description and prompt words according to the modeling key information includes: Obtaining user information, including industry background, professional field knowledge and design requirements; Analyze the user information to obtain user needs and preferences; Generate a demand description and prompt words according to the user demand and the preference.

4. The method according to claim 1, characterized in that The step of combining the plurality of modeling fragments to obtain a complete modeling instruction comprises: Performing detection and error correction on the plurality of modeling segments to obtain a plurality of correct modeling segments; Identifying the plurality of correct modeling fragments by applying the first script to obtain a plurality of modeling fragments to be combined; A plurality of the to-be-combined modeling fragments are combined by applying a second script to obtain a complete modeling instruction.

5. The method according to claim 4, characterized in that The step of combining the plurality of modeling fragments to be combined by applying the second script to obtain a complete modeling instruction comprises: By applying a second script to parse the plurality of modeling fragments to be combined, the semantics and structures corresponding to the modeling fragments to be combined are obtained; The semantics and the structure are sorted and combined to obtain a complete modeling instruction.

6. The method according to claim 4, characterized in that After the step of combining the plurality of modeling fragments to be combined by applying the second script to obtain a complete modeling instruction, the method further includes: The complete modeling instruction is judged to obtain a judgment result; When the judgment result is that the complete modeling instruction meets the preset requirements of Simulink modeling, output the complete modeling instruction to Simulink software; When the judgment result is that the complete modeling instruction does not meet the Simulink modeling preset requirement, the complete modeling instruction is reassembled until the Simulink modeling preset requirement is met.

7. The method according to claim 1, characterized in that Before the step of inputting the key modeling information into the preset construction model to obtain a plurality of modeling fragments, the method includes: According to the modeling key sample information, a question-answer pair data set is obtained, wherein the questions in the question-answer pair data set represent modeling requirements, and the answers in the question-answer pair data set represent corresponding standard Simulink modeling instructions; The data set is trained and fine-tuned based on the question and answer to obtain a preset construction model.

8. A simulink modeling device based on a large model, characterized in that: The device comprises: Acquisition module, used to obtain key information for modeling; A calculation module, used for inputting the key modeling information into a preset construction model to obtain a plurality of modeling fragments; The combination module is also used to combine a plurality of the modeling fragments to obtain a complete modeling instruction; An execution module is used to execute a modeling operation based on the complete modeling instruction.

9. A simulink modeling device based on a large model, characterized in that: The device includes: a memory, a processor, and a large model-based Simulink modeling program stored in the memory and executable on the processor, wherein the large model-based Simulink modeling program is configured to implement the steps of the large model-based Simulink modeling method as described in any one of claims 1 to 7.

10. A medium, characterized in that The medium stores a large-model-based Simulink modeling program, which, when executed by a processor, implements the steps of the large-model-based Simulink modeling method as described in any one of claims 1 to 7.