Method and apparatus for synchronization of slave clock to master clock
US-2016359610-A1 · Dec 8, 2016 · US
US11831746B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-11831746-B2 |
| Application number | US-202117444901-A |
| Country | US |
| Kind code | B2 |
| Filing date | Aug 11, 2021 |
| Priority date | May 8, 2020 |
| Publication date | Nov 28, 2023 |
| Grant date | Nov 28, 2023 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
The invention belongs to the technical field of time synchronization of computer co-simulation, and particularly relates to a time consistency synchronization method for distributed simulation. According to the time consistency synchronization method, a most appropriate master clock is selected according to votes, and then the other clocks in a network are controlled to synchronize by using the master clock, so that the consistency of data of each node and a time-related event in time logic is ensured. Even if a certain simulation node goes down, influences on the other links of the whole system are relatively small, which can effectively perform decentration, ensure the time consistency to the greatest extent, and ensure the correctness and the scale of a whole distributed system.
Opening claim text (preview).
What is claimed is: 1. A time consistency synchronization method for distributed simulation, comprising the following steps of: (1) setting system parameters of each simulation node in a virtual simulation system to zero, wherein the system parameters comprise a local logic clock, a global logic clock, a local minimum advance clock interval, a global minimum advance clock interval, and a logic clock list of other simulation nodes, and setting the local minimum advance clock interval; (2) connecting each simulation node with other simulation nodes in a network, determining a master clock, and setting the other simulation nodes as slave clocks; (3) constructing, by each slave clock, a logic time state query packet, and pushing the logic time state query packet to the master clock; receiving, by the slave clock, a query response packet answered by the master clock, wherein the query response packet comprises a global logic clock of the master clock, a local logic clock of the other simulation nodes, and a local minimum advance clock interval; and setting, by the slave clock, both a global logic clock and a local logic clock of the slave clock to the global logic clock in the query response packet; (4) packing, by each slave clock, the local logic clock into a data packet and transmitting the packet to a receiving queue of the other simulation nodes through a network communication working thread, selecting, by the other simulation nodes, one data packet from the receiving queue, comparing the local logic clock in the data packet with the local logic clock of the other simulation nodes, if the local logic clock in the data packet is less than the local logic clock of the other simulation nodes, discarding the data packet, and returning a logic clock lag response packet to a data packet sender; if the local logic clock in the data packet is greater than or equal to the local logic clock of the other simulation nodes and less than a sum of the local logic time and the local minimum advance clock interval, accepting the data packet; and if the local logic clock in the data packet is great than or equal to the sum of the local logic time and the local minimum advance clock interval, sending the logic time advance request to the master clock; and (5) after the master clock receives the logic time advance request of the slave clock, comparing the local logic time requested to be advanced by the slave clock with the global logic time of the master clock, and if the local logic time requested to be advanced by the slave clock is less than or equal to the global logic time of the master clock, returning a response packet allowing successful time advance to the slave clock; if the local logic time requested to be advanced by the slave clock is greater than the global logic time and less than a sum of the global logic time and the global minimum advance clock interval, allowing the time advance; if the local logic time requested to be advanced by the slave clock is greater than the sum of the global logic time and the global minimum advance clock interval, comparing first data of the other simulation nodes with the sum of the global logic time and the global minimum advance clock interval, if the first data is greater than or equal to the sum of the global logic time and the global minimum advance clock interval, and the time advance request is blocked, allowing all time advance requests and updating a local logic time list of simulation nodes in the master clock, and setting the global logic time as a minimum local logic time in all simulation nodes. 2. The time consistency synchronization method for distributed simulation according to claim 1 , wherein in step (2), a method for establishing the connection comprises: sending, by a first simulation node, a detection packet by broadcasting to query the other simulation nodes in the network; after receiving the detection packet, constructing, by The other simulation nodes, a response packet, establishing a TCP connection with the first simulation node, and transmitting the response packet back to the first simulation node, wherein the response packet comprises a network address and a network connection list; and after receiving the response packet, comparing, by the first simulation node, the network connection list in the response packet with a local network connection list, if the two are inconsistent in contents, constructing a network information difference packet, and transmitting the network information difference packet to the simulation node sending the response packet by using the network address to complete the connection establishment. 3. The time consistency synchronization method for distributed simulation according to claim 1 , wherein in step (2), a method for determining the master clock comprises: setting, by each simulation node, the simulation node as the master clock first, and informing the other simulation nodes, if the master clock already exists in the network at the moment, informing, by the master clock, the simulation node, changing, by the simulation node, the simulation node into the slave clock, and executing step (3); if the master clock does not exist in the network at the moment, entering a stage of voting to select the master clock, and judging, by the simulation node, whether the current node is the selected master clock or not; if the answer is yes, setting the current node as the master clock; and otherwise, setting the current node as the slave clock. 4. The time consistency synchronization method for distributed simulation according to claim 3 , wherein in step (2), a method for selecting the master clock by voting comprises: (a) constructing, by each simulation node, an internal vote, wherein the internal vote comprises a node identification code and a global logic clock; (b) putting the internal votes in a sending queue and sending the votes to the other simulation nodes to serve as external votes for the other simulation nodes to obtain from the receiving queue; (c) obtaining, by The simulation node, the external votes from the receiving queue without an interval; (d) after the simulation node obtains all the external votes connected by the network, counting the external votes; (e) selecting a vote with a maximum global logic clock value, judging if a number of the selected votes is greater than or equal to two, and if the number of selected votes is greater than or equal to 2, selecting the vote with the maximum node identification code, and discarding the rest votes; (f) changing the internal vote of the node into the selected external vote, putting the changed internal vote into the sending queue and sending the changed vote to the other simulation nodes; (g) obtaining, by the simulation node, a second round of external votes from the receiving queue without an interval; (h) after the simulation node obtains all the external votes connected by the network, counting the external votes; and (i) judging whether more than a half of the simulation nodes accept the external vote of the node or not, and if more than a half of the simulation nodes accept the external vote of the node, selecting the node as the master clock; otherwise, returning to step (a) to carry out selection again. 5. The time consistency synchronization method for distributed simulation according to claim 1 , wherein in step (3), data between the master clock and the slave clock are all transmitted through the network communication worker thread which comprises a sending queue and the receiving queue; data packets sent by the simulation node to the other simulation nodes are pushed to the sending queue in sequence; and the receiving queue stores data packets sent by the other simulation nodes according to a network receiving sequence. 6. The time consis
by comparing receiver clock with transmitter clock · CPC title
Clock or time synchronisation among nodes; Internode synchronisation (synchronization for ring networks H04L12/422; data switching networks with synchronous transmission H04L12/43) · CPC title
Synchronisation of different clock signals {provided by a plurality of clock generators} · CPC title
using simulation · CPC title
Timing analysis · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.