CN116208284B - Time synchronization method, device, system, computer equipment and storage medium - Google Patents

Time synchronization method, device, system, computer equipment and storage medium Download PDF

Info

Publication number
CN116208284B
CN116208284B CN202310191449.XA CN202310191449A CN116208284B CN 116208284 B CN116208284 B CN 116208284B CN 202310191449 A CN202310191449 A CN 202310191449A CN 116208284 B CN116208284 B CN 116208284B
Authority
CN
China
Prior art keywords
time
synchronization
agent
information
pulse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310191449.XA
Other languages
Chinese (zh)
Other versions
CN116208284A (en
Inventor
汪承研
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Mechanical and Electrical College
Original Assignee
Guangdong Mechanical and Electrical College
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Mechanical and Electrical College filed Critical Guangdong Mechanical and Electrical College
Priority to CN202310191449.XA priority Critical patent/CN116208284B/en
Publication of CN116208284A publication Critical patent/CN116208284A/en
Application granted granted Critical
Publication of CN116208284B publication Critical patent/CN116208284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes

Abstract

The application discloses a time synchronization method, a device, a system, computer equipment and a storage medium, wherein the method comprises the following steps: determination ofA synchronization time period T; at a set time point t 1 Generating or receiving trigger pulses, and calculating the number of the trigger pulses; acquiring time synchronization information t 1 +T; at a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain; in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization. The embodiment of the application realizes high-precision time synchronization between single boards of the same plug-in box and between single boards of different plug-in boxes by a mode of receiving time information at an advance time point of the synchronization time and broadcasting the time information to a time synchronization domain and a mode of responding to the synchronization pulse.

Description

Time synchronization method, device, system, computer equipment and storage medium
Technical Field
The application relates to a time synchronization method, a time synchronization device, a time synchronization system, computer equipment and a storage medium, and belongs to the field of time synchronization.
Background
In communication system devices, other data processing cluster devices, and other subject devices or scenarios requiring accurate time stamping, absolute time errors between different device jacks, cabinets, processing units are very critical. Taking communication system equipment as an example, the communication system equipment comprises single boards, an inserting box and cabinets, wherein a plurality of single boards are inserted into one layer of inserting boxes, a plurality of inserting boxes are placed into one cabinet, and a plurality of cabinets are stored in one machine room so as to complete specific data processing and transmission tasks.
In order to meet the demands of ordering and traceability of signaling data in a communication network, it is required that the absolute time error between boards in the same jack is less than 1ms and the absolute time error between boards in different jacks is less than 2ms. At present, it is difficult to achieve such a small absolute time error, i.e., to achieve high-precision time synchronization between boards.
Disclosure of Invention
In view of the above, the present application provides a time synchronization method, apparatus, system, computer device, and storage medium, which implement high-precision time synchronization between the same boards and between different boards by receiving time information at an advanced time point of synchronization time and broadcasting to a time synchronization domain and responding to a synchronization pulse.
A first object of the present application is to provide a time synchronization method.
A second object of the present application is to provide a time synchronization method.
A third object of the present application is to provide a time synchronization device.
A fourth object of the present application is to provide a time synchronization system.
A fifth object of the present application is to provide a time synchronization system.
A sixth object of the present application is to provide a computer device.
A seventh object of the present application is to provide a storage medium.
The first object of the present application can be achieved by adopting the following technical scheme:
a method of time synchronization performed by a time master agent, the method comprising:
determining a synchronous time period T;
at a set time point t 1 Generating trigger pulses and calculating the number of the trigger pulses;
acquiring time synchronization information t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
Preferably, the threshold value is defined by a set point in time t 1 The time type of the trigger pulse and the synchronization time period T.
Preferably, the time type of the trigger pulse includes one of: seconds, minutes, hours, days, months, seasons, and years;
the time type of the trigger pulse is the same as the time type of the synchronization time period.
Preferably by means of synchronization pulses and time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent is enabled to complete time synchronization, and the method comprises the following steps:
sending a synchronization pulse to enable the time processing device to trigger an interrupt so as to give a temporary variable to the time processing device, thereby achieving local time synchronization, wherein the temporary variable is time synchronization information t acquired by the time processing device in real time previously 1 +T。
The second object of the application can be achieved by adopting the following technical scheme:
a method of time synchronization performed by a time master agent, the method comprising:
determining a synchronous time period T;
at a set time point t 1 Receiving trigger pulses, and calculating the number of the trigger pulses, wherein the trigger pulses are generated by a time information source;
acquiring time synchronization information t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
Preferably, the threshold value is defined by a set point in time t 1 The time type of the trigger pulse and the synchronization time period T.
Preferably, the time type of the trigger pulse includes one of: seconds, minutes, hours, days, months, seasons, and years;
the time type of the trigger pulse is the same as the time type of the synchronization time period.
Preferably by means of synchronization pulses and time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent is enabled to complete time synchronization, and the method comprises the following steps:
sending a synchronization pulse to cause the time processing device to trigger an interrupt to give itself a temporary variable to complete local time synchronization, wherein the temporary variable is set for the time processing deviceTime synchronization information t acquired in advance in real time 1 +T。
The third object of the present application can be achieved by adopting the following technical scheme:
a time synchronization apparatus, the apparatus comprising:
the determining module is used for determining a synchronous time period T;
a calculation module for setting a time point t 1 Generating or receiving trigger pulses, and calculating the number of the trigger pulses;
an acquisition module for acquiring time synchronization information t 1 +T;
A broadcasting module for setting a time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
a synchronization module for generating a synchronization pulse when the trigger pulse count reaches a threshold value in the time synchronization domain, and simultaneously transmitting the synchronization pulse and the time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
The fourth object of the present application can be achieved by adopting the following technical scheme:
a time synchronization system comprising a time information source, a time master agent, a time slave agent and a time processing device;
a time information source for generating time information;
the time master agent and the corresponding time processing equipment connected with the time master agent are in the same plug-in box;
the time slave agent and the corresponding time processing equipment connected with the time slave agent are in the same plug-in box;
the time master agent and the time slave agent are not in the same plug-in box;
the time master agent and the time slave agent are in a tree-shaped relationship, and the link is a trigger pulse, wherein the time master agent is positioned at a trunk end, and the time slave agent is positioned at a branch end;
the time master agent and the time processing equipment are in star-shaped relation, and the link is time information;
a time master agent, a method for achieving the first object.
Preferably, the system further comprises a standby time master agent and a standby time slave agent;
the standby time master agent is in an insertion box where the time master agent is located;
the standby time slave agent is in the plug-in box where the time slave agent is located.
The fifth object of the present application can be achieved by adopting the following technical scheme:
a time synchronization system comprising a time information source, a time master agent, a time slave agent and a time processing device;
a time information source for generating time information and a trigger pulse;
the time master agent and the corresponding time processing equipment connected with the time master agent are in the same plug-in box;
the time slave agent and the corresponding time processing equipment connected with the time slave agent are in the same plug-in box;
the time master agent and the time slave agent are not in the same plug-in box;
the time master agent and the time slave agent are in a tree-shaped relationship, and the link is a trigger pulse, wherein the time master agent is positioned at a trunk end, and the time slave agent is positioned at a branch end;
the time master agent and the time processing equipment are in star-shaped relation, and the link is time information;
a time master agent, a method for achieving the second object.
Preferably, the system further comprises a standby time master agent and a standby time slave agent;
the standby time master agent is in an insertion box where the time master agent is located;
the standby time slave agent is in the plug-in box where the time slave agent is located.
The sixth object of the present application can be achieved by adopting the following technical scheme:
a computer device comprising a processor and a memory for storing a program executable by the processor, the processor implementing the above-described time synchronization method when executing the program stored in the memory.
The seventh object of the present application can be achieved by adopting the following technical scheme:
a storage medium storing a program which, when executed by a processor, implements the time synchronization method described above.
Compared with the prior art, the application has the following beneficial effects:
the embodiment of the application realizes high-precision time synchronization between single boards of the same plug-in box and between single boards of different plug-in boxes by a mode of receiving time information at an advance time point of a synchronization time and broadcasting the time information to a time synchronization domain and a mode of responding to a synchronization pulse; in addition, a plurality of wireless time inputs, such as Beidou and GPS, are supported, and when no wireless time input exists, NTP network time input is supported.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a block diagram showing the structure of a time synchronization system according to embodiment 1 of the present application.
Fig. 2 is a block diagram showing the structure of a time synchronization system in the GPS mode according to embodiment 1 of the present application.
Fig. 3 is a block diagram of a time synchronization system in NTP mode according to embodiment 1 of the present application.
Fig. 4 is a schematic diagram of a time synchronization method according to embodiment 1 of the present application.
Fig. 5-a is a flowchart of a time synchronization method according to embodiment 1 of the present application.
Fig. 5-b is a flowchart of a time synchronization method according to embodiment 1 of the present application.
Fig. 6 is a block diagram showing the structure of a time synchronization apparatus according to embodiment 2 of the present application.
Fig. 7 is a block diagram showing the structure of a computer device according to embodiment 3 of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present application are within the scope of protection of the present application.
In the description and claims of the present application, "and" means at least one of the connected objects, and the character "/" generally means a relationship in which the associated objects are one or.
The present description accomplishes time synchronization in a communication network big data acquisition platform, wherein the following terms and components are involved:
the trigger Pulse may be referred to as "Pulse info"/"trigger info", such as Pulse Per Second (PPS); the time information is absolute time information.
Time information source: devices that generate time information, such as Beidou/GPS servers (simply "Beidou/GPS") and network time protocol (Network Time Protocol, NTP) servers. The NTP server obtains standard time information from the GPS satellite, and transmits the information to devices (computer, protection device, fault recorder, event sequence recorder, security automation device and remote terminal unit) in the automation system, which need time information, so that the time synchronization of the whole system can be achieved.
Time synchronization domain: within the synchronization range of a time information, there is a common time information source and trigger pulse source, which makes the devices within the domain pace.
Time master agent: the system is characterized by being a switch board/card in a plug-in box in hardware, and having only one time master agent in a time synchronization domain.
Time slave agent: in hardware, a board/card in a card box, within a time synchronization domain, there may be multiple time slave agents.
A time processing device (also referred to as "data acquisition processing unit"): in hardware, the system is represented as an acquisition card/service processing single board in an insertion box, and in a time synchronization domain, a plurality of time processing devices can exist.
Local time processing device: the time processing devices in the same enclosure as the time master agent, and the devices in other enclosures and cabinets are referred to as non-local devices.
Example 1:
as shown in fig. 1, the present embodiment provides a time synchronization system including a time information source, a time master agent, a time slave agent, and a time processing device;
a time information source for generating time information or generating time information and a trigger pulse;
the time master agent and the corresponding time processing equipment connected with the time master agent are in the same plug-in box;
the time slave agent and the corresponding time processing equipment connected with the time slave agent are in the same plug-in box;
the time master agent and the time slave agent are not in the same plug-in box;
the time master agent and the time slave agent are in a tree-shaped relationship, and the link is a trigger pulse, wherein the time master agent is positioned at a trunk end, and the time slave agent is positioned at a branch end;
the time master agent and the time processing equipment are in star-shaped relation, and the link is time information;
when the time information source generates only time information
A time master agent for implementing the time synchronization method shown in fig. 5-a.
When the time information source generates time information and trigger pulse
A time master agent for implementing the time synchronization method shown in fig. 5-b.
In this embodiment, the generating and transmitting process of the time information and the trigger pulse includes:
(1) The time master agent receives time information and trigger pulse from the Beidou/GPS or receives time information from the NTP server and generates trigger pulse by itself;
(2) The time master agent sends the time information to all time processing devices in a broadcasting mode through the Ethernet; the time master agent sends the trigger pulse to the next time slave agent, and meanwhile, the previous time slave agent sends the trigger pulse to the next time slave agent, so that the trigger pulse is transmitted step by step, and the trigger pulse and other pulses are transmitted through a backboard bus or a cable.
In this embodiment, the system further includes a standby time master agent and a standby time slave agent;
the standby time master agent is in an insertion box where the time master agent is located;
the standby time slave agent is in the plug-in box where the time slave agent is located.
The time master agent and the time slave agent are the master switch boards, and the standby time master agent and the standby time slave agent are the standby switch boards.
Further, those skilled in the art will further appreciate the system and list the functional parts that need to be considered in the system design:
1. management of time synchronization domain:
a) Mainly involves the selection of GPS mode and NTP mode, whether GPS mode or NTP mode is selected at the beginning of the start of the time master agent in the time synchronization domain, the GPS mode referring to fig. 2, the NTP mode referring to fig. 3, their main differences referring to table 1.
TABLE 1 differentiation between GPS mode and NTP mode
Absolute time information Trigger information
GPS mode GPS generation GPS generation
NTP mode NTP server generation Time master agent generation
b) In the system operation, the time master agent processes after the time information acquisition failure.
c) Because there may be a plurality of time synchronization domains in one lan and the transmission of time information is performed by broadcasting, it is necessary to configure a uniform time synchronization domain.
2. Driving of SCC2 port:
the SCC2 port needs to be configured, and the time information of the GPS is received from the SCC2 port.
3. How to read time information from a string in GPS mode:
since the time information of the GPS is specified in a format, it is necessary to parse the time information in a character string.
4. NTP client programming:
when the GPS is not present, time information needs to be acquired from the NTP server.
5. In GPS mode and NTP mode, the time agent has different processing methods (synchronization time period t=10s):
a) In GPS mode, the hardware logic of the time master agent receives the trigger pulse from the serial port, and the GPS in this embodiment generates a trigger pulse one second, which requires the CPU to be interrupted once a second. At the position ofTime point t 1 If the time master agent needs to start synchronization, then in the interrupt program, the program will notify the hardware logic that, at interrupt time t 1 +1s, ready to start the trigger pulse count, when it reaches 10, a sync pulse is generated. The program is at time point t 1 Obtaining the time value timeinfo at the moment from the serial port, and then adding the timeinfo to 10s at t 1 And t 1 Between +10s, timeinfo+10s is broadcast into the time synchronization domain. At t 1 At +10s, the hardware logic generates an interrupt to the CPU in addition to the sync pulse, the program changes the time value obtained at this interrupt time, timeinfo_1, to timeinfo_1+10s, at t 1 +10s and t 1 Between +20s, timeinfo_1+10s is broadcast into the time synchronization domain, and time synchronization is performed from time to time.
b) In NTP mode, the hardware logic of the time master agent generates a trigger pulse by itself according to its own clock. After the NTP server acquires the time information, at a time point t 1 If the time master agent needs to start synchronization, then in the interrupt program, the program will notify the hardware logic that, at interrupt time t 1 +1s, prepare to start the trigger pulse count, when count to 10, produce a synchronous pulse; the program is at time point t 1 Obtaining the time value timeinfo from the NTP server, and then adding the timeinfo+10s to the time value at t 1 And t 1 Between +10s, timeinfo+10s is broadcast into the time synchronization domain. At t 1 At +10s, the hardware logic generates an interrupt to the CPU in addition to the sync pulse, the program changes the time value obtained at this interrupt time, timeinfo_1, to timeinfo_1+10s, at t 1 +10s and t 1 Between +20s, timeinfo_1+10s is broadcast into the time synchronization domain, and time synchronization is performed from time to time.
6. Switching of the main exchange board and the standby exchange board:
switching the exchange plates in the plug-in boxes in a manual operation mode;
taking a GPS mode as an example, the switching thought between the main exchange board and the standby exchange board is described, and specifically, the switching thought comprises: in a certain plug-in box, it is assumed that a main exchange board and a standby exchange board are connected, the GPS is connected with the main exchange board, the main exchange board with faults is disassembled, and then the GPS is connected with the standby exchange board, so that the standby exchange board is used as the main exchange board to continue time synchronization. After the main exchange board fails and before the standby exchange board is not successfully exchanged, the main exchange board does not send time information and pulses, and time processing equipment in the time synchronization domain calculates time according to the time synchronization information and the local clock which are acquired previously.
7. Data processing by the time processing device:
for the time processing equipment, a program opens a broadcast message port to receive a broadcast packet in real time, and when the time fo+10s is received, the time value is stored to a local temporary variable; when a synchronization pulse of the time value arrives (the time processing device is configured with a high priority interrupt for this pulse), this pulse triggers an interrupt to the time processing device, which in an interrupt response procedure assigns the time value previously stored in the temporary variable to the system time, thus achieving local time synchronization.
As shown in fig. 4 and 5-a, the present embodiment further provides a time synchronization method performed by a time master agent, the method comprising the steps of:
s501a, determining a synchronization time period T.
In this step, t=10s.
In other embodiments, t=2s or t=5s.
S502a, at a set time point t 1 Trigger pulses are generated and the number of trigger pulses is counted.
Specifically, the time type of the trigger pulse includes one of: seconds, minutes, hours, days, months, seasons, and years; the time type of the trigger pulse is the same as the time type of the synchronous time period, and in this step, the trigger pulse is a second pulse.
S503a, acquiring time synchronization information t 1 +T。
In this step, let t 1 10 points 30 minutes 00 seconds, t 1 +T is 10 points 30 minutes10 seconds.
S504a at a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T is broadcast into the time synchronization domain.
In this step, a broadcast protocol, that is, a broadcast message is used to transmit the time synchronization information t 1 The broadcast packet of +t is sent into the time synchronization domain, typically with a delay of a few ms, tens of ms. It should be noted that how fast the present operation is essentially not required.
S505a, in the time synchronization domain, when the trigger pulse count reaches the threshold value, generating a synchronization pulse, and simultaneously transmitting the synchronization pulse and the time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent/the time slave agent completes time synchronization.
In this step, the threshold value is set at time t 1 The time type of the trigger pulse and the synchronization time period T, the threshold is 11 times.
In this step, the information t is synchronized by the synchronization pulse and the time 1 +t, for the time master/slave corresponding time processing device to complete time synchronization, comprising:
sending a synchronization pulse to enable the time processing device to trigger an interrupt so as to give a temporary variable to the time processing device, thereby achieving local time synchronization, wherein the temporary variable is time synchronization information t acquired by the time processing device in real time previously 1 +T。
As shown in fig. 4 and 5-b, the present embodiment also provides a time synchronization method performed by a time master agent, the method comprising the steps of:
s501b, determining a synchronization time period T.
In this step, t=10s.
In other embodiments, t=2s or t=5s.
S502b, at a set time point t 1 And receiving the trigger pulses and counting the number of the trigger pulses.
Specifically, the time type of the trigger pulse includes one of: seconds, minutes, hours, days, months, seasons, and years; the time type of the trigger pulse is the same as the time type of the synchronous time period, and in this step, the trigger pulse is a second pulse.
S503b, acquiring time synchronization information t 1 +T。
In this step, let t 1 10 points 30 minutes 00 seconds, t 1 +T is 10 points for 30 minutes 10 seconds.
S504b at a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T is broadcast into the time synchronization domain.
In this step, a broadcast protocol, that is, a broadcast message is used to transmit the time synchronization information t 1 The broadcast packet of +t is sent into the time synchronization domain, typically with a delay of a few ms, tens of ms. It should be noted that how fast the present operation is essentially not required.
S505b generating a synchronization pulse in the time synchronization domain when the trigger pulse count reaches a threshold value, simultaneously passing the synchronization pulse and the time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent/the time slave agent completes time synchronization.
In this step, the threshold value is set at time t 1 The time type of the trigger pulse and the synchronization time period T, the threshold is 11 times.
In this step, the information t is synchronized by the synchronization pulse and the time 1 +t, for the time master/slave corresponding time processing device to complete time synchronization, comprising:
sending a synchronization pulse to enable the time processing device to trigger an interrupt so as to give a temporary variable to the time processing device, thereby achieving local time synchronization, wherein the temporary variable is time synchronization information t acquired by the time processing device in real time previously 1 +T。
Experiments are carried out under the basic environment condition that the deviation of the service processing single-plate crystal oscillator is +/-20 ppm, and the effects are as follows:
the system time synchronization period is set to 10s, the absolute time error between different single boards in the same plug-in box is 1ms, and the absolute time error between the single boards of different plug-in boxes is 2ms;
the system time synchronization period is set to 2s, the absolute time error between different single boards in the same plug-in box is 0.2ms, and the absolute time error between the single boards of different plug-in boxes is 0.4ms.
Those skilled in the art will appreciate that all or part of the steps in a method implementing the above embodiments may be implemented by a program to instruct related hardware, and the corresponding program may be stored in a computer readable storage medium.
It should be noted that although the method operations of the above embodiments are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in that particular order or that all illustrated operations be performed in order to achieve desirable results. Rather, the depicted steps may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
Example 2:
as shown in fig. 6, the present embodiment provides a time synchronization apparatus, which includes a determining module 601, a calculating module 602, an obtaining module 603, a broadcasting module 604, and a synchronizing module 605, where specific functions of the respective modules are as follows:
a determining module 601, configured to determine a synchronization time period T;
a calculation module 602 for, at a set time point t 1 Generating or receiving trigger pulses, and calculating the number of the trigger pulses;
an acquisition module 603 for acquiring time synchronization information t 1 +T;
A broadcasting module 604 for setting a time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
a synchronization module 605 for generating a synchronization pulse when the trigger pulse count reaches a threshold value in the time synchronization domain, and simultaneously synchronizing the information t by the synchronization pulse and the time 1 And +T, the time processing equipment corresponding to the time master agent/the time slave agent completes time synchronization.
Example 3:
as shown in fig. 7, the present embodiment provides a computer apparatus including a processor 702, a memory, an input device 703, a transceiver 704, and a network interface 705 connected by a system bus 701. The processor 702 is configured to provide computing and control capabilities, and the memory includes a nonvolatile storage medium 706 and an internal memory 707, where the nonvolatile storage medium 706 stores an operating system, a computer program, and a database, and the internal memory 707 provides an environment for the operating system and the running of the computer program in the nonvolatile storage medium 706, and when the computer program is executed by the processor 702, the time synchronization method of the foregoing embodiment 1 is implemented as follows:
determining a synchronous time period T;
at a set time point t 1 Generating or receiving trigger pulses, and calculating the number of the trigger pulses;
acquiring time synchronization information t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent/the time slave agent completes time synchronization.
Example 4:
the present embodiment provides a storage medium that is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the time synchronization method of the above embodiment 1, as follows:
determining a synchronous time period T;
at a set time point t 1 Generating or receiving trigger pulses, and calculating the number of the trigger pulses;
acquiring time synchronizationInformation t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent/the time slave agent completes time synchronization.
The computer readable storage medium of the present embodiment may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present embodiment, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable storage medium may be written in one or more programming languages, including an object oriented programming language such as Java, python, C ++ and conventional procedural programming languages, such as the C-language or similar programming languages, or combinations thereof for performing the present embodiments. The program may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
In summary, the embodiment of the application realizes high-precision time synchronization between the same plug-in box single boards and between different plug-in box single boards by receiving the time information at the advanced time point of the synchronization time and broadcasting the time information to the time synchronization domain and responding to the synchronization pulse.
The above-mentioned embodiments are only preferred embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can make equivalent substitutions or modifications according to the technical solution and the inventive concept of the present application within the scope of the present application disclosed in the present application patent, and all those skilled in the art belong to the protection scope of the present application.

Claims (10)

1. A method of time synchronization performed by a time master agent, the method comprising:
determining a synchronous time period T;
at a set time point t 1 Generating trigger pulses, counting the number of trigger pulsesAn amount of;
acquiring time synchronization information t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
2. A method of time synchronization performed by a time master agent, the method comprising:
determining a synchronous time period T;
at a set time point t 1 Receiving trigger pulses, calculating the number of the trigger pulses, wherein the received trigger pulses are generated by an external pulse source;
acquiring time synchronization information t 1 +T;
At a set time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
in the time synchronization domain, when the trigger pulse count reaches a threshold value, a synchronization pulse is generated, and the synchronization pulse and the time synchronization information t are passed simultaneously 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
3. The method according to any one of claims 1-2, wherein the threshold value is defined by a set time point t 1 The time type of the trigger pulse and the synchronization time period T.
4. A method according to claim 3, wherein the time type of the trigger pulse comprises one of: seconds, minutes, hours, days, months, seasons, and years;
the time type of the trigger pulse is the same as the time type of the synchronization time period.
5. The method of claim 4, wherein the information t is synchronized by a synchronization pulse and time 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent is enabled to complete time synchronization, and the method comprises the following steps:
sending a synchronization pulse to enable the time processing device to trigger an interrupt so as to give a temporary variable to the time processing device, thereby achieving local time synchronization, wherein the temporary variable is time synchronization information t acquired by the time processing device in real time previously 1 +T。
6. A time synchronization device, the device comprising:
the determining module is used for determining a synchronous time period T;
a calculation module for setting a time point t 1 Generating or receiving trigger pulses, calculating the number of the trigger pulses, wherein the received trigger pulses are generated by an external pulse source;
an acquisition module for acquiring time synchronization information t 1 +T;
A broadcasting module for setting a time point t 1 And time synchronization information t 1 Between time points corresponding to +T, time synchronization information T 1 +T broadcast to time synchronization domain;
a synchronization module for generating a synchronization pulse when the trigger pulse count reaches a threshold value in the time synchronization domain, and simultaneously transmitting the synchronization pulse and the time synchronization information t 1 And +T, the time processing equipment corresponding to the time master agent or the time slave agent completes time synchronization.
7. A time synchronization system, comprising a time information source, a time master agent, a time slave agent and a time processing device;
a time information source for generating time information;
the time master agent and the corresponding time processing equipment connected with the time master agent are in the same plug-in box;
the time slave agent and the corresponding time processing equipment connected with the time slave agent are in the same plug-in box;
the time master agent and the time slave agent are not in the same plug-in box;
the time master agent and the time slave agent are in a tree-shaped relationship, and the link is a trigger pulse, wherein the time master agent is positioned at a trunk end, and the time slave agent is positioned at a branch end;
the time master agent and the time processing equipment are in star-shaped relation, and the link is time information;
a time master agent for implementing the method of any one of claims 1, 3-5;
the pulse is transmitted from the agent at the previous stage time to the agent at the next stage time, so that the pulse is transmitted step by step.
8. A time synchronization system, comprising a time information source, a time master agent, a time slave agent and a time processing device;
a time information source for generating time information and a trigger pulse;
the time master agent and the corresponding time processing equipment connected with the time master agent are in the same plug-in box;
the time slave agent and the corresponding time processing equipment connected with the time slave agent are in the same plug-in box;
the time master agent and the time slave agent are not in the same plug-in box;
the time master agent and the time slave agent are in a tree-shaped relationship, and the link is a trigger pulse, wherein the time master agent is positioned at a trunk end, and the time slave agent is positioned at a branch end;
the time master agent and the time processing equipment are in star-shaped relation, and the link is time information;
a time master agent for implementing the method of any of claims 2-5;
the pulse is transmitted from the agent at the previous stage time to the agent at the next stage time, so that the pulse is transmitted step by step.
9. A computer device comprising a processor and a memory for storing a program executable by the processor, wherein the processor implements the method of any of claims 1-5 when executing the program stored by the memory.
10. A storage medium storing a program, which when executed by a processor, implements the method of any one of claims 1-5.
CN202310191449.XA 2023-03-02 2023-03-02 Time synchronization method, device, system, computer equipment and storage medium Active CN116208284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310191449.XA CN116208284B (en) 2023-03-02 2023-03-02 Time synchronization method, device, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310191449.XA CN116208284B (en) 2023-03-02 2023-03-02 Time synchronization method, device, system, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116208284A CN116208284A (en) 2023-06-02
CN116208284B true CN116208284B (en) 2023-11-07

Family

ID=86518929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310191449.XA Active CN116208284B (en) 2023-03-02 2023-03-02 Time synchronization method, device, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116208284B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102204204A (en) * 2011-05-20 2011-09-28 华为技术有限公司 A method for realizing pulse synchronization and a device thereof
CN109283864A (en) * 2017-07-21 2019-01-29 北京智云芯科技有限公司 A kind of time synchronization of data sampling, calibration method and system
CN115102651A (en) * 2022-05-05 2022-09-23 阿里巴巴达摩院(杭州)科技有限公司 Data processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7146516B2 (en) * 2002-12-20 2006-12-05 Invensys Systems, Inc. Time synchronization schemes wherein at least one data message associates a hardware pulse with a future time

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102204204A (en) * 2011-05-20 2011-09-28 华为技术有限公司 A method for realizing pulse synchronization and a device thereof
CN109283864A (en) * 2017-07-21 2019-01-29 北京智云芯科技有限公司 A kind of time synchronization of data sampling, calibration method and system
CN115102651A (en) * 2022-05-05 2022-09-23 阿里巴巴达摩院(杭州)科技有限公司 Data processing method

Also Published As

Publication number Publication date
CN116208284A (en) 2023-06-02

Similar Documents

Publication Publication Date Title
US9762667B2 (en) Distributed server election with imperfect clock synchronization
CN110334126A (en) Timed task processing method, device and computer equipment based on Spring MVC
CN111464646B (en) Information processing method, information processing apparatus, electronic device, and medium
CN110830138B (en) Information processing method, electronic equipment and server
CN112417255A (en) Method and device for receiving online state, storage medium and electronic device
CN113572560B (en) Method, electronic device, and storage medium for determining clock synchronization accuracy
CN116208284B (en) Time synchronization method, device, system, computer equipment and storage medium
CN112769517B (en) T-BOX time synchronization method and device
CN114706615A (en) Automatic reverse analysis method and device for industrial robot protocol
CN111596721B (en) Data time tag synchronization method and device
WO2016000324A1 (en) Method and apparatus for implementing time synchronization
CN108123773B (en) Time synchronization method and device
CN112650815B (en) Method and device for synchronizing environment data, storage medium and electronic device
CN108964825A (en) Calibration method, correction device and time server
CN109510682B (en) Method, device, terminal and storage medium for synchronizing BMC (baseboard management controller) clocks of pooling server system
CN204707129U (en) Time synchronized server in a kind of local area network (LAN)
CN113434184A (en) Equipment upgrading method and device, storage medium and electronic device
CN113839991A (en) Method and device for confirming equipment information, storage medium and electronic device
CN112948195A (en) Interface testing method and device, electronic equipment and storage medium
CN108664656B (en) Knowledge data automatic synchronization and input method, device, system, equipment and medium
KR20100064283A (en) Method for synchronizing time in iptv service network
CN114553621B (en) Equipment access method and device, storage medium and electronic device
CN111158928B (en) Distributed system and communication method
CN110209400A (en) A kind of automatic registration and configuration method of intelligent electronic device
CN106201942B (en) By the associated method of event between computer equipment, equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant