A method and device for optimizing simulation model
By obtaining test data and setting command line parameters, the simulation model is automatically optimized, which solves the problem of cumbersome manual operations in the existing technology, and achieves rapid and automated simulation model optimization.
Patent Information
- Application Number
- CN202410715329.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-06-04
AI Technical Summary
In the prior art, when automated testing tools execute different parameters, they need manual operations to adjust and optimize the simulation model, resulting in cumbersome, time-consuming and highly repetitive processes.
By obtaining the test data corresponding to the test results that fail, set command line parameters, including simulation time, simulation step, simulation model path and test data path, and use these parameters to automatically obtain and configure the simulation model to achieve optimization.
The simulation model is automatically, simple and fast optimization, which reduces manual operation steps, saves time, and avoids manual operation errors.
Smart Images

Figure CN118484396B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for optimizing a simulation model. Background Art
[0002] With the development of automated testing technology, users can configure test cases, working conditions and other information to automatically test simulation models and generate reports. In the face of the need for batch simulation testing of multiple working conditions, it is more convenient for users to set parameter combinations according to business needs and conduct sequential testing with one click.
[0003] In the prior art, the automated testing tool executes different parameters each time, and determines whether the test passes based on the test results and the use case configuration. If the test fails, the user needs to adjust and optimize the simulation model through the simulation tool according to the parameters to eliminate the model errors. The process requires manual operation, which is cumbersome, time-consuming, and highly repetitive. Therefore, there is a need for a method that can automatically, simply, and quickly optimize the simulation model so that the next round of testing can be quickly carried out. Summary of the invention
[0004] Based on the above problems, the present application provides a method and device for optimizing a simulation model, which can automatically, simply and quickly complete the optimization of the simulation model so as to quickly carry out the next round of testing.
[0005] The present application discloses a method for optimizing a simulation model, the method comprising:
[0006] Based on the test of the simulation model, the test data corresponding to the failed test results are obtained;
[0007] Setting command line parameters according to the test data; the command line parameters include simulation duration, simulation step length, the path of the simulation model and the path of the test data;
[0008] The simulation model is acquired according to the command line parameters, and the command line parameters are configured to optimize the simulation model.
[0009] Optionally, setting command line parameters according to the test data includes:
[0010] The test tool sets command line parameters according to the working conditions corresponding to the test cases in the test data.
[0011] Optionally, acquiring the simulation model according to the command line parameters and configuring the command line parameters includes:
[0012] The simulation tool obtains the simulation model according to the path of the simulation model, and sets the simulation duration and the simulation step for the simulation model;
[0013] The simulation tool obtains parameter information of the test data according to the path of the test data, and assigns the parameter information to the simulation model.
[0014] Optionally, acquiring the simulation model according to the command line parameters and configuring the command line parameters includes:
[0015] The simulation tool is started in response to the instruction of the test tool, and the project where the simulation model is located is opened according to the path of the simulation model;
[0016] The simulation tool sets the simulation duration and the simulation step size for the project;
[0017] The simulation tool loads the test data and parameter information of the test data according to the path of the test data;
[0018] The simulation tool configures the parameter information to the corresponding modules in the simulation model and loads the test data into the memory.
[0019] Optionally, before the simulation tool starts in response to the instruction of the test tool, the method further includes:
[0020] The simulation tool debugging mode in the test tool is turned on, so that after the test tool sets the command line parameter, the instruction is sent to the simulation tool through the simulation tool debugging mode.
[0021] Based on the above-mentioned method for optimizing a simulation model, the present application also discloses a device for optimizing a simulation model, including: a test data acquisition unit, a parameter setting unit and a command line parameter configuration unit;
[0022] The test data acquisition unit is used to acquire test data corresponding to failed test results based on the test of the simulation model;
[0023] The parameter setting unit is used to set command line parameters according to the test data; the command line parameters include simulation duration, simulation step length, the path of the simulation model and the path of the test data;
[0024] The command line parameter configuration unit is used to obtain the simulation model according to the command line parameters, and configure the command line parameters to optimize the simulation model.
[0025] Optionally, the parameter setting unit includes:
[0026] The command line parameter setting subunit is used for the test tool to set the command line parameters according to the working conditions corresponding to the test cases in the test data.
[0027] Optionally, the command line parameter configuration unit includes:
[0028] A simulation model acquisition subunit, used for a simulation tool to acquire the simulation model according to the path of the simulation model, and to set the simulation duration and the simulation step length for the simulation model;
[0029] The parameter assignment subunit is used for the simulation tool to obtain the parameter information of the test data according to the path of the test data, and assign the parameter information to the simulation model.
[0030] Optionally, the command line parameter configuration unit includes:
[0031] A starter unit, used for the simulation tool to start in response to the instruction of the test tool, and to open the project where the simulation model is located according to the path of the simulation model;
[0032] A duration setting subunit is used for the simulation tool to set the simulation duration and the simulation step length for the project;
[0033] A loading subunit, used for a simulation tool to load the test data and parameter information of the test data according to the path of the test data;
[0034] The parameter information setting subunit is used for the simulation tool to configure the parameter information to the corresponding modules in the simulation model and load the test data into the memory.
[0035] Optionally, the device further comprises:
[0036] The debugging mode enabling unit is used to enable the debugging mode of the simulation tool in the test tool, so as to send the instruction to the simulation tool through the debugging mode of the simulation tool after the test tool sets the command line parameter.
[0037] The present application discloses a method and device for optimizing a simulation model. Based on the test of the simulation model, the test data corresponding to the failed test results are obtained. The command line parameters are set according to the test data, including the simulation duration, the simulation step length, the path of the simulation model and the path of the test data. Then, according to the command line parameters, the simulation model is obtained, and the command line parameters are configured to optimize the simulation model. There is no need to manually input the test data into the simulation model, but through the form of command line parameters, it is convenient for users to quickly and automatically reflect the test data on the simulation model with one click. While reducing cumbersome operating steps and saving time, it also avoids mistakes in manual operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] 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, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0039] Figure 1a A schematic diagram of a flow chart of a simulation model optimization method disclosed in an embodiment of the present application;
[0040] Figure 1b This is a schematic diagram of the test results disclosed in the embodiments of the present application;
[0041] Figure 1c A schematic diagram of a simulation model disclosed in an embodiment of the present application;
[0042] Figure 2 A schematic flow chart of another simulation model optimization method disclosed in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of the structure of a simulation model optimization device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] Embodiment 1: This application discloses a method for optimizing a simulation model.
[0046] For details, please refer to Figure 1a , a simulation model optimization method disclosed in this embodiment includes the following steps:
[0047] Step 101: Based on the test of the simulation model, the test data corresponding to the failed test results are obtained.
[0048] GCKontro l system design and simulation software is a graphical modeling and simulation tool that can realize system design and simulation. TestManager is an automated testing tool that can configure test cases, working conditions and other information to automatically run the simulation model established in GCK and generate reports. The method described in this embodiment can be applied between these two tools.
[0049] In the method described in this embodiment, it is first necessary to turn on the simulation tool debugging mode switch in the test tool, so that after the test tool sets the command line parameters, instructions are sent to the tool through the simulation tool debugging mode. As an optional method, the test tool can be TestManager, and the simulation tool can be GCKontro l system design and simulation software.
[0050] The simulation tool debugging mode switch described in this embodiment is set on the test result page given by the test tool, and is used to turn on or off the simulation tool debugging mode according to user needs. Wherein, after the simulation tool debugging mode is turned on, the simulation engine in the test tool will return the values of all variables of the simulation model in the simulation tool so that they can be passed to the simulation tool later. Since returning too much data will lead to performance degradation, the simulation tool debugging mode is turned off by default, and the simulation engine only returns the output value of the simulation model and the variable value set in the user display configuration. Only when the simulation tool debugging mode is turned on, the user can issue an instruction to open the simulation tool in the test tool with one click.
[0051] In the method described in this embodiment, when the test tool completes the test and returns the test result (list), a piece of operating condition data that needs to be adjusted, that is, that fails, is selected.
[0052] Step 102: Setting command line parameters according to the test data.
[0053] In the method described in this embodiment, the command line parameters include simulation duration, simulation step length, simulation model path and test data path. As an optional method, the test tool sets the command line parameters according to the working conditions corresponding to the test cases in the test data.
[0054] Step 103: Acquire the simulation model according to the command line parameters, and configure the command line parameters to optimize the simulation model.
[0055] In the method described in this embodiment, the simulation tool obtains the simulation model according to the path of the simulation model, and sets the simulation duration and simulation step for the simulation model, and obtains the parameter information of the test data according to the path of the test data, and assigns the parameter information to the simulation model.
[0056] As an optional method, the specific operations in the two tools can be that the simulation tool responds to the instruction of the test tool to start, and opens the project where the simulation model is located according to the path of the simulation model. After the simulation tool sets the simulation time and simulation step for the project, it loads the test data and the parameter information of the test data according to the path of the test data, and configures the parameter information to the corresponding module in the simulation model. Finally, the test data is loaded into the memory.
[0057] Among them, clicking the start button in the failed test result in the test tool will send an instruction to the simulation tool. The simulation tool is automatically called up in response to the instruction, and the corresponding simulation model under the working condition is loaded. As an optional method, the operation after pressing the button can be to obtain the address of the simulation tool execution program and organize the set command line parameters. Start the simulation tool according to the command line parameters and record the process ID so that when the test tool is closed, the called simulation tool is also closed. After the simulation tool is started, the command line parameters are automatically parsed. First, open the specified project, that is, the simulation model, and set the simulation time and simulation step for the project. Then load the test data and parameter information (which can be in binary format), set the parameter information to the corresponding module in the project, load the test data into the memory, and set the project to the simulation end state.
[0058] As an example, Figure 1b Schematic diagram of the test results disclosed in the embodiment of this application. As an optional method, Figure 1b As shown in the figure, four working conditions of the test case named test_case1 were run, and the parameter information corresponding to each working condition is different. From working condition 1 to 4, the parameter g.ParamVa l (Earth gravity acceleration constant) is set to -9.8, -9.7, -9.6, and -9.5 respectively. The parameter information is different, and the results of other variables related to it are also different. At this time, if the test data that failed is the data corresponding to working condition 4, you can directly click the rightmost button in the test object column of the row where working condition 4 is located to send instructions to the simulation tool. The simulation tool will start automatically and open the test object bouncingBa l l.gck project, which is the simulation model.
[0059] As an example, Figure 1c Schematic diagram of the simulation model disclosed in the embodiment of this application. As an optional method, Figure 1c As shown, the simulation model is a small pinball model, that is, Figure 1b The figure shows the bouncingBa l l.gck project. After setting the simulation duration and simulation step of the project, set the parameter information to the corresponding module in the project (the part in the box). As you can see, the gravity acceleration constant g is set to -9.5. In actual work, the user may set more than a dozen parameters at a time. The user can drag the slider of the progress bar at the bottom to observe the data changes of each frame. The specific values can be observed by turning on the highlighted data label on the model variable.
[0060] The method described in this embodiment does not require the user to search for parameter information from the test tool, then open the simulation tool, and assign the parameter information to the simulation model. When faced with a large amount of data, a large number of repeated and cumbersome parameter configuration operation steps are saved, which improves work efficiency and helps users optimize simulation models more quickly and easily. At the same time, the simulation tool debugging mode switch is set to maximize performance when the model optimization function is not needed, and it is convenient for users to open the simulation tool with one click when model optimization is required, and there is no need to simulate the model again in the simulation tool, and the test data and parameter information of the test tool can be directly used for optimization. In addition, the automated setting also eliminates the time and labor costs caused by human operating errors.
[0061] Embodiment 2: This application discloses another method for optimizing a simulation model. Figure 2 , the method described in this embodiment is aimed at.
[0062] Step 201: The test tool tests the simulation model from the simulation tool and obtains a failed test result.
[0063] Step 202: The test tool sets command line parameters according to the test results and test cases.
[0064] Step 203: The test tool responds to the user's button operation and calls up the simulation tool.
[0065] Step 204: After the simulation tool is started, the simulation model is opened according to the command line parameters.
[0066] Step 205: The simulation tool configures the command line parameters in the simulation model to optimize the simulation model.
[0067] Based on the method for optimizing a simulation model disclosed in the above embodiment, this embodiment correspondingly discloses a device for optimizing a simulation model. Figure 3 , the simulation model optimization device comprises: a test data acquisition unit 301, a parameter setting unit 302 and a command line parameter configuration unit 303;
[0068] The test data acquisition unit 301 is used to acquire test data corresponding to failed test results based on the test of the simulation model;
[0069] The parameter setting unit 302 is used to set command line parameters according to the test data; the command line parameters include simulation duration, simulation step length, the path of the simulation model and the path of the test data;
[0070] The command line parameter configuration unit 303 is used to obtain the simulation model according to the command line parameters, and configure the command line parameters to optimize the simulation model.
[0071] Optionally, the parameter setting unit 302 includes:
[0072] The command line parameter setting subunit is used for the test tool to set the command line parameters according to the working conditions corresponding to the test cases in the test data.
[0073] Optionally, the command line parameter configuration unit 303 includes:
[0074] A simulation model acquisition subunit, used for a simulation tool to acquire the simulation model according to the path of the simulation model, and to set the simulation duration and the simulation step length for the simulation model;
[0075] The parameter assignment subunit is used for the simulation tool to obtain the parameter information of the test data according to the path of the test data, and assign the parameter information to the simulation model.
[0076] Optionally, the command line parameter configuration unit 303 includes:
[0077] A starter unit, used for the simulation tool to start in response to the instruction of the test tool, and to open the project where the simulation model is located according to the path of the simulation model;
[0078] A duration setting subunit is used for the simulation tool to set the simulation duration and the simulation step length for the project;
[0079] A loading subunit, used for a simulation tool to load the test data and parameter information of the test data according to the path of the test data;
[0080] The parameter information setting subunit is used for the simulation tool to configure the parameter information to the corresponding modules in the simulation model and load the test data into the memory.
[0081] Optionally, the device further comprises:
[0082] The debugging mode enabling unit is used to enable the debugging mode of the simulation tool in the test tool, so as to send the instruction to the simulation tool through the debugging mode of the simulation tool after the test tool sets the command line parameter.
[0083] The embodiments in this specification are described in a progressive manner. As for the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.
[0084] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0085] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0086] The features described in the embodiments of this specification can be replaced or combined with each other, so that professional and technical personnel in this field can implement or use the present application.
[0087] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for optimizing a simulation model, characterized in that: include: Based on the test of the simulation model, the test data corresponding to the failed test results are obtained; Setting command line parameters according to the test data; The command line parameters include simulation duration, simulation step length, the path of the simulation model and the path of the test data; According to the command line parameters, the simulation model is acquired, and the command line parameters are configured to optimize the simulation model; The acquiring the simulation model according to the command line parameters and configuring the command line parameters includes: The simulation tool is started in response to the instruction of the test tool, and the project where the simulation model is located is opened according to the path of the simulation model; The simulation tool sets the simulation duration and the simulation step size for the project; The simulation tool loads the test data and parameter information of the test data according to the path of the test data; The simulation tool configures the parameter information to the corresponding modules in the simulation model and loads the test data into the memory; Before the simulation tool starts in response to the instruction of the test tool, the method further includes: The simulation tool debugging mode in the test tool is turned on, so that after the test tool sets the command line parameter, the instruction is sent to the simulation tool through the simulation tool debugging mode.
2. The method according to claim 1, characterized in that: The step of setting command line parameters according to the test data includes: The test tool sets command line parameters according to the working conditions corresponding to the test cases in the test data.
3. The method according to claim 1, characterized in that: The acquiring the simulation model according to the command line parameters and configuring the command line parameters includes: The simulation tool obtains the simulation model according to the path of the simulation model, and sets the simulation duration and the simulation step for the simulation model; The simulation tool obtains parameter information of the test data according to the path of the test data, and assigns the parameter information to the simulation model.
4. A device for optimizing a simulation model, characterized in that: include: Test data acquisition unit, parameter setting unit and command line parameter configuration unit; The test data acquisition unit is used to acquire test data corresponding to failed test results based on the test of the simulation model; The parameter setting unit is used to set command line parameters according to the test data; the command line parameters include simulation duration, simulation step length, the path of the simulation model and the path of the test data; The command line parameter configuration unit is used to obtain the simulation model according to the command line parameters, and configure the command line parameters to optimize the simulation model; The command line parameter configuration unit includes: A starter unit, used for the simulation tool to start in response to the instruction of the test tool, and to open the project where the simulation model is located according to the path of the simulation model; A duration setting subunit is used for the simulation tool to set the simulation duration and the simulation step length for the project; A loading subunit, used for a simulation tool to load the test data and parameter information of the test data according to the path of the test data; A parameter information setting subunit is used for the simulation tool to configure the parameter information to the corresponding module in the simulation model and load the test data into the memory; The device also includes: The debugging mode enabling unit is used to enable the debugging mode of the simulation tool in the test tool, so as to send the instruction to the simulation tool through the debugging mode of the simulation tool after the test tool sets the command line parameter.
5. The device according to claim 4, characterized in that The parameter setting unit comprises: The command line parameter setting subunit is used for the test tool to set the command line parameters according to the working conditions corresponding to the test cases in the test data.
6. The device according to claim 4, characterized in that The command line parameter configuration unit includes: A simulation model acquisition subunit, used for a simulation tool to acquire the simulation model according to the path of the simulation model, and to set the simulation duration and the simulation step length for the simulation model; The parameter assignment subunit is used for the simulation tool to obtain the parameter information of the test data according to the path of the test data, and assign the parameter information to the simulation model.
Citation Information
Patent Citations
Model management method and device, terminal and storage medium
CN114462777A
Model testing method, device, equipment and medium
CN116257424A