Multi-link message reliability assurance method and device based on logical time synchronization

By adopting the multi-link message reliability guarantee method with logical time synchronization in distributed simulation systems, it is improved to a multi-link parallel method and a synchronization working mechanism is designed, which solves the problem that single link cannot meet high-performance requirements and realizes multi-link Efficient, reliable transmission and causal sequence of road messages.

CN119030936BActive Publication Date: 2024-12-24NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411522094.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2024-12-24
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

The prior art cannot meet the needs of high performance and high throughput in distributed simulation systems, and the single-link sending and receiving data methods cannot effectively ensure the reliability and causal order of multi-link messages.

Method used

Using a multi-link message reliability guarantee method based on logical time synchronization, the single-link serial method of simulation unit and simulation server is improved by one connection method for each topic to be multi-link parallel method, and design the simulation thread and the producer thread. The synchronous working mechanism of the message receiver uses the Bitmap structure to record the number of messages and serial numbers, and ensure the reliability of asynchronous messages through a timed query mechanism.

Benefits of technology

The throughput and parallel processing capabilities of multi-link message transmission are improved, the causality and order of messages are ensured, and the complete reception and reliability of messages are achieved in a multi-link environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030936B_ABST
    Figure CN119030936B_ABST
Patent Text Reader

Abstract

The present application relates to a multi-link message reliability assurance method and device based on logical time synchronization. The method adopts a connection method for each topic to improve the single-link serial mode of the simulation unit sender and receiver and the simulation server into a multi-link parallel mode; the sender adds a sequence number to the message, and the time advancement message carries the end number and the number of messages sent; the receiver sorts the received messages by sequence number and uses Bitmap to record the number of received messages; when the receiver receives the request time advancement message, it checks whether the data has arrived within the adjacent step length to ensure the reliability of data transmission. Based on logical time synchronization, the method adopts the method of adding sequence numbers to messages to ensure the orderliness of messages under multi-link parallelism, and uses time synchronization primitives as a reliability assurance strategy. Under the premise of ensuring the causality and sequentiality of messages, it not only improves the throughput but also improves the parallel processing capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of multi-link message reliability assurance, and in particular to a multi-link message reliability assurance method and device based on logical time synchronization. Background Art

[0002] In a distributed simulation system, multiple nodes transmit message data based on the network, and some data requires reliable transmission, including attack interaction, command interaction, etc. A method needs to be provided to ensure and check whether the relevant data has arrived successfully.

[0003] The existing method is to send and receive data through a single link. The message is sent from the simulation unit and forwarded to other simulation units through the simulation server. The simulation unit sender and the simulation server are connected by a single TCP, and the simulation server and the simulation unit receiver are connected by a single TCP. The reliable characteristics of TCP ensure that the message arrives safely at the receiver. Therefore, in the case of a single connection, the receiver only needs to process the received data in the order of reception, and there will be no causal confusion. In this simulation process, when a time advancement request is received from a certain unit, it means that all previous messages have been received and processed into the queue. As the simulation time advances, the message executor will execute the corresponding message to ensure that there will be no causal order confusion. The method of sending and receiving data through a single link cannot meet the requirements of high performance and high throughput. Based on this, it is necessary to provide a multi-link transmission message reliability assurance method based on logical time synchronization for the above technical problems. Summary of the invention

[0004] Based on this, it is necessary to provide a multi-link message reliability assurance method and device based on logical time synchronization to address the above technical problems.

[0005] A multi-link message reliability assurance method based on logical time synchronization, the method comprising:

[0006] The single-link serial mode between the simulation unit sender and the simulation server is improved to a multi-link parallel mode by adopting a one-connection-per-topic approach, and a synchronization mechanism between the simulation thread and the producer thread is designed.

[0007] By adopting the method of one connection per topic, the single-link serial mode between the simulation unit receiver and the simulation server is improved to a multi-link parallel mode, and the timing query method is used to ensure the reliability of asynchronous messages.

[0008] The sender of the simulation unit adds a sequence number to the message, and the time-advanced message carries the end number and the number of messages sent; the sequence number uses an atomic variable; the end number is the sequence number of the last message.

[0009] After receiving the message, the simulation unit receiver sorts the message by sequence number and uses the Bitmap structure to record the number of received messages.

[0010] When the simulation unit receiver receives the request time advancement message, it determines whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent; if consistent, the message is completely received; if inconsistent, continue to query.

[0011] In one embodiment, the specific steps of the synchronization working mechanism between the simulation thread and the producer thread include:

[0012] The simulation thread starts the producer thread pool and waits. After the threads in the producer thread pool complete their tasks, they notify the simulation thread that they have completed their tasks and enter a waiting state. When all producer threads complete their tasks, the activated simulation thread sends a request time advancement message and starts the next round of activating producer thread tasks. This cycle continues until the simulation ends.

[0013] In one of the embodiments, the specific steps of the asynchronous message reliability arrival mechanism include: when a message requesting time advancement from a simulation unit is received, it is calculated whether all messages of the simulation unit have been received. If all messages have been received, the business thread queue is exchanged to the work queue; if any message has not been received, a timed query task is generated and inserted into the timer. When the query result is true or the timeout period is reached, the timed task is removed and the consumer thread cache queue is exchanged to the work queue, and this cycle is repeated until the simulation ends.

[0014] In one embodiment, the specific steps of the timing query include:

[0015] Set the timer for each message.

[0016] After the first detection, if all messages have arrived successfully, the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins.

[0017] If not all messages have arrived after detection, the next timer time will be reduced to the preset times of the timing time of the previous message, and the timing time of the message will be updated to the preset times of the timing time of the previous message, until all messages finally arrive, the cache thread will be notified to refresh, the thread cache queue will be submitted to the work queue, and the message execution will start.

[0018] In one of the embodiments, the simulation unit time advancement rule adopts a conservative time advancement mechanism.

[0019] The specific steps of the simulation unit time advancement rule include: each simulation unit that completes business processing requests time advancement. When the logical time requested by the simulation unit is less than the lower limit of the timestamp, it is allowed to advance successfully and proceed to the next round of business processing. And so on. Time advances step by step until the end condition is reached directly and the simulation ends.

[0020] In one embodiment, the specific steps of determining that the message reception of the simulation unit is complete include:

[0021] When the simulation unit receiver receives the request time advancement message, it determines whether the final value of the Bitmap is consistent with the final value calculated by the end number carried by the time advancement request time and the number of messages sent. If they are consistent, the time message is completely received; if not, continue to query.

[0022] A multi-link message reliability assurance device based on logical time synchronization, the device comprising:

[0023] The simulation unit sender multi-link parallel improvement module is used to adopt one connection per topic to improve the single-link serial mode between the simulation unit sender and the simulation server to a multi-link parallel mode, and to design a synchronization working mechanism between the simulation thread and the producer thread.

[0024] The simulation unit receiver multi-link parallel improvement module is used to adopt one connection per topic to improve the single-link serial mode between the simulation unit receiver and the simulation server into a multi-link parallel mode, and adopts a timed query method to ensure the reliability of asynchronous messages.

[0025] The simulation unit sender message sending module is used to add a serial number to the message at the simulation unit sender. The time advancement message carries the end number and the number of messages sent; the serial number uses an atomic variable; the end number is the serial number of the last message.

[0026] The simulation unit receiver message receiving module is used for the simulation unit receiver to sort the messages according to the sequence numbers after receiving the messages, and use the Bitmap structure to record the number of received messages.

[0027] The multi-link message reliability assurance module is used to determine whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent when the simulation unit receiver receives the request time advancement message; if consistent, the message is completely received; if inconsistent, continue to query.

[0028] The above-mentioned multi-link message reliability assurance method and device based on logical time synchronization adopts a connection method for each topic, and improves the single-link serial method of the simulation unit sender and receiver and the simulation server into a multi-link parallel method; the simulation unit sender adds a sequence number to the message, and the time advancement message carries the end number and the number of messages sent; the simulation unit receiver sorts the message by sequence number after receiving the message, and uses a Bitmap structure to record the number of received messages; when the simulation unit receiver receives the request time advancement message, it checks whether the data has arrived within the adjacent step length, which can ensure the reliability of data transmission. Compared with the method based on single connection to ensure order, this method uses the method of adding sequence numbers to messages on the basis of logical time synchronization to ensure the orderliness of messages under multi-link parallelism, and uses time synchronization primitives as a reliability assurance strategy. On the premise of ensuring the causality and sequentiality of the message, it improves both the throughput and the parallel processing capability. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flowchart of a method for ensuring reliability of multi-link messages based on logical time synchronization in one embodiment;

[0030] Figure 2 A schematic diagram of a multi-link process of a simulation unit sender in one embodiment;

[0031] Figure 3 A schematic diagram of a multi-link process of a simulation unit receiving side in one embodiment;

[0032] Figure 4 This is a schematic diagram of an example of time advancement in another embodiment;

[0033] Figure 5 A flowchart of a timing query in another embodiment;

[0034] Figure 6 It is a structural block diagram of a multi-link message reliability assurance device based on logical time synchronization in one embodiment. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0036] In one embodiment, Figure 1 As shown, a multi-link message reliability assurance method based on logical time synchronization is provided, and the method comprises the following steps:

[0037] Step 100: adopting a one-connection-per-topic approach, improving the single-link serial approach between the simulation unit sender and the simulation server to a multi-link parallel approach, and designing a synchronization mechanism between the simulation thread and the producer thread.

[0038] Specifically, the single connection between the simulation unit sender and the simulation server is improved to multiple connections, and one connection is adopted for each topic. This improvement changes the single-link serial connection to multiple-link parallel connection, thereby improving the production capacity of simulation unit messages. Since multiple connections are sent in parallel, the simulation business request time advancement is not the same connection, so it is necessary to design a synchronization mechanism between the simulation thread (time synchronization) and the producer thread.

[0039] The simulation unit sender multi-link process diagram is as follows Figure 2 shown.

[0040] Step 102: adopting a one-connection-per-topic approach, improving the single-link serial approach between the simulation unit receiver and the simulation server into a multi-link parallel approach, and adopting a timed query approach to ensure the reliability of asynchronous messages.

[0041] Specifically, the single connection between the simulation unit receiver and the simulation server is improved to multiple connections, and one connection is adopted for each topic. This improvement changes the single-link serial connection to multiple-link parallel connections, thereby improving the simulation unit's message receiving and parallel processing capabilities. Since multiple connections are used to receive and request time synchronization messages in parallel on different threads, it is necessary to design an asynchronous message reliability arrival mechanism - timed query.

[0042] Based on the publish-subscribe message model, messages from multiple simulation units may be received. When the time synchronization message arrives, the service consumption of the simulation unit (sender) may not have arrived completely, so a timing query mechanism is used to poll the status of the simulation units that have not arrived completely. The multi-link process diagram of the simulation unit receiving end is as follows: Figure 3 shown.

[0043] Step 104: The sender of the simulation unit adds a sequence number to the message. The time-advanced message carries the end number and the number of messages sent. The sequence number uses an atomic variable. The end number is the sequence number of the last message.

[0044] Specifically, in distributed simulation, physical time can be regarded as mechanical time, which always flows forward naturally and evenly. Simulation time always flows forward along the simulation time axis. Simulation unit time refers to the current value of a simulation unit on the simulation time axis. It is also the logical time of the simulation unit. For example, if a simulation unit is in logical time T, it means that it has completed the processing of all entity states before time T. The goal of time synchronization is to make the order of events in simulation time consistent with the order of events in the real world, to ensure that each unit can observe the occurrence of events in a unified order, and to coordinate related activities between them.

[0045] The conservative time synchronization algorithm is based on the conservative algorithm of PDES. Its basic idea is to assume that the physical system meets feasibility and predictability. Feasibility ensures that the message sent by the system at time t depends only on the messages and states received before time t; predictability ensures that the system can predict the message at time t+ε (ε>0) at time t, and realize the correct simulation of the system under the premise of complying with local constraints. In the conservative time advancement mechanism, "Lookahead" and "Lower Limit of Timestamp (LBTS)" are two key variables that affect time advancement. Each simulation unit that completes business processing requests time advancement. When the requested logical time is less than LBTS, it is allowed to advance successfully and can proceed to the next round of business processing, including processing received messages, sending event messages, etc., and so on. Time advances step by step until the end condition is reached directly, and the simulation ends.

[0046] The simulation unit advancement rules are as follows Figure 4 Assume that the look-ahead values ​​of simulation units A and B are both 10, Figure 4 It can be concluded that A's LBTS is 810 and B's LBTS is 1010, so B can move forward safely. A needs to wait until B moves forward to 1000+ before it can continue to move forward.

[0047] Step 106: After receiving the messages, the simulation unit receiver sorts the messages according to the sequence numbers and uses a Bitmap structure to record the number of received messages.

[0048] Specifically, by adding a sequence number to the message at the sender of the simulation unit (the sequence number uses an atomic variable), the correct accumulation of sequence numbers between multiple threads is ensured without losing performance. The time advancement message carries the end number and the number of messages sent. The end number is the sequence number of the last message sent. When the receiver receives the request time advancement message, it cannot determine whether the message has been received. After receiving the message, the receiver sorts the message by sequence number. The receiver uses a Bitmap structure to record the number of messages received. Because the continuity and order of the sequence number are guaranteed at the sender, the receiver does not need to consider whether the message is continuous. The default message is ordered and continuous.

[0049] Step 108: When the simulation unit receiver receives the request time advancement message, it determines whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent; if consistent, the message is completely received; if inconsistent, continue to query.

[0050] In the above-mentioned multi-link message reliability guarantee method based on logical time synchronization, the method adopts a connection method for each topic, and improves the single-link serial method of the simulation unit sender and receiver and the simulation server into a multi-link parallel method; the simulation unit sender adds a sequence number to the message, and the time advancement message carries the end number and the number of messages sent; the simulation unit receiver sorts the message by sequence number after receiving the message, and uses a Bitmap structure to record the number of received messages; when the simulation unit receiver receives the request time advancement message, it checks whether the data has arrived within the adjacent step length, which can ensure the reliability of data transmission. Compared with the method based on single connection to ensure order, this method, on the basis of logical time synchronization, adopts the method of adding sequence numbers to messages to ensure the orderliness of messages under multi-link parallelism, and uses time synchronization primitives as a reliability guarantee strategy. On the premise of ensuring the causality and sequentiality of messages, it improves both the throughput and the parallel processing capability.

[0051] In one embodiment, the specific steps of the synchronization working mechanism between the simulation thread and the producer thread in step 100 include: the simulation thread starts the producer thread pool and waits, and after the threads in the producer thread pool complete the task, they notify the simulation thread that it has been completed and enter a waiting state. When all producer threads complete the task, the simulation thread is activated to send a request time advancement message and start the next round of activating the producer thread task, and this cycle continues until the simulation ends.

[0052] In one of the embodiments, a timed query method is used to ensure the reliability of asynchronous messages, including: when a message requesting time advancement from a simulation unit is received, it is calculated whether all messages of the simulation unit have been received. If all messages have been received, the business thread queue is exchanged to the work queue; if any message has not been received, a timed query task is generated and inserted into the timer. When the query result is true or the timeout period is reached, the timed task is removed and the consumer thread cache queue is exchanged to the work queue, and this cycle is repeated until the simulation ends.

[0053] In one embodiment, the specific steps of the timed query include: setting the timer time for each message; after the first detection, if all messages have been successfully received, the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins; if not all messages have been received after the detection, the next timer time will be reduced to the preset times of the timer time of the previous message, and the message timer time will be updated to the preset times of the timer time of the previous message, until all messages have finally arrived, then the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins. The process of the timed query is as follows: Figure 5 shown.

[0054] Specifically, the multi-link message arrival confirmation mechanism is designed - timed query. This method automatically estimates the time of message arrival according to a certain method and sets this time as the timing time. If all messages have been successfully received after the first detection, the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins; if not all messages have been received after the detection, the next timer time is half of the previous message, that is, the timer time is reduced by 0.5 times (actually configurable) each time, until all messages finally arrive, the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins. Compared with the conventional polling mechanism, this method can greatly reduce CPU consumption. The strategy of reducing the timing time can improve the timeliness of the arrival of the detection message, avoid the increase of message delay, and affect the system performance.

[0055] In one of the embodiments, the simulation unit time advancement rule adopts a conservative time advancement mechanism; the specific steps of the simulation unit time advancement rule include: each simulation unit that completes business processing requests time advancement, and when the logical time requested by the simulation unit is less than the lower limit of the timestamp, it is allowed to advance successfully and proceed to the next round of business processing, and so on. Time advances step by step until the end condition is reached directly and the simulation ends.

[0056] In one of the embodiments, the specific steps for determining whether the message of the simulation unit is completely received include: when the simulation unit receiver receives a time advancement message requesting time, the final value of the Bitmap is determined and compared with the final value calculated by the end number carried by the time advancement request time and the number of messages sent. If they are consistent, the time message is completely received; if they are inconsistent, continue the query.

[0057] Specifically, an algorithm is used to determine whether the message reception of the simulation unit is complete based on the simulation time synchronization and the Bitmap feature. The message reception status is recorded by Bitmap. When the receiver receives the request time advancement message, it verifies whether all messages have been received based on the end number carried by the time advancement message. The determination method is to compare the final value of the Bitmap with the final value calculated by the end number carried by the time advancement request time and the number of messages sent. If they are consistent, it proves that the message has been completely received. If they are inconsistent, continue to query.

[0058] Call setBit with the sequence number carried by the message to set it. When receiving the time advancement request message, call the isReceived interface to confirm whether all messages have arrived. If it returns 0, it means that all messages have been received. If it returns non-0, add a scheduled query task to determine whether the reception is complete. When all messages are received, call the reset interface to reset the bitmap. The following three steps are required to calculate the successful arrival of the message:

[0059] The first step is to calculate the position in the bitmap by serial number. The algorithm is as follows:

[0060] unsigned int flag

[10000] ; / / int flag is the flag;

[0061] void setBit(unsigned int i){ / / setBit(unsigned int i) is used to set a bit in the bitmap to true; i is a parameter;

[0062] flag[i>>5] |= (1<<(i&31));} / / used to set the i-th position to true;

[0063] Note: To determine which bit of the data is in which array, the usual approach is num / 32 = n modulo m, where n represents the number of the array and m represents the number of the array; the fifth power of 2 is equal to 32, and the division is simplified by shifting, and the remainder operation is simplified by &.

[0064] void clearBit(unsigned int i) { / / The clearBit(unsigned int i) function is used to set a bit in the bitmap to false; i is the parameter;

[0065] flag[i >> 5] &= ~(1 << (i & 31));} / / Used to set the i-th bit to false;

[0066] Note: 2 to the power of 5 is equal to 32, and division is simplified by shifting.

[0067] The second step is to calculate the function to determine if reception is complete:

[0068] bool testBit(unsigned int i) { / / The testBit(unsigned int i) function is used to determine if a bit in the bitmap is true;

[0069] return flag[i >> 5] & (1 << (i & 31));} / / Used to determine if the i-th bit is true;

[0070] int isReceived(unsigned int begin, unsigned int end) { / / Used to determine if reception is complete, where the parameter begin represents the start position and the parameter end represents the end position;

[0071] unsigned temp = end + 1; / / Set the value of the variable temp

[0072] for (unsigned int i = begin; i < temp; ++i) / / Loop to judge;

[0073] { if (testBit(i) == false) / / Judge whether the result of testBit(i) is false;

[0074] { return i;} / / The next judgment can start from this position;

[0075] };

[0076] return -1;} / / Return -1;

[0077] The third step is to reset after completion:

[0078] void reset(unsigned int begin, unsigned int end) { / / Used to reset the bitmap to false, where the parameter begin represents the start position and the parameter end represents the end position;

[0079] unsigned int temp = end + 1; / / Set the value of the variable temp;

[0080] for (unsigned int i = begin; i < temp; ++i) / / Loop to set to false;

[0081] { clearBit(i);} / / Clear the i-th bit;

[0082] }

[0083] The messages of the simulation unit need to ensure orderliness, that is, ensure that the messages are sent first and arrive first. Messages have causality, that is, messages need to be triggered at the moment when they should occur. TCP can ensure the order of messages in the same connection. To improve from single-connection single-link to multi-connection multi-link, a method is needed to ensure the synchronization of messages in different connections. The purpose of inventing this algorithm is to solve the reliable reception of messages in parallel links, that is, a method to ensure complete message reception imposed on the basis of simulation logic time synchronization.

[0084] There are multiple TCP connections between the simulation unit sender and the simulation server; there are multiple TCP connections between the simulation unit receiver and the simulation server.

[0085] It should be understood that although Figure 1 the steps in the flowchart of Figure 1 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,

[0086] In one embodiment, as Figure 6As shown, a multi-link message reliability assurance device based on logical time synchronization is provided, comprising: a simulation unit sender multi-link parallel improvement module, a simulation unit receiver multi-link parallel improvement module, a simulation unit sender message sending module, a simulation unit receiver message receiving module and a multi-link message reliability assurance module, wherein:

[0087] The simulation unit sender multi-link parallel improvement module is used to adopt one connection per topic to improve the single-link serial mode between the simulation unit sender and the simulation server to a multi-link parallel mode, and to design a synchronization working mechanism between the simulation thread and the producer thread.

[0088] The simulation unit receiver multi-link parallel improvement module is used to adopt one connection per topic to improve the single-link serial mode between the simulation unit receiver and the simulation server into a multi-link parallel mode, and adopts a timed query method to ensure the reliability of asynchronous messages.

[0089] The simulation unit sender message sending module is used to add a serial number to the message at the simulation unit sender. The time advancement message carries the end number and the number of messages sent; the serial number uses an atomic variable; the end number is the serial number of the last message.

[0090] The simulation unit receiver message receiving module is used for the simulation unit receiver to sort the messages according to the sequence numbers after receiving the messages, and use the Bitmap structure to record the number of received messages.

[0091] The multi-link message reliability assurance module is used to determine whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent when the simulation unit receiver receives the request time advancement message; if consistent, the message is completely received; if inconsistent, continue to query.

[0092] In one of the embodiments, the specific steps of the synchronization working mechanism between the simulation thread and the producer thread in the multi-link parallel improvement module of the simulation unit sender include: the simulation thread starts the producer thread pool and waits, and after the threads in the producer thread pool complete the task, they notify the simulation thread that they have completed and enter a waiting state. When all producer threads complete the task, the simulation thread is activated to send a request time advancement message and start the next round of activating the producer thread task, and this cycle continues until the simulation ends.

[0093] In one of the embodiments, the simulation unit receiver multi-link parallel improvement module is also used to calculate whether all messages of a simulation unit have been received after receiving a message requesting time advancement from a simulation unit. If all messages have been received, the business thread queue is exchanged to the work queue; if any message has not been received, a timed query task is generated and inserted into the timer. When the query result is true or the timeout period is reached, the timed task is removed and the consumer thread cache queue is exchanged to the work queue, and this cycle is repeated until the simulation ends.

[0094] In one of the embodiments, the specific steps of the timed query in the multi-link parallel improvement module of the simulation unit receiver include: setting the timing time of each message; after the first detection, if all messages have been successfully received, notifying the refresh cache thread, submitting the thread cache queue to the work queue, and starting to execute the message; if not all messages have been received after the detection, the next timer time will be reduced to a preset multiple of the timing time of the previous message, and the timing time of the message will be updated to a preset multiple of the timing time of the previous message, until all messages have finally arrived, then notifying the refresh cache thread, submitting the thread cache queue to the work queue, and starting to execute the message.

[0095] In one of the embodiments, the simulation unit time advancement rule in the simulation unit sender message sending module adopts a conservative time advancement mechanism; the specific steps of the simulation unit time advancement rule include: each simulation unit that completes business processing requests time advancement, and when the logical time requested by the simulation unit is less than the lower limit of the timestamp, it is allowed to advance successfully and proceed to the next round of business processing, and so on. Time advances step by step until the end condition is reached directly and the simulation ends.

[0096] In one of the embodiments, the specific steps for determining whether the message of the simulation unit is completely received in the multi-link message reliability assurance module include: when the simulation unit receiver receives a request time advancement message, determine whether the final value of the Bitmap is consistent with the final value calculated by the end number carried by the time advancement request time and the number of messages sent. If they are consistent, the time message is completely received; if they are inconsistent, continue to query.

[0097] For the specific limitations of the multi-link message reliability assurance device based on logical time synchronization, please refer to the limitations of the multi-link message reliability assurance method based on logical time synchronization above, which will not be repeated here. Each module in the above-mentioned multi-link message reliability assurance device based on logical time synchronization can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0098] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A multi-link message reliability assurance method based on logical time synchronization, characterized in that: The method comprises: By adopting the method of one connection per topic, the single-link serial mode between the simulation unit sender and the simulation server is improved to a multi-link parallel mode, and a synchronization mechanism between the simulation thread and the producer thread is designed; By adopting the method of one connection per topic, the single-link serial mode between the simulation unit receiver and the simulation server is improved to a multi-link parallel mode, and the timing query method is adopted to ensure the reliability of asynchronous messages; The sender of the simulation unit adds a sequence number to the message, and the time-advanced message carries an end number and the number of messages sent; the sequence number uses an atomic variable; the end number is the sequence number of the last message; After receiving the message, the simulation unit receiver sorts the message by sequence number and uses the Bitmap structure to record the number of received messages; When the simulation unit receiver receives the request time advancement message, it determines whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent; if consistent, the message is completely received; if inconsistent, continue to query.

2. The method according to claim 1, characterized in that The specific steps of the synchronization mechanism between the simulation thread and the producer thread include: The simulation thread starts the producer thread pool and waits. After the threads in the producer thread pool complete their tasks, they notify the simulation thread that they have completed and enter a waiting state. When all producer threads complete their tasks, the activated simulation thread sends a request time advancement message and starts the next round of activating producer thread tasks. This cycle continues until the simulation ends.

3. The method according to claim 1, characterized in that The reliability of asynchronous messages is ensured by using a timed query method, including: When a message requesting time advancement is received from a simulation unit, it is calculated whether all messages of the simulation unit have been received. If all messages have been received, the business thread queue is exchanged to the work queue; if any messages have not been received, a timed query task is generated and inserted into the timer. When the query result is true or the timeout period is reached, the timed task is removed and the consumer thread cache queue is exchanged to the work queue. This cycle continues until the simulation ends.

4. The method according to claim 1, characterized in that: The specific steps of scheduled query include: Set the timing of each message; After the first detection, if all messages have been successfully received, the cache refresh thread is notified, the thread cache queue is submitted to the work queue, and the message execution begins; If not all messages have arrived after detection, the next timer time will be reduced to the preset times of the timing time of the previous message, and the timing time of the message will be updated to the preset times of the timing time of the previous message, until all messages finally arrive, the cache thread will be notified to refresh, the thread cache queue will be submitted to the work queue, and the message execution will start.

5. The method according to claim 1, characterized in that The simulation unit time advancement rule adopts a conservative time advancement mechanism; The specific steps of the simulation unit time advancement rule include: each simulation unit that completes business processing requests time advancement. When the logical time requested by the simulation unit is less than the lower limit of the timestamp, it is allowed to advance successfully and proceed to the next round of business processing. And so on. Time advances step by step until the end condition is reached directly and the simulation ends.

6. The method according to claim 1, characterized in that The specific steps of determining whether the message reception of the simulation unit is complete include: When the simulation unit receiver receives the request time advancement message, it determines whether the final value of Bitmap is consistent with the final value calculated by the end number carried by the time advancement request time and the number of messages sent. If they are consistent, the message is completely received; if they are inconsistent, continue to query; Calculate the position in the bitmap based on the serial number; Calculate whether the message is received based on the sequence number; if the message is received, reset it.

7. A multi-link message reliability assurance device based on logical time synchronization, characterized in that: The device comprises: The simulation unit sender multi-link parallel improvement module is used to adopt a one-connection-per-topic approach to improve the single-link serial approach between the simulation unit sender and the simulation server into a multi-link parallel approach, and to design a synchronization mechanism between the simulation thread and the producer thread; The simulation unit receiver multi-link parallel improvement module is used to adopt a one-connection-per-topic approach to improve the single-link serial approach between the simulation unit receiver and the simulation server to a multi-link parallel approach, and to use a timed query approach to ensure the reliability of asynchronous messages; The simulation unit sender message sending module is used to add a sequence number to the message at the simulation unit sender, and the time advancement message carries an end number and the number of messages sent; the sequence number adopts an atomic variable; the end number is the sequence number of the last message; The simulation unit receiver message receiving module is used for the simulation unit receiver to sort the messages according to the sequence numbers after receiving the messages, and use the Bitmap structure to record the number of received messages; The multi-link message reliability assurance module is used to determine whether the final value of Bitmap is consistent with the final value calculated based on the end number carried by the time advancement message and the number of messages sent when the simulation unit receiver receives the request time advancement message; if consistent, the message is completely received; if inconsistent, continue to query.