Time synchronization method and device

By introducing timestamp modules and pulse message processing modules into Ethernet, the pulse time difference between the ports is calculated and restored, the problem of high cost of GPS receiving modules when the deployment density of 5G base stations is high, and a variety of precise time synchronization methods are provided to realize the precise transmission and synchronization of time on Ethernet.

CN114430302BActive Publication Date: 2025-05-06NANJING ZHONGXING XIN SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011178071.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-29
Publication Date
2025-05-06
Estimated Expiration
2040-10-29

AI Technical Summary

Technical Problem

The prior art is difficult to receive a high-cost deployment method of GPS receiving module when the deployment density of 5G base stations is high, and the method of using the PTP protocol to deliver accurate time on Ethernet is limited.

Method used

By introducing a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module in the Ethernet, the pulse time difference calculation and time stamp information recovery between the first port and the second port are realized, providing a new time synchronization method.

Benefits of technology

It enriches the method of delivering precise time on Ethernet, provides more options for time synchronization, and realizes the precise time transmission and synchronization of time on Ethernet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114430302B_ABST
    Figure CN114430302B_ABST
Patent Text Reader

Abstract

The present invention discloses a time synchronization method and device, which relates to the technical field of time synchronization, solves the technical problem that the methods for accurate time transmission are not rich enough, and the key points of the technical solution are to set the TOD time information of the first port through a timestamp module, after the first port sends the first pulse message according to the second pulse trigger, the timestamp module adds timestamp information to the first pulse message, and sends the timestamp information to a 1PPS+TOD recovery module; after the pulse message processing module receives the second pulse message sent by the second port according to the second pulse trigger, it sends a response message to the second port; the 1PPS+TOD recovery module calculates the pulse time difference according to the second pulse message and the response message, and recovers the 1PPS and TOD time information according to the pulse time difference and the timestamp information. A new method and device that can accurately synchronize time at the same time are provided, which enriches the methods for transmitting accurate time on Ethernet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time synchronization, and in particular to a time synchronization method and device. Background Art

[0002] With the development of communication networks, the networking modes in the network are becoming more and more flexible, and the requirements for network reliability, maintainability and performance are becoming higher and higher. 5G is booming as a major trend in the communication industry. Connecting 5G base stations through ONU (Optical NetWork Unit) under wired networks is a mainstream application. In the past, base stations generally used GPS (Global Positioning System) receiving modules to provide accurate time references for base stations, but the deployment density of 5G base stations is difficult to receive the high-cost deployment method of GPS receiving modules. In this regard, the communication industry has a solution, which is to replace the GPS receiving module with the precise time transmission protocol. The PTP (Precision Time Protocol) specified in the IEEE1588V2 standard of the Institute of Electrical and Electronics Engineers can not only meet the requirements of precise time synchronization but also replace the GPS receiving module.

[0003] So far, the PTP protocol is still the only method to transmit accurate time on Ethernet, and more methods of transmitting accurate time are needed. Summary of the invention

[0004] The present invention provides a time synchronization method and device, the technical purpose of which is to enrich the method of transmitting accurate time on Ethernet, provide more options for time synchronization, and realize accurate transmission of time on Ethernet.

[0005] The above technical objectives of the present disclosure are achieved through the following technical solutions:

[0006] A time synchronization method, comprising:

[0007] TOD time information is set for the first port, the first port triggers sending a first pulse message according to the second pulse, and the first pulse message includes timestamp information;

[0008] After receiving the second pulse message sent by the second port according to the second pulse triggering, sending a response message to the second port;

[0009] Calculate the pulse time difference according to the second pulse message and the response message, and restore the 1PPS and the TOD time information according to the pulse time difference and the timestamp information;

[0010] The TOD time information setting includes: adding 1S to the TOD time information after each second pulse is emitted according to the second pulse.

[0011] Furthermore, a sending timestamp t1 is added to the second pulse message, and an arrival timestamp t2 is added to the response message.

[0012] Furthermore, the calculation of the pulse time difference includes:

[0013] Obtaining a calculated residence time t_delta of the first port after receiving the second pulse message and before sending the response message, and adding the calculated residence time t_delta to the response message;

[0014] Calculate the message interaction time t_ms between the first port and the second port according to the arrival timestamp t2, the sending timestamp t1 and the calculated residence time t_delta;

[0015] The difference between t2 and the local time of the second port is Tp, and the pulse time difference Td of the second port relative to the first port is calculated based on Tp and t_ms.

[0016] A time synchronization device, comprising:

[0017] A timestamp module sets TOD time information for the first port, adds timestamp information to the first pulse message after the first port sends the first pulse message according to the second pulse trigger, and sends the timestamp information to the 1PPS+TOD recovery module;

[0018] The pulse message processing module receives the second pulse message sent by the second port according to the second pulse triggering, and sends a response message to the second port;

[0019] A 1PPS+TOD recovery module, which calculates a pulse time difference according to the second pulse message and the response message, and recovers 1PPS and the TOD time information according to the pulse time difference and the timestamp information;

[0020] The TOD time information setting includes: adding 1S to the TOD time information after each second pulse is emitted according to the second pulse.

[0021] Furthermore, the timestamp module is further used to: add a sending timestamp t1 to the second pulse message, and add an arrival timestamp t2 to the response message.

[0022] Furthermore, the pulse message processing module is also used for:

[0023] Obtaining a calculated residence time t_delta of the first port after receiving the second pulse message and before sending the response message, and adding the calculated residence time t_delta to the response message;

[0024] Calculate the message interaction time t_ms between the first port and the second port according to the arrival timestamp t2, the sending timestamp t1 and the calculated residence time t_delta;

[0025] The difference between t2 and the local time of the second port is Tp, and the t_ms and the Tp are sent to the 1PPS+TOD recovery module.

[0026] Furthermore, the 1PPS+TOD recovery module is also used for:

[0027] receiving the timestamp information;

[0028] The t_ms and the Tp are received, and a pulse time difference Td of the second port relative to the first port is calculated according to the t_ms and the Tp.

[0029] The beneficial effects of the present disclosure are as follows: the time synchronization method and device described in the present disclosure, sets the TOD time information for the first port through the timestamp module, after the first port sends the first pulse message according to the second pulse trigger, the timestamp module adds the timestamp information to the first pulse message, and sends the timestamp information to the 1PPS+TOD recovery module; after the pulse message processing module receives the second pulse message sent by the second port according to the second pulse trigger, it sends a response message to the second port; the 1PPS+TOD recovery module calculates the pulse time difference according to the second pulse message and the response message, and recovers the 1PPS and TOD time information according to the pulse time difference and the timestamp information. A new method and device for accurate time synchronization is provided, which enriches the method of transmitting accurate time on Ethernet and provides more options for time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a flow chart of the disclosed method;

[0031] Figure 2 It is a schematic diagram of the device disclosed in the present invention;

[0032] Figure 3 It is a schematic diagram of message flow between ports;

[0033] Figure 4 It is a schematic diagram of an embodiment of the device disclosed in the present invention;

[0034] Figure 5 This is a schematic diagram for calculating the message interaction time t_ms;

[0035] Figure 6 Schematic diagram of pulse time difference Td. DETAILED DESCRIPTION

[0036] The technical solution of the present disclosure will be described in detail below in conjunction with the accompanying drawings. In the description of the present disclosure, it should be understood that the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated, and are only used to distinguish different components. In this application, "first port" refers to the master port, that is, time synchronization is performed based on the clock of the master port. "Second port" refers to the slave port, and the slave port is synchronized with the clock of the master port through time synchronization.

[0037] Figure 1 The flow chart of the disclosed method is as follows: Figure 1 As shown, firstly, the TOD (Time of Day, time information) is set for the first port, and the TOD time information setting is to add 1S to the TOD time information after each second pulse is sent according to the second pulse, and then the first port triggers the sending of the first pulse message according to the second pulse (i.e. 1PPS), and the first pulse message includes the timestamp information T_tod. The second port sends the second pulse message to the first port according to the second pulse trigger, and after receiving the second pulse message, the first port sends a response message to the second port, calculates the pulse time difference according to the response message, and finally restores the 1PPS and TOD according to the pulse time difference and the timestamp information T_tod.

[0038] The sending timestamp when the second port sends the second pulse message is t1, and the arrival timestamp when the second port receives the reply message is t2; at the same time, after receiving the second pulse message and before sending the reply message, there is a calculated residence time t_delta on the first port. When the first port sends the reply message, the calculated residence time t_delta is added to the reply message, and the message interaction time between the first port and the second port can be calculated as t_ms = (t2-t1-t_delta) / 2. In addition, the difference between t2 and the local time of the second port is Tp, so there is Td is the pulse time difference of the second port relative to the first port. Finally, the second port adds Td to its local 1PPS (pulse per second) to output the recovered 1PPS, and adds 1 to the timestamp information T_tod to output the recovered TOD time information.

[0039] In actual application scenarios, the generation and processing capabilities of time pulse messages are increased in the hardware logic of the Ethernet port of the network device, such as Figure 3, between the master port of device 1 and the slave port of device 2, the pulse message is triggered by the second pulse of the system of the device where the port is located every second, and the current time of the device is sent downstream as the message content in the pulse message. After receiving the pulse message, the pulse message receiver sends back a pulse message response. The pulse message sender calculates the distance between the ports based on the time when the response arrives, and uses the distance as the basis for the time transmission deviation. When devices 1-3 are in the process of time synchronization, port A of upstream device 1 uses EEC (Synchronous Ethernet Equipment Clock) to synchronize the frequency to the downstream device. The upstream device 1 and its downstream device 2 work at the same frequency. Port B of device 2 measures the distance between it and port A of device 1 through pulse message interaction, and calculates the current precise time of port B based on the pulse message information of port A of device 1 and the measured distance, and transmits it to the downstream devices one by one in the network in the same way.

[0040] Figure 4 This is a schematic diagram of an embodiment of the device disclosed in the present invention. As shown in the figure, a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module are set in the NP (Network Processer) of the Ethernet port of the device. Figure 3 , the device 1 system completes the TOD time information setting of the timestamp module corresponding to port A within the system pulse cycle. After the setting is completed, the new TOD time information increases by 1S after each second pulse is sent according to the second pulse. The pulse message processing module of port A is triggered by the system 1PPS pulse to send a pulse message to port B. The pulse message contains the timestamp information T_tod of the timestamp module. The 1PPS+TOD recovery module of port B receives the timestamp information T_tod. T_tod is a high-precision ns-level accurate timestamp.

[0041] The pulse message processing module of port B of device 2 is triggered by the PPS pulse of system 1 to send a pulse message to port A. The pulse message includes a sending timestamp t1. After port A receives the pulse message from port B, it sends a response message to port B. After port B receives the response message from port A, it can be calculated that the time required for message interaction between port B and port A is t_ms = (t2-t1-t_delta) / 2, as Figure 5As shown, t_ms is sent to the 1PPS+TOD recovery module. At the same time, after port B receives the response message from port A, it records the time Tp that the arrival time of the response message is slower than the 1PPS of the local system of port B. Then the pulse message processing module of port B sends Tp to the 1PPS+TOD recovery module. The 1PPS+TOD recovery module combines historical data and The pulse time difference of 1PPS of port B relative to port A is calculated, such as Figure 6 As shown, is the average value of all Tp data in a period of time, It is the average value of all t_ms data in a period of time. Finally, the 1PPS+TOD recovery module of port B adds Td to the system 1PPS of port B and outputs the recovered 1PPS, adds 1 to T_tod and then outputs the recovered TOD time information.

[0042] Figure 2 It is a schematic diagram of the device disclosed in the present invention, as shown in Figure 2 As shown, the time synchronization device described in the present invention includes a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module. The timestamp module is used to: set TOD time information for the first port; add timestamp information to the first pulse message after the first port sends the first pulse message according to the second pulse trigger; add a sending timestamp t1 to the second pulse message, and add an arrival timestamp t2 to the reply message.

[0043] The pulse message processing module is used to: after receiving the second pulse message sent by the second port according to the second pulse trigger, send a reply message to the second port; obtain the calculated residence time t_delta of the first port after receiving the second pulse message and before sending the reply message, and add the calculated residence time t_delta to the reply message, calculate the message interaction time t_ms between the first port and the second port = (t2-t1-t_delta) / 2; then obtain the difference between t2 and the local time of the second port as Tp, and send t_ms and Tp to the 1PPS+TOD recovery module.

[0044] The 1PPS+TOD recovery module is used to: receive the timestamp information of the timestamp module, and simultaneously receive the t_ms and Tp of the pulse message processing module, and calculate Td is the pulse time difference of the second port relative to the first port, and finally 1PPS and TOD are restored according to Td and T_tod; where, is the average value of all Tp in a period of time, It is the average value of all t_ms in a period of time.

[0045] Generally speaking, any port of the device is respectively provided with a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module, that is, the NP of the first port is provided with a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module, and the NP of the second port is also provided with a timestamp module, a pulse message processing module and a 1PPS+TOD recovery module. Specifically, when port A is used as an upstream port, its timestamp module sets the TOD time information for it, and after its system triggers the sending of a pulse message, its timestamp module adds the timestamp information T_tod to its pulse message, and sends the timestamp information T_tod to the 1PPS+TOD recovery module of port B.

[0046] The system trigger of port B sends a pulse message to port A. After receiving the message, port A sends a reply message to port B. After receiving the reply message, port B processes the message in its pulse message processing module to obtain t_ms, and obtains the difference Tp between the arrival time of the reply message at port B and the local time of port B. The pulse message processing module of port B sends t_ms and Tp to the 1PPS+TOD recovery module of port B itself. The 1PPS+TOD recovery module of port B calculates the pulse time difference based on t_ms and Tp. Finally, the 1PPS+TOD recovery module of port Bd recovers the 1PPS and TOD of port B based on the pulse time difference and the timestamp information T_tod received from port A.

[0047] The above are exemplary embodiments of the present disclosure, and the protection scope of the present disclosure is defined by the claims and their equivalents.

Claims

1. A time synchronization method, characterized in that: include: TOD time information is set for the first port, the first port triggers sending a first pulse message according to the second pulse, and the first pulse message includes timestamp information; The first port refers to the primary port; After receiving the second pulse message sent by the second port according to the second pulse triggering, sending a response message to the second port; The second port refers to the slave port; Calculate the pulse time difference according to the second pulse message and the response message, and restore the 1PPS and the TOD time information of the second port according to the pulse time difference and the timestamp information; wherein the pulse time difference is determined according to the difference between the message interaction time between the first port and the second port and Tp; Tp represents the difference between the arrival time of the response message and the local time of the second port; The TOD time information setting includes: adding 1S to the TOD time information after each second pulse is emitted according to the second pulse.

2. The time synchronization method according to claim 1, characterized in that: A sending timestamp t1 is added to the second pulse message, and an arrival timestamp t2 is added to the response message.

3. The time synchronization method according to claim 2, characterized in that: The calculation of the pulse time difference includes: Obtaining a calculated residence time t_delta of the first port after receiving the second pulse message and before sending the response message, and adding the calculated residence time t_delta to the response message; Calculate the message interaction time t_ms between the first port and the second port according to the arrival timestamp t2, the sending timestamp t1 and the calculated residence time t_delta; The difference between t2 and the local time of the second port is Tp, and the pulse time difference Td of the second port relative to the first port is calculated based on Tp and t_ms.

4. A time synchronization device, characterized in that: include: A timestamp module sets TOD time information for the first port, adds timestamp information to the first pulse message after the first port sends the first pulse message according to the second pulse trigger, and sends the timestamp information to the 1PPS+TOD recovery module; The first port refers to the primary port; The pulse message processing module receives the second pulse message sent by the second port according to the second pulse triggering, and sends a response message to the second port; The second port refers to a slave port; A 1PPS+TOD recovery module calculates a pulse time difference according to the second pulse message and the response message, and recovers the 1PPS and TOD time information of the second port according to the pulse time difference and the timestamp information; wherein the pulse time difference is determined according to the difference between the message interaction time between the first port and the second port and Tp; Tp represents the difference between the arrival time of the response message and the local time of the second port; The TOD time information setting includes: adding 1S to the TOD time information after each second pulse is emitted according to the second pulse.

5. The time synchronization device according to claim 4, characterized in that: The timestamp module is further used to add a sending timestamp t1 to the second pulse message and to add an arrival timestamp t2 to the response message.

6. The time synchronization device according to claim 5, characterized in that: The pulse message processing module is also used for: Obtaining a calculated residence time t_delta of the first port after receiving the second pulse message and before sending the response message, and adding the calculated residence time t_delta to the response message; Calculate the message interaction time t_ms between the first port and the second port according to the arrival timestamp t2, the sending timestamp t1 and the calculated residence time t_delta; The difference between t2 and the local time of the second port is Tp, and the t_ms and the Tp are sent to the 1PPS+TOD recovery module.

7. The time synchronization device according to claim 6, characterized in that: The 1PPS+TOD recovery module is also used for: receiving the timestamp information; The t_ms and the Tp are received, and a pulse time difference Td of the second port relative to the first port is calculated according to the t_ms and the Tp.

Citation Information

Patent Citations

  • Time compensation method, device and system

    CN102082655A