Device and method for simulating in sync with real-time system

By synchronizing the calculation cycle of offline simulation and real-time system in embedded system development, the data exchange delay problem is solved, and the reliability and accuracy of simulation results are achieved, ensuring the unified and minimized delays in the simulation process.

CN110945511BActive Publication Date: 2024-12-24ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201880052587.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-08-14
Filing Date
2018-08-03
Publication Date
2024-12-24
Estimated Expiration
2038-08-03

AI Technical Summary

Technical Problem

During the development of embedded systems, there is data exchange delay in the coupling between offline simulation models and real-time systems, resulting in inaccurate simulation results and low reliability, especially in hardware verification and real-world simulation.

Method used

By synchronizing the calculation cycle of offline simulation and real-time system at the beginning of the simulation, using the trigger pulse of the real-time system and the macro stride of the offline simulation, ensuring that the delay of data exchange is constant and minimized during the simulation process, the adaptive calculation cycle method is adopted. to reduce latency.

Benefits of technology

The unified and minimized data exchange delays during the simulation process are realized, making the simulation results more reliable, avoiding the phenomenon of doubling the delay in the simulation process, and improving the accuracy and reliability of the simulation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110945511B_ABST
    Figure CN110945511B_ABST
Patent Text Reader

Abstract

A method for simulating a simulation model on a computer synchronously with a real-time system, wherein the simulation and the real-time system each have a calculation cycle with a consistent macrostep #imgabs0#, characterized by the following features: - waiting for a message from the real-time system; - measuring the time at which the message is received by the simulation; - waiting for at least one other message from the real-time system; - measuring the time at which the other message is received by the simulation; - calculating an average reception time from the times at which the message and the at least one other message are received; determining the start time of the simulation based on the average reception time, so that the result of the macrostep #imgabs1# of the real-time system is available for the simulation at the start of the macrostep #imgabs2#.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for simulating synchronously with a real-time system. The invention further relates to a corresponding device, a corresponding computer program and a corresponding storage medium. Background Art

[0002] Embedded systems rely on decisive input signals from sensors and stimulate their own surroundings again via output signals to various actuators. During the validation and pre-development phases of such systems, their models (model in the loop, MiL), software (software in the loop, SiL), processors (processor in the loop, PiL) or the entire hardware (hardware in the loop, HiL) are therefore simulated together with a model of the environment in a control loop. In vehicle engineering, simulators corresponding to this principle for testing electronic control units are occasionally referred to as component test benches, module test benches or integration test benches, depending on the test phase and the test object.

[0003] DE 10303489A1 discloses a method for testing the software of a control unit of a vehicle, wherein a control object that can be controlled by the control unit is at least partially simulated by a test system, in that an output signal is generated by the control unit and this output signal of the control unit is transmitted to a first hardware module via a first connection and a signal of a second hardware module is transmitted as an input signal to the control unit via a second connection, wherein the output signal is provided as a first control value in the software and is additionally transmitted to the test system in real time with respect to the control object via a communication interface.

[0004] US 2009 / 0063120 A1 relates to a system for performing emulation or co-simulation of hardware and software. The system comprises: a hardware simulator having an integrated hardware model; a hardware or software environment for controlling the hardware simulator and executing software simulation or direct software application; at least one synchronization device in the hardware model for describing the requirements of the hardware or software environment; a receiver for placing the synchronization device in a predetermined state; and a control device for switching the hardware simulator between an idle state and an operation request state. Summary of the invention

[0005] The invention provides a method for simulating synchronously with a real-time system, a corresponding device, a corresponding computer program and a corresponding storage medium according to the independent claims.

[0006] The proposed approach is based on the recognition that the construction of expensive real prototypes can be further postponed in the further development process by coupling engine test benches or other component test benches with offline simulation models for the purpose of hardware verification, i.e. co-simulation, which meets the so-called "soft real-time requirements". This makes it possible, for example, to study the influence of traffic conditions and ambient conditions on the behavior of real components, such as the emissions of internal combustion engines in actual driving operation (real driving emissions, RDE), on the test bench. With such a coupling of the test bench with the offline simulation model, such tests can be carried out during the development process without a test vehicle suitable for the road.

[0007] The proposed approach is also based on the recognition that in the coupling of an offline simulation model and a real-time system, delays occur in the data exchange which can falsify the simulation results.

[0008] The advantage of the solution described below therefore lies in the achieved adaptation of the calculation cycle of the offline simulation to the calculation cycle of the real-time system in order to make the delays occurring in the data exchange uniform. The simulation results thus become more reliable. In many cases, the unification of the delays also corresponds to their minimization. The synchronization is carried out at the beginning of the simulation in order to make the delays constant during the entire simulation process.

[0009] Advantageous developments and improvements of the basic idea described in the independent claim are possible by means of the measures mentioned in the dependent claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Embodiments of the invention are shown in the drawings and are further explained in the following description.

[0011] Figure 1 Schematically illustrating a first simulation process;

[0012] Figure 2 schematically illustrating a second simulation process;

[0013] Figure 3 A flow chart showing a method according to one embodiment;

[0014] Figure 4 A stand-alone operating computer according to a second specific embodiment is shown schematically. DETAILED DESCRIPTION

[0015] The coupling described hereafter by way of example consists of two mutually independent components. One component (usually a separate operating computer with a suitable operating system) performs the offline simulation. The other component is a real-time system, for example an engine test bench. The offline simulation and the real-time system coordinate their calculations with regard to the different trigger pulses. The calculation cycle t r ,t r+1 ,t r+2 …, the calculation of the real-time system runs in this calculation cycle. The cycle t of the offline simulation k ,t k+1 ,t k+2 ...is determined in a similar manner by starting the offline simulation. The interval between the corresponding trigger pulses is determined by a consistent macrostep In contrast, the starting points of the calculation cycles are independent of each other, since the offline simulation and the real-time system are physically separated from each other. As a result, the calculation cycles of the two components are shifted in a random manner during each simulation.

[0016] exist Figure 1 and Figure 2 It is shown in the figure that these two calculation cycles t r ,t r+1 ,t r+2 …and t k ,t k+1 ,t k+2 ... influences the data exchange. The bars shown mark the duration of the calculation in the respective subsystem. The horizontal bar in this case represents the calculation duration of the model for offline simulation or the following cycle time t U , which is the cycle time required for communication with the real-time system; the vertical bars mark the duration of the data exchange between the models of the offline simulation 11, 12 or 21, 22, which is coordinated by the host of the offline simulation.

[0017] exist Figure 1 FIG. 1 shows a simulation process 10 in which the two calculation cycles t r ,t r+1 ,t r+2 …and t k ,t k+1 ,t k+2 The starting time points of ... are represented relative to each other so that at the macro time step Data exchange is possible within t. k The values ​​of 11 and 12 can be simulated offline in consideration of the cycle time t U At time t r is processed by the real-time system 13 and its result is at time t k+1Again, it is available for offline simulation 11 , 12 .

[0018] Figure 2 A simulation process 20 is shown, in which the two calculation cycles t r ,t r+1 ,t r+2 …and t k ,t k+1 ,t k+2 The starting time points of ... behave unfavorably relative to each other. At time point t k The values ​​of the offline simulation 21 and 22 are due to the cycle time t U But it cannot be done at time t r is processed by the real-time system 23, and its result is thus available at time t k+2 The delay is thus doubled to two macro time steps 2 during the data exchange process during the entire simulation process. .

[0019] In which the delay is two macro time steps 2 The results of a simulation process with a delay of t are significantly worse than the results of a simulation process in which the delay is smaller. The central aspect of the proposed approach is therefore that the two calculation cycles t r ,t r+1 ,t r+2 …and t k ,t k+1 ,t k+2 ... are synchronized so that their conditions are optimized relative to each other and the delays are unified. The calculation period t r ,t r+1 ,t r+2 …and t k ,t k+1 ,t k+2 …like Figure 2 Simulation processes that are disadvantageous relative to one another as shown are avoided in this way. This ensures that the delays in all simulation processes are minimized and uniform.

[0020] In this regard, according to Figure 3 The method (30) shown in , at the beginning of the offline simulation, adapts the computing cycle of the already running real-time system and the computing cycle of the offline simulation before the simulation starts to it. To this end, the cycle is first measured , the offline simulation receives messages from the real-time system in this cycle. With the known cycle time t U , the optimal calculation period of offline simulation can be determined. It is also known that in order to determine the period, only the starting time t1 must be determined.

[0021] For this purpose, we first wait until a message from the real-time system arrives (event 31). The time of this event is measured (process 32). Since individual time measurements can be imprecise (this should be noted, for example, when using a separate working computer for executing the method (30)), in the next step the measurement (32) is averaged with other measurements (33). To this end, a further message is waited for (event 34), which should arrive exactly one macro time step after the previous message. Arrival. Variable t Cal The value of increases with the degree of deviation between the measured time and the expected time (process 33). The process is repeated several times (decision 35, branch T) until the number n of processed messages corresponds to the set sampling range nCal (decision 35, branch F). Next, the average deviation t of the other time measurements is calculated. Cal,av is determined (process 36). In the final step (process 37), t1 is determined by substituting t Cal,av from Subtract. In the macro stride Therefore, the cycle is determined , messages arrive from the real-time system at said period.

[0022] This method (30) can be implemented, for example, in software or hardware or in a hybrid form consisting of software and hardware, for example in a stand-alone computer (40), such as Figure 4 As illustrated by the schematic diagram.

Claims

1. A method (30) for synchronizing an offline simulation (11, 12, 21, 22) with a real-time system (13, 23), wherein the real-time system (13, 23) comprises a test bench, and wherein the offline simulation (11, 12, 21, 22) is performed with the aid of an independent working computer (40), and the working computer and the real-time system are physically separated from each other and communicate with each other for the joint simulation, characterized in that Before starting the simulation, the independent working computer performs the following steps: - Waiting for the message from the real-time system (13, 23); - measuring the time of receipt of said message; - waiting for at least one other message from the real-time system (13, 23); - measuring the reception time of said other message; - forming the time difference between these reception time points; - determining a deviation of the time difference from a predefined macrostep of the simulation (11, 12, 21, 22); and - determining a starting time of the simulation (11, 12, 21, 22) based on the deviation, wherein the determined starting time enables the calculation cycle of the offline simulation (11, 12, 21, 22) to be adapted to the calculation cycle of the already running real-time system (13, 23) in such a way that the off-line simulation (11, 12, 21, 22) can be run while taking into account the cycle time t required for communication with the real-time system (13, 23). U In this case, the data exchange between the real-time system (13, 23) and the independent working computer is completed within a macro time step ΔT.

2. The method (30) according to claim 1, Features The following features: - detect the number of messages waiting; - As long as the number does not reach the set sampling range, the waiting and measuring are repeated; - once the number corresponds to the set sampling range, the average value of the corresponding deviations is formed; and - Determining the starting time point according to the average value.

3. The method (30) according to claim 2, It is characterized by the following features: - by adding up the corresponding deviations, a sum is formed and The mean value is determined mathematically by dividing the sum by the sampling range.

4. The method (30) according to any one of claims 1 to 3, It is characterized by the following features: - The real-time system (13, 23) comprises an engine test bench.

5. The method (30) according to any one of claims 1 to 3, It is characterized by the following features : The message is transmitted to the engine test bench via CAN.

6. The method (30) according to any one of claims 1 to 3, It is characterized by the following features: - The simulation (11, 12, 21, 22) is a collaborative simulation (11, 12, 21, 22) of multiple models.

7. A computer program product comprising machine-readable instructions which, when executed on a computer, cause the computer to perform the method (30) according to any one of claims 1 to 6.

8. A machine-readable storage medium on which the computer program product according to claim 7 is stored.

9. A device (40) configured to carry out the method (30) according to any one of claims 1 to 6.