A time synchronization method, device, system and storage medium

By adding a timestamp and phase difference to phase synchronization protocol packets in the phase synchronization network, and accurately correction, the calculation error problem introduced in the two -way packet processing due to the linkage of linking quality.

CN112865900BActive Publication Date: 2025-01-28ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911184040.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-27
Publication Date
2025-01-28
Estimated Expiration
2039-11-27

AI Technical Summary

Technical Problem

In the prior art, the phase synchronization scheme is based on bidirectional message processing. If the message is transmitted on a link without phase compensation, it will introduce calculation errors, affect the calculation accuracy of phase synchronization, and may affect the network service transmission quality.

Method used

Through detection time synchronization events, send phase synchronization protocol packets, and add entry time stamps and phase differences in the message. After receiving the feedback message, add the export timestamp and calculate the value of the correction field to correct the time information of the current network element and achieve precise compensation of the phase difference.

Benefits of technology

It improves the accuracy of the phase synchronization, reduces the calculation error, and ensures the quality of the network business transmission, especially to meet the NS accuracy requirements in the 5G network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112865900B_ABST
    Figure CN112865900B_ABST
Patent Text Reader

Abstract

An embodiment of the present application proposes a time synchronization method, device, system and storage medium, the method comprising: detecting a time synchronization event trigger, sending a first phase synchronization protocol message to a slave network element, and adding a first entry timestamp and a first phase difference to the first phase synchronization protocol message; upon receiving a second phase synchronization protocol message sent by the slave network element, adding a second exit timestamp to the second phase synchronization protocol message; obtaining the value of a second correction field in the second phase synchronization protocol message, and sending the value of the second correction field to the slave network element.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a clock synchronization network, and in particular to a time synchronization method, device, system and storage medium. Background Art

[0002] In a digital synchronous network, all network elements in the network topology must be synchronized with the clock source of the entire network to ensure normal service reception. Generally speaking, clock synchronization includes frequency synchronization and phase synchronization. Different network transmission modes have different requirements for the accuracy of clock synchronization. At present, with the development of communication technology, especially with the deployment of 5G networks, the accuracy requirements for clock synchronization, especially phase synchronization, are constantly increasing, and the accuracy level of ns needs to be achieved. Since the phase synchronization scheme in the relevant technology is based on the processing of two-way messages for phase synchronization, if the message is transmitted on a link without phase compensation and jitter occurs, it will introduce calculation errors, which will affect the calculation accuracy of phase synchronization and even affect the service transmission quality on the network. Summary of the invention

[0003] Embodiments of the present application provide a time synchronization method, device, system and storage medium.

[0004] In a first aspect, an embodiment of the present application provides a time synchronization method, including:

[0005] Upon detecting a time synchronization event trigger, sending a first phase synchronization protocol message to a slave network element, and adding a first entry timestamp and a first phase difference to the first phase synchronization protocol message;

[0006] Upon receiving a second phase synchronization protocol message sent from a network element, adding a second egress timestamp to the second phase synchronization protocol message;

[0007] Obtain a value of a second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element.

[0008] In a second aspect, an embodiment of the present application further provides a time synchronization method, including:

[0009] receiving a first phase synchronization protocol message, adding a second phase difference to the first phase synchronization protocol message, and forwarding the first phase synchronization protocol message with the second phase difference added to a slave network element;

[0010] A second phase synchronization protocol message is received, a fourth phase difference is added to the second phase synchronization protocol message, and the second phase synchronization protocol message with the fourth phase difference added is forwarded to the master network element.

[0011] In a third aspect, an embodiment of the present application further provides a time synchronization method, including:

[0012] receiving a first phase synchronization protocol message, and adding a first egress timestamp to the first phase synchronization protocol message;

[0013] Sending a second phase synchronization protocol message to the master network element, and adding a second entry timestamp and a third phase difference to the second phase synchronization protocol message;

[0014] Obtaining the value of the second correction field sent by the primary network element;

[0015] Determine a value of a first correction field based on a first inlet timestamp, a first phase difference, a second phase difference and a first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field;

[0016] The time information of the current network element is corrected according to the phase difference.

[0017] In a fourth aspect, an embodiment of the present application provides a time synchronization device, including:

[0018] A protocol message control module, configured to detect a time synchronization event trigger, send out a first phase synchronization protocol message, and obtain a value of a second correction field in a second phase synchronization protocol message, and send the value of the second correction field to a slave network element;

[0019] a transmission delay compensation module, configured to add a first ingress timestamp to the first phase synchronization protocol message, and, upon receiving a second phase synchronization protocol message sent from a network element, to add a second egress timestamp to the second phase synchronization protocol message;

[0020] The phase difference measurement and compensation module is used to add the first phase difference to the first phase synchronization protocol message and send the first phase synchronization protocol message to the slave network element.

[0021] In a fifth aspect, an embodiment of the present application further provides a time synchronization device, including:

[0022] A first phase difference measurement and compensation module, used for receiving a first phase synchronization protocol message, adding a second phase difference to the first phase synchronization protocol message, and forwarding the first phase synchronization protocol message with the second phase difference added to a slave network element;

[0023] The second phase difference measurement and compensation module is used to receive the second phase synchronization protocol message, add the fourth phase difference to the second phase synchronization protocol message, and forward the second phase synchronization protocol message with the fourth phase difference added to the master network element.

[0024] In a sixth aspect, an embodiment of the present application further provides a time synchronization device, including:

[0025] A protocol message control module, used for sending a second phase synchronization protocol message to a master network element;

[0026] A phase difference measurement and compensation module, used to add a third phase difference to the second phase synchronization protocol message;

[0027] A transmission delay compensation module, configured to receive a first phase synchronization protocol message, add a first egress timestamp to the first phase synchronization protocol message, and add a second ingress timestamp to the second phase synchronization protocol message;

[0028] A phase synchronization processing module, used to obtain a value of a second correction field sent by the master network element, determine a value of the first correction field based on the first inlet timestamp, the first phase difference, the second phase difference and the first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field;

[0029] The time information management module is used to correct the time information of the current network element according to the phase difference.

[0030] In a seventh aspect, an embodiment of the present application provides a time synchronization system, including: a master network element and a slave network element;

[0031] The master network element executes the method of the first aspect in the embodiment of the present application, and the slave network element executes the method of the third aspect in the embodiment of the present application.

[0032] In an eighth aspect, an embodiment of the present application provides a time synchronization system, including: a master network element, an intermediate network element, and a slave network element;

[0033] The master network element executes the method of the first aspect in the embodiment of the present application, the intermediate network element executes the method of the second aspect in the embodiment of the present application, and the slave network element executes the method of the third aspect in the embodiment of the present application.

[0034] An embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, any one of the methods in the embodiments of the present application is implemented.

[0035] With regard to the above embodiments and other aspects of the present application and their implementation, further description is provided in the accompanying drawings, detailed description and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flow chart of a time synchronization method in the related art;

[0037] Figure 2 A flowchart of a time synchronization method provided in an embodiment of the present application;

[0038] Figure 3A flowchart of another time synchronization method provided in an embodiment of the present application;

[0039] Figure 4 A flowchart of another time synchronization method provided in an embodiment of the present application;

[0040] Figure 5 A structural block diagram of a time synchronization device provided in an embodiment of the present application;

[0041] Figure 6 A structural block diagram of another time synchronization device provided in an embodiment of the present application;

[0042] Figure 7 A structural block diagram of another time synchronization device provided in an embodiment of the present application;

[0043] Figure 8 A structural block diagram of a master network element or a slave network element in which a phase difference measurement compensation module and a transmission delay compensation module are integrated according to an embodiment of the present application;

[0044] Fig. 9 A structural block diagram of a master network element or a slave network element in which a phase difference measurement compensation module and a transmission delay compensation module are separately provided in an embodiment of the present application;

[0045] Fig.10 A structural block diagram of another intermediate network element provided in an embodiment of the present application;

[0046] Fig.11 A schematic diagram of the structure of another intermediate network element provided in an embodiment of the present application;

[0047] Fig.12 A schematic diagram of PTP message processing under a chain topology of a time synchronization system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0049] To facilitate understanding, the words that may appear in the embodiments of the present application are explained below.

[0050] Time synchronization: also called phase synchronization, means that the frequency and phase between signals remain consistent, that is, the phase difference between signals is always zero.

[0051] Frequency synchronization: also called clock synchronization, refers to maintaining a certain strict and specific relationship between signals in frequency or phase. Signals appear at the same average rate at their corresponding effective moments to ensure that all devices in the communication network run at the same rate, that is, a constant phase difference is maintained between signals.

[0052] The master-slave relationship is relative. For a pair of network elements that are synchronized with each other, the following master-slave relationship exists:

[0053] The network element that publishes the synchronized time is called the master network element, and the network element that receives the synchronized time is called the slave network element.

[0054] The clock on the master network element is called the time information, and the clock on the slave network element is called the slave clock.

[0055] The port that publishes the synchronized time is called the master port, and the port that receives the synchronized time is called the slave port.

[0056] Master Port: The port that publishes the synchronization time, which can exist on BC or OC.

[0057] Slave Port: The port that receives the synchronized time, which can exist on BC or OC.

[0058] Passive Port: A port that neither receives nor publishes synchronized time, and exists only on BC.

[0059] The network elements in a PTP domain (a network using the PTP protocol) can also be called clock nodes. The PTP protocol defines the following three types of basic clock nodes:

[0060] OC (Ordinary Clock): This clock node has only one PTP port in the same PTP domain to participate in time synchronization, and synchronizes time from the upstream clock node through this port. In addition, when the clock node is used as a clock source, it can publish time to the downstream clock node through only one PTP port.

[0061] BC (Boundary Clock): This clock node has multiple PTP ports in the same PTP domain to participate in time synchronization. It synchronizes time from the upstream clock node through one of the ports and publishes time to the downstream clock nodes through the remaining ports. In addition, when the clock node is used as a clock source, it can publish time to downstream clock nodes through multiple PTP ports.

[0062] TC (Transparent clock): Compared with BC or OC, BC or OC needs to keep time synchronization with other clock nodes, while TC does not keep time synchronization with other clock nodes. TC has multiple PTP ports, but it only forwards PTP protocol messages between these ports and corrects the forwarding delay, and does not synchronize time through any port.

[0063] According to the PTP standard protocol, the network topology includes three types of network elements, namely Master network element (master network element), Slave network element (slave network element) and TC network element. Among them, Master and Slave network elements are master and slave network elements with phase synchronization in the network. The phase of the Slave network element is synchronized with the Master network element, and the TC network element is the intermediate network element between the Master network element and the Slave network element for transparent transmission of PTP messages.

[0064] Phase synchronization can be achieved through GNSS (Global Navigation Satellite System). For example, the GPS system can be used for timing, but this method has a high deployment cost, and once the GNSS system fails, it will have a significant impact on the network. Therefore, the usual method is to use a timing method that combines GNSS with a high-precision ground time network, which can effectively guarantee the synchronization performance and security of the entire network. Especially for scenarios where GNSS deployment is difficult, timing based on a high-precision ground time network is an effective solution.

[0065] PTP (Precision Time Protocol) is a commonly used phase synchronization protocol. The synchronization principle of the PTP protocol is that the master and slave network elements exchange synchronization messages and record the message sending and receiving time, and calculate the phase difference between the master and slave network elements by calculating the time difference of the message round trip. Figure 1 This is a flow chart of a time synchronization method in the related art. The specific steps of the time synchronization method are as follows:

[0066] 1. The master NE sends a Sync message at time t1 and timestamps the Sync message with t1. If the master NE is in One-step mode, the t1 timestamp is sent to the slave NE along with the Sync message. If the master NE is in Two-step mode, the t1 timestamp is sent to the slave NE in the subsequent Follow_Up message.

[0067] 2. The slave network element receives the Sync message at time t2, and timestamps the Sync message with t2, and obtains the t1 timestamp from the Sync message (One-step) or Follow_Up message (Two-step).

[0068] 3. The slave NE sends a Delay_Req message carrying the t3 timestamp to the master NE at time t3.

[0069] 4. The master network element receives the Delay_Req message at time t4 and timestamps the Delay_Req message with t4.

[0070] 5 The master network element then sends the t4 timestamp to the slave network element via a Delay_Resp message.

[0071] Through the above message transmission process, the slave network element obtains a total of four timestamps, namely t1, t2, t3 and t4. At the same time, the Sync message and Delay_Req message also carry the CF field for correcting the path delay of the link. Since the CF field has corrected the asymmetric delay on the link, it can be considered that the bidirectional path delay is symmetrical. Therefore, the slave network element can calculate the average path delay between the master and slave network elements based on these four timestamps and two CF fields, and then calculate the time deviation between the slave network element and the master network element. After that, the slave network element uses this time deviation to correct the local time, so that the time between the master and slave network elements is synchronized.

[0072] The formula for calculating the average path delay and time deviation between the master and slave network elements is as follows, where θ represents the time deviation between the master and slave network elements, δ1 and δ2 represent the path delay of bidirectional transmission. Since the CF field in the message has corrected the asymmetric delay on the link, δ1 and δ2 can be considered equal.

[0073] t2=t1+θ+δ1+CF1 (1)

[0074] t4=t3-θ+δ2+CF2 (2)

[0075]

[0076]

[0077] As can be seen from the above, the PTP protocol performs phase synchronization based on the processing of bidirectional messages. During the bidirectional transmission of messages, the asymmetry of the delay on the transmission link will have a great impact on the final synchronization accuracy. In the PTP protocol, two methods for handling link asymmetry are specified, namely Edge-To-Edge and Peer-To-Peer modes. Among them, in the Edge-To-Edge mode, when the network elements in the network topology transparently transmit the PTP message, the residence time of the message in the network element is compensated to the CF field of the message; while in the Peer-To-Peer mode, the path delay of the message needs to be calculated segment by segment between network elements, and compensated to the CF field together with the residence time of the message in the device. Both modes compensate for the delay on the transmission link in segments, which is difficult to achieve seamlessness. If the message jitters when transmitting on the link that is not compensated, it will affect the accuracy of the final phase synchronization.

[0078] In view of this, an embodiment of the present application provides a time synchronization method to improve phase synchronization accuracy.

[0079] Figure 2 The flowchart of a time synchronization method provided in an embodiment of the present application can be performed by a time synchronization device. The device can be implemented by software and / or hardware and can generally be integrated in a primary network element. Figure 2 As shown, the method includes:

[0080] Step 210: When a time synchronization event is detected to be triggered, a first phase synchronization protocol message is sent to a slave network element, and a first entry timestamp and a first phase difference are added to the first phase synchronization protocol message.

[0081] In the embodiment of the present application, the phase synchronization protocol message may be a PTP message. For example, the first phase synchronization protocol message is a PTP message sent from the master network element to the slave network element.

[0082] In the embodiment of the present application, the master network element (i.e., the Master network element) and the slave network element (i.e., the Slave network element) are pre-configured, and the PTP port is added, the relevant parameters are set, and the PTP function is enabled. Whether a network element is a master network element or a slave network element is determined by the configuration information. The same network element is configured as a slave network element in a certain configuration operation, but may be configured as a master network element in other configuration operations.

[0083] It should be noted that there are many ways to trigger a time synchronization event, which is not specifically limited in the embodiments of the present application. For example, when the PTP function of the network element is enabled, the time synchronization event is triggered. Or, the time synchronization event is triggered periodically.

[0084] It should be noted that in a time synchronization network, each network element in the network topology is equipped with a time information management module, which is used to maintain and manage the time information of the network element. The time information publishing module on the network element is used to periodically synchronize the time information to the transmission delay compensation module and phase difference measurement compensation module of the network element.

[0085] In the embodiment of the present application, the protocol message control module on the master network element is responsible for the control of the sending and receiving of the protocol message. For the received protocol message, the protocol message control module performs analysis, verification and processing. When the phase synchronization protocol message is a PTP message, and the PTP port is configured on the network element and the PTP function is enabled, the PTP message is periodically sent through the PTP port.

[0086] In an embodiment of the present application, upon detecting a time synchronization event trigger, the protocol message control module sends a first phase synchronization protocol message. The first phase synchronization protocol message enters the transmission delay compensation module of the main network element, and the entry of the transmission delay compensation module runs a setting program to stamp the first entry timestamp for the first phase synchronization protocol message according to the time information stored in the module, and records the first entry timestamp to the setting field of the phase synchronization protocol message. For example, the transmission delay compensation module records the time when the first phase synchronization protocol message is detected as the first entry timestamp; the first entry timestamp is added to the preset field of the first phase synchronization protocol message. Among them, the preset field can be any field in the message, for example, it can be a correction field such as a CF field, which is located in the frame header of the PTP message and is used to correct the asymmetric delay on the transmission link. Then, the transmission delay compensation module forwards the first phase synchronization protocol message containing the first entry timestamp.

[0087] In an exemplary solution, the phase difference measurement and compensation module on the adjacent network element measures the phase difference between the adjacent network element in real time according to the time information recorded inside the module. For example, the phase difference measurement and compensation module on the master network element measures the first phase difference between the master network element and the adjacent intermediate network element in real time.

[0088] The phase difference measurement compensation module obtains a first phase difference between the current network element and an adjacent intermediate network element or a slave network element, adds the first phase difference to a first phase synchronization protocol message, and forwards the first phase synchronization protocol message including a first ingress timestamp and a first phase difference to the slave network element. Exemplarily, the first phase synchronization protocol message reaches the phase difference measurement compensation module, and the phase difference measurement compensation module adds the first phase difference to the first phase synchronization protocol message.

[0089] In the embodiment of the present application, there are many ways to forward the first phase synchronization protocol message to the slave network element, and the embodiment of the present application does not specifically limit it. For example, the phase difference measurement compensation module forwards the first phase synchronization protocol message containing the first entry timestamp and the first phase difference to the slave network element through the intermediate network element. Alternatively, the phase difference measurement compensation module sends the first phase synchronization protocol message containing the first entry timestamp and the first phase difference to the slave network element.

[0090] Step 220: When receiving a second phase synchronization protocol message sent from a network element, add a second egress timestamp to the second phase synchronization protocol message.

[0091] The second phase synchronization protocol message may be a PTP message sent from the network element to the master network element.

[0092] Exemplarily, the transmission delay compensation module determines a second exit timestamp of the second phase synchronization protocol message, and adds the second exit timestamp to the second phase synchronization protocol message. For example, the exit of the transmission delay compensation module runs a setting program, and when the second phase synchronization protocol message leaves the transmission delay compensation module, the second exit timestamp is added to the second phase synchronization protocol message.

[0093] Step 230: Obtain a value of a second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element.

[0094] Exemplarily, the second phase synchronization protocol message is parsed, and the value of the second correction field in the second phase synchronization protocol message is obtained based on the second entry timestamp, the third phase difference, the fourth phase difference and the second exit timestamp, and the value of the second correction field is sent to the slave network element via a Resp message.

[0095] In an exemplary embodiment, before the transmission delay compensation module detects the phase synchronization protocol message, it also includes: a time information publishing module periodically obtains the time information of the inter-module transmission delay and the time information management module, and synchronizes the time information to the transmission delay compensation module and the phase difference measurement compensation module according to the inter-module transmission delay. Among them, the inter-module transmission delay is the delay caused when the message containing time information is transmitted between the modules inside the network element. There are many ways to determine the transmission delay, and the embodiments of the present application are not specifically limited. For example, the transmission delay can be determined by analyzing the circuit design. Alternatively, a measurement pulse signal is sent to the transmission delay compensation module and the phase difference measurement compensation module through the time information publishing module to measure the transmission delay between modules in real time.

[0096] The embodiment of the present application provides another time synchronization method, which can be performed by a time synchronization device. The device can be implemented by software and / or hardware, and can generally be integrated in an intermediate network element. The method includes:

[0097] receiving a first phase synchronization protocol message, adding a second phase difference to the first phase synchronization protocol message, and forwarding the first phase synchronization protocol message with the second phase difference added to a slave network element;

[0098] A second phase synchronization protocol message is received, a fourth phase difference is added to the second phase synchronization protocol message, and the second phase synchronization protocol message with the fourth phase difference added is forwarded to the master network element.

[0099] It should be noted that the time information publishing module periodically obtains the inter-module transmission delay and the time information of the time information management module, and synchronizes the time information to the phase difference measurement compensation module according to the inter-module transmission delay.

[0100] Exemplarily, the phase measurement compensation module includes a first phase measurement compensation module and a second phase difference measurement compensation module. The first phase difference measurement compensation module calculates the phase difference between the current network element and the adjacent intermediate network element or the slave network element based on the time information in the module to obtain the second phase difference. The low temperature phase difference measurement compensation module calculates the phase difference between the current network element and the adjacent intermediate network element and the master network element based on the time information in the module to obtain the fourth phase difference.

[0101] For example, when there are multiple intermediate network elements and the current intermediate network element is not directly connected to the slave network element, along the message sending direction, the first phase difference measurement compensation module measures the second phase difference between the intermediate network element and the adjacent intermediate network element in real time based on the time information in the module.

[0102] Alternatively, when there is an intermediate network element, or the current network element is directly connected to the slave network element, the first phase difference measurement module measures the second phase difference between the intermediate network element and the slave network element in real time based on the time information in the module.

[0103] Alternatively, when the current network element is directly connected to the main network element, the second phase difference measurement module measures the fourth phase difference between the intermediate network element and the main network element in real time based on the time information in the module.

[0104] Alternatively, when there are multiple intermediate network elements and the current intermediate network element is not directly connected to the main network element, along the message sending direction, the second phase difference measurement compensation module measures the fourth phase difference between the intermediate network element and the adjacent intermediate network element in real time based on the time information in the module.

[0105] It should be noted that the middleware network element can be a TC network element with multiple PTP ports, which is responsible for forwarding PTP protocol messages and correcting their forwarding delays, and will not synchronize time through any port. The first phase difference measurement and compensation module obtains the second phase difference between the current network element and the adjacent intermediate network element or slave network element, and adds the second phase difference to the first phase synchronization protocol message. The second phase difference measurement and compensation module obtains the fourth phase difference between the current network element and the adjacent intermediate network element or master network element, and adds the fourth phase difference to the second phase synchronization protocol message.

[0106] Figure 3 This is a flow chart of another time synchronization method provided in an embodiment of the present application, which can be executed by a time synchronization device. The device can be implemented by software and / or hardware and can generally be integrated in a slave network element.

[0107] Step 310: Receive a first phase synchronization protocol message, and add a first egress timestamp to the first phase synchronization protocol message.

[0108] The first phase synchronization protocol message includes a first entry timestamp, a first phase difference and a second phase difference.

[0109] The transmission delay compensation module determines a first exit timestamp of the first phase synchronization protocol message, and adds the first exit timestamp to the first phase synchronization protocol message. For example, the exit operation setting program of the transmission delay compensation module is used to add a second timestamp to the phase synchronization protocol message when detecting that the transmission delay compensation module forwards the first phase synchronization protocol message to the phase synchronization processing module. For example, the transmission delay compensation module records the departure time of the first phase synchronization protocol message as the second timestamp; and adds the second timestamp to a preset field of the phase synchronization protocol message.

[0110] Step 320: Send a second phase synchronization protocol message to the master network element, and add a second entry timestamp and a third phase difference to the second phase synchronization protocol message.

[0111] The second phase synchronization protocol message may be a PTP message sent from the network element to the master network element.

[0112] It should be noted that the time information publishing module periodically obtains the inter-module transmission delay and the time information of the time information management module, and synchronizes the time information to the transmission delay compensation module and the phase difference measurement compensation module according to the inter-module transmission delay.

[0113] It should be noted that before adding the third phase difference to the second phase synchronization protocol message, it also includes: the phase difference measurement compensation module calculates the third phase difference between the current network element and the adjacent network element based on the time information in the module, wherein the adjacent network element includes an intermediate network element or a main network element.

[0114] The protocol message control module sends a second phase synchronization protocol message; the transmission delay compensation module determines the second entry timestamp of the second phase synchronization protocol message, and adds the second entry timestamp to the second phase synchronization protocol message; the phase difference measurement compensation module obtains the third phase difference between the current network element and the adjacent intermediate network element or the main network element, adds the third phase difference to the second phase synchronization protocol message, and forwards the second phase synchronization protocol message containing the second entry timestamp and the third phase difference to the main network element.

[0115] An exemplary implementation may be that the protocol message control module sends a second phase synchronization protocol message to the master network element. When the second phase synchronization protocol message passes through the entrance of the transmission delay compensation module, a second entrance timestamp is stamped. When the second phase synchronization protocol message passes through the phase difference measurement compensation module, the third phase difference in the phase difference measurement compensation module is compensated to a preset field of the second phase synchronization protocol message. In an embodiment of the present application, it may be a correction field (e.g., a CF field).

[0116] Step 330: Obtain the value of the second correction field sent by the primary network element.

[0117] The protocol message control module receives the Resp message sent by the primary network element, and parses the Resp message to obtain a value of the second correction field.

[0118] Step 340: determine the value of the first correction field based on the first inlet timestamp, the first phase difference, the second phase difference and the first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field.

[0119] At this time, for the first phase synchronization protocol message, the CF field records the first entry timestamp, the first phase difference, the second phase difference, and the first exit timestamp, which are used as the value of the first correction field (denoted as CF1). For the second phase synchronization protocol message, the value of the second correction field (denoted as CF2) is determined based on the second entry timestamp, the third phase difference, the fourth phase difference, and the second exit timestamp.

[0120] According to the above CF1, CF2, adopt Figure 1 The time synchronization method and formulas (1) to (4) shown calculate the phase difference between the slave network element and the master network element.

[0121] Step 350: Correct the time information of the current network element according to the phase difference.

[0122] The time information of the time information management module is adjusted according to the phase difference between the slave network element and the master network element, thereby completing the time synchronization between the master network element and the slave network element.

[0123] In an exemplary embodiment, Figure 4 A flowchart of another time synchronization method provided in an embodiment of the present application is as follows: Figure 4 As shown, the method includes:

[0124] Step 401: The time information publishing module requests time information from the time information management module, and periodically synchronizes the time information to the transmission delay compensation module and the phase difference measurement compensation module.

[0125] In an embodiment of the present application, each network element on the network topology has a time information management module for maintaining and managing the time information of the network element. The time information publishing module periodically requests time information from the time information management module, and periodically synchronizes the time information to the transmission delay compensation module and / or the phase difference measurement compensation module, thereby ensuring the synchronization of time information between various modules on the network element. For example, if both the master network element and the slave network element have a transmission delay compensation module and a phase difference measurement compensation module, the time information publishing module synchronizes the time information to the transmission delay compensation module and the phase difference measurement compensation module. For intermediate network elements, the time information publishing module synchronizes the time information to the phase difference measurement compensation module.

[0126] Step 402: The phase difference measurement and compensation module measures the phase difference between two adjacent network elements in real time.

[0127] Exemplarily, the phase difference measurement and compensation module measures the phase difference between the network elements at both ends of the link in real time according to the time information recorded in the module. Between adjacent network elements, the phase difference measurement and compensation module measures the phase difference between the network elements at both ends of the link according to the time information stored locally, Δ1 = T 对端 -T 本地 , and save it to the phase difference measurement compensation module.

[0128] Step 403: When a PTP Master port or a PTP Slave port is configured on the network element and the PTP function is enabled, the protocol message control module sends a PTP message.

[0129] Step 404: When the PTP message enters the transmission delay compensation module of the primary network element, a first entry timestamp is added to the PTP message according to the time information stored in the module.

[0130] For example, in the master network element, when the PTP message enters the transmission delay compensation module of the network element, the transmission delay compensation module, at the entry of the module, according to the time information stored in the module, stamps the entry timestamp T1 as the first entry timestamp, and records the information of the first entry timestamp to the setting field of the message. The setting field may be a CF field, that is, after the PTP message passes through the transmission delay compensation module, the CF field is -T1.

[0131] Step 405: The phase difference measurement and compensation module detects the PTP message, and adds the first phase difference between adjacent network elements stored in the module to the PTP message.

[0132] Exemplarily, in the master network element, after the PTP message passes through the transmission delay compensation module, it is forwarded and processed by the network element memory and reaches the phase difference measurement compensation module. The phase difference measurement compensation module updates the CF field according to the phase difference Δ1 between adjacent network elements stored in the module. At this time, the CF field is -T1+Δ1.

[0133] Step 406: The intermediate network element adds a second phase difference value PTP message, and forwards the PTP message including the first inlet timestamp, the first phase difference, and the second phase difference to the slave network element.

[0134] For example, the PTP message is forwarded through the TC network element. In the sending direction, the phase difference measurement and compensation module adjusts the CF field according to the second phase difference Δ2 stored in the module. The CF field is -T1+Δ1+Δ2.

[0135] Optionally, the PTP message sent by the master network element is forwarded to the slave network element through two or more TC network elements. Each time it passes through a TC network element, the phase difference measurement compensation module in the TC network element adjusts the CF field according to the second phase difference stored in the module. Assuming that the PTP message sent by the master network element is forwarded through three TC network elements, the CF field is -T1+Δ1+Δ2+Δ3+Δ4.

[0136] Step 407, the PTP message transmission reaches the slave network element, the transmission delay compensation module of the slave network element detects the PTP message, adds the first egress timestamp to the PTP message, forwards the PTP message to the phase synchronization processing module, and obtains the value of the first correction field.

[0137] Exemplarily, the PTP message is forwarded to the slave network element through the TC network element, and then forwarded to the transmission delay compensation module through the internal module. The transmission delay compensation module, at the module exit, stamps the exit timestamp T2 according to the time information stored in the module, records it as the first exit timestamp, and records the information of the first exit timestamp to the setting field of the message. At this time, the CF field is T2-T1+Δ1+Δ2, that is, CF1=T2-T1+Δ1+Δ2.

[0138] When the PTP message is forwarded through a TC network element, Δ1 is the phase difference between the master network element and the TC network element, and Δ2 is the phase difference between the TC network element and the slave network element. Then, Δ=Δ1+Δ2 is equivalent to the phase difference between the master network element and the slave network element, that is, Δ=T Slave -T Master Therefore, T2-T1+Δ is the complete delay of the PTP message on the one-way transmission link between the master network element and the slave network element.

[0139] Step 408: When the PTP message enters the transmission delay compensation module of the slave network element, a second entry timestamp is added to the PTP message according to the time information stored in the module.

[0140] Step 409: The phase difference measurement and compensation module detects the PTP message, and adds the third phase difference between adjacent network elements stored in the module to the PTP message.

[0141] Step 410: The intermediate network element adds a fourth phase difference value PTP message, and forwards the PTP message including the second inlet timestamp, the third phase difference and the fourth phase difference to the primary network element.

[0142] Step 411: When the PTP message transmission reaches the master network element, the transmission delay compensation module of the master network element detects the PTP message and adds the second egress timestamp to the PTP message. At this time, the value of the second correction field in the PTP message is determined by the second ingress timestamp, the third phase difference, the fourth phase difference and the second egress timestamp.

[0143] Step 412: Obtain the value of the second correction field in the PTP message sent by the primary network element.

[0144] If T4, T3, Δ3, and Δ4 are used to represent the second egress timestamp, the second ingress timestamp, the third phase difference, and the fourth phase difference, respectively, the value of the correction field CF2 can be expressed as CF2 = T4-T3+Δ3+Δ4. Therefore, T4-T3+Δ3+Δ4 is ​​the complete delay of the PTP message on the unidirectional transmission link from the network element to the master network element. Based on the content recorded in the CF1 and CF2 fields, seamless compensation of the entire path delay on the link can be achieved.

[0145] Step 413: Calculate the phase difference based on the value CF1 of the first correction field and the value CF2 of the second correction field, and adjust the time of the time information management module according to the phase difference.

[0146] The embodiment of the present application provides a time synchronization method, which realizes end-to-end seamless compensation on the entire link, thereby ensuring that the final phase synchronization result is not affected by asymmetry such as transmission jitter on the link, thereby improving the phase synchronization accuracy.

[0147] Figure 5 This is a structural block diagram of a time synchronization device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0148] The protocol message control module 510 is used to detect the triggering of a time synchronization event, send out a first phase synchronization protocol message, and obtain the value of the second correction field in the second phase synchronization protocol message;

[0149] The transmission delay compensation module 520 is used to add a first ingress timestamp to the first phase synchronization protocol message, and, when receiving a second phase synchronization protocol message sent from a network element, add a second egress timestamp to the second phase synchronization protocol message;

[0150] The phase difference measurement compensation module 530 is used to add a first phase difference to the first phase synchronization protocol message, and send the first phase synchronization protocol message to the slave network element.

[0151] In an exemplary embodiment, the protocol message control module is used to detect a time synchronization event trigger, send a first phase synchronization protocol message to a slave network element, and parse the second phase synchronization protocol message to obtain a value of a second correction field;

[0152] a transmission delay compensation module, configured to add a first ingress timestamp to the first phase synchronization protocol message, and, upon receiving a second phase synchronization protocol message sent from a network element, to add a second egress timestamp to the second phase synchronization protocol message;

[0153] The phase difference measurement and compensation module is used to add a first phase difference to the first phase synchronization protocol message and send the first phase synchronization protocol message to the slave network element.

[0154] In an exemplary embodiment, upon detecting a time synchronization event trigger, the protocol message control module sends a first phase synchronization protocol message;

[0155] The transmission delay compensation module determines a first inlet timestamp of the first phase synchronization protocol message, and adds the first inlet timestamp to the first phase synchronization protocol message;

[0156] The phase difference measurement compensation module obtains the first phase difference between the current network element and the adjacent intermediate network element or the slave network element, adds the first phase difference to the first phase synchronization protocol message, and forwards the first phase synchronization protocol message containing the first entry timestamp and the first phase difference to the slave network element.

[0157] In an exemplary embodiment, the transmission delay compensation module determines a second egress timestamp of the second phase synchronization protocol message, and adds the second egress timestamp to the second phase synchronization protocol message.

[0158] In an exemplary embodiment, the time information publishing module periodically obtains the inter-module transmission delay and the time information of the time information management module, and synchronizes the time information to the transmission delay compensation module and the phase difference measurement compensation module according to the inter-module transmission delay.

[0159] In an exemplary embodiment, it further includes:

[0160] Before adding the first phase difference to the first phase synchronization protocol message, the phase difference measurement compensation module calculates the first phase difference between the current network element and the adjacent network element based on the time information in the module, wherein the adjacent network element includes an intermediate network element or a slave network element.

[0161] Figure 6 This is a structural block diagram of another time synchronization device provided in an embodiment of the present application. Figure 6 As shown, the device comprises:

[0162] A first phase difference measurement and compensation module 610, configured to receive a first phase synchronization protocol message, add a second phase difference to the first phase synchronization protocol message, and forward the first phase synchronization protocol message with the second phase difference added to a slave network element;

[0163] The second phase difference measurement and compensation module 620 is configured to receive a second phase synchronization protocol message, add a fourth phase difference to the second phase synchronization protocol message, and forward the second phase synchronization protocol message with the fourth phase difference added to the master network element.

[0164] In an exemplary embodiment, the time information publishing module periodically obtains the inter-module transmission delay and the time information of the time information management module, and synchronizes the time information to the phase difference measurement compensation module according to the inter-module transmission delay.

[0165] In an exemplary embodiment, before receiving the first phase synchronization protocol message, the method further includes:

[0166] The first phase difference measurement and compensation module calculates the second phase difference between the current network element and the adjacent intermediate network element or the slave network element based on the time information in the module;

[0167] The second phase difference measurement and compensation module calculates the fourth phase difference between the current network element and the adjacent intermediate network element or the main network element based on the time information in the module.

[0168] In an exemplary embodiment, adding a second phase difference to the first phase synchronization protocol message includes:

[0169] The first phase difference measurement and compensation module obtains a second phase difference between the current network element and an adjacent intermediate network element or a slave network element, and adds the second phase difference to the first phase synchronization protocol message.

[0170] In an exemplary embodiment, adding a fourth phase difference to the second phase synchronization protocol message includes:

[0171] The second phase difference measurement and compensation module obtains a fourth phase difference between the current network element and an adjacent intermediate network element or a master network element, and adds the fourth phase difference to the second phase synchronization protocol message.

[0172] Figure 7 This is a structural block diagram of another time synchronization device provided in an embodiment of the present application. Figure 7 As shown, the device comprises:

[0173] The protocol message control module 710 is used to send the second phase synchronization protocol message to the master network element;

[0174] A phase difference measurement compensation module 720, configured to add a third phase difference to the second phase synchronization protocol message;

[0175] The transmission delay compensation module 730 is used to receive the first phase synchronization protocol message, add a first egress timestamp to the first phase synchronization protocol message, and add a second ingress timestamp to the second phase synchronization protocol message;

[0176] The phase synchronization processing module 740 is used to obtain the value of the second correction field sent by the master network element, determine the value of the first correction field based on the first inlet timestamp, the first phase difference, the second phase difference and the first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field;

[0177] The time information management module 750 is used to correct the time information of the current network element according to the phase difference.

[0178] In an exemplary embodiment, adding a first egress timestamp to the first phase synchronization protocol message includes:

[0179] The transmission delay compensation module determines a first egress timestamp of the first phase synchronization protocol message, and adds the first egress timestamp to the first phase synchronization protocol message.

[0180] In an exemplary embodiment, sending a second phase synchronization protocol message to a master network element, and adding a second ingress timestamp and a third phase difference to the second phase synchronization protocol message, includes:

[0181] The protocol message control module sends a second phase synchronization protocol message;

[0182] The transmission delay compensation module determines a second inlet timestamp of the second phase synchronization protocol message, and adds the second inlet timestamp to the second phase synchronization protocol message;

[0183] The phase difference measurement compensation module obtains the third phase difference between the current network element and the adjacent intermediate network element or the main network element, adds the third phase difference to the second phase synchronization protocol message, and forwards the second phase synchronization protocol message containing the second entry timestamp and the third phase difference to the main network element.

[0184] In an exemplary embodiment, before adding the third phase difference to the second phase synchronization protocol message, the method further includes:

[0185] The phase difference measurement compensation module calculates the third phase difference between the current network element and the adjacent network element based on the time information in the module, wherein the adjacent network element includes an intermediate network element or a main network element.

[0186] In an exemplary embodiment, the protocol message control module is used to control the sending and receiving of phase synchronization protocol messages. When a PTP port is configured on a network element and the PTP function is enabled, the port will periodically send PTP messages outward; in addition, the protocol message control module is also responsible for analyzing, checking and processing received PTP messages.

[0187] The transmission delay compensation module is used for path delay compensation of the entire transmission link. It is effective on the master network element and the slave network element. The PTP message sent by the protocol message control module is stamped with an entry timestamp and an exit timestamp at the entry of the transmission delay compensation module and the exit of the transmission delay compensation module of the remote slave network element, respectively.

[0188] The phase difference measurement and compensation module is used to measure and compensate the phase difference between adjacent network elements on the entire transmission link. That is, the phase difference measurement and compensation module of the adjacent network element calculates the phase difference with the opposite network element based on the time information stored in the module. When the PTP message passes through the phase difference measurement and compensation module, the phase difference is added to the setting field of the PTP message in the message sending direction.

[0189] The time information publishing module is used to periodically publish the time information of the time information management module to other modules on this network element, including the transmission delay compensation module and the phase difference measurement compensation module, so as to align the time information between the modules in this network element.

[0190] The time information management module is used to manage and maintain the time information within this network element.

[0191] The phase synchronization processing module is effective in the slave network element and is used to parse the timestamp information from the received PTP message, calculate the phase difference between the slave network element and the master network element according to the PTP protocol, and compensate this phase difference to the time information management module of the slave network element, so as to synchronize the phase between the slave network element and the master network element.

[0192] The time synchronization device of the embodiment of the present application realizes end-to-end seamless compensation on the entire link, thereby ensuring that the final phase synchronization result is not affected by asymmetry such as transmission jitter on the link, thereby improving the phase synchronization accuracy.

[0193] In an exemplary embodiment, the phase difference measurement compensation module is integrated with the transmission delay compensation module. Figure 8 A structural block diagram of a master network element or a slave network element provided by an embodiment of the present application in which a phase difference measurement compensation module and a transmission delay compensation module are integrated. Figure 8 As shown, the protocol message control module 810, the transmission delay compensation module 820, the phase difference measurement compensation module 830, the time information publishing module 840, the time information management module 850 and the phase synchronization processing module 860 are integrated on the main control board. When the PTP function is enabled, the protocol message control module 810 sends and receives PTP messages, and when the message passes through the transmission delay compensation module 820 and the phase difference measurement compensation module 830, the timestamp and phase difference compensation processing will be performed respectively, and the compensation result will be filled in the CF field of the PTP message. Finally, the slave network element sends the received PTP message to the phase synchronization processing module 860 of the network element, and calculates the phase difference with the master network element according to the PTP protocol. The phase synchronization processing module of the slave network element corrects the phase difference to the time information management module 850 of the network element, and completes the phase synchronization between the slave network element and the master network element.

[0194] In an exemplary embodiment, the phase difference measurement compensation module and the transmission delay compensation module are separately provided. Fig. 9 This is a structural block diagram of a master network element or a slave network element in which a phase difference measurement compensation module and a transmission delay compensation module are separately provided in an embodiment of the present application. Fig. 9 As shown, the protocol message control module 910, the transmission delay compensation module 920, the time information publishing module 940, the time information management module 950 and the phase synchronization processing module 960 are arranged on the main control board, and the phase difference measurement compensation module 930 is arranged on the interface board. The time information publishing module 940 of the main control board synchronizes the time information stored on the main control board across boards to the phase difference measurement compensation module 930 on the interface board. In the synchronization process of the time information, the transmission delay between modules needs to be considered. That is, the time information publishing module 940 obtains the time information of the transmission delay between modules and the time information management module, and synchronizes the above time information to the phase difference measurement compensation module 930 on the interface board according to the transmission delay between modules. The compensation of the PTP message timestamp and the phase difference is the same as that in the above-mentioned embodiment of the present application, which will not be repeated here. By adopting a split design, the number of docked network elements can be increased, thereby achieving the purpose of capacity expansion.

[0195] In an exemplary implementation, the intermediate network element includes a TC network element main control board and an interface board. Fig.10 This is a structural block diagram of another intermediate network element provided in an embodiment of the present application. Fig.10 As shown, the time information publishing module 1010 and the time information management module 1020 are located on the TC network element main control board, and the first phase difference measurement compensation module 1030 and the second phase difference measurement compensation module 1040 are respectively located on the interface board. Compared with the master network element and the slave network element, the TC network element main control board only has the time information management module 1020 and the time information publishing module 1010. The time information publishing module 1010 periodically synchronizes the time information of the network element to the phase difference measurement compensation module (1030, 1040) of the split interface board. In the synchronization process of the time information, the transmission delay between modules needs to be considered. In addition, it should be noted that when the PTP message passes through the main control board of the TC network element, the message is only forwarded, and the message is not modified.

[0196] In an exemplary implementation, the intermediate network element includes a TC network element main control board, and the TC network element main control board includes a time information publishing module, a time information management module, and a phase difference measurement compensation module. Fig.11 This is a schematic diagram of the structure of another intermediate network element provided in an embodiment of the present application. Fig.11 As shown, the time information publishing module 1110, the time information management module 1120, the first phase difference measurement compensation module 1130 and the second phase difference measurement compensation module 1140 are located on the TC network element main control board. The time information management module 1120 manages the time information of the network element and periodically synchronizes the time information of the network element to the phase difference measurement compensation module (1130, 1140) through the time information publishing module 1110.

[0197] The embodiment of the present application also provides a time synchronization system, including:

[0198] A master network element is used to detect the triggering of a time synchronization event, send a first phase synchronization protocol message to a slave network element, and add a first entry timestamp and a first phase difference to the first phase synchronization protocol message; upon receiving a second phase synchronization protocol message sent by the slave network element, add a second exit timestamp to the second phase synchronization protocol message; obtain the value of the second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element.

[0199] A slave network element is used to receive a first phase synchronization protocol message, add a first exit timestamp to the first phase synchronization protocol message; send a second phase synchronization protocol message to a master network element, and add a second entry timestamp and a third phase difference to the second phase synchronization protocol message; obtain the value of a second correction field sent by the master network element; determine the value of the first correction field based on the first entry timestamp, the first phase difference, the second phase difference and the first exit timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field; and correct the time information of the current network element according to the phase difference.

[0200] The embodiment of the present application also provides another time synchronization system, including:

[0201] A master network element is used to detect the triggering of a time synchronization event, send a first phase synchronization protocol message to a slave network element, and add a first entry timestamp and a first phase difference to the first phase synchronization protocol message; upon receiving a second phase synchronization protocol message sent by the slave network element, add a second exit timestamp to the second phase synchronization protocol message; obtain the value of the second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element.

[0202] An intermediate network element is used to receive a first phase synchronization protocol message, add a second phase difference to the first phase synchronization protocol message, and forward the first phase synchronization protocol message with the second phase difference added to the slave network element; receive a second phase synchronization protocol message, add a fourth phase difference to the second phase synchronization protocol message, and forward the second phase synchronization protocol message with the fourth phase difference added to the master network element.

[0203] A slave network element is used to receive a first phase synchronization protocol message, add a first exit timestamp to the first phase synchronization protocol message; send a second phase synchronization protocol message to a master network element, and add a second entry timestamp and a third phase difference to the second phase synchronization protocol message; obtain the value of a second correction field sent by the master network element; determine the value of the first correction field based on the first entry timestamp, the first phase difference, the second phase difference and the first exit timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field; and correct the time information of the current network element according to the phase difference.

[0204] Fig.12 A schematic diagram of PTP message processing in a chain topology of a time synchronization system provided in an embodiment of the present application. After the link between network elements is established, the phase difference measurement and compensation modules at both ends of the link begin to measure the phase difference Δ between the network element and the opposite network element in real time according to the time information of the network element, and save the measurement results in the module.

[0205] like Fig.12As shown, the phase difference between the main network element and the TC network element measured by the phase difference measurement compensation module 1203 is Δ1=T TC -T Master , and the phase difference between the TC network element and the slave network element measured by the phase difference measurement compensation module 1204 is Δ2 = T Slave -T TC .

[0206] The protocol message control module 1201 of the main network element sends a PTP message. When passing through the transmission delay compensation module 1202, the transmission delay compensation module 1202 puts an entry timestamp T1 at the entry. Then the message is sent to the phase difference measurement compensation module 1203 of the main network element to compensate for the phase difference Δ1 at both ends of the link in the sending direction. Both modifications will be compensated to the CF field of the PTP message, recorded as CF1=-T1+Δ1.

[0207] When the PTP message is forwarded through the TC network element, the CF field of the PTP message is modified according to the phase difference Δ2 between the TC network element and the slave network element stored in the first phase difference measurement compensation module 1204 in the sending direction. At this time, the CF field of the PTP message is modified to CF1 = -T1 + Δ1 + Δ2. The PTP message is forwarded through the transmission delay compensation module 1205 of the intermediate network element.

[0208] When the PTP message reaches the slave network element, it passes through the phase difference measurement and compensation module 1206 of the slave network element and reaches the transmission delay compensation module 1207 of the local network element. When the message passes through the transmission delay compensation module 1207 of the slave network element, a T2 timestamp is stamped at the exit, and finally the complete path delay CF1=-T1+Δ1+Δ2+T2 on the link is obtained. Substituting the phase difference between the two ends of the link calculated above into the formula, CF1=T2-T1+T Slave -T Master ,It can be seen from the formula that the final CF field is equivalent to calculating the link path delay after aligning the time of the slave network element and the master network element.

[0209] The PTP message is sent from the protocol message control module 1208 of the network element. When passing through the transmission delay compensation module 1207, the transmission delay compensation module 1207 puts a second entry timestamp T3 at the entry. Then the message is forwarded to the phase difference measurement compensation module 1206 of the network element through the memory modules, and the phase difference Δ3 at both ends of the link is compensated in the sending direction. Both modifications will be compensated to the CF field of the PTP message, which is recorded as CF2=-T3+Δ3.

[0210] When the PTP message is forwarded through the TC network element, the TC network element compensates the CF field of the PTP message according to the phase difference Δ4 between the TC network element and the master network element stored in the second phase difference measurement and compensation module 1211 in the sending direction. At this time, the CF field of the PTP message is modified to CF2 = -T3 + Δ3 + Δ4. After the PTP message reaches the master network element, it passes through the phase difference measurement and compensation module 1203 of the master network element to reach the transmission delay compensation module 1202 of this network element. When the message passes through the transmission delay compensation module 1202 of the slave network element, the second exit timestamp T4 will be stamped at the exit, and finally the complete path delay CF2 = -T3 + Δ3 + Δ4 + T4 on the link is obtained. Subsequently, the master network element sends the value of CF2 to the slave network element.

[0211] The phase synchronization processing module 1209 calculates the phase difference between the slave network element and the master network element based on CF1 and CF2 according to the standard PTP protocol, and corrects the phase difference to the time information management module 1210 of the network element to achieve phase synchronization with the master network element.

[0212] The embodiment of the present application also provides a storage medium of executable instructions, and the computer executable instructions are configured to execute a time synchronization method when executed by a computer processor, the method comprising: detecting a time synchronization event trigger, sending a first phase synchronization protocol message to a slave network element, and adding a first entry timestamp and a first phase difference to the first phase synchronization protocol message;

[0213] Upon receiving a second phase synchronization protocol message sent from a network element, adding a second egress timestamp to the second phase synchronization protocol message;

[0214] Obtaining a value of a second correction field in a second phase synchronization protocol message, and sending the value of the second correction field to the slave network element;

[0215] receiving a first phase synchronization protocol message, and adding a first egress timestamp to the first phase synchronization protocol message;

[0216] Sending a second phase synchronization protocol message to the master network element, and adding a second entry timestamp and a third phase difference to the second phase synchronization protocol message;

[0217] Obtaining the value of the second correction field sent by the primary network element;

[0218] Determine a value of a first correction field based on a first inlet timestamp, a first phase difference, a second phase difference and a first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field;

[0219] The time information of the current network element is corrected according to the phase difference.

[0220] Alternatively, the time synchronization method may further include: receiving a first phase synchronization protocol message, adding a second phase difference to the first phase synchronization protocol message, and forwarding the first phase synchronization protocol message with the second phase difference added to a slave network element;

[0221] A second phase synchronization protocol message is received, a fourth phase difference is added to the second phase synchronization protocol message, and the second phase synchronization protocol message with the fourth phase difference added is forwarded to the master network element.

[0222] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.

[0223] In general, various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof. For example, some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software that can be executed by a controller, microprocessor or other computing device, although the present application is not limited thereto.

[0224] Embodiments of the present application may be implemented by executing computer program instructions by a data processor of a mobile device, for example in a processor entity, or by hardware, or by a combination of software and hardware. The computer program instructions may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages.

[0225] The block diagram of any logic flow in the accompanying drawings of the present application can represent program steps, or can represent interconnected logic circuits, modules and functions, or can represent a combination of program steps and logic circuits, modules and functions. The computer program can be stored in a memory. The memory can have any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical memory device and system (digital versatile disc DVD or CD disc), etc. Computer-readable media may include non-transient storage media. The data processor can be any type suitable for the local technical environment, such as but not limited to a general-purpose computer, a special-purpose computer, a microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (FGPA) and a processor based on a multi-core processor architecture.

[0226] By way of exemplary and non-limiting examples, a detailed description of exemplary embodiments of the present application has been provided above. However, various modifications and adjustments to the above embodiments will be apparent to those skilled in the art when considered in conjunction with the accompanying drawings and claims, but will not depart from the scope of the present invention. Therefore, the proper scope of the present invention will be determined according to the claims.

Claims

1. A time synchronization method, characterized in that: include: When a time synchronization event is detected to be triggered, a first phase synchronization protocol message is sent to the slave network element, and a first entry timestamp and a first phase difference are added to the first phase synchronization protocol message; wherein the first entry timestamp is determined according to the time when the transmission delay compensation module of the master network element detects the first phase synchronization protocol message; the first phase difference is the phase difference between the master network element and the adjacent intermediate network element or slave network element measured by the phase difference measurement compensation module of the master network element; When receiving a second phase synchronization protocol message sent from the slave network element, adding a second egress timestamp to the second phase synchronization protocol message; the second egress timestamp is determined according to the time when the second phase synchronization protocol message leaves the transmission delay compensation module of the master network element; Obtaining a value of a second correction field in the second phase synchronization protocol message, and sending the value of the second correction field to the slave network element; wherein the second correction field is a CF field; the value of the second correction field is determined based on a second entry timestamp, a third phase difference, a fourth phase difference, and a second exit timestamp; the second entry timestamp is determined according to the time when the second phase synchronization protocol message passes through the entry of the transmission delay compensation module of the slave network element; The method also includes: the phase difference measurement and compensation module of the slave network element calculates the third phase difference between the current network element and the adjacent intermediate network element or the main network element based on the time information in the module; the second phase difference measurement and compensation module of the intermediate network element calculates the fourth phase difference between the current network element and the adjacent intermediate network element or the main network element based on the time information in the module.

2. The method according to claim 1, characterized in that Detecting a time synchronization event trigger, sending a first phase synchronization protocol message to a slave network element, and adding a first entry timestamp and a first phase difference to the first phase synchronization protocol message, including: Upon detecting a time synchronization event trigger, the protocol message control module sends a first phase synchronization protocol message; The transmission delay compensation module of the master network element determines a first ingress timestamp of the first phase synchronization protocol message, and adds the first ingress timestamp to the first phase synchronization protocol message; The phase difference measurement compensation module of the master network element obtains the first phase difference between the current network element and the adjacent intermediate network element or slave network element, adds the first phase difference to the first phase synchronization protocol message, and forwards the first phase synchronization protocol message containing the first entry timestamp and the first phase difference to the slave network element.

3. The method according to claim 1, characterized in that Adding a second egress timestamp to the second phase synchronization protocol message includes: The transmission delay compensation module of the master network element determines a second egress timestamp of the second phase synchronization protocol message, and adds the second egress timestamp to the second phase synchronization protocol message.

4. The method according to claim 2, characterized in that: Also includes: The time information publishing module of the master network element periodically obtains the time information of the inter-module transmission delay and the time information management module, and synchronizes the time information to the transmission delay compensation module of the master network element and the phase difference measurement compensation module of the master network element according to the inter-module transmission delay.

5. The method according to claim 4, characterized in that Before adding the first phase difference to the first phase synchronization protocol message, the method further includes: The phase difference measurement compensation module of the master network element calculates the first phase difference between the current network element and the adjacent network element based on the time information in the module, wherein the adjacent network element includes an intermediate network element or a slave network element.

6. A time synchronization method, characterized in that: include: receiving a first phase synchronization protocol message, adding a second phase difference to the first phase synchronization protocol message, and forwarding the first phase synchronization protocol message with the second phase difference added to a slave network element; receiving a second phase synchronization protocol message, adding a fourth phase difference to the second phase synchronization protocol message, and forwarding the second phase synchronization protocol message with the fourth phase difference added to the master network element; The master network element is used to obtain the value of the second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element; wherein the second correction field is a CF field; the value of the second correction field is determined based on the second entry timestamp, the third phase difference, the fourth phase difference and the second exit timestamp; the second entry timestamp is determined according to the time when the second phase synchronization protocol message passes through the entry of the transmission delay compensation module of the slave network element; before receiving the first phase synchronization protocol message, it also includes: The phase difference measurement and compensation module of the slave network element calculates the third phase difference between the current network element and the adjacent intermediate network element or the master network element based on the time information in the module; the first phase difference measurement and compensation module of the intermediate network element calculates the second phase difference between the current network element and the adjacent intermediate network element or the slave network element based on the time information in the module; The second egress timestamp is determined according to the time when the second phase synchronization protocol message leaves the transmission delay compensation module of the master network element; The second phase difference measurement and compensation module calculates the fourth phase difference between the current network element and the adjacent intermediate network element or the main network element based on the time information in the module.

7. The method according to claim 6, characterized in that Also includes: The time information publishing module periodically obtains the inter-module transmission delay and the time information of the time information management module, and synchronizes the time information to the phase difference measurement compensation module according to the inter-module transmission delay.

8. The method according to claim 6, characterized in that Adding a second phase difference to the first phase synchronization protocol message includes: The first phase difference measurement and compensation module obtains a second phase difference between the current network element and an adjacent intermediate network element or a slave network element, and adds the second phase difference to the first phase synchronization protocol message.

9. The method according to claim 6, characterized in that Adding a fourth phase difference to the second phase synchronization protocol message includes: The second phase difference measurement and compensation module obtains a fourth phase difference between the current network element and an adjacent intermediate network element or a master network element, and adds the fourth phase difference to the second phase synchronization protocol message.

10. A time synchronization method, characterized in that: include: receiving a first phase synchronization protocol message, and adding a first egress timestamp to the first phase synchronization protocol message; The first egress timestamp is determined according to the time when the first phase synchronization protocol message leaves the transmission delay compensation module of the slave network element; Sending a second phase synchronization protocol message to the master network element, and adding a second entry timestamp and a third phase difference to the second phase synchronization protocol message; the second entry timestamp is determined according to the time when the second phase synchronization protocol message passes through the entry of the transmission delay compensation module of the slave network element; Obtain a value of a second correction field sent by the primary network element; wherein the second correction field is a CF field; The value of the first correction field is determined based on the first inlet timestamp, the first phase difference, the second phase difference and the first outlet timestamp, and the phase difference is calculated according to the value of the first correction field and the value of the second correction field; the first inlet timestamp is determined according to the time when the transmission delay compensation module of the master network element records the detection of the first phase synchronization protocol message; the first phase difference is the phase difference between the master network element and the adjacent intermediate network element measured by the phase difference measurement and compensation module of the master network element; Correct the time information of the current network element according to the calculated phase difference; The method also includes: the phase difference measurement and compensation module of the slave network element calculates the third phase difference between the current network element and the adjacent intermediate network element or the master network element based on the time information in the module; the first phase difference measurement and compensation module of the intermediate network element calculates the second phase difference between the current network element and the adjacent intermediate network element or the slave network element based on the time information in the module.

11. The method according to claim 10, characterized in that Adding a first egress timestamp to the first phase synchronization protocol message includes: A transmission delay compensation module of the slave network element determines a first egress timestamp of the first phase synchronization protocol message, and adds the first egress timestamp to the first phase synchronization protocol message.

12. The method according to claim 10, characterized in that Sending a second phase synchronization protocol message to the master network element, and adding a second entry timestamp and a third phase difference to the second phase synchronization protocol message, including: The protocol message control module sends a second phase synchronization protocol message; Determine a second ingress timestamp of the second phase synchronization protocol message from a transmission delay compensation module of the network element, and add the second ingress timestamp to the second phase synchronization protocol message; Obtain the third phase difference between the current network element and the adjacent intermediate network element or the main network element from the phase difference measurement compensation module of the network element, add the third phase difference to the second phase synchronization protocol message, and forward the second phase synchronization protocol message containing the second entry timestamp and the third phase difference to the main network element.

13. The method according to claim 10, characterized in that Before adding the third phase difference to the second phase synchronization protocol message, the method further includes: The phase difference measurement compensation module of the slave network element calculates the third phase difference between the current network element and the adjacent network element based on the time information in the module, wherein the adjacent network element includes an intermediate network element or a master network element.

14. A time synchronization device, characterized in that: include: The protocol message control module of the master network element is used to detect the triggering of a time synchronization event, send out a first phase synchronization protocol message, and obtain the value of the second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element; a transmission delay compensation module of the master network element, configured to add a first ingress timestamp to the first phase synchronization protocol message, and, upon receiving a second phase synchronization protocol message sent by the slave network element, to add a second egress timestamp to the second phase synchronization protocol message; A phase difference measurement and compensation module of a master network element, configured to add a first phase difference to the first phase synchronization protocol message, and send the first phase synchronization protocol message to a slave network element; wherein the second correction field is a CF field; and the value of the second correction field is determined based on a second entry timestamp, a third phase difference, a fourth phase difference, and a second exit timestamp; Among them, the first ingress timestamp is determined according to the time when the transmission delay compensation module of the master network element detects the first phase synchronization protocol message; the first phase difference is the phase difference between the master network element and the adjacent intermediate network element or slave network element measured by the phase difference measurement and compensation module of the master network element; the second egress timestamp is determined according to the time when the second phase synchronization protocol message leaves the transmission delay compensation module of the master network element; the second ingress timestamp is determined according to the time when the second phase synchronization protocol message passes through the inlet of the transmission delay compensation module of the slave network element; The third phase difference is the phase difference between the current network element and the adjacent intermediate network element or the master network element calculated by the phase difference measurement and compensation module of the slave network element based on the time information in the module; The fourth phase difference is the phase difference between the current network element and the adjacent intermediate network element or the main network element calculated by the second phase difference measurement compensation module of the intermediate network element based on the time information in the module.

15. A time synchronization device, characterized in that: include: A first phase difference measurement and compensation module of the intermediate network element, configured to receive a first phase synchronization protocol message, add a second phase difference to the first phase synchronization protocol message, and forward the first phase synchronization protocol message with the second phase difference added to the slave network element; The second phase difference measurement and compensation module of the intermediate network element is used to receive a second phase synchronization protocol message, add a fourth phase difference to the second phase synchronization protocol message, and forward the second phase synchronization protocol message with the fourth phase difference added to the master network element; wherein the master network element is used to obtain the value of the second correction field in the second phase synchronization protocol message, and send the value of the second correction field to the slave network element; wherein the second correction field is a CF field; the value of the second correction field is determined based on the second entry timestamp, the third phase difference and the fourth phase difference and the second exit timestamp; the second entry timestamp is determined according to the time when the second phase synchronization protocol message passes through the entry of the transmission delay compensation module of the slave network element; before receiving the first phase synchronization protocol message, The third phase difference is the phase difference between the current network element and the adjacent intermediate network element or the main network element calculated by the phase difference measurement and compensation module of the slave network element based on the time information in the module; A first phase difference measurement and compensation module of the intermediate network element, used to calculate a second phase difference between the current network element and an adjacent intermediate network element or a slave network element based on time information in the module; The second phase difference measurement and compensation module of the intermediate network element is used to calculate the fourth phase difference between the current network element and the adjacent intermediate network element or the main network element based on the time information in the module.

16. A time synchronization device, characterized in that: include: The protocol message control module of the slave network element is used to send the second phase synchronization protocol message to the master network element; A phase difference measurement and compensation module of the slave network element, configured to add a third phase difference to the second phase synchronization protocol message; A transmission delay compensation module of the slave network element, configured to receive a first phase synchronization protocol message, add a first egress timestamp to the first phase synchronization protocol message, and add a second ingress timestamp to the second phase synchronization protocol message; The phase synchronization processing module of the slave network element is used to obtain the value of the second correction field sent by the master network element, determine the value of the first correction field based on the first inlet timestamp, the first phase difference, the second phase difference and the first outlet timestamp, and calculate the phase difference according to the value of the first correction field and the value of the second correction field; wherein the second correction field is a CF field; The time information management module of the slave network element is used to correct the time information of the current network element according to the calculated phase difference; Among them, the first egress timestamp is determined according to the time when the first phase synchronization protocol message leaves the transmission delay compensation module of the slave network element; the second ingress timestamp is determined according to the time when the second phase synchronization protocol message passes through the ingress of the transmission delay compensation module of the slave network element; the first ingress timestamp is determined according to the time when the transmission delay compensation module of the master network element records the detection of the first phase synchronization protocol message; the first phase difference is the phase difference between the master network element and the adjacent intermediate network element measured by the phase difference measurement and compensation module of the master network element; A phase difference measurement and compensation module of a slave network element, used to calculate a third phase difference between a current network element and an adjacent intermediate network element or a master network element based on time information in the module; The second phase difference is the phase difference between the current network element and the adjacent intermediate network element or slave network element calculated by the first phase difference measurement compensation module of the intermediate network element based on the time information in the module.

17. A time synchronization system, characterized in that: include: Master network element and slave network element; The master network element executes the method according to any one of claims 1 to 5, and the slave network element executes the method according to any one of claims 10 to 13.

18. A time synchronization system, characterized in that: include: Master network element, intermediate network element and slave network element; The master network element executes the method according to any one of claims 1-5, the intermediate network element executes the method according to any one of claims 6-9, and the slave network element executes the method according to any one of claims 10-13.

19. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • High precision clock synchronization method, module, equipment and system for timing system

    CN106130681A

  • Time synchronization error compensation method for multi-hop wireless backhaul network based on ptp

    US20170366287A1