CN114389735A - A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock - Google Patents
A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock Download PDFInfo
- Publication number
- CN114389735A CN114389735A CN202111481939.0A CN202111481939A CN114389735A CN 114389735 A CN114389735 A CN 114389735A CN 202111481939 A CN202111481939 A CN 202111481939A CN 114389735 A CN114389735 A CN 114389735A
- Authority
- CN
- China
- Prior art keywords
- clock
- timestamp
- time
- delay
- node
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000005259 measurement Methods 0.000 claims abstract description 39
- 230000007246 mechanism Effects 0.000 claims abstract description 11
- 230000001360 synchronised effect Effects 0.000 claims abstract description 11
- 230000004044 response Effects 0.000 claims description 23
- 230000005540 biological transmission Effects 0.000 claims description 20
- 238000004364 calculation method Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 7
- 238000012937 correction Methods 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 4
- 230000003111 delayed effect Effects 0.000 claims 1
- 230000035945 sensitivity Effects 0.000 claims 1
- 238000004891 communication Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 239000013078 crystal Substances 0.000 description 3
- 230000001934 delay Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002459 sustained effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
Description
技术领域technical field
本发明涉及工业时间敏感网络通信技术领域,具体涉及一种基于 IEEE802.1AS冗余主时钟的时钟同步方法。The invention relates to the technical field of industrial time-sensitive network communication, in particular to a clock synchronization method based on an IEEE802.1AS redundant master clock.
背景技术Background technique
工业互联网是智能制造和智能工厂的核心,连接工业制造的各个环节,旨 在提高制造效率,优化生产管理,促进工业制造领域的转型升级与国民经济持 续高速发展。新兴的时敏业务对数据传输的确定性时延的要求对现有以太网提 出了不小的挑战。IEEE802.1工作组提出了时间敏感网络(time-sensitive networking,TSN)协议,TSN以基于IEEE802.3的有线以太网为基础,并增加 扩展一系列功能与协议标准,提升以太网支持实时应用的能力,在为时敏业务 提供时延有界且高可靠的数据传输服务的同时,也能为非时敏业务提供高速率 但尽力而为的传输服务。The Industrial Internet is the core of smart manufacturing and smart factories, connecting all aspects of industrial manufacturing, aiming to improve manufacturing efficiency, optimize production management, and promote the transformation and upgrading of industrial manufacturing and the sustained and rapid development of the national economy. The requirement of deterministic delay of data transmission for emerging time-sensitive services poses no small challenge to the existing Ethernet. The IEEE802.1 working group proposed the time-sensitive networking (TSN) protocol. TSN is based on the wired Ethernet based on IEEE802.3, and adds and expands a series of functions and protocol standards to improve the ability of Ethernet to support real-time applications. It can not only provide time-sensitive services with bounded and highly reliable data transmission services, but also provide high-speed but best-effort transmission services for non-time-sensitive services.
IEEE 802.1AS作为TSN技术实现的前提,工作在全双工以太网的数据链路 层,通过时间戳传递的方式实现高精度的时钟同步。相较于传统的NTP、SNTP 同步协议,IEEE802.1AS协议将时钟类型进行了统一,同时采用对等延时机制, 能够提供亚微秒级的同步精度。IEEE 802.1AS works on the data link layer of full-duplex Ethernet as the premise of TSN technology, and realizes high-precision clock synchronization by means of time stamp transmission. Compared with the traditional NTP and SNTP synchronization protocols, the IEEE802.1AS protocol unifies the clock types and adopts a peer-to-peer delay mechanism, which can provide sub-microsecond synchronization accuracy.
时间戳的精度决定了同步的精度,在以时间戳为信息传输与计算的 IEEE802.1AS协议中高精度的时间戳对同步精度的提升起着至关重要的作用。 例如采用软件实现方式调用函数提取时间计数时,由于函数提取需要一定时间, 提取的时间计数与实际时间存在较大偏差,因此软件实现的时钟同步精度大多 不如硬件实现的同步精度。同时,链路的不对称性也是影响影响IEEE802.1AS 协议同步精度的主要因素之一。由于协议采用的是对等延时机制,而实际链路 由于节点间不同的配置以及处理数据时延不同,节点间往返链路时延往往呈现 非对称性,从而造成了一定的延时误差并且该误差会随着不对称度的加深而增 大。此外,理想情况下,实时时钟不随时间的推移以及外界环境的影响而变化, 但实际上晶振因存在温漂、固有抖动等问题,可能造成时钟源的不稳定从而产 生误差。例如,稳定性为±100ppm的时钟晶振源理论上每125ms同步一次产 生的累积误差最大值可达到12.5μs。因此,当主时钟节点失效后,各节点重新 进行BMCA选取最佳主时钟所需的较长时间里主从节点的同步误差也随之累 积,在选取出最佳主时钟前主从节点甚至可超过1us的同步误差,从而影响了时 敏业务的确定性时延传输。The precision of the time stamp determines the precision of synchronization. In the IEEE802.1AS protocol that uses time stamps for information transmission and calculation, high precision time stamps play a crucial role in improving the synchronization precision. For example, when the function is called to extract the time count in the software implementation, because the function extraction requires a certain time, the extracted time count has a large deviation from the actual time, so the clock synchronization accuracy realized by software is mostly not as good as the synchronization accuracy realized by hardware. At the same time, the asymmetry of the link is also one of the main factors affecting the synchronization accuracy of the IEEE802.1AS protocol. Since the protocol adopts the peer-to-peer delay mechanism, and the actual link has different configurations and different data processing delays between nodes, the round-trip link delay between nodes is often asymmetric, resulting in a certain delay error and This error increases as the asymmetry deepens. In addition, ideally, the real-time clock does not change with the passage of time and the influence of the external environment, but in fact, the crystal oscillator has problems such as temperature drift and inherent jitter, which may cause the instability of the clock source and cause errors. For example, a clock crystal oscillator with a stability of ±100ppm can theoretically generate a maximum cumulative error of 12.5μs when synchronizing every 125ms. Therefore, when the master clock node fails, the synchronization error of the master and slave nodes will also accumulate in the long time required for each node to re-execute BMCA to select the best master clock. Before the best master clock is selected, the master and slave nodes may even exceed The synchronization error of 1us affects the deterministic delay transmission of time-sensitive services.
综上所述,现有的时钟同步技术缺乏减小主时钟节点失效后重新选取所耗 时间内时钟误差的具体可靠性方案,同时协议关于对称链路的基础上测量路径 延时的前提缺乏实用性。因此,提高同步可靠性以及减小链路不对称性带来的 误差以提高同步精度成为研究重点。To sum up, the existing clock synchronization technology lacks a specific reliability scheme to reduce the clock error in the time consumed by re-selection after the failure of the master clock node, and the premise of the protocol for measuring path delay on the basis of symmetric links is not practical. sex. Therefore, improving synchronization reliability and reducing errors caused by link asymmetry to improve synchronization accuracy have become the focus of research.
发明内容SUMMARY OF THE INVENTION
基于现有协议存在的问题,本发明提供一种基于IEEE802.1AS冗余主时钟 的时钟同步方法,具体包括以下步骤:Based on the problems existing in the existing protocols, the present invention provides a clock synchronization method based on the IEEE802.1AS redundant master clock, which specifically includes the following steps:
同步集中控制节点接收时钟同步域中各时敏上报的时钟源参数信息获取冗 余时钟序列表以及当前最佳主时钟;The synchronization centralized control node receives the clock source parameter information reported by each time-sensitive in the clock synchronization domain to obtain the redundant clock sequence list and the current best master clock;
同步集中控制节点将冗余时钟序列表以及当前最佳主时钟下发到其他节 点,节点根据下发的主时钟序列表信息确定本地时钟主从状态;The synchronization centralized control node sends the redundant clock sequence list and the current best master clock to other nodes, and the node determines the master-slave state of the local clock according to the information of the master clock sequence list sent;
节点采用硬件时间戳作为时钟计数,同时采用时间戳精度补偿机制对时间 戳进行补偿;The node uses the hardware timestamp as the clock count, and uses the timestamp precision compensation mechanism to compensate the timestamp;
时钟同步域中各时敏节点考虑邻频比与不对称度对时延测量建模求解时延 误差,完成时钟同步。In the clock synchronization domain, each time-sensitive node considers the adjacent frequency ratio and asymmetry to model the delay measurement to solve the delay error and complete the clock synchronization.
进一步的,冗余时钟序列列表生成以及当前最佳主时钟选择的过程包括:Further, the process of generating the redundant clock sequence list and selecting the current best master clock includes:
同步集中控制节点接收到时钟同步域中各时敏节点上报的时钟源参数信 息,时钟源参数信息至少包括时钟源类、时钟误差估计值、时钟标识号;The synchronization centralized control node receives the clock source parameter information reported by each time-sensitive node in the clock synchronization domain, and the clock source parameter information at least includes the clock source type, the estimated clock error value, and the clock identification number;
采用数据集比较算法依次比较各节点上报的时钟源数据集参数,将最优的 节点的时钟作为最佳时钟,并将次优的两个节点的时钟生成冗余时钟序列表。The data set comparison algorithm is used to compare the clock source data set parameters reported by each node in turn, and the clock of the optimal node is used as the optimal clock, and the clocks of the two sub-optimal nodes are used to generate a redundant clock sequence table.
进一步的,时钟同步域中各时敏节点接收冗余时钟列表以及最佳主时钟信 息确认时钟树结构,即当有新节点加入时,根据该节点上报的时钟源参数信息 计算该节点的优劣排序,并根据排序将该节点加入到节点的时钟优劣排列表, 将该表封装到冗余时钟序列表报文下发并覆盖之前下发的报文。Further, each time-sensitive node in the clock synchronization domain receives the redundant clock list and the best master clock information to confirm the clock tree structure, that is, when a new node joins, the pros and cons of the node are calculated according to the clock source parameter information reported by the node. Sorting, and adding the node to the clock quality ranking table of the node according to the sorting, encapsulating the table into the redundant clock sequence table and sending the message and covering the previously sent message.
进一步的,采用时间戳精度补偿机制对时间戳进行补偿的过程包括以下步 骤:Further, the process of compensating the timestamp by using the timestamp precision compensation mechanism includes the following steps:
数据通过输入处理模块时依据报文类型的不同分别记录下接收请求报文时 接收方时间戳t2,接收回应报文时接收方时间戳t4以及接收同步报文时接收方 时间戳ts,在同步模块中提取本地时间比较得到入口延时值;;When the data passes through the input processing module, according to the different message types, the receiver timestamp t2 when the request message is received, the receiver timestamp t4 when the response message is received, and the receiver timestamp ts when the synchronization message is received are respectively recorded. The local time is extracted from the module to obtain the entry delay value;
数据从同步模块发出后,在输出数据处理模块时,根据报文类型的不同提 取发送请求报文时发送方时间戳t1,发送回应报文时发送方时间戳t3以及发送 同步报文时发送方时间戳tm,与本地时间比较得到出口延时值;After the data is sent from the synchronization module, when the data processing module is output, the sender’s timestamp t1 when sending the request message, the sender’s timestamp t3 when sending the response message, and the sender’s timestamp when sending the synchronization message are extracted according to different message types. Timestamp tm, compared with the local time to obtain the exit delay value;
报文关键信息提取模块根据算得的入口延时值与提取的出口延时值进行时 间戳补偿;The message key information extraction module performs timestamp compensation according to the calculated ingress delay value and the extracted egress delay value;
将修正后的时间戳发送至延时测量模块或同步修正模块。Send the corrected timestamp to the delay measurement module or the synchronization correction module.
进一步的,对发送时间戳和接收时间戳进行修正包括:Further, modifying the sending timestamp and the receiving timestamp includes:
egressTimestamp=egressMeasuredTimestamp+egressLatencyegressTimestamp=egressMeasuredTimestamp+egressLatency
igressTimestamp=igressMeasuredTimestamp-igressLatencyigressTimestamp=igressMeasuredTimestamp-igressLatency
其中,egressTimestamp为发送时间戳,igressTimestamp为接收时间戳,egressMeasuredTimestamp是同步模块记录的发送时间戳,egressLatency为出口延时 值,igressMeasuredTimestamp为同步模块记录的接收时间戳,igressLatency为入口延 时值。Among them, egressTimestamp is the sending timestamp, igressTimestamp is the receiving timestamp, egressMeasuredTimestamp is the sending timestamp recorded by the synchronization module, egressLatency is the egress delay value, igressMeasuredTimestamp is the receiving timestamp recorded by the synchronization module, and igressLatency is the entry delay value.
进一步的,时钟同步域中各时敏节点考虑邻频比与不对称度对时延测量建 模求解时延误差包括:Further, each time-sensitive node in the clock synchronization domain considers the adjacent frequency ratio and asymmetry to model the delay measurement and solve the delay error including:
其中,Delay_reply为求解得到的时延;fratio为邻节点频率比;t1为发送传 输延时请求报文时发送方的时间戳;t2为接收传输延时请求报文时接收方时钟 的时间戳;t3为发送回应报文时发送方的时间戳,t4为接收回应报文时接收方 时钟的时间戳;SDR为对称度。Among them, Delay_reply is the delay obtained by solving; f ratio is the frequency ratio of adjacent nodes; t1 is the timestamp of the sender when sending the transmission delay request message; t2 is the time stamp of the receiver's clock when receiving the transmission delay request message ; t3 is the timestamp of the sender when sending the response message, t4 is the timestamp of the receiver's clock when the response message is received; SDR is the degree of symmetry.
进一步的,为了获取更准确的时延,进行多次时延测量计算,将多次计算 的平均延时测量值作为时延,则第k次计算所得平均延时测量值表示为:Further, in order to obtain a more accurate time delay, multiple time delay measurement calculations are performed, and the average delay measurement value calculated for multiple times is taken as the time delay, then the average delay measurement value obtained by the k-th calculation is expressed as:
Davg,k=αDavg,k-1+(1-α)Dk-1;D avg,k =αD avg,k−1 +(1−α)D k−1 ;
其中,Dk-1是第k-1次延时测量值,Davg,k是第k次计算所得平均延时测量值; α是指数权重因子,表示为,M是测量次数。Among them, D k-1 is the k-1 delay measurement value, D avg,k is the average delay measurement value calculated at the kth time; α is the exponential weight factor, expressed as , M is the number of measurements.
进一步的,邻节点频率比fratio表示为:Further, the adjacent node frequency ratio f ratio is expressed as:
其中,t3(k)表示k时刻发送回应报文时发送方的时间戳,t3(k-1)表示k-1时 刻发送回应报文时发送方的时间戳;t4(k)表示k时刻接收回应报文时接收方时 钟的时间戳,t4(k-1)表示k-1时刻接收回应报文时接收方时钟的时间戳。Among them, t 3 (k) represents the time stamp of the sender when sending the response message at time k, t 3 (k-1) represents the time stamp of the sender when sending the response message at time k-1; t 4 (k) represents The timestamp of the receiver's clock when the response message is received at time k, and t 4 (k-1) represents the timestamp of the receiver's clock when the response message is received at time k-1.
进一步的,对称度SDR表示为:Further, the symmetry degree SDR is expressed as:
其中,Trans_request表示传输延时请求报文所需的时间,表示为 Trans_reply=t4-t3;Trans_reply表示传输延时回应报文所需的时间,表示为 Trans_request=t2-t1。Wherein, Trans_request represents the time required to transmit the delay request message, expressed as Trans_reply=t 4 -t 3 ; Trans_reply represents the time required to transmit the delay response message, expressed as Trans_request=t 2 -t 1 .
本发明通过采用冗余主时钟序列的方式使得全局网络在主时钟节点失效时 各节点能够依据冗余主时钟序列快速重新选取最佳主时钟,从而减小重新选取 所耗时间内累积的同步误差,同时提高了时钟同步的可靠性;通过考虑邻频比、 不对称度等因素对路径延时测量值建模并计算从而减小上述因素造成的同步误 差;基于硬件电路时钟计数并采用时间戳精度补偿机制减小记录的时间戳与实 际时间的偏差从而提高同步精度。By adopting the redundant master clock sequence, the present invention enables each node of the global network to quickly reselect the best master clock according to the redundant master clock sequence when the master clock node fails, thereby reducing the synchronization error accumulated in the time spent on re-selection At the same time, the reliability of clock synchronization is improved; by considering the adjacent frequency ratio, asymmetry and other factors, the path delay measurement value is modeled and calculated to reduce the synchronization error caused by the above factors; based on hardware circuit clock counting and using timestamps The precision compensation mechanism reduces the deviation between the recorded timestamp and the actual time to improve the synchronization precision.
附图说明Description of drawings
图1是本发明实施例中工业TSN网络模型;Fig. 1 is the industrial TSN network model in the embodiment of the present invention;
图2是本发明中基于冗余时钟的工业时间敏感网络时钟同步方法流程图;Fig. 2 is the flow chart of the industrial time-sensitive network clock synchronization method based on redundant clock in the present invention;
图3是本发明中实施例中主时钟序列表格式;Fig. 3 is the master clock sequence table format in the embodiment of the present invention;
图4是本发明中同步集中控制节点更新主时钟序列表流程图;Fig. 4 is the flow chart of updating master clock sequence table of synchronous centralized control node in the present invention;
图5是本发明中采用的连续delayrep消息原理图;Fig. 5 is the continuous delayrep message principle diagram adopted in the present invention;
图6为本发明中采用的节点路径延时测量流程图;6 is a flow chart of the node path delay measurement adopted in the present invention;
图7是本发明中采用的时间戳误差原理图;Fig. 7 is the time stamp error principle diagram adopted in the present invention;
图8是本发明采用的链路延时测量原理图。FIG. 8 is a schematic diagram of the link delay measurement adopted in the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是 全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
图1是本发明实例采用的工业TSN网络模型;本案例考虑如图1所示的由 多个终端与网桥以及一个同步集中控制节点组成的工业TSN网络。各节点上报 时钟源参数信息至同步集中控制节点选取出一个最佳主时钟节点,以此节点作 为根节点生成如图所示的时钟生成树。Fig. 1 is the industrial TSN network model adopted by the example of the present invention; this case considers the industrial TSN network composed of multiple terminals and bridges and a synchronous centralized control node as shown in Fig. 1 . Each node reports the clock source parameter information to the synchronization centralized control node to select an optimal master clock node, and use this node as the root node to generate the clock spanning tree as shown in the figure.
图2是本发明实例中的一种基于冗余时钟的工业时间敏感网络时钟同步方 法流程图,本发明时钟同步方法通过冗余时钟序列表提高同步可靠性即主时钟 出了问题可以根据序列表顺序重新选取主时钟;通过时间戳补偿机制以及路径 延时测量补偿减小同步误差从而提高同步精度,IEEE802.1AS协议的时钟同步 修正值是通过时间戳以及路径延时测量值进行计算的,考虑上述的因素可以减 小延时测量误差从而减小同步误差;本发明方法保障时钟同步的可靠性的同时 提高同步精度,该方法方法包括以下步骤:2 is a flowchart of an industrial time-sensitive network clock synchronization method based on redundant clocks in an example of the present invention. The clock synchronization method of the present invention improves synchronization reliability through a redundant clock sequence table, that is, if the master clock has a problem, it can be The master clock is reselected in sequence; the synchronization error is reduced by the time stamp compensation mechanism and path delay measurement compensation to improve the synchronization accuracy. The clock synchronization correction value of the IEEE802.1AS protocol is calculated by the time stamp and the path delay measurement value. Considering The above factors can reduce the delay measurement error and thus reduce the synchronization error; the method of the present invention ensures the reliability of clock synchronization while improving the synchronization accuracy, and the method method comprises the following steps:
步骤1:同步集中控制节点接收时钟同步域中各时敏节点上报的时钟源参数 信息,通过数据集比较算法选取出冗余时钟序列以及当前最佳主时钟。同步集 中控制节点通过集中式配置的方法为时钟同步域中所有时敏节点下发冗余时钟 序列以及当前最佳主时钟信息。图3为同步集中控制节点生成的主时钟序列表 格式,如图所示,表项由节点的时钟标识号与其对应的主时钟序列顺序组成。Step 1: The synchronization centralized control node receives the clock source parameter information reported by each time-sensitive node in the clock synchronization domain, and selects the redundant clock sequence and the current best master clock through the data set comparison algorithm. The synchronization centralized control node sends the redundant clock sequence and the current best master clock information to all the time-sensitive nodes in the clock synchronization domain through centralized configuration. Figure 3 shows the format of the master clock sequence table generated by the synchronization centralized control node. As shown in the figure, the table entry is composed of the node's clock identification number and its corresponding master clock sequence order.
步骤2:节点根据下发的主时钟序列表信息确定本地时钟主从状态,图4是 同步集中控制节点在新节点加入后更新主时钟序列表流程图,如图所示,新加 入节点上报自身时钟源参数信息至同步集中控制节点,同步集中控制节点将该 节点信息与主时钟序列表表项依次比较,若优于某一表项则以该节点时钟标识 号生成对应表项,序列表中原有此顺序往后的表项顺序集体后移一位。若比较 完所有选项未有劣于新节点的,则在原有主时钟序列表项末尾增加以此节点生 成的新表项。Step 2: The node determines the master-slave state of the local clock according to the master clock sequence table information issued. Figure 4 is the flow chart of the synchronization centralized control node updating the master clock sequence table after the new node joins. As shown in the figure, the newly added node reports itself The clock source parameter information is sent to the synchronization centralized control node, and the synchronization centralized control node compares the node information with the master clock sequence table entry in turn. The order of entries in this order is collectively shifted back by one. If all options are compared and no one is inferior to the new node, a new entry generated by this node is added to the end of the original master clock sequence entry.
步骤3:节点考虑邻频比与不对称度对链路延时测量进行建模,从而减小上 述因素带来的同步误差,具体过程包括:Step 3: The node models the link delay measurement considering the adjacent frequency ratio and asymmetry, thereby reducing the synchronization error caused by the above factors. The specific process includes:
当使用非对称流量时,必须知道传播和传输延迟的差异,并且由于时间敏 感网络的同步过程包含不同的节点模型、动态数据速率和不对称特性,因此有 必要提出一个模型来处理这些变量。Differences in propagation and transmission delays must be known when using asymmetric traffic, and since the synchronization process of time-sensitive networks involves different node models, dynamic data rates, and asymmetric properties, it is necessary to propose a model to handle these variables.
1)对称度SDR1) Symmetry SDR
其中Trans_request和Trans_reply分别是传输延时请求报文和回应报文所需的时间,包括传输时延与数据传播时延Among them, Trans_request and Trans_reply are the time required to transmit delay request message and response message respectively, including transmission delay and data propagation delay
Trans_reply=t4-t3 Trans_reply=t 4 -t 3
Trans_request=t2-t1 Trans_request=t 2 -t 1
其中,t1和t2分别是发送和接收传输延时请求报文时发送方和接收方时钟 的时间戳。类似地,t3和t4是发送和接收回应报文时发送方和接收方时钟的时 间戳。Among them, t1 and t2 are the time stamps of the sender's and receiver's clocks when the transmission delay request message is sent and received, respectively. Similarly, t3 and t4 are the timestamps of the sender's and receiver's clocks when the reply message was sent and received.
Transtimerequest为请求报文传输时间,Transtimereply为回应报文传输时间,确定性时间差Δfixed_time等于两者相减的绝对值。Transtime request is the transmission time of the request message, Transtime reply is the transmission time of the response message, and the deterministic time difference Δ fixed_time is equal to the absolute value of the subtraction of the two.
Δfixed_time=|Transtimerequest-Transtimereply|Δ fixed_time = |Transtime request -Transtime reply |
在有线场景下,数据的传播时间基本固定,数据链路的不对称性主要体现 在报文在节点内部的传输时间之差。In the wired scenario, the data propagation time is basically fixed, and the asymmetry of the data link is mainly reflected in the difference in the transmission time of the packets within the node.
t4-t3=(t2-t1)+Δfixed_time t 4 -t 3 =(t 2 -t 1 )+ Δfixed_time
可得SDR比率:Available SDR ratios:
2)邻节点频率比fratio:2) Adjacent node frequency ratio f ratio :
实际测量中,时间戳t1与t4使用发送者节点的时钟源作为计数参考,t2与 t3使用响应者的时钟源作为计数参考,若是两个时钟源的晶振源频率存在差异, 会给延时测量带来一定误差。因此,为了在从时钟上获得准确的同步时间,计 算相邻时间感知设备的频率比fratio用于补偿本地时钟的漂移时间。In the actual measurement, timestamps t1 and t4 use the clock source of the sender node as the counting reference, and t2 and t3 use the clock source of the responder as the counting reference. If the frequency of the crystal oscillator source of the two clock sources is different, a delay measurement will be given. bring some errors. Therefore, in order to obtain accurate synchronization time on the slave clock, the frequency ratio f ratio of adjacent time-aware devices is calculated to compensate for the drift time of the local clock.
图5为连续delayrep消息原理图,如图所示,fratio的值可以通过最后两个随 后的delayrep消息来计算:Figure 5 is a schematic diagram of continuous delayrep messages. As shown, the value of f ratio can be calculated by the last two subsequent delayrep messages:
其中,t3(k)和t3(k-1)分别是接收节点时钟和发送相邻时间感知节点中的delayrep消息的先前时间戳。类似地,t4(k)和t4(k-1)是同一delayrep消息的当前时 间戳值。where t 3 (k) and t 3 (k-1) are the receiving node clock and the previous timestamp of the delayrep message in the sending adjacent time-aware node, respectively. Similarly, t 4 (k) and t 4 (k-1) are the current timestamp values of the same delayrep message.
3)计算Delay_reply值3) Calculate the Delay_reply value
一次测量的结果可能存在较大偏差,为计算出更准确的延时测量值,需进 行多次计算:The result of one measurement may have a large deviation. In order to calculate a more accurate delay measurement value, it is necessary to perform multiple calculations:
Davg,k=αDavg,k-1+(1-α)Dk-1 D avg , k =αD avg , k-1 +(1-α)D k-1
其中,Dk-1是第k-1次延时测量,Davg,k是第k次计算所得平均延时测量值,α 是指数权重因子,M是测量次数。Wherein, D k-1 is the k-1 th delay measurement, D avg,k is the average delay measurement value calculated for the k th time, α is an exponential weighting factor, and M is the number of measurements.
图6为节点路径延时测量流程图,如图所示,节点在接收到四个时间戳后 首先计算邻频比与不对称度,随后代入建立的延时测量值模型中求出精确地链 路延时值并根据平均计算方法进行计算得出最后采用的链路延时测量值。Figure 6 is the flow chart of the node path delay measurement. As shown in the figure, the node first calculates the adjacent frequency ratio and asymmetry after receiving the four time stamps, and then substitutes it into the established delay measurement value model to obtain the exact link The link delay value is calculated according to the average calculation method to obtain the finally adopted link delay measurement value.
本实施例中t1~t4通过延时测量的报文交互过程产生的时间戳进行计算,如 图8,talker发送路径延时请求报文并记录时间戳t1,listener接收请求报文并记 录时间戳t2,之后listener返回一个含时间戳t2的响应报文并记录下发送时间t3, 发送完响应报文后listener再将t3封装至跟随报文发送至talker,talker接收到含 t2的响应报文时记录下接收时间戳t4,通过接受或记录到的时间戳t1\t2\t3\t4计 算路径延时值。In this embodiment, t1 to t4 are calculated based on the time stamps generated by the message exchange process of delay measurement. As shown in Figure 8, the talker sends a path delay request message and records the time stamp t1, and the listener receives the request message and records the time stamp t2, then the listener returns a response message with timestamp t2 and records the sending time t3. After sending the response message, the listener encapsulates t3 to follow the message and sends it to the talker. When the talker receives the response message with t2 Record the received timestamp t4, and calculate the path delay value through the received or recorded timestamp t1\t2\t3\t4.
步骤4:节点采用硬件时间戳作为时钟计数,同时采用时间戳精度补偿机制 减小记录时间与实际时间的误差。图7为本发明中采用的时间戳误差原理图, 如图所示,数据收发的时间戳记录时间与实际时间存在着输出延时或者输入延 时的误差,从而降低了时间戳的准确性进而降低了同步精度。本发明采用时间 戳精度补偿机制如下:Step 4: The node uses the hardware timestamp as the clock count, and adopts the timestamp precision compensation mechanism to reduce the error between the recording time and the actual time. Fig. 7 is a schematic diagram of the time stamp error used in the present invention. As shown in the figure, there is an output delay or input delay error between the time stamp recording time of data transmission and reception and the actual time, which reduces the accuracy of the time stamp and further reduces the accuracy of the time stamp. Reduced synchronization accuracy. The present invention adopts the time stamp precision compensation mechanism as follows:
egressTimestamp=egressMeasuredTimestamp+egressLatencyegressTimestamp=egressMeasuredTimestamp+egressLatency
igressTimestamp=igressMeasuredTimestamp-igressLatencyigressTimestamp=igressMeasuredTimestamp-igressLatency
其中,egressTimestamp为发送时间戳,igressTimestamp为接收时间戳,egressMeasuredTimestamp是同步模块记录的发送时间戳,egressLatency为出口延时 值,igressMeasuredTimestamp为同步模块记录的接收时间戳,igressLatency为入口延 时值。Among them, egressTimestamp is the sending timestamp, igressTimestamp is the receiving timestamp, egressMeasuredTimestamp is the sending timestamp recorded by the synchronization module, egressLatency is the egress delay value, igressMeasuredTimestamp is the receiving timestamp recorded by the synchronization module, and igressLatency is the entry delay value.
具体实现步骤如下:The specific implementation steps are as follows:
步骤1:数据通过输入处理模块时记录下接收时间戳并封装至报头中,在同 步模块中提取报头时间戳与本地时间计算可得入口延时值。Step 1: When the data passes through the input processing module, record the received timestamp and encapsulate it into the header, and extract the header timestamp and local time in the synchronization module to calculate the entry delay value.
步骤2:数据从同步报文模块发出后,在输出数据处理模块时,提取报文携 带的发送时间戳与本地时间戳计算得到出口延时值并封装到数据报文的保留为 中。Step 2: After the data is sent from the synchronization message module, when outputting the data processing module, extract the sending time stamp and the local time stamp carried by the message to calculate the egress delay value and encapsulate it into the reserved value of the data message.
步骤3:报文关键信息提取模块根据算得的入口延时值与提取的出口延时值 对得到的时间戳按照上述公式进行修正,将修正后的时间戳发送至延时测量模 块或同步修正模块以供延时测量值与时钟偏移的计算。Step 3: The message key information extraction module corrects the obtained time stamp according to the calculated ingress delay value and the extracted egress delay value according to the above formula, and sends the modified time stamp to the delay measurement module or the synchronization correction module For calculation of delay measurements and clock skew.
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言, 可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变 化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications and substitutions can be made in these embodiments without departing from the principle and spirit of the invention and modifications, the scope of the present invention is defined by the appended claims and their equivalents.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111481939.0A CN114389735A (en) | 2021-12-06 | 2021-12-06 | A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111481939.0A CN114389735A (en) | 2021-12-06 | 2021-12-06 | A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114389735A true CN114389735A (en) | 2022-04-22 |
Family
ID=81196449
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111481939.0A Pending CN114389735A (en) | 2021-12-06 | 2021-12-06 | A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114389735A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114978395A (en) * | 2022-04-26 | 2022-08-30 | 国家电网有限公司 | High-reliability time synchronization method of time-sensitive network |
CN115190577A (en) * | 2022-05-11 | 2022-10-14 | 四川创智联恒科技有限公司 | O-RAN system time sequence synchronization mutual backup method |
CN115694704A (en) * | 2022-10-28 | 2023-02-03 | 重庆长安汽车股份有限公司 | Time synchronization method, device, equipment and storage medium |
CN115941552A (en) * | 2022-12-01 | 2023-04-07 | 杭州趣链科技有限公司 | Information transmission delay calculation method, device, electronic equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1045518A1 (en) * | 1999-04-16 | 2000-10-18 | Infineon Technologies North America Corp. | Phase Mixer |
CN101034950A (en) * | 2007-04-20 | 2007-09-12 | 北京中星微电子有限公司 | Clock synchronization method and device |
CN101977104A (en) * | 2010-11-13 | 2011-02-16 | 上海交通大学 | IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof |
US20160330012A1 (en) * | 2014-01-31 | 2016-11-10 | University Of North Dakota | Network clock skew estimation and calibration |
CN112165369A (en) * | 2020-09-11 | 2021-01-01 | 上海创时汽车科技有限公司 | Time sensitive network redundant clock synchronization method and synchronization system thereof |
CN112887226A (en) * | 2021-01-26 | 2021-06-01 | 重庆邮电大学 | Method for managing and scheduling satellite time-sensitive network queue with wired and wireless integration |
CN112904705A (en) * | 2021-01-22 | 2021-06-04 | 重庆邮电大学 | Hierarchical clock synchronization method between low-orbit small satellites |
CN113411153A (en) * | 2021-06-07 | 2021-09-17 | 中国人民解放军国防科技大学 | Centralized control time synchronization method for time sensitive network |
CN113660052A (en) * | 2021-10-21 | 2021-11-16 | 之江实验室 | Precise clock synchronization device and method based on endogenous security mechanism |
-
2021
- 2021-12-06 CN CN202111481939.0A patent/CN114389735A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1045518A1 (en) * | 1999-04-16 | 2000-10-18 | Infineon Technologies North America Corp. | Phase Mixer |
CN101034950A (en) * | 2007-04-20 | 2007-09-12 | 北京中星微电子有限公司 | Clock synchronization method and device |
CN101977104A (en) * | 2010-11-13 | 2011-02-16 | 上海交通大学 | IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof |
US20160330012A1 (en) * | 2014-01-31 | 2016-11-10 | University Of North Dakota | Network clock skew estimation and calibration |
CN112165369A (en) * | 2020-09-11 | 2021-01-01 | 上海创时汽车科技有限公司 | Time sensitive network redundant clock synchronization method and synchronization system thereof |
CN112904705A (en) * | 2021-01-22 | 2021-06-04 | 重庆邮电大学 | Hierarchical clock synchronization method between low-orbit small satellites |
CN112887226A (en) * | 2021-01-26 | 2021-06-01 | 重庆邮电大学 | Method for managing and scheduling satellite time-sensitive network queue with wired and wireless integration |
CN113411153A (en) * | 2021-06-07 | 2021-09-17 | 中国人民解放军国防科技大学 | Centralized control time synchronization method for time sensitive network |
CN113660052A (en) * | 2021-10-21 | 2021-11-16 | 之江实验室 | Precise clock synchronization device and method based on endogenous security mechanism |
Non-Patent Citations (2)
Title |
---|
HAYTHAM BANIABDELGHANY: ""Extended Synchronization Protocol Based on IEEE802.1AS for Improved Precision in Dynamic and Asymmetric TSN Hybrid Networks"", 《2020 9TH MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING》 * |
LAN/MAN STANDARDS COMMITTEE: ""Timing and Synchronization for Time-Sensitive Applications"", 《IEEE STD 802.1AS™‐2020》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114978395A (en) * | 2022-04-26 | 2022-08-30 | 国家电网有限公司 | High-reliability time synchronization method of time-sensitive network |
CN115190577A (en) * | 2022-05-11 | 2022-10-14 | 四川创智联恒科技有限公司 | O-RAN system time sequence synchronization mutual backup method |
CN115190577B (en) * | 2022-05-11 | 2023-10-13 | 四川创智联恒科技有限公司 | ORAN system time sequence synchronization mutual backup method |
CN115694704A (en) * | 2022-10-28 | 2023-02-03 | 重庆长安汽车股份有限公司 | Time synchronization method, device, equipment and storage medium |
CN115941552A (en) * | 2022-12-01 | 2023-04-07 | 杭州趣链科技有限公司 | Information transmission delay calculation method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114389735A (en) | A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock | |
CN111585683A (en) | High-reliability clock synchronization system and method for time-sensitive network | |
US9667370B2 (en) | Communication device with peer-to-peer assist to provide synchronization | |
US10056999B2 (en) | Time synchronization error compensation method for multi-hop wireless backhaul network based on PTP | |
JP5658375B2 (en) | Method for synchronizing master and slave clocks in a packet switched network with aggregated connections between nodes and associated synchronization device | |
CN114050884B (en) | Cross-network time synchronization method for industrial wireless and TSN fusion | |
CN106452650B (en) | A Clock Synchronization Frequency Offset Estimation Method for Multi-hop Wireless Sensor Networks | |
US20130215753A1 (en) | Non-intrusive method for synchronizing master and slave clocks of a packet-switched network, and associated synchronization devices | |
US8861668B2 (en) | Transmission device, transmission method and computer program | |
JP2015506626A (en) | Method and apparatus for communicating time information between time recognition devices | |
CN103929293A (en) | Asymmetric delay time synchronization method and system | |
CN108650050A (en) | A kind of distributed network clock synchronous method | |
CN113259038A (en) | Time synchronization method, node, device and storage medium | |
CN113574813B (en) | Network entity and method for a wireless network system for determining time information | |
CN108134644B (en) | Synchronization method, device, synchronization device and system | |
CN111416785A (en) | Method for estimating relative frequency offset of consistent clock synchronization based on weighted median | |
CN111682919A (en) | A Time Synchronization Method of Downhole Sensing Equipment Based on Time Sensitive Network | |
WO2023098683A1 (en) | Real-time clock synchronization method and system for power distribution terminal, and power distribution terminal | |
CN104601269A (en) | Master and slave clock synchronization method and system | |
Garner et al. | Synchronization of audio/video bridging networks using IEEE 802.1 AS | |
CN101902291B (en) | Method, equipment and system for precise time synchronization | |
CN114070448B (en) | A Master Clock Selection Method Based on Multiple Attribute Decision Making | |
CN109150358B (en) | A distributed clock synchronization method and system | |
CN112751641B (en) | A TSN network time synchronization method, device and storage medium | |
EP2458757A1 (en) | A method for transmitting IEEE 1588V2 synchronization packets over ethernet in link-by-link mode, via network elements having a transparent clock, and associated help device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220422 |
|
RJ01 | Rejection of invention patent application after publication |