A distributed simulation system and method of operation
Patent Information
- Application Number
- CN202610890194.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-18
- Publication Date
- 2026-10-27
AI Technical Summary
(1)本发明在DIS无主控分布式架构的基础上,引入主控节点,保留了DIS的兼容性与扩展性,增加系统的可控性。
Smart Images

Figure CN122987285A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a distributed simulation system and its operation method, belonging to the field of simulation system design technology. Background Technology
[0002] Distributed simulation refers to distributing the simulation system across multiple computing nodes, with data from each node interacting collaboratively via a network to achieve larger-scale and more complex simulation tasks. Distributed Interactive Simulation (DIS) is a mature and universally applicable distributed simulation technology, originally developed by the U.S. Department of Defense and now an international standard (IEEE 1278). DIS defines a cross-platform, cross-language interface specification and is widely used in military, aviation, aerospace, transportation, logistics, and other fields. Protocol Data Unit (PDU) is the basic data structure in DIS communication, defining various data protocol formats for simulation interaction. DIS has advantages such as good platform compatibility, high data consistency, and ease of expansion, but it also has the following disadvantages: 1. Low network communication efficiency: Distributed communication is achieved using a broadcast mechanism. As the number of entities N increases, network traffic grows by O(N²), resulting in high bandwidth consumption. 2. Lack of time management: DIS mainly relies on real-time interaction, has no central node, and cannot achieve global time synchronization of each simulation node. Summary of the Invention
[0003] The technical problem solved by this invention is to overcome the shortcomings of the prior art and provide a distributed simulation system architecture and operation method based on the DIS protocol. The system is optimized for DIS, which improves network communication efficiency and enhances simulation time management.
[0004] The technical solution of this invention is: A distributed simulation system includes: a simulation model layer, a simulation platform layer, and a network support layer; The simulation model layer includes various simulation models, which rely on the simulation engine to run. The simulation platform layer includes simulation engine nodes and master control nodes. The simulation engine nodes have distributed simulation interfaces and simulation engines. The simulation engine is used to perform simulations based on the simulation model. The distributed simulation interface is used to realize data interaction with other simulation engine nodes and master control nodes. The master control node, as a special distributed node, realizes dynamic multicast management and distributed time management. The network support layer includes a computer network that implements TCP, UDP, and IGMP protocols. Data transmission and reception between the simulation engine node and the master control node are based on the computer network.
[0005] Furthermore, the simulation platform layer also includes a situation display and simulation control module; The situation display and simulation control module communicates with the master control node via TCP protocol, receives simulation model data sent by the master control node, and displays the simulation process on a two-dimensional or three-dimensional digital globe. The situation display and simulation control module is also used to receive the number of simulation engine nodes, simulation time advance step size, total simulation duration, and simulation speed set by external users, and send them to the master control node, which completes the simulation parameter setting. The situation display and simulation control module is also used to receive simulation start, simulation pause, and simulation termination commands operated by external users, and send them to the master control node, which completes the simulation control.
[0006] Secondly, the present invention also proposes a method for operating a distributed simulation system, comprising the following steps: (1) Each simulation engine node registers model information with the master node, including the simulation model's ID, location, interaction scope, type, published topic, and subscribed topic; among which the type includes static type, weak dynamic type, and high dynamic type; (2) The master control node divides all simulation models into different topic groups according to the subscription topics based on the simulation model subscription topics; (3) The master control node performs spatial clustering analysis on static and weakly dynamic simulation models and divides them into different spatial groups according to spatial distance; the high-dynamic model is added to the corresponding spatial group according to its current position; (4) Based on the spatial group formed in step (3), the master control node further groups the topic group formed in step (2) to form topic spatial groups, assigns a unique multicast address to each topic spatial group, generates a topic spatial group-multicast address mapping table, and sends it to each simulation engine node. (5) Each simulation engine node performs multicast configuration according to the topic space group-multicast address mapping table issued by the master control node and establishes a multicast channel; (6) The simulation process begins, and the master control node performs real-time time synchronization with each simulation engine node; (7) During the simulation operation, the simulation engine node detects the clustering and recombination conditions according to the real-time status of each simulation model. If recombination is required, the simulation engine node reports the changes to the master control node. The master control node updates the topic space group-multicast address mapping table and sends it to the simulation engine node. The simulation engine node continues the simulation after updating; otherwise, it returns to step (6). (8) The simulation process ends when the preset simulation time is reached.
[0007] Furthermore, a static type model refers to a model whose spatial coordinates do not change during the simulation process; Weak dynamic type model refers to a model with a low rate of coordinate change and a stable motion trajectory during simulation; High dynamic type models refer to models with high coordinate change rates and complex maneuver trajectories during the simulation process; High or low coordinate change rate refers to a large or small change rate compared to a preset change rate threshold; smooth motion trajectory means that the fluctuation amplitude does not exceed a preset threshold; complex maneuver trajectory means that the rate of change of acceleration exceeds a preset change rate threshold and the direction of change is irregular.
[0008] Furthermore, step (2) is divided into different topic groups according to the subscribed topics, specifically including: The content of the publishing and subscription topics for simulation models includes the camp to which the simulation model belongs and the DIS message type; The master node iterates through each simulation model and, for each simulation model's published topic, groups all simulation models that have subscribed to that topic into a group. If a group already exists for a certain topic during the process of traversing the simulation model, the master node will not create a new group, but will expand the existing group. The same simulation model can publish or subscribe to multiple topics, and can join multiple topic groups.
[0009] Furthermore, in step (3), the master node performs spatial clustering analysis, specifically through the DBSCAN spatial clustering algorithm.
[0010] Furthermore, spatial clustering analysis is performed using the DBSCAN spatial clustering algorithm, specifically including the following steps: (1) Data preprocessing: The master node extracts the three-dimensional spatial coordinates and interaction range of static and weakly dynamic models to construct a spatial sample dataset; (2) DBSCAN parameter adaptive configuration: neighborhood radius Take the average interaction range of all statically typed and weakly dynamically typed models, and the minimum number of samples. Take 10% of the total number of static and weakly dynamic type models; if the result is not an integer, round it up. (3) Spatial clustering execution: Execute the DBSCAN algorithm to cluster groups with spatial distances less than 10 ... The number of models in the domain is greater than The models are divided into the same spatial group.
[0011] Furthermore, the master node provides a unified clock source to synchronize the time of each simulation engine node in real time, specifically including: (6.1) During the initialization phase of the distributed simulation system, the user sets the number of simulation engine nodes N, the simulation time advance step size ΔT, and the simulation time T=0 through the situation display and simulation control module; (6.2) The master control node sends a time advancement request SendAdvanceTime(T+ΔT) to each simulation engine node via the TCP protocol; (6.3) Each simulation engine node interacts with other simulation engine nodes and the master control node via UDP multicast based on the DIS protocol; (6.4) After the simulation engine node runs to T+ΔT, it sends a time response RequestTime(T+ΔT) to the master node; (6.5) After the master node receives the time response from all simulation engine nodes, it updates the simulation time T=T+ΔT and continues to execute steps (6.2)~(6.5) until the simulation ends.
[0012] Furthermore, the main control node contains a total of 4+n processing threads, where n is the number of simulation engine nodes; The main thread's processing flow is as follows: (1) Based on the TCP protocol, connect to the situation display and simulation control module. After the connection is successful, create a second new thread to receive control commands sent by the situation display and simulation control module, including start, pause, stop, and simulation speed setting. (2) Based on the UDP protocol, UDP multicast communication is created according to the multicast address and communication port. A third new thread is created to receive PDU data sent by each simulation engine node during the simulation process. (3) Based on the number of simulation engine nodes, simulation start time, simulation step size, and total simulation duration, create a time control server; after creating the time control server, create a fourth new thread to receive connections from simulation engine nodes; (4) Execute the simulation process in a loop: wait for all simulation engine nodes to connect, send the simulation time to all simulation engine nodes, wait for all simulation engine nodes to run to the simulation time, update the simulation time according to the simulation step size, reset the connection status of the simulation engine nodes, and check whether the total simulation time has been reached. (5) End the simulation and shut down the relevant services and ports; The second new thread processing flow is as follows: (1) Based on the TCP protocol, receive data from the situation display and simulation control module; (2) Deserialize the received data using protobuf, determine whether it conforms to the communication protocol, and execute the corresponding control instructions according to the data type, including start, pause, stop, and simulation speed setting; The processing flow for the third new thread is as follows: (1) Receive data from multicast networks based on the UDP protocol; (2) Parse the PDU frame format, instantiate the PDU into a specific type, and call the corresponding JSON conversion function according to the different types; (3) Serialize the JSON data of string type into protobuf format and send it to the situation display and simulation control module via TCP protocol; The processing flow for the fourth new thread is as follows: (1) Create a SOCKET and wait for the simulation engine node to connect; (2) After the simulation engine node is successfully connected, obtain the IP address and name of the simulation engine node, initialize the state of the simulation engine node, and start a new data processing thread for each simulation engine node. The process of the simulation engine node data processing threads, namely the fifth to nth new threads, is as follows: (1) Receive data from the simulation engine node based on the TCP protocol; (2) Parse TCP data to determine whether the simulation engine node has run to the simulation time required by the master node; through inter-thread communication, notify the master thread to check whether all simulation engine nodes are ready.
[0013] Furthermore, the simulation engine node processing flow is as follows: (1) Based on the TCP protocol, connect to the master node, including: initializing Winsock, creating a client socket, setting the client socket to non-blocking mode, connecting to the master node server, and using select to wait for the connection to complete; (2) After successful connection, notify the master node that this node has completed initialization and is ready to start simulation; (3) After the simulation starts, check whether the simulation time required by the master node has been reached; if not, continue to execute the simulation calculation; if it has been reached, reply to the master node that it has been reached and can continue to execute; among them, the reception and transmission of DIS data are implemented during the simulation calculation process.
[0014] Furthermore, in step (7), the simulation engine node detects clustering and recombination conditions based on the real-time status of each simulation model. The criteria for recombination include: The process generates a new simulation model; The simulation model exits the simulation. The simulation model is located outside the neighborhood of the DBSCAN cluster; If any one of the above three conditions is met, it is determined that clustering and recombination are required.
[0015] Furthermore, if a reorganization is required, the simulation engine node reports the changes to the master node. The master node updates the topic space group-multicast address mapping table and distributes it to the simulation engine node. After updating, the simulation engine node continues the simulation. Specifically: (1) The simulation engine node reports the changes in the simulation model to the master control node; (2) The master node performs a reorganization type determination based on the received changes; if a new model, a model exits, or a weakly dynamic model is located outside the cluster neighborhood, it is determined to be a full reorganization; if a highly dynamic model is located outside the cluster neighborhood, it is determined to be an incremental reorganization. (3) If it is a full reorganization, the master node executes steps (2) to (4) in claim 3; if it is an incremental reorganization, the master node adds the high dynamic model to the corresponding group according to the current position of the model, updates the topic space group-multicast address mapping table, and sends it to the simulation engine node. (4) When the simulation engine node performs a multicast channel update, if a full update is required, it exits all old multicast groups and joins the multicast group to which it belongs in the new mapping table; if it is an incremental update, it only exits the multicast groups that have changed and joins the newly added multicast groups. (5) The simulation process continues.
[0016] The advantages of this invention compared to the prior art are: (1) Based on the masterless distributed architecture of DIS, this invention introduces a master node, which retains the compatibility and scalability of DIS and increases the controllability of the system.
[0017] (2) The present invention adopts a combination of spatial clustering and dynamic multicast technology, which improves the system communication efficiency and avoids network congestion.
[0018] (3) The present invention completes the time control function of other simulation nodes through the master control node, so as to ensure the time synchronization between the nodes during the simulation process. Attached Figure Description
[0019] Figure 1 This is a diagram of the distributed system architecture of the present invention; Figure 2 This is a flowchart of the distributed system operation of the present invention; Figure 3 This is a flowchart of the main control node processing of the present invention; Figure 4 This is a flowchart of the node processing of the simulation engine of the present invention; Figure 5 This is a flowchart of the dynamic multicast process of the present invention. Detailed Implementation
[0020] The specific embodiments of the present invention will now be described in further detail with reference to the accompanying drawings.
[0021] like Figure 1 As shown, the present invention provides a distributed simulation system, including: a simulation model layer, a simulation platform layer, and a network support layer; The simulation model layer includes various simulation models, which rely on the simulation engine to run. Simulation models are mathematical algorithms corresponding to real-world objects and rely on the simulation engine to run, such as aircraft models and sensor models.
[0022] The simulation platform layer includes simulation engine nodes and master control nodes. The simulation engine nodes have distributed simulation interfaces and simulation engines. The simulation engine is used to perform simulations based on the simulation model. The distributed simulation interface is used to realize data interaction with other simulation engine nodes and master control nodes. The master control node, as a special distributed node, realizes dynamic multicast management and distributed time management. The network support layer includes a computer network that implements TCP, UDP, and IGMP protocols. Data transmission and reception between the simulation engine nodes and the master control node are achieved through this computer network. The network support layer provides hardware and software support for the operation of the distributed simulation system.
[0023] Furthermore, such as Figure 1 As shown, the simulation platform layer of this invention also includes a situation display and simulation control module; The situation display and simulation control module communicates with the master control node via TCP protocol, receives simulation model data sent by the master control node, and displays the simulation process on a two-dimensional or three-dimensional digital globe. The situation display and simulation control module is also used to receive the number of simulation engine nodes, simulation time advance step size, total simulation duration, and simulation speed set by external users, and send them to the master control node, which completes the simulation parameter setting. The situation display and simulation control module is also used to receive simulation start, simulation pause, and simulation termination commands operated by external users, and send them to the master control node, which completes the simulation control.
[0024] like Figure 2 As shown, based on the above-mentioned distributed simulation system, this invention also proposes a method for operating the distributed simulation system, as follows: (1) Each simulation engine node registers model information with the master node, including the simulation model's ID, location, interaction scope, type, published topic, and subscribed topic; among which the type includes static type, weak dynamic type, and high dynamic type; Static type models refer to models whose spatial coordinates do not change during the simulation process; these include: fixed radar stations, air defense positions, and infrastructure. Weak dynamic type models refer to models with low coordinate change rate and stable motion trajectory during simulation; including: slow-moving vehicles on the ground and slow-moving ships on the water. High dynamic type models refer to models with high coordinate change rates and complex maneuver trajectories during the simulation process; including missiles, aircraft, and high-speed maneuvering targets. High or low coordinate change rate refers to a large or small change rate compared to a preset change rate threshold; smooth motion trajectory means that the fluctuation amplitude does not exceed a preset threshold; complex maneuver trajectory means that the rate of change of acceleration exceeds a preset change rate threshold and the direction of change is irregular.
[0025] (2) The master control node divides all simulation models into different topic groups according to the subscription topics based on the simulation model subscription topics; Specifically, it includes: The content of the publishing and subscription topics for simulation models includes the camp to which the simulation model belongs and the DIS message type; The master node iterates through each simulation model and, for each simulation model's published topic, groups all simulation models that have subscribed to that topic into a group. If a group already exists for a certain topic during the process of traversing the simulation model, the master node will not create a new group, but will expand the existing group. The same simulation model can publish or subscribe to multiple topics, and can join multiple topic groups.
[0026] (3) The master control node performs spatial clustering analysis on static and weakly dynamic simulation models and divides them into different spatial groups according to spatial distance; the high-dynamic model is added to the corresponding spatial group according to its current position; Specifically, this is achieved through the DBSCAN spatial clustering algorithm.
[0027] DBSCAN is an unsupervised learning algorithm that can automatically identify cluster structures in data and handle noisy data. Its core idea is to divide data points into core points, boundary points, and noise points, thereby identifying the data distribution in regions of different densities. Relevant definitions are as follows: Definition 1. - Neighborhood: Data Points of - Neighborhood is denoted as , can be represented as ,in It is a dataset. Data points and The distance between them.
[0028] Definition 2. Density: Data points The density is denoted as , can be represented as , refers to - The number of points contained within the domain.
[0029] Definition 3. Core point: If Then point It's the core point, otherwise... This is not the core point. Among them, It is the set density threshold.
[0030] Definition 4. Boundary point: If a point It is not the core point, and Then point These are boundary points. Among them, point... That's the core point.
[0031] Definition 5. Noise Point: If a point If a point is neither a core point nor a boundary point, then it is a noise point.
[0032] Definition 6. Direct density reachability: If and data points If it is the core point, then the point Time Direct density attainability is possible. However, direct density attainability does not satisfy symmetry.
[0033] Definition 7. Density reachability: If a series of data points exists And from arrive Direct density is achievable, then point Time Density is achievable. However, achievable density does not satisfy symmetry.
[0034] Definition 8. Density Connectivity: If data points exist Time and points If all densities are attainable, then the point Time Density connectivity. Density connectivity satisfies symmetry.
[0035] The main idea of the DBSCAN algorithm is to randomly select a point from the dataset. If you click If it's the core point, then find the starting point. All density-reachable points are identified and labeled into the same cluster. Otherwise, another unlabeled point is randomly selected from the dataset, and the above steps are repeated until all points are labeled. Based on the DBSCAN algorithm, this invention performs spatial clustering analysis on all models.
[0036] Therefore, specifically, spatial clustering analysis using the DBSCAN spatial clustering algorithm includes the following steps: (3.1) Data preprocessing: For static and weakly dynamic models, the master node extracts their three-dimensional spatial coordinates and interaction range to construct a spatial sample dataset; (3.2) DBSCAN parameter adaptive configuration: neighborhood radius Take the average interaction range of all statically typed and weakly dynamically typed models, and the minimum number of samples. Take 10% of the total number of static and weakly dynamic type models; if the result is not an integer, round it up. (3.3) Spatial Clustering Execution: Execute the DBSCAN algorithm to cluster groups with spatial distances less than [a certain value]. The number of models in the domain is greater than The models are divided into the same spatial group.
[0037] (4) Based on the spatial group formed in step (3), the master control node further groups the topic group formed in step (2) to form topic spatial groups, assigns a unique multicast address to each topic spatial group, generates a topic spatial group-multicast address mapping table, and sends it to each simulation engine node. (5) Each simulation engine node performs multicast configuration according to the topic space group-multicast address mapping table issued by the master control node and establishes a multicast channel; (6) The simulation process begins, and the master control node performs real-time time synchronization with each simulation engine node, specifically including: (6.1) During the initialization phase of the distributed simulation system, the user sets the number of simulation engine nodes N, the simulation time advance step size ΔT, and the simulation time T=0 through the situation display and simulation control module; (6.2) The master control node sends a time advancement request SendAdvanceTime(T+ΔT) to each simulation engine node via the TCP protocol; (6.3) Each simulation engine node interacts with other simulation engine nodes and the master control node via UDP multicast based on the DIS protocol; (6.4) After the simulation engine node runs to T+ΔT, it sends a time response RequestTime(T+ΔT) to the master node; (6.5) After the master node receives the time response from all simulation engine nodes, it updates the simulation time T=T+ΔT and continues to execute steps (6.2)~(6.5) until the simulation ends.
[0038] (7) During the simulation operation, the simulation engine node detects the clustering and recombination conditions according to the real-time status of each simulation model. If recombination is required, the simulation engine node reports the changes to the master control node. The master control node updates the topic space group-multicast address mapping table and sends it to the simulation engine node. The simulation engine node continues the simulation after updating; otherwise, it returns to step (6). (8) The simulation process ends when the preset simulation time is reached.
[0039] like Figure 3 As shown, in this invention, the main control node program adopts a multi-threaded design, containing a total of 4+n (n is the number of simulation engine nodes) processing threads. It employs a "strong temporal coupling" design philosophy to maximize computational parallelism while ensuring time consistency.
[0040] The main thread's processing flow is as follows: (1) Based on the TCP protocol, connect to the situation display and simulation control module. After the connection is successful, create a second new thread to receive control commands sent by the situation display and simulation control module, including start, pause, stop, and simulation speed setting. (2) Based on the UDP protocol, UDP multicast communication is created according to the multicast address and communication port. A third new thread is created to receive PDU data sent by each simulation engine node during the simulation process. (3) Based on the number of simulation engine nodes, simulation start time, simulation step size, and total simulation duration, create a time control server; the main steps include initializing Winsock, creating a server socket, setting address reuse, setting the server address, binding the socket, and starting listening. After creating the time control server, create a fourth new thread to receive connections from the simulation engine nodes; (4) Execute the simulation process in a loop: wait for all simulation engine nodes to connect, send the simulation time to all simulation engine nodes, wait for all simulation engine nodes to run to the simulation time, update the simulation time according to the simulation step size, reset the connection status of the simulation engine nodes, and check whether the total simulation time has been reached. (5) End the simulation and shut down the relevant services and ports; The second new thread processing flow is as follows: (1) Based on the TCP protocol, receive data from the situation display and simulation control module; (2) Deserialize the received data using protobuf, determine whether it conforms to the communication protocol, and execute the corresponding control instructions according to the data type, including start, pause, stop, and simulation speed setting; The processing flow for the third new thread is as follows: (1) Receive data from multicast networks based on the UDP protocol; (2) Parse the PDU frame format, instantiate the PDU into a specific type, and call the corresponding JSON conversion function according to the different types; (3) Serialize the JSON data of string type into protobuf format and send it to the situation display and simulation control module via TCP protocol; The processing flow for the fourth new thread is as follows: (1) Create a SOCKET and wait for the simulation engine node to connect; (2) After the simulation engine node is successfully connected, obtain the IP address and name of the simulation engine node, initialize the state of the simulation engine node, and start a new data processing thread for each simulation engine node. The process of the simulation engine node data processing threads, namely the fifth to nth new threads, is as follows: (1) Receive data from the simulation engine node based on the TCP protocol; (2) Parse TCP data to determine whether the simulation engine node has run to the simulation time required by the master node; through inter-thread communication, notify the master thread to check whether all simulation engine nodes are ready.
[0041] like Figure 4 As shown, the node processing flow of the simulation engine is as follows: (1) Based on the TCP protocol, connect to the master node, including: initializing Winsock, creating a client socket, setting the client socket to non-blocking mode, connecting to the master node server, and using select to wait for the connection to complete; (2) After successful connection, notify the master node that this node has completed initialization and is ready to start simulation; (3) After the simulation starts, check whether the simulation time required by the master node has been reached; if not, continue to execute the simulation calculation; if it has been reached, reply to the master node that it has been reached and can continue to execute; among them, the reception and transmission of DIS data are implemented during the simulation calculation process.
[0042] In step (7) of this invention, the simulation engine node detects clustering and recombination conditions based on the real-time status of each simulation model. The criteria for recombination include: The process generates new simulation models; for example, an air defense position launches an interceptor missile. The simulation model exits the simulation; for example, the target is destroyed. The simulation model is located outside the neighborhood of the DBSCAN cluster; If any one of the above three conditions is met, it is determined that clustering and recombination are required.
[0043] like Figure 5As shown, if a reorganization is required, the simulation engine node reports the changes to the master node. The master node updates the topic space group-multicast address mapping table and distributes it to the simulation engine node. After updating, the simulation engine node continues the simulation. Specifically: (1) The simulation engine node reports the changes in the simulation model to the master control node; (2) The master node performs a reorganization type determination based on the received changes; if a new model, a model exits, or a weakly dynamic model is located outside the cluster neighborhood, it is determined to be a full reorganization; if a highly dynamic model is located outside the cluster neighborhood, it is determined to be an incremental reorganization. (3) If it is a full reorganization, the master node executes steps (2) to (4) in claim 3; if it is an incremental reorganization, the master node adds the high dynamic model to the corresponding group according to the current position of the model, updates the topic space group-multicast address mapping table, and sends it to the simulation engine node. (4) When the simulation engine node performs a multicast channel update, if a full update is required, it exits all old multicast groups and joins the multicast group to which it belongs in the new mapping table; if it is an incremental update, it only exits the multicast groups that have changed and joins the newly added multicast groups. (5) The simulation process continues.
[0044] The parts of this invention not described in detail are common knowledge to those skilled in the art.
Claims
1. A distributed simulation system, characterized in that, include: Simulation model layer, simulation platform layer, network support layer; The simulation model layer includes various simulation models, which rely on the simulation engine to run. The simulation platform layer includes simulation engine nodes and master control nodes. The simulation engine nodes have distributed simulation interfaces and simulation engines. The simulation engine is used to perform simulations based on the simulation model. The distributed simulation interface is used to realize data interaction with other simulation engine nodes and master control nodes. The master control node, as a special distributed node, realizes dynamic multicast management and distributed time management. The network support layer includes a computer network that implements TCP, UDP, and IGMP protocols. Data transmission and reception between the simulation engine node and the master control node are based on the computer network.
2. The distributed simulation system according to claim 1, characterized in that: The simulation platform layer also includes a situation display and simulation control module; The situation display and simulation control module communicates with the master control node via TCP protocol, receives simulation model data sent by the master control node, and displays the simulation process on a two-dimensional or three-dimensional digital globe. The situation display and simulation control module is also used to receive the number of simulation engine nodes, simulation time advance step size, total simulation duration, and simulation speed set by external users, and send them to the master control node, which completes the simulation parameter setting. The situation display and simulation control module is also used to receive simulation start, simulation pause, and simulation termination commands operated by external users, and send them to the master control node, which completes the simulation control.
3. A method for operating the distributed simulation system according to claim 2, characterized in that, include: (1) Each simulation engine node registers model information with the master node, including the simulation model's ID, location, interaction scope, type, published topic, and subscribed topic; The types include static types, weakly dynamic types, and highly dynamic types; (2) The master control node divides all simulation models into different topic groups according to the subscription topics based on the simulation model subscription topics; (3) The master control node performs spatial clustering analysis on static and weakly dynamic simulation models and divides them into different spatial groups according to spatial distance; the high-dynamic model is added to the corresponding spatial group according to its current position; (4) Based on the spatial group formed in step (3), the master control node further groups the topic group formed in step (2) to form topic spatial groups, assigns a unique multicast address to each topic spatial group, generates a topic spatial group-multicast address mapping table, and sends it to each simulation engine node. (5) Each simulation engine node performs multicast configuration according to the topic space group-multicast address mapping table issued by the master control node and establishes a multicast channel; (6) The simulation process begins, and the master control node performs real-time time synchronization with each simulation engine node; (7) During the simulation operation, the simulation engine node detects the clustering and recombination conditions according to the real-time status of each simulation model. If recombination is required, the simulation engine node reports the changes to the master control node. The master control node updates the topic space group-multicast address mapping table and sends it to the simulation engine node. After the simulation engine node updates, it continues the simulation. Otherwise, return to step (6); (8) The simulation process ends when the preset simulation time is reached.
4. The operating method according to claim 3, characterized in that: A static model refers to a model whose spatial coordinates do not change during the simulation process. Weak dynamic type model refers to a model with a low rate of coordinate change and a stable motion trajectory during simulation; High dynamic type models refer to models with high coordinate change rates and complex maneuver trajectories during the simulation process; High or low coordinate change rate refers to a large or small change rate compared to a preset change rate threshold; smooth motion trajectory means that the fluctuation amplitude does not exceed a preset threshold; complex maneuver trajectory means that the rate of change of acceleration exceeds a preset change rate threshold and the direction of change is irregular.
5. The operating method according to claim 3, characterized in that: Step (2) involves dividing the subscription topics into different topic groups, specifically including: The content of the publishing and subscription topics for simulation models includes the camp to which the simulation model belongs and the DIS message type; The master node iterates through each simulation model and, for each simulation model's published topic, groups all simulation models that have subscribed to that topic into a group. If a group already exists for a certain topic during the process of traversing the simulation model, the master node will not create a new group, but will expand the existing group. The same simulation model can publish or subscribe to multiple topics, and can join multiple topic groups.
6. The operating method according to claim 3, characterized in that: In step (3), the master node performs spatial clustering analysis, specifically through the DBSCAN spatial clustering algorithm.
7. The operating method according to claim 6, characterized in that: Spatial clustering analysis is performed using the DBSCAN spatial clustering algorithm, specifically including the following steps: (1) Data preprocessing: The master node extracts the three-dimensional spatial coordinates and interaction range of static and weakly dynamic models to construct a spatial sample dataset; (2) DBSCAN parameter adaptive configuration: neighborhood radius Take the average interaction range of all statically typed and weakly dynamically typed models, and the minimum number of samples. Take 10% of the total number of static and weakly dynamic type models; if the result is not an integer, round it up. (3) Spatial clustering execution: Execute the DBSCAN algorithm to cluster groups with spatial distances less than 10 ... The number of models in the domain is greater than The models are divided into the same spatial group.
8. The operating method according to claim 3, characterized in that: The master node provides a unified clock source to synchronize the time of each simulation engine node in real time, specifically including: (6.1) During the initialization phase of the distributed simulation system, the user sets the number of simulation engine nodes N, the simulation time advance step size ΔT, and the simulation time T=0 through the situation display and simulation control module; (6.2) The master control node sends a time advancement request SendAdvanceTime(T+ΔT) to each simulation engine node via the TCP protocol; (6.3) Each simulation engine node interacts with other simulation engine nodes and the master control node via UDP multicast based on the DIS protocol; (6.4) After the simulation engine node runs to T+ΔT, it sends a time response RequestTime(T+ΔT) to the master node; (6.5) After the master node receives the time response from all simulation engine nodes, it updates the simulation time T=T+ΔT and continues to execute steps (6.2)~(6.5) until the simulation ends.
9. The operating method according to claim 8, characterized in that: The main control node contains 4+n processing threads, where n is the number of simulation engine nodes; The main thread's processing flow is as follows: (1) Based on the TCP protocol, connect to the situation display and simulation control module. After the connection is successful, create a second new thread to receive control commands sent by the situation display and simulation control module, including start, pause, stop, and simulation speed setting. (2) Based on the UDP protocol, UDP multicast communication is created according to the multicast address and communication port. A third new thread is created to receive PDU data sent by each simulation engine node during the simulation process. (3) Create a time control server based on the number of simulation engine nodes, simulation start time, simulation step size, and total simulation duration; After creating the time control server, create a fourth new thread to receive connections from the simulation engine nodes; (4) Execute the simulation process in a loop: wait for all simulation engine nodes to connect, send the simulation time to all simulation engine nodes, wait for all simulation engine nodes to run to the simulation time, update the simulation time according to the simulation step size, reset the connection status of the simulation engine nodes, and check whether the total simulation time has been reached. (5) End the simulation and shut down the relevant services and ports; The second new thread processing flow is as follows: (1) Based on the TCP protocol, receive data from the situation display and simulation control module; (2) Deserialize the received data using protobuf, determine whether it conforms to the communication protocol, and execute the corresponding control instructions according to the data type, including start, pause, stop, and simulation speed setting; The processing flow for the third new thread is as follows: (1) Receive data from multicast networks based on the UDP protocol; (2) Parse the PDU frame format, instantiate the PDU into a specific type, and call the corresponding JSON conversion function according to the different types; (3) Serialize the JSON data of string type into protobuf format and send it to the situation display and simulation control module via TCP protocol; The processing flow for the fourth new thread is as follows: (1) Create a SOCKET and wait for the simulation engine node to connect; (2) After the simulation engine node is successfully connected, obtain the IP address and name of the simulation engine node, initialize the state of the simulation engine node, and start a new data processing thread for each simulation engine node. The process of the simulation engine node data processing threads, namely the fifth to nth new threads, is as follows: (1) Receive data from the simulation engine node based on the TCP protocol; (2) Parse the TCP data and determine whether the simulation engine node has run to the simulation time required by the master node; Through inter-thread communication, the main thread is notified to check whether all simulation engine nodes are ready.
10. The operating method according to claim 8, characterized in that: The simulation engine node processing flow is as follows: (1) Based on the TCP protocol, connect to the master node, including: initializing Winsock, creating a client socket, setting the client socket to non-blocking mode, connecting to the master node server, and using select to wait for the connection to complete; (2) After successful connection, notify the master node that this node has completed initialization and is ready to start simulation; (3) After the simulation starts, check whether the simulation time required by the master node has been reached; if not, continue to execute the simulation calculation; if it has been reached, reply to the master node that it has been reached and can continue to execute; among them, the reception and transmission of DIS data are implemented during the simulation calculation process.
11. The operating method according to claim 3, characterized in that: In step (7), the simulation engine node detects clustering and recombination conditions based on the real-time status of each simulation model. The criteria for recombination include: The process generates a new simulation model; The simulation model exits the simulation. The simulation model is located outside the neighborhood of the DBSCAN cluster; If any one of the above three conditions is met, it is determined that clustering and recombination are required.
12. The operating method according to claim 11, characterized in that: If a reconfiguration is required, the simulation engine node reports the changes to the master node. The master node updates the topic space group-multicast address mapping table and distributes the changes to the simulation engine node. After updating, the simulation engine node continues the simulation. Specifically: (1) The simulation engine node reports the changes in the simulation model to the master control node; (2) The master node performs a reorganization type determination based on the received changes; if a new model, a model exits, or a weakly dynamic model is located outside the cluster neighborhood, it is determined to be a full reorganization; if a highly dynamic model is located outside the cluster neighborhood, it is determined to be an incremental reorganization. (3) If it is a full reorganization, the master node executes steps (2) to (4) in claim 3; if it is an incremental reorganization, the master node adds the high dynamic model to the corresponding group according to the current position of the model, updates the topic space group-multicast address mapping table, and sends it to the simulation engine node. (4) When the simulation engine node performs a multicast channel update, if a full update is required, it exits all old multicast groups and joins the multicast group to which it belongs in the new mapping table; if it is an incremental update, it only exits the multicast groups that have changed and joins the newly added multicast groups. (5) The simulation process continues.