CN116910910A - Model simulation method, device, equipment and medium - Google Patents

Model simulation method, device, equipment and medium Download PDF

Info

Publication number
CN116910910A
CN116910910A CN202310886115.4A CN202310886115A CN116910910A CN 116910910 A CN116910910 A CN 116910910A CN 202310886115 A CN202310886115 A CN 202310886115A CN 116910910 A CN116910910 A CN 116910910A
Authority
CN
China
Prior art keywords
model
simulation
simulated
scheduling
period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310886115.4A
Other languages
Chinese (zh)
Inventor
张蕊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Runke General Technology Co Ltd
Original Assignee
Beijing Runke General Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Runke General Technology Co Ltd filed Critical Beijing Runke General Technology Co Ltd
Priority to CN202310886115.4A priority Critical patent/CN116910910A/en
Publication of CN116910910A publication Critical patent/CN116910910A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/15Vehicle, aircraft or watercraft design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/02CAD in a network environment, e.g. collaborative CAD or distributed simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/20Configuration CAD, e.g. designing by assembling or positioning modules selected from libraries of predesigned modules
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Automation & Control Theory (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a model simulation method, a device, equipment and a medium, and relates to the technical field of simulation, wherein the method comprises the following steps: acquiring a scheduling signal; controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal; and obtaining simulation data of the model to be simulated in the running process. By the method, the scheduling of the model to be simulated is realized, and the variable step simulation of the model can be supported, so that the simulation time is reduced under the condition of obtaining the preset precision.

Description

Model simulation method, device, equipment and medium
Technical Field
The application relates to the technical field of simulation, in particular to a model simulation method, device, equipment and medium.
Background
In the field of semi-physical simulation, the system design of an aircraft needs to be evaluated and verified through joint simulation at different stages of the aircraft design. Because the complexity of the aircraft system is high, the verification of the aircraft model needs to relate to verification of simulation models in different fields, different complexity and different scenes, and the simulation models in different fields are integrated, so that system-level design, simulation and analysis are realized. And finally, verifying the multi-disciplinary multi-field multi-complexity model through a distributed collaborative simulation platform, and realizing the cross-linking of the model in a simulation environment and the real-time interaction among different simulation nodes.
At present, when simulation is carried out on a model, only fixed-step simulation is supported on the model, and when the simulation is carried out on the fixed-step simulation, the shorter the step of the fixed-step is, the higher the simulation precision is. However, when the fixed-step simulation is performed, the step cannot be changed, and when the state of the model is slowly changed, the step is too short, so that the model executes unnecessary time steps, and the simulation operation speed is slower.
Disclosure of Invention
The model simulation method, the device, the equipment and the medium provided by the application can reduce the simulation time under the condition of obtaining the preset precision.
In a first aspect, an embodiment of the present application provides a model simulation method, where the method includes:
acquiring a scheduling signal;
controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal;
and obtaining simulation data of the model to be simulated in the running process.
In a second aspect, the present application provides a model simulation apparatus, comprising:
the first acquisition module is used for acquiring the scheduling signals;
the scheduling module is used for controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signals;
and the second acquisition module is used for acquiring simulation data of the model to be simulated in the running process.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions;
the processor when executing the computer program instructions implements a model simulation method as in any one of the embodiments of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement a model simulation method as in any of the embodiments of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, instructions in which, when executed by a processor of an electronic device, cause the electronic device to perform a model simulation method implementing any one of the embodiments of the first aspect described above.
The method, the device, the equipment and the medium for model simulation in the embodiment of the application, wherein the method comprises the following steps: acquiring a scheduling signal; controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal; and obtaining simulation data of the model to be simulated in the running process. By acquiring the scheduling signal and controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulated time, the variable step length running mode of the model to be simulated is realized, and meanwhile, the model to be simulated can be scheduled. By obtaining the simulation data of the model to be simulated in the operation process, the data receiving and transmitting between the model to be simulated and the outside can be realized in the operation process of the model to be simulated, the variable step simulation of the model is realized together, and further, the simulation time can be reduced under the condition of obtaining the preset precision, and the precision and the operation time of the model to be simulated in the operation process are balanced.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings that are needed to be used in the embodiments of the present application will be briefly described, and it is possible for a person skilled in the art to obtain other drawings according to these drawings without inventive effort.
FIG. 1 is a schematic diagram of a frame structure of a model simulation apparatus according to an embodiment of the present application;
FIG. 2 is a flow chart of a model simulation method according to an embodiment of the present application;
FIG. 3 is an exemplary diagram of model scheduling of FIG. 3 in different simulation modes provided by one embodiment of the present application;
FIG. 4 is a schematic diagram of a model simulation device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
In order to solve the problems in the prior art, the embodiment of the application provides a model simulation method and a model simulation device.
The following describes a model simulation device provided by an embodiment of the present application.
FIG. 1 is a schematic diagram of a framework of a model simulation device according to an embodiment of the present application. The model simulation device comprises a simulation platform and a simulation interface 102, the simulation platform further comprising simulation management software 105, a main engine module 106 and at least one sub-engine module 101. The emulation interface 102 includes an input-output module 103 and a clock scheduling module 104. When there are a plurality of to-be-simulated models for collaborative simulation, the plurality of to-be-simulated models may be loaded to different simulation nodes, respectively, as shown in fig. 1, the simulation nodes include a main simulation node 10, at least one sub-simulation node 11, the simulation management software 105 and the main engine module 106 are disposed in the main simulation node 10, and only the sub-engine module 101 and the simulation interface 102 need to be disposed in the sub-simulation node 11.
The simulation management software 105 is upper computer software of a simulation test environment, provides a man-machine interaction interface for a user, builds a simulation model, and manages simulation experiments.
And the simulation interface 102 is used for realizing the adaptation of the sub-engine module 101 and the simulation model in the joint simulation process and completing the functions of data receiving and transmitting and model scheduling between the model and the simulation platform. The input/output module 103 is used for receiving and transmitting data, and the clock scheduling module 104 is used for model scheduling.
The sub-engine modules 101 are deployed at different simulation nodes 10, and are configured to receive the scheduling signals sent by the main engine module 106, so as to complete functions of clock scheduling, data transceiving and the like of the simulation model.
The main engine module 106 is a core control part of the system, and is configured to send the scheduling signal sent by the simulation management software 105 to the corresponding sub engine module 101, so as to implement scheduling management and status monitoring on all the models to be simulated.
The arrows in fig. 1 indicate the data interaction between the two through the DDS network. In the data interaction in the simulation process, the models need to perform data interaction with each other through a DDS (Data Distribution Service data distribution service) network. The simulation data of each simulation model also needs to be reported to the main engine module 106 through the sub engine module 101. After receiving the scheduling instruction of the main engine module 106 to the model, the sub engine module 101 schedules the model through respective mechanisms of different simulation models.
After the simulation model finishes calculation, simulation data are transmitted to the sub-engine module 101 through the simulation interface 102, and the sub-engine module 101 distributes the data to the DDS network according to the DDS ID distributed by the network configuration. The main engine module 106 acquires the simulation data sent by each sub engine module 101 in the DDS network in a subscription mode, and then completes the dispatching work according to different preset simulation modes.
Based on the above-mentioned model simulation device, the following first describes a model simulation method provided by the embodiment of the present application.
Fig. 2 is a flow chart of a model simulation method according to an embodiment of the present application. As shown in fig. 2, the method specifically may include the following steps:
step 201, obtaining a scheduling signal;
in step 201, in a specific implementation, the step may be specifically implemented by a simulation platform in the model simulation device, where simulation software is installed.
The scheduling signal is generated by the simulation platform and sent to the simulation interface for triggering the simulation interface to schedule the model to be simulated. In the generating process, the generating can be specifically performed according to a simulation mode corresponding to the scheduling signal, wherein the simulation mode comprises a non-real-time simulation mode and a soft real-time simulation mode. For a specific generation process, please refer to the following examples.
Step 202, controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal;
in step 202, in particular, this step may be implemented by a simulation interface in a model simulation device, where the simulation interface is installed in a model to be simulated. The simulation interface comprises a clock scheduling module and an input/output module, and when receiving scheduling signals in the simulation platform, the clock scheduling module is specifically used for setting a signal quantity for receiving, wherein the signal quantity is a mechanism for realizing signal communication between the simulation interface and the simulation platform and is used for preventing the simulation interface from simultaneously receiving a plurality of scheduling signals sent by the simulation platform, so that the problem of scheduling confusion is caused. The scheduling signal is used for triggering the simulation interface to schedule the model to be simulated to run.
When the running times are determined, the running times can be counted by setting a signal count value in the clock scheduling module, specifically, the signal count value is set to 0 before model simulation is carried out, after the clock scheduling module receives a scheduling signal sent by the simulation platform, the signal count value is accumulated to obtain an accumulated value, and the accumulated value is the running times.
After the scheduling signal is acquired, the time to be simulated is controlled to run in a variable step size mode. The model period refers to the period between each scheduling of the model to be simulated by the simulation platform. The current simulation time refers to the current time reached when the model to be simulated is running. The cumulative time refers to the time required for the model to be simulated to run. Specifically, the time period can be determined by the number of times of the current received scheduling signal, for example, the model period is 10s, the number of times of the current received scheduling signal is 2, and the accumulated time is 20s. The model period is 10s, the number of times of the currently received scheduling signal is 3, and the accumulation time is 30s.
And when the current simulation time is smaller than the accumulated time, indicating that the model to be simulated is not operated, and continuing to operate in a variable step length mode. And when the current simulation time is longer than the accumulated time, the model to be simulated is stopped, and the simulation platform is waited to send a next scheduling signal to enter the next round of scheduling process.
In addition, in addition to controlling the model to be simulated to run in a variable step-size manner, the model to be simulated may also be run in a fixed step-size manner. And furthermore, the simulation interface can simultaneously meet the running modes of fixed-step simulation and variable-step simulation, and the application range of the simulation interface is enlarged.
And 203, obtaining simulation data of the model to be simulated in the running process.
In step 203, in particular, this step may be implemented by an input/output module in the simulation interface. The simulation data comprise single-step simulation calculation results and model running state data, wherein the single-step simulation calculation results refer to data calculated by running a model to be simulated in each step. The operation state data includes state data of normal operation, abnormal operation, suspended operation, and the like. And after each operation of the model to be simulated is finished, generating simulation data. After the simulation data is generated by the model to be simulated, the simulation data is sent to the simulation platform through the input/output module, so that data receiving and transmitting of the model to be simulated are realized.
In the process of acquiring simulation data, whether to transmit and receive the simulation data between the to-be-simulated model and the simulation platform can be determined by setting an accumulated count value in the input/output module, specifically, the accumulated count value is updated after each simulation operation is performed, the input/output module acquires the simulation data after detecting that the accumulated count value changes, and data transmission and reception between the to-be-simulated model and the simulation platform are performed.
In this embodiment, the model simulation method includes: acquiring a scheduling signal; controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal; and obtaining simulation data of the model to be simulated in the running process. By acquiring the scheduling signal and controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulated time, the variable step length running mode of the model to be simulated is realized, and meanwhile, the model to be simulated can be scheduled. By obtaining the simulation data of the model to be simulated in the operation process, the data receiving and transmitting between the model to be simulated and the outside can be realized in the operation process of the model to be simulated, the variable step simulation of the model is realized together, and further, the simulation time can be reduced under the condition of obtaining the preset precision, and the precision and the operation time of the model to be simulated in the operation process are balanced.
In one embodiment of the present application, before the acquiring the scheduling signal, the method further includes:
configuring a plurality of simulation modes;
selecting a target simulation mode from the plurality of simulation modes;
the acquiring the scheduling signal includes:
and generating a scheduling signal according to the target simulation mode.
The simulation modes comprise a non-real-time simulation mode and a soft real-time simulation mode, and can be configured in the simulation platform when the simulation mode is configured, wherein the non-real-time simulation mode is a simulation mode which is as fast as possible. Once the input data required by the model to be emulated is ready (i.e., data ready state), the model is scheduled to enter the next solution state. Soft real-time simulation is a simulation mode in which the simulation process is as consistent as possible with the actual period process in a non-real-time environment, wherein the actual period refers to the actual simulation time in a real physical scene.
When the target simulation mode is selected, the simulation mode can be determined according to the speed of the model simulation time, and particularly, when the model simulation time is faster than the real time, soft real-time and non-real-time simulation can be used for ensuring synchronization; when the model simulation time is slower than the real time, non-real time simulation is used.
In one embodiment of the present application, the generating a scheduling signal according to the target simulation mode includes:
generating the scheduling signal according to the model period under the condition that the target simulation mode is a non-real-time simulation mode;
and generating a scheduling signal according to an actual period when the preset simulation mode is a soft real-time simulation mode, wherein the actual period is a period of equipment corresponding to the to-be-simulated model in actual operation.
And under the condition that the target simulation mode is a non-real-time simulation mode, after each operation of the model is finished, an operation finishing signal is sent to the simulation platform, and after the simulation platform receives the operation finishing signal, a scheduling signal is generated. Since the model ends after running for one model period, the scheduling signal is generated according to the model period in the non-real-time simulation mode.
And generating a scheduling signal according to an actual period in actual operation set in the simulation platform under the condition that the target simulation mode is a soft real-time simulation mode. Even after the model is operated, if the real-time period is not reached, a scheduling signal is not generated. The actual period refers to the period that the equipment corresponding to the model to be simulated operates in the actual physical scene.
In an embodiment of the present application, the generating the scheduling signal according to the model period includes:
after the model to be simulated is operated based on a scheduling signal last time, generating the scheduling signal according to the model period;
the generating a scheduling signal according to the actual period includes:
and generating the scheduling signal according to the actual period after the last actual period is over.
In this embodiment, when the model to be simulated is scheduled for multiple times, if the simulation mode is non-real-time simulation, the scheduling signal may be generated after the last model to be simulated is scheduled, that is, a model period has elapsed. For example, the model period is 10s, and when the model is completed after 10s, the scheduling signal is generated immediately.
If the mode to be simulated is a soft real-time simulation mode, generating a scheduling signal according to the actual period after the last actual period is finished. For example, the actual period is 10S, and the running time of the model to be simulated is 8S, so that after the model to be simulated is finished running, the scheduling signal is regenerated after 2S.
In this embodiment, the scheduling signals are generated through different simulation modes, so that unified scheduling of the models to be simulated is satisfied, and synchronous simulation of a plurality of models to be simulated is realized.
In yet another embodiment of the present application, before the acquiring the scheduling signal, the method further includes:
constructing a model to be simulated, and configuring a model period and a maximum step length, wherein the maximum step length is smaller than or equal to the model period;
the controlling the model to be simulated to run in a variable step length mode comprises the following steps:
and controlling the model to be simulated to run in a variable step length mode which is smaller than or equal to the maximum step length.
When the model to be simulated is constructed, a model period of the model to be simulated and a maximum step length are required to be configured, wherein the maximum step length refers to the maximum step length which can be changed in the running process of the model, and the maximum step length is required to be set as the model period so as to prevent the running time of the model to be simulated from exceeding the model period and causing the occurrence of simulation failure. In addition, it should be noted that, when the model to be simulated is simulated in a fixed step, the step is fixed, so that the maximum step is not required to be set, and only the model period is required to be set.
In the running process of the model to be simulated, the model to be simulated needs to be kept to run in a variable step mode without exceeding the maximum step. During the simulation operation, the model was solved at regular time intervals in a period from the start of the simulation to the end of the simulation. Wherein the size of the interval is called the step size. In general, reducing the step size will increase the accuracy of the simulation results, but will increase the time required for system simulation. When the simulation is performed in a step-variable manner, the step-size is changed during the simulation. When the model state changes rapidly, the step length is reduced to improve the accuracy; when the model state changes slowly, the step size is increased to avoid performing unnecessary time steps. Calculating step sizes increases the computational overhead per step size, but may reduce the total number of time steps required to maintain a specified level of accuracy for models with rapidly changing states or piecewise continuous states, thereby reducing simulation time. In this embodiment, the correct simulation of the model to be simulated is ensured by setting the maximum step length and the model period of the model to be simulated.
In an embodiment of the present application, the scheduling signal includes a first scheduling sub-signal and a second scheduling sub-signal;
and controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulated time, wherein the method comprises the following steps of:
under the condition that the current simulation time is smaller than a first accumulation time, controlling a first model to be simulated to run in a variable step length mode, wherein the first accumulation time is determined according to a preset first model period and the number of times of currently receiving the first scheduling sub-signal;
and under the condition that the current simulation time is smaller than a second accumulation time, if the first model period is larger than or equal to N times of the second model period, controlling the second model to be simulated to run for N times in a variable step length mode, wherein the second accumulation time is determined according to the preset second model period and the current times of receiving the second scheduling sub-signal, and N is an integer larger than 1.
In this embodiment, when collaborative simulation of multiple models is performed, the simulation platform needs to send multiple different scheduling signals to different simulation interfaces to control different models to be simulated to run. Thus, for example, when there are two or more models to be simulated, the scheduling signal includes a first scheduling sub-signal and a second scheduling sub-signal, the models to be simulated include a first model to be simulated and a second model to be simulated, and a first accumulation time corresponding to the first model to be simulated and a second accumulation time corresponding to the second model to be simulated. For the determination of the first accumulation time and the second accumulation time, please refer to the above embodiment, and the description of the present application is omitted.
And under the condition that the current simulation time is smaller than the second accumulation time, if the first model period is larger than or equal to N times of the second model period, the second model to be simulated can be operated for N times in the operation process of the first model to be simulated, and the second model to be simulated is controlled to be operated for N times.
In an embodiment of the present application, the controlling the second model to be simulated to run N times in a variable step manner includes:
determining N consecutive sub-periods, or N non-consecutive sub-periods, within the first model period;
and in each subcycle, controlling the second model to be simulated in a variable step-size manner.
Because the simulation modes are divided into a non-real-time simulation mode and a soft real-time simulation mode, in the process of running the second model to be simulated for N times, the triggering of the scheduling signals of different simulation modes is also required to be followed.
In the non-real-time simulation mode, the next scheduling is triggered immediately after the second model to be simulated is operated, which means that the scheduling of the second model to be simulated is continuous, therefore, the period of the first model can be divided into N subcycles, and the operation of the second model to be simulated is completed once in each subcycle.
In the soft real-time simulation mode, the next scheduling is not triggered immediately after the second model to be simulated is operated, and the time point of the next scheduling needs to be waited for, so that the period of the first model can be divided into N discontinuous subcycles, and the operation of the second model to be simulated is completed once in each subcycle.
For example, referring to fig. 3, fig. 3 is a diagram illustrating scheduling of a plurality of models in two simulation modes, wherein a square corresponding to the a model represents a second model period of the a model, and a square between two dotted lines represents a sub-period of the a model. The square corresponding to the B model represents the first model period of the B model. The dashed line represents the simulation platform scheduling a single model, and the solid line represents the platform scheduling all models.
When the first model period of the B model is 3 times that of the A model in non-real-time simulation, the simulation platform schedules A, B models to run simultaneously, the A model runs continuously for 3 times, the B model runs once, and the next scheduling is executed after A, B is run.
In soft real-time simulation, after the operation is completed, the model A and the model B do not immediately perform the next operation, but complete the next operation according to the actual period.
In this embodiment, under the condition of co-simulation of multiple models to be simulated, by scheduling different models to be simulated separately, synchronous simulation of all models to be simulated can be completed in one scheduling, and efficiency in a simulation process is improved.
Fig. 4 is a schematic structural diagram of a model simulation device according to an embodiment of the present application, and for convenience of explanation, only a portion related to the embodiment of the present application is shown.
Referring to fig. 4, the model simulation apparatus 400 may include:
a first obtaining module 401, configured to obtain a scheduling signal;
a scheduling module 402, configured to control the model to be simulated to run in a variable step size manner if the current simulation time is less than an accumulation time, where the accumulation time is determined according to a preset model period and the number of times the scheduling signal is currently received;
a second obtaining module 403, configured to obtain simulation data of the model to be simulated in a running process.
Optionally, the model simulation apparatus 400 further includes:
the configuration module is used for configuring a plurality of simulation modes;
the selecting module is used for selecting one target simulation mode from the plurality of simulation modes;
the acquiring the scheduling signal includes:
and generating a scheduling signal according to the target simulation mode.
Optionally, the first obtaining module 401 includes
The first signal module is used for generating the scheduling signal according to the model period under the condition that the target simulation mode is a non-real-time simulation mode;
and the second signal module is used for generating a scheduling signal according to an actual period when the preset simulation mode is a soft real-time simulation mode, wherein the actual period is the period of equipment corresponding to the to-be-simulated model in actual operation.
Optionally, the first signal module is specifically configured to:
after the fact that the model to be simulated runs based on a scheduling signal last time is monitored, generating the scheduling signal according to the model period;
the generating a scheduling signal according to the actual period includes:
and generating the scheduling signal according to the actual period after the last actual period is over.
Optionally, the model simulation apparatus 400 further includes:
the building module is used for building a model to be simulated, and configuring a model period and a maximum step length, wherein the maximum step length is smaller than or equal to the model period;
the controlling the model to be simulated to run in a variable step length mode comprises the following steps:
and controlling the model to be simulated to run in a variable step length mode which is smaller than or equal to the maximum step length.
Optionally, the scheduling module 402 includes;
the first scheduling module is used for controlling the first model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than a first accumulation time, wherein the first accumulation time is determined according to a preset first model period and the number of times of currently receiving the first scheduling sub-signal;
the second scheduling module is configured to control the second model to be simulated to run N times in a variable step size manner if the current simulation time is less than a second accumulation time and the first model period is greater than or equal to N times the second model period, where the second accumulation time is determined according to a preset second model period and the number of times the second scheduling sub-signal is currently received, and N is an integer greater than 1.
Optionally, the second scheduling module is specifically configured to:
determining N continuous subcycles or N discontinuous subcycles within the first model period;
and in each subcycle, controlling the second model to be simulated to run for N times in a variable step-length mode.
The model simulation device 400 provided in the embodiment of the present application can implement each process implemented by the foregoing method embodiment, and in order to avoid repetition, details are not repeated here.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 5 shows a schematic hardware structure of an electronic device according to an embodiment of the present application.
The device may include a processor 501 and a memory 502 in which program instructions are stored.
The steps of any of the various method embodiments described above are implemented when the processor 501 executes a program.
By way of example, a program may be partitioned into one or more modules/units that are stored in the memory 502 and executed by the processor 501 to accomplish the present application. One or more of the modules/units may be a series of program instruction segments capable of performing specific functions to describe the execution of the program in the device.
In particular, the processor 501 may include a Central Processing Unit (CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured as one or more integrated circuits that implement embodiments of the present application.
Memory 502 may include mass storage for data or instructions. By way of example, and not limitation, memory 502 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. Memory 502 may include removable or non-removable (or fixed) media, where appropriate. Memory 502 may be internal or external to the integrated gateway disaster recovery device, where appropriate. In a particular embodiment, the memory 502 is a non-volatile solid state memory.
The memory may include Read Only Memory (ROM), random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical/tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform the operations described with reference to methods in accordance with aspects of the present disclosure.
The processor 501 implements any one of the methods of the above embodiments by reading and executing program instructions stored in the memory 502.
In one example, the electronic device may also include a communication interface 503 and a bus 310. The processor 501, the memory 502, and the communication interface 503 are connected to each other via the bus 310 and perform communication with each other.
The communication interface 503 is mainly used to implement communication between each module, apparatus, unit and/or device in the embodiments of the present application.
Bus 310 includes hardware, software, or both that couple the components of the online data flow billing device to each other. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. Bus 310 may include one or more buses, where appropriate. Although embodiments of the application have been described and illustrated with respect to a particular bus, the application contemplates any suitable bus or interconnect.
In addition, in combination with the method in the above embodiment, the embodiment of the present application may be implemented by providing a storage medium. The storage medium has program instructions stored thereon; the program instructions, when executed by a processor, implement any of the methods of the embodiments described above.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the embodiment of the method can be realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the above method embodiments, and achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
It should be understood that the application is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer grids such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present application are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present application is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present application, and they should be included in the scope of the present application.

Claims (10)

1. A method of model simulation, the method comprising:
acquiring a scheduling signal;
controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signal;
and obtaining simulation data of the model to be simulated in the running process.
2. The model simulation method of claim 1, wherein prior to the acquiring the scheduling signal, the method further comprises:
configuring a plurality of simulation modes;
selecting a target simulation mode from the plurality of simulation modes;
the acquiring the scheduling signal includes:
and generating a scheduling signal according to the target simulation mode.
3. The model simulation method of claim 2, wherein the target simulation mode includes a non-real-time simulation mode and a soft real-time simulation mode;
the generating a scheduling signal according to the target simulation mode comprises the following steps:
generating the scheduling signal according to the model period under the condition that the target simulation mode is a non-real-time simulation mode;
and generating a scheduling signal according to an actual period when the preset simulation mode is a soft real-time simulation mode, wherein the actual period is a period of equipment corresponding to the to-be-simulated model in actual operation.
4. The model simulation method of claim 3, wherein the generating the scheduling signal according to the model period comprises:
after the fact that the model to be simulated runs based on a scheduling signal last time is monitored, generating the scheduling signal according to the model period;
the generating a scheduling signal according to the actual period includes:
and generating the scheduling signal according to the actual period after the last actual period is over.
5. The model simulation method of claim 1, wherein prior to the acquiring the scheduling signal, the method further comprises:
constructing a model to be simulated, and configuring a model period and a maximum step length, wherein the maximum step length is smaller than or equal to the model period;
the controlling the model to be simulated to run in a variable step length mode comprises the following steps:
and controlling the model to be simulated to run in a variable step length mode which is smaller than or equal to the maximum step length.
6. The model simulation method of claim 1, wherein the scheduling signal comprises a first scheduling sub-signal and a second scheduling sub-signal;
and controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulated time, wherein the method comprises the following steps of:
under the condition that the current simulation time is smaller than a first accumulation time, controlling a first model to be simulated to run in a variable step length mode, wherein the first accumulation time is determined according to a preset first model period and the number of times of currently receiving the first scheduling sub-signal;
and under the condition that the current simulation time is smaller than a second accumulation time, if the first model period is larger than or equal to N times of the second model period, controlling the second model to be simulated to run for N times in a variable step length mode, wherein the second accumulation time is determined according to the preset second model period and the current times of receiving the second scheduling sub-signal, and N is an integer larger than 1.
7. The model simulation method of claim 6, wherein controlling the second model to be simulated to run N times in a variable step-size manner comprises:
determining N continuous subcycles or N discontinuous subcycles within the first model period;
and in each subcycle, controlling the second model to be simulated to run for N times in a variable step-length mode.
8. A model simulation apparatus, comprising:
the first acquisition module is used for acquiring the scheduling signals;
the scheduling module is used for controlling the model to be simulated to run in a variable step length mode under the condition that the current simulation time is smaller than the accumulation time, wherein the accumulation time is determined according to a preset model period and the current times of receiving the scheduling signals;
and the second acquisition module is used for acquiring simulation data of the model to be simulated in the running process.
9. An electronic device, the device comprising: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the model simulation method according to any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer program instructions, which when executed by a processor, implement the model simulation method according to any of claims 1-7.
CN202310886115.4A 2023-07-18 2023-07-18 Model simulation method, device, equipment and medium Pending CN116910910A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310886115.4A CN116910910A (en) 2023-07-18 2023-07-18 Model simulation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310886115.4A CN116910910A (en) 2023-07-18 2023-07-18 Model simulation method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116910910A true CN116910910A (en) 2023-10-20

Family

ID=88356106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310886115.4A Pending CN116910910A (en) 2023-07-18 2023-07-18 Model simulation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116910910A (en)

Similar Documents

Publication Publication Date Title
US20150046742A1 (en) Data processing system
CN107329774A (en) The method and apparatus for determining Redriver chip parameters
CN103472735A (en) Automatic testing system of avionics system
CN104321716B (en) Use device idle duration information optimizes energy efficiency
CN104331282A (en) Reconfigurable comprehensive development and test system of wireless product
CN103618588A (en) Automatic Baud rate detection method and detection module
CN111064449A (en) Digital down-sampling filter verification platform and method based on UVM platform
CN114896166A (en) Scene library construction method and device, electronic equipment and storage medium
CN114117973A (en) Logic synthesis method, device and storage medium
CN109375146B (en) Supplementary collection method and system for electricity consumption data and terminal equipment
US11163579B2 (en) Instruction generation based on selection or non-selection of a special command
US5960188A (en) Method for modeling electrical interconnections in a cycle based simulator
CN116910910A (en) Model simulation method, device, equipment and medium
CN109446740A (en) A kind of system on chip framework performance emulation platform
CN106708431A (en) Data storage method, data storage device, mainframe equipment and storage equipment
CN115567448A (en) Flow control method, flow control device, flow control apparatus, flow control medium, and program product
CN116087752A (en) Chip testing method, system, device and medium
CN115391158A (en) Time delay determination method, system and device and electronic equipment
CN113821076A (en) Virtual simulation system and synchronization method based on virtual clock
Kim et al. System-level development and verification of the FlexRay communication controller model based on SystemC
Nielsen et al. Markov chain-based performance evaluation of FlexRay dynamic segment
CN117998463A (en) Data processing method, device, equipment, medium and vehicle
CN115250251B (en) Transmission path planning method and device in network-on-chip simulation, electronic equipment and computer readable storage medium
CN116450306A (en) Task scheduling method, device, equipment, storage medium and product
CN115529623B (en) Baseband unit testing device and method, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination