Simulation method and system for data transmission delay and running tool
By introducing the simulation clock module, target simulation function module and simulation delay configuration module in the on-board network, the problem of difficult module operation frequency due to insufficient computing performance in the prior art is solved, and editability and reproducibility of data transmission delay are realized, ensuring the accuracy of simulation results and efficient utilization of resources.
Patent Information
- Application Number
- CN202411836326.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-12
AI Technical Summary
The existing simulation solutions for on-board network data transmission delays are not sufficient when the computing performance is insufficient, and the module operation frequency is difficult to meet the requirements, and when using network delay to simulate data transmission delays, they do not have editability and reproducibility.
Provides a simulation method for data transmission delay, through the joint work of the simulation clock module, the target simulation function module and the simulation delay configuration module, the simulation operation is iteratively performed until the simulation end condition is met. The method includes broadcasting the current frame clock signal, responding to and calculating functional data, sending a delay request and receiving delay information, outputting functional data, and broadcasting a simulation end instruction when the simulation end condition is met.
In the case of insufficient computing performance, the stability of the module's operating frequency and the editability and reproducibility of simulation delay are achieved, which avoids resource waste and ensures the accuracy of simulation results.
Smart Images

Figure CN119629069A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a simulation method, system and driving tool for data transmission delay. Background Art
[0002] In the existing simulation scheme for vehicle network data transmission delay, the simulation clock uses the device system clock, that is, the clock is consistent with the real world, resulting in a strong correlation between the calculation speed of each simulation module and the device performance. Different devices will have different calculation times in different resource environments. When the computing performance is insufficient, the module's operating frequency is difficult to meet the requirements. In addition, the use of network delay to simulate the data transmission delay of each module in the real product is not editable and reproducible. Summary of the invention
[0003] In view of this, the present invention provides a simulation method, system and driving tool for data transmission delay to solve the problem that when the computing performance is insufficient, the module's operating frequency is difficult to meet the requirements, and using network delay to simulate the data transmission delay of each module in the actual product is not editable and reproducible.
[0004] In a first aspect, the present invention provides a method for simulating data transmission delay, which is applied to a simulation clock module. The method comprises: iteratively performing simulation operations until a simulation end condition is met. The simulation operations comprise: broadcasting a current frame clock signal targeted by the simulation operation so that a target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on corresponding upstream data, obtains functional data, and sends a current frame delay request to a simulation delay configuration module. After receiving the delay information of the current frame data sent by the simulation delay configuration module, the function data is output based on the delay information of the current frame data, wherein the target simulation function module is any one of a plurality of simulation function modules; the delay information of the current frame data is generated based on the target simulation function module identifier in the current frame delay request and the current frame clock signal after the simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, and sends the delay information of the current frame data to the target.
[0005] The simulation function module; the current frame clock signal at least includes the simulation time of the current frame, wherein the simulation time of the current frame is determined according to a preset simulation step; receiving the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, determining that the simulation operation is executed.
[0006] In an optional implementation, the simulation end condition is satisfied at least including that the simulation time of the current frame reaches a preset simulation time, and / or the vehicle ends driving.
[0007] In an optional implementation, the method further includes: if the simulation end condition is met, broadcasting a simulation end instruction, so that the target simulation function module responds to the simulation end instruction and ends the function simulation.
[0008] After determining that the simulation end condition is currently met, the simulation clock module of the present invention can immediately broadcast a simulation end instruction to end the simulation of each target simulation function module, thereby avoiding the waste of simulation resources.
[0009] In an optional embodiment, the following steps are used to determine whether all simulation function modules have completed the simulation of the current frame: receiving the current frame processing completion information sent by the target simulation function module, marking the target simulation function module, and detecting whether all target simulation function modules have been marked; if all target simulation function modules have been marked, it is determined that all simulation function modules have completed the simulation of the current frame.
[0010] The simulation clock module of the present invention can accurately and conveniently reflect the current frame simulation status of each simulation function module by marking the simulation function module that receives the current frame processing completion information, ensuring that the next frame clock signal is sent only after all simulation function modules have completed the current frame simulation.
[0011] In a second aspect, the present invention provides a method for simulating data transmission delay, which is applied to a target simulation function module, wherein the target simulation function module is any one of a plurality of simulation function modules, and the method comprises: in response to a current frame clock signal broadcast by a simulation clock module, performing calculations based on corresponding upstream data to obtain functional data, wherein the current frame clock signal at least includes a simulation time of a current frame, wherein the simulation time of the current frame is determined according to a preset simulation step size, and the current frame clock signal is a current frame clock signal for a simulation operation broadcast by the simulation clock module; sending a current frame delay request to a simulation delay configuration module, and upon receiving the current frame data sent by the simulation delay configuration module After receiving the delay information of the current frame data, the functional data is output based on the delay information of the current frame data, where the delay information of the current frame data is the delay information of the current frame data generated by the simulation delay configuration module in response to the current frame delay request sent by the target simulation function module based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, and sent to the target simulation function module; the current frame processing completion information is sent to the simulation clock module so that the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively performed until the simulation end condition is met.
[0012] In an optional implementation, the method further includes: ending the functional simulation in response to a simulation end instruction broadcast by the simulation clock module, wherein the simulation end instruction is an instruction broadcast by the simulation clock module when determining that a simulation end condition is met.
[0013] In an optional embodiment, the target simulation function module integrates a calculation frame time set, and the calculation frame time is calculated by preset simulation step size and the operating frequency of the target simulation function module. The calculation based on the corresponding upstream data to obtain the functional data includes: judging whether the trigger condition is met. When the trigger condition is met, the calculation is based on the corresponding upstream data to obtain the functional data. The trigger condition is met, including: the current frame simulation time is in the calculation frame time set; if the trigger condition is not met, the functional data is set to empty data.
[0014] After responding to the current frame clock signal, the target simulation function module of the present invention can first determine whether the current frame simulation time is in the calculation frame time set, and only output function data if it is in the calculation frame time set, thereby avoiding resource waste of the simulation function module.
[0015] In an optional embodiment, the delay information of the current frame data includes at least a delay time, and the outputting of the functional data based on the delay information of the current frame data includes: determining a target frame position for placing the functional data in the message queue based on the delay time and a preset simulation step, and filling the target frame position with the functional data; filling the frame position in the message queue that does not store data before the target frame position with preset data, and clearing the data in the frame position after the target frame position; determining the data in the first frame position in the message queue as functional data, and outputting it, and moving the functional data that is not output in the message queue forward by one frame position based on the frame position where it is stored.
[0016] The target simulation function module of the present invention places the function data at the corresponding position in the message queue based on the delay time, and outputs the first data in the message queue when outputting data, so as to ensure that the output data are all the latest.
[0017] In a third aspect, the present invention provides a method for simulating data transmission delay, which is applied to a simulation delay configuration module. The method comprises: in response to a current frame delay request sent by a target simulation function module, based on a target simulation function module identifier in the current frame delay request and a current frame clock signal, generating delay information of the current frame data, and sending the information to the target simulation function module. The current frame delay request is a current frame clock signal broadcast by the target simulation function module in response to a simulation clock module, which is calculated based on corresponding upstream data to obtain functional data and then sent to the simulation delay configuration module. The current frame clock signal at least includes a simulation time of the current frame, wherein the simulation time of the current frame is calculated based on a preset simulation step. It is long determined that the current frame clock signal is the current frame clock signal targeted by the simulation operation broadcast by the simulation clock module, and the target simulation function module is any one of the multiple simulation function modules; after receiving the delay information of the current frame data sent by the simulation delay configuration module, the target simulation function module outputs the function data based on the delay information of the current frame data, and sends the current frame processing completion information to the simulation clock module, so that the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively executed until the simulation end condition is met.
[0018] In an optional embodiment, the delay information at least includes the delay time, and the delay information of the current frame data is generated based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, including: determining the delay time of the current frame data based on the correspondence between different simulation time periods corresponding to the target simulation function module and the delay time and the simulation time of the current frame, or inputting the simulation time of the current frame into a random delay model corresponding to the target simulation function module to obtain the delay time of the current frame data, or inputting the simulation time of the current frame into a delay time prediction model corresponding to the target simulation function module to obtain the delay time of the current frame data, and the delay time prediction model is obtained by training based on historical simulation time and delay time correspondence data.
[0019] The simulation delay configuration module of the present invention simulates different delay scenarios through different model parameters to verify the reliability of the system. As long as the model parameters are the same, the corresponding delay effects are consistent, ensuring that the delay scenarios can be accurately reproduced.
[0020] In a third aspect, the present invention provides a simulation system for data transmission delay, the system comprising a simulation clock module, a target simulation function module and a simulation delay configuration module, the target simulation function module being any one of a plurality of simulation function modules, wherein the simulation clock module iteratively performs a simulation operation until a simulation end condition is met, the simulation operation comprising: the simulation clock module broadcasts a current frame clock signal targeted by the simulation operation, the current frame clock signal at least comprising a simulation time of the current frame, and the simulation time of the current frame is determined according to a preset step size; the target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on corresponding upstream data, obtains functional data, and transmits the simulation delay to the simulation delay module. The configuration module sends a current frame delay request; the simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, generates delay information of the current frame data based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, and sends it to the target simulation function module; after receiving the delay information of the current frame data sent by the simulation delay configuration module, the target simulation function module outputs the functional data based on the delay information of the current frame data, and sends current frame processing completion information to the simulation clock module; the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and determines that the simulation operation is completed when it is determined that all simulation function modules have completed the simulation of the current frame.
[0021] The present invention provides a simulation system for data transmission delay, in which a simulation clock module broadcasts a current frame clock signal targeted by a simulation operation, a target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on corresponding upstream data, obtains functional data, and sends a current frame delay request to a simulation delay configuration module. After the simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, generates delay information of the current frame data, and sends it to the target simulation function module. The target simulation function module outputs functional data based on the delay information of the current frame data, and sends it to the simulation clock module. Send the current frame processing completion information, the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively performed until the simulation end condition is met. Among them, the clock signal emitted by the simulation clock module does not adopt the existing system clock, but dynamically adjusts the timing of sending the clock signal according to the feedback of the completion of each simulation function module to ensure that each module can complete the current frame before receiving the clock signal of the next frame, and the simulation delay configuration module determines the specific delay information based on the simulation function module identifier and the current frame clock signal to ensure that the delay scenario can be accurately reproduced.
[0022] In a fourth aspect, the present invention provides a traveling tool, which includes the simulation system for data transmission delay described in the third aspect.
[0023] In an optional embodiment, the travel vehicle is a vehicle, an aircraft or a flying car. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a structural block diagram of a simulation system for data transmission delay according to an embodiment of the present invention;
[0026] Figure 2 is an example diagram of interaction of a simulation system for data transmission delay according to an embodiment of the present invention;
[0027] Figure 3 is a schematic diagram of interaction between modules of a simulation system for data transmission delay according to an embodiment of the present invention;
[0028] Figure 4 is a structural block diagram of a traveling tool according to an embodiment of the present invention;
[0029] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] The present invention provides a simulation system for data transmission delay, such as Figure 1As shown, the system includes a simulation clock module 1, a target simulation function module 2 and a simulation delay configuration module 3, wherein the target simulation function module 2 is any one of a plurality of simulation function modules (simulation function nodes), wherein the simulation clock module 1 iteratively performs simulation operations until a simulation end condition is met, and the simulation operations include: the simulation clock module 1 broadcasts a current frame clock signal targeted by the simulation operation, the current frame clock signal at least includes a simulation time of the current frame, and the simulation time of the current frame is determined according to a preset step size; the target simulation function module 2 responds to the current frame clock signal broadcast by the simulation clock module 1, performs calculations based on corresponding upstream data, obtains functional data, and sends the current frame to the simulation delay configuration module 3. Delay request; the simulation delay configuration module 3 responds to the current frame delay request sent by the target simulation function module 2, generates the delay information of the current frame data based on the target simulation function module 2 identifier in the current frame delay request and the current frame clock signal, and sends it to the target simulation function module 2; after receiving the delay information of the current frame data sent by the simulation delay configuration module 3, the target simulation function module 2 outputs the functional data based on the delay information of the current frame data, and sends the current frame processing completion information to the simulation clock module 1; the simulation clock module 1 receives the current frame processing completion information sent by the target simulation function module 2, and when it is determined that all simulation function modules have completed the simulation of the current frame, it determines that the simulation operation is executed.
[0032] The simulation function module of the embodiment of the present invention may include but is not limited to a navigation algorithm module, a flight control algorithm module and a dynamics module for realizing the vehicle driving function, for example, Figure 2 As shown, when the simulation starts, all simulation function modules are initialized, and after the initialization is completed, the initialization completion information is fed back to the simulation clock module 1. After the simulation clock module 1 detects that all simulation function modules have been initialized, it can send the current frame clock signal for the current simulation operation in the form of broadcast, wherein the clock signal includes the simulation time and the simulation step length that are gradually accumulated from zero. Generally, the current frame simulation time sent by the simulation clock module 1 for the first time after the initialization is completed is 0s, for example only.
[0033] like Figure 2As shown, the target simulation function module 2 of the embodiment of the present invention can maintain a state of waiting for message data after initialization is completed, that is, waiting for the current frame clock signal and upstream dependent data, wherein the upstream dependent data is generally various sensor data, and when responding to the current frame clock signal broadcast by the simulation clock module 1 and receiving the upstream data, it can perform corresponding calculations based on the upstream data to obtain the functional data corresponding to the current frame; before outputting the functional data corresponding to the current frame, the target simulation function module 2 can first send a current frame delay request to the simulation delay configuration module 3, wherein the current frame delay request includes the target simulation function module 2 identifier, such as the node name.
[0034] The simulation delay configuration module 3 of the embodiment of the present invention responds to the current frame delay request sent by the target simulation function module 2, and can determine the delay information of the current frame data of the target simulation function module 2 based on the target simulation function module 2 identifier and the current frame simulation time, and send the delay information of the current frame data to the target simulation function module 2, wherein the delay information at least includes the delay time (the delay time is generally n milliseconds, n≥0, and can be divided by the preset simulation step (milliseconds), representing that the current frame data is delayed by n milliseconds to be sent), and the simulation delay configuration module 3 can obtain the current frame simulation time in a manner that the target simulation function module 2 sends the current frame delay request, or the simulation delay configuration module 3 responds to the current frame clock signal broadcast by the simulation clock module 1, just as an example; there is no limitation on how to determine the delay information of the current frame data, and the simulation delay configuration module 3 can be pre-integrated with a relational database of simulation times and delay times corresponding to all simulation function modules, such as a relational curve, and the delay information of the current frame data is determined by searching the relational database, just as an example.
[0035] After receiving the delay information of the current frame data sent by the simulation delay configuration module 3, the target simulation function module 2 of the embodiment of the present invention can delay the output of the calculated function data based on the delay time in the delay information. The data outputted corresponding to the current frame can be a preset default value, or the function data calculated by the historical frame can be outputted. For example, Figure 2As shown, after outputting data, the target simulation function module 2 can send current frame processing completion information to the simulation clock module 1, wherein the output of functional data or current frame processing completion information and other data can be transmitted through the message middleware, including but not limited to inter-process communications such as TCP, UDP and shared memory, just as an example; after the simulation clock module 1 receives the current frame processing completion information sent by the target simulation function module 2, it can record the simulation function module that has completed the current frame simulation, and when it is determined that all simulation function modules have completed the simulation of the current frame, it can determine whether the current frame meets the simulation end condition, wherein the simulation end condition may include that the vehicle completes the specified route or route, just as an example, if it is determined that the current frame does not meet the simulation end condition, the simulation time can be increased based on the preset simulation step size to obtain the next frame clock signal, and the next frame clock signal is broadcast, and then the above-mentioned simulation operation is repeated until the simulation end condition is met.
[0036] The present invention provides a simulation system for data transmission delay, in which a simulation clock module broadcasts a current frame clock signal targeted by a simulation operation, a target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on corresponding upstream data, obtains functional data, and sends a current frame delay request to a simulation delay configuration module. After the simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, generates delay information of the current frame data, and sends it to the target simulation function module. The target simulation function module outputs functional data based on the delay information of the current frame data, and sends it to the simulation clock module. Send the current frame processing completion information, the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively performed until the simulation end condition is met. Among them, the clock signal emitted by the simulation clock module does not adopt the existing system clock, but dynamically adjusts the timing of sending the clock signal according to the feedback of the completion of each simulation function module to ensure that each module can complete the current frame before receiving the clock signal of the next frame, and the simulation delay configuration module determines the specific delay information based on the simulation function module identifier and the current frame clock signal to ensure that the delay scenario can be accurately reproduced.
[0037] Specifically, satisfying the simulation end condition at least includes that the simulation time of the current frame reaches a preset simulation time, and / or the vehicle ends driving.
[0038] In an optional implementation, if the simulation end condition is met, a simulation end instruction is broadcasted, so that the target simulation function module 2 responds to the simulation end instruction and ends the function simulation.
[0039] The simulation end conditions of the embodiment of the present invention may include but are not limited to the simulation time reaching the set simulation time, the aircraft or car completing the specified route or path, or the car collides and ends driving. As long as one of the above simulation end conditions is met, the simulation clock module 1 determines that the simulation is over and can send a simulation end instruction in the form of a broadcast. After the target simulation function module 2 responds to the simulation end instruction, the functional simulation can be ended.
[0040] After determining that the simulation end condition is currently met, the simulation clock module of the present invention can immediately broadcast a simulation end instruction to end the simulation of each target simulation function module, thereby avoiding the waste of simulation resources.
[0041] Specifically, the simulation clock module 1 determines that all simulation function modules have completed the simulation of the current frame through the following steps: receiving the current frame processing completion information sent by the target simulation function module 2, marking the target simulation function module 2, and detecting whether all target simulation function modules 2 have been marked; if all target simulation function modules 2 have been marked, it is determined that all simulation function modules have completed the simulation of the current frame.
[0042] After receiving the current frame processing completion information sent by the target simulation function module 2, the simulation clock module 1 of the embodiment of the present invention can mark the received flag of the simulation function module and detect whether the flags of all simulation function modules have been marked. If the flags of all simulation function modules have been marked, it is determined that all simulation function modules have completed the simulation of the current frame, which is just an example.
[0043] The simulation clock module of the present invention can accurately and conveniently reflect the current frame simulation status of each simulation function module by marking the simulation function module that receives the current frame processing completion information, ensuring that the next frame clock signal is sent only after all simulation function modules have completed the current frame simulation.
[0044] Specifically, the target simulation function module 2 is integrated with a calculation frame time set, wherein the calculation frame time is calculated by a preset simulation step and the operating frequency of the target simulation function module 2, and whether the trigger condition is met is judged. When the trigger condition is met, calculation is performed based on the corresponding upstream data to obtain the function data. Meeting the trigger condition includes: the current frame simulation time is in the calculation frame time set; if the trigger condition is not met, the function data is set to empty data.
[0045] The target simulation function module 2 of the embodiment of the present invention can predetermine the calculation frame time set of data calculation based on its own operating frequency and the simulation step size of the system. For example, if the operating frequency of the navigation algorithm module is 200 Hz and the simulation step size of the system is 0.001s, the calculation frame time set is determined to be 0s, 0.005s, 0.01s, 0.015s... For example, Figure 2 As shown, after responding to the current frame clock signal sent by the simulation clock module 1, it can be determined whether the current frame simulation time in the current frame clock signal is in the calculation frame time set. For example, if the current frame simulation time is 0.005s, it is determined to be in the calculation frame time set, and the functional data is calculated based on the corresponding upstream data; if the current frame simulation time is 0.002s, it is determined that it is not in the calculation frame time set, then the algorithm calculation can be omitted and the functional data can be directly set to empty data.
[0046] After responding to the current frame clock signal, the target simulation function module of the present invention can first determine whether the current frame simulation time is in the calculation frame time set, and only output function data if it is in the calculation frame time set, thereby avoiding resource waste of the simulation function module.
[0047] Specifically, the delay information of the current frame data at least includes the delay time. The target simulation function module 2 outputs the function data based on the delay information of the current frame data, including: determining the target frame position for placing the function data in the message queue based on the delay time and the preset simulation step, and filling the function data into the target frame position; filling the frame position in the message queue that does not store data before the target frame position with preset data, and clearing the data in the frame position after the target frame position; determining the data in the first frame position in the message queue as function data, and outputting it, and moving the function data that is not output in the message queue forward by one frame position based on its storage frame position.
[0048] After the target simulation function module 2 of the embodiment of the present invention obtains the delay time, it divides the delay time by the simulation step size to determine the target frame position for placing the function data in the message queue. For example, if the delay time is 0.005s, the simulation step size is 0.001s, and the corresponding target frame position is the 5th frame position, the function data is filled into the 5th frame position, and it is determined whether there is data in the 0-5 frame positions in the message queue. If some frame positions do not store data, they can be filled with preset data. For example, data is stored in the 0th, 1st and 2nd frame positions in the message queue, but no data is stored in the 3rd and 4th frames. In this case, the data in the previous 0th, 1st and 2nd frames can be kept unchanged, and the data in the 3rd and 4th frame positions can be filled in the 2nd frame position. The message queue can be filled with data or set data (based on the function data requirement setting), and the data in the position after the 5th frame of the message queue can be directly cleared; when outputting data in the current frame, the data in the position representing the first frame can be read from the message queue, and the data can be taken out of the message queue, and the taken data can be sent out. After the data in the position representing the first frame is sent out, the data in the corresponding subsequent frame position can be moved forward one frame position. For example, in the next frame simulation, if the target frame position corresponding to the calculated data is the 3rd frame position, the data is placed at the 3rd frame position, and all data after the 3rd frame position are cleared, including the data placed at the 5th frame position of the current frame mentioned above, to ensure that the output data are the latest.
[0049] The target simulation function module of the present invention places the function data at the corresponding position in the message queue based on the delay time, and outputs the first data in the message queue when outputting data, so as to ensure that the output data are all the latest.
[0050] Specifically, the delay information at least includes the delay time. The simulation delay configuration module 3 generates the delay information of the current frame data based on the target simulation function module 2 identifier in the current frame delay request and the current frame clock signal, including: determining the delay time of the current frame data based on the correspondence between different simulation time periods and the delay time corresponding to the target simulation function module 2 and the simulation time of the current frame, or inputting the simulation time of the current frame into the random delay model corresponding to the target simulation function module 2 to obtain the delay time of the current frame data, or inputting the simulation time of the current frame into the delay time prediction model corresponding to the target simulation function module 2 to obtain the delay time of the current frame data, and the delay time prediction model is obtained by training based on the correspondence data between historical simulation time and delay time.
[0051] like Figure 2As shown, the simulation delay configuration module 3 of the embodiment of the present invention integrates a fixed delay model, a random delay model and a delay time prediction model corresponding to each simulation function module, wherein the fixed delay model integrates the correspondence between different simulation time periods and delay times, that is, within any simulation time period, the corresponding delay time is the same; the random delay model simulates random changes based on a certain probability distribution (such as uniform distribution, normal distribution or Poisson distribution), so that the delay time output each time is different; the delay time prediction model can collect the correspondence data of historical simulation time and delay time in actual products to establish an empirical model, that is, predict future delay time based on historical data, and can also include discrete event simulation to determine the delay time, just as an example; after receiving the current frame delay request sent by the target simulation function module 2, the simulation delay configuration module 3 can first obtain the corresponding model based on the target simulation function module 2 identifier (any of the above three models can be used), and then input the simulation time of the current frame into the model to obtain the delay time of the current frame data, just as an example.
[0052] The simulation delay configuration module of the present invention simulates different delay scenarios through different model parameters to verify the reliability of the system. As long as the model parameters are the same, the corresponding delay effects are consistent, ensuring that the delay scenarios can be accurately reproduced.
[0053] The embodiment of the present invention also provides a method for simulating data transmission delay, which is applied to Figure 1 The simulation clock module 1, the target simulation function module 2 and the simulation delay configuration module 3 are shown, wherein Figure 3 As shown, the simulation clock module 1 is used to execute steps S101 to S105, the target simulation function module 2 is used to execute steps S201 to S203, and the simulation delay configuration module 3 is used to execute steps S301 to S303.
[0054] Step S101, iteratively perform simulation operations until simulation conditions are met, the simulation operations including: broadcasting a current frame clock signal targeted by the simulation operation, the current frame clock signal including at least a simulation time of the current frame, and the simulation time of the current frame is determined according to a preset step size.
[0055] Step S102, receiving the current frame processing completion information sent by the target simulation function module, and determining that the simulation operation is completed when it is determined that all simulation function modules have completed the simulation of the current frame.
[0056] Step S201, in response to the current frame clock signal broadcast by the simulation clock module, calculation is performed based on the corresponding upstream data to obtain functional data, and a current frame delay request is sent to the simulation delay configuration module.
[0057] Step S202: after receiving the delay information of the current frame data sent by the simulation delay configuration module, output the functional data based on the delay information of the current frame data.
[0058] Step S301, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, generate delay information of the current frame data and send it to the target simulation function module.
[0059] Please refer to the above embodiments for detailed description, which will not be repeated here.
[0060] The present invention provides a method for simulating data transmission delay. The simulation clock module broadcasts the current frame clock signal targeted by the simulation operation. The target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on corresponding upstream data, obtains functional data, and sends a current frame delay request to the simulation delay configuration module. After the simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, generates delay information of the current frame data, and sends it to the target simulation function module. The target simulation function module outputs the functional data based on the delay information of the current frame data, and sends it to the simulation clock module. Send the current frame processing completion information, the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively performed until the simulation end condition is met. Among them, the clock signal emitted by the simulation clock module does not adopt the existing system clock, but dynamically adjusts the timing of sending the clock signal according to the feedback of the completion of each simulation function module to ensure that each module can complete the current frame before receiving the clock signal of the next frame, and the simulation delay configuration module determines the specific delay information based on the simulation function module identifier and the current frame clock signal to ensure that the delay scenario can be accurately reproduced.
[0061] The embodiment of the present invention provides a travel tool, such as Figure 4 As shown, the travel tool includes a simulation system for data transmission delay. Specifically, the travel tool may include but is not limited to a vehicle, an aircraft or a flying car, just as an example.
[0062] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0063] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0064] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0065] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0066] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0067] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0068] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0069] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0070] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for simulating data transmission delay, characterized in that: Applied to a simulation clock module, the method comprises: Iteratively performing a simulation operation until a simulation end condition is met, the simulation operation comprising: Broadcast the current frame clock signal targeted by the simulation operation, so that the target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on the corresponding upstream data, obtains function data, and sends a current frame delay request to the simulation delay configuration module, and after receiving the delay information of the current frame data sent by the simulation delay configuration module, outputs the function data based on the delay information of the current frame data, wherein the target simulation function module is any one of the multiple simulation function modules; the delay information of the current frame data is generated by the simulation delay configuration module in response to the current frame delay request sent by the target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, and sent to the target simulation function module; the current frame clock signal at least includes the simulation time of the current frame, wherein the simulation time of the current frame is determined according to a preset simulation step size; The current frame processing completion information sent by the target simulation function module is received, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is executed successfully.
2. The method according to claim 1, characterized in that The simulation end condition is satisfied at least including that the simulation time of the current frame reaches a preset simulation time, and / or the vehicle ends driving.
3. The method according to claim 2, characterized in that The method further comprises: If the simulation end condition is met, a simulation end instruction is broadcasted, so that the target simulation function module responds to the simulation end instruction and ends the function simulation.
4. The method according to claim 1, characterized in that: Use the following steps to ensure that all simulation function modules have completed the simulation of the current frame: Receiving current frame processing completion information sent by a target simulation function module, marking the target simulation function module, and detecting whether all target simulation function modules have been marked; If all target simulation function modules have been marked, it is determined that all simulation function modules have completed the simulation of the current frame.
5. A method for simulating data transmission delay, characterized in that: Applied to a target simulation function module, the target simulation function module is any one of a plurality of simulation function modules, the method comprising: In response to a current frame clock signal broadcast by the simulation clock module, calculation is performed based on corresponding upstream data to obtain functional data, wherein the current frame clock signal at least includes a simulation time of the current frame, wherein the simulation time of the current frame is determined according to a preset simulation step length, and the current frame clock signal is a current frame clock signal for which the simulation operation broadcast by the simulation clock module is directed; Sending a current frame delay request to the simulation delay configuration module, and after receiving the delay information of the current frame data sent by the simulation delay configuration module, outputting the functional data based on the delay information of the current frame data, wherein the delay information of the current frame data is generated by the simulation delay configuration module in response to the current frame delay request sent by the target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, and sent to the target simulation function module; Send the current frame processing completion information to the simulation clock module so that the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, determine that the simulation operation is completed, and iteratively execute the simulation operation until the simulation end condition is met.
6. The method according to claim 5, characterized in that The method further comprises: In response to a simulation end instruction broadcast by the simulation clock module, the functional simulation is ended. The simulation end instruction is an instruction broadcast by the simulation clock module when it determines that a simulation end condition is met.
7. The method according to claim 5, characterized in that The target simulation function module integrates a calculation frame time set, and the calculation frame time is calculated by a preset simulation step size and an operation frequency of the target simulation function module. The calculation based on the corresponding upstream data to obtain the function data includes: Determine whether a trigger condition is met, and when the trigger condition is met, calculate based on the corresponding upstream data to obtain function data, wherein the trigger condition is met including: the current frame simulation time is in the calculation frame time set; If the trigger condition is not met, the function data is set to empty data.
8. The method according to claim 5, characterized in that The delay information of the current frame data at least includes a delay time, and the outputting the function data based on the delay information of the current frame data includes: Based on the delay time and the preset simulation step length, determine the target frame position for placing the function data in the message queue, and fill the function data into the target frame position; Fill the frame positions in the message queue that do not store data before the target frame position with preset data, and clear the data in the frame positions after the target frame position; The data in the first frame position in the message queue is determined as functional data and outputted, and the functional data not outputted in the message queue is moved forward by one frame position based on the frame position where it is stored.
9. A method for simulating data transmission delay, characterized in that: Applied to the simulation delay configuration module, the method includes: In response to a current frame delay request sent by a target simulation function module, based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, delay information of the current frame data is generated and sent to the target simulation function module, wherein the current frame delay request is a request sent to the simulation delay configuration module after the target simulation function module obtains functional data by performing calculations based on corresponding upstream data in response to the current frame clock signal broadcast by the simulation clock module, wherein the current frame clock signal at least includes the simulation time of the current frame, wherein the simulation time of the current frame is determined according to a preset simulation step size, and the current frame clock signal is a current frame clock signal for the simulation operation broadcast by the simulation clock module, and the target simulation function module is any one of a plurality of simulation function modules; After receiving the delay information of the current frame data sent by the simulation delay configuration module, the target simulation function module outputs the function data based on the delay information of the current frame data, and sends the current frame processing completion information to the simulation clock module, so that the simulation clock module receives the current frame processing completion information sent by the target simulation function module, and when it is determined that all simulation function modules have completed the simulation of the current frame, it is determined that the simulation operation is completed, and the simulation operation is iteratively executed until the simulation end condition is met.
10. The method according to claim 9, characterized in that The delay information at least includes the delay time, and the delay information of the current frame data is generated based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, including: Based on the corresponding relationship between different simulation time periods and delay times corresponding to the target simulation function module and the simulation time of the current frame, the delay time of the current frame data is determined, or, Input the simulation time of the current frame into the random delay model corresponding to the target simulation function module to obtain the delay time of the current frame data, or, The simulation time of the current frame is input into the delay time prediction model corresponding to the target simulation function module to obtain the delay time of the current frame data, and the delay time prediction model is obtained by training based on the corresponding relationship data of the historical simulation time and the delay time.
11. A data transmission delay simulation system, characterized in that: The system comprises a simulation clock module, a target simulation function module and a simulation delay configuration module, wherein the target simulation function module is any one of a plurality of simulation function modules, wherein: The simulation clock module iteratively performs a simulation operation until a simulation end condition is met, wherein the simulation operation includes: the simulation clock module broadcasts a current frame clock signal targeted by the simulation operation, wherein the current frame clock signal includes at least a simulation time of the current frame, and the simulation time of the current frame is determined according to a preset step size; The target simulation function module responds to the current frame clock signal broadcast by the simulation clock module, performs calculations based on the corresponding upstream data, obtains function data, and sends a current frame delay request to the simulation delay configuration module; The simulation delay configuration module responds to the current frame delay request sent by the target simulation function module, generates delay information of the current frame data based on the target simulation function module identifier in the current frame delay request and the current frame clock signal, and sends it to the target simulation function module; After receiving the delay information of the current frame data sent by the simulation delay configuration module, the target simulation function module outputs the function data based on the delay information of the current frame data, and sends the current frame processing completion information to the simulation clock module; The simulation clock module receives the current frame processing completion information sent by the target simulation function module, and determines that the simulation operation is executed successfully when it is determined that all simulation function modules have completed the simulation of the current frame.
12. A traveling tool, characterized in that: The traveling tool comprises the simulation system for data transmission delay as claimed in claim 11.
13. The travel tool according to claim 12, characterized in that: The travel tool is a vehicle, an aircraft or a flying car.
Citation Information
Patent Citations
Distributed air-based simulation operation control management method
CN111966748A
Magnetic-levitation train operation simulation system
CN114578726A
Routing spacecraft channel time division multiplexing telemetering framing simulation method, device and system
CN118249887A
Simulation system for testing a radar system
US20210293924A1
Time synchronization and latency compensation for emulation test system
US20210356561A1