面向工业互联网的PTP多源融合时钟同步与守时补偿算法
Multi-Source Fusion Clock Synchronization and Holdover Compensation Algorithm for PTP in Industrial Internet
摘要: 在工业互联网、分布式采样和同步触发系统中,IEEE 1588精密时间协议(Precision Time Protocol, PTP)能够为多节点设备提供统一时间基准,但网络传输时延抖动(Packet Delay Variation, PDV)、链路不对称、报文间歇丢失以及本地晶振温漂会显著降低同步精度和触发一致性。针对上述问题,本文提出一种面向工业现场的PTP多源融合时钟同步与守时补偿算法。该算法以相位偏差和频率漂移为状态量,构建自适应卡尔曼时钟伺服模型;在观测更新前引入幸运包过滤机制,利用滑动窗口内最小时延报文抑制交换机排队噪声;同时结合片载温度采样与三阶多项式拟合,并在同步稳定阶段在线学习温度–频率关系,实现PTP中断阶段的置信度融合守时补偿。算法在同步触发端加入固定硬件延迟预补偿,使时间同步结果能够直接服务于脉冲输出和分布式采样。基于可复现仿真平台的对比实验表明,在轻载、中载和重载网络条件下,本文方法的稳态均方根同步误差分别为6.2 ns、8.4 ns和12.5 ns;在重载快速温变场景中,60 s、180 s和300 s断链守时的最大时间误差分别为18.7 ns、895.8 ns和1901.9 ns,与传统PI伺服相比,最大误差分别降低约97.4%、67.7%和60.7%。实验结果验证了该方法在复杂网络和硬件漂移共同作用下的同步精度、鲁棒性和工程适用性。
Abstract: In industrial Internet, distributed sampling and synchronous triggering systems, the IEEE 1588 Precision Time Protocol (PTP) provides a common time base for multiple nodes. However, packet delay variation, link asymmetry, intermittent message loss and oscillator temperature drift still degrade synchronization accuracy. This paper proposes a multi-source fusion clock synchronization and holdover compensation algorithm for PTP. The phase offset and frequency drift are modeled as clock states in an adaptive Kalman servo. Before measurement update, a lucky packet filter selects low-delay packets in a sliding window to suppress switch queuing noise. A temperature-frequency polynomial model is learned during normal synchronization, validated by a confidence estimator, and then used for holdover compensation when PTP packets are unavailable. In addition, a deterministic delay pre-compensation module is introduced for synchronous trigger outputs. Reproducible simulation experiments show that the proposed method achieves RMS offset errors of 6.2 ns, 8.4 ns and 12.5 ns under light, medium and heavy network loads, respectively. Under heavy load with a fast temperature transient, the maximum holdover errors during 60 s, 180 s and 300 s PTP outages are limited to 18.7 ns, 895.8 ns and 1901.9 ns, respectively. Compared with PI, these values are reduced by approximately 97.4%, 67.7% and 60.7%. The results demonstrate the accuracy, robustness and practical value of the proposed method under combined network jitter and hardware drift.
文章引用:段君凡, 赵伟. 面向工业互联网的PTP多源融合时钟同步与守时补偿算法[J]. 计算机科学与应用, 2026, 16(8): 88-99. https://doi.org/10.12677/csa.2026.168265

参考文献

[1] Lo Bello, L. and Steiner, W. (2019) A Perspective on IEEE Time-Sensitive Networking for Industrial Communication and Automation Systems. Proceedings of the IEEE, 107, 1094-1120.
https://doi.org/10.1109/jproc.2019.2905334
[2] Sundararaman, B., Buy, U. and Kshemkalyani, A.D. (2005) Clock Synchronization for Wireless Sensor Networks: A Survey. Ad Hoc Networks, 3, 281-323.
https://doi.org/10.1016/j.adhoc.2005.01.002
[3] Levesque, M. and Tipper, D. (2016) A Survey of Clock Synchronization over Packet-Switched Networks. IEEE Communications Surveys & Tutorials, 18, 2926-2947.
https://doi.org/10.1109/comst.2016.2590438
[4] IEEE (2020) 1588-2019—IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems. 1-499.
https://doi.org/10.1109/IEEESTD.2020.9120376
[5] Mills, D.L. (1991) Internet Time Synchronization: The Network Time Protocol. IEEE Transactions on Communications, 39, 1482-1493.
https://doi.org/10.1109/26.103043
[6] Correll, K., Barendt, N. and Branicky, M. (2005) Design Considerations for Software Only Implementations of the IEEE 1588 Precision Time Protocol. Proceedings of the 2005 Conference on IEEE 1588 Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems, Winterthur, 10-12 October 2005, 1-6.
[7] Giorgi, G. and Narduzzi, C. (2011) Performance Analysis of Kalman-Filter-Based Clock Synchronization in IEEE 1588 Networks. IEEE Transactions on Instrumentation and Measurement, 60, 2902-2909.
https://doi.org/10.1109/tim.2011.2113120
[8] LinuxPTP Project: ptp4l(8): PTP Boundary/Ordinary/Transparent Clock.
https://www.linuxptp.org/documentation/ptp4l/
[9] Kalman, R.E. (1960) A New Approach to Linear Filtering and Prediction Problems. Journal of Basic Engineering, 82, 35-45.
https://doi.org/10.1115/1.3662552
[10] Bletsas, A. (2005) Evaluation of Kalman Filtering for Network Time Keeping. IEEE Transactions on Ultrasonics, Ferroelectrics and Frequency Control, 52, 1452-1460.
https://doi.org/10.1109/tuffc.2005.1516016
[11] Schriegel, S. and Jasperneite, J. (2007) Investigation of Industrial Environmental Influences on Clock Sources and Their Effect on the Synchronization Accuracy of IEEE 1588. 2007 IEEE International Symposium on Precision Clock Synchronization for Measurement, Control and Communication, Vienna, 1-3 October 2007, 50-55.
https://doi.org/10.1109/ispcs.2007.4383773
[12] Vig, J.R. (2004) Quartz Crystal Resonators and Oscillators for Frequency Control and Timing Applications: A Tutorial. U.S. Army Communications-Electronics Command, Fort Monmouth.
[13] Alhashmi, N., Almoosa, N. and Gianini, G. (2022) Path Asymmetry Reconstruction via Deep Learning. 2022 IEEE 21st Mediterranean Electrotechnical Conference (MELECON), Palermo, 14-16 June 2022, 1171-1176.
https://doi.org/10.1109/melecon53508.2022.9842892
[14] Zhang, W. and Hou, Y. (2023) A Modified Strong Tracking Adaptive Kalman Filter for Precision Clock Synchronization System. IEEJ Transactions on Electrical and Electronic Engineering, 18, 1702-1711.
https://doi.org/10.1002/tee.23900
[15] Liu, X. and Wang, H. (2025) Robust Clock Parameters Tracking for IEEE 1588 with Asymmetric Packet Delays in Industrial Networks. IEEE Transactions on Communications, 73, 1248-1261.
https://doi.org/10.1109/tcomm.2024.3450603
[16] Ji, R., Xu, F., Duan, S., Zhu, J., Tao, Y., Liu, M., et al. (2024) A Cooperative Timestamp-Free Clock Synchronization Scheme Based on Fast Unscented Kalman Filtering for Time-Sensitive Networking. Computer Networks, 253, Article ID: 110711.
https://doi.org/10.1016/j.comnet.2024.110711
[17] Anyaegbu, M., Wang, C.X. and Berrie, W. (2013) Dealing with Packet Delay Variation in IEEE 1588 Synchronization Using a Sample-Mode Filter. IEEE Intelligent Transportation Systems Magazine, 5, 20-27.
https://doi.org/10.1109/mits.2013.2267546
[18] Gong, F. and Sichitiu, M.L. (2017) Temperature Compensated Kalman Distributed Clock Synchronization. Ad Hoc Networks, 62, 88-100.
https://doi.org/10.1016/j.adhoc.2017.04.009
[19] IEEE (2020) 802.1AS-2020—IEEE Standard for Local and Metropolitan Area Networks: Timing and Synchronization for Time-Sensitive Applications. 1-421.
https://doi.org/10.1109/IEEESTD.2020.9121845
[20] IEEE (2016) 802.1Qbv-2015—IEEE Standard for Local and Metropolitan Area Networks: Bridges and Bridged Networks—Amendment 25: Enhancements for Scheduled Traffic. 1-57.
https://doi.org/10.1109/IEEESTD.2016.8613095