WO2012151808A1 - Method and system for improving synchronization precision based on precision time protocol - Google Patents

Method and system for improving synchronization precision based on precision time protocol Download PDF

Info

Publication number
WO2012151808A1
WO2012151808A1 PCT/CN2011/078997 CN2011078997W WO2012151808A1 WO 2012151808 A1 WO2012151808 A1 WO 2012151808A1 CN 2011078997 W CN2011078997 W CN 2011078997W WO 2012151808 A1 WO2012151808 A1 WO 2012151808A1
Authority
WO
WIPO (PCT)
Prior art keywords
delay
module
hardware
measurement
packet
Prior art date
Application number
PCT/CN2011/078997
Other languages
French (fr)
Chinese (zh)
Inventor
万娟
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012151808A1 publication Critical patent/WO2012151808A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0685Clock or time synchronisation in a node; Intranode synchronisation
    • H04J3/0697Synchronisation in a packet node

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and system for improving synchronization accuracy based on an accurate clock protocol (Precision Clock Protocol) of IEEE 1588 (accurate clock synchronization protocol standard for network measurement and control systems).
  • Precision Clock Protocol an accurate clock protocol
  • IEEE 1588 accurate clock synchronization protocol standard for network measurement and control systems
  • the Accurate Clock Protocol is a distributed Ethernet accurate synchronous clock protocol defined by IEEE1588. It can realize the synchronization between various systems by using widely used and low-cost Ethernet, which greatly reduces the cost of system clock synchronization. Its synchronization accuracy can reach microseconds.
  • the precision clock protocol draws on NTP technology and features easy configuration, fast convergence, and low network bandwidth and resource consumption. Its main synchronization principle is to periodically synchronize the clocks of all nodes in the network through a synchronization signal, so that the Ethernet-based distributed system can be accurately synchronized, and the precise clock protocol clock synchronization technology can be applied to any group. Broadcast in the network.
  • precise clock protocol synchronization includes the recording of time-issued and received time information (such precise clock protocol time information frames are also called 1588 messages or precise clock protocol messages), and a "time stamp" is added to each message.
  • the system's top-level clock (grandmaster clock) defines the overall reference source for the system. With time recording, the slave's slave clock can calculate its own clock error and delay in the network, thus making clock adjustments and synchronizing its own clock. Go to the system top level clock for synchronization purposes.
  • the synchronization accuracy of the precise clock protocol message is closely related to the time stamp and the time information.
  • the timestamp should be generated as close as possible to the physical layer, which can make the generated timestamp more accurate Reflects the delivery time of the message and adds the timestamp to the subsequent message sent.
  • different timestamp points may be selected according to actual conditions, for example, the hardware layer, the software driver layer or the software application layer may be selected as a time stamp point.
  • the most accurate method is to detect the accurate clock protocol message at the hardware layer and stamp the time stamp. Because the accuracy of the software layer stamping time is also related to the timing characteristics and load of the software operating system, the software timing is not as accurate as the hardware timing. Therefore, the current common practice of improving the synchronization accuracy of the system is as follows: The media independent interface (Media Independent Interface, ⁇ ) between the MAC layer and the physical layer chip is used as the time stamping time of the time stamp. The accuracy of the synchronization accuracy of this method depends on the timing characteristics and transmission delay characteristics of the physical layer chip.
  • Media Independent Interface Media Independent Interface
  • the transmission delay of the hardware layer is relatively fixed relative to the delay of the software layer.
  • existing schemes generally calculate the hardware layer transmission delay as a fixed value.
  • the hardware layer's transmission delay is not completely fixed. This is because the hardware may be upgraded or modified, so that the hardware delay after the change is not the same as the delay before the change.
  • the hardware itself also exists.
  • the delay of the second level fluctuates, so the hardware delay is not completely fixed. Since the fluctuation of the hardware layer transmission delay is neglected in the prior art, there is a certain influence on the final synchronization accuracy. Summary of the invention
  • the main technical problem to be solved by the present invention is to provide a method and system for improving synchronization accuracy based on an accurate clock protocol, which can perform corresponding delay compensation according to a real-time measured delay value and an extracted time stamp, thereby improving an accurate clock. Synchronization accuracy of protocol packets.
  • a system for improving synchronization accuracy based on an accurate clock protocol including:
  • the delay measurement module is configured to measure the delay value of the message passing through the hardware delay module in real time and send it to the delay compensation module;
  • a clock extraction module configured to: when determining that the packet is a precise clock protocol packet, extract a time stamp stamped by the precise clock protocol packet before entering the hardware delay module, and send the time stamp to the The delay compensation module;
  • the delay compensation module is configured to perform corresponding delay compensation according to the received delay value and the time stamp.
  • the system further includes a physical layer message transmission module and a media independent interface module, where the physical layer message transmission module is configured to receive the message from the Ethernet, and transmit the message to the device through the media independent interface module.
  • the hardware delay module is configured to delay the physical layer message transmission module.
  • the delay compensation module includes an interface communication unit and a delay compensation unit.
  • the interface communication unit is respectively connected to the delay measurement module and the clock extraction module, and configured to receive the delay value and the time stamp.
  • the delay compensation unit is configured to perform corresponding delay compensation according to the delay value and the time stamp.
  • the hardware delay module, the clock extraction module, and the delay measurement module are integrated in the same FPGA.
  • the hardware delay module is a first in first out module.
  • the delay measurement module is a counter.
  • the clock extraction module is a media access control module with a timestamp management function.
  • a method for improving synchronization accuracy based on an accurate clock protocol including:
  • the time delay value of the packet passing through the hardware delay node is measured in real time; when the packet is an accurate clock protocol packet, the time stamp stamped by the precise clock protocol packet before entering the hardware delay node is extracted;
  • Corresponding delay compensation is performed according to the delay value and the time stamp.
  • the method further includes: determining whether the physical layer receives the packet.
  • the process of the delay value of the real-time measurement message passing through the hardware delay node includes: marking the measurement start point signal as the measurement starting point of the delay value when the message enters the hardware delay node And, when the message is out of the hardware delay node, the tag measurement An end point signal, as a measurement end point of the delay value;
  • the delay value is calculated based on the measurement start point and the measurement end point.
  • the beneficial effects of the present invention are: performing real-time measurement of the delay value of a precise clock protocol message through a hardware delay node, and the extracted time stamp of the precise clock protocol message before entering the hardware delay node Ground delay compensation. Since the delay value generated by the precise clock protocol packet through different hardware delay modules is dynamically changed, the delay value measured by applying the present invention is more accurate, so that the accurate clock protocol message obtained according to the measurement can pass through a certain The precise delay value of the hardware delay node and the extracted time stamp adjust the corresponding time stamp, which improves the synchronization precision of the accurate clock protocol message compared with the prior art.
  • Figure 1 is a schematic view showing the structure of the system of the present invention
  • FIG. 2 is a schematic structural diagram of a system according to an embodiment of the present invention.
  • Figure 3 is a flow chart of the method of the present invention.
  • the transmission delay of the hardware layer is relatively fixed. Therefore, the PTP packets are stamped on the media independent interface. After the stamping and transmission at the hardware layer, the transmission delay value of the hardware layer is calculated as a fixed value.
  • the present invention proposes a method and system for improving synchronization accuracy based on an accurate clock protocol.
  • the main idea of the present invention is: Since the delay values of different PTP packets passing through the same hardware node may be different, the delay values of the same PTP packet passing through different hardware nodes may be different, and the same hardware The point in time at which the hardware delay fluctuation occurs in the node is uncertain.
  • the present invention proposes a system for improving synchronization accuracy based on an accurate clock protocol.
  • the system 1 includes a hardware delay module 11, a delay measurement module 12, a clock extraction module 13 and a delay compensation module 14.
  • the hardware delay module 11 is configured to transmit packets on the packet transmission and reception path, and perform clock domain conversion on the packet to ensure that the locally obtained data is reliable. Since the hardware delay module is a delay indeterminate module, the transmission delay generated when the message passes through the hardware delay module is also uncertain.
  • the function of the delay measurement module 12 is to measure the time taken by the message to enter the hardware delay module 11 and the hardware delay module 11 in real time, that is, the delay value, and transmit the delay value to the delay compensation module 14.
  • the function of the clock extraction module 13 is to extract the time stamped information of the PTP message before entering the hardware delay module 11 when determining that the packet transmitted by the hardware delay module 11 is a PTP message, and This time stamp is transmitted to the delay compensation module 14.
  • the delay compensation module 14 dynamically adjusts the current timestamp of the PTP message output by the hardware delay module according to the received delay value and timestamp, and performs corresponding delay compensation.
  • the delay measurement module performs real-time measurement of the delay value of a PTP message through a hardware delay module, and the time stamp of the PTP message extracted by the clock extraction module before entering the hardware delay module, to perform corresponding delay compensation. . Since the delay value generated by the PTP message through different hardware delay modules is dynamically changed, the system of the present invention is used to measure the delay value in real time. In order to make the measurement of the delay value more accurate. Therefore, the delay compensation module can adjust the timestamp according to the precise delay value of the PTP message through a hardware delay module, and improve the synchronization precision of the PTP message compared with the prior art.
  • the delay value of the PTP packet measured by the present invention is a delay value generated when the PTP packet is time stamped and transmitted on the hardware delay module, and the PTP packet of the present invention enters. Just before the hardware delay module, it has just been stamped with a timestamp. Therefore, the timestamp information extracted by the clock extraction module is a time stamp stamped before the PTP message enters the hardware delay module.
  • the delay compensation module of the present invention can be implemented in a software language and run on a CPU. In this way, the CPU can output the delay measurement module according to the delay value reported by the received delay measurement module and the time stamp reported by the clock extraction module.
  • the current timestamp of the PTP packet is adjusted accordingly to improve the synchronization accuracy of the PTP packet.
  • the functions of the hardware delay module 11, the delay measurement module 12, and the clock extraction module 13 can be implemented by a Field Programmable Gate Array (FPGA).
  • FPGA Field Programmable Gate Array
  • the above three modules are integrated.
  • the FPGA real-time measurement of the transmission delay of the Ethernet layer in the hardware layer can be realized, and the measured delay value and the extracted time stamp are reported together to the delay compensation module, thus eliminating the traditional Delay measuring instruments such as oscilloscopes are simple and convenient to use and low in cost.
  • the delay measurement module of the present invention can be implemented by a hardware language or by a software language, and has high versatility.
  • the system can adapt to the network port rate and realize dynamic delay compensation under 1000M, 100M, and 10M networks. Under 125M working clock, the measurement accuracy of the delay value is 8ns. Moreover, the system can further improve the measurement accuracy of the delay value by increasing the working clock rate.
  • the system further includes a physical layer message transmission module (PHY transmission module) 15 and a media independent interface ( ⁇ interface) module 16.
  • the physical layer message transmission module 15 is configured to perform a packet received from the Ethernet through a media independent interface.
  • Block 16 is transmitted to hardware delay module 11 in the FPGA.
  • the physical layer packet transmission module receives the packet from the physical layer and adds a timestamp to the media independent interface module, so that the packet timestamp is generated as close as possible to the physical layer, and the packet transmission is more accurately reflected. time.
  • the delay compensation module 14 includes an interface communication unit 141 and a delay compensation unit 142.
  • the interface communication unit 141 is connected to the delay measurement module 12 and the clock extraction module 13, respectively, for receiving the transmitted delay value and time stamp, and transmitting it to the delay compensation unit 142.
  • the delay compensation unit 142 is configured to implement an accurate clock protocol and complete the synchronization process. Specifically, according to the acquired delay value and time stamp, the data is processed according to an accurate clock protocol, and the PTP report output by the hardware delay module is dynamically adjusted. The current timestamp of the text, corresponding delay compensation, to achieve clock synchronization. For example, the time stamp of the extracted PTP message plus the measured delay value can be used as the current time stamp of the PTP message output by the hardware delay module.
  • the hardware delay module refers to a module that generates delay fluctuations when a message passes, such as a first-in first-out FIFO module, and of course, other transmissions.
  • a delayed hardware module is generated when the message is sent.
  • the clock extraction module marks the message entering the FIFO module, that is, the measurement start signal when the message enters the FIFO module, and the measurement end point signal when the message output FIFO module is marked, and transmits the two signals to Delay measurement module.
  • the delay measurement module can be a counter. Specifically, the counter uses the received measurement start signal as the measurement starting point of the delay value, and uses the measurement end point signal as the measurement end point of the delay value, and passes the phase difference between the two signals by itself. Count, to calculate the delay value.
  • the delay value thus calculated accurately reflects the transmission time of the PTP message through the FIFO module, so that an accurate delay value can be obtained in the subsequent clock synchronization process.
  • the clock extraction module is a media access control MAC module with a timestamp management function.
  • the MAC module is configured to implement parsing of PTP packets, obtain timestamps, and complete transmission and reception of time-stamped packets according to the communication standard IEEE802.3, and transmit the extracted timestamps to the delay compensation module.
  • the MAC module with timestamp management starts to detect whether the FIFO module receives the message. After confirming the receipt of the message, not only the corresponding flag message enters the measurement start signal/measurement end point signal of the FIFO module/out FIFO module. At the same time, it is determined whether the packet is a PTP packet. If yes, the MAC module needs to process the packet and extract timestamp and other information. The information such as the measured delay value and the extracted time stamp is reported to the delay compensation unit through the communication interface unit, and the delay compensation unit calls the CPU resource according to the delay value obtained by the real-time measurement and the extracted time stamp, and further Corresponding delay compensation is performed to improve the synchronization performance of PTP packets.
  • the present invention also provides a method for improving synchronization accuracy based on an accurate clock protocol, including the following steps:
  • the real-time measurement packet passes the delay value of the hardware delay node. Meanwhile, if the packet is determined to be a precise clock protocol packet (PTP packet), the PTP packet is extracted and inserted into the hardware delay node. Timestamp
  • the dynamic delay compensation of PTP packets can be performed according to the timestamp of the PTP packet and the delay value obtained by real-time measurement.
  • the delay value of the hardware layer obtained by the invention is closer to the true delay value of the PTP message, so that the subsequent delay compensation processing is more accurate. , improve the synchronization accuracy of PTP messages.
  • the delay value there is a judging step of judging whether a message has passed through the hardware delay node, or it can be said to determine whether the physical layer receives the message. If physics The layer does not receive the packet, that is, it does not need to perform subsequent operations, and continues to detect whether the packet is received.
  • the delay value is measured only after the physical layer receives the packet, and the timestamp and other information are extracted when the packet is a PTP packet. If it is not a PTP packet, no subsequent delay is required. Compensation operation.
  • FIG. 4 it is a flowchart of a method according to an embodiment of the present invention, which is specifically:
  • the packet detects whether the physical layer receives the packet, and if it does not receive the packet, continues to detect. If the packet is received, the received packet is processed, and a measurement is marked when the packet enters the hardware delay node.
  • the start point signal marks a measurement end point signal when the message leaves the hardware delay node.
  • the delay value is calculated, specifically, the measurement start point signal is used as the measurement starting point for calculating the start delay value, and the measurement end point signal is used as the measurement end point calculated by the end delay value, and the delay is calculated according to the measurement start point and the measurement end point. value.
  • the packet of the hardware delay node is a PTP packet, and if it is a PTP packet, the timestamp of the PTP packet is extracted.
  • the current timestamp of the PTP packet is adjusted according to the calculated delay value and the extracted timestamp.
  • the time consumed by the PTP message passing through a certain hardware delay node that is, the delay value
  • the PTP packet enters the timestamp of the hardware delay node and the delay value obtained by the real-time measurement, and performs dynamic delay compensation on the PTP packet outputted by the hardware delay node, thereby improving the synchronization precision of the PTP packet.

Abstract

Disclosed are a system and a method for improving synchronization precision based on a precision time protocol, for measuring in real time a delay value when a packet passes through a hardware delay node. When the packet is a precision time protocol packet, a time stamp pressed before the precision time protocol packet enters the hardware delay node is extracted; and corresponding delay compensation is performed according to the delay value and the time stamp. Compared with the prior art, the delay value measured by using the technical solution of the present invention is more precise, so that the time stamp can be correspondingly adjusted according to the measured precise delay value when the precision time protocol packet passes through the hardware delay node and the extracted time stamp, thereby improving the synchronization precision of the precision time protocol packet.

Description

基于精确时钟协议提高同步精度的方法及系统 技术领域  Method and system for improving synchronization accuracy based on precise clock protocol
本发明涉及通信技术领域,具体而言,尤其涉及一种基于 IEEE1588 (网 络测量和控制系统的精确时钟同步协议标准) 的精确时钟协议 ( Precision Time Protocol, 精确时钟协议)提高同步精度的方法及系统。 背景技术  The present invention relates to the field of communications technologies, and in particular, to a method and system for improving synchronization accuracy based on an accurate clock protocol (Precision Clock Protocol) of IEEE 1588 (accurate clock synchronization protocol standard for network measurement and control systems). . Background technique
精确时钟协议是以 IEEE1588 为标准定义的一种分布式以太网的精确 同步时钟协议, 它能利用应用广泛、 价格低廉的以太网, 实现各个系统之 间的同步, 大大降低系统时钟同步的成本, 其同步精度可以达到微秒级。  The Accurate Clock Protocol is a distributed Ethernet accurate synchronous clock protocol defined by IEEE1588. It can realize the synchronization between various systems by using widely used and low-cost Ethernet, which greatly reduces the cost of system clock synchronization. Its synchronization accuracy can reach microseconds.
精确时钟协议借鉴了 NTP技术, 具有容易配置、 快速收敛以及对网络 带宽和资源消耗少等特点。 它的主要同步原理是, 通过一个同步信号周期 性地对网络中所有节点的时钟进行同步校正, 从而可以使基于以太网的分 布式系统达到精确同步, 精确时钟协议时钟同步技术可以应用于任何组播 网络中。  The precision clock protocol draws on NTP technology and features easy configuration, fast convergence, and low network bandwidth and resource consumption. Its main synchronization principle is to periodically synchronize the clocks of all nodes in the network through a synchronization signal, so that the Ethernet-based distributed system can be accurately synchronized, and the precise clock protocol clock synchronization technology can be applied to any group. Broadcast in the network.
精确时钟协议同步的基本原理包括时间发出和接收时间信息的记录 (这类精确时钟协议时间信息帧又叫 1588报文或精确时钟协议报文), 并 且对每一条信息增加一个 "时间戳"。 系统的顶层时钟(grandmaster时钟) 给系统定义了整体参考源, 有了时间记录, 接收端的从时钟就可以计算出 自己在网络中的时钟误差和延时, 从而进行时钟调整, 将自身的时钟同步 到系统顶层时钟以达到同步的目的。  The basic principles of precise clock protocol synchronization include the recording of time-issued and received time information (such precise clock protocol time information frames are also called 1588 messages or precise clock protocol messages), and a "time stamp" is added to each message. The system's top-level clock (grandmaster clock) defines the overall reference source for the system. With time recording, the slave's slave clock can calculate its own clock error and delay in the network, thus making clock adjustments and synchronizing its own clock. Go to the system top level clock for synchronization purposes.
由此可见, 精确时钟协议报文的同步精确度与时间戳和时间信息紧密 相关, 时间戳的时间越接近真实发送时间, 同步精度就越高。 时间戳的产 生应该尽可能地靠近物理层, 这样可以使得产生的时间戳能够更加准确地 反映报文的传递时间, 并将该时间戳添加到随后发送的跟随报文中。 It can be seen that the synchronization accuracy of the precise clock protocol message is closely related to the time stamp and the time information. The closer the time stamp time is to the real transmission time, the higher the synchronization precision. The timestamp should be generated as close as possible to the physical layer, which can make the generated timestamp more accurate Reflects the delivery time of the message and adds the timestamp to the subsequent message sent.
在基于精确时钟协议的系统实现同步的过程中, 可以根据实际情况, 选择不同的时间戳点, 例如可选择硬件层、 软件驱动层或软件应用层为时 间戳点。 其中最精确的方法是在硬件层检测精确时钟协议报文并加盖时间 戳, 因为软件层加盖时间戳的准确性还跟软件操作系统的计时特性和负载 相关, 软件计时不如硬件计时准确。 所以当前提高系统的同步精度的常见 做法为: 将介于 MAC 层和物理层芯片之间的媒体独立接口(Media Independent Interface , ΜΠ)作为时间戳点的加盖时间。 这种方法的同步精度 的准确性取决于物理层芯片的计时特性和传输延时特性。  In the process of synchronizing the system based on the precise clock protocol, different timestamp points may be selected according to actual conditions, for example, the hardware layer, the software driver layer or the software application layer may be selected as a time stamp point. The most accurate method is to detect the accurate clock protocol message at the hardware layer and stamp the time stamp. Because the accuracy of the software layer stamping time is also related to the timing characteristics and load of the software operating system, the software timing is not as accurate as the hardware timing. Therefore, the current common practice of improving the synchronization accuracy of the system is as follows: The media independent interface (Media Independent Interface, ΜΠ) between the MAC layer and the physical layer chip is used as the time stamping time of the time stamp. The accuracy of the synchronization accuracy of this method depends on the timing characteristics and transmission delay characteristics of the physical layer chip.
相对于软件层的延时来说, 硬件层的传输延时是比较固定的。 目前已 有的方案一般将硬件层传输延时当成固定值来计算。 但实际上, 硬件层的 传输延时也不是完全固定的, 这是因为硬件可能会升级或改动, 从而导致 变动之后的硬件延时与变动之前的延时不相同; 同时硬件本身内部也存在 纳秒级的延时波动, 所以硬件延时并不是完全固定的。 由于现有技术中忽 略了硬件层传输延时的波动, 所以对最后的同步精度会有一定的影响。 发明内容  The transmission delay of the hardware layer is relatively fixed relative to the delay of the software layer. At present, existing schemes generally calculate the hardware layer transmission delay as a fixed value. However, in fact, the hardware layer's transmission delay is not completely fixed. This is because the hardware may be upgraded or modified, so that the hardware delay after the change is not the same as the delay before the change. At the same time, the hardware itself also exists. The delay of the second level fluctuates, so the hardware delay is not completely fixed. Since the fluctuation of the hardware layer transmission delay is neglected in the prior art, there is a certain influence on the final synchronization accuracy. Summary of the invention
本发明要解决的主要技术问题是, 提供一种基于精确时钟协议提高同 步精度的方法及系统, 能够根据实时测量的延时值和提取的时间戳, 进行 相应地时延补偿, 从而提高精确时钟协议报文的同步精度。  The main technical problem to be solved by the present invention is to provide a method and system for improving synchronization accuracy based on an accurate clock protocol, which can perform corresponding delay compensation according to a real-time measured delay value and an extracted time stamp, thereby improving an accurate clock. Synchronization accuracy of protocol packets.
为达到上述目的, 本发明采用了以下技术方案:  In order to achieve the above object, the present invention adopts the following technical solutions:
一种基于精确时钟协议提高同步精度的系统, 包括:  A system for improving synchronization accuracy based on an accurate clock protocol, including:
延时测量模块, 用于实时测量报文经过硬件延时模块时的延时值并发 送给时延补偿模块;  The delay measurement module is configured to measure the delay value of the message passing through the hardware delay module in real time and send it to the delay compensation module;
时钟提取模块, 用于在确定所述报文为精确时钟协议报文时, 提取所 述精确时钟协议报文进入所述硬件延时模块之前加盖的时间戳, 并发送给 所述时延补偿模块; a clock extraction module, configured to: when determining that the packet is a precise clock protocol packet, extract a time stamp stamped by the precise clock protocol packet before entering the hardware delay module, and send the time stamp to the The delay compensation module;
时延补偿模块, 用于根据接收到的所述延时值和所述时间戳, 进行相 应的时延补偿。  The delay compensation module is configured to perform corresponding delay compensation according to the received delay value and the time stamp.
其中, 所述系统还包括物理层报文传输模块和媒体独立接口模块, 所 述物理层报文传输模块用于从以太网处接收所述报文, 并通过所述媒体独 立接口模块传输给所述硬件延时模块。  The system further includes a physical layer message transmission module and a media independent interface module, where the physical layer message transmission module is configured to receive the message from the Ethernet, and transmit the message to the device through the media independent interface module. The hardware delay module.
其中, 所述时延补偿模块包括接口通信单元和时延补偿单元; 所述接 口通信单元分别与所述延时测量模块和时钟提取模块相连, 用于接收所述 延时值和所述时间戳; 所述时延补偿单元用于根据所述延时值和所述时间 戳, 进行相应的时延补偿。  The delay compensation module includes an interface communication unit and a delay compensation unit. The interface communication unit is respectively connected to the delay measurement module and the clock extraction module, and configured to receive the delay value and the time stamp. The delay compensation unit is configured to perform corresponding delay compensation according to the delay value and the time stamp.
其中, 所述硬件延时模块、 时钟提取模块以及延时测量模块集成在同 一 FPGA中。  The hardware delay module, the clock extraction module, and the delay measurement module are integrated in the same FPGA.
其中, 所述硬件延时模块为先进先出模块。  The hardware delay module is a first in first out module.
其中, 所述延时测量模块为计数器。  The delay measurement module is a counter.
其中 , 所述时钟提取模块为具有时间戳管理功能的媒体访问控制模块。 一种基于精确时钟协议提高同步精度的方法, 包括:  The clock extraction module is a media access control module with a timestamp management function. A method for improving synchronization accuracy based on an accurate clock protocol, including:
实时测量报文经过硬件延时节点时的延时值; 当所述报文为精确时钟 协议报文时, 提取所述精确时钟协议报文进入所述硬件延时节点之前加盖 的时间戳;  The time delay value of the packet passing through the hardware delay node is measured in real time; when the packet is an accurate clock protocol packet, the time stamp stamped by the precise clock protocol packet before entering the hardware delay node is extracted;
根据所述延时值和所述时间戳, 进行相应的时延补偿。  Corresponding delay compensation is performed according to the delay value and the time stamp.
其中, 在测量所述延时值之前, 还包括判断物理层是否接收到报文的 步驟。  Before measuring the delay value, the method further includes: determining whether the physical layer receives the packet.
其中, 所述实时测量报文经过硬件延时节点时的延时值的过程包括: 在所述报文进入所述硬件延时节点时, 标记测量起点信号, 作为所述 延时值的测量起点; 以及, 在所述报文出所述硬件延时节点时, 标记测量 终点信号, 作为所述延时值的测量终点; The process of the delay value of the real-time measurement message passing through the hardware delay node includes: marking the measurement start point signal as the measurement starting point of the delay value when the message enters the hardware delay node And, when the message is out of the hardware delay node, the tag measurement An end point signal, as a measurement end point of the delay value;
根据所述测量起点和测量终点计算延时值。  The delay value is calculated based on the measurement start point and the measurement end point.
本发明的有益效果是: 通过实时测量精确时钟协议报文经过某个硬件 延时节点的延时值, 以及提取到的精确时钟协议报文进入该硬件延时节点 之前的时间戳, 来进行相应地延时补偿。 由于精确时钟协议报文经过不同 的硬件延时模块产生的延时值是动态变化的, 因此应用本发明测量得到的 延时值更加精确, 如此则能够根据测量得到的精确时钟协议报文经过某个 硬件延时节点的精确延时值和提取到的时间戳进行相应的时间戳的调整, 与现有技术相比, 提高了精确时钟协议报文的同步精度。 附图说明  The beneficial effects of the present invention are: performing real-time measurement of the delay value of a precise clock protocol message through a hardware delay node, and the extracted time stamp of the precise clock protocol message before entering the hardware delay node Ground delay compensation. Since the delay value generated by the precise clock protocol packet through different hardware delay modules is dynamically changed, the delay value measured by applying the present invention is more accurate, so that the accurate clock protocol message obtained according to the measurement can pass through a certain The precise delay value of the hardware delay node and the extracted time stamp adjust the corresponding time stamp, which improves the synchronization precision of the accurate clock protocol message compared with the prior art. DRAWINGS
图 1为本发明的系统组成示意图;  Figure 1 is a schematic view showing the structure of the system of the present invention;
图 2为本发明一种实施例的系统组成示意图;  2 is a schematic structural diagram of a system according to an embodiment of the present invention;
图 3为本发明的方法流程图;  Figure 3 is a flow chart of the method of the present invention;
图 4为本发明一种实施例的方法流程图。 具体实施方式  4 is a flow chart of a method in accordance with an embodiment of the present invention. detailed description
下面通过具体实施方式结合附图对本发明作进一步详细说明。  The present invention will be further described in detail below with reference to the accompanying drawings.
现有的基于精确时钟协议的系统在实现精确时钟协议报文( PTP报文 ) 同步时, 由于认为硬件层的传输延时是比较固定的, 因此在 PTP报文在媒 体独立接口加盖了时间戳后且在硬件层传输时, 就把硬件层的传输延时值 当成一个固定值来计算。  When the system based on the precise clock protocol synchronizes the accurate clock protocol packets (PTP packets), it is considered that the transmission delay of the hardware layer is relatively fixed. Therefore, the PTP packets are stamped on the media independent interface. After the stamping and transmission at the hardware layer, the transmission delay value of the hardware layer is calculated as a fixed value.
但实际上, 由于硬件层的传输延时也有一定的波动, 并不是固定不变 的, 所以使得现有方案中 PTP报文的同步精度会受到一定的影响。 为尽可 能减少硬件层的传输延时波动对同步精度的影响, 本发明提出了一种基于 精确时钟协议提高同步精度的方法及系统。 本发明的主要构思是: 由于不同的 PTP报文经过同一个硬件节点的延 时值可能不一样, 而同一个 PTP报文经过不同的硬件节点的延时值也可能 不一样, 并且同一个硬件节点出现硬件延时波动的时间点不确定。 因此, 通过实时测量当前 PTP报文经过某个硬件延时节点时的延时值, 并同时提 取该 PTP报文经过该硬件节点之前的时间戳, 根据该延时值和提取得到的 时间戳, 就可以对出了硬件延时节点后的 PTP报文的当前时间戳进行动态 调整,从而使得 PTP报文的时钟偏差和延时计算更加精确,进而提高了 PTP 报文的同步精度。 In fact, since the transmission delay of the hardware layer also has a certain fluctuation, it is not fixed, so the synchronization accuracy of the PTP message in the existing scheme will be affected to some extent. In order to minimize the influence of transmission delay fluctuations of the hardware layer on synchronization accuracy, the present invention proposes a method and system for improving synchronization accuracy based on an accurate clock protocol. The main idea of the present invention is: Since the delay values of different PTP packets passing through the same hardware node may be different, the delay values of the same PTP packet passing through different hardware nodes may be different, and the same hardware The point in time at which the hardware delay fluctuation occurs in the node is uncertain. Therefore, by measuring the delay value of the current PTP packet passing through a hardware delay node in real time, and simultaneously extracting the timestamp of the PTP packet before passing through the hardware node, according to the delay value and the extracted timestamp, The current timestamp of the PTP packet after the hardware delay node is dynamically adjusted, so that the clock skew and delay calculation of the PTP packet are more accurate, thereby improving the synchronization precision of the PTP packet.
根据该构思, 本发明提出了一种基于精确时钟协议提高同步精度的系 统。 如图 1所示, 该系统 1包括硬件延时模块 11 , 延时测量模块 12, 时钟 提取模块 13以及时延补偿模块 14。 其中, 硬件延时模块 11用于传输报文 收发路径上的报文, 并对报文进行时钟域的转换, 保证本地获得的数据可 靠。 由于硬件延时模块是延时不确定模块, 因此报文经过硬件延时模块时, 产生的传输延时也是不确定的。  In accordance with this concept, the present invention proposes a system for improving synchronization accuracy based on an accurate clock protocol. As shown in FIG. 1, the system 1 includes a hardware delay module 11, a delay measurement module 12, a clock extraction module 13 and a delay compensation module 14. The hardware delay module 11 is configured to transmit packets on the packet transmission and reception path, and perform clock domain conversion on the packet to ensure that the locally obtained data is reliable. Since the hardware delay module is a delay indeterminate module, the transmission delay generated when the message passes through the hardware delay module is also uncertain.
延时测量模块 12的作用就是实时测量报文进入硬件延时模块 11和出 硬件延时模块 11所用的时间, 即延时值, 并将该延时值传输给时延补偿模 块 14。 而时钟提取模块 13的作用是在确定硬件延时模块 11上传输的报文 为 PTP报文时, 用来提取该 PTP报文进入硬件延时模块 11之前加盖的时 间戳等信息, 并将该时间戳传输给时延补偿模块 14。 时延补偿模块 14根据 接收到的延时值和时间戳等信息, 动态地调整硬件延时模块输出的 PTP报 文当前的时间戳, 进行相应的时延补偿。  The function of the delay measurement module 12 is to measure the time taken by the message to enter the hardware delay module 11 and the hardware delay module 11 in real time, that is, the delay value, and transmit the delay value to the delay compensation module 14. The function of the clock extraction module 13 is to extract the time stamped information of the PTP message before entering the hardware delay module 11 when determining that the packet transmitted by the hardware delay module 11 is a PTP message, and This time stamp is transmitted to the delay compensation module 14. The delay compensation module 14 dynamically adjusts the current timestamp of the PTP message output by the hardware delay module according to the received delay value and timestamp, and performs corresponding delay compensation.
通过延时测量模块实时测量 PTP报文经过某个硬件延时模块的延时 值, 以及时钟提取模块提取的该 PTP报文进入该硬件延时模块之前的时间 戳, 来进行相应地延时补偿。 由于 PTP报文经过不同的硬件延时模块产生 的延时值是动态变化的, 因此, 采用本发明的系统来实时测量延时值, 可 以使得延时值的测量更加精确。 因此, 时延补偿模块能够根据 PTP报文经 过某个硬件延时模块的精确延时值进行相应的时间戳的调整, 与现有技术 相比, 提高了 PTP报文的同步精度。 The delay measurement module performs real-time measurement of the delay value of a PTP message through a hardware delay module, and the time stamp of the PTP message extracted by the clock extraction module before entering the hardware delay module, to perform corresponding delay compensation. . Since the delay value generated by the PTP message through different hardware delay modules is dynamically changed, the system of the present invention is used to measure the delay value in real time. In order to make the measurement of the delay value more accurate. Therefore, the delay compensation module can adjust the timestamp according to the precise delay value of the PTP message through a hardware delay module, and improve the synchronization precision of the PTP message compared with the prior art.
需要说明的一点是, 本发明测量得到的 PTP报文的延时值, 是 PTP报 文加盖时间戳后在硬件延时模块上传输时产生的延时值, 本发明的 PTP报 文在进入硬件延时模块之前, 刚刚被加盖上时间戳。 因此时钟提取模块提 取到的时间戳信息是 PTP报文进入硬件延时模块之前加盖的时间戳。  It should be noted that the delay value of the PTP packet measured by the present invention is a delay value generated when the PTP packet is time stamped and transmitted on the hardware delay module, and the PTP packet of the present invention enters. Just before the hardware delay module, it has just been stamped with a timestamp. Therefore, the timestamp information extracted by the clock extraction module is a time stamp stamped before the PTP message enters the hardware delay module.
需要说明的另一点是, 本发明的时延补偿模块, 可以采用软件语言来 实现, 并在 CPU上运行。 如此, CPU可以根据接收到的延时测量模块上报 的延时值以及时钟提取模块上报的时间戳, 就可以对延时测量模块输出的 Another point to be noted is that the delay compensation module of the present invention can be implemented in a software language and run on a CPU. In this way, the CPU can output the delay measurement module according to the delay value reported by the received delay measurement module and the time stamp reported by the clock extraction module.
PTP报文的当前时间戳进行相应地调整, 从而提高 PTP报文的同步精度。 The current timestamp of the PTP packet is adjusted accordingly to improve the synchronization accuracy of the PTP packet.
如图 2所示, 在该系统的实际运用中, 硬件延时模块 11、 延时测量模 块 12 以及时钟提取模块 13 三者的功能可通过现场可编程门阵列 (Field Programmable Gate Array, FPGA ) 来实现, 即在同一个 FPGA上, 集成有 上述三个模块。 利用该 FPGA, 可以实现对以太网 ^艮文在硬件层传输延时的 实时测量, 并将测量得到的延时值以及提取的时间戳一起上报给时延补偿 模块, 如此则省去了传统的示波器等延迟测量仪器, 使用简单方便, 成本 低。 并且, 本发明的时延测量模块, 可以通过硬件语言来实现, 也可以通 过软件语言来实现, 通用性强。 本系统能自适应网口速率, 能实现 1000M、 100M、 10M网络情况下的动态时延补偿; 在 125M工作时钟下, 延时值的 测量精度为 8ns。 并且, 本系统还可以通过提高工作时钟速率来进一步提高 延时值的测量精度。  As shown in FIG. 2, in the actual operation of the system, the functions of the hardware delay module 11, the delay measurement module 12, and the clock extraction module 13 can be implemented by a Field Programmable Gate Array (FPGA). Implementation, that is, on the same FPGA, the above three modules are integrated. By using the FPGA, real-time measurement of the transmission delay of the Ethernet layer in the hardware layer can be realized, and the measured delay value and the extracted time stamp are reported together to the delay compensation module, thus eliminating the traditional Delay measuring instruments such as oscilloscopes are simple and convenient to use and low in cost. Moreover, the delay measurement module of the present invention can be implemented by a hardware language or by a software language, and has high versatility. The system can adapt to the network port rate and realize dynamic delay compensation under 1000M, 100M, and 10M networks. Under 125M working clock, the measurement accuracy of the delay value is 8ns. Moreover, the system can further improve the measurement accuracy of the delay value by increasing the working clock rate.
如图 2所示, 在本发明实施例中, 该系统还包括物理层报文传输模块 ( PHY传输模块) 15和媒体独立接口 (ΜΠ接口)模块 16。 其中, 物理层 报文传输模块 15用于将从以太网处接收到的报文通过媒体独立接口 ΜΠ模 块 16传输给 FPGA中的硬件延时模块 11。采用物理层报文传输模块从物理 层接收报文, 并在媒体独立接口模块处加盖时间戳的方式, 使得报文时间 戳的产生尽可能地靠近物理层, 更加准确地反映报文的传递时间。 As shown in FIG. 2, in the embodiment of the present invention, the system further includes a physical layer message transmission module (PHY transmission module) 15 and a media independent interface (ΜΠ interface) module 16. The physical layer message transmission module 15 is configured to perform a packet received from the Ethernet through a media independent interface. Block 16 is transmitted to hardware delay module 11 in the FPGA. The physical layer packet transmission module receives the packet from the physical layer and adds a timestamp to the media independent interface module, so that the packet timestamp is generated as close as possible to the physical layer, and the packet transmission is more accurately reflected. time.
在本发明实施例中, 如图 2所示, 时延补偿模块 14包括接口通信单元 141和时延补偿单元 142。 接口通信单元 141分别与延时测量模块 12和时 钟提取模块 13相连, 用于接收传来的延时值和时间戳, 并将其传输给时延 补偿单元 142。 时延补偿单元 142用于实现精确时钟协议, 完成同步过程, 具体是根据获取的延时值和时间戳, 根据精确时钟协议对这些数据进行相 应的处理, 动态调整硬件延时模块输出的 PTP报文的当前时间戳, 进行相 应的时延补偿, 实现时钟同步。 例如, 可以将提取得到的 PTP报文的时间 戳加上测量得到的延时值的和作为硬件延时模块输出的 PTP报文的当前时 间戳。  In the embodiment of the present invention, as shown in FIG. 2, the delay compensation module 14 includes an interface communication unit 141 and a delay compensation unit 142. The interface communication unit 141 is connected to the delay measurement module 12 and the clock extraction module 13, respectively, for receiving the transmitted delay value and time stamp, and transmitting it to the delay compensation unit 142. The delay compensation unit 142 is configured to implement an accurate clock protocol and complete the synchronization process. Specifically, according to the acquired delay value and time stamp, the data is processed according to an accurate clock protocol, and the PTP report output by the hardware delay module is dynamically adjusted. The current timestamp of the text, corresponding delay compensation, to achieve clock synchronization. For example, the time stamp of the extracted PTP message plus the measured delay value can be used as the current time stamp of the PTP message output by the hardware delay module.
在本发明实施例中, 如图 2所示, 硬件延时模块指的是有报文经过时, 会产生延时波动的模块,例如先进先出 FIFO模块,当然也还可以是其它的、 传输报文时会产生延时的硬件模块。时钟提取模块会对进入 FIFO模块的报 文做相应的标记, 即标记报文进入 FIFO模块时的测量起点信号, 以及标记 报文输出 FIFO模块时的测量终点信号,并将这两个信号传送给延时测量模 块。 延时测量模块可以为计数器, 具体地, 计数器将接收到的测量起点信 号作为延时值的测量起点, 将测量终点信号作为延时值的测量终点, 并通 过自身对这两个信号的相位差的计数, 来计算延时值。 如此计算得到的延 时值,精确地反映了 PTP报文经过 FIFO模块的传输时间,使得在后续的时 钟同步过程中, 能够得到精确的延时值。  In the embodiment of the present invention, as shown in FIG. 2, the hardware delay module refers to a module that generates delay fluctuations when a message passes, such as a first-in first-out FIFO module, and of course, other transmissions. A delayed hardware module is generated when the message is sent. The clock extraction module marks the message entering the FIFO module, that is, the measurement start signal when the message enters the FIFO module, and the measurement end point signal when the message output FIFO module is marked, and transmits the two signals to Delay measurement module. The delay measurement module can be a counter. Specifically, the counter uses the received measurement start signal as the measurement starting point of the delay value, and uses the measurement end point signal as the measurement end point of the delay value, and passes the phase difference between the two signals by itself. Count, to calculate the delay value. The delay value thus calculated accurately reflects the transmission time of the PTP message through the FIFO module, so that an accurate delay value can be obtained in the subsequent clock synchronization process.
需要说明的是, 由于 FIFO模块带来的硬件延时波动通常在在几十到上 百 ns, 与 FIFO模块的深度相关, 因此, 采用本发明能够有效的提高 PTP 报文的同步精度。 如图 2所示, 在本发明实施例中, 时钟提取模块为具有时间戳管理功 能的媒体访问控制 MAC模块。 MAC模块用于实现 PTP报文的解析, 时间 戳的获取以及根据通信标准 IEEE802.3完成带时间戳的报文的发送和接收, 以及将提取到的时间戳传送给时延补偿模块。 It should be noted that, because the hardware delay fluctuation caused by the FIFO module is usually in the range of several tens to hundreds of ns, which is related to the depth of the FIFO module, the present invention can effectively improve the synchronization precision of the PTP message. As shown in FIG. 2, in the embodiment of the present invention, the clock extraction module is a media access control MAC module with a timestamp management function. The MAC module is configured to implement parsing of PTP packets, obtain timestamps, and complete transmission and reception of time-stamped packets according to the communication standard IEEE802.3, and transmit the extracted timestamps to the delay compensation module.
图 2所示的系统开始工作后,带时间戳管理功能的 MAC模块开始检测 FIFO模块是否收到报文。在确认收到报文后, 不但对应标记报文进入 FIFO 模块 /出 FIFO模块的测量起点信号 /测量终点信号。 同时, 还判断该报文为 是否 PTP报文, 若是, 那么该 MAC模块则需要对该报文进行处理, 提取 时间戳等信息。 将测量得到的延时值和提取的时间戳等信息通过通信接口 单元上报给时延补偿单元, 时延补偿单元根据实时测量得到的延时值和提 取到的时间戳, 调用 CPU的资源, 进而进行相应的时延补偿, 从而提高了 PTP报文的同步性能。  After the system shown in Figure 2 starts working, the MAC module with timestamp management starts to detect whether the FIFO module receives the message. After confirming the receipt of the message, not only the corresponding flag message enters the measurement start signal/measurement end point signal of the FIFO module/out FIFO module. At the same time, it is determined whether the packet is a PTP packet. If yes, the MAC module needs to process the packet and extract timestamp and other information. The information such as the measured delay value and the extracted time stamp is reported to the delay compensation unit through the communication interface unit, and the delay compensation unit calls the CPU resource according to the delay value obtained by the real-time measurement and the extracted time stamp, and further Corresponding delay compensation is performed to improve the synchronization performance of PTP packets.
同时, 如图 3 所示, 本发明还提供了一种基于精确时钟协议提高同步 精度的方法, 包括以下步驟:  Meanwhile, as shown in FIG. 3, the present invention also provides a method for improving synchronization accuracy based on an accurate clock protocol, including the following steps:
51、 实时测量报文经过硬件延时节点的延时值; 同时, 如果确定该报 文为精确时钟协议报文 ( PTP报文), 则提取该 PTP报文进入该硬件延时节 点之前加盖的时间戳;  The real-time measurement packet passes the delay value of the hardware delay node. Meanwhile, if the packet is determined to be a precise clock protocol packet (PTP packet), the PTP packet is extracted and inserted into the hardware delay node. Timestamp
52、 根据该延时值和该时间戳, 进行相应的时延补偿。  52. Perform corresponding delay compensation according to the delay value and the time stamp.
通过上述两个步驟, 即可以根据 PTP报文的时间戳和实时测量得到的 延时值, 对 PTP报文进行动态时延补偿。 与传统的 更件层的延时值当成 固定值的计算相比, 本发明得到的硬件层的延时值更能接近 PTP报文的真 实延时值, 从而使得后续进行时延补偿处理更加精确, 提高了 PTP报文的 同步精度。  Through the above two steps, the dynamic delay compensation of PTP packets can be performed according to the timestamp of the PTP packet and the delay value obtained by real-time measurement. Compared with the calculation of the conventional layered delay value as a fixed value, the delay value of the hardware layer obtained by the invention is closer to the true delay value of the PTP message, so that the subsequent delay compensation processing is more accurate. , improve the synchronization accuracy of PTP messages.
实际上, 在进行延时值的测量之前, 还有一个判断步驟, 即判断是否 有报文经过硬件延时节点, 也可以说判断物理层是否接收到报文。 若物理 层没有接收到报文, 即不需要进行后续的操作步驟, 并继续检测是否收到 报文。 只有在物理层接收到报文后, 才进行延时值的测量, 并在判断该报 文为 PTP报文时, 才提取时间戳等信息, 若不是 PTP报文, 则不用进行后 续的延时补偿操作。 In fact, before the measurement of the delay value, there is a judging step of judging whether a message has passed through the hardware delay node, or it can be said to determine whether the physical layer receives the message. If physics The layer does not receive the packet, that is, it does not need to perform subsequent operations, and continues to detect whether the packet is received. The delay value is measured only after the physical layer receives the packet, and the timestamp and other information are extracted when the packet is a PTP packet. If it is not a PTP packet, no subsequent delay is required. Compensation operation.
如图 4所示, 是本发明实施例的方法流程图, 具体为:  As shown in FIG. 4, it is a flowchart of a method according to an embodiment of the present invention, which is specifically:
首先, 检测物理层是否接收到报文, 若没有接收到报文, 则继续检测, 若接收到报文, 则对接收到的报文进行处理, 在报文进入硬件延时节点时 标记一个测量起点信号, 在报文出硬件延时节点时标记一个测量终点信号。  First, it detects whether the physical layer receives the packet, and if it does not receive the packet, continues to detect. If the packet is received, the received packet is processed, and a measurement is marked when the packet enters the hardware delay node. The start point signal marks a measurement end point signal when the message leaves the hardware delay node.
其次, 进行延时值的计算, 具体是将该测量起点信号作为开始延时值 计算的测量起点, 将测量终点信号作为结束延时值计算的测量终点, 根据 测量起点和测量终点来计算延时值。 同时, 判断经过硬件延时节点的报文 是否为 PTP报文, 若为 PTP报文, 则提取 PTP报文的时间戳等信息。  Secondly, the delay value is calculated, specifically, the measurement start point signal is used as the measurement starting point for calculating the start delay value, and the measurement end point signal is used as the measurement end point calculated by the end delay value, and the delay is calculated according to the measurement start point and the measurement end point. value. At the same time, it is determined whether the packet of the hardware delay node is a PTP packet, and if it is a PTP packet, the timestamp of the PTP packet is extracted.
最后, 根据计算得到的延时值以及提取的时间戳等信息, 对 PTP报文 的当前时间戳进行调整。  Finally, the current timestamp of the PTP packet is adjusted according to the calculated delay value and the extracted timestamp.
应用本发明, 能够实时测量 PTP报文经过某个硬件延时节点时所消耗 的时间, 即延时值, 与现有方案相比, 本发明测量得到的延时值更加精确; 根据提取得到的 PTP报文进入该硬件延时节点之前的时间戳以及实时测量 得到的延时值, 对硬件延时节点输出的 PTP报文进行动态时延补偿, 从而 能够提高 PTP报文的同步精度。 能认定本发明的具体实施只局限于这些说明。 对于本发明所属技术领域的 普通技术人员来说, 在不脱离本发明构思的前提下, 还可以做出若干简单 推演或替换, 都应当视为属于本发明的保护范围。  By applying the invention, the time consumed by the PTP message passing through a certain hardware delay node, that is, the delay value, can be measured in real time, and the delay value measured by the invention is more accurate than the existing solution; The PTP packet enters the timestamp of the hardware delay node and the delay value obtained by the real-time measurement, and performs dynamic delay compensation on the PTP packet outputted by the hardware delay node, thereby improving the synchronization precision of the PTP packet. It is to be understood that the specific embodiments of the invention are limited only by the description. It is to be understood by those skilled in the art that the present invention may be practiced without departing from the spirit and scope of the invention.

Claims

权利要求书 Claim
1、 一种基于精确时钟协议提高同步精度的系统, 包括:  1. A system for improving synchronization accuracy based on an accurate clock protocol, comprising:
延时测量模块, 用于实时测量报文经过硬件延时模块时的延时值并发 送给时延补偿模块;  The delay measurement module is configured to measure the delay value of the message passing through the hardware delay module in real time and send it to the delay compensation module;
时钟提取模块, 用于在确定所述报文为精确时钟协议报文时, 提取所 述精确时钟协议报文进入所述硬件延时模块之前加盖的时间戳, 并发送给 所述时延补偿模块;  a clock extraction module, configured to: when determining that the packet is an accurate clock protocol packet, extract a time stamp stamped before the precise clock protocol packet enters the hardware delay module, and send the time stamp to the delay compensation Module
时延补偿模块, 用于根据接收到的所述延时值和所述时间戳, 进行相 应的时延补偿。  The delay compensation module is configured to perform corresponding delay compensation according to the received delay value and the time stamp.
2、 如权利要求 1所述的系统, 其中, 所述系统还包括物理层报文传输 模块和媒体独立接口模块, 所述物理层报文传输模块用于从以太网处接收 所述报文, 并通过所述媒体独立接口模块传输给所述硬件延时模块。  2. The system according to claim 1, wherein the system further comprises a physical layer message transmission module and a media independent interface module, and the physical layer message transmission module is configured to receive the message from an Ethernet. And transmitting to the hardware delay module by the media independent interface module.
3、 如权利要求 1所述的系统, 其中, 所述时延补偿模块包括接口通信 单元和时延补偿单元; 所述接口通信单元分别与所述延时测量模块和时钟 提取模块相连, 用于接收所述延时值和所述时间戳; 所述时延补偿单元用 于根据所述延时值和所述时间戳, 进行相应的时延补偿。  3. The system according to claim 1, wherein the delay compensation module comprises an interface communication unit and a delay compensation unit; the interface communication unit is respectively connected to the delay measurement module and the clock extraction module, and is configured to Receiving the delay value and the timestamp; the delay compensation unit is configured to perform corresponding delay compensation according to the delay value and the timestamp.
4、 如权利要求 1至 3任一项所述的系统, 其中, 所述硬件延时模块、 时钟提取模块以及延时测量模块集成在同一 FPGA中。  4. The system according to any one of claims 1 to 3, wherein the hardware delay module, the clock extraction module, and the delay measurement module are integrated in the same FPGA.
5、 如权利要求 1至 3任一项所述的系统, 其中, 所述硬件延时模块为 先进先出模块。  The system according to any one of claims 1 to 3, wherein the hardware delay module is a first in first out module.
6、 如权利要求 1至 3任一项所述的系统, 其中, 所述延时测量模块为 计数器。  The system according to any one of claims 1 to 3, wherein the delay measurement module is a counter.
7、 如权利要求 1至 3任一项所述的系统, 其中, 所述时钟提耳 4莫块为 具有时间戳管理功能的媒体访问控制模块。  The system according to any one of claims 1 to 3, wherein the clock tear block is a media access control module having a time stamp management function.
8、 一种基于精确时钟协议提高同步精度的方法, 包括: 实时测量报文经过硬件延时节点时的延时值; 当所述报文为精确时钟 协议报文时, 提取所述精确时钟协议报文进入所述硬件延时节点之前加盖 的时间戳; 8. A method for improving synchronization accuracy based on an accurate clock protocol, comprising: The time delay value of the packet passing through the hardware delay node is measured in real time; when the packet is an accurate clock protocol packet, the time stamp stamped by the precise clock protocol packet before entering the hardware delay node is extracted;
根据所述延时值和所述时间戳, 进行相应的时延补偿。  Corresponding delay compensation is performed according to the delay value and the time stamp.
9、 如权利要求 8所述的方法, 其中, 在测量所述延时值之前, 还包括 判断物理层是否接收到报文的步驟。  9. The method according to claim 8, wherein before measuring the delay value, further comprising the step of determining whether the physical layer receives the message.
10、 如权利要求 8或 9所述的方法, 其中, 所述实时测量报文经过硬 件延时节点时的延时值的过程包括:  10. The method according to claim 8 or 9, wherein the process of delaying the value of the real-time measurement message through the hardware delay node comprises:
在所述报文进入所述硬件延时节点时, 标记测量起点信号, 作为所述 延时值的测量起点; 以及, 在所述报文出所述硬件延时节点时, 标记测量 终点信号, 作为所述延时值的测量终点;  When the message enters the hardware delay node, marking a measurement start signal as a measurement starting point of the delay value; and, when the message is out of the hardware delay node, marking a measurement end point signal, As the measurement end point of the delay value;
根据所述测量起点和测量终点计算延时值。  The delay value is calculated based on the measurement start point and the measurement end point.
PCT/CN2011/078997 2011-07-18 2011-08-26 Method and system for improving synchronization precision based on precision time protocol WO2012151808A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110200851.7 2011-07-18
CN201110200851.7A CN102244572B (en) 2011-07-18 2011-07-18 A kind of method and device for realizing that clock is synchronous

Publications (1)

Publication Number Publication Date
WO2012151808A1 true WO2012151808A1 (en) 2012-11-15

Family

ID=44962432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/078997 WO2012151808A1 (en) 2011-07-18 2011-08-26 Method and system for improving synchronization precision based on precision time protocol

Country Status (2)

Country Link
CN (1) CN102244572B (en)
WO (1) WO2012151808A1 (en)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638339B (en) * 2012-04-20 2014-12-24 杭州华三通信技术有限公司 Method and device for realizing precision time synchronization
CN103840877B (en) 2012-11-23 2017-11-24 中兴通讯股份有限公司 The time synchronism apparatus and method of automatic detection optical fiber asymmetric
CN104113517A (en) * 2013-04-22 2014-10-22 华为技术有限公司 Timestamp generation method, device and system
CN104980244B (en) * 2015-07-01 2017-07-28 大唐电信(成都)信息技术有限公司 Time synchronism equipment incoming line compensation of delay device and method
US9668101B2 (en) * 2015-08-10 2017-05-30 Qualcomm Incorporated Partial timing synchronization function (TSF) synchronization in fine timing measurement (FTM) protocol
CN105119775A (en) * 2015-08-28 2015-12-02 国电南瑞科技股份有限公司 Method for improving accuracy of Ethernet message transmission delay measurement
CN105376115A (en) * 2015-12-01 2016-03-02 北京博维亚讯技术有限公司 Hardware-based sampling value clock transparent transmission device and method for mutual inductor of transformer substation
CN105703866B (en) * 2015-12-29 2018-03-09 南京世海声学科技有限公司 A kind of synchronous collection method using network recovery clock of underwater linear array
CN105681889A (en) * 2015-12-31 2016-06-15 中科创达软件股份有限公司 Audio play delay determining method
CN106788836B (en) * 2016-04-06 2019-09-06 新华三技术有限公司 A kind of synchronous method and device of system time
CN108155982B (en) * 2016-12-02 2020-02-21 深圳市中兴微电子技术有限公司 Timestamp processing method and device
CN107749788B (en) * 2017-09-29 2019-06-18 郑州云海信息技术有限公司 A kind of method, device and equipment improving clock synchronization accuracy
CN109039514B (en) * 2018-07-19 2020-02-11 烽火通信科技股份有限公司 Method for improving IEEE1588 timestamp precision
WO2020062225A1 (en) * 2018-09-30 2020-04-02 华为技术有限公司 Mac device and time point estimation method
CN111327386B (en) * 2018-12-14 2023-08-08 深圳市中兴微电子技术有限公司 Delay jitter compensation method and device and computer storage medium
CN111464252B (en) * 2019-01-22 2023-01-06 华为技术有限公司 Communication method and optical module
CN112217588B (en) * 2019-07-10 2021-11-16 烽火通信科技股份有限公司 Timestamp jitter compensation method and system
CN110401505A (en) * 2019-07-19 2019-11-01 深圳大学 A kind of wireless network accurate time synchronization method
CN110596485B (en) * 2019-08-22 2022-11-04 国网安徽省电力有限公司 Digital-analog integrated tester and digital-analog synchronous output method thereof
CN110764401B (en) * 2019-10-29 2021-11-16 北京无线电计量测试研究所 Shipborne time synchronization calibration equipment
CN111443251B (en) * 2020-04-10 2022-03-08 国网湖北省电力有限公司宜昌供电公司 Intelligent substation analog quantity and digital quantity synchronous output control device and method
CN111698076B (en) * 2020-06-03 2023-05-30 河北工业大学 Accurate communication synchronization method and system based on time compensation
CN112600639A (en) * 2020-12-17 2021-04-02 珠海市一微半导体有限公司 Timestamp correction method and system
CN114221733B (en) * 2021-12-27 2023-11-07 深圳市紫光同创电子有限公司 Error compensation method for synchronizing time stamps

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404618A (en) * 2008-11-04 2009-04-08 中兴通讯股份有限公司 System, apparatus and method for implementing transparent transmission clock in accurate clock synchronization protocol
CN101977104A (en) * 2010-11-13 2011-02-16 上海交通大学 IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
CN102104572A (en) * 2009-12-22 2011-06-22 华为技术有限公司 Time synchronization method and system in transmission system and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004320657A (en) * 2003-04-18 2004-11-11 Nippon Telegr & Teleph Corp <Ntt> Time synchronizing system, method for time synchronizing, master station, slave station and relay station
CN101330374B (en) * 2007-06-18 2012-11-14 大唐移动通信设备有限公司 Method and system for synchronizing clock of transmission network as well as subordinate clock side entity
CN101662702B (en) * 2008-08-27 2013-06-26 华为技术有限公司 Time delay control method in passive optical network, optical line terminal and passive optical network
CN101582733A (en) * 2009-06-18 2009-11-18 中兴通讯股份有限公司 Method and system for realizing high precision time synchronization among SDH equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404618A (en) * 2008-11-04 2009-04-08 中兴通讯股份有限公司 System, apparatus and method for implementing transparent transmission clock in accurate clock synchronization protocol
CN102104572A (en) * 2009-12-22 2011-06-22 华为技术有限公司 Time synchronization method and system in transmission system and device
CN101977104A (en) * 2010-11-13 2011-02-16 上海交通大学 IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof

Also Published As

Publication number Publication date
CN102244572B (en) 2017-06-06
CN102244572A (en) 2011-11-16

Similar Documents

Publication Publication Date Title
WO2012151808A1 (en) Method and system for improving synchronization precision based on precision time protocol
CN104836630B (en) IEEE1588 clock synchronization system and implementation method therefor
US9256247B2 (en) Method and apparatus for communicating time information between time aware devices
KR101658204B1 (en) Apparatus and method for estimating timestamp
US8325767B2 (en) Enhancement of IEEE 1588 synchronization using out-of-band communication path
US11588568B2 (en) Packet processing method and network device
CN102136900B (en) Time synchronization method for passive optical network, device and system
WO2011120262A1 (en) Time synchronization processing method and device
WO2018006686A1 (en) Method, apparatus and device for optimizing time synchronization between communication network devices
US20100034191A1 (en) Method and system for time synchronization in a sensor network
CN103929293A (en) Asymmetrically-delayed time synchronization method and system
WO2013056575A1 (en) Clock synchronization method and system in 1588-2008 protocol
CN109150357A (en) The method for synchronizing time of hybrid bus based on RS485 and Ethernet
WO2012065334A1 (en) Method, device and system for realizing time synchronization in time division multiplexing network
CN101425865A (en) Method and system for synchronizing clock of transmission network as well as subordinate clock side entity
WO2013082901A1 (en) 1588 event message processing method and system
CN109039514A (en) A method of improving IEEE1588 timestamp precision
US9065748B2 (en) Symmetrical latency with TDM circuit emulated service
CN105634716A (en) Airborne network IEEE1588 protocol slave clock port synchronization method
CN103117829A (en) Method or device for time synchronization and compensation between asymmetrical networks
JP2009005070A (en) Communication system, communication method, and communication program
WO2012103702A1 (en) Method and device for detecting 1588 equipment performance
WO2013155944A1 (en) Boundary clock, transparent clock, and method for clock transmission
CN115865246A (en) Time synchronization device, system and method
CN105634715A (en) Airborne network IEEE1588 protocol transparent clock port synchronization method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11865392

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11865392

Country of ref document: EP

Kind code of ref document: A1