Simulation script generation method and device, computer equipment and storage medium

By providing editing entrances and parameter input entrances in the modeling element editing interface, the generation process of multi-body dynamics simulation scripts is simplified, and the problems of complexity and low convenience in generating simulation scripts in the existing technology are solved, which improves users Experience and generate efficiency.

CN119475472APending Publication Date: 2025-02-18CHENGDU GONGDING TECHNOLOGY CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411637365.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The process of generating multi-body dynamic simulation scripts in the prior art is complicated, requiring users to have a coding basis, resulting in high learning costs for novices and low convenience in generating simulation scripts.

Method used

Provides a simulation script generation method. By displaying the editing entrance and parameter input entrance of the modeling element in the modeling element editing interface, users can generate simulation scripts by inputting necessary parameters, simplifying the creation process of dynamic simulation scripts.

Benefits of technology

By providing a visual user interface, users can generate simulation scripts only by entering parameters, which improves the convenience of generating simulation scripts and reduces the learning cost for novice users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475472A_ABST
    Figure CN119475472A_ABST
Patent Text Reader

Abstract

The invention relates to a simulation script generation method and device, computer equipment and a storage medium. The method comprises the following steps: displaying an editing entry of modeling elements for constructing a simulation model in a modeling element editing interface; in response to a trigger operation of an editing entry of the modeling element, displaying at least one parameter input entry of the modeling element; the parameter input entry corresponds to modeling parameters needing to be manually input by a user in a target API, and the target API is used for generating a simulation script of a simulation model; generating a simulation script of the simulation model according to the modeling parameters received through the parameter input inlets; the simulation script is used for performing dynamic simulation on the simulation model. By adopting the method, the convenience of generating the simulation script can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of dynamics simulation technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium and computer program product for generating a simulation script. Background Art

[0002] Creating a multibody dynamics (MBD) simulation script usually involves several key steps, including but not limited to defining system components, setting physical properties, defining contacts and constraints, and writing code to control the simulation process. The specific process will depend on the simulation software or programming environment used. Since the writing of dynamics simulation scripts is relatively complex, it requires users to have a certain coding foundation, which is not friendly to some novice users. The learning cost for novice users is too high without a programming foundation. In traditional technology, novice users can generate simulation models through the model creation function in the software, but this process is usually cumbersome and complicated, resulting in low convenience in generating simulation scripts. Summary of the invention

[0003] Based on this, it is necessary to provide a simulation script generation method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the convenience of generating simulation scripts in response to the above-mentioned technical problems.

[0004] In a first aspect, the present application provides a method for generating a simulation script, comprising:

[0005] Displaying the editing entry of the modeling elements used to construct the simulation model in the modeling element editing interface;

[0006] In response to a triggering operation of the editing entry of the modeling element, at least one parameter input entry of the modeling element is displayed; the parameter input entry corresponds to a modeling parameter that needs to be manually input by a user in a target API, and the target API is used to generate a simulation script of the simulation model;

[0007] A simulation script of the simulation model is generated according to the modeling parameters received through each of the parameter input ports; the simulation script is used to perform dynamic simulation on the simulation model.

[0008] In one embodiment, generating a simulation script of the simulation model according to the modeling parameters received through each of the parameter input ports includes:

[0009] In response to the modeling parameter input operation of the parameter input entrance, a modeling parameter table is displayed in the table panel of the modeling element editing interface; the modeling parameter table includes row data corresponding to the modeling element; the row data includes the modeling parameters that meet the numerical rules and are received through each of the parameter input entrances, and the row data includes a unique modeling element identifier;

[0010] In response to the export operation of the modeling parameter table, a simulation script of the simulation model is generated.

[0011] In one embodiment, in response to the export operation of the modeling parameter table, generating a simulation script of the simulation model includes:

[0012] In response to the export operation of the modeling parameter table, generating a target API corresponding to the modeling element according to the modeling parameters received through each of the parameter input entrances;

[0013] The target API is written into the created script file to generate a simulation script for the simulation model; the simulation script is used to call the target API during execution and display the simulation model constructed by the simulation script in a canvas panel; the canvas panel is used for the user to adjust the simulation model.

[0014] In one embodiment, before the step of displaying the editing entry of the modeling element for constructing the simulation model in the modeling element editing interface, the method further includes:

[0015] Displaying a template library interface; the template library interface includes a plurality of node controls displayed in a tree structure; different node controls represent corresponding dynamic systems;

[0016] In response to a triggering operation on a target node control in the node controls, jump to the modeling element editing interface of the dynamic system represented by the target node control.

[0017] In one embodiment, after the step of generating a simulation script of the simulation model, the method further comprises:

[0018] Displaying a model display panel in the template library interface;

[0019] In response to the operation of dragging any one of the node controls to the model display panel, the simulation model of the dynamic system represented by the any one of the node controls is displayed in the model display panel.

[0020] In one embodiment, the node control is configured with a dynamic system template, and the dynamic system template is used to simulate the simulation model of the dynamic system together with the simulation script; after the step of displaying the template library interface, the method further includes:

[0021] In response to a script editing operation on the dynamics system template, obtaining a custom script template for the dynamics system;

[0022] According to the custom script template, a new node control is generated in the template library interface; the new node control is configured with the custom script template.

[0023] In one embodiment, generating a new node control in the template library interface according to the custom script template includes:

[0024] In response to a position editing operation on the custom script template, determining a node position of the custom script template;

[0025] According to the node position, a new node control corresponding to the custom script template is configured in the template library interface.

[0026] In a second aspect, the present application also provides a simulation script generation device, comprising:

[0027] A display module, used for displaying the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface;

[0028] a response module, configured to display at least one parameter input entry of the modeling element in response to a triggering operation of the editing entry of the modeling element; the parameter input entry corresponds to a modeling parameter that needs to be manually input by a user in a target API, and the target API is used to generate a simulation script of the simulation model;

[0029] A generation module is used to generate a simulation script of the simulation model according to the modeling parameters received through each of the parameter input entrances; the simulation script is used to perform dynamic simulation on the simulation model.

[0030] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0032] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0033] The above-mentioned simulation script generation method, device, computer equipment, computer-readable storage medium and computer program product display the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface; in response to the triggering operation of the modeling element editing entry, display at least one parameter input entry of the modeling element, the parameter input entry corresponds to the modeling parameter that needs to be manually input by the user in the target API, and the target API is used to generate the simulation script of the simulation model; according to the modeling parameters received through each parameter input entry, generate the simulation script of the simulation model, and the simulation script is used to perform dynamic simulation on the simulation model. By providing a visual user interface including the modeling element editing entry and the parameter input entry, the creation process of the dynamic simulation script is simplified, and the user only needs to enter the necessary parameters in the visual modeling environment to conveniently create the corresponding simulation script, so that the simulation script can be generated efficiently and conveniently, and the convenience of generating the simulation script is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0035] FIG1 is an application environment diagram of a method for generating a simulation script in one embodiment;

[0036] FIG2 is a schematic flow chart of a method for generating a simulation script in one embodiment;

[0037] FIG3 is a schematic diagram of a modeling element editing interface in one embodiment;

[0038] FIG4 is a flowchart of a method for generating a simulation script in one embodiment;

[0039] FIG5 is a schematic diagram of a template library interface in one embodiment;

[0040] FIG6 is a schematic diagram of a user interface for generating a custom script template in one embodiment;

[0041] FIG7 is a schematic flow chart of a method for generating a simulation script in another embodiment;

[0042] FIG8 is a structural block diagram of a device for generating a simulation script in one embodiment;

[0043] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] The method for generating a simulation script provided in an embodiment of the present application can be applied to an application environment as shown in FIG. 1. The terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 displays the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface; the terminal 102 displays at least one parameter input entry of the modeling element in response to the triggering operation of the editing entry of the modeling element; the parameter input entry corresponds to the modeling parameter that the user needs to manually input in the target API, and the target API is used to generate a simulation script for the simulation model; the terminal 102 generates a simulation script for the simulation model according to the modeling parameters received through each parameter input entry; the simulation script is used to perform dynamic simulation on the simulation model. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, projection devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0046] In an exemplary embodiment, as shown in FIG. 2 , a method for generating a simulation script is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, and includes:

[0047] Step S202: displaying the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface.

[0048] The modeling element editing interface is a graphical interface for editing modeling elements, through which users can edit the parameters of each modeling element to input the content required to build a simulation script. In a specific implementation, the modeling element editing interface can display modeling elements by category.

[0049] Among them, the simulation model can be a simulation model of a dynamic system constructed by a simulation script. The simulation model can be used to simulate the various components and their interactions in the dynamic system. A dynamic system can refer to a mechanical system whose state changes due to external inputs and internal characteristics during the time evolution process. In the field of vehicle engineering, the dynamic system may include but is not limited to a suspension system, a steering system, a braking system, etc., which together affect the vehicle's motion behavior and handling performance. Furthermore, the simulation script of the embodiment of the present application can also be used to construct a simulation model of a multi-body dynamic system. A multi-body dynamic system can refer to a mechanical system composed of multiple interconnected rigid bodies or flexible bodies.

[0050] The modeling elements may include the components and properties required to construct a simulation model of a dynamic system. Through these modeling elements, the physical properties, positional relationships, force conditions, and interactions of the components in the dynamic system may be defined.

[0051] Optionally, modeling elements may include "components", "coordinate points", "marker points", "geometry", "kinematic pairs", "loads", "general", "user-defined elements", etc. Among them, "components" can define various physical entities in the dynamic system, such as parts or assemblies; "coordinate points" can be used to define the spatial position or reference point of a specific component in the dynamic system; "marker points" can be used to define the identification point of a specific component; "geometry" can be used to define the shape and structure of a specific component; "kinematic pairs" are used to define the constraints between various components; "loads" are used to define the external forces or loads applied to the dynamic system; "general" can be used to define the general functions of components or the general elements of scenarios; "user-defined elements" can be used to customize special components or properties.

[0052] The editing entry of the modeling element may be an operation entry for the user to select and edit the modeling element in the modeling element editing interface. For example, the user may select the editing entry corresponding to the modeling element to be created from the modeling element editing interface, such as the editing entry of the "coordinate point", thereby providing the user with an intuitive way to select the modeling element to be simulated, avoiding the trouble of directly writing code.

[0053] Step S204: in response to a triggering operation of an editing entry of a modeling element, display at least one parameter input entry of the modeling element.

[0054] The parameter input entry corresponds to the modeling parameters that need to be manually input by the user in the target API, and the target API is used to generate a simulation script for the simulation model. The parameter input entry may refer to an input area for receiving modeling parameters, such as a parameter input box, in which the user can fill in the specific values ​​of the modeling parameters. These modeling parameters are the parameters required by the target API to generate a simulation script for the simulation model.

[0055] Among them, API refers to Application Programming Interface (API). The target API can refer to the programming interface of a specific modeling element, which is used to generate a simulation script corresponding to the specific modeling element according to the modeling parameters filled in by the user. After the user fills in the modeling parameters in the parameter input entrance, the terminal can call the target API corresponding to the modeling element and generate a simulation script for the simulation model through the target API.

[0056] In a specific implementation, the user's triggering operation on the editing entry may include but is not limited to click, double-click, long press and other operations. After the user triggers the editing entry of the modeling element, the terminal displays at least one parameter input entry of the modeling element in the modeling element editing interface, and the user can see the modeling parameters that need to be filled in, including the modeling element name, parameter value, etc. For example, if the modeling element selected by the user is a "coordinate point", the parameter input entry displayed by the terminal in the modeling element editing interface may include but is not limited to the coordinate point name, the name of the attached component, the XYZ coordinate position, etc.

[0057] Step S206, generating a simulation script of the simulation model according to the modeling parameters received through each parameter input entry.

[0058] In one of the embodiments, the terminal parses the modeling parameters received through each parameter input entrance to obtain the target API corresponding to the modeling element, and writes the target API into the created script file to obtain the simulation script of the simulation model. Then, by running the simulation script, the target API of the modeling element can be called to perform dynamic simulation of the simulation model.

[0059] Specifically, the script modeling library can provide a programming interface API to support code generation for dynamic simulation modeling. In other words, the script modeling library can be an underlying library and function set that supports the generation of simulation scripts. The script modeling library encapsulates multiple API interfaces according to modeling elements. The user selects a modeling element through the modeling element editing interface. The terminal uses the API corresponding to the modeling element in the script modeling library as the target API, and displays the corresponding parameter input entry in the modeling element editing interface according to the modeling parameters required by the target API. After receiving the modeling parameters input by the user through the parameter input entry, the terminal can parse and obtain the target API containing the modeling parameters, and automatically generate a simulation script based on the target API. Finally, by running the simulation script, the target API of the modeling element can be called to perform dynamic simulation on the simulation model.

[0060] For example, if the user selects the modeling element "coordinate point", the target API corresponding to the modeling element "coordinate point" in the script modeling library can be a coordinate point creation function. Each variable in the coordinate point creation function corresponds to a different modeling parameter. The terminal can parse the modeling parameters filled in by the user to obtain the coordinate point creation function after assigning values ​​to each variable, write the coordinate point creation function into the created script file, and obtain the simulation script. Finally, by running the simulation script, the target API of the modeling element is called to perform dynamic simulation on the simulation model.

[0061] The simulation script is used to perform dynamic simulation on the simulation model. In a specific implementation, the terminal may call the target API obtained by parsing the modeling parameters to run the simulation script, thereby performing dynamic simulation on the simulation model of the dynamic system to which the modeling element belongs. Specifically, the dynamic simulation process may include presenting a three-dimensional model corresponding to the dynamic system in a view window of the user interface, so that the user can intuitively view and analyze the structure and motion behavior of the dynamic system.

[0062] In the above simulation script generation method, an editing entry of a modeling element used to construct a simulation model is displayed in a modeling element editing interface; in response to a triggering operation of the modeling element editing entry, at least one parameter input entry of the modeling element is displayed, and the parameter input entry corresponds to a modeling parameter that needs to be manually input by a user in a target API, and the target API is used to generate a simulation script of the simulation model; according to the modeling parameters received through each parameter input entry, a simulation script of the simulation model is generated, and the simulation script is used to perform dynamic simulation on the simulation model. By providing a visual user interface including a modeling element editing entry and a parameter input entry, the creation process of the dynamic simulation script is simplified, and the user only needs to enter the necessary parameters in the visual modeling environment to conveniently create the corresponding simulation script, so that the simulation script can be generated efficiently and conveniently, and the convenience of generating the simulation script is improved.

[0063] In another embodiment, a simulation script of a simulation model is generated based on modeling parameters received through each parameter input entrance, including: in response to a modeling parameter input operation of the parameter input entrance, displaying a modeling parameter table in a table panel of a modeling element editing interface; the modeling parameter table includes row data corresponding to the modeling elements; in response to an export operation of the modeling parameter table, generating a simulation script of the simulation model.

[0064] Among them, the modeling parameter input operation of the parameter input entrance may include the user inputting a specific parameter value in the parameter input entrance and confirming the input parameter value. For example, the user can manually type a specific value or text in the parameter input entrance, or select a value or text in the corresponding drop-down menu, and trigger the "Confirm" virtual control to confirm the input value. In response to the modeling parameter input operation, the terminal can add a row of data about the modeling parameter in the modeling parameter table in the table panel.

[0065] The table panel may be a component displayed in a table format in the modeling element editing interface, and the table panel may display a modeling parameter table, and the row data of each row in the modeling parameter table includes various modeling parameters corresponding to the modeling element. For example, if the modeling element is a "coordinate point", the row data corresponding to the "coordinate point" may include but is not limited to the specific name of the coordinate point, the specific name of the attached component, the specific value of the XYZ coordinate position, etc.

[0066] The row data includes modeling parameters that comply with numerical rules and are received through each parameter input entry, and the row data contains a unique modeling element identifier.

[0067] In a specific implementation, in response to the modeling parameter input operation, the terminal may first determine whether the modeling parameters received through each parameter input entry conform to the numerical rules, and determine whether the modeling element identifiers contained in the modeling parameters are repeated with the modeling element identifiers contained in other generated row data. If the modeling parameters received through each parameter input entry conform to the numerical rules, and the modeling element identifiers contained in the modeling parameters are not repeated with the modeling element identifiers contained in other generated row data, then a row of data about the modeling parameter is added to the modeling parameter table in the table panel.

[0068] Exemplarily, determining whether the modeling parameters received through each parameter input entrance conform to the numerical rules may be a validity test of the modeling parameters. For example, a regular expression may be used to determine whether the modeling parameters received through each parameter input entrance conform to the numerical rules. The regular expression may be used to check whether the input modeling parameters are in a valid numeric format, within a specified range, or contain special characters.

[0069] Exemplarily, the modeling element identifier may refer to the modeling element name. Row data corresponding to the same modeling element name is not allowed to exist in the modeling parameter table, that is, the modeling element name corresponding to each row in the modeling parameter table is different.

[0070] Exemplarily, the export operation of the modeling parameter table may include a user triggering an "export" virtual button, and the terminal may generate a simulation script of the simulation model according to the row data in the modeling parameter table in response to the export operation of the modeling parameter table.

[0071] The technical solution of this embodiment simplifies the parameter input and script generation process of modeling elements by generating a modeling parameter table, thereby improving user experience and modeling efficiency. The row data generated in the modeling parameter table ensures that the modeling parameters comply with numerical rules and that there are no repeated modeling element identifiers, thereby ensuring that the generated simulation script is accurate and effective and meets the needs of dynamic simulation.

[0072] Furthermore, in another embodiment, in response to an export operation on a modeling parameter table, a simulation script of a simulation model is generated, including: in response to an export operation on the modeling parameter table, generating a target API corresponding to a modeling element according to the modeling parameters received through each parameter input entry; writing the target API into a created script file to generate a simulation script for the simulation model; the simulation script is used to call the target API during execution, and display the simulation model constructed by the simulation script in a canvas panel; and the canvas panel is used for the user to adjust the simulation model.

[0073] In a specific implementation, the terminal responds to the export operation of the modeling parameter table, and can embed the modeling parameters into the target API according to the modeling parameters received through each parameter input entrance. For example, if the target API is a coordinate point creation function, the modeling parameters can be used to assign values ​​to each variable in the coordinate point creation function to obtain a target API embedded with the modeling parameters. Then the target API is written into the created script file, for example, a python script file can be written to form an executable simulation script, thereby interactively completing the creation of the simulation script by providing a visual user interface, which can more conveniently generate simulation scripts and is more friendly to novice users. The simulation script may contain one or more target APIs corresponding to modeling elements. Optionally, the generation of the simulation model can be triggered after the script file is generated according to a single target API.

[0074] In the specific implementation, the terminal executes the generated simulation script and calls the target API to create and configure the modeling elements in the simulation model, thereby simulating the dynamic system. During the running of the simulation script, the simulation model can be presented in real time in the canvas panel, allowing the user to preview the simulation results and model structure in real time. Optionally, the canvas panel can be located in the modeling element editing interface, or it can be a panel in the next interface that jumps from the modeling element editing interface.

[0075] In the specific implementation, users can directly interact with the simulation model through the canvas panel, such as adjusting the position, rotating the view, or modifying parameters. The canvas panel provides users with a visual interface for model adjustment and optimization.

[0076] In the technical solution of this embodiment, the user sets the modeling parameters through the parameter input port, the terminal automatically generates and runs the simulation script, and displays the visualized simulation model in the canvas panel, so that the user can preview the simulation model in real time during the model creation process. The canvas panel further supports the user's intuitive adjustment of the simulation model, which facilitates the rapid iteration and optimization of the simulation model.

[0077] It can be seen that the simulation script generation method of the embodiment of the present application provides a visual way to create scripts, which reduces the learning cost of novice users without programming foundation. At the same time, advanced users can also use the visual script tool to initially complete the script and make fine adjustments at a later stage. Through the visual user interface, users only need to input parameters to generate script files, and can preview their own script models in the view, so that users can complete script writing efficiently, conveniently, and graphically.

[0078] In order to facilitate the understanding of those skilled in the art, FIG3 exemplarily provides a schematic diagram of a modeling element editing interface. In the modeling element editing interface 300, the modeling elements are classified and displayed according to their categories, and the editing entrance 302 of each modeling element is displayed. In response to the triggering operation of the editing entrance 302 of the modeling element, at least one parameter input entrance 304 of the modeling element is displayed. These parameter input entrances 304 are used by the user to input the modeling parameters required by the target API, such as parameter names and parameter values. As shown in FIG3, a modeling element "coordinate point" is created. Assuming that the target API corresponding to the modeling element is expressed as:

[0079] pySimSDK.CreateMarker(MarkerName=" ",

[0080] PartName=" ",

[0081] Location = " ");

[0082] Among them, pySimSDK is the script modeling library; CreateMarker is the coordinate point creation function in the script modeling library, that is, the target API; MarkerName is the coordinate point name, that is, the modeling element identifier; PartName is the selected component name, that is, the coordinate point is used as the coordinate point of which component; Location is the XYZ coordinate position. The coordinate point creation function can assign values ​​to the corresponding CreateMarker, MarkerName, PartName and other function variables according to the modeling parameters input by the user, so as to parse and obtain the assigned coordinate point creation function, which can be used to generate simulation scripts.

[0083] The user can input the corresponding modeling parameters in the parameter input entry 304. After triggering the "Confirm" virtual control 310, a record about the "coordinate point" of the modeling element can be added to the modeling parameter table of the table panel 306, that is, the row data of the "coordinate point" of the modeling element.

[0084] In addition, the user can select the row data in the modeling parameter table in its entirety, and the terminal will activate the parameter input entry 304. The user can modify the modeling parameters input in the parameter input entry 304, and then trigger the "confirm" virtual control 310 again to modify the content of the modeling parameter table. Alternatively, the user can double-click a cell in the modeling parameter table to edit the modeling parameters in the cell.

[0085] Finally, the user can trigger the "Export" virtual control 312, and the terminal will read all the records in the modeling parameter table row by row, parse them one by one into the target API corresponding to the modeling element, and write the target API into the created script file to obtain the simulation script. Then, by running the simulation script, the target API of the modeling element is called to perform dynamic simulation on the simulation model.

[0086] In order to facilitate the understanding of those skilled in the art, FIG4 exemplarily provides a flowchart of generating a simulation script. It can be seen that after the user clicks the "Confirm" virtual button 310 for the modeling parameters, it is first determined whether the input modeling parameters are reasonable, that is, whether they meet the numerical rules. If they do not meet the numerical rules, it is prompted that the input is inappropriate; if they meet the numerical rules, it is further determined whether there are the same modeling element names in the modeling parameter table. If there are the same modeling element names, it is prompted that there are duplicate names; if there are no same modeling element names, a new row is added to the modeling parameter table, that is, a new row of data is added, and then according to each row of data in the modeling parameter table, the target API is parsed and a simulation script is generated; by executing the simulation script, the target API can be called to display the simulation model in the canvas panel.

[0087] In another embodiment, before the step of displaying the editing entry of the modeling element for constructing the simulation model in the modeling element editing interface, it also includes: displaying the template library interface; the template library interface includes multiple node controls displayed in a tree structure; different node controls represent corresponding dynamic systems; in response to the triggering operation of the target node control in the node control, jump to the modeling element editing interface of the dynamic system represented by the target node control.

[0088] Among them, the template library interface is used to display existing dynamic system templates. The dynamic system template is a pre-defined model template containing specific dynamic system structure and properties, which is used to accelerate the modeling and simulation process. The dynamic system template contains the basic components, connection relationships, parameter settings, etc. of a complete dynamic system or subsystem, which can be used directly or further modified by users when creating simulation models.

[0089] Exemplarily, the dynamic system template may include templates for dynamic systems such as suspension system, steering system, and braking system, and may also include subsystem templates for each dynamic system. For example, the subsystem of the suspension system includes subsystems such as front suspension and rear suspension, and the front suspension further includes subsystems such as McPherson and double wishbone.

[0090] In the template library interface, different dynamic system templates in the template library are displayed in the form of node controls and arranged in a tree structure, which is convenient for users to expand and collapse each level to view different dynamic systems or subsystems.

[0091] Each node control in the tree structure represents a specific dynamic system or subsystem. Users can trigger the node control to enter the modeling element editing interface of the corresponding system. The target node control is the node control selected by the user. For example, after the user performs a trigger operation such as clicking or double-clicking the target node control, it will jump to the modeling element editing interface of the dynamic system represented by the target node control.

[0092] The technical solution of this embodiment, through the template library and tree structure, enables the user to quickly navigate to the modeling element editing interface of the target dynamic system, effectively build and optimize the simulation model, and improve the model building efficiency and user experience.

[0093] In another embodiment, after the step of generating a simulation script for a simulation model, it also includes: displaying a model display panel in a template library interface; in response to the operation of dragging any node control in the node controls to the model display panel, displaying the simulation model of the dynamic system represented by any node control in the model display panel.

[0094] The model display panel may be a visualization panel for displaying a simulation model of a dynamic system.

[0095] The user can select a node control in the tree structure, drag the node control to the model display panel, and the terminal will generate and display the simulation model of the dynamic system corresponding to the node control in the model display panel. The simulation model can be presented in a three-dimensional view, so that the user can clearly observe the structure of the simulation model, the layout of the components and their relationships.

[0096] The technical solution of this embodiment can conveniently import and display the simulation model of the dynamic system in a visual model display panel through a simple drag and drop operation, so that the user can intuitively view and adjust the simulation model, thereby accelerating the simulation model construction and optimization process.

[0097] To facilitate the understanding of those skilled in the art, Fig. 5 exemplarily provides a schematic diagram of a template library interface. It can be seen that the left side of the template library interface 500 displays multiple node controls 502 displayed in a tree structure. A model display panel 504 is displayed in the template library interface 500; in response to the operation of dragging any node control in the node controls 502 to the model display panel 504, the simulation model of the dynamic system represented by any node control is displayed in the model display panel 504.

[0098] In another embodiment, the node control is configured with a dynamic system template, and the dynamic system template is used to simulate the simulation model of the dynamic system together with the simulation script; after the step of displaying the template library interface, it also includes: in response to the script editing operation of the dynamic system template, obtaining a custom script template for the dynamic system; according to the custom script template, generating a new node control in the template library interface; the new node control is configured with the custom script template.

[0099] The dynamic system template is a predefined model template, which contains the components, connection relationships and initial parameter settings of a specific dynamic system. The simulation script includes a set of instructions for controlling the simulation process, including specific steps for model operation, parameter adjustment and simulation operation. The simulation model of the dynamic system can be a specific model generated by the joint action of the dynamic system template and the simulation script, which contains all components, parameters and behavior descriptions of the dynamic system.

[0100] In a specific implementation, the script editing operation may include editing operations such as modifying the parameters of the dynamic system template, adding new template functions, and adjusting the template structure. In response to the script editing operation on the dynamic system template, the terminal may generate a custom script template, which contains all modifications and extensions made by the user to the original dynamic system template. The terminal adds a new node control in the template library interface, representing the custom script template created by the user. The new node control is displayed together with the original node control for the user to select and use in subsequent simulation modeling. The new node control is configured with the custom script template created by the user.

[0101] The technical solution of this embodiment allows users to edit existing dynamic system templates, create custom script templates, and generate new node controls in the template library interface, so that users can quickly create and use custom dynamic system templates according to specific needs, thereby improving the efficiency and accuracy of simulation modeling.

[0102] In another embodiment, a new node control is generated in the template library interface based on the custom script template, including: determining the node position of the custom script template in response to a position editing operation on the custom script template; and configuring a new node control corresponding to the custom script template in the template library interface according to the node position.

[0103] The position editing operation may be an operation for editing the display position of a new node control configured with a custom script template in the template library interface. The position editing operation may include selecting a position in the tree structure to configure the new node control at a specific position in the tree structure.

[0104] The technical solution of this embodiment allows the user to edit the position of the custom script template and determine the display position of the new node control in the template library interface, so that the user can quickly create and use customized dynamic system templates according to specific needs, thereby improving the efficiency and accuracy of simulation modeling.

[0105] In order to facilitate the understanding of those skilled in the art, FIG. 6 exemplarily provides a user interface schematic diagram for generating a custom script template. As shown in FIG. 6 , the left side of the template library interface 500 displays a plurality of node controls 502 displayed in a tree structure, including a user library node control 600 and a McPherson node control 602. The user library node control 600 provides the function of a custom library, which is convenient for users to establish and maintain their own model library. Taking the addition of a custom McPherson template as an example, first right-click the McPherson node control 602 in the car library and select "Create Library Copy". At this time, a pop-up window 604 will appear to prompt the user to place the custom McPherson template at which node of the tree. After the user clicks the control 606, the script editing window is displayed, and the script file predefined by the McPherson template can be displayed in the script editing window. The user can edit and modify the predefined script file to a custom McPherson template. After confirming the custom McPherson template, the custom McPherson template will generate a new node control under the user library node control 600. In addition, the add node button 608 and the delete node button 610 in the pop-up window 604 can facilitate the user to customize the tree structure and organize the template library.

[0106] In another embodiment, as shown in FIG. 7 , a method for generating a simulation script is provided, which is described by taking the method applied to the terminal 102 in FIG. 1 as an example, and includes the following steps:

[0107] S702, display the template library interface.

[0108] The template library interface includes multiple node controls displayed in a tree structure. Different node controls represent corresponding dynamic systems.

[0109] S704, in response to a triggering operation on a target node control in the node control, jump to a modeling element editing interface of the dynamic system represented by the target node control.

[0110] S706, displaying the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface.

[0111] S708: In response to a triggering operation of an editing entry of a modeling element, display at least one parameter input entry of the modeling element.

[0112] The parameter input entry corresponds to the modeling parameters that need to be manually input by the user in the target API, and the target API is used to generate a simulation script for the simulation model.

[0113] S710 , in response to a modeling parameter input operation at a parameter input entry, displaying a modeling parameter table in a table panel of a modeling element editing interface.

[0114] The modeling parameter table includes row data corresponding to the modeling elements; the row data includes the modeling parameters that meet the numerical rules and are received through each parameter input entry, and the row data contains a unique modeling element identifier.

[0115] S712, in response to the export operation of the modeling parameter table, generating a target API corresponding to the modeling element according to the modeling parameters received through each parameter input entry.

[0116] S714, writing the target API into the created script file to generate a simulation script for the simulation model.

[0117] The simulation script is used to call the target API when executed, and display the simulation model constructed by the simulation script in the canvas panel; the canvas panel is used for the user to adjust the simulation model.

[0118] S716, displaying the model display panel in the template library interface.

[0119] In one of the embodiments, a node control is configured with a dynamic system template, and the dynamic system template is used to simulate a simulation model of the dynamic system together with a simulation script; after the step of displaying the template library interface, it also includes: in response to a script editing operation on the dynamic system template, obtaining a custom script template for the dynamic system; generating a new node control in the template library interface according to the custom script template; the new node control is configured with the custom script template.

[0120] In one of the embodiments, a new node control is generated in a template library interface based on a custom script template, including: determining a node position of the custom script template in response to a position editing operation on the custom script template; and configuring a new node control corresponding to the custom script template in the template library interface according to the node position.

[0121] S718, in response to the operation of dragging any node control in the node controls to the model display panel, the simulation model of the dynamic system represented by any node control is displayed in the model display panel.

[0122] It should be noted that the specific limitations of the above steps can refer to the specific limitations of a simulation script generation method mentioned above.

[0123] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0124] Based on the same inventive concept, the embodiment of the present application also provides a device for generating a simulation script for implementing the method for generating a simulation script involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the device for generating one or more simulation scripts provided below can refer to the limitations of the method for generating a simulation script above, and will not be repeated here.

[0125] In an exemplary embodiment, as shown in FIG8 , a simulation script generation device is provided, including:

[0126] The display module 810 is used to display the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface.

[0127] The response module 820 is used to display at least one parameter input entry of the modeling element in response to the triggering operation of the editing entry of the modeling element; the parameter input entry corresponds to the modeling parameters that need to be manually input by the user in the target API, and the target API is used to generate a simulation script for the simulation model.

[0128] The generation module 830 is used to generate a simulation script of the simulation model according to the modeling parameters received through each of the parameter input entrances; the simulation script is used to perform dynamic simulation on the simulation model.

[0129] In one embodiment, the generation module 830 is specifically used to display a modeling parameter table in the table panel of the modeling element editing interface in response to the modeling parameter input operation of the parameter input entrance; the modeling parameter table includes row data corresponding to the modeling element; the row data includes modeling parameters that comply with numerical rules and are received through each of the parameter input entrances, and the row data contains a unique modeling element identifier; in response to the export operation of the modeling parameter table, a simulation script of the simulation model is generated.

[0130] In one of the embodiments, the generation module 830 is specifically used to generate a target API corresponding to the modeling element in response to an export operation on the modeling parameter table, according to the modeling parameters received through each of the parameter input entries; write the target API into a created script file to generate a simulation script for the simulation model; the simulation script is used to call the target API during execution, and display the simulation model constructed by the simulation script in a canvas panel; and the canvas panel is used for the user to adjust the simulation model.

[0131] In one embodiment, the display module 810 is specifically used to display the template library interface; the template library interface includes multiple node controls displayed in a tree structure; different node controls represent corresponding dynamic systems; in response to a trigger operation on a target node control in the node controls, jump to the modeling element editing interface of the dynamic system represented by the target node control.

[0132] In one embodiment, the display module 810 is specifically used to display a model display panel in the template library interface; in response to the operation of dragging any node control among the node controls to the model display panel, the simulation model of the dynamic system represented by any node control is displayed in the model display panel.

[0133] In one of the embodiments, the node control is configured with a dynamic system template, and the dynamic system template is used to simulate the simulation model of the dynamic system together with the simulation script; the generation module 830 is specifically used to obtain a custom script template for the dynamic system in response to a script editing operation on the dynamic system template; according to the custom script template, a new node control is generated in the template library interface; the new node control is configured with the custom script template.

[0134] In one of the embodiments, the generation module 830 is specifically used to determine the node position of the custom script template in response to the position editing operation of the custom script template; according to the node position, configure a new node control corresponding to the custom script template in the template library interface.

[0135] Each module in the above simulation script generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0136] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for generating a simulation script is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0137] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0138] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0139] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0140] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0142] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0143] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0144] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a simulation script, characterized in that: The method comprises: Displaying the editing entry of the modeling elements used to construct the simulation model in the modeling element editing interface; In response to a triggering operation of the editing entry of the modeling element, at least one parameter input entry of the modeling element is displayed; the parameter input entry corresponds to a modeling parameter that needs to be manually input by a user in a target API, and the target API is used to generate a simulation script of the simulation model; A simulation script of the simulation model is generated according to the modeling parameters received through each of the parameter input ports; the simulation script is used to perform dynamic simulation on the simulation model.

2. The method according to claim 1, characterized in that The step of generating a simulation script of the simulation model according to the modeling parameters received through each of the parameter input entrances comprises: In response to the modeling parameter input operation of the parameter input entrance, a modeling parameter table is displayed in the table panel of the modeling element editing interface; the modeling parameter table includes row data corresponding to the modeling element; the row data includes the modeling parameters that meet the numerical rules and are received through each of the parameter input entrances, and the row data includes a unique modeling element identifier; In response to the export operation of the modeling parameter table, a simulation script of the simulation model is generated.

3. The method according to claim 2, characterized in that The step of generating a simulation script of the simulation model in response to the export operation of the modeling parameter table comprises: In response to the export operation of the modeling parameter table, generating a target API corresponding to the modeling element according to the modeling parameters received through each of the parameter input entrances; The target API is written into the created script file to generate a simulation script for the simulation model; the simulation script is used to call the target API during execution and display the simulation model constructed by the simulation script in a canvas panel; the canvas panel is used for the user to adjust the simulation model.

4. The method according to claim 1, characterized in that: Before the step of displaying the editing entry of the modeling element for constructing the simulation model in the modeling element editing interface, the method further includes: Displaying a template library interface; the template library interface includes a plurality of node controls displayed in a tree structure; different node controls represent corresponding dynamic systems; In response to a triggering operation on a target node control in the node controls, jump to the modeling element editing interface of the dynamic system represented by the target node control.

5. The method according to claim 4, characterized in that After the step of generating a simulation script of the simulation model, the method further comprises: Displaying a model display panel in the template library interface; In response to the operation of dragging any one of the node controls to the model display panel, the simulation model of the dynamic system represented by the any one of the node controls is displayed in the model display panel.

6. The method according to claim 4, characterized in that The node control is configured with a dynamic system template, and the dynamic system template is used to simulate the simulation model of the dynamic system together with the simulation script; After the step of displaying the template library interface, the method further includes: In response to a script editing operation on the dynamics system template, obtaining a custom script template for the dynamics system; According to the custom script template, a new node control is generated in the template library interface; the new node control is configured with the custom script template.

7. The method according to claim 6, characterized in that Generating a new node control in the template library interface according to the custom script template includes: In response to a position editing operation on the custom script template, determining a node position of the custom script template; According to the node position, a new node control corresponding to the custom script template is configured in the template library interface.

8. A device for generating a simulation script, characterized in that: The device comprises: A display module, used for displaying the editing entry of the modeling element used to construct the simulation model in the modeling element editing interface; a response module, configured to display at least one parameter input entry of the modeling element in response to a triggering operation of the editing entry of the modeling element; the parameter input entry corresponds to a modeling parameter that needs to be manually input by a user in a target API, and the target API is used to generate a simulation script of the simulation model; A generation module is used to generate a simulation script of the simulation model according to the modeling parameters received through each of the parameter input entrances; the simulation script is used to perform dynamic simulation on the simulation model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.