A model simulation method, device, electronic device and storage medium
By pausing the simulation program after each step based on calculated time intervals, the method addresses CPU overload and maintains real-time performance in simulation programs.
Patent Information
- Application Number
- CN202111370914.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2041-11-18
AI Technical Summary
The high CPU resource consumption and reduced real-time performance in simulation due to the publication of all data through OPC UA services on personal computers, caused by the computational intensity of numerical integration algorithms in simulation programs.
Implementing a model simulation method that pauses the simulation program for a calculated duration after each step, based on the simulation time step and interaction parameter times, allowing the CPU to idle and reducing overall CPU load.
This approach maintains real-time performance by minimizing CPU load and ensuring synchronization between simulation time and real-time, reducing the computational burden on the CPU.
Smart Images

Figure CN114021378B_ABST
Abstract
Description
Background Art
[0002] The core of the simulation program is the numerical integration algorithm. In each step of the numerical integration, all variable data is calculated, and the data is published as an OPC UA service. The front end obtains the data from the OPC UA service in real time. Due to the performance of personal computers and the amount of data, publishing all data as an OPC UA service will consume a large amount of CPU resources, resulting in slow simulation solution and degraded real-time performance. Summary of the Invention
[0003] In view of this, the present invention provides a model simulation method, device, electronic device, and storage medium, which at least partially solve the problems existing in the prior art.
[0004] The present application provides a model simulation method, including the following steps:
[0005] Obtain the model to be simulated and simulation parameters;
[0006] Obtain the step size parameter x input by the user; the step size parameter x is used to represent the set time of each step of the simulation;
[0007] In response to the user starting the simulation program, perform each step of the simulation operation on the simulation model in sequence according to the model to be simulated, the simulation parameters, and the step size parameter x;
[0008] Among them, the simulation operation includes:
[0009] Perform simulation calculations according to the model to be simulated and the simulation parameters, and obtain the calculation results;
[0010] Output the calculation results;
[0011] Obtain interaction parameters;
[0012] Suspend the simulation program for a first duration t;
[0013] After the first duration t ends, enter the next step of the simulation operation; the first duration t is obtained according to the step size parameter x.
[0014] In an exemplary embodiment of the present disclosure, the first duration t is obtained according to the following steps:
[0015] Obtain the time consumption a of the simulation calculation;
[0016] Obtain the time consumption b for obtaining the interaction parameters;
[0017] Determine the first duration t according to t = x - a - b.
[0018] In an exemplary embodiment of the present disclosure, the method further includes:
[0019] In response to a user's selection of display parameters;
[0020] Obtain a result parameter corresponding to the display parameter from within the calculation result;
[0021] Draw a simulation image according to the result parameter;
[0022] Display the simulation image.
[0023] In an exemplary embodiment of the present disclosure, during the process of displaying the simulation image, the method further includes:
[0024] Obtain in real time a result parameter corresponding to the display parameter in newly generated calculation results;
[0025] Update the simulation image according to the newly obtained result parameter.
[0026] In an exemplary embodiment of the present disclosure, before the simulation program is started, the method further includes:
[0027] Obtain a delay duration y;
[0028] The displaying of the simulation image includes:
[0029] Start to display the simulation image after the delay duration;
[0030] Wherein, the delay duration y is calculated according to historical delay records in historical simulation records.
[0031] In an exemplary embodiment of the present disclosure, before the simulation program is started, the method further includes:
[0032] Obtain a delay duration y; the delay duration y is calculated according to historical delay records in historical simulation records;
[0033] The determining of the first duration t according to t = x - a - b includes:
[0034] Determine the first duration t according to t = x - a - b - y / n, where n is the total number of steps of the current simulation.
[0035] In an exemplary embodiment of the present disclosure, after entering the next simulation operation, the method further includes:
[0036] Perform a simulation calculation according to the model to be simulated, the simulation parameters, and the interaction parameters, and obtain a calculation result;
[0037] Output the calculation result.
[0038] According to one aspect of the present disclosure, there is provided a model simulation device, including:
[0039] A first acquisition module, configured to acquire a model to be simulated and simulation parameters;
[0040] A second acquisition module, configured to acquire a step size parameter x input by a user; the step size parameter x is used to represent the set time for each step of simulation;
[0041] A simulation module, configured to, in response to a user starting a simulation program, sequentially perform each step of simulation operation on the simulation model according to the model to be simulated, the simulation parameters, and the step size parameter x;
[0042] Wherein, the simulation module includes:
[0043] A calculation module, configured to perform simulation calculations according to the model to be simulated and the simulation parameters, and obtain calculation results;
[0044] An output module, configured to output the calculation results;
[0045] A third acquisition module, configured to acquire interaction parameters;
[0046] A suspension module, configured to suspend the simulation program for a first duration t;
[0047] An execution module, configured to, after the first duration t ends, enter the next step of simulation operation; the first duration t is obtained according to the step size parameter x.
[0048] According to one aspect of the present disclosure, there is provided an electronic device, including a processor and a memory;
[0049] The processor is configured to execute the steps of the method described in any one of the above by calling a program or instruction stored in the memory.
[0050] According to one aspect of the present disclosure, there is provided a computer-readable storage medium, where the computer-readable storage medium stores a program or instruction, and the program or instruction causes a computer to execute the steps of the method described in any one of the above.
[0051] The present application discloses a model simulation method, apparatus, electronic device, and storage medium. Among them, in the model simulation method provided by the present application, after obtaining the model to be simulated, simulation parameters, and step parameter x, simulation calculations will be performed according to the above parameters. However, the time consumption of each simulation calculation will vary due to different calculation contents. Moreover, the time consumption of calculation and the time consumption of obtaining interaction parameters usually only account for a very small part of each step length (i.e., step parameter x). Therefore, if the next calculation is immediately entered, the CUP will always be in a high-load working state, which will consume a large amount of CPU resources, thus resulting in slow simulation solution and decreased real-time performance. After the simulation calculation and the acquisition of interaction parameters are completed in the present application, the first duration will be calculated according to the set time of each simulation step, and the simulation program will be suspended for the first duration. During the suspension of the simulation program, the CUP is in an idle state, so the load of the CUP will be reduced. At the same time, by suspending the simulation program for the first duration, the simulation time consumption and result output can be kept synchronized with the real time. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0053] Figure 1 It is a flowchart of a model simulation method provided in this embodiment;
[0054] Figure 2 It is a flowchart of simulation operations in a model simulation method provided in this embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] The embodiments of the present invention will be described in detail below with reference to the drawings.
[0056] It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other; and, based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present disclosure.
[0057] Note that the following description pertains to various aspects of embodiments within the scope of the appended claims. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of the aspects set forth herein can be used to implement a device and / or practice a method. Additionally, this device can be implemented and this method can be practiced using other structures and / or functionality in addition to one or more of the aspects set forth herein.
[0058] Please refer to Figure 1 , this application provides a model simulation method, including the following steps:
[0059] Step S100, obtain the model to be simulated and simulation parameters;
[0060] Step S200, obtain the step size parameter x input by the user; the step size parameter x is used to represent the set time for each step of the simulation;
[0061] Step S300, in response to the user starting the simulation program, sequentially perform each step of the simulation operation on the simulation model according to the model to be simulated, the simulation parameters, and the step size parameter x;
[0062] Among them, the simulation operation includes:
[0063] Step S310, perform simulation calculations according to the model to be simulated and the simulation parameters, and obtain the calculation results;
[0064] Step S320, output the calculation results;
[0065] Step S330, obtain interaction parameters;
[0066] Step S340, suspend the simulation program for the first duration t;
[0067] Step S350, after the end of the first duration t, enter the next step of the simulation operation; the first duration t is obtained according to the step size parameter x.
[0068] In practical applications, the user can pre-build the model to be simulated within the simulation program, complete the modeling in other programs, and save the model in a format that the simulation program can read for the simulation program to read.
[0069] Meanwhile, this method can be implemented through a local program or a web page. When implemented through a local program, local computing resources are used to complete the simulation calculation. When using the web version, a remote server is used for simulation calculation, and the calculation results transmitted back by the server are received.
[0070] A model simulation method provided in this embodiment will perform simulation calculations based on the above parameters after obtaining the model to be simulated, simulation parameters, and step size parameter x. However, the time consumption of each simulation calculation will vary due to different calculation contents. And the time consumption of calculation and the time consumption of obtaining interaction parameters often only account for a very small part of each step size (i.e., step size parameter x). Therefore, if the next calculation is immediately entered, the CUP will always be in a high-load working state, which will consume a large amount of CPU resources, resulting in slow simulation solving and decreased real-time performance. In this application, after completing the simulation calculation and obtaining the interaction parameters, the first duration is calculated according to the set time of each simulation step, and the simulation program is suspended for the first duration. During the suspension of the simulation program, the CUP is in an idle state, so the load on the CUP will be reduced. At the same time, by suspending the simulation program for the first duration, the simulation time consumption and result output can be kept synchronized with the real time.
[0071] In an exemplary embodiment of the present disclosure, the first duration t is obtained according to the following steps:
[0072] Obtain the simulation calculation time consumption a;
[0073] Obtain the time consumption b for obtaining interaction parameters;
[0074] Determine the first duration t according to t = x - a - b.
[0075] In actual implementation, a clock is set in the program, and the clock will advance in time as the real time progresses. The method for obtaining the simulation calculation time consumption a is to determine the simulation calculation time consumption a according to the clock time at the start of the calculation and the clock time at the end of the calculation. The time consumption b for obtaining interaction parameters can be obtained in a similar way to the simulation calculation time consumption a, or the time consumption b for obtaining interaction parameters can be set to a fixed value, that is, the same time is reserved for obtaining interaction parameters when each simulation step is executed to avoid failure to obtain interaction parameters.
[0076] Meanwhile, the clock can also be set to keep advancing in time since the start of the simulation, or it can be set to restart timing after each step ends, that is, start re-timing when the time reaches the set duration.
[0077] The first duration t obtained through the above solution is used to control the suspension time of the simulation program, making the suspension time of the simulation program more accurate, and preventing it from entering the next simulation too early or too late, thereby avoiding the problem of asynchronous timing between the simulation time and the real time.
[0078] In an exemplary embodiment of the present disclosure, the method further includes:
[0079] Responding to the user's selection of display parameters;
[0080] Obtaining result parameters corresponding to the display parameters from the calculation results;
[0081] Drawing a simulation image according to the result parameters;
[0082] Displaying the simulation image.
[0083] During the process of displaying the simulation image, the method further includes:
[0084] Real-time obtaining result parameters corresponding to the display parameters in newly generated calculation results;
[0085] Updating the simulation image according to the newly obtained result parameters.
[0086] After the simulation starts, the front end of the simulation program will display the display parameters corresponding to the calculation results, and can, when the user selects a certain display parameter, retrieve the corresponding result parameters, draw and display a simulation image according to the result parameters, enabling the user to obtain the changes in parameters during the simulation. At the same time, during the simulation process, after each step of the simulation ends, the simulation image will be updated according to the newly obtained data, thereby achieving real-time simulation.
[0087] In an exemplary embodiment of the present disclosure, after the operation of entering the next simulation step, the method further includes:
[0088] Performing simulation calculations according to the model to be simulated, the simulation parameters, and the interaction parameters, and obtaining calculation results;
[0089] Outputting the calculation results.
[0090] In the model simulation method provided in this embodiment, since the interaction parameters are obtained after the simulation calculations are completed in each step, in each step of the simulation process, the interaction parameters obtained in the previous step are used to participate in the current simulation calculation, thereby achieving real-time interactive simulation.
[0091] Sometimes, due to factors such as too long calculation time or network delay, the actual time taken for each step is longer than the time recorded by the real time, resulting in program lag or time asynchrony. To solve the impact of this problem on the simulation.
[0092] In an exemplary embodiment of the present disclosure, before the simulation program is started, the method further includes:
[0093] Obtain a delay duration y;
[0094] The displaying of the simulation image includes:
[0095] After the delay duration, start to display the simulation image;
[0096] Wherein, the delay duration y is calculated according to the historical delay record in the historical simulation record.
[0097] By the above method, the initial display time of the simulation image lags behind the real time. Therefore, even if there is a lag during the calculation process, it will not affect the real-time display of the simulation image. It only needs to be compatible with the delay duration each time the calculation duration is greater than the set duration. This makes the real-time simulation image display smoother. Using the historical delay record to calculate the delay duration can prevent the delay duration from being set too long or too short.
[0098] In an exemplary embodiment of the present disclosure, another solution to the above problem is provided, specifically: before the simulation program is started, the method further includes:
[0099] Obtain a delay duration y; the delay duration y is calculated according to the historical delay record in the historical simulation record;
[0100] The determining of the first duration t according to t = x - a - b includes:
[0101] Determine the first duration t according to t = x - a - b - y / n, where n is the total number of steps in this simulation.
[0102] By this method, during each step of the simulation, buffer time is reserved, and when there is no lag, the total buffered time is accumulated to be compatible with subsequent lag situations. By this method, when the simulation image is displayed, it is not necessary to wait too long at the beginning. This makes the simulation duration as synchronized with the real time as possible.
[0103] In this embodiment, the acquisition of the interaction parameters is implemented by an interaction component. The interaction component is established with Modelica and is a component used to read user operation inputs during the simulation. The user can operate on a control variable (control channel) with an interaction component. For example, in flight control, yaw control can be connected to the user input operation with an interaction component.
[0104] The main parameters of the interaction component are the control variable name, maximum value, minimum value, increment, increase control key, and decrease control key. The control variable name is used to identify the control channel information transmitted from the front end during simulation. The maximum and minimum values are used to limit the range of the control variable, and the increase and decrease control keys are used for identification by the front end, so that the front end can know which specific key should be used to control the variable.
[0105] The interaction component is written in Modelica language. By utilizing the feature that Modelica can embed C language, the function of front-end and back-end interaction is implemented in C language. The interaction component abstracts the user operation input into a parameter: the increment value or the decrement value.
[0106] The server receives the control information transmitted from the front end and sends the information to the simulation program through the socket. After receiving the interaction information, the socket temporarily records the message, and the content recorded is the increment value or the decrement value. During each iteration of the simulation program and when calling the service update, the currently recorded interaction information is superimposed on the variables of the simulation, and the new interaction data will be used for calculation in the next simulation iteration.
[0107] Since there is a large amount of idle time in each step of the simulation, the time occupied by the execution of the interaction component is only a very small part of the idle time and will not affect the real-time performance.
[0108] This embodiment is illustrated by taking the simulation case of a six-rotor UAV physical model as an example.
[0109] 1. Use the components in the UAV library and the real-time interaction library to establish a six-rotor UAV physical model, and reference the interaction component for modeling as the operation input data interface;
[0110] 2. Click "Simulate", and the simulation parameters will be displayed in the right sidebar;
[0111] 3. Modify the simulation parameters, select real-time simulation, set the real-time time, click the simulation button, and prepare to execute the simulation;
[0112] 4. Automatically jump to the result view. There is already a variable tree in the result visualization page, and there is a start / pause button above the main view during real-time simulation;
[0113] 5. Check the variable in the variable tree and then click "Start", and the real-time simulation data obtained from the server will be plotted as a two-dimensional curve on the interface;
[0114] 6. Or click the "Start" button first and then check the variable, and the real-time curve of the variable will be plotted in the main view;
[0115] 7. Input data from the keyboard during simulation and upload the data to the server in real time to participate in the simulation process;
[0116] 8. Click the pause button to pause the simulation. Click start again, and the simulation will continue from the paused time point.
[0117] According to one aspect of the present disclosure, a model simulation device is provided, including:
[0118] A first acquisition module for acquiring a model to be simulated and simulation parameters;
[0119] A second acquisition module for acquiring a step size parameter x input by a user; the step size parameter x is used to represent the set time of each step of the simulation;
[0120] A simulation module for, in response to a user starting a simulation program, sequentially performing each step of the simulation operation on the simulation model according to the model to be simulated, the simulation parameters, and the step size parameter x;
[0121] Wherein, the simulation module includes:
[0122] A calculation module for performing simulation calculations according to the model to be simulated and the simulation parameters, and obtaining calculation results;
[0123] An output module for outputting the calculation results;
[0124] A third acquisition module for acquiring interaction parameters;
[0125] A suspension module for suspending the simulation program for a first duration t;
[0126] An execution module for, after the first duration t ends, entering the next step of the simulation operation; the first duration t is obtained according to the step size parameter x.
[0127] In addition, although the steps of the methods in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.
[0128] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the methods according to the embodiments of the present disclosure.
[0129] In an exemplary embodiment of the present disclosure, there is also provided an electronic device capable of implementing the above method.
[0130] Those skilled in the art of the relevant technical field can understand that various aspects of the present invention can be implemented as a system, a method, or a program product. Therefore, various aspects of the present invention can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to herein as "circuit", "module", or "system".
[0131] An electronic device according to this embodiment of the present invention. The electronic device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0132] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor described above, the at least one storage, and a bus connecting different system components (including the storage and the processor).
[0133] Wherein, the storage stores program code, and the program code can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above "exemplary method" section of this specification.
[0134] The storage may include a readable medium in the form of a volatile storage, such as a random access storage (RAM) and / or a cache storage, and may further include a read-only storage (ROM).
[0135] The storage may also include a program / utility having a set (at least one) of program modules, and such program modules include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.
[0136] The bus may represent one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure in a variety of bus structures.
[0137] The electronic device can also communicate with one or more external devices (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device, and / or communicate with any device that enables the electronic device to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface. Moreover, the electronic device can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device through a bus. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0138] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or can be implemented by the way of software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0139] In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium, on which a program product capable of implementing the above method of this specification is stored. In some possible implementation manners, various aspects of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0140] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0141] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0142] The program code contained on the readable medium may be transmitted by any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0143] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0144] In addition, the above drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present invention, and are not for limiting purposes. It is easy to understand that the processes shown in the above drawings do not indicate or limit the time sequence of these processes. Additionally, it is also easy to understand that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0145] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0146] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A model simulation method, characterized in that, It includes the following steps: Obtain the model to be simulated and simulation parameters; Obtain the step size parameter x input by the user; The step size parameter x is used to represent the set time for each step of the simulation; In response to the user starting the simulation program, perform each step of the simulation operation on the simulation model in sequence according to the model to be simulated, the simulation parameters, and the step size parameter x; Among them, the simulation operation includes: Perform simulation calculations according to the model to be simulated and the simulation parameters, and obtain the calculation results; Output the calculation results; Obtain interaction parameters; Suspend the simulation program for the first duration t; After the first duration t ends, enter the next step of the simulation operation; the first duration t is obtained according to the step size parameter x; The method further includes: In response to the user's selection of display parameters; Obtain the result parameter corresponding to the display parameter from the calculation results; Draw a simulation image according to the result parameter; Display the simulation image; Before the simulation program is started, the method further includes: Obtain the delay duration y; The displaying the simulation image includes: Start displaying the simulation image after the delay duration; Among them, the delay duration y is calculated according to the historical delay record in the historical simulation record.
2. The model simulation method according to claim 1, wherein The first duration t is obtained according to the following steps: Obtain the time consumed for simulation calculation a; Obtain the time consumed for obtaining interaction parameters b; Determine the first duration t according to t = x - a - b.
3. The model simulation method according to claim 1, characterized in that During the process of displaying the simulation image, the method further includes: Obtain in real time the result parameter corresponding to the display parameter in the newly generated calculation results; Update the simulation image according to the newly obtained result parameter.
4. The model simulation method according to claim 2, wherein Before the simulation program is started, the method further includes: Obtain the delay duration y; the delay duration y is calculated according to the historical delay record in the historical simulation record; The determining the first duration t according to t = x - a - b includes: Determine the first duration t according to t = x - a - b - y / n, where n is the total number of steps of this simulation.
5. The model simulation method according to claim 1, wherein After entering the next step of the simulation operation, the method further includes: Perform simulation calculations according to the model to be simulated, the simulation parameters, and the interaction parameters, and obtain the calculation results; Output the calculation results.
6. An electronic device, characterized in that, It includes a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 5 by calling the program or instructions stored in the memory.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions, and the program or instructions cause the computer to execute the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Methods, systems, devices, and media for coupling computations and simulations
CN117077397A