Real-time simulation method and system based on UDP network communication

CN122845447APending Publication Date: 2026-09-29NAVAL UNIV OF ENG PLA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611329355.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

目前现有仿真技术存在以下明显短板,难以满足工程实际需求:

Benefits of technology

[0045]结合上述的技术方案和解决的技术问题,请从以下几方面分析本发明所要保护的技术方案所具备的优点及积极效果为:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122845447A_ABST
    Figure CN122845447A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of real-time simulation, distributed simulation, visual visualization and semi-physical simulation, and discloses a real-time simulation method and system based on UDP network communication, which constructs a real-time simulation model with Simulink as the core, realizes bidirectional data exchange between the simulation model and visual simulation software through UDP network communication, and supports two modes of deployment on the same host and distributed deployment in a local area network. The application defines a unified UDP data frame structure, configures Simulink fixed-step real-time solving, designs a timestamp synchronization mechanism and a lightweight packet loss processing mechanism, guarantees low-delay and high-reliable interaction of simulation data, realizes real-time operation of control algorithms and synchronous rendering of three-dimensional visual scenes, and has the advantages of strong real-time performance, flexible deployment, good versatility, high development efficiency, low cost and the like, and is suitable for rapid prototype verification, semi-physical simulation and visual debugging of various systems such as robots and industrial control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of real-time simulation, distributed simulation, visual visualization and semi-physical simulation technology, and in particular relates to a real-time simulation method and system based on UDP (User Datagram Protocol) network communication. Background Technology

[0002] In the development of systems for autonomous driving, industrial automation, and service robots, real-time simulation technology is a core tool for verifying control algorithms and optimizing system performance. However, current simulation technologies have the following significant shortcomings, making them difficult to meet practical engineering needs:

[0003] (1) Conventional Simulink simulation is mostly offline simulation mode, which can only complete the offline calculation and verification of the algorithm. It cannot be linked with external visual simulation software in real time, making it difficult to intuitively display the dynamic operation process of the system, which is not conducive to the visual debugging and troubleshooting of the algorithm.

[0004] (2) Most existing real-time simulation platforms rely on dedicated real-time hardware (such as dSPACE, RT-LAB, etc.). Such hardware is expensive, has a complex deployment process, and poor versatility. For small and medium-sized R&D teams, it is difficult to bear the relevant construction costs.

[0005] (3) The communication between the simulation core (such as Simulink) and the visual simulation software mostly adopts the TCP (Transmission Control Protocol) protocol. The TCP protocol has a three-way handshake, retransmission confirmation and other mechanisms, which have high communication overhead and high latency, and cannot meet the core requirement of real-time simulation for low latency (millisecond level).

[0006] (4) The data protocols between different simulation software and visual software are not unified. When connecting across platforms and software, a lot of adaptation development work is required. The adaptation cycle is long and the efficiency is low, which makes it difficult to control the rapid iteration and verification of the algorithm.

[0007] (5) Although a few existing UDP-based co-simulation schemes have solved the TCP high latency problem, they have two major engineering drawbacks that cannot be addressed simultaneously:

[0008] 1. Using only a fixed transmission cycle, the packet transmission frequency cannot be reduced when network congestion and packet loss rate increase, the network load continues to deteriorate, and packet loss intensifies;

[0009] 2. Some solutions can adaptively adjust the UDP sending rate, but the parameters of the packet loss compensation algorithm at the view end are not optimized in sync: when the sending period is lengthened and the data update interval is increased, relying solely on simple linear interpolation will cause stiff motion and mechanical jumps in the 3D model; existing technologies do not have a coordinated linkage solution of "Simulink dynamically adjusting the sending period + frame status word passing network level + view adaptively modifying the damping compensation coefficient".

[0010] Meanwhile, existing solutions lack a unified frame structure and have no elastic buffer to absorb network jitter. Small and medium-sized teams still need expensive dedicated dSPACE / RT-LAB hardware, leaving a gap in software-based, low-cost collaborative simulation solutions.

[0011] Therefore, there is an urgent need for a real-time simulation solution that is low-cost, easy to deploy, highly real-time, supports stand-alone and local area network distributed operation, and can achieve seamless collaboration between Simulink and visual software, in order to overcome the shortcomings of existing technologies. Summary of the Invention

[0012] To address the problems existing in the prior art, this invention provides a real-time simulation method and system based on UDP network communication.

[0013] This invention is implemented as follows: A real-time simulation method based on UDP network communication includes:

[0014] Step 1: Construct a simulation model of the controlled object in the Simulink simulation environment. The simulation model includes a dynamic model and a control algorithm model.

[0015] Step 2: Integrate a UDP sending module and a UDP receiving module into the simulation model, and configure Simulink real-time parameters, UDP sending and receiving parameters, and UDP communication parameters. The UDP sending module sends the simulation data of the simulation model through the UDP network, and the UDP receiving module receives the data fed back by the visual simulation software through the UDP network.

[0016] Step 3: Load the 3D scene model corresponding to the controlled object into the visual simulation software, configure the UDP listening function in the visual simulation software, wait for the simulation data sent by the Simulink UDP sending module, parse the received simulation data and extract key information to drive the 3D scene model to complete the corresponding action, configure the data sending function of the visual simulation software, and send the collected human-computer interaction instructions and environmental parameters to the Simulink UDP receiving module through the UDP network.

[0017] Step four involves synchronously verifying, monitoring the communication status, and debugging the simulation model in Simulink and the 3D scene model in the visual simulation software.

[0018] Furthermore, configuring Simulink real-time parameters includes:

[0019] Select a fixed-step solver, set the simulation step size, and enable the real-time running kernel to ensure the real-time operation of the simulation model.

[0020] Furthermore, configure UDP send and receive parameters, including:

[0021] In standalone mode, Simulink and the visual simulation software are deployed on the same host. The UDP communication between Simulink and the visual simulation software uses a local loopback address. The UDP sending module is bound to the sending port, the UDP receiving module is bound to the receiving port, and the visual simulation software listens to the receiving port to achieve bidirectional data interaction.

[0022] In LAN mode, Simulink and the visual simulation software are deployed on different hosts within the same LAN. The target IP of the UDP sending module is set to the LAN IP of the host where the visual simulation software is located, and the port number is consistent with the listening port of the visual simulation software. At the same time, the data sending period of the UDP sending module is set to match the simulation step size, and the UDP sending port of the visual simulation software is set to match the receiving port of Simulink, thus completing the communication link establishment.

[0023] Furthermore, configure UDP communication parameters, including:

[0024] Define a unified data frame structure and package the simulation data output by Simulink according to the data frame structure to ensure the standardization of data transmission;

[0025] Simultaneously configure the UDP receiving model to parse the received visual feedback data according to the same data frame structure.

[0026] Furthermore, the UDP data frame includes a frame header, data length, timestamp, frame sequence number, status word, data field, and checksum arranged in sequence, wherein the frame header is 4 bytes, the data length is 2 bytes, the timestamp is 8 bytes, the status word is 2 bytes, the checksum is 2 bytes, and the data field has a variable length.

[0027] The frame header identifies the start of a data frame; the data length identifies the number of bytes in the data field; the timestamp records the data transmission time for synchronization; the frame sequence number identifies the transmission order of data packets; the status word identifies the data and communication status, specifically including a network load level flag bit. When the Simulink terminal adjusts the transmission cycle, it writes the corresponding load level flag into the status word. After the visual simulation software parses the status word, it automatically matches the corresponding compensation algorithm parameters (such as adjusting the damping coefficient λ); the data field has a variable length and is used to store the specific data exchanged between Simulink and the visual simulation software; the check bit is used to verify data integrity.

[0028] The uplink feedback frame (view → Simulink) data field only stores interaction commands and network statistical parameters. The data field length is much smaller than that of the downlink simulation frame, reducing bandwidth usage. The downlink simulation frame stores the complete pose, angular velocity, and control output data of the controlled object.

[0029] Furthermore, the Simulink uses a fixed-step solver, with the simulation step size set according to the model's solution needs (usually no more than 10ms). The period for sending simulation data via UDP is an integer multiple of the simulation step size (should be no more than 40ms) and is matched with the rendering frame rate of the visual simulation software to ensure that simulation and rendering are synchronized.

[0030] Furthermore, the synchronous verification includes:

[0031] By writing simulation timestamps into UDP data frames, the visual simulation software can calculate the time difference between the current frame and the previous frame based on the timestamps after receiving data, and adjust the rendering update cycle according to the time difference.

[0032] Determine whether the actions of the simulation model of the controlled object in Simulink are consistent with the corresponding 3D scene model of the controlled object in the visual simulation software.

[0033] Furthermore, it also includes data verification, packet loss marking, frame order correction, and lightweight interpolation compensation mechanisms. When data packet loss is detected, linear interpolation or keeping the data of the previous frame is used to ensure the continuity of the simulation process.

[0034] Another objective of this invention is to provide a real-time simulation system based on UDP network communication for implementing the aforementioned real-time simulation method based on UDP network communication, comprising:

[0035] The Simulink real-time simulation subsystem is used to build simulation models of controlled objects in the Simulink simulation environment. The simulation models include dynamic models and control algorithm models.

[0036] A UDP communication intermediate module is used to integrate a UDP sending module and a UDP receiving module in the simulation model, and to configure Simulink real-time parameters, UDP sending and receiving parameters and UDP communication parameters. The UDP sending module sends the simulation data of the simulation model through the UDP network, and the UDP receiving module receives the data fed back by the visual simulation software through the UDP network.

[0037] The visual simulation subsystem is used to load the three-dimensional scene model corresponding to the controlled object into the visual simulation software, configure the UDP listening function in the visual simulation software to wait for the simulation data sent by the Simulink UDP sending module, parse the received simulation data and extract key information to drive the three-dimensional scene model to complete the corresponding action, configure the data sending function of the visual simulation software to send the collected human-computer interaction instructions and environmental parameters to the Simulink UDP receiving module through the UDP network;

[0038] The simulation model of the Simulink real-time simulation subsystem and the 3D scene model of the visual simulation subsystem are synchronously verified, their communication status is monitored, and they are debugged online.

[0039] The system supports both stand-alone deployment and local area network distributed deployment, and can be flexibly switched according to needs;

[0040] The Simulink real-time simulation subsystem includes a real-time target kernel, a fixed-step solver, a UDPSend module, a UDPReceive module, a data packaging module, and a data parsing module.

[0041] The UDP communication intermediate module supports configurable IP address and port number, and the data protocol can be extended according to actual simulation needs, making it compatible with mainstream visual simulation software.

[0042] Another object of the present invention is to provide a computer device including a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the real-time simulation method based on UDP network communication.

[0043] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the real-time simulation method based on UDP network communication.

[0044] Another objective of this invention is to provide an information data processing terminal for implementing the real-time simulation system based on UDP network communication.

[0045] Based on the above technical solutions and the technical problems solved, please analyze the advantages and positive effects of the technical solution to be protected by this invention from the following aspects:

[0046] High real-time performance: It adopts the UDP lightweight communication protocol, without redundant mechanisms such as handshake and acknowledgment, and the end-to-end data transmission latency is less than 50ms, which meets the core requirements of real-time simulation.

[0047] Flexible deployment: Supports both stand-alone and LAN deployment modes, requiring no dedicated real-time hardware, and can be flexibly selected according to R&D needs, with convenient debugging and low deployment costs;

[0048] High versatility: Defines a unified data frame structure, and the communication IP, port number and data protocol can all be configured and extended, compatible with mainstream visual simulation software (such as Vega, Creator, Unity, etc.), and adaptable to simulation needs in different fields;

[0049] High development efficiency: Based on the Simulink visual modeling environment, there is no need to develop the simulation core from scratch. Control algorithms and dynamic models can be quickly built, enabling rapid prototype verification and iterative optimization of the algorithm;

[0050] Low cost: Implemented entirely in software, eliminating the need to purchase expensive dedicated real-time hardware, significantly reducing the construction and maintenance costs of the simulation platform, and making it suitable for various R&D teams. Attached Figure Description

[0051] Figure 1 This is a flowchart of a real-time simulation method based on UDP network communication provided in an embodiment of the present invention;

[0052] Figure 2 This is a block diagram of a real-time simulation system based on UDP network communication provided in an embodiment of the present invention. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0054] like Figure 1 As shown, the real-time simulation method based on UDP network communication provided in this embodiment of the invention includes the following steps:

[0055] S101, Construct a simulation model of the controlled object in the Simulink simulation environment. The simulation model includes a dynamic model and a control algorithm model.

[0056] S102, In the simulation model, a UDP sending module and a UDP receiving module are integrated, and Simulink real-time parameters, UDP sending and receiving parameters and UDP communication parameters are configured. The UDP sending module sends the simulation data of the simulation model through the UDP network, and the UDP receiving module receives the data fed back by the visual simulation software through the UDP network.

[0057] S103, load the 3D scene model corresponding to the controlled object into the visual simulation software, configure the UDP listening function in the visual simulation software, wait for the simulation data sent by the Simulink UDP sending module, parse the received simulation data and extract key information to drive the 3D scene model to complete the corresponding action, configure the data sending function of the visual simulation software, and send the collected human-computer interaction instructions and environmental parameters to the Simulink UDP receiving module through the UDP network.

[0058] S104, perform synchronous verification, communication status monitoring and online debugging of the simulation model in Simulink and the 3D scene model in the visual simulation software.

[0059] The configuration of Simulink real-time parameters provided in this embodiment of the invention includes:

[0060] Select a fixed-step solver, set the simulation step size, and enable the real-time running kernel to ensure the real-time operation of the simulation model.

[0061] The UDP send / receive parameters configured in this embodiment of the invention include:

[0062] In standalone mode, Simulink and the visual simulation software are deployed on the same host. The UDP communication between Simulink and the visual simulation software uses a local loopback address. The UDP sending module is bound to the sending port, the UDP receiving module is bound to the receiving port, and the visual simulation software listens to the receiving port to achieve bidirectional data interaction.

[0063] In LAN mode, Simulink and the visual simulation software are deployed on different hosts within the same LAN. The target IP of the UDP sending module is set to the LAN IP of the host where the visual simulation software is located, and the port number is consistent with the listening port of the visual simulation software. At the same time, the data sending period of the UDP sending module is set to match the simulation step size, and the UDP sending port of the visual simulation software is set to match the receiving port of Simulink, thus completing the communication link establishment.

[0064] The UDP communication configuration parameters provided in this embodiment of the invention include:

[0065] Define a unified data frame structure and package the simulation data output by Simulink according to the data frame structure to ensure the standardization of data transmission;

[0066] Simultaneously configure the UDP receiving model to parse the received visual feedback data according to the same data frame structure.

[0067] The UDP data frame provided in this embodiment of the invention includes a frame header, data length, timestamp, frame sequence number, status word, data field, and checksum arranged in sequence. The frame header is 4 bytes, the data length is 2 bytes, the timestamp is 8 bytes, the frame sequence number is 4 bytes, the status word is 2 bytes, the checksum is 2 bytes, and the data field has a variable length.

[0068] The frame header identifies the start of a data frame; the data length identifies the number of bytes in the data field; the timestamp records the data transmission time for synchronization; the frame sequence number identifies the transmission order of data packets; the status word identifies the data and communication status, specifically including a network load level flag bit. When the Simulink terminal adjusts the transmission cycle, it writes the corresponding load level flag into the status word. After the visual simulation software parses the status word, it automatically matches the corresponding compensation algorithm parameters (such as adjusting the damping coefficient λ); the data field has a variable length and is used to store the specific data exchanged between Simulink and the visual simulation software; the check bit is used to verify data integrity.

[0069] The Simulink provided in this embodiment of the invention uses a fixed step size solver. The simulation step size is set according to the solution needs of the model (usually no more than 10ms), while the period for sending simulation data via UDP is an integer multiple of the simulation step size (should be no more than 40ms) and is matched with the rendering frame rate of the visual simulation software to ensure that the simulation and rendering are synchronized.

[0070] The stand-alone mode provided in this embodiment of the invention involves the Simulink real-time simulation subsystem and the visual simulation software being deployed on the same host, using the 127.0.0.1 local loopback address for UDP communication; the local area network mode involves Simulink and the visual simulation software being deployed on different hosts on the same local area network, communicating via Ethernet UDP unicast or broadcast.

[0071] The synchronous verification provided in this embodiment of the invention includes:

[0072] By writing simulation timestamps into UDP data frames, the visual simulation software can calculate the time difference between the current frame and the previous frame based on the timestamps after receiving data, and adjust the rendering update cycle according to the time difference.

[0073] Determine whether the actions of the simulation model of the controlled object in Simulink are consistent with the corresponding 3D scene model of the controlled object in the visual simulation software.

[0074] The embodiments of the present invention also provide data verification, packet loss marking, frame order correction and lightweight interpolation compensation mechanisms. When data packet loss is detected, linear interpolation or the previous frame data is retained to ensure the continuity of the simulation process.

[0075] Furthermore, the method also includes an adaptive communication load adjustment mechanism, specifically:

[0076] The visual simulation software provides real-time statistics on packet loss rate P_loss and average network latency T_delay within a preset time window T.

[0077] The packet loss rate P_loss and the average network delay T_delay are fed back into the Simulink simulation model;

[0078] The Simulink simulation model dynamically adjusts the UDP data transmission period T_send based on the feedback network state parameters, keeping the simulation step size Δt constant. The adjustment rule is as follows: when P_loss > P_threshold or T_delay > T_threshold, the UDP data transmission period T_send is increased (i.e., the transmission frequency is reduced) to decrease the number of data packets sent per unit time, thereby reducing network load; conversely, the UDP data transmission period T_send is decreased to increase the data refresh rate.

[0079] Where P_threshold is the preset packet loss rate threshold, and T_threshold is the preset latency threshold.

[0080] It should be noted that the adaptive communication load adjustment mechanism does not operate in isolation, but works closely with the kinematics back-calculation compensation mechanism. When the Simulink end increases the transmission period T_send (e.g., from 20ms to 40ms) based on network conditions, although the network load is reduced, the data interval received by the visual simulation software becomes larger. In this case, the Simulink end will mark "low-frequency transmission mode" in the status word of the data frame. After receiving this mark, the visual simulation software automatically increases the weight of the kinematics back-calculation compensation algorithm (i.e., appropriately reduces the damping coefficient λ) to maintain the smoothness of the model motion over a longer time interval and prevent a mechanical feel caused by slower data updates.

[0081] The method also includes an adaptive communication load adjustment mechanism:

[0082] Specifically, the preset adjustment strategies in the Simulink simulation model are shown in Table 1:

[0083] Table 1 Preset Adjustment Strategies

[0084]

[0085] When the visual simulation software calculates the current packet loss rate to be 3% and the latency to be 30ms, it is judged as "good". The Simulink model keeps the simulation step size unchanged at 5ms and automatically adjusts the transmission cycle from 20ms to 40ms (that is, from sending data once every 4 frames to sending data once every 8 frames).

[0086] It can also perform a weighted summation of data delay reception time, number of packet loss, and number of frame order anomalies, and determine the increment of the UDP data transmission period according to a preset ratio of the weighted summation result.

[0087] like Figure 2 As shown, an embodiment of the present invention provides a real-time simulation system based on UDP network communication, comprising:

[0088] The Simulink real-time simulation subsystem is used to build simulation models of controlled objects in the Simulink simulation environment. The simulation models include dynamic models and control algorithm models.

[0089] A UDP communication intermediate module is used to integrate a UDP sending module and a UDP receiving module in the simulation model, and to configure Simulink real-time parameters, UDP sending and receiving parameters and UDP communication parameters. The UDP sending module sends the simulation data of the simulation model through the UDP network, and the UDP receiving module receives the data fed back by the visual simulation software through the UDP network.

[0090] The visual simulation subsystem is used to load the three-dimensional scene model corresponding to the controlled object into the visual simulation software, configure the UDP listening function in the visual simulation software to wait for the simulation data sent by the Simulink UDP sending module, parse the received simulation data and extract key information to drive the three-dimensional scene model to complete the corresponding action, configure the data sending function of the visual simulation software to send the collected human-computer interaction instructions and environmental parameters to the Simulink UDP receiving module through the UDP network;

[0091] The simulation model of the Simulink real-time simulation subsystem and the 3D scene model of the visual simulation subsystem are synchronously verified, their communication status is monitored, and they are debugged online.

[0092] The system supports both stand-alone deployment and local area network distributed deployment, and can be flexibly switched according to needs;

[0093] The Simulink real-time simulation subsystem includes a real-time target kernel, a fixed-step solver, a UDPSend module, a UDPReceive module, a data packaging module, and a data parsing module.

[0094] The UDP communication intermediate module supports configurable IP address and port number, and the data protocol can be extended according to actual simulation needs, making it compatible with mainstream visual simulation software.

[0095] Another object of the present invention is to provide a computer device including a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the real-time simulation method based on UDP network communication.

[0096] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the real-time simulation method based on UDP network communication.

[0097] Another objective of this invention is to provide an information data processing terminal for implementing the real-time simulation system based on UDP network communication.

[0098] Specific implementation of the present invention:

[0099] A Simulink real-time simulation solution based on UDP network communication is proposed. The real-time simulation model is built with Simulink as the core and bidirectional data exchange between the simulation model and the visual simulation software is realized through UDP network communication. It supports two modes: deployment on the same host and distributed deployment on a local area network, taking into account the requirements of real-time performance, flexibility and low cost.

[0100] I. System Overall Architecture

[0101] The real-time simulation system described in this invention mainly consists of three parts, which work together seamlessly. The specific architecture is as follows:

[0102] 1. Simulink Real-Time Simulation Subsystem: As the core of the entire simulation system, it is responsible for completing control algorithm modeling, dynamics solution of the controlled object, and control logic operation. It also integrates a UDP data transceiver module to realize the sending and receiving of simulation data.

[0103] 2. UDP Communication Intermediate Module: As a bridge for data interaction, it is responsible for encapsulating and encoding the simulation data output by Simulink and transmitting it to the visual simulation software via the UDP network. At the same time, it parses and verifies the data fed back by the visual simulation software and transmits it to the Simulink real-time simulation subsystem, realizing low-latency bidirectional data interaction.

[0104] 3. Visual Simulation Subsystem: Responsible for the construction and real-time rendering of the 3D scene, receiving simulation data (such as position, attitude, state, etc.) transmitted from Simulink, driving the 3D model to complete the corresponding actions, and collecting human-computer interaction commands (such as control commands, environmental parameter settings, etc.) and feeding them back to Simulink to realize the visualization and interactivity of the simulation process.

[0105] II. UDP Communication Mechanism

[0106] To ensure the real-time performance and reliability of data interaction, this invention employs the UDP / IP protocol to construct a lightweight communication link, with the specific design as follows:

[0107] 1. Communication protocol selection: UDP protocol is adopted, abandoning the handshake and confirmation mechanism of TCP protocol, reducing communication overhead, reducing data transmission latency, and meeting the millisecond-level response requirements of real-time simulation;

[0108] 2. Deployment modes supported:

[0109] (1) Standalone mode: The Simulink real-time simulation subsystem and the visual simulation software are deployed on the same host and communicate using the local loopback address (127.0.0.1). No additional network configuration is required, making debugging convenient and eliminating network latency.

[0110] (2) Local Area Network Mode: The Simulink real-time simulation subsystem and the visual simulation software are deployed on different hosts within the local area network. They communicate via unicast or broadcast through the local area network IP addresses of each host to achieve distributed deployment and improve system performance.

[0111] 3. Data Frame Structure: Define a unified UDP data frame structure to ensure the standardization and parsability of data transmission. The specific structure is as follows: Frame Header (4 bytes, used to identify the start of the data frame) + Data Length (2 bytes, indicating the number of bytes in the data field) + Timestamp (8 bytes, recording the data transmission time, used for synchronization) + Frame Sequence Number (4 bytes, indicating the transmission order of the data frames) + Status Word (2 bytes, indicating the data status and communication status) + Data Field (variable length, storing the specific data interacting between the simulation core and the visual software) + Check Bit (2 bytes, using CRC (Cyclic Redundancy Check) verification, used to verify data integrity and avoid data transmission errors).

[0112] 4. Reliability Assurance: To address the lack of an acknowledgment mechanism in the UDP protocol, a lightweight reliability assurance mechanism is designed, including data verification, frame order judgment, packet loss marking, and interpolation compensation. When packet loss is detected, linear interpolation or maintaining the previous frame's data is used to ensure the continuity of the simulation process.

[0113] III. Real-time synchronization mechanism

[0114] To achieve synchronized operation of Simulink simulation and scene rendering, and to avoid simulation lag or scene stuttering, the following synchronization mechanism is designed:

[0115] 1. Fixed step size solver: The Simulink real-time simulation subsystem uses a fixed step size solver. The simulation step size can be configured according to actual needs, usually set to 1ms~10ms, to ensure the real-time performance and stability of the simulation calculation.

[0116] 2. Frame rate matching: Set the period of Simulink's UDP data transmission and reception to an integer multiple of the simulation step size to match the rendering frame rate of the visual simulation software (e.g., a transmission and reception period of 20ms corresponds to a rendering frame rate of 50fps) to ensure that the visual rendering and simulation calculation are synchronized and avoid visual stuttering.

[0117] 3. Clock synchronization: The Simulink simulation clock and the scene rendering clock are synchronized through the timestamp in the UDP data frame, ensuring that both run on the same time base and avoiding data misalignment;

[0118] 4. Anomaly Handling: When network latency, packet loss, or other anomalies occur, frame order correction and packet loss interpolation are used to ensure the continuity of the simulation process and prevent system crashes.

[0119] The specific embodiments of the present invention will be described in detail below.

[0120] Step 1: Build a Simulink real-time simulation model

[0121] 1. Open Matlab software, enter the Simulink simulation environment, and establish the dynamic model and control algorithm model of the controlled object (such as PID (Proportional-Integral-Derivative) control, model predictive control, etc.) according to the specific application scenario (such as autonomous driving, industrial automation, service robots, etc.).

[0122] 2. In the Simulink model, add a UDP Send module and a UDP Receive module (which can be directly called from the Simulink library) to send and receive simulation data, respectively. Add a Zero-OrderHold module in front of the modules and set the sampling time to be consistent with the scene rendering cycle.

[0123] 3. Configure Simulink real-time parameters: Select a fixed step size solver (such as ode3, ode4), set the simulation step size to 1ms~10ms (adjust according to real-time requirements), and enable the real-time running kernel to ensure the real-time operation of the simulation model;

[0124] 4. Configure UDP send / receive parameters: Set the target IP address and port number according to the deployment mode. In standalone mode, set the target IP to 127.0.0.1, and customize the sending and receiving ports (e.g., sending port 8000, receiving port 8001) to ensure that the sending and receiving ports do not conflict. In LAN mode, set the target IP to the LAN IP of the host where the visual software is located, and keep the port number consistent with the listening port of the visual software. At the same time, set the data sending period to match the simulation step size.

[0125] Step 2: Configure UDP communication parameters

[0126] 1. Standalone mode configuration: Simulink and the visual software run on the same machine. UDP communication uses the local loopback address 127.0.0.1. Simulink's UDP Send module is bound to the sending port, and the UDP Receive module is bound to the receiving port. The visual software listens on the corresponding receiving port to realize bidirectional data interaction.

[0127] 2. LAN mode configuration: Ensure that the Simulink host and the Vision software host are on the same LAN with the same subnet mask. Configure the Simulink UDP Send module target IP to the Vision host's LAN IP and the port number to match the Vision software's listening port. Set the Vision software's UDP sending port to match the Simulink receiving port to complete the communication link setup.

[0128] 3. Data Packaging Configuration: Pack the simulation data output by Simulink (such as position coordinates, attitude angles, angular velocities, control commands, system status, etc.) according to a unified data frame structure, and add frame headers, timestamps, frame sequence numbers, status words and check bits to ensure the standardization of data transmission; at the same time, configure the UDP Receive module to parse the received visual feedback data (such as human-machine operation commands, environmental parameters, etc.) according to the same data frame structure.

[0129] Step 3: Configure the visual simulation software

[0130] 1. Launch the visual simulation software (such as Vega, Unity, etc.) and load the pre-built 3D scene model (the 3D model corresponding to the controlled object);

[0131] 2. Configure the UDP listening function in the visual software, set the listening port to be the same as the sending port of Simulink's UDP Send module, enable the data receiving function, and wait for data to be sent by Simulink;

[0132] 3. Write a data parsing program: According to the UDP data frame structure defined in this invention, parse the received Simulink data, extract key information such as position, attitude, and state, drive the 3D model to complete corresponding attitude adjustment, position movement and other actions, and realize the visualization of the simulation process;

[0133] 4. Configure the visual software data transmission function: Collect human-computer interaction commands (such as joystick commands, parameter setting commands, etc.) and environmental parameters (such as wind speed, road conditions, etc.), package them according to the same data frame structure, and send them to the Simulink receiving port via UDP to realize data return.

[0134] Step 4: System Operation and Synchronization Debugging

[0135] 1. Startup order: First start the visual simulation software and ensure that the UDP listening function is enabled, then run the Simulink simulation model to avoid data loss;

[0136] 2. Synchronous Verification: During system operation, a timestamp synchronization mechanism is used to ensure that Simulink simulation and visual rendering are synchronized, observe whether the 3D model actions are consistent with the simulation data, and troubleshoot issues such as delays and packet loss.

[0137] 3. Status monitoring: Real-time display of data transmission and reception status, network latency, packet loss rate and other parameters. When packet loss or excessive latency occurs, adjust the simulation step size or network configuration to ensure stable system operation.

[0138] 4. Online debugging: Supports Simulink online parameter tuning, which allows for real-time adjustment of control algorithm parameters, observation of visual model response changes, and rapid optimization and verification of the algorithm.

[0139] Figure 2 The system consists of three parts: a Simulink real-time simulation subsystem, a UDP communication intermediate module, and a visual simulation subsystem. The data interaction relationship between these three parts is indicated by bidirectional arrows. The Simulink real-time simulation subsystem includes a real-time solving module, a UDP transceiver module, and a data packaging / parsing module. The UDP communication intermediate module includes a data encapsulation module, a data parsing module, and a synchronization module. The visual simulation subsystem includes a 3D rendering module, a human-computer interaction module, and a UDP listening / sending module. The diagram also indicates two deployment modes (standalone mode and LAN mode). In standalone mode, all three are deployed on the same host. In LAN mode, Simulink and the visual simulation software are deployed on separate machines and communicate via Ethernet.

[0140] Table 2 Schematic diagram of UDP data frame structure

[0141]

[0142] Note: Table 2 shows the layered structure of a UDP data frame, from left to right: frame header, data length, timestamp, status word, data field, and checksum. The meaning and byte count of each field are as follows:

[0143] 1. Frame header: 4 bytes, fixed value (e.g., 0x5A5A5A5A), used to identify the beginning of the data frame, making it easier for the receiving end to identify a valid data frame;

[0144] 2. Data length: 2 bytes, indicating the number of bytes in the data field, with a value range of 0~65535, to facilitate the receiving end in determining the read length of the data field;

[0145] 3. Timestamp: 8 bytes, using Unix timestamp format, records the precise time of data transmission, used to achieve clock synchronization between Simulink and the visual software;

[0146] 4. Frame sequence number: 4 bytes, used to identify the transmission order of data frames;

[0147] 5. Status word: 2 bytes, used to identify the data status (such as valid, invalid) and communication status (such as normal, abnormal). The receiving end can determine the validity of the data based on the status word;

[0148] 6. Data field: Variable length (specified by the data length field), storing the specific data of the interaction between Simulink and the visual simulation software, such as the position coordinates, attitude angles, control commands sent by Simulink, and the network status parameters (such as packet loss rate and latency) fed back to Simulink by the visual simulation software.

[0149] 7. Check bit: 2 bytes, using the CRC-16 check algorithm, calculated based on all bytes from the frame header to the data field. The receiving end uses the check bit to determine whether an error has occurred during data transmission. If the check fails, the data frame is discarded.

[0150] The workflow of the entire real-time simulation solution, specifically the following steps:

[0151] 1. Initialization phase: Start Simulink and the visual simulation software respectively, and complete the Simulink model configuration (fixed step size, UDP parameters) and the visual software configuration (3D scene loading, UDP listening).

[0152] 2. Link Establishment: Simulink sends connection request data, the visual software receives and responds, a bidirectional communication link is established via UDP, and communication parameter verification is completed;

[0153] 3. Real-time operation phase: Simulink runs at fixed step size, calculates simulation data, packages it according to the rendering cycle, and sends it to the visual software via UDP; the visual software parses the data, drives the rendering of the 3D model, and at the same time collects human-computer interaction commands, packages them, and sends them back to Simulink.

[0154] 4. Synchronization and Verification: The receiving end verifies the data and determines the frame order. If packet loss occurs, interpolation compensation is performed. Clock synchronization is achieved through timestamps to ensure that simulation and rendering are synchronized.

[0155] 5. Termination Judgment: Determine whether the simulation has reached the preset termination condition (such as simulation duration expires or manual stop). If not, return to the real-time running stage and execute in a loop; if it has, stop the simulation, close the communication link, and save the simulation data.

[0156] Example 1: Single-machine real-time closed-loop simulation scenario

[0157] Simulink real-time simulation environment and 3D scene simulation software are deployed simultaneously on a single computer. First, a dynamic model of the controlled object and a control algorithm module are created in Simulink, configured with a fixed step size of 10 milliseconds. Then, UDP sending and receiving units are configured in the model, with the local address set to 127.0.0.1, and a unified data frame structure is defined. Each data frame includes a frame header, data length, timestamp, frame sequence number, status word, data fields, and a checksum field. After the 3D scene simulation software starts, a UDP listening port is opened and the 3D scene model is loaded. During real-time simulation, Simulink outputs the position, attitude, and status data of the controlled object at a fixed step size, and packages and sends it according to the agreed data frame structure. The scene simulation software parses the data frames and drives the 3D model's motion, achieving real-time visualization. A synchronization relationship between simulation time and rendering time is established through the timestamp field, ensuring consistency between the 3D display and the simulation state.

[0158] Example 2: Real-time simulation scenario of two machines in a local area network

[0159] Two computers are deployed in a local area network environment. One runs the Simulink real-time simulation system, and the other runs 3D visual simulation software. The Simulink client is configured with its UDP sending address set to the IP address of the visual simulation computer, and its port number set to a fixed communication port. The real-time simulation module calculates the system state every 20 milliseconds and encapsulates parameters such as position, velocity, and attitude according to the data frame protocol before sending it. The visual simulation software receives the data frames, parses them, and drives the real-time rendering of the 3D scene. Simultaneously, the operator controls the movement of virtual objects or changes environmental parameters through input devices; this information is transmitted back to Simulink via UDP. Simulink adjusts its control algorithm based on the received feedback data, achieving a complete closed-loop simulation process.

[0160] Example 3: Multi-machine distributed simulation scenario

[0161] In complex simulation systems, Simulink runs on a master compute node, while multiple view nodes are responsible for 3D display from different angles. The master node calculates the simulation state in fixed increments and sends data frames to multiple view nodes via UDP broadcast. Each view node independently parses the data and drives its local 3D rendering module, thus achieving synchronized display across multiple perspectives. To ensure consistent display across nodes, a unified timestamp is included in the data frames. Each node adjusts its rendering cycle based on the timestamp, keeping the display frames synchronized across different computers.

[0162] Example 4: Implementation of a packet loss smoothing compensation mechanism based on elastic buffer and kinematic inverse calculation

[0163] While efficient, the UDP protocol cannot guarantee reliable data delivery and is prone to network jitter during network communication. To maintain simulation continuity and smooth network fluctuations, this embodiment designs frame sequence number marking and elastic buffer mechanisms at both the sending and receiving ends, and combines them with a kinematic back-calculation algorithm to achieve high-precision packet loss compensation.

[0164] First, the Simulink interface at the sending end maintains a global counter. Each time a UDP data frame is sent, the counter is incremented by 1, and the count value is written to the "frame sequence number" field of the data frame.

[0165] The receiver's visual simulation software maintains a flexible data reception buffer in memory, with a target buffer delay set (e.g., 50ms). The software's rendering thread does not directly render the latest arriving data packet; instead, it consistently renders data at the moment when "the current system time minus the target buffer delay" occurs. Through this mechanism, the system constructs a safe time window capable of absorbing fluctuations in network arrival time, effectively smoothing out network jitter.

[0166] Based on this, the receiver performs detection and packet loss compensation by combining frame sequence numbers. When the receiver retrieves data from the buffer, if it finds that the current frame sequence number is not continuous with the previous frame, it determines that a data packet has been lost. At this time, the system triggers a compensation strategy based on kinematics back-calculation:

[0167] Assuming in The frame sequence number received at any time is The data packet, its location information is ;exist The frame sequence number received at any time is The data packet, its location information is The system detected a frame with sequence number [number missing]. The packet loss needs to be estimated. Location information at any time .

[0168] The system first uses the state difference between two adjacent frames in the buffer to deduce the average velocity vector within that time window. :

[0169] ;

[0170] Subsequently, based on The initial position at each moment and the derived average velocity are used to estimate the state of the missing frame using a kinematic extrapolation formula with a damping coefficient:

[0171] ;

[0172] in, To smooth the damping coefficient (the range of values ​​is set to...) In this embodiment, the preferred value is... By introducing a damping coefficient, the overshoot of the estimated position caused by extreme network jitter can be effectively suppressed.

[0173] Finally, the result calculated using this formula This data will be injected into the scene rendering queue as compensation. This method not only utilizes an elastic buffer to absorb network jitter, but also ensures the 3D model remains stable during actual packet loss through kinematic inference. arrive The smooth transition within a time period effectively avoids abrupt changes in the visuals.

[0174] Example 5: Real-time synchronization mechanism implementation

[0175] In the collaborative process of real-time simulation and visual rendering, it is necessary to maintain consistency between computation time and rendering time. This is achieved by writing the current simulation timestamp into the data frame, which records the cumulative runtime since the simulation began. Upon receiving the data frame, the visual software reads the timestamp and compares it with the local rendering time. If a discrepancy exists, the rendering update cycle is adjusted to gradually bring the rendering frame rate closer to the simulation's tempo. This method avoids display delays caused by rendering speeds that are too fast or too slow.

[0176] Example 6: Verification under severe network conditions with high packet loss

[0177] In a local area network environment, a high packet loss condition of 8%~12% was artificially created, with a simulation step size of 5ms and an initial transmission cycle of 20ms. The packet loss rate was judged as "poor" according to the visual statistics. Simulink automatically adjusted T_send to 100ms and wrote the poor level mark in the status word. After the visual analysis mark was determined, λ≈0.8 was calculated according to λ=1-0.2×P_loss, and the damping coefficient was lowered to the lower limit of the interval. A kinematic back-calculation compensation combined with a continuous packet loss uniform extrapolation strategy was adopted. The 3D model showed no obvious jumps and could run stably throughout the process.

[0178] As can be seen from the above implementation methods, this technical solution forms a complete real-time interactive framework through real-time simulation calculation, a unified data frame communication structure, a time synchronization mechanism, and a data compensation mechanism. This enables the simulation calculation system and the 3D visual system to stably exchange data at high speed and maintain time consistency. This solution not only supports single-machine operation but also multi-machine distributed simulation in a local area network environment, maintaining data continuity and display stability even under network instability. Therefore, it has significant engineering applicability and technological advancement.

[0179] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.

[0180] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A real-time simulation method based on UDP network communication, characterized in that, Includes the following steps: Step 1: Construct a simulation model of the controlled object in the Simulink simulation environment. The simulation model includes a dynamic model and a control algorithm model. Step two: Integrate the UDP sending module and the UDP receiving module into the simulation model, and configure the Simulink real-time parameters, UDP sending and receiving parameters, and UDP communication parameters. The UDP communication parameters define a unified hierarchical UDP data frame structure. The data frame is fixed to contain a 4-byte frame header, a 2-byte data length, an 8-byte timestamp, a 4-byte frame sequence number, a 2-byte status word, a variable-length data field, and a 2-byte CRC checksum. Simulink globally increments the frame sequence number and writes it into the data frame for each frame of simulation data generated. The UDP sending module sends simulation data frames through the UDP network, and the UDP receiving module receives data frames returned by the visual simulation software through the UDP network. Step 3: Load the 3D scene model of the controlled object into the visual simulation software, configure the UDP listening function to parse the data frames sent by Simulink, extract the pose and control state to drive the motion of the 3D model; the visual simulation software collects human-computer interaction commands and environmental parameters, and simultaneously calculates the packet loss rate and average network latency within the preset sliding time window in real time, and packages the interaction commands, environmental parameters and network status parameters into uplink data frames and sends them back to Simulink; When the visual simulation software parses downlink data frames, it determines whether there is packet loss by checking the continuity of frame sequence numbers: if there is no packet loss, it directly extracts data to drive rendering; if packet loss is detected, it executes a kinematic back-calculation compensation strategy to generate compensation data to ensure the continuity of the image. Step four: Perform synchronous verification, communication status monitoring, and online debugging on the simulation model in Simulink and the 3D scene model in the visual simulation software; The method also includes an adaptive communication load linkage compensation mechanism, specifically comprising: S401: Simulink keeps the simulation step size Δt constant, receives the packet loss rate and latency parameters from the scene, matches them with the preset packet loss threshold and latency threshold in a graded manner, and dynamically adjusts the UDP sending period T_send. T_send is always an integer multiple of Δt; the higher the network load, the larger the value of T_send. S402: Simulink writes a network load level flag / low frequency transmission flag into the status word of the data frame being sent; S403: Visual simulation software parses status word markers and synchronously adjusts the smoothing damping coefficient λ of kinematic back-calculation compensation. The higher the network load, the larger T_send, and the smaller the value of λ, thus enhancing the motion smoothing compensation effect.

2. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, Configuring Simulink real-time parameters includes: Select the fixed-step solver ode3 or ode4, set the simulation step size Δt∈[1ms,10ms], and enable the Simulink real-time running kernel to ensure the real-time operation of the simulation model.

3. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, Configure UDP send and receive parameters, including: In standalone mode, Simulink and the visual simulation software are deployed on the same host. The UDP communication between Simulink and the visual simulation software uses a local loopback address. The UDP sending module is bound to the sending port, the UDP receiving module is bound to the receiving port, and the visual simulation software listens to the receiving port to achieve bidirectional data interaction. In LAN mode, Simulink and the visual simulation software are deployed on different hosts within the same LAN. The target IP of the UDP sending module is set to the LAN IP of the host where the visual simulation software is located, and the port number is consistent with the listening port of the visual simulation software. At the same time, the data sending period of the UDP sending module is set to match the simulation step size, and the data sending period is an integer multiple of the simulation step size. The visual simulation software is set to match the UDP sending port with the Simulink receiving port, thus completing the communication link establishment.

4. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, Configure UDP communication parameters, including: Define a unified data frame structure and package the simulation data output by Simulink according to the data frame structure to ensure the standardization of data transmission; Simultaneously configure the UDP receiving model to parse the received visual feedback data according to the same data frame structure.

5. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, Also includes: The simulation step size in Simulink is synchronized with the rendering frame period of the visual simulation software, so that the simulation step size and the rendering frame period are consistent or are integer multiples of each other.

6. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, The synchronous verification includes: By writing simulation timestamps and frame sequence numbers into UDP data frames, an elastic data receiving buffer is established in the memory of the visual simulation software, and a target buffer delay is set; the rendering thread of the visual simulation software always extracts data frames whose current system time is less than the target buffer delay time, in order to absorb fluctuations in network arrival time. Determine whether the actions of the simulation model of the controlled object in Simulink are consistent with the corresponding 3D scene model of the controlled object in the visual simulation software.

7. The real-time simulation method based on UDP network communication as described in claim 1, characterized in that, The execution logic of the kinematic back-calculation compensation strategy includes: Single-frame packet loss: Extract the pose and timestamp of adjacent valid frames before and after the lost frame, and calculate the average velocity vector within the window; use the formula Pos(N)=Pos(N-1)+V avg ×(t mid -t1)×λ is used to estimate the pose of lost frames; the smoothing damping coefficient λ∈[0.8,1.0], the larger the network jitter, the smaller the value of λ, Pos(N) and Pos(N-1) are the frame numbers N and N respectively. The location information of the data packet, ,t1 and The frame numbers are respectively and The time of data packet reception, , where is the average velocity vector within the time window, and Pos(N+1) is the frame number. The location information of the data packet; For ≥3 consecutive frames of packet loss: switch to a uniform motion prediction degradation strategy, continuously extrapolate the velocity based on the last valid frame data, and avoid a sharp increase in estimation error when multiple frames are missing. The rendering of 3D models is driven by pose compensation, eliminating screen jumps or stutters.

8. The real-time simulation method based on UDP network communication according to claim 1, characterized in that, The method also includes an adaptive communication load adjustment mechanism: The visual simulation software statistically analyzes network status parameters within a preset time window in real time, including packet loss rate and network latency. The network state parameters are fed back to the Simulink simulation model; The Simulink simulation model dynamically adjusts the UDP data sending period T_send based on the feedback network state parameters, while keeping the simulation step size Δt fixed. T_send is always an integer multiple of Δt. When the network status parameter exceeds the preset threshold, increase T_send to reduce the network load, and send a mode switching command to the visual simulation software through the status word in the UDP data frame to activate the kinematic back-inference compensation strategy to smooth the screen update interval caused by the increase of T_send. The Simulink simulation model has multiple pre-defined correspondences between network load levels and data transmission periods. Based on the feedback packet loss rate and the range of network latency, the corresponding data transmission period T_send is selected from the correspondences. The Simulink simulation model performs real-time calculations according to the simulation step size Δt, and sends data to the visual simulation software according to the adjusted data sending period T_send, where T_send is an integer multiple of Δt.

9. A real-time simulation system based on UDP network communication that implements the real-time simulation method based on UDP network communication as described in any one of claims 1 to 8, characterized in that, include: The Simulink real-time simulation subsystem is used to build simulation models of controlled objects in the Simulink simulation environment. The simulation models include dynamic models and control algorithm models. A UDP communication intermediate module is used to integrate a UDP sending module and a UDP receiving module in the simulation model, and to configure Simulink real-time parameters, UDP sending and receiving parameters and UDP communication parameters. The UDP sending module sends the simulation data of the simulation model through the UDP network, and the UDP receiving module receives the data fed back by the visual simulation software through the UDP network. The visual simulation subsystem is used to load the three-dimensional scene model corresponding to the controlled object into the visual simulation software, configure the UDP listening function in the visual simulation software to wait for the simulation data sent by the Simulink UDP sending module, parse the received simulation data and extract key information to drive the three-dimensional scene model to complete the corresponding action, configure the data sending function of the visual simulation software to send the collected human-computer interaction instructions and environmental parameters to the Simulink UDP receiving module through the UDP network; The simulation model of the Simulink real-time simulation subsystem and the 3D scene model of the visual simulation subsystem are synchronously verified, their communication status is monitored, and they are debugged online.

10. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the real-time simulation method based on UDP network communication as described in any one of claims 1 to 8.