CN113110114B - Scheduling method and device for super-real-time joint simulation - Google Patents

Scheduling method and device for super-real-time joint simulation Download PDF

Info

Publication number
CN113110114B
CN113110114B CN202110566841.9A CN202110566841A CN113110114B CN 113110114 B CN113110114 B CN 113110114B CN 202110566841 A CN202110566841 A CN 202110566841A CN 113110114 B CN113110114 B CN 113110114B
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.)
Active
Application number
CN202110566841.9A
Other languages
Chinese (zh)
Other versions
CN113110114A (en
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 CN202110566841.9A priority Critical patent/CN113110114B/en
Publication of CN113110114A publication Critical patent/CN113110114A/en
Application granted granted Critical
Publication of CN113110114B publication Critical patent/CN113110114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B17/00Systems involving the use of models or simulators of said systems
    • G05B17/02Systems 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 scheduling device for super-real-time joint simulation, wherein the method comprises the following steps: when the joint simulation is carried out, the scheduling system counts each model, adds up natural time, and when the token state of the registered model reached by the next step is detected to be the sent state, the time is stopped to be added up naturally, and the registered model which is not solved and is not solved in the registered model reached by the next step is waited for finishing the solving. 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 quickened, and the simulation efficiency is improved.

Description

Scheduling method and device for super-real-time joint simulation
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
Currently, in electronic system design, each subsystem performs mathematical modeling independently. Taking an airplane electronic system as an example, a mathematical model of each device is built according to future airplane electronic system division (avionics, control, electromechanics and the like). And then performing model verification, wherein during model verification, most of logic solutions using modeling tools perform super real-time simulation. In the joint simulation stage, each model is downloaded into a real-time simulator, each model is resolved in real time according to physical time, and simulation is carried out according to each time sequence in the model operation process.
It can be seen that in the joint simulation stage, since real-time calculation is performed, all the verification needs to rely on physical time, so that the simulation progress is slow, and the verification time is long. For example, an aircraft may fly for one hour, and each model must be run for one hour on a physical time basis to verify completion. In addition, if each model performs super real-time joint simulation, the physical time in each model is not uniform due to different logic complexity of each model and different calculation time, and the joint simulation can cause logic confusion.
Therefore, how to solve the problem of too slow running speed of real-time simulation and the problem of non-uniform physical time of each model in ultra-real-time joint simulation is a urgent problem to be solved.
Disclosure of Invention
In view of the above, the invention provides a scheduling method and device for super-real-time joint simulation, which is based on a shared memory.
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 each registered model based on the corresponding relation so as to enable each registered model receiving the tokens to perform step length calculation, and setting the token state of each token as a sent state;
when each registered model carries out step length calculation, carrying out time natural accumulation;
setting the token state of the registered model of the submitted token to a recovered state; the registered model is submitted to the token after the calculation is completed;
when the time is naturally accumulated to one or more registered models and the next step length is reached, detecting the token state of the registered model with the reached next step length;
if the token state of the registered model with the reached next step is detected to be the sent state, stopping time is accumulated naturally, and the registered model which is not resolved in the registered model with the reached next step is waited for to be resolved.
Optionally, the method further comprises:
if the token states of the registered models which are reached by the next step are all recovered states, then the time natural accumulation is continued, and the tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that the registered models which are reached by the next step are subjected to step calculation, and the token states of the registered models which are reached by the next step are set to be sent states.
Optionally, the method further comprises:
starting a timer of the registered model which is not calculated to be completed to time; wherein a registered model is provided with a timer;
setting a corresponding model state as a destroyed state for a registered model in which no token is submitted in a corresponding preset timeout period in the uncomputed registered model; wherein, a registered model corresponds to a preset timeout period;
and when the state of the registered model with the next step is in the recovered state and the state of the model is in the destroyed state, continuously and naturally accumulating time for the target registered model with the token state of the registered model with the next step being in the recovered state, and sending the token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step resolving, and setting the target registered model as the sent state.
Optionally, for the registered model in which the token is not submitted within the corresponding preset timeout period in the registered model which is not resolved, setting the corresponding model state to be the destroyed state includes:
Recording a timeout for a registered model which is not submitted with a token after the timer finishes in the registered model which is not calculated, and restarting a corresponding timer;
and determining the uncomputed registered model with the timeout times reaching the preset timeout times as a registered model of which the token is not submitted in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as a destroyed state.
Optionally, the method further comprises:
and setting corresponding preset timeout times based on the resolving time and destroying probability of each registered model.
The embodiment of the invention discloses a scheduling device for super-real-time joint simulation, which comprises the following components:
the building module is used for building the corresponding relation between each registered model and each token required by simulation;
the sending module is used for sending tokens to each registered model based on the corresponding relation so as to enable the registered model of each received token to carry out step length calculation and set the token state of each token as a sent state;
the first time natural accumulation module is used for carrying out time natural accumulation when each registered model carries out step length calculation;
The first setting module is used for setting the token state of the registered model of the submitted token into a recovered state; the registered model is submitted to the token after the calculation is completed;
the detection module is used for detecting the token state of the registered model with the reached next step length when the time is naturally accumulated to one or more registered models with the reached next step length;
and the execution waiting module is used for naturally accumulating the stopping time if the token state of the registered model with the reached next step is detected to be the sent state, and waiting for the completion of the resolving of the registered model which is not resolved to be completed in the registered model with the reached next step.
Optionally, the method further comprises:
the second time natural accumulation module is used for: if the token states of the registered models which are reached by the next step are all recovered states, then the time natural accumulation is continued, and the tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that the registered models which are reached by the next step are subjected to step calculation, and the token states of the registered models which are reached by the next step are set to be sent states.
Optionally, the method further comprises:
The first timer starting module is used for starting a timer of the registered model which is not resolved to be completed to time; 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 period in the registered model which is not resolved; wherein, a registered model corresponds to a preset timeout period;
and the third time natural accumulation module is used for continuously carrying out time natural accumulation on a target registered model with the token state of the registered model reached in the next step length being the recovered state when the token state of the registered model reached in the next step length is both the recovered state and the destroyed state, sending a token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step length calculation, and setting the target registered model to be the sent state.
Optionally, the second setting module includes:
the second timer starting sub-module is used for recording one time overtime for the registered model which is not submitted with the token after the timer finishes timing in the registered model which is not solved, and restarting the corresponding timer;
And the second setting submodule is used for determining the uncomputed registered model with the timeout times reaching the preset timeout times as the registered model which does not upload tokens in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as the destroyed state.
Optionally, the method further comprises:
the timeout times setting module is used for setting the corresponding preset timeout times based on the resolving time and the destroying probability of each registered model.
In summary, the invention discloses a scheduling method and a device for super real-time joint simulation, when joint simulation is performed, a scheduling system counts each model, natural time accumulation is adopted, when the fact that the token state of a registered model reached by the next step is detected to be a sent state, stop time is accumulated naturally, and the completion of resolving of a registered model which is not resolved in the registered model reached by the next step is waited. 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 quickened, and the simulation efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of embodiment 1 of a scheduling method of super real-time joint simulation disclosed by the invention;
FIG. 2 is a flow chart of a method of embodiment 2 of a scheduling method for super real-time joint simulation disclosed by the invention;
FIG. 3 is a flow chart of a method of embodiment 3 of a scheduling method of super real-time joint simulation disclosed by the invention;
fig. 4 is a schematic structural diagram of an embodiment 1 of a scheduling apparatus for super real-time joint simulation disclosed in the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a method flowchart of an embodiment 1 of a scheduling method for super real-time joint simulation disclosed in the present invention may include the following steps:
s101: and establishing the corresponding relation between each registered model and each token required by simulation.
To facilitate understanding, the concept of super real time is explained first. To simulate a certain scene, each related model needs to synchronously reach the corresponding state required by the scene, but due to different running complexity of each model, the running time of each model is different, which requires that a model with a fast running wait for a model with a relatively slow running to complete the simulation of the scene. This results in a difference between the time required to complete the scene simulation and the real physical time, beyond the real physical time, so called super real time. It should be noted that: the time required for simulation may be shorter or longer than the actual physical time, depending on the duration of the model simulating the actual scene. If the physical time of a scene is very short, but the model for simulating the scene is complex, the running time is very long, and the situation that the simulation time is longer than the real physical time can occur. Conversely, if a certain physical time is long, but the model for simulating the scene is simple, the running time is short, and the simulation time is smaller than the real physical time.
When the scheduling of the super real-time joint simulation is needed, firstly, the models needed by the simulation are registered by utilizing the shared memory, then, the initialization of the token information is carried out, and the corresponding relation between each token and the registered models is established. In order to facilitate searching the tokens, each token information can also comprise 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 when the model A, the model B, the model C and the model D are used, respectively establishing one-to-one correspondence between the model A, the model B, the model C and the model D and each token.
S102: and sending tokens to each registered model based on the corresponding relation so as to enable each registered model receiving the tokens to perform step length calculation, and setting the token state of each token as a sent state.
In this embodiment, the token status of each token may include: unsent, sent, and recycled, wherein the status of the token is indicated as unsent prior to the token being sent; when the model is in the resolving state, the token state is sent; when the model has completed resolving and properly submitted the token, then the token indicates that it has been recovered.
The corresponding relation is the corresponding relation between the registered model and the token, the token is sent to the corresponding registered model based on the corresponding relation, so that the registered model performs step length calculation, and the state of the token is set to be sent.
In this embodiment, the token information may further include a process number of the registered model. The scheduling system queries the process information according to the process number and sends the scheduling information to the appointed model through the process number.
After establishing the correspondence between each registered model and each token required by the simulation, further, the tokens may be sent to all registered models required by the simulation according to the process numbers in the correspondence, and the state of each token may be set as the sent state. In this embodiment, after the registered model receives the token, step size calculation is performed.
S103: and when each registered model carries out step length calculation, carrying out time natural accumulation.
When each registered model carries out step length calculation, the time natural accumulation is carried out without depending on the physical time.
Wherein, the natural accumulation of time means: the time values are accumulated by taking the step length as 1, the accumulation speed is related to the calculation force of the computing equipment for carrying out the time natural accumulation, the larger the calculation force is, the faster the accumulation speed is, and the time values of the time natural accumulation are the time considered by the computer. Typically, the time value for natural accumulation of time is much faster than physical time, e.g., in steps of microseconds, for example, 3.0GHz processing, and it takes only about 1 second to accumulate to 300 hours.
S104: setting the token state of the registered model of the submitted token to a recovered state; wherein the registered model is submitted to the token after the completion of the solution.
As can be seen from the above description, the recycling state of the token includes a recycled state, and the recycled state represents: the registered model completes the solution and hands up the token. Then, in the step-size resolving process of each registered model, when the resolving of the registered model is completed, the token state of the registered model with the resolved completion is set to the recovered state, for example, in the resolving process, when the resolving of the model A is completed and the token is submitted, the token state of the model A is set to the recovered state from the sent state.
S105: when time is naturally accumulated in one or a plurality of registered models, the next step length is reached, the token state of the registered model with the reached next step length is detected.
S106: if the token state of the registered model which is reached by the next step is detected to be the sent state, stopping time natural accumulation, and waiting for the completion of the resolving of the registered model which is not resolved in the registered model which is reached by the next step.
In this embodiment, when the registered model receives the token, the solution is performed, natural accumulation of time is performed, and when the accumulated time duration is one step length of one or several registered models, that is, when the natural time is accumulated until the next step length of one or several registered models is reached, the state of the token of the registered model whose next step length is reached is detected. In this embodiment, in a certain scenario, the steps required by different registered models are different, and the resolving time is also different due to the different complexity of the model resolving, so when the time is naturally accumulated to the next step 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 resolving times, the token state may be recovered and for those with longer resolving times, the token state may be sent.
Illustrating: for example, four models are needed for simulating a certain scene, namely a model A, a model B, a model C and a model D, wherein the models A and B are respectively used as a step length of 100 mu s, the model C is used as a step length of 200 mu s, the model D is used as a step length of 500 mu s, 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. When the four models are registered through the shared memory, the dispatching system sends tokens to the four models when recognizing that the four models are registered through the shared memory, and sets the token states of the four models to be sent. And meanwhile, the timing system of the scheduling system carries out time natural accumulation, the model A is solved after 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 scheduling system detects the token states of the model A and the model B in the solution, 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 the super real-time joint simulation scheduling is required, the corresponding relationship between each registered model and each token required by the simulation is first 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 the sent state; when each registered model carries out step length calculation, carrying out time natural accumulation; in the step length resolving process of each registered model, when the resolving of the registered model is completed, setting the state of the token of the registered model with the resolved completion as a recovered state; when the time is naturally accumulated to one or more registered models and the next step length is reached, detecting the token state of the registered model with the reached next step length; if the token state of the registered model with the reached next step is detected to be the sent state, stopping time is accumulated naturally, and the registered model which is not resolved in the registered model with the reached next step is waited for to be resolved. It can be seen that, in this embodiment, when performing joint simulation, the scheduling system counts each model, and adopts accumulation of natural time, and when detecting that the token state of the registered model reached by the next step is the sent state, stops natural accumulation of time, and waits for the completion of the calculation of the registered model that is not calculated in the registered model reached by the next step. 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 quickened, and the simulation efficiency is improved.
As shown in fig. 2, a method flowchart of an embodiment 2 of a scheduling method for super real-time joint simulation disclosed in the present invention may include the following steps:
s201: and establishing the corresponding relation between each registered model and each token required by simulation.
S202: and sending tokens to each registered model based on the corresponding relation so as to enable each registered model receiving the tokens to perform step length calculation, and setting the token state of each token as 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 of the submitted token to a recovered state; wherein the registered model is submitted to the token after the completion of the solution.
S205: when time is naturally accumulated in one or a plurality of registered models, the next step length is reached, the token state of the registered model with the reached next step length is detected.
S206: if the token state of the registered model with the reached next step is detected to be the sent state, stopping time is accumulated naturally, and the registered model which is not resolved in the registered model with the reached next step is waited for to be resolved.
The S201-S206 are identical to the S101-S106, and are not described in detail in this embodiment.
S207: if the token states of the registered models which are reached by the next step are all recovered states, natural time accumulation is continued, tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that step calculation is carried out on the registered models which are reached by the next step, and the token states of the registered models which are reached by the next step are set to be sent states.
In this embodiment, when time is naturally accumulated until one or several registered models have arrived at the next step, the token state of the registered model that the next step has arrived is detected, where the token state of the registered model that the next step has arrived may include two types: the sent state and the recovered state, based on the two states, may include the following two cases:
case one: the token state of the registered model that the next step is reached contains the sent state, which indicates that there is an unresolved completion in the registered model that the next step is reached, in which case the natural time accumulation is stopped and the unresolved completed registered model in the registered model that the next step is reached is waited for until the unresolved completed registered model in the registered model that the next step is reached completes the calculation. When the token states of the registered models with the reached next step are all recovered states, natural time accumulation is continued, tokens are sent to the registered models with the reached next step based on the corresponding relation, so that step calculation is conducted on the registered models with the reached next step, and the token states of the registered models with the reached next step are set to be sent states.
And a second case: the token states of the registered models with the reached next step are all recovered states, and the registered models with the reached next step are all completed with the calculation, in this case, the time natural accumulation is continued without waiting for the calculation of other models, and the token is sent to the registered models with the reached next step based on the corresponding relation, so that the registered models with the reached next step are subjected to the step calculation, and the token states of the registered models with the reached next step are set as sent.
In this embodiment, when performing joint simulation, the scheduling system counts each model, adopts accumulation of 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 time, and waits for the completion of the calculation of the registered model which is not completed by the calculation in the registered model reached by the next step. If the token states of the registered models which are reached by the next step are all recovered states, natural time accumulation is continued, tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that step calculation is carried out on the registered models which are reached by the next step, and the token states of the registered models which are reached by the next step 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 quickened, and the simulation efficiency is improved.
As shown in fig. 3, a method flowchart of an embodiment 3 of a scheduling method for super real-time joint simulation disclosed in the present invention may include the following steps:
s301: starting a timer of the registered model which is not calculated to be completed to time; wherein a registered model is provided with a timer.
In this embodiment, when it is detected that the token state of the registered model in which the next step is reached is the sent state, natural time accumulation is stopped, and the calculation is continued for the registered model in which the next step is reached, and in the process of the calculation, timing is performed by a timer corresponding to the registered model.
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 model which is not calculated, wherein one registered model corresponds to one preset timeout duration.
In this embodiment, when the next step of a certain model is reached, but the model is not calculated, which indicates that the model has timed out, in this embodiment, in order to ensure normal execution of the joint simulation, a timeout within a certain range is allowed, that is, if the model continues to perform the calculation. However, due to the existence of some abnormal conditions, the solution of the present problem may be caused, and then the solution may not be completed for a long time, and the super real-time joint simulation is blocked, so that the realization of the joint simulation is not influenced. Setting a preset timeout duration, and setting the model state of the registered model as a destroyed state after the timeout resolving time of the registered model exceeds the preset timeout duration, namely indicating that the model is in an unregistered state.
In one embodiment, the preset timeout period may be equal to a time period of one timer, and the setting of the preset timeout period may be based on a solution time of the model and a destruction probability of the model. The solution time of the model is related to the complexity of the model, and the solution time of the model can be understood as the time required for the model to complete the solution under normal conditions. Meanwhile, in order to reduce the destruction probability of the model, a preset timeout period is set through experimental study, 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 be set to an empirical value without being limited by a specific probability threshold. Wherein the destruction probability of the model, i.e. the probability that the model state is set to the destroyed state.
In another embodiment, the preset timeout period may be equal to the periods of a plurality of timers, where the periods of the timers are set according to the complexity of the corresponding model, and it is required to ensure that the corresponding model completes the calculation within the period of one timer under 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, can be flexibly set according to experience or test results, generally needs to avoid the situation that the model state is set to be the destroyed state as much as possible, and meanwhile, needs to consider the problem of ultra-real-time joint simulation blocking caused by model abnormality, and avoids the abnormal model blocking the joint simulation process. Optionally, S302 includes:
Recording a timeout for a registered model which is not submitted with a token after the timer finishes in the registered model which is not calculated, and restarting a corresponding timer;
and determining the uncomputed registered model with the timeout times reaching the preset timeout times as a registered model of which the token is not submitted in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as a destroyed state.
In general, the preset timeout times are set in relation to the resolving time of the model and the destroying probability of the model, wherein the resolving time of the model is related to the complexity of the model, and the resolving time of the model can be understood as the time required for the model to complete resolving under normal conditions. In addition, in order to reduce the destruction probability of the model, the overtime is set through experimental study so that the destruction probability of the model is smaller than a certain preset probability threshold. It will be appreciated that the preset number of times of timeout may be part of the token information.
S303: and when the state of the registered model with the next step is in the recovered state and the state of the model is in the destroyed state, continuously and naturally accumulating time for the target registered model with the token state of the registered model with the next step being in the recovered state, and sending the token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step resolving, and setting the target registered model as the sent state.
In this embodiment, when there is a registered model whose model state is a destroyed state, other models of the joint simulation are not affected, and the time natural accumulation is continued, and the solution is continued, that is: and sending the 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 the next step size calculation. In other words, for the registered model with the next step length reached, when the model states of other models are destroyed except for the model with the token state being the recovered state, the model with the token state being the recovered state is continuously solved, so that the joint simulation is completed.
In this embodiment, the time-out period when the registered model which has not yet been resolved reaches the next step is controlled by means of timer timing, and the registered model which has not yet been resolved is still within the preset time-out period, and the model state is set to be the destroyed state, so that the abnormal model does not affect the implementation of the joint simulation.
For a more clear description of the technical solution of the present invention, the following description is given by way of specific examples:
for example, four models are needed to simulate a certain scene, namely model a, model B, model C and model D. Taking physical time as a scale, taking 100 mu s as a step length, taking 200 mu s as a step length, taking 500 mu s as a step length, taking 30 mu s as a solution time of the model A, 115 mu s as a solution time of the model B, 50 mu s as a solution time of the model C and 100 mu s as a solution time of the model D. When the four models are registered by the shared memory, the scheduling system sends a token to the four models after the token information is initialized and the token states of the four models are set to be sent. Meanwhile, the timing system of the scheduling system carries out time natural accumulation, the model A is already solved at 30 mu s, when the time is naturally accumulated to 100 mu s, the model B is still in the process of solving, the scheduling system detects the token states of the model A and the model B, the token states of the model A are detected to be recovered, the token states of the model B are still transmitted, the time natural accumulation is stopped at the moment, a physical timer of the model B can be started, when the physical timer of the model B reaches the timing duration of 10 mu s, the model B still does not have the solution completed, the scheduling system detects the state of the model B or is transmitted, the time is recorded for one time to overtime, the physical timer of the model B is started again, when the physical timer of the model B is timed to 5 mu s, the model B is completely solved and the token states of the model B are detected to be recovered by the scheduling system, the time of the model A and the model B continues to carry out natural time accumulation at the moment, and the model B enters the solution of the second period. When the time is naturally accumulated to 200 mu s, the dispatching system detects that the token states of a model A (the time is naturally accumulated to 130 mu s and the token states of a model C (the time is naturally accumulated to 50 mu s) are recovered, the token states of a model B are transmitted, the time is naturally accumulated again to stop, and the physical timer of the model B is started again, when the physical timer of the model B reaches 10 mu s (namely, the time counting is finished), the physical timer of the model B is still not completely solved, a timeout is recorded, the physical timer of the model B is started again, the dispatching system detects that the state of the model B is transmitted, when the physical timer of the model B is counted to 5 mu s, the token states of the model B are completely solved again and the token states of the model B are detected to be recovered by the dispatching system, the model A and the model B enter the solution of the third period, the model C enters the solution of the second period, the natural time accumulation is continuously carried out, the third token states of the model A and the model B are detected at 300 mu s respectively, corresponding operations are executed according to the detection results, the detection results are carried out when the physical timer of the model B reaches 400 mu s, the detection results are carried out, and the corresponding operation results of the model operation is executed according to the model states. When the time is added 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 resolved at 100 mu s), and detects that the token states of the model A, the model C and the model D are recovered, the state of the model B is transmitted, 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 the timing duration of 10 mu s, the model B still does not resolve completely, the dispatching system detects that the state of the model B is transmitted, records a timeout once, restarts the physical timer of the model B, and when the physical timer of the model B is timed to 5 mu s, the model B is resolved again and the token state is recovered, and the stage of simulation is completed.
Of course, the foregoing embodiment is merely a specific embodiment, and under different situations, there may be different operation results according to the foregoing design logic, for example, the solution time of the model B is 150 μs, the timeout time is 10 μs, and the preset timeout number is 3, so the scheduling system may find that the model B is still not yet solved after the preset timeout number is exceeded, set the model state of the model B to be a destroyed state, and continue to perform natural accumulation of time to complete the subsequent simulation process. For another example, the resolving time of the model B is 50 mu s, so that a physical timer is not required to be started in each stage, and the time is continuously and naturally accumulated until the simulation is finished.
Models a and B use 100 μs as a step length, model C uses 200 μs as a step length, and model D uses 500 μs as a step length, which means that: model A and model B correspond to a physical time of 100 μs when time naturally accumulates to the time value at the next step; model C, when time is naturally added to the time value of the next step, the corresponding physical time is 200 mu s; model D corresponds to a physical time of 500 mus when time naturally accumulates to the time value at its next step. The time value that each model naturally accumulates when the next step reaches is related to the computing power of the corresponding computing device.
As shown in fig. 4, a schematic structural diagram of an embodiment 1 of a scheduling apparatus for super real-time joint simulation disclosed in the present invention may include:
the establishing module 401 is configured to establish a correspondence between each registered model and each token required for simulation;
a sending module 402, configured to send tokens to each registered model based on the correspondence, so that each registered model that receives a token performs step-size calculation, and set a token state of each token to be a sent state;
a first time natural accumulation module 403, configured to perform time natural accumulation when each registered model performs step resolution;
a first setting module 404, configured to set a token state of a registered model of the submitted token to a recovered state; the registered model is submitted to the token after the calculation is completed;
a detection module 405, configured to detect, when time naturally accumulates to one or more registered models and a next step size has been reached, a token state of the registered model in which the next step size has been reached;
the execution waiting module 406 is configured to, if it is detected that the token status of the registered model that has reached the next step size is the sent status, naturally accumulate the stopping time, and wait for the completion of the solution of the registered model that has not been completed in the registered model that has reached the next step size.
Optionally, the method further comprises:
the second time natural accumulation module is used for: if the token states of the registered models which are reached by the next step are all recovered states, then the time natural accumulation is continued, and the tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that the registered models which are reached by the next step are subjected to step calculation, and the token states of the registered models which are reached by the next step are set to be sent states.
Optionally, the method further comprises:
the first timer starting module is used for starting a timer of the registered model which is not resolved to be completed to time; 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 period in the registered model which is not resolved; wherein, a registered model corresponds to a preset timeout period;
and the third time natural accumulation module is used for continuously carrying out time natural accumulation on the target registered model with the token state of the registered model reached in the next step length being the recovered state when the token state of the registered model reached in the next step length exists as the recovered state or the destroyed state, sending the token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step length calculation, and setting the target registered model as the sent state.
Optionally, the second setting module includes:
the second timer starting sub-module is used for recording one time overtime for the registered model which is not submitted with the token after the timer finishes timing in the registered model which is not solved, and restarting the corresponding timer;
and the second setting submodule is used for determining the uncomputed registered model with the timeout times reaching the preset timeout times as the registered model which does not upload tokens in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as the destroyed state.
Optionally, the method further comprises:
the timeout times setting module is used for setting the corresponding preset timeout times based on the resolving time and the destroying probability of each registered model.
In summary, in the device disclosed by the invention, when joint simulation is performed, the scheduling system counts each model, and adopts accumulation of natural time, and when the token state of the registered model reached by the next step is detected to be the sent state, the device stops the natural accumulation of time, and waits for the completion of the calculation of the registered model which is not calculated in the registered model reached by the next step. 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 quickened, and the simulation efficiency is improved.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
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 elements and steps are described above generally in terms of functionality in order to clearly illustrate the 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 solution. 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. The software modules may be disposed 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. The scheduling method of the super-real-time joint simulation is characterized by comprising the following steps of:
establishing a corresponding relation between each registered model and each token required by simulation; each token information comprises information representing a model to which the token belongs and a token state;
sending tokens to each registered model based on the corresponding relation so as to enable each registered model receiving the tokens to perform step length calculation, and setting the token state of each token as a sent state;
when each registered model carries out step length calculation, carrying out time natural accumulation;
setting the token state of the registered model of the submitted token to a recovered state; the registered model is submitted to the token after the calculation is completed;
When the time is naturally accumulated to one or more registered models and the next step length is reached, detecting the token state of the registered model with the reached next step length;
if the token state of the registered model with the reached next step is detected to be the sent state, stopping time is accumulated naturally, and the registered model which is not resolved in the registered model with the reached next step is waited for to be resolved.
2. The method as recited in claim 1, further comprising:
if the token states of the registered models which are reached by the next step are all recovered states, then the time natural accumulation is continued, and the tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that the registered models which are reached by the next step are subjected to step calculation, and the token states of the registered models which are reached by the next step are set to be sent states.
3. The method as recited in claim 1, further comprising:
starting a timer of the registered model which is not calculated to be completed to time; wherein a registered model is provided with a timer;
setting a corresponding model state as a destroyed state for a registered model in which no token is submitted in a corresponding preset timeout period in the uncomputed registered model; wherein, a registered model corresponds to a preset timeout period;
And when the state of the registered model with the next step is in the recovered state and the state of the model is in the destroyed state, continuously and naturally accumulating time for the target registered model with the token state of the registered model with the next step being in the recovered state, and sending the token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step resolving, and setting the target registered model as the sent state.
4. A method according to claim 3, wherein for a registered model for which no token has been submitted within a corresponding preset timeout period of the uncomputed registered models, setting the corresponding model state to a destroyed state comprises:
recording a timeout for a registered model which is not submitted with a token after the timer finishes in the registered model which is not calculated, and restarting a corresponding timer;
and determining the uncomputed registered model with the timeout times reaching the preset timeout times as a registered model of which the token is not submitted in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as a destroyed state.
5. The method as recited in claim 4, further comprising:
and setting corresponding preset timeout times based on the resolving time and destroying probability of each registered model.
6. A scheduling device for super real-time joint simulation, comprising:
the building module is used for building the corresponding relation between each registered model and each token required by simulation; each token information comprises information representing a model to which the token belongs and a token state;
the sending module is used for sending tokens to each registered model based on the corresponding relation so as to enable the registered model of each received token to carry out step length calculation and set the token state of each token as a sent state;
the first time natural accumulation module is used for carrying out time natural accumulation when each registered model carries out step length calculation;
the first setting module is used for setting the token state of the registered model of the submitted token into a recovered state; the registered model is submitted to the token after the calculation is completed;
the detection module is used for detecting the token state of the registered model with the reached next step length when the time is naturally accumulated to one or more registered models with the reached next step length;
And the execution waiting module is used for naturally accumulating the stopping time if the token state of the registered model with the reached next step is detected to be the sent state, and waiting for the completion of the resolving of the registered model which is not resolved to be completed in the registered model with the reached next step.
7. The apparatus as recited in claim 6, further comprising:
the second time natural accumulation module is used for: if the token states of the registered models which are reached by the next step are all recovered states, then the time natural accumulation is continued, and the tokens are sent to the registered models which are reached by the next step based on the corresponding relation, so that the registered models which are reached by the next step are subjected to step calculation, and the token states of the registered models which are reached by the next step are set to be sent states.
8. The apparatus as recited in claim 6, further comprising:
the first timer starting module is used for starting a timer of the registered model which is not resolved to be completed to time; 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 period in the registered model which is not resolved; wherein, a registered model corresponds to a preset timeout period;
And the third time natural accumulation module is used for continuously carrying out time natural accumulation on a target registered model with the token state of the registered model reached in the next step length being the recovered state when the token state of the registered model reached in the next step length is both the recovered state and the destroyed state, sending a token to the target registered model based on the corresponding relation so as to enable the target registered model to carry out step length calculation, and setting the target registered model to be the sent state.
9. The apparatus of claim 8, wherein the second setting module comprises:
the second timer starting sub-module is used for recording one time overtime for the registered model which is not submitted with the token after the timer finishes timing in the registered model which is not solved, and restarting the corresponding timer;
and the second setting submodule is used for determining the uncomputed registered model with the timeout times reaching the preset timeout times as the registered model which does not upload tokens in the corresponding preset timeout time in the uncomputed registered model, and setting the corresponding model state as the destroyed state.
10. The apparatus as recited in claim 9, further comprising:
the timeout times setting module is used for setting the corresponding preset timeout times based on the resolving time and the destroying probability of each registered model.
CN202110566841.9A 2021-05-24 2021-05-24 Scheduling method and device for super-real-time joint simulation Active CN113110114B (en)

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 CN113110114A (en) 2021-07-13
CN113110114B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929158B (en) * 2012-10-30 2015-01-07 北京华力创通科技股份有限公司 Multi-core multi-model parallel distributed type real-time simulation system
US10755003B2 (en) * 2013-11-08 2020-08-25 Rockwell Automation Technologies, Inc. Time synchronization of signal transmission intervals for simulating a machine in industrial automation
CN105930580B (en) * 2016-04-19 2021-06-22 国家电网公司 Time synchronization and data exchange device and method for joint simulation of power system and information communication system
CN106559273B (en) * 2017-01-19 2019-10-25 中国人民解放军国防科学技术大学 Self-adaptive service quality priority dispatching method towards time trigger Ethernet
CN107301884B (en) * 2017-07-24 2019-07-16 哈尔滨工程大学 A kind of hybrid nuclear power station method for diagnosing faults
MA41572B1 (en) * 2017-12-05 2019-08-30 Atlan Space Autonomous navigation and behavior of unmanned vehicle without connection to the control station

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113110114A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN113110114B (en) Scheduling method and device for super-real-time joint simulation
EP3447642A1 (en) System and method for predicting application performance for large data size on big data cluster
CN108351707B (en) Man-machine interaction method and device, terminal equipment and computer readable storage medium
EP3103014B1 (en) Removal of idle time in virtual machine operation
CN108804231B (en) Memory optimization method and device, readable storage medium and mobile terminal
CN110297703B (en) Method and device for simulating hardware task scheduling in real-time simulation system
CN114625108B (en) Simulation test method and device
CN109656775A (en) By the method and apparatus, related computer program and the avionics system that execute time monitoring avionics hardware application program
US20170329730A1 (en) Method and unit for handling interrupts in a system
US11567489B2 (en) Method and device for efficient fault analysis through simulated faults in a digital twin
Renault et al. Adapting models to model checkers, a case study: Analysing aadl using time or colored petri nets
KR101613887B1 (en) Method of real time simulation and simulation device performing the same
CN104008046A (en) Method and device for testing programs
CN111679924B (en) Reliability simulation method and device for componentized software system and electronic equipment
CN115496016A (en) Double-clock multi-core embedded concurrent time sequence simulation method and device
US7630875B2 (en) Automatic time warp for electronic system simulation
CN103838701A (en) Data processing apparatus and method in PLC system
CN107122489B (en) Data comparison method and device
CN107272822A (en) A kind of system clock monitoring method and device
CN114397875B (en) Automatic production line spoofing attack detection method and system based on random control
TWI788894B (en) Memory control circuit and method for controlling erasing operation of flash memory
CN115277153B (en) Smart grid 5G network risk assessment system and assessment method
CN116739115B (en) Unmanned aerial vehicle escape strategy modeling-oriented data sample generation method and system
RU2636699C2 (en) Device of modeling technological control processes of technical objects
JP6949440B2 (en) Vector generator and vector generator program

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