WO2016004644A1 - Method and apparatus for monitoring ethernet clock synchronization - Google Patents
Method and apparatus for monitoring ethernet clock synchronization Download PDFInfo
- Publication number
- WO2016004644A1 WO2016004644A1 PCT/CN2014/082619 CN2014082619W WO2016004644A1 WO 2016004644 A1 WO2016004644 A1 WO 2016004644A1 CN 2014082619 W CN2014082619 W CN 2014082619W WO 2016004644 A1 WO2016004644 A1 WO 2016004644A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- clock device
- time
- slave
- master clock
- request message
- Prior art date
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 47
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000005856 abnormality Effects 0.000 claims description 15
- 230000006855 networking Effects 0.000 claims description 8
- ATJFFYVFTNAWJD-UHFFFAOYSA-N Tin Chemical compound [Sn] ATJFFYVFTNAWJD-UHFFFAOYSA-N 0.000 description 15
- 238000010586 diagram Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 8
- 238000013507 mapping Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 108700009949 PTP protocol Proteins 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 241000645803 Trailing lespedeza virus 1 Species 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
Definitions
- the present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for monitoring Ethernet clock synchronization.
- IEEE1588 is an accurate clock synchronization protocol based on packets. Based on the PTP protocol, message transmission between the master clock and the slave clock enables precise time synchronization and frequency synchronization in the packet transmission network.
- Frequency synchronization refers to a specific relationship in which the frequency or phase occurs at the same effective rate at the corresponding effective instant, thereby maintaining all devices in the communication network operating at the same rate.
- Clock synchronization means that the frequencies between the signals are the same and are consistent in phase.
- the master clock device In the existing 1588 clock synchronization protocol, the master clock device only periodically sends clock synchronization packets, or sends time synchronization packets according to the timing request from the clock device, but the master clock device cannot know the slave clock device and the master clock device. Whether the timing is correct, or whether the timing of the clock device from the master clock device is accurate.
- the local clock is adjusted by calculating the phase compensation value OFFSET, thereby realizing time synchronization with the master clock device, but
- the phase compensation value OFFSET calculated by the hardware configuration is an error value, so that it is difficult for the slave clock device to adjust the local clock according to the erroneous phase compensation value OFFSET.
- the master clock device simply salifies the slave clock device, and the master clock device cannot detect the time synchronization accuracy of the slave clock device, and a large time occurs between the slave clock device and the master clock device. If the deviation is not processed in time, the time synchronization of the current network will not meet the accuracy requirements, which will result in very strict Heavy security risks;
- the hardware configuration of a slave clock device fails or the network is abnormal, the time deviation between the master clock device and the slave clock device is gradually increased because the master clock device cannot detect the slave clock device.
- the synchronization is abnormal, so it can only be discovered after more serious consequences due to synchronization anomalies, but this has caused unnecessary losses.
- the embodiment of the invention provides a method for monitoring Ethernet clock synchronization, the method comprising:
- the master clock device sends a clock synchronization Sync message to the slave clock device;
- the master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information
- the method further includes:
- the master clock device receives the delay request that is sent by the slave clock device, wherein the delay request follows the time stamp ⁇ 3, where ⁇ 3 is the time for sending the delay request message from the clock device.
- the determining the time offset between the master clock device and the slave clock device includes: the master clock device receiving the delay according to the time stamp ⁇ 3 carried in the delay request message The time ⁇ 4 of the request message and the link delay information carried in the delay request message determine the time offset between the master clock device and the slave clock device;
- the delay request message When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, where the master clock is determined.
- the time offset between the device and the slave clock device includes:
- the master clock device according to the timestamp ⁇ 3 carried in the delay request message, the time ⁇ 4 of the delay request message received by the master clock device, the link delay information, and the end-to-end transparent clock device
- the dwell time information determines the time offset between the master clock device and the slave clock device.
- the delay request message returned by the slave clock device further includes: when the master clock device determines that the upper-level master clock device exists, the master clock device serves as the previous one. Master Returning, by the slave clock device of the clock device, a delay request message to the upper-level master clock device, where the delay request message carries the last pair of time periods determined by the master clock device as the slave clock device.
- the method further includes:
- the master clock device When the master clock device does not have the upper-level master clock device, the master clock device records the clock identification information of each slave clock device in the networking, and records each slave clock device in each pair of time periods and itself. Time offset, wherein the time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
- An embodiment of the present invention provides an apparatus for monitoring synchronization of an Ethernet clock, where the apparatus includes:
- a sending module configured to send a clock synchronization Sync message to the slave clock device
- a receiving module configured to receive a delay request message returned from the clock device, where the delay request message carries link delay information between the master clock device and the slave clock device determined by the clock device;
- a determining module configured to determine a time offset between the master clock device and the slave clock device according to the received link delay information
- a determining module configured to determine whether the time deviation is less than a set time deviation threshold
- the alarm module is configured to issue a clock synchronization abnormality alarm signal when the determining module determines that the time deviation is not less than a set time deviation threshold.
- the receiving module is further configured to: when the slave clock device is a two-step clock, receive a delay request sent by the slave clock device to follow For example, the delay request follows the time stamp ⁇ 3, where ⁇ 3 is the time for sending the delay request message from the clock device.
- the determining module is specifically configured to: according to the timestamp ⁇ 3 carried in the delay request message, the time ⁇ 4 of the delay request message and the delay request message
- the link delay information carried in the text determines the time deviation between the master clock device and the slave clock device
- the delay request message When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, and the determining module, Specifically, the method is further configured to: timestamp ⁇ 3 carried in the delay request packet, time 404 in which the delay request message is received by itself, the link delay information, and the station of the end-to-end transparent clock device. The time information is used to determine the time offset between the master clock device and the slave clock device.
- the sending module is further configured to: when it is determined that the upper-level master clock device exists, return a delay request message to the upper-level master clock device, where the delay The request message carries the link delay information between the last pair of time periods determined as the master clock device of the slave clock device and the upper master clock device, and the determined time of each slave clock device belonging to itself. Deviation, clock identification information for each slave clock device and timing information for determining each time offset.
- the device further includes:
- a storage module configured to record, according to clock identification information of each slave clock device in the networking, when the upper-level master clock device does not exist, record a time deviation of each slave clock device from itself in each pair of time periods, where The time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
- the embodiment of the present invention provides a method and a device for monitoring Ethernet clock synchronization.
- the slave clock device returns a delay request message to the master clock device
- the slave device carries the slave clock device in the delay request message.
- the link delay information between the master clock device and the slave clock device in the last pair of time periods so that the master clock device can determine the time deviation between the master clock device and the slave clock device, according to whether the time deviation is less than the set time Deviation threshold to determine whether to send an alarm message.
- the master clock device can determine the timing of the slave clock device to achieve monitoring.
- the purpose of the clock device is to ensure the accuracy of time synchronization and reduce the loss caused by inaccurate time.
- FIG. 1 is a schematic diagram of a process for monitoring Ethernet clock synchronization according to an embodiment of the present invention
- FIG. 2A is a clock synchronization monitoring list maintained by a master clock device of a higher-level master clock device according to Embodiment 1 of the present invention
- FIG. 2B is a clock synchronization monitoring list maintained by a master clock device of a higher-level master clock device according to Embodiment 2 of the present invention
- FIG. 3 is a schematic diagram of a detailed process of monitoring Ethernet clock synchronization according to an embodiment of the present invention.
- FIG. 4A is a schematic structural diagram of a networking for performing clock synchronization monitoring on an Ethernet according to an embodiment of the present invention
- FIG. 4B is a package format diagram of a delay request packet including a TIN field according to an embodiment of the present invention
- FIG. 5 is a schematic structural diagram of a device for monitoring an Ethernet clock synchronization according to an embodiment of the present invention.
- DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In order to effectively monitor the time-to-time situation of each slave clock device in the network, and discover the synchronization abnormality between the slave clock device and the master clock device in time, and improve the reliability of the network, the embodiment of the present invention provides a method for monitoring Ethernet. Method and device for clock synchronization.
- FIG. 1 is a schematic diagram of a process for monitoring Ethernet clock synchronization according to an embodiment of the present invention, where the process includes the following steps:
- the master clock device sends a clock synchronization Sync message to the slave clock device.
- the master clock device sends a clock synchronization Sync message to the slave clock device according to the set time interval according to the IEEE1588 protocol, where the clock synchronization Sync message carries the time T1 and the time period SQ for transmitting the clock synchronization Sync message. ID and other information.
- the master clock device receives the delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device of the last pair of time periods determined by the slave clock device.
- the time T2 of the clock synchronization Sync message sent by the master clock device is recorded from the clock device, and the link delay Delay calculated according to the previous time period and the time T1 carried in the clock synchronization Sync message are calculated and calculated.
- the time offset of the master clock device is OFFSET, and the local clock is corrected according to the OFFSET value, and then the delay request message is returned to the master clock device, where the delay request message carries the delay request sent by the slave clock device.
- Information such as the time T3 of the packet, the clock ID information, the clock ID, and the SQ ID, and the TIN field of the delay request carries the last clock cycle between the master clock device and the slave clock device.
- the link delays the Delay.
- the method further includes: the master clock device receiving the delay request sent by the slave clock device Following the ⁇ ⁇ text, where the delay request follows the time stamp ⁇ 3 , ⁇ 3 is the time for sending the delay request message from the clock device.
- the slave clock device calculates the time T2 of synchronizing the Sync message according to the clock sent by the master clock device, the timestamp T1 carried in the Sync message, and the previous time period.
- the link delay delay calculate the time offset from the master clock device OFFSET and correct the local clock, and then return a delay request message carrying the SQ ID and delay information to the master clock device, and then send the delay request message.
- the time T3 of the text is carried to the delay request follow message and sent to the master clock device.
- the master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information.
- the master clock device records the time T4 of receiving the delay request message sent from the clock device, and parses the delay request message to obtain the time when the slave clock device carries the delay request message carried in the delay request message.
- T3 and the link delay Delay between the master clock device and the slave clock device calculated in the last time period, and determine the time offset between the master clock device and the slave clock device based on the above information.
- the determining the time offset between the master clock device and the slave clock device includes: The master clock device determines, according to the timestamp T3 carried in the delay request message, the time T4 of the delay request message and the link delay information carried in the delay request message. Time offset between the master clock device and the slave clock device;
- the delay request message When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, where the master clock is determined.
- the time offset between the device and the slave clock device includes:
- the master clock device according to the timestamp T3 carried in the delay request message, the time T4 when the delay request message is received by itself, the link delay information, and the end-to-end transparent clock device
- the dwell time information determines the time offset between the master clock device and the slave clock device.
- the master clock device records the time ⁇ 4 of receiving the delay request message sent from the clock device, parses the delay request message, and extracts the time stamp ⁇ 3, the time period SQ ID, and the slave clock carried in the message.
- the slave device When there is an end-to-end transparent clock device between the master clock device and the slave clock device, when the slave clock device returns a delay request message to the master clock device, the slave device carries the slave clock in the TIN field of the delay request message.
- the time T4 of the delay request message sent by the device parsing the delay request, extracting the time stamp ⁇ 3 carried in the text, the SQ ID of the time period, and the clock ID of the slave clock device, Obtaining, in the TIN field of the delay request message, the link delay Delay between the primary clock device calculated by the slave clock device and the delay request message passing through each end
- S104 The master clock device determines whether the time deviation is less than a set time deviation threshold.
- each primary clock device can set the same time deviation threshold, and different time deviation thresholds can be set for each primary clock device.
- the master clock device After calculating the time deviation between each slave clock device and itself, the master clock device according to its own time offset The threshold value is used to determine whether the calculated time deviation is less than the time deviation threshold. When it is determined that the time deviation is not less than the set time deviation threshold, the master clock device determines that the slave clock device is in time synchronization with itself and issues a clock synchronization. Abnormal alarm signal.
- the clock synchronization abnormality alarm signal carries information such as a clock ID, a time period SQ ID, and the determined time offset of the slave clock device.
- the slave clock device when the slave clock device performs clock synchronization with the master clock device, the determined link delay information between the master clock device and the master clock device is returned to the master clock device, so that the master clock device Calculating the time deviation between the slave clock device and itself according to the link delay information and the sending and receiving time of the packet carrying the link delay information message, thereby determining the timing of the slave clock device and achieving the purpose of monitoring the slave clock device.
- the accuracy requirement of time synchronization is ensured, and the loss caused by inaccurate time is reduced.
- each primary clock device needs to monitor its own slave clock devices.
- the delay request message returned by the master clock device as the slave clock device of the upper-level master clock device further includes:
- the master clock device When the master clock device determines that the upper-level master clock device exists, the master clock device serves as a slave clock device of the upper-level master clock device, and returns a delay request message to the upper-level master clock device.
- the delay request message carries the link delay information between the last pair of time periods determined by the master clock device of the slave clock device and the upper-level master clock device, and each determined slave belongs to itself. Time offset of the clock device, clock identification information for each slave clock device, and timing information for determining each time offset.
- each level of the master clock device is based on the time T4 of receiving the delay request message returned from the clock device, the timestamp T3 carried in the delay request message, and a pair of time periods on the slave clock device. a link delay delay between the slave clock device and the master clock device, and after calculating the time offset of the slave clock device, updating a locally stored mapping list of the clock ID, the time period SQ ID, and the time offset of the slave clock device, where The master clock device determines whether it has the upper-level master clock device. When it is determined that the upper-level master clock device exists, the master clock device returns the delay request message to the upper-level master clock device.
- the SQ ID and the clock ID of the slave clock device of the upper-level master clock device As the time T3 of transmitting the delay request message, the SQ ID and the clock ID of the slave clock device of the upper-level master clock device, and the link delay delay of the master clock with the upper-level master clock, It is necessary to save itself for the time offset of each slave clock device and its own time period, and the SQ ID and Clock I of each slave clock device corresponding to the time offset.
- the information such as D is carried in the delay request message.
- the method further includes:
- the master clock device When the master clock device does not have the upper-level master clock device, the master clock device records the clock identification information of each slave clock device in the networking, and records each slave clock device in each pair of time periods and itself. Time offset, wherein the time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
- the master clock device of the upper-level master clock device does not need to monitor the timing of all the slave clock devices in the entire network, and the master clock device that does not exist in the upper-level master clock device establishes clock synchronization locally.
- a watch list where the time synchronization deviation of each of the slave clock devices is saved in the clock synchronization monitoring list, where the clock synchronization monitoring list includes clock ID information of each of the slave clock devices, and a corresponding time period SQ ID.
- the time deviation from itself, through the clock synchronization monitoring list administrator or maintenance personnel can intuitively determine the timing deviation trend of each slave clock device and the master clock device without the upper-level master clock device, which is convenient for discovery
- the timing error of the slave clock device is processed in time, which solves the problem that the time deviation between the clock device and the master clock device is gradually increased, which ultimately leads to more serious consequences, improves the reliability of the network, and reduces unnecessary loss.
- the master clock device In order to facilitate the time delay of the master clock device to send its slave clock device to its upper-level master clock device, the master clock device that does not exist in the upper-level master clock device monitors the timing of all slave clock devices.
- different master clock devices can maintain their own saved clock synchronization monitoring list in different ways. As shown in FIG. 2A, when there is a clock synchronization monitoring list maintained by the master clock device of the upper-level master clock device, the master clock device determines the information according to the information carried in the delay request message returned by each of the slave clock devices.
- FIG. 2B is a clock synchronization monitoring list maintained when the upper-level master clock device does not exist, as shown in the figure, and exists Compared with the master clock device of the upper-level master clock device, the master clock device that does not exist in the upper-level master clock device needs to save the time offset of each slave clock device with each time period, thereby monitoring the whole The timing of each slave clock device.
- FIG. 3 is a schematic diagram of a detailed process of monitoring Ethernet clock synchronization according to an embodiment of the present invention, where the process includes the following steps:
- the master clock device sends a clock synchronization Sync message to the slave clock device.
- the master clock device receives the delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device of the last pair of time periods determined by the slave clock device.
- the master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information.
- S304 The master clock device determines whether the time deviation is less than a set time deviation threshold. If the determination result is yes, proceed to step S306; otherwise, proceed to step S305.
- S305 When the master clock device determines that the time deviation is not less than a set time deviation threshold, a clock synchronization abnormality alarm signal is issued.
- the master clock device updates its own clock synchronization monitoring list according to the clock ID of the slave clock device, the time period SQ ID, and the time offset.
- step S307 The master clock device determines whether there is a higher-level master clock device. If the determination result is YES, then step S308 is performed; otherwise, step S309 is performed.
- the master clock device returns a delay request message to the upper-level master clock device, where the delay request message carries the link between the last pair of time periods determined by the master clock device and the upper-level master clock device.
- the master clock device records, for the clock identification information of each slave clock device in the networking, a time offset of each slave clock device with each time period, wherein the time offset is according to the slave clock device and each The sum of the time offsets between the primary clock devices.
- the slave clock device when the slave clock device performs clock synchronization with the master clock device, the link delay information between the determined master clock device and the master clock device and the associated slave clock device and its own The time offset is returned to the master clock device, so that the master clock device updates its own clock synchronization monitoring list, and reports the time offset of each slave clock device to which it belongs to the upper-level master clock device through the delay request message.
- the master clock device of the upper-level master clock device does not monitor the timing of all slave clock devices, thereby ensuring the accuracy requirement of time synchronization and reducing the loss caused by inaccurate timing.
- FIG. 4A is a schematic diagram of a network structure for performing clock synchronization monitoring on an Ethernet according to an embodiment of the present invention.
- M is a master clock device having no upper-level master clock device, and switching devices S1-S8 For the slave clock devices of M, both are Boundary Clocks (BC), and SI is the upper-level master clock device of S3.
- S2 is the upper-level master clock device of S4 ⁇ S6, and S4 is S7 and The upper-level master clock device of S8, the slave clock device of S2 includes S4 ⁇ S8, wherein the synchronization period of the slave clock devices S1-S8 and the master clock device M is the same.
- M sends a Sync message to S1 and S2 according to the IEEE1588 protocol, where the Sync 4 message carries the transmission time t1 of the message.
- S1 records the time t2 when the Sync message is received, and returns a delay request message to the M.
- the delay request message carries the time t3 at which the delay request message is sent, and the M record receives the delay request message.
- the time t4 of the text, and t4 is carried into the Delay_resp message and sent to the SI, and the S1 calculates the average link delay delayMl of itself and M according to the four timestamps tl, t2, t3, t4, and the same S2 determines and M
- the average link delay delayM2, S3 determines the average link delay delayl3 with S1, and so on, and analogously, the average link delay delay calculated by each slave clock device with the upper-level master clock device.
- the slave clock device S1 When the master clock device M clocks the slave clock in the second timing cycle, the slave clock device S1, according to Sync The timestamp tl in the message and the link delay delayMl calculated in the first pair of time periods, calculate the time offset from the master clock device OFFSET and adjust the local clock, and then return the delay request to M. And adding a TIN field at the end of the delay request message, and the delay request message is sent from the timestamp t3 of the clock device to the origintimestamp field of the • ⁇ , where the TIN field Type is set to DELAY, the length is 8 bytes, and the value is the link delay delayMl calculated in the previous pair of time periods.
- the M records the time t4 of receiving the delay request ⁇ If the time difference OFM1 is less than the set time deviation threshold, the M will issue a clock synchronization abnormality alarm message, where
- the clock synchronization abnormality alarm message includes information such as the clock ID of the S1, the current SQ ID, and the time offset OFM1.
- the M updates the locally saved clock synchronization monitoring list according to the determined time deviation OFM1 of the slave clock device S1 and the clock ID of the S1 carried in the delay request message and the current time period SQ ID.
- the time synchronization OFM2 of S2 is also stored in the clock synchronization monitoring list of M.
- the time synchronization OF13 of S3 is stored in the clock synchronization monitoring list of S1, and the time of S4 S6 is saved in the clock synchronization monitoring list of S2.
- the time deviations OF47 and OF48 of S7 and S8 are stored in the clock synchronization monitoring list of the deviations OF24, OF25 and OF26, S4.
- the slave clock device S1 calculates the time according to the timestamp t1 in the Sync message and the link delay delayMl calculated in the second pair of time periods.
- the offset OFFSET adjusts the local clock, and returns the delay request message to the M.
- the delay is still Adding a new TIN field at the end of the request message, carrying the time offset of the S3 in the second pair of time periods, the clock ID of the S3, the clock ID of the S3, and the second time period SQ ID, where the new increase is made in the TIN field.
- Type can be set to SLAVE, the length is 24 bytes, the Value content part can store the Block ID of S3 with 8 bytes, and the 8 bytes store the time deviation of the second timing period of S3 and S1 OF13, 8 The byte holds the second time period SQID.
- Deviation threshold when it is determined that any one of the above time deviations is not less than the set time deviation threshold, M will issue a clock synchronization abnormality alarm message.
- M increases the time offset of the third timing period of S 1 in its own clock synchronization monitoring list according to the determined time offset OFM1 of the clock device S1 according to the determined third timing period, and according to the determined S3 in the second pair Time period
- the inter-vehicle OFM3 and the clock ID of the S3 carried in the delay request message store the mapping relationship between the clock identification information, the time period and the time offset value of the S3 in the clock synchronization monitoring list.
- M can save the time offset of the slave clock device S4 S8 in the local clock synchronization monitoring list through the delay request message returned by S2, thereby realizing the monitoring of the timing of all the slave clock devices.
- the clock device S4 When an abnormality occurs in the slave clock device in the network, for example, the clock device S4 is inaccurate with the S2 due to a hardware failure or a network abnormality, and the time deviation from the previous master clock S2 is large, but does not exceed S2.
- the time deviation threshold is set, and the time deviation threshold of the main clock M is not exceeded after the time deviation of S2 is added.
- the clock synchronization abnormality signal is not issued by the previous main clock S2 and the main clock device M.
- the member will not be able to find the problem in time.
- the slave clock devices S7 and S8 of S4 also have a time deviation when synchronizing with S4.
- the master clock device M determines that the time offset value of S7 or S8 exceeds the set threshold, it will also trigger.
- FIG. 4 is a package format diagram of a delay request packet including a TIN field according to an embodiment of the present invention.
- a conventional delay request message carries a slave clock device in a DATA.
- the end of the delay request message is added.
- the TIN field in which the Value part is used to carry the link delay of the slave clock device and the master clock device in the last pair of time periods, when the slave clock device still has the next-level slave clock device,
- the new TLV1 field is added after the TIN field, and the value of the next-level slave clock device calculated by the Clock ID, the SQ ID of the next-level slave clock device, and the last-stage time period is carried in the Value portion of the new TIN field.
- Deviation wherein the length of the newly added TIN field is determined by the number of slave clock devices of the next level included in the slave clock device.
- FIG. 5 is a schematic structural diagram of a device for monitoring an Ethernet clock synchronization according to an embodiment of the present invention.
- the device includes: a sending module 51, configured to send a clock synchronization Sync message to a slave clock device;
- the receiving module 52 is configured to receive a delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device determined by the clock device. ;
- a determining module 53 configured to determine a time offset between the master clock device and the slave clock device according to the received link delay information
- the determining module 54 is configured to determine whether the time deviation is less than a set time deviation threshold
- the alarm module 55 is configured to send a clock synchronization abnormality alarm signal when the determining module determines that the time deviation is not less than a set time deviation threshold.
- the receiving module 52 is further configured to: when the slave clock device is a two-step clock, receive a delay request follow message sent by the slave clock device, where the delay request follows a time stamp T3, and T3 is The time from when the clock device sends a delay request.
- the determining module 53 is configured to: according to the timestamp ⁇ 3 carried in the delay request message, the time ⁇ 4 of the delay request message and the link carried in the delay request message Delay information to determine the time offset between the master clock device and the slave clock device.
- the delay request message further carries the resident time information of the end-to-end transparent clock device, and the determining module 53 Specifically, the method is further configured to: timestamp ⁇ 3 carried in the delay request message, time ⁇ 4 of receiving the delay request message by itself, the link delay information, and the end-to-end transparent clock device
- the dwell time information determines the time offset between the master clock device and the slave clock device.
- the sending module 51 is further configured to: when it is determined that the upper-level master clock device exists, return a delay request message to the upper-level master clock device, where the delay request packet carries the slave request.
- the device also includes:
- the storage module 56 is configured to record, for the clock identification information of each slave clock device in the networking, when the upper-level master clock device does not exist, record the time deviation of each slave clock device from itself in each pair of time periods, The time offset is determined based on a sum of time deviations between the slave clock device and each stage master clock device.
- the embodiment of the present invention provides a method and a device for monitoring Ethernet clock synchronization.
- the slave clock device returns a delay request message to the master clock device
- the slave device carries the slave clock device in the delay request message.
- the link delay information between the master clock device and the slave clock device in the last pair of time periods so that the master clock device can determine the time deviation between the master clock device and the slave clock device, according to whether the time deviation is less than the set time Deviation threshold to determine whether to send an alarm message.
- the master clock device can determine the timing of the slave clock device to achieve monitoring.
- the purpose of the clock device is to ensure the accuracy of time synchronization and reduce the loss caused by inaccurate time.
- modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
- the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-assemblies.
- any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed may be employed. Or combine all the processes or units of the device.
- Each feature disclosed in the specification (including the accompanying claims, the abstract, and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
- a microprocessor or digital signal processor can be used in practice to implement some or all of the devices, terminals, and systems that monitor Ethernet clock synchronization in accordance with embodiments of the present invention.
- the invention may also be embodied as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- Such a program implementing the present invention may be stored on a computer readable shield or may have the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
- any reference signs placed between parentheses shall not be construed as a limitation.
- the word “comprising” does not exclude the presence of the elements or steps that are not in the claims.
- the word “a” or “an” preceding a component does not exclude the presence of a plurality of such elements.
- the invention can be implemented by means of hardware comprising thousands of different elements and by means of a suitably programmed computer. In the unit claims enumerating the thousands of devices, thousands of these devices may be embodied by the same hardware item.
- the use of the words first, second, and third does not indicate any order. These words can be interpreted as Name.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The present application provides a method and apparatus for monitoring Ethernet clock synchronization. In the method, when a slave clock device returns a delay request packet to a master clock device, the delay request packet carries link delay information, determined by the slave clock device, between the master clock device and the slave clock device of a last time synchronization cycle, so that the master clock device can determine a time deviation between the master clock device and the slave clock device and determine, according to whether the time deviation is smaller than a set time deviation threshold, whether to send alarm information. Because in embodiments of the present application, the slave clock device returns the determined link delay information between the slave clock device and the master clock device to the master clock device, the master clock device can determine a time synchronization condition of the slave clock device so as to achieve the purpose of monitoring the slave clock device, and thus precision demands of time synchronization are ensured and loss caused by inaccuracy of time synchronization is reduced.
Description
一种监控以太网时钟同步的方法及装置 本申请要求在 2014年 7月 09日提交中国专利局、 申请号为 201410325610.9、发明名称为一种 监控以太网时钟同步的方法及装置的中国专利申请的优先权, 其全部内容通过引用结合在本 申请中。 Method and device for monitoring Ethernet clock synchronization. The present application claims to be filed on July 9, 2014, the Chinese Patent Office, the application number is 201410325610.9, and the invention is a method and device for monitoring Ethernet clock synchronization. Priority is hereby incorporated by reference in its entirety.
技术领域 Technical field
本发明涉及互联网技术领域, 尤其涉及一种监控以太网时钟同步的方法及装置。 The present invention relates to the field of Internet technologies, and in particular, to a method and apparatus for monitoring Ethernet clock synchronization.
背景技术 Background technique
IEEE1588是一种建立在报文基础上的精确时钟同步协议, 基于 PTP协议在主时钟和 从时钟间进行消息传递, 可以在分组传送的网络中实现精确时间同步和频率同步。 其中频 率同步是指频率或相位在相应的有效瞬间以同一平均速率出现的特定关系, 从而维持通信 网络中所有的设备以相同的速率运行。 时钟同步是指信号之间的频率相同, 并且在相位上 保持一致。 IEEE1588 is an accurate clock synchronization protocol based on packets. Based on the PTP protocol, message transmission between the master clock and the slave clock enables precise time synchronization and frequency synchronization in the packet transmission network. Frequency synchronization refers to a specific relationship in which the frequency or phase occurs at the same effective rate at the corresponding effective instant, thereby maintaining all devices in the communication network operating at the same rate. Clock synchronization means that the frequencies between the signals are the same and are consistent in phase.
工业以太网对时钟同步要求很高, 如果从时钟设备和主时钟设备之间的对时出现误 差, 且当该误差不能及时检测到时, 有可能导致从时钟设备与主时钟设备的时间偏差越来 越大, 最终时间无法同步。 Industrial Ethernet requires high clock synchronization. If there is an error in the timing between the slave clock device and the master clock device, and when the error cannot be detected in time, the time deviation between the slave clock device and the master clock device may be more The bigger the time, the final time cannot be synchronized.
现有的 1588 时钟同步协议中, 主时钟设备只是周期性的发送时钟同步报文, 或者根 据从时钟设备的对时请求发送时间同步报文, 但主时钟设备无法知道从时钟设备与主时钟 设备是否进行对时,或者从时钟设备与主时钟设备的对时是否准确。另夕卜,根据 PTP协议, 当从时钟设备接收到主时钟设备发送的时钟同步 ·ί艮文后, 通过计算相位补偿值 OFFSET对 本地时钟进行调整, 从而实现与主时钟设备的时间同步, 但当从时钟设备本身的硬件配置 出现问题时, 通过该硬件配置计算出的相位补偿值 OFFSET为错误值, 因此从时钟设备根 据该错误的相位补偿值 OFFSET对本地时钟进行调整, 就很难达到与主时钟的精确对时, 或者, 当从时钟设备与主时钟设备之间的链路异常时, 将导致时间同步 4艮文频繁丢包, 从 而造成从时钟设备长时间进行守时, 进而无法与主时钟设备保持同步。 In the existing 1588 clock synchronization protocol, the master clock device only periodically sends clock synchronization packets, or sends time synchronization packets according to the timing request from the clock device, but the master clock device cannot know the slave clock device and the master clock device. Whether the timing is correct, or whether the timing of the clock device from the master clock device is accurate. In addition, according to the PTP protocol, after receiving the clock synchronization sent by the master clock device from the clock device, the local clock is adjusted by calculating the phase compensation value OFFSET, thereby realizing time synchronization with the master clock device, but When there is a problem with the hardware configuration of the clock device itself, the phase compensation value OFFSET calculated by the hardware configuration is an error value, so that it is difficult for the slave clock device to adjust the local clock according to the erroneous phase compensation value OFFSET. The exact timing of the master clock, or when the link between the slave clock device and the master clock device is abnormal, the time synchronization will cause frequent packet loss, causing the slave clock device to perform punctuality for a long time, and thus cannot The master clock device remains synchronized.
因此, 现有的时钟同步机制中主时钟设备只是单纯的对从时钟设备进行授时, 主时钟 设备无法检测从时钟设备的时间同步精度, 当从时钟设备与主时钟设备之间出现较大的时 间偏差而未能及时处理时, 将导致当前网络的时间同步达不到精度要求, 从而造成非常严
重的安全隐患; 另外, 当某个从时钟设备的硬件配置故障或者网络出现异常时, 导致主时 钟设备与从时钟设备之间的时间偏差逐步加大, 因为主时钟设备无法监测到从时钟设备的 同步异常, 所以只有因同步异常导致更严重的后果之后才可能被发现, 但此时已经造成了 不必要的损失。 发明内容 鉴于上述问题, 提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问 题的一种监控以太网时钟同步的方法及装置。 Therefore, in the existing clock synchronization mechanism, the master clock device simply salifies the slave clock device, and the master clock device cannot detect the time synchronization accuracy of the slave clock device, and a large time occurs between the slave clock device and the master clock device. If the deviation is not processed in time, the time synchronization of the current network will not meet the accuracy requirements, which will result in very strict Heavy security risks; In addition, when the hardware configuration of a slave clock device fails or the network is abnormal, the time deviation between the master clock device and the slave clock device is gradually increased because the master clock device cannot detect the slave clock device. The synchronization is abnormal, so it can only be discovered after more serious consequences due to synchronization anomalies, but this has caused unnecessary losses. SUMMARY OF THE INVENTION In view of the above, the present invention has been made in order to provide a method and apparatus for monitoring Ethernet clock synchronization that overcomes the above problems or at least partially solves the above problems.
本发明实施例提供了一种监控以太网时钟同步的方法, 该方法包括: The embodiment of the invention provides a method for monitoring Ethernet clock synchronization, the method comprising:
主时钟设备向从时钟设备发送时钟同步 Sync报文; The master clock device sends a clock synchronization Sync message to the slave clock device;
接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带从时钟设备确定的 上一对时周期主时钟设备与从时钟设备间的链路延迟信息; Receiving a delay request message returned from the clock device, where the delay request message carries link delay information between the master clock device and the slave clock device determined by the slave device;
主时钟设备根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间的时间 偏差; The master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information;
判断该时间偏差是否小于设定的时间偏差阈值; Determining whether the time deviation is less than a set time deviation threshold;
当该时间偏差不小于设定的时间偏差阈值时, 发出时钟同步异常告警信号。 When the time deviation is not less than the set time deviation threshold, a clock synchronization abnormality alarm signal is issued.
为了监控每个从时钟设备, 扩大本方案的实施范围, 当所述从时钟设备为两步钟时, 所述方法还包括: In order to monitor each slave clock device, the implementation scope of the solution is expanded. When the slave clock device is a two-step clock, the method further includes:
所述主时钟设备接收所述从时钟设备发送的延时请求跟随 ·ί艮文, 其中该延时请求跟随 中携带时间戳 Τ3 , Τ3为从时钟设备发送延时请求报文的时间。 The master clock device receives the delay request that is sent by the slave clock device, wherein the delay request follows the time stamp Τ3, where Τ3 is the time for sending the delay request message from the clock device.
为了准确的确定时间偏差, 所述确定主时钟设备与从时钟设备之间的时间偏差包括: 所述主时钟设备根据所述延时请求报文中携带的时间戳 Τ3 , 自身收到所述延时请求报 文的时间 Τ4及所述延时请求报文中携带的链路延迟信息, 确定主时钟设备与从时钟设备 之间的时间偏差; In order to accurately determine the time offset, the determining the time offset between the master clock device and the slave clock device includes: the master clock device receiving the delay according to the time stamp Τ3 carried in the delay request message The time Τ4 of the request message and the link delay information carried in the delay request message determine the time offset between the master clock device and the slave clock device;
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定主时钟设备与从时钟设备之 间的时间偏差包括: When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, where the master clock is determined. The time offset between the device and the slave clock device includes:
所述主时钟设备根据所述延时请求报文中携带的时间戳 Τ3、自身收到所述延时请求报 文的时间 Τ4、所述链路延迟信息及所述端到端透明时钟设备的驻留时间信息,确定主时钟 设备与从时钟设备之间的时间偏差。 The master clock device according to the timestamp Τ3 carried in the delay request message, the time 自身4 of the delay request message received by the master clock device, the link delay information, and the end-to-end transparent clock device The dwell time information determines the time offset between the master clock device and the slave clock device.
为了准确的监控每个从时钟设备, 所述从时钟设备返回的延时请求报文还包括: 当所述主时钟设备判断自身存在上一级主时钟设备时, 所述主时钟设备作为上一级主
时钟设备的从时钟设备, 向所述上一级主时钟设备返回延时请求报文, 其中所述延时请求 报文中携带该作为从时钟设备的主时钟设备确定的上一对时周期与上一级主时钟设备间 的链路延迟信息、 及确定的归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备的 时钟标识信息以及确定每个时间偏差的对时周期信息。 In order to accurately monitor each slave clock device, the delay request message returned by the slave clock device further includes: when the master clock device determines that the upper-level master clock device exists, the master clock device serves as the previous one. Master Returning, by the slave clock device of the clock device, a delay request message to the upper-level master clock device, where the delay request message carries the last pair of time periods determined by the master clock device as the slave clock device The link delay information between the upper-level master clock devices, and the determined time offset of each slave clock device belonging to itself, the clock identification information of each slave clock device, and the timing information for determining each time offset.
为了准确的监控每个从时钟设备, 所述方法还包括: In order to accurately monitor each slave clock device, the method further includes:
当所述主时钟设备不存在上一级主时钟设备时, 所述主时钟设备针对组网中的每个从 时钟设备的时钟标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中 该时间偏差根据该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。 When the master clock device does not have the upper-level master clock device, the master clock device records the clock identification information of each slave clock device in the networking, and records each slave clock device in each pair of time periods and itself. Time offset, wherein the time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
本发明实施例提供了一种监控以太网时钟同步的装置, 所述装置包括: An embodiment of the present invention provides an apparatus for monitoring synchronization of an Ethernet clock, where the apparatus includes:
发送模块, 用于向从时钟设备发送时钟同步 Sync报文; a sending module, configured to send a clock synchronization Sync message to the slave clock device;
接收模块, 用于接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带从 时钟设备确定的上一对时周期主时钟设备与从时钟设备间的链路延迟信息; a receiving module, configured to receive a delay request message returned from the clock device, where the delay request message carries link delay information between the master clock device and the slave clock device determined by the clock device;
确定模块, 用于根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间的 时间偏差; a determining module, configured to determine a time offset between the master clock device and the slave clock device according to the received link delay information;
判断模块, 用于判断该时间偏差是否小于设定的时间偏差阈值; a determining module, configured to determine whether the time deviation is less than a set time deviation threshold;
告警模块, 用于当判断模块确定该时间偏差不小于设定的时间偏差阈值时, 发出时钟 同步异常告警信号。 The alarm module is configured to issue a clock synchronization abnormality alarm signal when the determining module determines that the time deviation is not less than a set time deviation threshold.
为了监控每个从时钟设备, 扩大本方案的实施范围, 所述接收模块, 还用于当所述从 时钟设备为两步钟时, 接收所述从时钟设备发送的延时请求跟随 ·ί艮文, 其中该延时请求跟 随中携带时间戳 Τ3 , Τ3为从时钟设备发送延时请求报文的时间。 In order to monitor the implementation scope of the solution, the receiving module is further configured to: when the slave clock device is a two-step clock, receive a delay request sent by the slave clock device to follow For example, the delay request follows the time stamp Τ3, where Τ3 is the time for sending the delay request message from the clock device.
为了准确的确定时间偏差, 所述确定模块, 具体用于根据所述延时请求报文中携带的 时间戳 Τ3 , 自身收到所述延时请求报文的时间 Τ4及所述延时请求报文中携带的链路延迟 信息, 确定主时钟设备与从时钟设备之间的时间偏差; In order to accurately determine the time deviation, the determining module is specifically configured to: according to the timestamp Τ3 carried in the delay request message, the time Τ4 of the delay request message and the delay request message The link delay information carried in the text determines the time deviation between the master clock device and the slave clock device;
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定模块, 具体还用于根据所述 延时请求报文中携带的时间戳 Τ3、 自身收到所述延时请求报文的时间 Τ4、 所述链路延迟 信息及所述端到端透明时钟设备的驻留时间信息, 确定主时钟设备与从时钟设备之间的时 间偏差。 When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, and the determining module, Specifically, the method is further configured to: timestamp Τ3 carried in the delay request packet, time 404 in which the delay request message is received by itself, the link delay information, and the station of the end-to-end transparent clock device. The time information is used to determine the time offset between the master clock device and the slave clock device.
为了准确的监控每个从时钟设备, 所述发送模块, 还用于当判断自身存在上一级主时 钟设备时, 向所述上一级主时钟设备返回延时请求报文, 其中所述延时请求报文中携带该 作为从时钟设备的主时钟设备确定的上一对时周期与上一级主时钟设备间的链路延迟信 息、 及确定的归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备的时钟标识信息 以及确定每个时间偏差的对时周期信息。
为了准确的监控每个从时钟设备, 所述装置还包括: In order to accurately monitor each of the slave clock devices, the sending module is further configured to: when it is determined that the upper-level master clock device exists, return a delay request message to the upper-level master clock device, where the delay The request message carries the link delay information between the last pair of time periods determined as the master clock device of the slave clock device and the upper master clock device, and the determined time of each slave clock device belonging to itself. Deviation, clock identification information for each slave clock device and timing information for determining each time offset. In order to accurately monitor each slave clock device, the device further includes:
存储模块, 用于当不存在上一级主时钟设备时, 针对组网中的每个从时钟设备的时钟 标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中该时间偏差根据 该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。 a storage module, configured to record, according to clock identification information of each slave clock device in the networking, when the upper-level master clock device does not exist, record a time deviation of each slave clock device from itself in each pair of time periods, where The time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
本发明实施例提供了一种监控以太网时钟同步的方法及装置, 该方法中从时钟设备在 向主时钟设备返回延时请求报文时, 在该延时请求报文中携带从时钟设备确定的上一对时 周期主时钟设备与从时钟设备间的链路延迟信息, 从而使主时钟设备能够确定主时钟设备 与从时钟设备之间的时间偏差, 根据该时间偏差是否小于设定的时间偏差阈值, 确定是否 发出告警信息。 由于在本发明实施例中该从时钟设备将确定的其与主时钟设备之间的链路 延迟信息返回给主时钟设备 , 从而可以使主时钟设备确定从时钟设备的对时情况, 达到监 控从时钟设备的目的, 进而保证时间同步的精度需求, 降低对时不准确造成的损失。 The embodiment of the present invention provides a method and a device for monitoring Ethernet clock synchronization. When the slave clock device returns a delay request message to the master clock device, the slave device carries the slave clock device in the delay request message. The link delay information between the master clock device and the slave clock device in the last pair of time periods, so that the master clock device can determine the time deviation between the master clock device and the slave clock device, according to whether the time deviation is less than the set time Deviation threshold to determine whether to send an alarm message. Because the link delay information between the slave clock device and the master clock device is returned to the master clock device in the embodiment of the present invention, the master clock device can determine the timing of the slave clock device to achieve monitoring. The purpose of the clock device is to ensure the accuracy of time synchronization and reduce the loss caused by inaccurate time.
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的技术手段, 而可 依照说明书的内容予以实施, 并且为了让本发明的上述和其它目的、 特征和优点能够更明 显易懂, 以下特举本发明的具体实施方式。 附图说明 图 1为本发明实施例提供的一种监控以太网时钟同步的过程示意图; The above description is only an overview of the technical solutions of the present invention, and the technical means of the present invention can be more clearly understood, and can be implemented in accordance with the contents of the specification, and the above and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic diagram of a process for monitoring Ethernet clock synchronization according to an embodiment of the present invention;
图 2A为本发明实施例一提供的当存在上一级主时钟设备的主时钟设备维护的时钟同 步监控列表; 2A is a clock synchronization monitoring list maintained by a master clock device of a higher-level master clock device according to Embodiment 1 of the present invention;
图 2B为本发明实施例二提供的当不存在上一级主时钟设备的主时钟设备维护的时钟 同步监控列表; 2B is a clock synchronization monitoring list maintained by a master clock device of a higher-level master clock device according to Embodiment 2 of the present invention;
图 3为本发明实施例提供的一种监控以太网时钟同步的详细过程示意图; 3 is a schematic diagram of a detailed process of monitoring Ethernet clock synchronization according to an embodiment of the present invention;
图 4A为本发明实施例提供的一种在以太网中进行时钟同步监控的组网结构示意图; 图 4B为本发明实施例提供的一种包含 TIN字段的延时请求报文的封装格式图; 图 5为本发明实施例提供的一种监控以太网时钟同步装置的结构示意图。 具体实施方式 为了有效的监控网络中每个从时钟设备的对时情况, 及时发现从时钟设备与主时钟设 备间的同步异常, 提高网络的可靠性, 本发明实施例提供了一种监控以太网时钟同步的方 法及装置。 4A is a schematic structural diagram of a networking for performing clock synchronization monitoring on an Ethernet according to an embodiment of the present invention; FIG. 4B is a package format diagram of a delay request packet including a TIN field according to an embodiment of the present invention; FIG. 5 is a schematic structural diagram of a device for monitoring an Ethernet clock synchronization according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In order to effectively monitor the time-to-time situation of each slave clock device in the network, and discover the synchronization abnormality between the slave clock device and the master clock device in time, and improve the reliability of the network, the embodiment of the present invention provides a method for monitoring Ethernet. Method and device for clock synchronization.
下面将参照附图更详细地描述本公开的示例性实施例。 虽然附图中显示了本公开的示 例性实施例, 然而应当理解, 可以以各种形式实现本公开而不应被这里阐述的实施例所限
制。 相反, 提供这些实施例是为了能够更透彻地理解本公开, 并且能够将本公开的范围完 整的传达给本领域的技术人员。 Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited by the embodiments set forth herein. System. Rather, these embodiments are provided so that this disclosure will be more fully understood, and the scope of the disclosure may be fully disclosed to those skilled in the art.
下面结合说明附图, 对本发明实施例进行说明。 The embodiments of the present invention will be described below with reference to the accompanying drawings.
图 1为本发明实施例提供的一种监控以太网时钟同步的过程示意图, 该过程包括以下 步骤: FIG. 1 is a schematic diagram of a process for monitoring Ethernet clock synchronization according to an embodiment of the present invention, where the process includes the following steps:
S 101: 主时钟设备向从时钟设备发送时钟同步 Sync报文。 S101: The master clock device sends a clock synchronization Sync message to the slave clock device.
主时钟设备根据 IEEE1588协议按照设定的对时周期向从时钟设备发送时钟同步 Sync 报文, 其中, 所述时钟同步 Sync报文中携带发送该时钟同步 Sync报文的时间 T1和对时 周期 SQ ID等信息。 The master clock device sends a clock synchronization Sync message to the slave clock device according to the set time interval according to the IEEE1588 protocol, where the clock synchronization Sync message carries the time T1 and the time period SQ for transmitting the clock synchronization Sync message. ID and other information.
S102: 主时钟设备接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带 从时钟设备确定的上一对时周期主时钟设备与从时钟设备间的链路延迟信息。 S102: The master clock device receives the delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device of the last pair of time periods determined by the slave clock device.
从时钟设备记录接收主时钟设备发送的该时钟同步 Sync报文的时间 T2, 并根据上一 个对时周期计算的链路延时 Delay和该时钟同步 Sync ·ί艮文中携带的时间 T1 , 计算与主时 钟设备的时间偏移量 OFFSET, 并根据该 OFFSET值修正本地时钟, 然后向主时钟设备返 回延时请求报文, 其中, 所述延时请求报文中携带从时钟设备发送该延时请求报文的时间 T3、 时钟标识信息 Clock ID和对时周期 SQ ID等信息, 并在该延时请求 4艮文的 TIN字段 中携带上一次对时周期计算的主时钟设备与从时钟设备之间的链路延迟 Delay。 The time T2 of the clock synchronization Sync message sent by the master clock device is recorded from the clock device, and the link delay Delay calculated according to the previous time period and the time T1 carried in the clock synchronization Sync message are calculated and calculated. The time offset of the master clock device is OFFSET, and the local clock is corrected according to the OFFSET value, and then the delay request message is returned to the master clock device, where the delay request message carries the delay request sent by the slave clock device. Information such as the time T3 of the packet, the clock ID information, the clock ID, and the SQ ID, and the TIN field of the delay request carries the last clock cycle between the master clock device and the slave clock device. The link delays the Delay.
另外, 为了监控每个从时钟,扩大本方案的实施范围, 当所述从时钟设备为两步钟时, 所述方法还包括: 所述主时钟设备接收所述从时钟设备发送的延时请求跟随 ·ί艮文, 其中该 延时请求跟随中携带时间戳 Τ3 , Τ3为从时钟设备发送延时请求报文的时间。 In addition, in order to monitor each slave clock, the implementation scope of the solution is expanded. When the slave clock device is a two-step clock, the method further includes: the master clock device receiving the delay request sent by the slave clock device Following the 艮 艮 text, where the delay request follows the time stamp Τ 3 , Τ 3 is the time for sending the delay request message from the clock device.
具体的, 从时钟设备为两步钟时, 从时钟设备根据接收主时钟设备发送的时钟同步 Sync报文的时间 T2和该 Sync报文中携带的时间戳 T1 , 及上一个对时周期计算的链路延 时 delay, 计算与主时钟设备的时间偏移量 OFFSET并修正本地时钟, 然后向主时钟设备 返回携带 SQ ID和 delay等信息的延时请求报文, 然后将发送该延时请求报文的时间 T3 携带到延时请求跟随报文中发送给主时钟设备。 Specifically, when the slave clock device is a two-step clock, the slave clock device calculates the time T2 of synchronizing the Sync message according to the clock sent by the master clock device, the timestamp T1 carried in the Sync message, and the previous time period. The link delay delay, calculate the time offset from the master clock device OFFSET and correct the local clock, and then return a delay request message carrying the SQ ID and delay information to the master clock device, and then send the delay request message. The time T3 of the text is carried to the delay request follow message and sent to the master clock device.
S 103: 主时钟设备根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间 的时间偏差。 S103: The master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information.
主时钟设备记录接收从时钟设备发送的该延时请求报文的时间 T4,并解析该延时请求 报文, 获取该延时请求报文携带的从时钟设备发送该延时请求报文的时间 T3 和上一次对 时周期计算的主时钟设备与该从时钟设备之间的链路延迟 Delay, 并根据上述信息确定主 时钟设备与该从时钟设备之间的时间偏差。 The master clock device records the time T4 of receiving the delay request message sent from the clock device, and parses the delay request message to obtain the time when the slave clock device carries the delay request message carried in the delay request message. T3 and the link delay Delay between the master clock device and the slave clock device calculated in the last time period, and determine the time offset between the master clock device and the slave clock device based on the above information.
在本发明中主时钟设备为了能够监控每个从时钟的对时情况, 需要确定各从时钟设备 与自身是否存在时间偏差, 所述确定主时钟设备与从时钟设备之间的时间偏差包括:
所述主时钟设备根据所述延时请求报文中携带的时间戳 T3 , 自身收到所述延时请求报 文的时间 T4及所述延时请求报文中携带的链路延迟信息, 确定主时钟设备与从时钟设备 之间的时间偏差; In the present invention, in order to be able to monitor the timing of each slave clock, it is necessary to determine whether there is a time deviation between each slave clock device and itself. The determining the time offset between the master clock device and the slave clock device includes: The master clock device determines, according to the timestamp T3 carried in the delay request message, the time T4 of the delay request message and the link delay information carried in the delay request message. Time offset between the master clock device and the slave clock device;
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定主时钟设备与从时钟设备之 间的时间偏差包括: When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, where the master clock is determined. The time offset between the device and the slave clock device includes:
所述主时钟设备根据所述延时请求报文中携带的时间戳 T3、自身收到所述延时请求报 文的时间 T4、所述链路延迟信息及所述端到端透明时钟设备的驻留时间信息,确定主时钟 设备与从时钟设备之间的时间偏差。 The master clock device according to the timestamp T3 carried in the delay request message, the time T4 when the delay request message is received by itself, the link delay information, and the end-to-end transparent clock device The dwell time information determines the time offset between the master clock device and the slave clock device.
具体的, 主时钟设备记录接收从时钟设备发送的延时请求报文的时间 Τ4,解析所述延 时请求报文, 提取报文中携带的时间戳 Τ3、 对时周期 SQ ID和该从时钟设备的 Clock ID 等信息,并获取所述延时请求报文的 TIN字段中携带的该从时钟设备上一次对时周期计算 的与主时钟设备之间的链路延迟 Delay, 根据时间偏差计算公式: OF=T4-T3 -Delay, 计算 出该从时钟设备与自身的时间偏差, 并在本地建立或更新该从时钟设备的 Clock ID、 对时 周期 SQ ID及时间偏差的映射列表。 Specifically, the master clock device records the time Τ4 of receiving the delay request message sent from the clock device, parses the delay request message, and extracts the time stamp Τ3, the time period SQ ID, and the slave clock carried in the message. The information such as the clock ID of the device, and the link delay Delay calculated by the last clock cycle of the slave clock device carried in the TIN field of the delay request message, according to the time deviation calculation formula : OF=T4-T3 -Delay, calculate the time deviation of the slave clock device from itself, and locally establish or update the mapping list of the clock ID, the time period SQ ID and the time offset of the slave clock device.
当主时钟设备和从时钟设备之间存在端到端透明时钟设备时, 从时钟设备在向主时钟 设备返回延时请求报文时,在所述延时请求报文的 TIN字段中携带该从时钟设备上一次对 时周期计算的与主时钟设备之间的链路延迟 Delay及所述延时请求报文在经过每个端到端 透明时钟设备的驻留时间信息, 主时钟设备记录接收从时钟设备发送的延时请求报文的时 间 T4, 解析所述延时请求 ·ί艮文, 提取 ·ί艮文中携带的时间戳 Τ3、 对时周期 SQ ID和该从时 钟设备的 Clock ID等信息, 并获取所述延时请求报文的 TIN字段中携带的该从时钟设备 上一次对时周期计算的与主时钟设备之间的链路延迟 Delay及所述延时请求报文经过每个 端到端透明时钟设备的驻留时间信息, 据时间偏差计算公式: OF=T4-T3-Delay-驻留时间, 计算出该从时钟设备与自身的时间偏差, 并在本地建立或更新该从时钟设备的 Clock ID、 对时周期 SQ ID及时间偏差的映射列表。 When there is an end-to-end transparent clock device between the master clock device and the slave clock device, when the slave clock device returns a delay request message to the master clock device, the slave device carries the slave clock in the TIN field of the delay request message. The link delay Delay between the master clock device calculated by the device last time period and the dwell time information of the delay request message passing through each end-to-end transparent clock device, and the master clock device records the receive slave clock The time T4 of the delay request message sent by the device, parsing the delay request, extracting the time stamp Τ3 carried in the text, the SQ ID of the time period, and the clock ID of the slave clock device, Obtaining, in the TIN field of the delay request message, the link delay Delay between the primary clock device calculated by the slave clock device and the delay request message passing through each end The dwell time information of the transparent clock device, according to the time deviation calculation formula: OF=T4-T3-Delay-residence time, calculate the time deviation of the slave clock device and itself, and establish locally Or update the mapping list of the clock ID, the time period SQ ID, and the time offset of the slave clock device.
S104: 主时钟设备判断该时间偏差是否小于设定的时间偏差阈值。 S104: The master clock device determines whether the time deviation is less than a set time deviation threshold.
为了保证能够准确的监控从时钟设备在与主时钟设备进行时间同步的过程中是否出 现错误, 且当产生较大偏差时能够及时的发现对时异常, 每一级主时钟设备都预先设置了 时间偏差阈值, 其中, 每一级主时钟设备可以设置相同的时间偏差阈值, 也可以为每个主 时钟设备分别设置不同的时间偏差阈值。 In order to ensure accurate monitoring of whether the slave clock device has an error during the time synchronization with the master clock device, and when a large deviation occurs, the time-of-day exception can be detected in time, and each level of the master clock device is preset with time. Deviation threshold, wherein each primary clock device can set the same time deviation threshold, and different time deviation thresholds can be set for each primary clock device.
S 105: 当主时钟设备确定该时间偏差不小于设定的时间偏差阈值时, 发出时钟同步异 常告警信号。 S105: When the master clock device determines that the time deviation is not less than the set time deviation threshold, a clock synchronization abnormality alarm signal is issued.
主时钟设备在计算出每个从时钟设备与自身的时间偏差后, 根据自身保存的时间偏差
阈值, 判断所述计算的时间偏差是否小于该时间偏差阈值, 当确定该时间偏差不小于设定 的时间偏差阈值时, 主时钟设备确定该从时钟设备与自身的时间同步异常, 并发出时钟同 步异常告警信号。 其中, 该时钟同步异常告警信号中携带该从时钟设备的 Clock ID、 对时 周期 SQ ID及确定的该时间偏差等信息。 After calculating the time deviation between each slave clock device and itself, the master clock device according to its own time offset The threshold value is used to determine whether the calculated time deviation is less than the time deviation threshold. When it is determined that the time deviation is not less than the set time deviation threshold, the master clock device determines that the slave clock device is in time synchronization with itself and issues a clock synchronization. Abnormal alarm signal. The clock synchronization abnormality alarm signal carries information such as a clock ID, a time period SQ ID, and the determined time offset of the slave clock device.
由于在本发明实施例中从时钟设备在与主时钟设备进行时钟同步时, 将确定的其与主 时钟设备之间上一对时周期的链路延迟信息返回给主时钟设备 , 使得主时钟设备根据该链 路延迟信息及携带该链路延时信息报文的发送及接收时间计算该从时钟设备与自身的时 间偏差, 从而确定从时钟设备的对时情况, 达到监控从时钟设备的目的, 进而保证了时间 同步的精度需求, 降低了对时不准确造成的损失。 In the embodiment of the present invention, when the slave clock device performs clock synchronization with the master clock device, the determined link delay information between the master clock device and the master clock device is returned to the master clock device, so that the master clock device Calculating the time deviation between the slave clock device and itself according to the link delay information and the sending and receiving time of the packet carrying the link delay information message, thereby determining the timing of the slave clock device and achieving the purpose of monitoring the slave clock device. In turn, the accuracy requirement of time synchronization is ensured, and the loss caused by inaccurate time is reduced.
在本发明实施例中为了准确的监控所有从时钟设备的对时情况, 每一级主时钟设备需 要监控自身的各级从时钟设备, 当主时钟设备确定自身存在上一级主时钟设备时, 该主时 钟设备作为上一级主时钟设备的从时钟设备返回的延时请求报文还包括: In the embodiment of the present invention, in order to accurately monitor the timing of all the slave clock devices, each primary clock device needs to monitor its own slave clock devices. When the master clock device determines that it has the upper-level master clock device, The delay request message returned by the master clock device as the slave clock device of the upper-level master clock device further includes:
当所述主时钟设备判断自身存在上一级主时钟设备时, 所述主时钟设备作为上一级主 时钟设备的从时钟设备, 向所述上一级主时钟设备返回延时请求报文, 其中所述延时请求 报文中携带该作为从时钟设备的主时钟设备确定的上一对时周期与上一级主时钟设备间 的链路延迟信息、 及确定的归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备的 时钟标识信息以及确定每个时间偏差的对时周期信息。 When the master clock device determines that the upper-level master clock device exists, the master clock device serves as a slave clock device of the upper-level master clock device, and returns a delay request message to the upper-level master clock device. The delay request message carries the link delay information between the last pair of time periods determined by the master clock device of the slave clock device and the upper-level master clock device, and each determined slave belongs to itself. Time offset of the clock device, clock identification information for each slave clock device, and timing information for determining each time offset.
具体的, 当每一级主时钟设备根据接收从时钟设备返回的延时请求报文的时间 T4及 该延时请求报文中携带的时间戳 T3 和该从时钟设备上一对时周期计算的与主时钟设备之 间的链路延迟 Delay, 计算出该从时钟设备与自身的时间偏差后, 更新本地保存的该从时 钟设备的 Clock ID、 对时周期 SQ ID及时间偏差的映射列表, 该级主时钟设备判断自身是 否存在上一级主时钟设备, 当确定自身存在上一级主时钟设备时, 该级主时钟设备在向上 一级主时钟设备返回延时请求报文时, 除了携带自身作为上一级主时钟设备的从时钟设备 发送该延时请求报文的时间 T3、 自身的 SQ ID和 Clock ID及自身与该上一级主时钟的链 路延时 delay等信息之外, 还需要将自身保存上一对时周期的各级从时钟设备与自身的时 间偏差,以及该时间偏差对应的各从时钟设备的 SQ ID和 Clock ID等信息携带到该延时请 求报文中, 当该主时钟设备的上一级主时钟设备接收到该延时请求报文时, 该上一级主时 钟设备根据时间偏差计算公式: OF=T4-T3 -Delay, 确定该主时钟设备的时间偏差, 并根据 确定的该主时钟设备的时间偏差及该延时请求报文中携带该主时钟设备的从时钟设备的 时间偏差, 确定该主时钟设备的各从时钟设备与该上一级主时钟设备的时间偏差。 Specifically, when each level of the master clock device is based on the time T4 of receiving the delay request message returned from the clock device, the timestamp T3 carried in the delay request message, and a pair of time periods on the slave clock device. a link delay delay between the slave clock device and the master clock device, and after calculating the time offset of the slave clock device, updating a locally stored mapping list of the clock ID, the time period SQ ID, and the time offset of the slave clock device, where The master clock device determines whether it has the upper-level master clock device. When it is determined that the upper-level master clock device exists, the master clock device returns the delay request message to the upper-level master clock device. As the time T3 of transmitting the delay request message, the SQ ID and the clock ID of the slave clock device of the upper-level master clock device, and the link delay delay of the master clock with the upper-level master clock, It is necessary to save itself for the time offset of each slave clock device and its own time period, and the SQ ID and Clock I of each slave clock device corresponding to the time offset. The information such as D is carried in the delay request message. When the upper-level master clock device of the master clock device receives the delay request message, the upper-level master clock device calculates the formula according to the time deviation: OF= Determining the time deviation of the master clock device, and determining the master according to the determined time deviation of the master clock device and the time deviation of the slave clock device carrying the master clock device in the delay request message The time deviation between each slave clock device of the clock device and the upper master clock device.
另外, 为了准确的监控所有从时钟设备在每个对时周期的对时情况, 需要不存在上一 级主时钟设备的主时钟设备保存所有从时钟设备在每个对时周期的时间偏差, 同时, 存在 上一级主时钟设备的主时钟设备只需保存上一对时钟周期自身各从时钟设备与自身的时
间偏差, 从而达到节省该存在上一级主时钟设备的主时钟设备存储空间的目的, 所述方法 还包括: In addition, in order to accurately monitor the timing of all slave clock devices in each pair of time periods, the master clock device that does not have the upper level master clock device needs to save the time offset of all slave clock devices in each pair of time periods, The master clock device with the upper-level master clock device only needs to save the time of each slave clock device and itself for the previous pair of clock cycles. For the purpose of saving the storage space of the master clock device of the upper-level master clock device, the method further includes:
当所述主时钟设备不存在上一级主时钟设备时, 所述主时钟设备针对组网中的每个从 时钟设备的时钟标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中 该时间偏差根据该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。 When the master clock device does not have the upper-level master clock device, the master clock device records the clock identification information of each slave clock device in the networking, and records each slave clock device in each pair of time periods and itself. Time offset, wherein the time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
具体的, 在本发明中不存在上一级主时钟设备的主时钟设备需要监控全网所有从时钟 设备的对时情况, 该不存在上一级主时钟设备的主时钟设备在本地建立时钟同步监控列 表, 该时钟同步监控列表中保存其每个从时钟设备的时间偏差, 其中, 该时钟同步监控列 表中包含该每个从时钟设备的时钟标识信息 Clock ID、 每个对时周期 SQ ID对应的与自身 的时间偏差, 通过该时钟同步监控列表管理员或维护人员能够直观的确定每个从时钟设备 与该不存在上一级主时钟设备的主时钟设备的对时跑偏趋势, 便于发现从时钟设备的对时 异常并及时处理, 解决了由于从时钟设备与主时钟设备之间的时间偏差逐步加大, 最终导 致更严重后果的问题, 提高了网络的可靠性, 减少了不必要的损失。 Specifically, in the present invention, the master clock device of the upper-level master clock device does not need to monitor the timing of all the slave clock devices in the entire network, and the master clock device that does not exist in the upper-level master clock device establishes clock synchronization locally. a watch list, where the time synchronization deviation of each of the slave clock devices is saved in the clock synchronization monitoring list, where the clock synchronization monitoring list includes clock ID information of each of the slave clock devices, and a corresponding time period SQ ID. The time deviation from itself, through the clock synchronization monitoring list administrator or maintenance personnel can intuitively determine the timing deviation trend of each slave clock device and the master clock device without the upper-level master clock device, which is convenient for discovery The timing error of the slave clock device is processed in time, which solves the problem that the time deviation between the clock device and the master clock device is gradually increased, which ultimately leads to more serious consequences, improves the reliability of the network, and reduces unnecessary loss.
为了便于主时钟设备向其上一级主时钟设备发送其从时钟设备的时间偏差, 最终实 现不存在上一级主时钟设备的主时钟设备对所有从时钟设备的对时情况进行监控, 在本发 明实施例中不同主时钟设备可以釆用不同的方式来维护自身保存的时钟同步监控列表。 如 图 2A所示的当存在上一级主时钟设备的主时钟设备维护的时钟同步监控列表, 该主时钟 设备根据其每个从时钟设备返回的延时请求报文中携带的信息, 确定其每个从时钟设备的 时间偏差 OF , 并根据该时间偏差 OF及该时间偏差对应的该从时钟设备的标识信息 Clock ID和对时周期 SQ ID建立映射列表, 其中, 为了节省该主时钟的存储资源, 该主时钟设备 只需保存上一对时周期计算的各从时钟设备的时间偏差; 图 2B为当不存在上一级主时钟 设备维护的时钟同步监控列表, 如图所示, 与存在上一级主时钟设备的主时钟设备相比, 该不存在上一级主时钟设备的主时钟设备需要保存每个从时钟设备在每个对时周期与自 身的时间偏差, 从而从整体上监控每个从时钟设备的对时情况。 In order to facilitate the time delay of the master clock device to send its slave clock device to its upper-level master clock device, the master clock device that does not exist in the upper-level master clock device monitors the timing of all slave clock devices. In different embodiments of the invention, different master clock devices can maintain their own saved clock synchronization monitoring list in different ways. As shown in FIG. 2A, when there is a clock synchronization monitoring list maintained by the master clock device of the upper-level master clock device, the master clock device determines the information according to the information carried in the delay request message returned by each of the slave clock devices. a time offset OF of each slave clock device, and a mapping list is established according to the time offset OF and the identification information Clock ID and the time period SQ ID of the slave clock device corresponding to the time offset, wherein, in order to save the storage of the master clock Resources, the master clock device only needs to save the time deviation of each slave clock device calculated in a pair of time periods; FIG. 2B is a clock synchronization monitoring list maintained when the upper-level master clock device does not exist, as shown in the figure, and exists Compared with the master clock device of the upper-level master clock device, the master clock device that does not exist in the upper-level master clock device needs to save the time offset of each slave clock device with each time period, thereby monitoring the whole The timing of each slave clock device.
图 3为本发明实施例提供的一种监控以太网时钟同步的详细过程示意图, 该过程包括 以下步骤: FIG. 3 is a schematic diagram of a detailed process of monitoring Ethernet clock synchronization according to an embodiment of the present invention, where the process includes the following steps:
S301 : 主时钟设备向从时钟设备发送时钟同步 Sync报文。 S301: The master clock device sends a clock synchronization Sync message to the slave clock device.
S302: 主时钟设备接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带 从时钟设备确定的上一对时周期主时钟设备与从时钟设备间的链路延迟信息。 S302: The master clock device receives the delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device of the last pair of time periods determined by the slave clock device.
S303: 主时钟设备根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间 的时间偏差。 S303: The master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information.
S304:主时钟设备判断该时间偏差是否小于设定的时间偏差阈值, 当判定结果为是时, 进行步骤 S306, 否则, 进行步骤 S305
S305: 当主时钟设备确定该时间偏差不小于设定的时间偏差阈值时, 发出时钟同步异 常告警信号。 S304: The master clock device determines whether the time deviation is less than a set time deviation threshold. If the determination result is yes, proceed to step S306; otherwise, proceed to step S305. S305: When the master clock device determines that the time deviation is not less than a set time deviation threshold, a clock synchronization abnormality alarm signal is issued.
S306: 主时钟设备根据该从时钟设备的 Clock ID、 对时周期 SQ ID及所述时间偏差, 更新自身的时钟同步监控列表。 S306: The master clock device updates its own clock synchronization monitoring list according to the clock ID of the slave clock device, the time period SQ ID, and the time offset.
S307: 主时钟设备判断自身是否存在上一级主时钟设备, 当判定结果为是时, 进行步 骤 S308 , 否则, 进行步骤 S309。 S307: The master clock device determines whether there is a higher-level master clock device. If the determination result is YES, then step S308 is performed; otherwise, step S309 is performed.
S308: 主时钟设备向上一级主时钟设备返回延时请求报文, 其中所述延时请求报文中 携带该主时钟设备确定的上一对时周期与上一级主时钟设备间的链路延迟信息、 及确定的 归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备的时钟标识信息以及确定每个 时间偏差的对时周期信息。 S308: The master clock device returns a delay request message to the upper-level master clock device, where the delay request message carries the link between the last pair of time periods determined by the master clock device and the upper-level master clock device. The delay information, and the determined time offset of each slave clock device belonging to itself, the clock identification information of each slave clock device, and the time period information determining each time offset.
S309: 主时钟设备针对组网中的每个从时钟设备的时钟标识信息, 记录每个从时钟设 备在每个对时周期与自身的时间偏差, 其中该时间偏差根据该从时钟设备与每一级主时钟 设备之间的时间偏差的和确定。 S309: The master clock device records, for the clock identification information of each slave clock device in the networking, a time offset of each slave clock device with each time period, wherein the time offset is according to the slave clock device and each The sum of the time offsets between the primary clock devices.
由于在本发明实施例中从时钟设备在与其主时钟设备进行时钟同步时, 将确定的与主 时钟设备之间上一对时周期的链路延迟信息及所属的每个从时钟设备与自身的时间偏差 返回给主时钟设备, 使得其主时钟设备更新自身时钟同步监控列表, 并通过延时请求报文 将其所属的每个从时钟设备的时间偏差上报给上一级主时钟设备, 从而实现了不存在上一 级主时钟设备的主时钟设备对所有从时钟设备对时情况的监控, 进而保证了时间同步的精 度需求, 降低了对时不准确造成的损失。 In the embodiment of the present invention, when the slave clock device performs clock synchronization with the master clock device, the link delay information between the determined master clock device and the master clock device and the associated slave clock device and its own The time offset is returned to the master clock device, so that the master clock device updates its own clock synchronization monitoring list, and reports the time offset of each slave clock device to which it belongs to the upper-level master clock device through the delay request message. The master clock device of the upper-level master clock device does not monitor the timing of all slave clock devices, thereby ensuring the accuracy requirement of time synchronization and reducing the loss caused by inaccurate timing.
下面结合一个具体的实施例进行说明。 The following description will be made in conjunction with a specific embodiment.
图 4A为本发明实施例提供的一种在以太网中进行时钟同步监控的组网结构示意图, 如图所示, M为不存在上一级主时钟设备的主时钟设备, 交换设备 S1-S8为 M的从时钟 设备, 且均为边界时钟 (Boundary Clock, BC), SI为 S3的上一级主时钟设备, 同理, S2 为 S4~S6的上一级主时钟设备, S4为 S7和 S8的上一级主时钟设备, S2的从时钟设备包 含 S4~S8 , 其中, 从时钟设备 S1-S8与主时钟设备 M的同步周期一致。 FIG. 4A is a schematic diagram of a network structure for performing clock synchronization monitoring on an Ethernet according to an embodiment of the present invention. As shown in the figure, M is a master clock device having no upper-level master clock device, and switching devices S1-S8 For the slave clock devices of M, both are Boundary Clocks (BC), and SI is the upper-level master clock device of S3. Similarly, S2 is the upper-level master clock device of S4~S6, and S4 is S7 and The upper-level master clock device of S8, the slave clock device of S2 includes S4~S8, wherein the synchronization period of the slave clock devices S1-S8 and the master clock device M is the same.
主时钟设备在第一个对时周期对从时钟设备进行时钟同步时, M根据 IEEE1588协议 向 S1和 S2发送 Sync 4艮文, 其中, 该 Sync 4艮文中携带该 4艮文的发送时间 tl , S1记录接收 到该 Sync报文的时间 t2 , 并向 M返回延时请求报文, 该延时请求报文中携带发送该延时 请求报文的时间 t3 , M记录接收到该延时请求报文的时间 t4, 并将 t4携带到 Delay_resp 报文中发送给 SI , S1根据 tl , t2, t3 , t4四个时间戳计算出自身与 M的平均链路延时 delayMl ,同理 S2确定与 M的平均链路延时 delayM2, S3确定与 S1的平均链路延时 delayl3 , 依次类推每个从时钟设备计算出与上一级主时钟设备的平均链路延时 delay。 When the master clock device performs clock synchronization on the slave clock device in the first timing cycle, M sends a Sync message to S1 and S2 according to the IEEE1588 protocol, where the Sync 4 message carries the transmission time t1 of the message. S1 records the time t2 when the Sync message is received, and returns a delay request message to the M. The delay request message carries the time t3 at which the delay request message is sent, and the M record receives the delay request message. The time t4 of the text, and t4 is carried into the Delay_resp message and sent to the SI, and the S1 calculates the average link delay delayMl of itself and M according to the four timestamps tl, t2, t3, t4, and the same S2 determines and M The average link delay delayM2, S3 determines the average link delay delayl3 with S1, and so on, and analogously, the average link delay delay calculated by each slave clock device with the upper-level master clock device.
主时钟设备 M在第二个对时周期对从时钟进行时钟同步时,从时钟设备 S1 ,根据 Sync
报文中的时间戳 tl和第一个对时周期计算的链路延时 delayMl , 计算与主时钟设备的时间 偏移量 OFFSET并对本地时钟进行调整, 然后向 M返回延时请求 4艮文, 并在该延时请求 报文的末尾增加一个 TIN字段, 并将该延时请求报文离开从时钟设备的时间戳 t3打在该 •ί艮文的 origintimestamp字段上,其中,该 TIN字段的 Type设置为 DELAY,长度为 8字节, 值为上一对时周期计算的链路延时 delayMl。 When the master clock device M clocks the slave clock in the second timing cycle, the slave clock device S1, according to Sync The timestamp tl in the message and the link delay delayMl calculated in the first pair of time periods, calculate the time offset from the master clock device OFFSET and adjust the local clock, and then return the delay request to M. And adding a TIN field at the end of the delay request message, and the delay request message is sent from the timestamp t3 of the clock device to the origintimestamp field of the • 艮 ,, where the TIN field Type is set to DELAY, the length is 8 bytes, and the value is the link delay delayMl calculated in the previous pair of time periods.
M记录接收该延时请求 ·ί艮文的时间 t4, 并解析该延时请求 4艮文获取 t3和 delayMl , 根 据时间偏差计算公式 OF= t4-t3-delayMl , 确定从时钟设备 SI的时间偏差 OFM1 , Μ判断 确定的 SI 与自身的时间偏差 OFM1 是否小于设定的时间偏差阈值, 当确定该时间偏差 OFM1不小于设定的时间偏差阈值时, M将发出时钟同步异常告警报文, 其中, 该时钟同 步异常告警报文中包含 S1的 Clock ID、 本次对时周期 SQ ID和时间偏差 OFM1等信息。 M records the time t4 of receiving the delay request············································ If the time difference OFM1 is less than the set time deviation threshold, the M will issue a clock synchronization abnormality alarm message, where The clock synchronization abnormality alarm message includes information such as the clock ID of the S1, the current SQ ID, and the time offset OFM1.
M根据确定的从时钟设备 S1 的时间偏差 OFM1 及该延时请求报文中携带的 S1 的 Clock ID和本次对时周期 SQ ID, 更新本地保存的时钟同步监控列表, 同理, 在第二次对 时周期内, M的时钟同步监控列表中也保存有 S2的时间偏差 OFM2, S1的时钟同步监控 列表中保存有 S3的时间偏差 OF13 , S2的时钟同步监控列表中保存有 S4 S6的时间偏差 OF24、 OF25 和 OF26, S4的时钟同步监控列表中保存有 S7和 S8的时间偏差 OF47 和 OF48。 The M updates the locally saved clock synchronization monitoring list according to the determined time deviation OFM1 of the slave clock device S1 and the clock ID of the S1 carried in the delay request message and the current time period SQ ID. Similarly, in the second During the next-time period, the time synchronization OFM2 of S2 is also stored in the clock synchronization monitoring list of M. The time synchronization OF13 of S3 is stored in the clock synchronization monitoring list of S1, and the time of S4 S6 is saved in the clock synchronization monitoring list of S2. The time deviations OF47 and OF48 of S7 and S8 are stored in the clock synchronization monitoring list of the deviations OF24, OF25 and OF26, S4.
主时钟设备 M在第三个对时周期对从时钟进行时钟同步时,从时钟设备 S1, 根据 Sync 报文中的时间戳 tl和第二个对时周期计算的链路延时 delayMl , 计算时间偏移量 OFFSET 对本地时钟进行调整, 向 M 返回延时请求报文中除了携带第二对时周期的链路延时 delayMl和发送该延时请求报文的时间 t3之外,还在该延时请求报文末尾增加新的 TIN字 段, 在该 TIN字段中携 S3在第二个对时周期的时间偏差 OF13、 S3的 Clock ID和第二个 对时周期 SQ ID, 其中, 在该新增加的 TIN字段中, Type可以设置为 SLAVE, 长度为 24 字节, Value内容部分可以用 8字节存放 S3的 Clock ID, 8字节存放 S3与 S1第二个对时 周期的时间偏差 OF13 , 8字节存放第二个对时周期 SQID。 When the master clock device M clocks the slave clock in the third timing cycle, the slave clock device S1 calculates the time according to the timestamp t1 in the Sync message and the link delay delayMl calculated in the second pair of time periods. The offset OFFSET adjusts the local clock, and returns the delay request message to the M. In addition to the link delay delayM1 of the second pair of time periods and the time t3 of sending the delay request message, the delay is still Adding a new TIN field at the end of the request message, carrying the time offset of the S3 in the second pair of time periods, the clock ID of the S3, the clock ID of the S3, and the second time period SQ ID, where the new increase is made in the TIN field. In the TIN field, Type can be set to SLAVE, the length is 24 bytes, the Value content part can store the Block ID of S3 with 8 bytes, and the 8 bytes store the time deviation of the second timing period of S3 and S1 OF13, 8 The byte holds the second time period SQID.
M记录接收该延时请求 ·ί艮文的时间 t4,解析该延时请求 4艮文获取 t3和第二个对时周期 的 delayMl , 计算第三个对时周期 SI的时间偏差 OFM1 , 并根据该延时请求报文中携带的 S3的第二个对时周期与 S1的时间偏差 OF13及自身时钟同步监控列表中保存的第二个对 时周期 S1的时间偏差 OFM1 , 通过公式 OFM3= OFM1+ OF13 , 确定 S3在第二个对时周 期与自身的时间偏差 OFM3 , 并判断确定的第三个对时周期 S1的时间偏差 OFM1或第二 个对时周期 S3的时间偏差 OFM3是否小于设定的时间偏差阈值, 当确定上述时间偏差任 意一个不小于设定的时间偏差阈值时, M将发出时钟同步异常告警报文。 M records the time t4 of receiving the delay request, extracts the delay request, obtains the delay M1 of the second time period, calculates the time deviation OFM1 of the third time period SI, and according to The time offset OFM of the second time interval S3 of the S3 carried in the delay request message and the time offset OF13 of the S1 and the second time period S1 saved in the self clock synchronization monitoring list, by the formula OFM3=OFM1+ OF13 Determining whether S3 is within the second time period of time and its own time deviation OFM3, and determining whether the time deviation OFM1 of the determined third timing period S1 or the time deviation OFM3 of the second timing period S3 is less than the set time. Deviation threshold, when it is determined that any one of the above time deviations is not less than the set time deviation threshold, M will issue a clock synchronization abnormality alarm message.
M根据确定的第三个对时周期从时钟设备 S1的时间偏差 OFM1 , 在自身的时钟同步 监控列表中增加 S 1第三个对时周期的时间偏差, 并根据确定的 S3在第二个对时周期的时
间偏差 OFM3及该延时请求报文中携带的 S3的 Clock ID , 在时钟同步监控列表中保存 S3 的时钟标识信息、 对时周期和时间偏差值的映射关系。 同理, M通过 S2返回的延时请求 报文, 可以在本地的时钟同步监控列表中保存从时钟设备 S4 S8的时间偏差, 从而实现了 对所有从时钟设备的对时情况的监控。 M increases the time offset of the third timing period of S 1 in its own clock synchronization monitoring list according to the determined time offset OFM1 of the clock device S1 according to the determined third timing period, and according to the determined S3 in the second pair Time period The inter-vehicle OFM3 and the clock ID of the S3 carried in the delay request message store the mapping relationship between the clock identification information, the time period and the time offset value of the S3 in the clock synchronization monitoring list. Similarly, M can save the time offset of the slave clock device S4 S8 in the local clock synchronization monitoring list through the delay request message returned by S2, thereby realizing the monitoring of the timing of all the slave clock devices.
当网络中的从时钟设备出现异常时, 如: 从时钟设备 S4 由于硬件故障或者网络异常 而导致与 S2对时不准确, 其与上一级主时钟 S2的时间偏差较大, 但未超过 S2设定的时 间偏差阈值, 且经过 S2的时间偏差加成后仍未超过主时钟 M的时间偏差阈值, 此时其上 一级主时钟 S2和主时钟设备 M均未发出时钟同步异常信号,管理员将无法及时发现问题, 但是, S4的从时钟设备 S7和 S8在与 S4进行同步时也存在时间偏差, 当主时钟设备 M判 定 S7或 S8的时间偏差值超过设定的阈值时也将触发 ·ί艮警, 管理员根据 Μ保存的时钟同 步监控列表能准确的发现, 虽然是由于 S7和 S8时间偏差超限触发的报警, 但是真正出现 异常的设备为 S4 , 从而能及时准确的定位故障设备。 When an abnormality occurs in the slave clock device in the network, for example, the clock device S4 is inaccurate with the S2 due to a hardware failure or a network abnormality, and the time deviation from the previous master clock S2 is large, but does not exceed S2. The time deviation threshold is set, and the time deviation threshold of the main clock M is not exceeded after the time deviation of S2 is added. At this time, the clock synchronization abnormality signal is not issued by the previous main clock S2 and the main clock device M. The member will not be able to find the problem in time. However, the slave clock devices S7 and S8 of S4 also have a time deviation when synchronizing with S4. When the master clock device M determines that the time offset value of S7 or S8 exceeds the set threshold, it will also trigger.艮 艮 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , .
图 4Β为本发明实施例提供的一种包含 TIN字段的延时请求报文的封装格式图, 如图 所示, 以一步钟为例, 常规的延时请求报文的 DATA中携带从时钟设备的 Clock ID、 SQ ID 和源时间戳 t3 , 在发明中为了实现不存在上一级主时钟设备的主时钟能够监控所有从时钟 设备与自身的时钟同步情况, 在延时请求报文的尾部增加了 TIN字段, 在该 TIN字段中, Value部分用于携带上一对时周期该从时钟设备与主时钟设备的链路延时, 当该从时钟设 备还存在下一级从时钟设备时, 在上述 TIN字段后增加新的 TLV1 字段, 并在新的 TIN 字段的 Value部分携带该下一级从时钟设备的 Clock ID、 SQ ID和上一对时周期计算的该 下一级从时钟设备的时间偏差, 其中,新增加的 TIN字段的长度由该从时钟设备包含的该 下一级从时钟设备的数量决定。 FIG. 4 is a package format diagram of a delay request packet including a TIN field according to an embodiment of the present invention. As shown in the figure, taking a one-clock clock as an example, a conventional delay request message carries a slave clock device in a DATA. Clock ID, SQ ID, and source timestamp t3. In the invention, in order to realize that the master clock of the upper-level master clock device cannot monitor the synchronization of all slave clock devices with their own clocks, the end of the delay request message is added. The TIN field, in which the Value part is used to carry the link delay of the slave clock device and the master clock device in the last pair of time periods, when the slave clock device still has the next-level slave clock device, The new TLV1 field is added after the TIN field, and the value of the next-level slave clock device calculated by the Clock ID, the SQ ID of the next-level slave clock device, and the last-stage time period is carried in the Value portion of the new TIN field. Deviation, wherein the length of the newly added TIN field is determined by the number of slave clock devices of the next level included in the slave clock device.
图 5为本发明实施例提供的一种监控以太网时钟同步装置的结构示意图,该装置包括: 发送模块 51 , 用于向从时钟设备发送时钟同步 Sync报文; FIG. 5 is a schematic structural diagram of a device for monitoring an Ethernet clock synchronization according to an embodiment of the present invention. The device includes: a sending module 51, configured to send a clock synchronization Sync message to a slave clock device;
接收模块 52 , 用于接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带 从时钟设备确定的上一对时周期主时钟设备与从时钟设备间的链路延迟信息; The receiving module 52 is configured to receive a delay request message returned from the clock device, where the delay request message carries the link delay information between the master clock device and the slave clock device determined by the clock device. ;
确定模块 53 , 用于根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间 的时间偏差; a determining module 53 , configured to determine a time offset between the master clock device and the slave clock device according to the received link delay information;
判断模块 54 , 用于判断该时间偏差是否小于设定的时间偏差阈值; The determining module 54 is configured to determine whether the time deviation is less than a set time deviation threshold;
告警模块 55 , 用于当判断模块确定该时间偏差不小于设定的时间偏差阈值时, 发出时 钟同步异常告警信号。 The alarm module 55 is configured to send a clock synchronization abnormality alarm signal when the determining module determines that the time deviation is not less than a set time deviation threshold.
所述接收模块 52 , 还用于当所述从时钟设备为两步钟时, 接收所述从时钟设备发送的 延时请求跟随报文, 其中该延时请求跟随中携带时间戳 T3 , T3为从时钟设备发送延时请 求 4艮文的时间。
所述确定模块 53 , 具体用于根据所述延时请求报文中携带的时间戳 Τ3 , 自身收到所 述延时请求报文的时间 Τ4及所述延时请求报文中携带的链路延迟信息, 确定主时钟设备 与从时钟设备之间的时间偏差。 The receiving module 52 is further configured to: when the slave clock device is a two-step clock, receive a delay request follow message sent by the slave clock device, where the delay request follows a time stamp T3, and T3 is The time from when the clock device sends a delay request. The determining module 53 is configured to: according to the timestamp Τ3 carried in the delay request message, the time Τ4 of the delay request message and the link carried in the delay request message Delay information to determine the time offset between the master clock device and the slave clock device.
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定模块 53 , 具体还用于根据所 述延时请求报文中携带的时间戳 Τ3、 自身收到所述延时请求报文的时间 Τ4、 所述链路延 迟信息及所述端到端透明时钟设备的驻留时间信息, 确定主时钟设备与从时钟设备之间的 时间偏差。 When the end-to-end transparent clock device exists between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, and the determining module 53 Specifically, the method is further configured to: timestamp Τ3 carried in the delay request message, time 自身4 of receiving the delay request message by itself, the link delay information, and the end-to-end transparent clock device The dwell time information determines the time offset between the master clock device and the slave clock device.
所述发送模块 51 , 还用于当判断自身存在上一级主时钟设备时, 向所述上一级主时钟 设备返回延时请求报文, 其中所述延时请求报文中携带该作为从时钟设备的主时钟设备确 定的上一对时周期与上一级主时钟设备间的链路延迟信息、 及确定的归属于自身的每个从 时钟设备的时间偏差, 每个从时钟设备的时钟标识信息以及确定每个时间偏差的对时周期 信息。 The sending module 51 is further configured to: when it is determined that the upper-level master clock device exists, return a delay request message to the upper-level master clock device, where the delay request packet carries the slave request The link delay information between the last pair of time periods determined by the master clock device of the clock device and the master clock device of the upper level, and the determined time deviation of each slave clock device belonging to itself, the clock of each slave clock device Identification information and timing information for determining each time offset.
所述装置还包括: The device also includes:
存储模块 56, 用于当不存在上一级主时钟设备时, 针对组网中的每个从时钟设备的时 钟标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中该时间偏差根 据该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。 The storage module 56 is configured to record, for the clock identification information of each slave clock device in the networking, when the upper-level master clock device does not exist, record the time deviation of each slave clock device from itself in each pair of time periods, The time offset is determined based on a sum of time deviations between the slave clock device and each stage master clock device.
本发明实施例提供了一种监控以太网时钟同步的方法及装置, 该方法中从时钟设备在 向主时钟设备返回延时请求报文时, 在该延时请求报文中携带从时钟设备确定的上一对时 周期主时钟设备与从时钟设备间的链路延迟信息, 从而使主时钟设备能够确定主时钟设备 与从时钟设备之间的时间偏差, 根据该时间偏差是否小于设定的时间偏差阈值, 确定是否 发出告警信息。 由于在本发明实施例中该从时钟设备将确定的其与主时钟设备之间的链路 延迟信息返回给主时钟设备 , 从而可以使主时钟设备确定从时钟设备的对时情况, 达到监 控从时钟设备的目的, 进而保证时间同步的精度需求, 降低对时不准确造成的损失。 The embodiment of the present invention provides a method and a device for monitoring Ethernet clock synchronization. When the slave clock device returns a delay request message to the master clock device, the slave device carries the slave clock device in the delay request message. The link delay information between the master clock device and the slave clock device in the last pair of time periods, so that the master clock device can determine the time deviation between the master clock device and the slave clock device, according to whether the time deviation is less than the set time Deviation threshold to determine whether to send an alarm message. Because the link delay information between the slave clock device and the master clock device is returned to the master clock device in the embodiment of the present invention, the master clock device can determine the timing of the slave clock device to achieve monitoring. The purpose of the clock device is to ensure the accuracy of time synchronization and reduce the loss caused by inaccurate time.
在此提供的算法和显示不与任何特定计算机、 虚拟系统或者其它设备固有相关。 各种 通用系统也可以与基于在此的示教一起使用。 根据上面的描述, 构造这类系统所要求的结 构是显而易见的。 此外, 本发明也不针对任何特定编程语言。 应当明白, 可以利用各种编 程语言实现在此描述的本发明的内容, 并且上面对特定语言所做的描述是为了披露本发明 的最佳实施方式。 The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems can also be used with the teaching based on the teachings herein. From the above description, the structure required to construct such a system is obvious. Moreover, the invention is not directed to any particular programming language. It is to be understood that the description of the present invention may be embodied in a variety of programming language, and the description of the specific language is set forth herein.
在此处所提供的说明书中, 说明了大量具体细节。 然而, 能够理解, 本发明的实施例 可以在没有这些具体细节的情况下实践。 在一些实例中, 并未详细示出公知的方法、 结构 和技术, 以便不模糊对本说明书的理解。 Numerous specific details are set forth in the description provided herein. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the description.
类似地, 应当理解, 为了精筒本公开并帮助理解各个发明方面中的一个或多个, 在上
面对本发明的示例性实施例的描述中, 本发明的各个特征有时被一起分组到单个实施例、 图、 或者对其的描述中。 然而, 并不应将该公开的方法解释成反映如下意图: 即所要求保 护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。 更确切地说, 如下面 的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。 因此, 遵循具体实施方式的权利要求书由此明确地并入该具体实施方式, 其中每个权利要求本身 都作为本发明的单独实施例。 Similarly, it should be understood that in order to refine the disclosure and to assist in understanding one or more of the various inventive aspects, In the description of the exemplary embodiments of the present invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the specific embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解, 可以对实施例中的设备中的模块进行自适应性地改变 并且把它们设置在与该实施例不同的一个或多个设备中。 可以把实施例中的模块或单元或 组件组合成一个模块或单元或组件, 以及此外可以把它们分成多个子模块或子单元或子组 件。 除了这样的特征和 /或过程或者单元中的至少一些是相互排斥之外, 可以釆用任何组合 对本说明书 (包括伴随的权利要求、 摘要和附图) 中公开的所有特征以及如此公开的任何 方法或者设备的所有过程或单元进行组合。 除非另外明确陈述, 本说明书 (包括伴随的权 利要求、 摘要和附图) 中公开的每个特征可以由提供相同、 等同或相似目的的替代特征来 代替。 Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-assemblies. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed may be employed. Or combine all the processes or units of the device. Each feature disclosed in the specification (including the accompanying claims, the abstract, and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外, 本领域的技术人员能够理解, 尽管在此所述的一些实施例包括其它实施例中所 包括的某些特征而不是其它特征, 但是不同实施例的特征的组合意味着处于本发明的范围 之内并且形成不同的实施例。 例如, 在下面的权利要求书中, 所要求保护的实施例的任意 之一都可以以任意的组合方式来使用。 In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are not included in other embodiments, and other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现, 或者以在一个或者多个处理器上运行的软 件模块实现, 或者以它们的组合实现。 本领域的技术人员应当理解, 可以在实践中使用微 处理器或者数字信号处理器( DSP ) 来实现根据本发明实施例的通过监控以太网时钟同步 的装置, 终端设备及系统中的一些或者全部部件的一些或者全部功能。 本发明还可以实现 为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序 (例如, 计算机程序 和计算机程序产品)。 这样的实现本发明的程序可以存储在计算机可读介盾上, 或者可以 具有一个或者多个信号的形式。 这样的信号可以从因特网网站上下载得到, 或者在载体信 号上提供, 或者以任何其他形式提供。 The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the devices, terminals, and systems that monitor Ethernet clock synchronization in accordance with embodiments of the present invention. Some or all of the features of the part. The invention may also be embodied as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the present invention may be stored on a computer readable shield or may have the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制, 并且本领域技 术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。 在权利要求中, 不应 将位于括号之间的任何参考符号构造成对权利要求的限制。 单词 "包含" 不排除存在未列 在权利要求中的元件或步骤。 位于元件之前的单词 "一" 或 "一个" 不排除存在多个这样 的元件。 本发明可以借助于包括有若千不同元件的硬件以及借助于适当编程的计算机来实 现。 在列举了若千装置的单元权利要求中, 这些装置中的若千个可以是通过同一个硬件项 来具体体现。 单词第一、 第二、 以及第三等的使用不表示任何顺序。 可将这些单词解释为
名称。 It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to limit the scope of the invention, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising thousands of different elements and by means of a suitably programmed computer. In the unit claims enumerating the thousands of devices, thousands of these devices may be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as Name.
显然, 本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和 范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。
It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention
Claims
1、 一种监控以太网时钟同步的方法, 其特征在于, 所述方法包括: A method for monitoring synchronization of an Ethernet clock, the method comprising:
主时钟设备向从时钟设备发送时钟同步 Sync报文; The master clock device sends a clock synchronization Sync message to the slave clock device;
接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带从时钟设备确定的 上一对时周期主时钟设备与从时钟设备间的链路延迟信息; Receiving a delay request message returned from the clock device, where the delay request message carries link delay information between the master clock device and the slave clock device determined by the slave device;
主时钟设备根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间的时间 偏差; The master clock device determines a time offset between the master clock device and the slave clock device according to the received link delay information;
判断该时间偏差是否小于设定的时间偏差阈值; Determining whether the time deviation is less than a set time deviation threshold;
当该时间偏差不小于设定的时间偏差阈值时, 发出时钟同步异常告警信号。 When the time deviation is not less than the set time deviation threshold, a clock synchronization abnormality alarm signal is issued.
2、 如权利要求 1 所述的方法, 其特征在于, 当所述从时钟设备为两步钟时, 所述方 法还包括: 2. The method according to claim 1, wherein when the slave clock device is a two-step clock, the method further includes:
所述主时钟设备接收所述从时钟设备发送的延时请求跟随 ·ί艮文, 其中该延时请求跟随 中携带时间戳 Τ3 , Τ3为从时钟设备发送延时请求报文的时间。 The master clock device receives the delay request that is sent by the slave clock device, wherein the delay request follows the time stamp Τ3, where Τ3 is the time for sending the delay request message from the clock device.
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述确定主时钟设备与从时钟设备 之间的时间偏差包括: The method according to claim 1 or 2, wherein the determining a time offset between the master clock device and the slave clock device comprises:
所述主时钟设备根据所述延时请求报文中携带的时间戳 Τ3 , 自身收到所述延时请求报 文的时间 Τ4及所述延时请求报文中携带的链路延迟信息, 确定主时钟设备与从时钟设备 之间的时间偏差; The master clock device determines, according to the timestamp Τ3 carried in the delay request message, the time Τ4 of the delay request message and the link delay information carried in the delay request message, Time offset between the master clock device and the slave clock device;
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定主时钟设备与从时钟设备之 间的时间偏差包括: When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, where the master clock is determined. The time offset between the device and the slave clock device includes:
所述主时钟设备根据所述延时请求报文中携带的时间戳 Τ3、自身收到所述延时请求报 文的时间 Τ4、所述链路延迟信息及所述端到端透明时钟设备的驻留时间信息,确定主时钟 设备与从时钟设备之间的时间偏差。 The master clock device according to the timestamp Τ3 carried in the delay request message, the time 自身4 of the delay request message received by the master clock device, the link delay information, and the end-to-end transparent clock device The dwell time information determines the time offset between the master clock device and the slave clock device.
4、 如权利要求 1或 2所述的方法, 其特征在于, 所述从时钟设备返回的延时请求报 文还包括: The method of claim 1 or 2, wherein the delay request message returned from the clock device further includes:
当所述主时钟设备判断自身存在上一级主时钟设备时, 所述主时钟设备作为上一级主 时钟设备的从时钟设备, 向所述上一级主时钟设备返回延时请求报文, 其中所述延时请求 报文中携带该作为从时钟设备的主时钟设备确定的上一对时周期与上一级主时钟设备间 的链路延迟信息、 及确定的归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备的 时钟标识信息以及确定每个时间偏差的对时周期信息。 When the master clock device determines that the upper-level master clock device exists, the master clock device serves as a slave clock device of the upper-level master clock device, and returns a delay request message to the upper-level master clock device. The delay request message carries the link delay information between the last pair of time periods determined by the master clock device of the slave clock device and the upper-level master clock device, and each determined slave belongs to itself. Time offset of the clock device, clock identification information for each slave clock device, and timing information for determining each time offset.
5、 如权利要求 4所述的方法, 其特征在于, 所述方法还包括:
当所述主时钟设备不存在上一级主时钟设备时, 所述主时钟设备针对组网中的每个从 时钟设备的时钟标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中 该时间偏差根据该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。 5. The method of claim 4, wherein the method further comprises: When the master clock device does not have the upper-level master clock device, the master clock device records the clock identification information of each slave clock device in the networking, and records each slave clock device in each pair of time periods and itself. Time offset, wherein the time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
6、 一种监控以太网时钟同步的装置, 其特征在于, 所述装置包括: 6. A device for monitoring Ethernet clock synchronization, wherein the device comprises:
发送模块, 用于向从时钟设备发送时钟同步 Sync报文; a sending module, configured to send a clock synchronization Sync message to the slave clock device;
接收模块, 用于接收从时钟设备返回的延时请求报文, 其中该延时请求报文中携带从 时钟设备确定的上一对时周期主时钟设备与从时钟设备间的链路延迟信息; a receiving module, configured to receive a delay request message returned from the clock device, where the delay request message carries link delay information between the master clock device and the slave clock device determined by the clock device;
确定模块, 用于根据接收到的该链路延迟信息, 确定主时钟设备与从时钟设备之间的 时间偏差; a determining module, configured to determine a time offset between the master clock device and the slave clock device according to the received link delay information;
判断模块, 用于判断该时间偏差是否小于设定的时间偏差阈值; a determining module, configured to determine whether the time deviation is less than a set time deviation threshold;
告警模块, 用于当判断模块确定该时间偏差不小于设定的时间偏差阈值时, 发出时钟 同步异常告警信号。 The alarm module is configured to issue a clock synchronization abnormality alarm signal when the determining module determines that the time deviation is not less than a set time deviation threshold.
7、 如权利要求 6 所述的装置, 其特征在于, 所述接收模块, 还用于当所述从时钟设 备为两步钟时, 接收所述从时钟设备发送的延时请求跟随报文, 其中该延时请求跟随中携 带时间戳 T3 , T3为从时钟设备发送延时请求报文的时间。 The device according to claim 6, wherein the receiving module is further configured to: when the slave clock device is a two-step clock, receive a delay request following message sent by the slave clock device, The delay request carries the timestamp T3, and T3 is the time for sending the delay request message from the clock device.
8、 如权利要求 6或 7所述的装置, 其特征在于, 所述确定模块, 具体用于根据所述 延时请求报文中携带的时间戳 T3 , 自身收到所述延时请求报文的时间 T4及所述延时请求 报文中携带的链路延迟信息, 确定主时钟设备与从时钟设备之间的时间偏差; The device according to claim 6 or 7, wherein the determining module is configured to receive the delay request message according to the timestamp T3 carried in the delay request message. Time T4 and link delay information carried in the delay request message, determining a time offset between the master clock device and the slave clock device;
当所述主时钟设备与从时钟设备之间存在端到端透明时钟设备时, 所述延时请求报文 中还携带所述端到端透明时钟设备的驻留时间信息, 所述确定模块, 具体还用于根据所述 延时请求报文中携带的时间戳 T3、 自身收到所述延时请求报文的时间 Τ4、 所述链路延迟 信息及所述端到端透明时钟设备的驻留时间信息, 确定主时钟设备与从时钟设备之间的时 间偏差。 When there is an end-to-end transparent clock device between the master clock device and the slave clock device, the delay request message further carries the resident time information of the end-to-end transparent clock device, and the determining module, The method is further configured to: timestamp T3 carried in the delay request message, time 自身4 in which the delay request message is received by itself, the link delay information, and the station of the end-to-end transparent clock device. The time information is used to determine the time offset between the master clock device and the slave clock device.
9、 如权利要求 6或 7所述的装置, 其特征在于, 所述发送模块, 还用于当判断自身 存在上一级主时钟设备时, 向所述上一级主时钟设备返回延时请求报文, 其中所述延时请 求报文中携带该作为从时钟设备的主时钟设备确定的上一对时周期与上一级主时钟设备 间的链路延迟信息、 及确定的归属于自身的每个从时钟设备的时间偏差, 每个从时钟设备 的时钟标识信息以及确定每个时间偏差的对时周期信息。 The device according to claim 6 or 7, wherein the sending module is further configured to: when it is determined that the upper-level master clock device exists, return a delay request to the upper-level master clock device. a message, wherein the delay request message carries the link delay information between the last pair of time periods determined by the master clock device of the slave clock device and the upper-level master clock device, and the determined attribution to itself The time offset of each slave clock device, the clock identification information of each slave clock device, and the timing information for each time offset.
10、 如权利要求 9所述的装置, 其特征在于, 所述装置还包括: The device of claim 9, wherein the device further comprises:
存储模块, 用于当不存在上一级主时钟设备时, 针对组网中的每个从时钟设备的时钟 标识信息, 记录每个从时钟设备在每个对时周期与自身的时间偏差, 其中该时间偏差根据 该从时钟设备与每一级主时钟设备之间的时间偏差的和确定。
a storage module, configured to record, according to clock identification information of each slave clock device in the networking, when the upper-level master clock device does not exist, record a time deviation of each slave clock device from itself in each pair of time periods, where The time offset is determined based on the sum of the time offsets between the slave clock device and each stage master clock device.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410325610.9A CN104113386B (en) | 2014-07-09 | 2014-07-09 | It is a kind of to monitor the synchronous method and device of ethernet clock |
CN201410325610.9 | 2014-07-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016004644A1 true WO2016004644A1 (en) | 2016-01-14 |
Family
ID=51710029
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/082619 WO2016004644A1 (en) | 2014-07-09 | 2014-07-21 | Method and apparatus for monitoring ethernet clock synchronization |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN104113386B (en) |
WO (1) | WO2016004644A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110138489A (en) * | 2019-04-18 | 2019-08-16 | 上海赫千电子科技有限公司 | RTC clock synchronization adjustment method and device |
Families Citing this family (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105530139B (en) * | 2014-09-28 | 2021-03-16 | 中兴通讯股份有限公司 | Self-checking method and device for 1588 equipment |
CN104579534B (en) * | 2014-12-31 | 2017-10-10 | 北京东土科技股份有限公司 | Clock synchronizing method and system in a kind of SDH network |
CN105978652B (en) * | 2016-04-27 | 2018-02-13 | 刘巍 | Equipment, system and method at synchronous pair of Redundant Ethernet |
CN106130710B (en) * | 2016-06-29 | 2019-11-08 | 北京东土科技股份有限公司 | A kind of clock synchronizing method and system |
CN106533600B (en) * | 2016-10-14 | 2018-09-28 | 瑞斯康达科技发展股份有限公司 | A kind of clock synchronizing method and equipment |
CN106647228B (en) * | 2016-12-05 | 2020-06-16 | 许继集团有限公司 | A fault judgment system for the master clock of a converter station |
CN107547160B (en) * | 2017-06-28 | 2019-06-04 | 新华三技术有限公司 | A kind of method for synchronizing time and device |
CN110098884B (en) | 2018-01-31 | 2021-05-18 | 慧与发展有限责任合伙企业 | Method and apparatus for determining an anomalous clock |
CN108599888A (en) * | 2018-05-09 | 2018-09-28 | 西安电子科技大学 | A kind of distributed network clock synchronizing system |
CN109756290B (en) * | 2018-12-07 | 2021-01-08 | 天津津航计算技术研究所 | IEEE1588 protocol-based signal system accurate time synchronization method |
CN109283829B (en) * | 2018-12-11 | 2020-09-18 | 烟台钟表研究所有限公司 | Control method of regional clock system |
CN109451521B (en) * | 2018-12-27 | 2022-06-03 | 超讯通信股份有限公司 | GPS synchronization method for base station intensive distributed networking |
CN111404627B (en) * | 2019-01-02 | 2022-09-13 | 中国移动通信有限公司研究院 | Time synchronization method, device, system and storage medium |
CN111600670B (en) * | 2019-02-20 | 2023-04-18 | 阿里巴巴集团控股有限公司 | Inductive data calculation control method and time service device |
CN110098886B (en) * | 2019-04-15 | 2020-04-21 | 成都光航信科技有限公司 | FC network time synchronization method based on complex network structure |
CN113572560B (en) * | 2021-09-22 | 2022-05-06 | 浙江国利信安科技有限公司 | Method, electronic device, and storage medium for determining clock synchronization accuracy |
CN116266818A (en) * | 2021-12-17 | 2023-06-20 | 中兴通讯股份有限公司 | Information measurement method and device |
CN114124616B (en) * | 2022-01-25 | 2022-05-27 | 浙江中控研究院有限公司 | Clock synchronization optimization method based on EPA bus structure |
CN116015520B (en) * | 2022-12-27 | 2025-05-06 | 中汽研(天津)汽车工程研究院有限公司 | A test method for vehicle-mounted TSN clock synchronization error |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080075217A1 (en) * | 2006-09-22 | 2008-03-27 | Ilnicki Slawomir K | Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols |
CN101902292A (en) * | 2009-12-30 | 2010-12-01 | 西安大唐电信有限公司 | UTC high-precision time synchronization method based on optical transmission network |
CN102291196A (en) * | 2011-08-17 | 2011-12-21 | 中兴通讯股份有限公司 | Implementation method and device for detecting asymmetrical time delay of 1588 link circuit automatically |
CN102355346A (en) * | 2011-10-13 | 2012-02-15 | 中兴通讯股份有限公司 | Validity judgment method of clock synchronous source device and device |
-
2014
- 2014-07-09 CN CN201410325610.9A patent/CN104113386B/en active Active
- 2014-07-21 WO PCT/CN2014/082619 patent/WO2016004644A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080075217A1 (en) * | 2006-09-22 | 2008-03-27 | Ilnicki Slawomir K | Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols |
CN101902292A (en) * | 2009-12-30 | 2010-12-01 | 西安大唐电信有限公司 | UTC high-precision time synchronization method based on optical transmission network |
CN102291196A (en) * | 2011-08-17 | 2011-12-21 | 中兴通讯股份有限公司 | Implementation method and device for detecting asymmetrical time delay of 1588 link circuit automatically |
CN102355346A (en) * | 2011-10-13 | 2012-02-15 | 中兴通讯股份有限公司 | Validity judgment method of clock synchronous source device and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110138489A (en) * | 2019-04-18 | 2019-08-16 | 上海赫千电子科技有限公司 | RTC clock synchronization adjustment method and device |
CN110138489B (en) * | 2019-04-18 | 2021-08-20 | 上海赫千电子科技有限公司 | RTC clock synchronization adjustment method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104113386B (en) | 2017-10-10 |
CN104113386A (en) | 2014-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2016004644A1 (en) | Method and apparatus for monitoring ethernet clock synchronization | |
US8738792B2 (en) | Server time protocol messages and methods | |
EP2801162B1 (en) | Method and apparatus for communicating time information between time-aware devices | |
US8416811B2 (en) | Coordinated timing network having servers of different capabilities | |
CN108599888A (en) | A kind of distributed network clock synchronizing system | |
WO2016106908A1 (en) | Method and system for synchronizing clocks in sdh network | |
WO2017101528A1 (en) | Method and device for clock link switching and base station | |
JP2012209791A (en) | Network node, time synchronization method, and network system | |
JP5127482B2 (en) | Timing synchronization method, synchronization apparatus, synchronization system, and synchronization program | |
WO2013023530A1 (en) | Implementation method and device for automatically detecting asymmetry time delay of 1588 link | |
CN103168440B (en) | Time path compensation method and device | |
CN108650050A (en) | A kind of distributed network clock synchronous method | |
JP6452427B2 (en) | Time synchronization monitoring method, communication system, and master device | |
US12167353B2 (en) | Network entities and methods for a wireless network system for determining time information | |
WO2017054554A1 (en) | Clock synchronization method, device, and communication apparatus | |
JP2011135482A (en) | Time synchronizing system, master node, slave node, repeater, time synchronizing method, and program for time synchronization | |
WO2011134371A1 (en) | Method for synchronizing clocks and clock synchronization device | |
CN104080115A (en) | Time synchronization performance monitoring method, device and system | |
US10104657B2 (en) | Communication system, wireless communication apparatus, and wireless communication method | |
CN101394264B (en) | Monitoring method and device for periodically packet transmission | |
CN104243079A (en) | Microsecond clock synchronization method for real-time Ethernet | |
WO2013107174A1 (en) | Method and device for detecting symmetry of optical fiber | |
WO2023045881A1 (en) | Time synchronization apparatus, system, and method | |
WO2016004645A1 (en) | Ieee1588 clock synchronization method, system and apparatus based on e1 link | |
CN102404104B (en) | Adaptive synchronicity method and system based on different delayed time mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14897302 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14897302 Country of ref document: EP Kind code of ref document: A1 |