CN110071777B - PTP over PTN的currentUtcOffset参数自适应处理方法 - Google Patents

PTP over PTN的currentUtcOffset参数自适应处理方法 Download PDF

Info

Publication number
CN110071777B
CN110071777B CN201910290789.1A CN201910290789A CN110071777B CN 110071777 B CN110071777 B CN 110071777B CN 201910290789 A CN201910290789 A CN 201910290789A CN 110071777 B CN110071777 B CN 110071777B
Authority
CN
China
Prior art keywords
ptp
currentutcoffset
satellite
grandmaster
epoch
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910290789.1A
Other languages
English (en)
Other versions
CN110071777A (zh
Inventor
杨林
朱哲然
王红印
范不井
雷炜卿
龙洁
任瑞敏
董奥冬
杨铁军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Jiaozuo Power Supply Co of State Grid Henan Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Jiaozuo Power Supply Co of State Grid Henan Electric Power Co Ltd
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 State Grid Corp of China SGCC, Jiaozuo Power Supply Co of State Grid Henan Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201910290789.1A priority Critical patent/CN110071777B/zh
Publication of CN110071777A publication Critical patent/CN110071777A/zh
Application granted granted Critical
Publication of CN110071777B publication Critical patent/CN110071777B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)
  • Electric Clocks (AREA)

Abstract

本发明公开了PTP over PTN的currentUtcOffset参数自适应处理方法,该方法基于的PTN链路包括互备的至少两套GPS卫星***的PTP设备,PTP设备为链路的卫星PTP钟;将互备的PTP钟设置优先级,选定其中一个担任链路中的grandmaster并自动获取正确的currentUtcOffset参数保存并播发;备用PTP设备获取播发数据并保存为自己的参数;当grandmaster不起作用时,其他备用PTP设备可切换。本发明参数自动从GPS或北斗获取的信息转换而来,不通过人为设置,备用PTP设备的参数也为自动获取。规定了备用PTP设备,非法的参数不会作用到PTP时间传递链路中。

Description

PTP over PTN的currentUtcOffset参数自适应处理方法
技术领域
本发明属时间同步技术领域,特别是涉及PTP over PTN的currentUtcOffset 参数自适应处理方法。
背景技术
网络测量和控制***的精密时钟同步协议IEEE1588(以下简称PTP)在通过 PTN完成对时的链路中,有多种的PTP设备如Ordinary clock(grandmaster、master、slave)、Boundary clock、End-to-end transparent clock、 Peer-to-peer transparent clock。在通信过程中各种设备均起着各自的作用,在链路中需要解析PTP时间时会用到currentUtcOffset参数,这个参数是PTP 历元转换为UTC时间的重要参数,是由Announcemessage承载传递的,这是个动态参数变量,其值的变化由闰秒事件触发产生。
闰秒事件由国际计量局统一发布,GPS卫星***、北斗卫星***、以及各国时频专业机构会对该信息进行预报。
依据PTP协议规定,在网络(此处为PTN网络)中的grandmaster只会有一个,他播发的时间以及currentUtcOffset参数会在网络中逐级传递到最后一个PTP节点。这样链路中需要解析时间时均用的是grandmaster播发的 currentUtcOffset参数。
在PTN对时链路中,当前的grandmaster可能会因为线路损坏或设备异常等原因不能在整个网络中起作用,这种情况下,节点中的其他具有grandmaster 能力的PTP设备会充当grandmaster的作用,由新的grandmaster播发 currentUtcOffset参数。如果前后两个grandmaster的currentUtcOffset的参数配置不一样的话,两个grandmaster切换后解析的UTC时间可能就不一样了。
目前currentUtcOffset大多采用手动方式设置,且为了保证PTN链路中各 PTP设备的该参都保持一致,且在闰秒触发时能够及时将变化的 currentUtcOffset值配置正确,对运维来说是一个繁琐的工作,一旦工作疏忽可能会在网络切换grandmaster设备后解算出前后不一致的UTC时间。而PTP 协议是为时间同步精度要求在亚微秒级的应用场景所设计,currentUtcOffset 的单位是秒级,因此该参数的错误会导致解析出的UTC时间的秒级误差,严重不满足PTP协议亚微秒级的设计目标以及使用要求。
发明内容
本发明的目的就在于克服现有的技术问题,主要是针对currentUtcOffset 采用手动方式设置的现状,提供一种PTP over PTN的currentUtcOffset参数自适应处理方法。
本发明是采用以下技术方案进行:PTP over PTN的currentUtcOffset参数自适应处理方法,所述方法基于的PTN链路包括互备的至少两套带北斗或GPS 卫星***的PTP设备,所述PTP设备为PTN链路的卫星PTP钟;
所述方法包括以下步骤:
步骤一,将所述的互备的卫星PTP钟分别设置优先级,通过BMC算法选定其中一个担任PTN链路中的grandmaster;
步骤二,选定的担任PTN链路中的grandmaster的卫星PTP钟,通过北斗卫星或GPS卫星自动获取正确的currentUtcOffset保存,并通过PTP协议的 Announce message进行播发;
步骤三,PTN链路中的其他具有成为grandmaster的备用PTP设备获取到担任PTN链路中的grandmaster的卫星PTP钟播发的currentUtcOffset的数据后进行合法性判断,并保存为自己的currentUtcOffset;
步骤四,当选定的担任PTN链路中的grandmaster的卫星PTP钟不起作用时,PTN链路中的其他具有成为grandmaster的备用PTP设备承担起grandmaster 的角色。
优选的,所述步骤四中具有成为grandmaster的备用PTP设备为步骤三中由原担任PTN链路中的grandmaster的卫星PTP钟同步过currentUtcOffset的备用PTP设备。
优选的,所述步骤一中的优先级分别设置为0和1。
优选的,所述步骤二包括三个子过程:初始化子过程,接收卫星历元与UTC 的时差形成currentUtcOffset子过程,currentUtcOffset播发的子过程;
所述初始化子过程:卫星PTP钟程序初始化时置 currentUtcOffsetInitFlag=0;
所述接收卫星历元与UTC的时差形成currentUtcOffset子过程:接收GPS 卫星播发的GPS历元与UTC的时差或北斗卫星播发的北斗历元与UTC的时差;判断是否接收到GPS历元或北斗历元与UTC的时差,若接收到,则解算出GPS 历元或北斗历元与UTC的时差并依据PTP协议中描述PTP历元推出PTP历元与 GPS历元差或PTP历元与北斗历元差,最后解算出PTP历元与UTC的时差;将本地currentUtcOffset参数设置为解算出来的PTP历元与UTC的时差,置 currentUtcOffsetInitFlag=1;
所述currentUtcOffset播发的子过程:首先判断是否为播发Announce message时间;若是播发Announce message时间,则判断 currentUtcOffsetInitFlag是否为1,如果是1则播发Announce message,播发的Announcemessage中currentUtcOffset填写卫星解算的currentUtcOffset,timeSource填写GPS(若为北斗仍填写为GPS,因为在 IEEE1588协议中无北斗的定义),否则不播发。
优选的,所述步骤三包括初始化子过程、接收上级grandmaster的currentUtcOffset,自动形成本体设备的currentUtcOffset子过程;
所述初始化子过程:备用PTP设备程序初始化时置 currentUtcOffsetInitFlag=0;
所述接收上级grandmaster的currentUtcOffset,自动形成本体设备的currentUtcOffset子过程:备用PTP设备***等待接收Announce message;当接收到Announce message,则解析出该消息中的currentUtcOffset和 timeSource的值;然后判断解析的timeSource是否为GPS,若是,则将本设备的currentUtcOffset参数设置为currentUtcOffset,并置卫星初始化完成标志 currentUtcOffsetInitFlag=1。
优选的,所述步骤四的具体流程如下:判断是否为播发Announce message 的时间;如果是播发Announce message的时间,则判断 currentUtcOffsetInitFlag是否为1,如果currentUtcOffsetInitFlag=1,则播发Announce message,否则不播发;播发的Announce message中 currentUtcOffset填写为依据卫星解算的currentUtcOffset值,timeSource 填写HAND_SET。
本发明的作用原理如下:从GPS或北斗卫星自动获取转化的 currentUtcOffset并传递到PTN链路的中的PTP设备,PTP设备中具有 grandmaster能力的currentUtcOffset继承为卫星PTP钟,并在其作为链路的 grandmaster时播发这个参数。PTN链路网络上的PTP设备的currentUtcOffset 参数都通过自适应方式完成,替代手动方式设置。
本发明具有以下有益效果:
1)、1588时间传递的currentUtcOffset参数,是自动从GPS或北斗获取的信息转换而来,不通过人为设置。
2)、currentUtcOffset通过卫星PTP钟播发的Announce message到PTP 的1588时间传递的链路中,在链路中的所有的PTP设备都可以接收到这个currentUtcOffset,链路中的其他具有grandmaster能力的PTP设备获取这个参数进行保存,并作为其成为grandmaster时播发的currentUtcOffset的值,从而解决了整条PTN链路所有具备grandmaster能力的PTP设备的 currentUtcOffset的自动获取。
3)、由于方法中规定了具备grandmaster能力的PTP设备,在没有获得通过卫星初始化的currentUtcOffset,则不能切换为grandmaster角色,使得非法的currentUtcOffset不会作用到PTN的PTP时间传递链路中。
附图说明
图1为卫星PTP钟形成currentUtcOffset并播发的流程总图;
图2为卫星PTP钟形成currentUtcOffset并播发的流程的初始化子过程;
图3为卫星PTP钟形成currentUtcOffset并播发的流程的接收卫星历元与 UTC的时差形成currentUtcOffset子过程;
图4为卫星PTP钟形成currentUtcOffset并播发的流程的 currentUtcOffset播发的子过程;
图5为具有grandmaster功能的PTP设备的currentUtcOffset形成的流程总图;
图6为具有grandmaster功能的PTP设备的currentUtcOffset形成的流程的初始化子过程;
图7为具有grandmaster功能的PTP设备的currentUtcOffset形成的流程的接收上级grandmaster的currentUtcOffset,自动形成本体设备的 currentUtcOffset子过程;
图8为具有grandmaster功能的PTP设备切换为grandmaster流程图。
具体实施方式
下面以具体实施例对本发明作进一步描述,在此发明的示意性实施例以及说明用来解释本发明,但并不作为对本发明的限定。
如图1至图8所示的PTP over PTN的currentUtcOffset参数自适应处理方法,所述方法基于的PTN链路包括互备的至少两套带北斗或GPS卫星***的 PTP设备,所述PTP设备为PTN链路的卫星PTP钟;
所述方法包括以下步骤:
步骤一,将所述的互备的卫星PTP钟分别设置优先级,通过BMC算法选定其中一个担任PTN链路中的grandmaster;
步骤二,选定的担任PTN链路中的grandmaster的卫星PTP钟,通过北斗卫星或GPS卫星自动获取正确的currentUtcOffset保存,并通过PTP协议的 Announce message进行播发;
步骤三,PTN链路中的其他具有成为grandmaster的备用PTP设备获取到担任PTN链路中的grandmaster的卫星PTP钟播发的currentUtcOffset的数据后进行合法性判断,并保存为自己的currentUtcOffset;
步骤四,当选定的担任PTN链路中的grandmaster的卫星PTP钟不起作用时,PTN链路中的其他具有成为grandmaster的备用PTP设备承担起grandmaster 的角色。
所述步骤四中具有成为grandmaster的备用PTP设备为步骤三中由原担任PTN链路中的grandmaster的卫星PTP钟同步过currentUtcOffset的备用PTP 设备。
所述步骤一中的优先级分别设置为0和1。
具体的,卫星PTP钟形成currentUtcOffset并播发的程序流程图参见图1、图2、图3、图4;本过程包含三个子过程:初始化子过程,接收卫星历元与UTC 的时差形成currentUtcOffset子过程,currentUtcOffset播发的子过程。
1)初始化子过程
卫星PTP钟程序初始化时置currentUtcOffsetInitFlag=0;
2)接收卫星历元与UTC的时差形成currentUtcOffset子过程
——接收GPS卫星(或北斗卫星)播发的GPS历元(北斗历元)与UTC的时差;
——如果接收到接收GPS卫星(或北斗卫星)播发的GPS历元(北斗历元) 与UTC的时差,则解算出GPS卫星(或北斗卫星)播发的GPS历元(北斗历元) 与UTC的时差;
——依据PTP协议中描述PTP历元推出,PTP历元与GPS历元差(与北斗历元差),解算出PTP历元与UTC的时差;
——将本地currentUtcOffset参数设置为解算出来的PTP历元与UTC的时差;
——置currentUtcOffsetInitFlag=1;
3)currentUtcOffset播发的子过程
——判断是否为播发Announce message时间;
——如果是播发Announcemessage时间,则判断currentUtcOffsetInitFlag 是否为1,如果是则播发Announce message,播发的Announce message中currentUtcOffset填写卫星解算的currentUtcOffset,timeSource填写GPS(若为北斗仍填写为GPS,因为在IEEE1588协议中无北斗的定义)否则不播发。
2、具有grandmaster功能的备用PTP设备的currentUtcOffset形成参见图5、图6、图7;本过程包含两个子过程:初始化子过程、接收上级grandmaster 的currentUtcOffset,形成本体设备的currentUtcOffset子过程。
1)、初始化子过程
备用PTP设备程序初始化时置currentUtcOffsetInitFlag=0;
2)、接收上级grandmaster的currentUtcOffset,形成本体设备的currentUtcOffset子过程
——***等待接收Announce message;
——如果接收到Announce message,则解析出该消息中的 currentUtcOffset和timeSource的值;
——判断解析的timeSource是否为GPS,若是,则将本设备的 currentUtcOffset参数设置为currentUtcOffset,并置卫星初始化完成标志 currentUtcOffsetInitFlag=1。
3、具有grandmaster功能的备用PTP设备切换为grandmaster流程参见图 8,过程如下:
——判断是否为播发Announce message的时间;
——如果是播发Announcemessage的时间,则判断 currentUtcOffsetInitFlag是否为1,如果currentUtcOffsetInitFlag=1,则播发Announce message,否则不播发;
——播发的Announce message中currentUtcOffset填写为依据卫星解算的currentUtcOffset值,timeSource填写HAND_SET
本发明的技术方案不限于上述具体实施例的限制,凡是根据本发明的技术方案做出的技术变形,均落入本发明的保护范围之内。

Claims (5)

1.PTP over PTN的currentUtcOffset参数自适应处理方法,其特征在于:所述方法基于的PTN链路包括互备的至少两套带北斗或GPS卫星***的PTP设备,所述PTP设备为PTN链路的卫星PTP钟;
所述方法包括以下步骤:
步骤一,将所述的互备的卫星PTP钟分别设置优先级,通过BMC算法选定其中一个担任PTN链路中的grandmaster;
步骤二,选定的担任PTN链路中的grandmaster的卫星PTP钟,通过北斗卫星或GPS卫星自动获取正确的currentUtcOffset保存,并通过PTP协议的Announce message进行播发;
步骤三,PTN链路中的其他具有成为grandmaster的备用PTP设备获取到担任PTN链路中的grandmaster的卫星PTP钟播发的currentUtcOffset的数据后进行合法性判断,并保存为自己的currentUtcOffset;
步骤四,当选定的担任PTN链路中的grandmaster的卫星PTP钟不起作用时,PTN链路中的其他具有成为grandmaster的备用PTP设备承担起grandmaster的角色;步骤四的具体流程如下:判断是否为播发Announce message的时间;如果是播发Announce message的时间,则判断currentUtcOffsetInitFlag是否为1,如果currentUtcOffsetInitFlag=1,则播发Announce message,否则不播发;播发的Announce message中currentUtcOffset填写为依据卫星解算的currentUtcOffset值,timeSource填写HAND_SET。
2.根据权利要求1所述的PTP over PTN的currentUtcOffset参数自适应处理方法,其特征在于:所述步骤四中具有成为grandmaster的备用PTP设备为步骤三中由原担任PTN链路中的grandmaster的卫星PTP钟同步过currentUtcOffset的备用PTP设备。
3.根据权利要求1所述的PTP over PTN的currentUtcOffset参数自适应处理方法,其特征在于:所述步骤一中的优先级分别设置为0和1。
4.根据权利要求1所述的PTP over PTN的currentUtcOffset参数自适应处理方法,其特征在于:所述步骤二包括三个子过程:初始化子过程,接收卫星历元与UTC的时差形成currentUtcOffset子过程,currentUtcOffset播发的子过程;
所述初始化子过程:卫星PTP钟程序初始化时置currentUtcOffsetInitFlag=0;
所述接收卫星历元与UTC的时差形成currentUtcOffset子过程:接收GPS卫星播发的GPS历元与UTC的时差或北斗卫星播发的北斗历元与UTC的时差;判断是否接收到GPS历元或北斗历元与UTC的时差,若接收到,则解算出GPS历元或北斗历元与UTC的时差并依据PTP协议中描述PTP历元推出PTP历元与GPS历元差或PTP历元与北斗历元差,最后解算出PTP历元与UTC的时差;将本地currentUtcOffset参数设置为解算出来的PTP历元与UTC的时差,置currentUtcOffsetInitFlag=1;
所述currentUtcOffset播发的子过程:首先判断是否为播发Announce message时间;若是播发Announce message时间,则判断currentUtcOffsetInitFlag是否为1,如果是1则播发Announce message,播发的Announcemessage中currentUtcOffset填写卫星解算的currentUtcOffset,timeSource填写GPS,否则不播发。
5.根据权利要求1所述的PTP over PTN的currentUtcOffset参数自适应处理方法,其特征在于:所述步骤三包括初始化子过程、接收上级grandmaster的currentUtcOffset,形成本体设备的currentUtcOffset子过程;
所述初始化子过程:备用PTP设备程序初始化时置currentUtcOffsetInitFlag=0;
所述接收上级grandmaster的currentUtcOffset,形成本体设备的currentUtcOffset子过程:备用PTP设备***等待接收Announce message;当接收到Announce message,则解析出Announce message中的currentUtcOffset和timeSource的值;然后判断解析的timeSource是否为GPS,若是,则将本设备的currentUtcOffset参数设置为currentUtcOffset,并置卫星初始化完成标志currentUtcOffsetInitFlag=1。
CN201910290789.1A 2019-04-11 2019-04-11 PTP over PTN的currentUtcOffset参数自适应处理方法 Active CN110071777B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910290789.1A CN110071777B (zh) 2019-04-11 2019-04-11 PTP over PTN的currentUtcOffset参数自适应处理方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910290789.1A CN110071777B (zh) 2019-04-11 2019-04-11 PTP over PTN的currentUtcOffset参数自适应处理方法

Publications (2)

Publication Number Publication Date
CN110071777A CN110071777A (zh) 2019-07-30
CN110071777B true CN110071777B (zh) 2020-10-30

Family

ID=67367425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910290789.1A Active CN110071777B (zh) 2019-04-11 2019-04-11 PTP over PTN的currentUtcOffset参数自适应处理方法

Country Status (1)

Country Link
CN (1) CN110071777B (zh)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951312A (zh) * 2010-09-15 2011-01-19 电信科学技术第五研究所 基于e1链路的双向时频同传方法及主从装置
WO2012171417A1 (zh) * 2011-06-14 2012-12-20 中兴通讯股份有限公司 一种时钟同步方法及设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5560706B2 (ja) * 2009-12-28 2014-07-30 富士通株式会社 ノード装置
CN102237996B (zh) * 2010-04-26 2014-03-19 中兴通讯股份有限公司 一种同步时钟的方法和时钟同步装置
CN103428081A (zh) * 2012-05-14 2013-12-04 中兴通讯股份有限公司 一种分组网络同步方法、装置及***
CN105846937B (zh) * 2015-01-12 2019-07-23 中兴通讯股份有限公司 时间处理方法及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951312A (zh) * 2010-09-15 2011-01-19 电信科学技术第五研究所 基于e1链路的双向时频同传方法及主从装置
WO2012171417A1 (zh) * 2011-06-14 2012-12-20 中兴通讯股份有限公司 一种时钟同步方法及设备

Also Published As

Publication number Publication date
CN110071777A (zh) 2019-07-30

Similar Documents

Publication Publication Date Title
CN108173614B (zh) 一种车载以太网的时间同步和调度方法
CN102246443B (zh) 用于分组交换网络节点的时钟以及关联的同步方法
US9838196B2 (en) Synchronization apparatus, synchronization system, radio communication apparatus and synchronization method
KR101426325B1 (ko) 패킷-교환 네트워크를 위한 네트워크 요소
US9154292B2 (en) Communication apparatus, communication system, and time synchronization method
RU2638645C2 (ru) Способ для определения опорных синхросигналов, подвергнутых воздействию изменения в асимметрии задержки трассы распространения между узлами в сети связи
US8953645B2 (en) Communication system, communication apparatus and time synchronization method
CN110120846B (zh) 一种时钟同步方法和***
CN103916950A (zh) 时间同步方法及***
CN110798276B (zh) 一种智能变电站sdn网络的时间同步方法与***
CN110113127B (zh) 一种基于1588协议传递时间的方法及其***
CN101394264B (zh) 周期性报文传递的监控方法及装置
CN110875818A (zh) 时钟同步方法及装置、***、存储介质、电子装置
CN103259640A (zh) 一种同步时间的方法和设备
CN103999387A (zh) 同步间隔确定
AU757626B2 (en) Frame phase synchronous system and a method thereof
WO2016112664A1 (zh) 时间处理方法及装置
CN110071777B (zh) PTP over PTN的currentUtcOffset参数自适应处理方法
CN107959537B (zh) 一种状态同步方法及装置
CN107528655A (zh) 时间同步方法和时间同步***
US9531530B2 (en) Faster synchronization time and better master selection based on dynamic accuracy information in a network of IEEE 1588 clocks
CN111769895B (zh) 多设备校时方法及***和设备校时方法及装置
CN105187150A (zh) 一种基于sdh网络的时钟同步***
CN116366194A (zh) 一种基于一主多从网络拓扑环境提升时间同步精度的算法
WO2016082369A1 (zh) 时钟源属性的同步方法、装置及***

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant