Search

CN-121984876-A - Heterogeneous simulation system access system and method based on HLA and DDS

CN121984876ACN 121984876 ACN121984876 ACN 121984876ACN-121984876-A

Abstract

The invention belongs to the technical field of distributed simulation systems, and discloses a heterogeneous simulation system access system and method based on HLA and DDS; the method comprises the steps of initializing a DDS communication assembly and creating a communication handle, completing the publishing and subscribing registration of data types, configuring time limitation and control attributes according to simulated node roles, establishing a time management hierarchical relationship, realizing intelligent message classification processing, distinguishing time sequence messages and common messages, executing stepping feasibility judgment based on a time management cluster, adopting a ordered data refreshing mechanism to ensure the correctness of causality relationship, and introducing a dynamic time compensation algorithm to eliminate synchronization errors. The invention improves the time synchronization precision and the system interoperability in the distributed environment and solves the problems of message timing confusion and time drift. In the complex system simulation fields such as spacecraft collaborative simulation, the system expansibility and the resource utilization efficiency are effectively enhanced, and reliable technical support is provided for large-scale heterogeneous system collaborative simulation.

Inventors

  • WANG RUI
  • FANG XUANKUN
  • LI YAJING
  • SUN SONGTAO
  • GUO HAONAN
  • Wang tianye
  • LI YIWEI
  • XIE CHAO
  • SONG BIN
  • YANG DONGCHUN
  • ZHOU YANWEI

Assignees

  • 浙江俱数科技有限公司
  • 上海宇航系统工程研究所

Dates

Publication Date
20260505
Application Date
20260408

Claims (10)

  1. 1. A heterogeneous simulation system access method based on HLA and DDS is characterized by comprising the following steps: Initializing a DDS communication assembly, creating a DDS communication handle, and completing the release registration and subscription registration of the data types based on the DDS communication handle to generate an initialized simulation node; adding the initialized simulation nodes into a time management cluster, and configuring node time limit attributes and node time control attributes according to roles of the simulation nodes in joint simulation to generate configured simulation nodes; Receiving a message to be issued through the DDS communication handle, classifying the message to be issued into a time sequence message or a common message and executing message issuing according to the association relation between the timestamp of the message to be issued and the current simulation time and the node time control attribute, and storing the received subscription message into a message cache; Initiating a time stepping request to the time management cluster based on the configured simulation nodes, and executing stepping feasibility judgment according to the node time control attribute of each simulation node in the time management cluster and the current simulation time to determine whether stepping to the target simulation time is possible; When the step feasibility is judged to be passed, screening historical information with a time stamp not larger than the target simulation time from the information cache, executing data refreshing operation to enable the historical information to sequentially pass a callback function according to time sequence to carry out callback processing, and generating step reply information after time stepping is completed; And collecting the stepping reply information returned by each simulation node in the time management cluster, calculating time synchronization errors among the simulation nodes, generating time compensation quantity, and applying the time compensation quantity to the next time stepping.
  2. 2. The method of claim 1, wherein initializing the DDS communication component, creating a DDS communication handle, and completing publication registration and subscription registration of data types based on the DDS communication handle, generating an initialized emulated node, comprises: Determining a communication domain identifier according to a system level to which the simulation system belongs, and creating the DDS communication handle based on the communication domain identifier; analyzing a data interaction configuration file of a simulation system, and extracting a data type set to be published and a data type set to be subscribed from the data interaction configuration file; Traversing the data type set to be published, creating a data writer for each data type in the DDS communication handle and completing the publication registration; And traversing the data type set to be subscribed, creating a data reader for each data type in the DDS communication handle, binding the corresponding callback function, and generating the initialized simulation node after the subscription registration is completed.
  3. 3. The method of claim 1, wherein the joining the initialized simulation node to a time management cluster configures a node time limited attribute and a node time control attribute according to a role of the simulation node in joint simulation, and generating a configured simulation node comprises: Acquiring node identification and node role information of the initialized simulation node, wherein the node role information comprises a system-level simulation system or a single-loading-level simulation system; Calling a cluster joining interface to register the initialized simulation node to the time management cluster, and obtaining a node serial number distributed by the cluster; determining a time management mode according to the node role information, and setting the node time control attribute to be in an on state when the node role information is a system level simulation system; And when the node role information is a single-loading-level simulation system, setting the node time limit attribute to be in an on state, and generating the simulation node with the configured attribute after the attribute configuration is completed.
  4. 4. The method according to claim 1, wherein classifying the message to be distributed as a time sequence message or a normal message and performing message distribution according to the association relationship between the timestamp of the message to be distributed and the current simulation time and the node time control attribute comprises: detecting whether the message to be issued carries a time stamp field, and when the message to be issued does not carry the time stamp field, marking the message to be issued as the common message and executing issuing through the DDS communication handle; When the message to be issued carries a time stamp field, judging whether the node time control attribute is in an on state or not; when the node time control attribute is in an on state, checking whether the value of the timestamp field is equal to the current simulation time, if so, marking the message to be issued as the time sequence message and executing issuing; And when the node time control attribute is in an unopened state, processing the message to be issued carrying the time stamp field according to the common message and executing issuing.
  5. 5. The method of claim 1, wherein the performing a step feasibility determination based on the node time control attribute of each simulation node in the time management cluster and the current simulation time comprises: acquiring the node time limited attribute of the configured simulation node; When the node time limit attribute is in an unopened state, directly judging that the step feasibility judgment is passed; when the node time limited attribute is in an on state, traversing all time control nodes of which the node time control attribute is in the on state in the time management cluster; judging whether all the time control nodes finish stepping or are requesting stepping, wherein the simulation time of each time control node is not smaller than the target simulation time, and judging that the stepping feasibility judgment is passed if the simulation time is satisfied.
  6. 6. The method of claim 1, wherein the filtering the historical message with the timestamp not greater than the target simulation time from the message cache, performing a data refresh operation to perform callback processing on the historical message sequentially through a callback function in time sequence, and generating step reply information after completing time stepping, includes: Screening the historical messages with the time stamp not more than the target simulation time from the message cache, and generating a message queue to be refreshed; the historical messages in the message queue to be refreshed are sequenced in an ascending order according to the time stamp; Sequentially taking out the history messages from the ordered message queue to be refreshed, calling the corresponding callback function according to the data type to complete callback processing, and removing the processed history messages from the message cache; and after the message queue to be refreshed is emptied, recording a stepping completion time stamp and stepping time consumption, and generating the stepping reply information.
  7. 7. The method of claim 1, wherein the collecting the step reply information returned by each of the simulation nodes in the time management cluster, calculating a time synchronization error between each of the simulation nodes and generating a time compensation amount, comprises: Receiving the stepping reply information returned by each simulation node in the time management cluster, and extracting a stepping completion time stamp and stepping time consumption from the stepping reply information; Calculating the difference value between the stepping time consumption of each simulation node and a preset stepping period, and recording the difference value as single-node time deviation; counting the maximum value of the single-node time deviation of all simulation nodes in the time management cluster, and recording the maximum value as the time synchronization error; and generating the time compensation quantity according to the time synchronization error.
  8. 8. The method according to claim 2, wherein extracting the set of data types to be published and the set of data types to be subscribed from the data interaction profile comprises: Reading data structure description information defined in the data interaction configuration file, wherein the data structure description information comprises a basic data type and a composite data type; Recursively resolving the internally nested data members of the composite data type until all members are the basic data type; adding the data type marked as release into the data type set to be released according to the release mark in the data interaction configuration file; and adding the data type marked as subscribed into the data type set to be subscribed according to the subscription mark in the data interaction configuration file.
  9. 9. The method of claim 5, wherein said determining whether all of said time control nodes have completed stepping or are requesting stepping comprises: Acquiring current state information of all time control nodes in the time management cluster, wherein the current state information comprises an idle state, a state in a stepping request and a stepping completion state; For the time control node with the current state information in an idle state, judging that the time control node does not meet a stepping condition; For the time control node of which the current state information is a state in a stepping request or a stepping completion state, further comparing the simulation time of the time control node with the target simulation time; And when all the current state information of the time control nodes are not in an idle state and the simulation time of each time control node is not less than the target simulation time, judging that the stepping condition is met.
  10. 10. A heterogeneous simulation system access system based on HLA and DDS, for implementing a heterogeneous simulation system access method based on HLA and DDS according to any one of claims 1 to 9, comprising: the DDS communication initialization module is used for completing initialization of the DDS communication assembly, publishing registration and subscribing registration of data types and generating initialized simulation nodes; the time management configuration module is used for accessing the initialized simulation nodes into a time management cluster and completing time management attribute configuration to generate simulation nodes with completed configuration; the message processing module is used for classifying and publishing the message to be published and carrying out cache management on the received subscription message; a time stepping request module, configured to initiate a time stepping request to the time management cluster and perform stepping feasibility determination; The historical message processing module is used for carrying out orderly callback processing on the historical messages in the cache after the step feasibility judgment is passed and generating step reply information; And the time synchronization compensation module is used for calculating the time synchronization error based on the stepping reply information of each simulation node and generating a time compensation amount, and applying the time compensation amount to the next time stepping.

Description

Heterogeneous simulation system access system and method based on HLA and DDS Technical Field The invention relates to the technical field of distributed simulation systems, in particular to a heterogeneous simulation system access system and method based on HLA and DDS. Background In the field of spacecraft collaborative simulation, the problem of difficulty in integration of heterogeneous systems generally exists in a traditional simulation framework, various simulation systems are mostly built based on different communication protocols and data standards, the difference between the protocols and the standards causes obvious inter-system barriers, the integration process is tedious and easy to make mistakes, in addition, the problem of insufficient distributed time synchronization precision during multi-system joint simulation is particularly prominent due to inconsistent integration standards of the heterogeneous systems, the processing capacity of different nodes is irregular, and the network transmission delay is unstable, so that a simulation time axis has obvious drift, the time difference of each node is gradually accumulated after long-time operation, and the accuracy and the reliability of a simulation result are seriously affected. The problem of disordered message processing time sequence is obvious in a high-strength interaction scene, and the lack of a unified message classification and priority mechanism leads to disordered sequence of events which are logically processed according to a specific sequence in actual execution, thereby causing causality errors. The time management mechanism in the prior art generally lacks flexibility, can not be configured differently according to the characteristics of different hierarchy simulation systems, forces all nodes to follow the same time pushing strategy, can not fully exert the computing power of high-performance nodes, and causes the resource-limited nodes to be tired for coping. Under a complex network environment, the system lacks an effective dynamic compensation mechanism, and cannot adaptively adjust time stepping parameters according to network fluctuation and load change monitored in real time, so that the system has insufficient robustness in the face of external interference. In addition, as the simulation scale is enlarged, for example, when a multi-model spacecraft simulator is used for collaborative simulation of the same scene, the problem of limited expansibility of the traditional method is increasingly remarkable, a large amount of manual configuration work is required for each new node, the management complexity is exponentially increased, and the implementation efficiency of collaborative simulation is severely restricted. The technical bottlenecks not only increase the system development and maintenance cost, but also restrict the precision and scale of spacecraft collaborative simulation, and cannot meet the increasing precision and flexibility requirements of future large-scale spacecraft collaborative simulation. In view of the above, the present invention provides a heterogeneous simulation system access system and method based on HLA and DDS to solve the above problems. Disclosure of Invention In order to overcome the defects in the prior art and achieve the purposes, the invention provides a heterogeneous simulation system access method based on HLA and DDS, which comprises the following steps: Initializing a DDS communication assembly, creating a DDS communication handle, and completing the release registration and subscription registration of the data types based on the DDS communication handle to generate an initialized simulation node; adding the initialized simulation nodes into a time management cluster, and configuring node time limit attributes and node time control attributes according to roles of the simulation nodes in joint simulation to generate configured simulation nodes; receiving a message to be issued through the DDS communication handle, classifying the message to be issued into a time sequence message or a common message and executing message issuing according to the association relation between the timestamp of the message to be issued and the current simulation time and the node time control attribute, and storing the received subscription message into a message cache; Initiating a time stepping request to a time management cluster based on the configured simulation nodes, and executing stepping feasibility judgment according to the node time control attribute of each simulation node in the time management cluster and the current simulation time to determine whether the simulation nodes can step to the target simulation time; When the step feasibility is judged to be passed, screening historical information with the time stamp not more than the target simulation time from the information cache, executing data refreshing operation to enable the historical information to sequentially pass through callba