在分析IEEE 1588原理以及影响同步精度因素的基础上,设计了基于Windows平台的时间同步方法,为分布式网络系统的时钟精确同步提供了一种有效可行的解决办法。目前,Windows平台下直接在应用层获取的时间戳精度在10 ms级左右,系统的同步精度为ms级。针对Windows平台下获取更高精度1588时间戳的困难,设计了基于SharpPcap的时间戳处理模块,得到高精度的数据链路层时间戳,从而提高了应用层的时间戳精度。实验结果表明,采用该方法系统主从时钟的同步精度达到亚ms级,满足电力系统中同步精度在ms级以内的时钟同步需求。
Based on the analysis of principle IEEE 1588 protocol and the factors affecting the synchronization accuracy,a time synchronization approach on Windows platform is proposed in this paper,and the approach provides a feasible and effective solution for distributed network system clock accuracy synchronization. At present,the timestamp accuracy is at about 10 ms level obtained directly from the application layer on windows platform,while the system synchronization is at millisecond level. For the difficulties to obtain higher precision 1588 timestamp on windows platform, a timestamp processing module based on SharpPcap is designed. The proposed approach reaches a higher accuracy in the data link layer timestamp,thus improves the timestamp precision of the application layer. The experimental results show that the synchronization accuracy of the system master-slave clock achieves sub-millisecond level in this approach, which can meet the requirements of clock synchronization accuracy within millisecond in the power system.