CN113110114A - Scheduling method and device for super real-time joint simulation - Google Patents
Scheduling method and device for super real-time joint simulation Download PDFInfo
- Publication number
- CN113110114A CN113110114A CN202110566841.9A CN202110566841A CN113110114A CN 113110114 A CN113110114 A CN 113110114A CN 202110566841 A CN202110566841 A CN 202110566841A CN 113110114 A CN113110114 A CN 113110114A
- Authority
- CN
- China
- Prior art keywords
- model
- registered
- token
- state
- time
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B17/00—Systems involving the use of models or simulators of said systems
- G05B17/02—Systems involving the use of models or simulators of said systems electric
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a scheduling method and a device for super real-time joint simulation, wherein the method comprises the following steps: when joint simulation is carried out, the scheduling system times each model, the natural time accumulation is adopted, and when the token state of the registered model reached by the next step length is detected to be a sent state, the natural time accumulation is stopped, and the registered model which is not solved in the registered model reached by the next step length is waited to complete the calculation. Therefore, the unification of the physical time of each model of the joint simulation is ensured, so that the logic of the joint simulation is not disordered, the simulation progress is accelerated, and the simulation efficiency is improved.
Description
Technical Field
The invention relates to the technical field of electronic system design and simulation verification, in particular to a scheduling method and device for super real-time joint simulation.
Background
At present, in the design of electronic systems, each subsystem is independently subjected to mathematical modeling. Taking an airplane electronic system as an example, a mathematical model of each device is established according to future airplane electronic system division (avionics, control, electromechanics and the like). And then carrying out model verification, wherein during model verification, the majority uses logic solution of a modeling tool to carry out super real-time simulation. In the joint simulation stage, each model is downloaded to a real-time simulator, each model is resolved in real time according to physical time, and simulation is performed according to respective time sequence in the running process of the models.
Therefore, in the joint simulation stage, because real-time solution is performed, all verification must depend on physical time, so that the simulation progress is slow, and the verification time is long. For example, if an airplane is tested for one hour of flight, each model must be run for one hour of physical time to verify completion. In addition, if each model is subjected to super real-time joint simulation, due to different logic complexity of each model and different resolving time consumption, physical time in each model is not uniform, and logic confusion is caused by joint simulation.
Therefore, how to solve the problem of too low running speed of real-time simulation during simulation and the problem of non-uniform physical time of each model during super real-time combined simulation are problems to be solved urgently.
Disclosure of Invention
In view of the above, the present invention provides a scheduling method and apparatus for super real-time joint simulation, in which a super real-time joint simulation token scheduling system based on a shared memory performs natural accumulation of time without depending on physical time through a super real-time calculation engine, so as to ensure simulation efficiency, and ensure that physical time of each model is uniform through a uniform token scheduling policy.
The invention provides a scheduling method of super real-time joint simulation, which comprises the following steps:
establishing a corresponding relation between each registered model and each token required by simulation;
sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation and set the token states of the tokens to be sent states;
when each registered model carries out step length calculation, natural accumulation of time is carried out;
setting the token state of the registered model for handing over the token to be a recovered state; the registered model is handed over to the token after the calculation is completed;
when time naturally accumulates until the next step size of one or more registered models is reached, detecting the token state of the registered model of which the next step size is reached;
and if the token state of the registered model which has reached the next step length is detected to be a sent state, stopping the natural accumulation of time, and waiting for the registered model which has not been solved in the registered model which has reached the next step length to complete the calculation.
Optionally, the method further includes:
and if the token states of the registered models reached by the next step length are all recovered states, continuing to perform natural time accumulation, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
Optionally, the method further includes:
starting a timer of the registered model which is not solved for completion to time; wherein a registered model is provided with a timer;
setting the corresponding model state as a destroyed state for the registered model which does not pass the token within the corresponding preset timeout duration in the registered models which are not solved; one registered model corresponds to a preset timeout duration;
and when the registered model with the next step size is in the recovered state and the model state is in the destroyed state, continuing to perform time natural accumulation on the target registered model with the token state of the registered model with the next step size being in the recovered state, and sending a token to the target registered model based on the corresponding relation so as to solve the step size of the target registered model and set the target registered model to be in the sent state.
Optionally, for a registered model for which a token is not handed over within a corresponding preset timeout period in the unresolved registered models, setting a corresponding model state as a destroyed state, including:
recording one time of overtime for the registered model which does not pass the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and determining the unresolved registered model with the overtime times reaching the preset overtime times as a registered model which does not pass tokens within the corresponding preset overtime duration in the unresolved registered model, and setting the corresponding model state as a destroyed state.
Optionally, the method further includes:
and setting corresponding preset timeout times based on the resolving time and the destruction probability of each registered model.
The embodiment of the invention discloses a scheduling device for super real-time joint simulation, which comprises:
the establishing module is used for establishing the corresponding relation between each registered model and each token required by simulation;
the sending module is used for sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation and set the token states of the tokens to be sent states;
the first time natural accumulation module is used for performing time natural accumulation when each registered model performs step length calculation;
the first setting module is used for setting the token state of the registered model for handing over the token to be a recovered state; the registered model is handed over to the token after the calculation is completed;
the detection module is used for detecting the token state of the registered model reached by the next step length when the time is naturally accumulated to the next step length reached by one or more registered models;
and the execution waiting module is used for stopping time natural accumulation if the token state of the registered model which reaches the next step length is detected to be a sent state, and waiting for the registered model which is not solved in the registered model which reaches the next step length to complete resolving.
Optionally, the method further includes:
a second temporal natural accumulation module to: and if the token states of the registered models reached by the next step length are all recovered states, continuing to perform natural time accumulation, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
Optionally, the method further includes:
the first timer starting module is used for starting the timer of the registered model which is not solved for timing; wherein a registered model is provided with a timer;
the second setting module is used for setting the corresponding model state as a destroyed state for the registered model which does not submit the token within the corresponding preset timeout duration in the unresolved registered models; one registered model corresponds to a preset timeout duration;
and the third time natural accumulation module is used for continuously performing time natural accumulation on the target registered model of which the token state of the registered model reached by the next step length is the recovered state and the destroyed state when the registered model reached by the next step length has the token state which is the recovered state, and sending a token to the target registered model based on the corresponding relation so as to solve the step length of the target registered model and set the target registered model to be the sent state.
Optionally, the second setting module includes:
the second timer starting submodule is used for recording one time of overtime for the registered model which does not give up the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and the second setting submodule is used for determining the unresolved registered model with the overtime times reaching the preset overtime times as the registered model which does not submit the token within the corresponding preset overtime length in the unresolved registered model, and setting the corresponding model state as the destroyed state.
Optionally, the method further includes:
and the overtime frequency setting module is used for setting corresponding preset overtime frequency based on the resolving time and the destruction probability of each registered model.
In summary, the invention discloses a scheduling method and a scheduling device for super real-time joint simulation, when joint simulation is performed, a scheduling system times each model, and natural time accumulation is adopted, and when it is detected that the token state of the registered model reached by the next step is a sent state, the time natural accumulation is stopped, and the registered model which is not solved and is not solved in the registered model reached by the next step is waited to complete resolving. Therefore, the unification of the physical time of each model of the joint simulation is ensured, so that the logic of the joint simulation is not disordered, the simulation progress is accelerated, and the simulation efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a scheduling method of super real-time joint simulation according to embodiment 1 of the present invention;
FIG. 2 is a flowchart of a scheduling method of super real-time joint simulation according to embodiment 2 of the present invention;
FIG. 3 is a flowchart of a scheduling method of super real-time joint simulation according to embodiment 3 of the present invention;
fig. 4 is a schematic structural diagram of a scheduling apparatus in super real-time joint simulation according to embodiment 1 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, which is a flowchart of a scheduling method of super real-time joint simulation in embodiment 1 of the present invention, the method may include the following steps:
s101: and establishing corresponding relations between each registered model and each token required by simulation.
For ease of understanding, the concept of super real-time is first explained. To simulate a scene, the relevant models need to synchronously reach the corresponding state required by the scene, but the running time of each model is different due to different running complexity of each model, so that the model which runs fast is required to wait for the model which runs relatively slowly to complete the simulation of the scene. This results in the time required to complete the scene simulation being different from the real physical time, beyond which it is called super real-time. It should be noted that: the time required for simulation may be shorter than the actual physical time or longer than the actual physical time, depending on the running time of the model simulating the actual scene. If the physical time of a scene is short, but the model for simulating the scene is complex and the running time is long, the simulation time is longer than the real physical time. Conversely, if a certain physical time is long, but the model for simulating the scene is simple and the running time is short, a situation occurs in which the simulation time is shorter than the real physical time.
When scheduling of super real-time joint simulation is needed, firstly, a model required by simulation is registered by using a shared memory, then, token information is initialized, and a corresponding relation between each token and a registered model is established. In order to facilitate searching the token, each token information may further include an index number of the token in the shared memory. Each token information also includes a token state of the token. For example, when the models required for simulation are: and respectively establishing one-to-one correspondence of the model A, the model B, the model C and the model D with each token when the model A, the model B, the model C and the model D are used.
S102: and sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation, and setting the token state of each token to be a sent state.
In this embodiment, the token state of each token may include: unsent, sent, and recycled, wherein the state of the token is indicated as unsent before the token is sent; when the model is in the resolving state, the token state is sent; when the model has completed resolving and handed the token over correctly, the token indicates that it has been reclaimed.
And the corresponding relation is the above-mentioned corresponding relation between the registered model and the token, and the token is sent to the corresponding registered model based on the corresponding relation so that the registered model carries out step length calculation and the token state is set to be sent.
In this embodiment, the token information may further include a process number of the registered model. The scheduling system inquires the process information according to the process number and sends the scheduling information to the designated model through the process number.
After the corresponding relationship between each registered model and each token required by the simulation is established, further, tokens can be sent to all registered models required by the simulation according to the process numbers in the corresponding relationship, and the state of each token is set to be a sent state. In this embodiment, after the registered model receives the token, the step length calculation is performed.
S103: and when each registered model carries out step length calculation, carrying out time natural accumulation.
And when each registered model carries out step length calculation, the time natural accumulation is carried out without depending on physical time.
Wherein, the time natural accumulation means: the time value is accumulated by taking the step length as 1, the accumulation speed is related to the calculation force of the calculation equipment for performing time natural accumulation, the larger the calculation force is, the faster the accumulation speed is, and the time value of the time natural accumulation is considered by the computer. Generally, the time value of the time natural accumulation is much faster than the physical time, for example, the 3.0GHz processing is taken as an example, the microsecond is taken as a step, the accumulation is 300 hours, and only about 1 second is needed.
S104: setting the token state of the registered model for handing over the token to be a recovered state; wherein, the registered model submits the token after the resolving is completed.
As can be seen from the above description, the recycling status of the token includes a recycled status, and the recycled status represents: the registered model completes the solution and hands the token up. Then, in the process of performing step size solution on each registered model, when there is a registered model that has completed the solution, the token state of the registered model that has completed the solution is set as the recovered state, for example, in the process of the solution, when the solution of the model a is completed and the token is handed over, the token state of the model a is set from the sent state to the recovered state.
S105: when time naturally accumulates until the next step size has been reached for one or several of the registered models, the token state of the registered model for which the next step size has been reached is detected.
S106: and if the token state of the registered model reached by the next step length is detected to be a sent state, stopping the natural accumulation of time, and waiting for the registered model which is not solved and is completely solved in the registered model reached by the next step length to complete the calculation.
In this embodiment, after the registered model receives the token, the token is solved, and the time is naturally accumulated, and when the accumulated time duration is one step length of one or more registered models, that is, the natural time is accumulated until the next step length of one or more registered models is reached, the token state of the registered model, at which the next step length is reached, is detected. In this embodiment, in a certain scenario, the step lengths required by different registered models are different, and the resolving time is different due to different model resolving complexities, so that when time is naturally added to the next step length of one or more registered models, the resolving states of the registered models are different, that is, the token states of the registered models are different. For registered models with short solution times, the token state may be recycled, and for longer solution times, the token state may be sent.
For example, the following steps are carried out: for example, for simulating a certain scene, four models are needed, namely a model A, a model B, a model C and a model D, and the models A and B are needed to take 100 μ s as a step length, the model C takes 200 μ s as a step length, and the model D takes 500 μ s as a step length, wherein the resolving time of the model A is 30 μ s, the resolving time of the model B is 115 μ s, the resolving time of the model C is 50 μ s, and the resolving time of the model D is 100 μ s. In the specific simulation, firstly, the four models complete registration by using the shared memory, and when the scheduling system recognizes that the four models are registered through the shared memory, the scheduling system sends tokens to the four models, and sets the token states of the four models to be sent. And meanwhile, a timing system of the scheduling system carries out time natural accumulation, the A model is solved in 30 mu s, when the time accumulation reaches 100 mu s, the next step length of the model A and the model B is reached, the token states of the model A and the model B are detected, the B model is still in the process of resolving, the scheduling system detects the token states of the model A and the model B, the token state of the model A is detected to be recovered, the state of the model B is still transmitted, and the time natural accumulation is stopped at the moment.
In summary, in the above embodiment, when super real-time joint simulation scheduling is required, first, a corresponding relationship between each registered model and each token required for simulation is established, then, the token is sent to each registered model based on the corresponding relationship, and the state of each token is set to be a sent state; when each registered model carries out step length calculation, natural accumulation of time is carried out; in the process of carrying out step length calculation on each registered model, when the registered model is calculated, setting the state of the token of the registered model which is calculated to be a recovered state; when time naturally accumulates until the next step size of one or more registered models is reached, detecting the token state of the registered model of which the next step size is reached; and if the token state of the registered model which has reached the next step length is detected to be a sent state, stopping the natural accumulation of time, and waiting for the registered model which has not been solved in the registered model which has reached the next step length to complete the calculation. Therefore, in the embodiment, when performing joint simulation, the scheduling system times each model, and accumulates the natural time, and when detecting that the token state of the registered model reached by the next step is the sent state, stops the natural accumulation of the time, and waits for the registered model not solved in the registered model reached by the next step to complete resolving. Therefore, the unification of the physical time of each model of the joint simulation is ensured, so that the logic of the joint simulation is not disordered, the simulation progress is accelerated, and the simulation efficiency is improved.
As shown in fig. 2, which is a flowchart of a method in an embodiment 2 of a scheduling method for super real-time joint simulation disclosed in the present invention, the method may include the following steps:
s201: and establishing corresponding relations between each registered model and each token required by simulation.
S202: and sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation, and setting the token state of each token to be a sent state.
S203: and when each registered model carries out step length calculation, carrying out time natural accumulation.
S204: setting the token state of the registered model for handing over the token to be a recovered state; wherein, the registered model submits the token after the resolving is completed.
S205: when time naturally accumulates until the next step size has been reached for one or several of the registered models, the token state of the registered model for which the next step size has been reached is detected.
S206: and if the token state of the registered model which has reached the next step length is detected to be a sent state, stopping the natural accumulation of time, and waiting for the registered model which has not been solved in the registered model which has reached the next step length to complete the calculation.
The above S201 to S206 are the same as the above S101 to S106, and are not described again in this embodiment.
S207: and if the token states of the registered models reached by the next step length are all recovered states, continuing to accumulate the natural time, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
In this embodiment, when time naturally accumulates until the next step size of one or more registered models arrives, the token state of the registered model that the next step size has reached is detected, and the token states of the registered model that the next step size has reached at this time may include two types: the sent state and the recovered state may include the following two cases based on the two states:
the first condition is as follows: and if the token state of the registered model reached by the next step contains the sent state, the token state indicates that the registered model reached by the next step has the unresolved state, in this case, the natural time accumulation is stopped, and the registered model reached by the next step and not solved in the registered model is waited for until the registered model reached by the next step completes the resolution. And when the token states of the registered models which have reached the next step length are all recovered states, continuing to accumulate the natural time, and sending the tokens to the registered models which have reached the next step length based on the corresponding relation, so that the registered models which have reached the next step length are subjected to step length calculation, and the token states of the registered models which have reached the next step length are set to be sent states.
Case two: and if the token states of the registered models of the next step length are all recovered states, the registered models of the next step length are all solved, in this case, time natural accumulation is continued without waiting for other models to solve, and tokens are sent to the registered models of the next step length based on the corresponding relation, so that the registered models of the next step length are subjected to step length calculation, and the token states of the registered models of the next step length are set to be sent.
In this embodiment, when performing joint simulation, the scheduling system times each model, and performs natural time accumulation, and when detecting that there is a token state of a registered model reached by a next step that is a sent state, stops time natural accumulation, and waits for a registered model not completed in solution in the registered model reached by the next step to complete solution. And if the token states of the registered models reached by the next step length are all recovered states, continuing to accumulate the natural time, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states. Therefore, the unification of the physical time of each model of the joint simulation is ensured, so that the logic of the joint simulation is not disordered, the simulation progress is accelerated, and the simulation efficiency is improved.
As shown in fig. 3, which is a flowchart of a scheduling method of super real-time joint simulation embodiment 3 disclosed in the present invention, the method may include the following steps:
s301: starting a timer of the registered model which is not solved for completion to time; wherein one registered model is provided with one timer.
In this embodiment, when it is detected that the token state of the registered model in which the next step has been reached is the sent state, the natural time accumulation is stopped, the calculation is continued for the registered model in which the next step has been reached, and in the calculation process, the timer corresponding to the registered model is used for timing.
S302: and setting the corresponding model state as a destroyed state for the registered model which does not submit the token within the corresponding preset timeout duration in the registered models which are not solved, wherein one registered model corresponds to one preset timeout duration.
In this embodiment, when the next step length of a certain model is reached, but the model is not calculated completely, which indicates that the model is overtime, in this embodiment, in order to ensure normal execution of the joint simulation, timeout within a certain range is allowed, that is, the model is allowed to continue to perform calculation. However, due to the existence of some abnormal situations, a problem may occur in the solution, which may result in that the solution cannot be completed for a long time, and the super real-time joint simulation is blocked, and in order to ensure that the realization of the joint simulation is not affected, in this embodiment, a model state is configured in each token information. By setting the preset timeout duration and after the timeout resolving time of the registered model exceeds the preset timeout duration, the model state of the registered model is set to be the destroyed state, namely, the model is in the unregistered state.
In one embodiment, the preset timeout duration may be equal to a duration of one timer, and the preset timeout duration may be set based on the resolving time of the model and the destruction probability of the model. The calculation time of the model is related to the complexity of the model, and the calculation time of the model can be understood as the time required by the model to complete calculation under normal conditions. Meanwhile, in order to reduce the destruction probability of the model, through experimental research, a preset overtime time is set, so that the destruction probability of the model is smaller than a certain preset probability threshold. Of course, in other embodiments, the preset timeout period may not be limited by a specific probability threshold, and may be set to an empirical value. Wherein, the destruction probability of the model, that is, the probability that the model state is set as the destroyed state.
In another embodiment, the preset timeout duration may also be equal to the durations of multiple timers, and the durations of the timers are set according to the complexity of the corresponding model, so that it is required to ensure that the corresponding model completes the resolution within the duration of one timer in a general situation. The specific preset timeout duration is equal to the duration of a plurality of timers, or the preset timeout times corresponding to the preset timeout duration are several times, the setting can be flexibly set according to experience or test results, the situation that the model state is set to the destroyed state is generally avoided as much as possible, meanwhile, the problem of blocking of the super-real-time joint simulation caused by the abnormal model is also considered, and the process of the joint simulation is prevented from being blocked by the abnormal model. Optionally, S302 includes:
recording one time of overtime for the registered model which does not pass the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and determining the unresolved registered model with the overtime times reaching the preset overtime times as a registered model which does not pass tokens within the corresponding preset overtime duration in the unresolved registered model, and setting the corresponding model state as a destroyed state.
Generally, the calculation time of the preset timeout times set in the model is related to the destruction probability of the model, wherein the calculation time of the model is related to the complexity of the model, and the calculation time of the model can be understood as the time required by the model to complete calculation under normal conditions. In addition, in order to reduce the destruction probability of the model, through experimental research, overtime is set so that the destruction probability of the model is smaller than a certain preset probability threshold. It will be appreciated that the preset timeout number may be part of the token information.
S303: and when the registered model with the next step size is in the recovered state and the model state is in the destroyed state, continuing to perform time natural accumulation on the target registered model with the token state of the registered model with the next step size being in the recovered state, and sending a token to the target registered model based on the corresponding relation so as to solve the step size of the target registered model and set the target registered model to be in the sent state.
In this embodiment, when there is a registered model whose model state is a destroyed state, the other models of the joint simulation are not affected, the time natural accumulation is continued, and the solution is continued, that is: and sending a token to the registered model in the recovered state based on the corresponding relation, so that the registered model in the recovered state carries out resolving of the next step. In other words, for the registered model reached by the next step length, when the model states of other models are destroyed states except the model with the token state being the recovered state, the model with the token state being the recovered state is continuously solved, and the joint simulation is completed.
In this embodiment, the timeout duration when the registered model that has reached the next step but has not yet been solved continues to be solved is controlled by a timer, and the model state of the registered model that has not yet been solved is set to the destroyed state within the preset timeout duration, so that the abnormal model does not affect the implementation of the joint simulation.
In order to more clearly illustrate the technical solution of the present invention, the following embodiments are described:
for example, four models, namely model a, model B, model C and model D, are needed to simulate a scene. And taking the physical time as a scale, taking 100 mu s as a step length for the models A and B, taking 200 mu s as a step length for the model C, and taking 500 mu s as a step length for the model D, wherein the resolving time of the model A is 30 mu s, the resolving time of the model B is 115 mu s, the resolving time of the model C is 50 mu s, and the resolving time of the model D is 100 mu s. During specific simulation, firstly, the four models complete registration by using a shared memory, when the scheduling system recognizes that the four models are registered through the shared memory, the token information is initialized, the tokens are sent to the four models, and the token states of the four models are set to be sent. Meanwhile, a timing system of the scheduling system carries out time natural accumulation, the model A is solved at 30 mu s, when the time natural accumulation reaches 100 mu s, the model B is still in the process of resolving, the scheduling system detects the token states of the model A and the model B, detects that the token state of the model A is recovered, the token state of the model B is still sent, at the moment, the time natural accumulation is stopped, a physical timer of the model B is started, when the physical timer of the model B reaches a timing duration of 10 mu s, the model B is still not solved completely, the scheduling system detects that the state of the model B is still sent, records one time timeout, starts the physical timer of the model B again, when the physical timer of the model B times to 5 mu s, the model B is solved completely and is detected by the scheduling system that the token state is recovered, at the moment, the natural time accumulation is continuously carried out, model a and model B enter the solution of the second cycle. When the time is naturally accumulated to 200 mus, the dispatching system detects that the token states of the model A (which is solved when the time is naturally accumulated to 130 mus) and the model C (which is solved when the time is naturally accumulated to 50 mus) are recovered, the token state of the model B is sent, the time natural accumulation stops again at the moment, and the physical timer of the model B is restarted, when the physical timer of the model B reaches 10 mus (namely, one-time timing is finished), the model B still does not finish the resolving, the record is overtime once, the physical timer of the model B is restarted, the dispatching system detects that the state of the model B is sent, when the physical timer of the model B times to 5 mus, the model B finishes the resolving again and is detected by the dispatching system that the token state is recovered, the model A and the model B enter the third-period of resolving, and the model C enters the second period of resolving, and continuing to accumulate the natural time, subsequently respectively carrying out token state detection of the model A and the model B for the third time at 300 mu s, executing corresponding operation according to the detection result, carrying out token state detection of the model A, the model B and the model C at 400 mu s, and executing corresponding operation according to the detection result. When the time is accumulated to 500 mu s, the dispatching system detects the token states of the model A, the model B, the model C and the model D (the model D is solved at 100 mu s), detects that the token states of the model A, the model C and the model D are recovered, and detects that the state of the model B is sent, at the moment, the time natural accumulation stops again, and the physical timer of the model B is started again, when the physical timer of the model B reaches the timing duration of 10 mu s, the model B is still not solved completely, the dispatching system detects that the state of the model B is still sent, records the timeout once, starts the physical timer of the model B again, and when the physical timer of the model B times to 5 mu s, the model B is solved again, and the dispatching system detects that the token state is recovered, and finishes the simulation at the stage.
Certainly, the foregoing embodiment is only a specific embodiment, and under different situations, different operation results may be obtained according to the design logic, for example, if the resolving time of the model B is 150 μ s, the timeout time is 10 μ s, and the preset timeout number is 3 times, the scheduling system may find that the model B still does not complete resolving after exceeding the preset timeout number, set the model state of the model B to the destroyed state, and continue to perform time natural accumulation to complete the subsequent simulation process. For another example, the solution time of the model B is 50 μ s, and then the time is continuously naturally accumulated until the simulation is finished without starting a physical timer at each stage.
It should be noted that the step sizes of the models a and B, the step size of the model C, and the step size of the model D are 100 μ s, 200 μ s, and 500 μ s, respectively: when the time of the model A and the model B is naturally added to the time value of the next step, the corresponding physical time is 100 mu s; when the time of the model C is naturally accumulated to the time value of the next step length, the corresponding physical time of the model C is 200 mus; when the time is naturally added to the time value of the next step length, the corresponding physical time of the model D is 500 mus. The time value that is naturally accumulated as to the time when each model reaches the next step is related to the computational power of the corresponding computing device.
As shown in fig. 4, which is a schematic structural diagram of a scheduling apparatus embodiment 1 of super real-time joint simulation disclosed in the present invention, the apparatus may include:
an establishing module 401, configured to establish a correspondence between each registered model and each token required for simulation;
a sending module 402, configured to send tokens to the registered models based on the correspondence, so that the registered models of the received tokens perform step length calculation, and set the token states of the tokens to be sent states;
a first time natural accumulation module 403, configured to perform time natural accumulation when step length calculation is performed on each registered model;
a first setting module 404, configured to set a token state of a registered model for handing over a token to a recycled state; the registered model is handed over to the token after the calculation is completed;
a detection module 405, configured to detect a token state of a registered model reached by a next step when time naturally accumulates until the next step of one or more registered models is reached;
and the execution waiting module 406 is configured to stop time natural accumulation if it is detected that the token state of the registered model in which the next step has been reached is a sent state, and wait for a registered model in which resolution is not completed in the registered model in which the next step has been reached to complete resolution.
Optionally, the method further includes:
a second temporal natural accumulation module to: and if the token states of the registered models reached by the next step length are all recovered states, continuing to perform natural time accumulation, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
Optionally, the method further includes:
the first timer starting module is used for starting the timer of the registered model which is not solved for timing; wherein a registered model is provided with a timer;
the second setting module is used for setting the corresponding model state as a destroyed state for the registered model which does not submit the token within the corresponding preset timeout duration in the unresolved registered models; one registered model corresponds to a preset timeout duration;
and the third time natural accumulation module is used for continuously performing time natural accumulation on the target registered model of which the token state of the registered model reached by the next step length is the recovered state and the destroyed state when the token state of the registered model reached by the next step length exists in the recovered state and the destroyed state, and sending a token to the target registered model based on the corresponding relation so as to solve the step length of the target registered model and set the target registered model to be the sent state.
Optionally, the second setting module includes:
the second timer starting submodule is used for recording one time of overtime for the registered model which does not give up the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and the second setting submodule is used for determining the unresolved registered model with the overtime times reaching the preset overtime times as the registered model which does not submit the token within the corresponding preset overtime length in the unresolved registered model, and setting the corresponding model state as the destroyed state.
Optionally, the method further includes:
and the overtime frequency setting module is used for setting corresponding preset overtime frequency based on the resolving time and the destruction probability of each registered model.
In summary, in the device disclosed in the present invention, when performing joint simulation, the scheduling system times each model by using natural time accumulation, and when detecting that the token state of the registered model reached by the next step is the sent state, stops time natural accumulation, and waits for the registered model not solved in the registered model reached by the next step to complete resolving. Therefore, the unification of the physical time of each model of the joint simulation is ensured, so that the logic of the joint simulation is not disordered, the simulation progress is accelerated, and the simulation efficiency is improved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A scheduling method of super real-time joint simulation is characterized by comprising the following steps:
establishing a corresponding relation between each registered model and each token required by simulation;
sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation and set the token states of the tokens to be sent states;
when each registered model carries out step length calculation, natural accumulation of time is carried out;
setting the token state of the registered model for handing over the token to be a recovered state; the registered model is handed over to the token after the calculation is completed;
when time naturally accumulates until the next step size of one or more registered models is reached, detecting the token state of the registered model of which the next step size is reached;
and if the token state of the registered model which has reached the next step length is detected to be a sent state, stopping the natural accumulation of time, and waiting for the registered model which has not been solved in the registered model which has reached the next step length to complete the calculation.
2. The method of claim 1, further comprising:
and if the token states of the registered models reached by the next step length are all recovered states, continuing to perform natural time accumulation, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
3. The method of claim 1, further comprising:
starting a timer of the registered model which is not solved for completion to time; wherein a registered model is provided with a timer;
setting the corresponding model state as a destroyed state for the registered model which does not pass the token within the corresponding preset timeout duration in the registered models which are not solved; one registered model corresponds to a preset timeout duration;
and when the registered model with the next step size is in the recovered state and the model state is in the destroyed state, continuing to perform time natural accumulation on the target registered model with the token state of the registered model with the next step size being in the recovered state, and sending a token to the target registered model based on the corresponding relation so as to solve the step size of the target registered model and set the target registered model to be in the sent state.
4. The method according to claim 3, wherein for the registered model which does not pass the token within the corresponding preset timeout period in the unresolved registered models, setting the corresponding model state as the destroyed state comprises:
recording one time of overtime for the registered model which does not pass the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and determining the unresolved registered model with the overtime times reaching the preset overtime times as a registered model which does not pass tokens within the corresponding preset overtime duration in the unresolved registered model, and setting the corresponding model state as a destroyed state.
5. The method of claim 4, further comprising:
and setting corresponding preset timeout times based on the resolving time and the destruction probability of each registered model.
6. A scheduling apparatus for super real-time joint simulation, comprising:
the establishing module is used for establishing the corresponding relation between each registered model and each token required by simulation;
the sending module is used for sending tokens to the registered models based on the corresponding relation so as to enable the registered models of the received tokens to carry out step length calculation and set the token states of the tokens to be sent states;
the first time natural accumulation module is used for performing time natural accumulation when each registered model performs step length calculation;
the first setting module is used for setting the token state of the registered model for handing over the token to be a recovered state; the registered model is handed over to the token after the calculation is completed;
the detection module is used for detecting the token state of the registered model reached by the next step length when the time is naturally accumulated to the next step length reached by one or more registered models;
and the execution waiting module is used for stopping time natural accumulation if the token state of the registered model which reaches the next step length is detected to be a sent state, and waiting for the registered model which is not solved in the registered model which reaches the next step length to complete resolving.
7. The apparatus of claim 6, further comprising:
a second temporal natural accumulation module to: and if the token states of the registered models reached by the next step length are all recovered states, continuing to perform natural time accumulation, and sending the tokens to the registered models reached by the next step length based on the corresponding relation, so that the registered models reached by the next step length are subjected to step length calculation, and the token states of the registered models reached by the next step length are set to be sent states.
8. The apparatus of claim 6, further comprising:
the first timer starting module is used for starting the timer of the registered model which is not solved for timing; wherein a registered model is provided with a timer;
the second setting module is used for setting the corresponding model state as a destroyed state for the registered model which does not submit the token within the corresponding preset timeout duration in the unresolved registered models; one registered model corresponds to a preset timeout duration;
and the third time natural accumulation module is used for continuously performing time natural accumulation on the target registered model of which the token state of the registered model reached by the next step length is the recovered state and the destroyed state when the registered model reached by the next step length has the token state which is the recovered state, and sending a token to the target registered model based on the corresponding relation so as to solve the step length of the target registered model and set the target registered model to be the sent state.
9. The apparatus of claim 8, wherein the second setup module comprises:
the second timer starting submodule is used for recording one time of overtime for the registered model which does not give up the token after the timer finishes timing in the registered models which are not solved, and starting the corresponding timer again;
and the second setting submodule is used for determining the unresolved registered model with the overtime times reaching the preset overtime times as the registered model which does not submit the token within the corresponding preset overtime length in the unresolved registered model, and setting the corresponding model state as the destroyed state.
10. The apparatus of claim 9, further comprising:
and the overtime frequency setting module is used for setting corresponding preset overtime frequency based on the resolving time and the destruction probability of each registered model.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110566841.9A CN113110114B (en) | 2021-05-24 | 2021-05-24 | Scheduling method and device for super-real-time joint simulation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110566841.9A CN113110114B (en) | 2021-05-24 | 2021-05-24 | Scheduling method and device for super-real-time joint simulation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113110114A true CN113110114A (en) | 2021-07-13 |
CN113110114B CN113110114B (en) | 2023-07-14 |
Family
ID=76723083
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110566841.9A Active CN113110114B (en) | 2021-05-24 | 2021-05-24 | Scheduling method and device for super-real-time joint simulation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113110114B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113722817A (en) * | 2021-08-08 | 2021-11-30 | 中国航空工业集团公司沈阳飞机设计研究所 | Distributed simulation system operation scheduling platform |
CN117997761A (en) * | 2024-02-19 | 2024-05-07 | 中国船舶集团有限公司第七一九研究所 | Cross-system real-time simulation scheduling method and system |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929158A (en) * | 2012-10-30 | 2013-02-13 | 北京华力创通科技股份有限公司 | Multi-core multi-model parallel distributed type real-time simulation system |
US20150134313A1 (en) * | 2013-11-08 | 2015-05-14 | Rockwell Automation Technologies, Inc. | Time synchronization of signal transmission intervals for simulating a machine in industrial automation |
CN105930580A (en) * | 2016-04-19 | 2016-09-07 | 国家电网公司 | Time synchronization and data exchange apparatus and method used for combined simulation of power system and information communication system |
CN106559273A (en) * | 2017-01-19 | 2017-04-05 | 中国人民解放军国防科学技术大学 | Towards the self-adaptive service quality priority dispatching method of Time Triggered Ethernet |
CN107301884A (en) * | 2017-07-24 | 2017-10-27 | 哈尔滨工程大学 | A kind of hybrid nuclear power station method for diagnosing faults |
WO2019112407A1 (en) * | 2017-12-05 | 2019-06-13 | Atlan Space | Autonomous pilotless vehicle navigation and behaviour without connection to the control station |
CN111405566A (en) * | 2020-03-09 | 2020-07-10 | 上海密尔克卫化工储存有限公司 | L ora standard-based node and base station private communication protocol system and method thereof |
CN111814131A (en) * | 2020-06-15 | 2020-10-23 | 北京天空卫士网络安全技术有限公司 | Method and device for equipment registration and configuration management |
-
2021
- 2021-05-24 CN CN202110566841.9A patent/CN113110114B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929158A (en) * | 2012-10-30 | 2013-02-13 | 北京华力创通科技股份有限公司 | Multi-core multi-model parallel distributed type real-time simulation system |
US20150134313A1 (en) * | 2013-11-08 | 2015-05-14 | Rockwell Automation Technologies, Inc. | Time synchronization of signal transmission intervals for simulating a machine in industrial automation |
CN105930580A (en) * | 2016-04-19 | 2016-09-07 | 国家电网公司 | Time synchronization and data exchange apparatus and method used for combined simulation of power system and information communication system |
CN106559273A (en) * | 2017-01-19 | 2017-04-05 | 中国人民解放军国防科学技术大学 | Towards the self-adaptive service quality priority dispatching method of Time Triggered Ethernet |
CN107301884A (en) * | 2017-07-24 | 2017-10-27 | 哈尔滨工程大学 | A kind of hybrid nuclear power station method for diagnosing faults |
WO2019112407A1 (en) * | 2017-12-05 | 2019-06-13 | Atlan Space | Autonomous pilotless vehicle navigation and behaviour without connection to the control station |
CN111405566A (en) * | 2020-03-09 | 2020-07-10 | 上海密尔克卫化工储存有限公司 | L ora standard-based node and base station private communication protocol system and method thereof |
CN111814131A (en) * | 2020-06-15 | 2020-10-23 | 北京天空卫士网络安全技术有限公司 | Method and device for equipment registration and configuration management |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113722817A (en) * | 2021-08-08 | 2021-11-30 | 中国航空工业集团公司沈阳飞机设计研究所 | Distributed simulation system operation scheduling platform |
CN117997761A (en) * | 2024-02-19 | 2024-05-07 | 中国船舶集团有限公司第七一九研究所 | Cross-system real-time simulation scheduling method and system |
Also Published As
Publication number | Publication date |
---|---|
CN113110114B (en) | 2023-07-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113110114A (en) | Scheduling method and device for super real-time joint simulation | |
CN104794016A (en) | Mobile terminal crash testing and processing method and system | |
US10323910B2 (en) | Methods and apparatuses for eliminating a missile threat | |
CN104899125B (en) | A kind of the operation information acquisition methods and device of single board system | |
CN109656775A (en) | By the method and apparatus, related computer program and the avionics system that execute time monitoring avionics hardware application program | |
CN115271736B (en) | Method, device, equipment and storage medium for verifying transaction consistency | |
CN114625108B (en) | Simulation test method and device | |
CN108572892B (en) | PowerPC multi-core processor-based offline test method and device | |
CN105389200A (en) | Multi-group stimulation batch simulation method and system applied to super-large scale chip verification | |
CN109753415B (en) | Processor verification system and processor verification method based on same | |
US11567489B2 (en) | Method and device for efficient fault analysis through simulated faults in a digital twin | |
CN114113984A (en) | Fault drilling method, device, terminal equipment and medium based on chaotic engineering | |
CN116881913A (en) | Staged malicious file detection method, device, equipment and medium | |
CN113821898A (en) | Random verification method, device, equipment and storage medium of chip subsystem | |
CN108241571A (en) | A kind of program testing method and device | |
CN114844684B (en) | Active defense network evaluation method and system based on multiple fusion method | |
CN111679924B (en) | Reliability simulation method and device for componentized software system and electronic equipment | |
CN114385496A (en) | Test method, test device, electronic equipment and computer readable storage medium | |
Carnevali et al. | Towards the quantitative evaluation of phased maintenance procedures using non-Markovian regenerative analysis | |
WO2021038636A1 (en) | Verification device, verification method, and verification program | |
CN113722212A (en) | CPLD upgrade test method, device, equipment and medium | |
JP6949440B2 (en) | Vector generator and vector generator program | |
CN107272822A (en) | A kind of system clock monitoring method and device | |
US20220222394A1 (en) | Root cause analysis in the synchronization of partial simulations with and without real-time capability | |
CN103309759A (en) | Method for detecting interrupt service of operating system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |