[go: up one dir, main page]

CN100518045C - A Method for Realizing Mutual Synchronization of Clocks - Google Patents

A Method for Realizing Mutual Synchronization of Clocks Download PDF

Info

Publication number
CN100518045C
CN100518045C CNB2004100448847A CN200410044884A CN100518045C CN 100518045 C CN100518045 C CN 100518045C CN B2004100448847 A CNB2004100448847 A CN B2004100448847A CN 200410044884 A CN200410044884 A CN 200410044884A CN 100518045 C CN100518045 C CN 100518045C
Authority
CN
China
Prior art keywords
clock
frequency
local
input reference
mutually synchronization
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.)
Expired - Fee Related
Application number
CNB2004100448847A
Other languages
Chinese (zh)
Other versions
CN1585273A (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB2004100448847A priority Critical patent/CN100518045C/en
Publication of CN1585273A publication Critical patent/CN1585273A/en
Application granted granted Critical
Publication of CN100518045C publication Critical patent/CN100518045C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The method applies a programming logic component FPGA chip and a local high speed working clock, by the method of sampling count, multiple input clocks are counted and measured, the result of the measurement is processed with weight average computation. According the result of the computation and the local high-speed clock, the synchroization clock standard related with the multiple input clocks is copied. This clock standard will be sent to the locked loop of master/slave synchronization to supply the system with the clocks of all frequency.

Description

一种实现时钟互同步的方法 A Method for Realizing Mutual Synchronization of Clocks

技术领域 technical field

本发明涉及通信网中的时钟同步方法,尤其涉及在网状拓扑的通信网或对节点的抗毁性有特殊要求的专网中的时钟同步方法。The invention relates to a clock synchronization method in a communication network, in particular to a clock synchronization method in a mesh topology communication network or a special network with special requirements on node invulnerability.

背景技术 Background technique

在网状拓扑的通信网中,各交换节点处于同等地位,各节点之间无主从之分,时钟的分布成网状的结构,这种情况下各节点时钟的产生不适合采用主从同步的方式,而宜采用互同步的方式。由于互同步网中不存在主节点,不存在主节点毁坏后整网时钟失锁的情况,在任一节点毁坏后,仍然能保持较好的时钟稳定度,可靠性有较大的改善。In the communication network of mesh topology, each switching node is in the same position, there is no master-slave distinction between nodes, and the distribution of clocks is a mesh structure. In this case, the generation of clocks of each node is not suitable for master-slave synchronization. way, but should adopt the way of mutual synchronization. Since there is no master node in the mutual synchronization network, there is no situation that the clock of the entire network loses lock after the master node is destroyed. After any node is destroyed, the clock stability can still be maintained, and the reliability is greatly improved.

传统的互同步实现原理如图1,通常其各节点的时钟是由一个多输入端的锁相环产生,其它节点的输入参考时钟信号经过相位比较,取他们的加权平均值后,用来控制压控振荡器的频率输出,当系统正常运行过程中,各交换节点的时钟源时钟始终处于一种动态调整过程中,只是调整步长越来越小,最后全网时钟稳定在一个频率附近,从而将滑码和滑码率控制在需要的范围内。该互同步传统实现方法的最大问题就是其实现的软硬件复杂程度较高,通常需要CPU和软件的参与。The principle of traditional mutual synchronization is shown in Figure 1. Usually, the clock of each node is generated by a multi-input phase-locked loop, and the input reference clock signals of other nodes are compared in phase, and their weighted average is taken to control the voltage. Oscillator frequency output, when the system is running normally, the clock source clock of each switching node is always in a dynamic adjustment process, but the adjustment step size is getting smaller and smaller, and finally the whole network clock is stable around a frequency, thus Control the slip code and slip rate within the required range. The biggest problem of the traditional mutual synchronization implementation method is that the software and hardware for its implementation are highly complex, and usually require the participation of CPU and software.

发明内容 Contents of the invention

本发明目的就是为了解决上述问题,提出一种可简单地产生互同步本地工作时钟的实现时钟互同步的方法。The object of the present invention is to solve the above-mentioned problems, and propose a method for realizing mutual synchronization of clocks, which can simply generate mutual synchronous local working clocks.

本发明的技术解决方案:Technical solution of the present invention:

一种实现时钟互同步的方法,其特征在于它采用一片可编程逻辑器件FPGA和一个本地的高速工作时钟,利用高速的本地时钟通过采样计数的方法对多个输入参考时钟基准进行计数测量,并对测量结果进行加权平均运算,根据运算后的结果和本地的高速时钟恢复出一个与各输入参考时钟相关的互同步时钟基准,再将该时钟基准送给一个通常意义上的主从同步的锁相环,主从同步的锁相环倍频出本地节点交换机所需的同步的工作时钟,从而将复杂的互同步过程转化为简单的主从同步过程。A method for realizing clock mutual synchronization is characterized in that it adopts a programmable logic device FPGA and a local high-speed working clock, utilizes the high-speed local clock to count and measure a plurality of input reference clock references by sampling and counting, and Perform weighted average calculation on the measurement results, recover a mutually synchronous clock reference related to each input reference clock according to the calculated results and the local high-speed clock, and then send the clock reference to a master-slave synchronization lock in the usual sense Phase loop, master-slave synchronous phase-locked loop multiplies the frequency to generate the synchronous working clock required by the local node switch, thus transforming the complex mutual synchronization process into a simple master-slave synchronization process.

本发明采用一片可编程逻辑器件FPGA和一个本地的高速工作时钟,通过采样计数的方法完成对多个输入参考时钟的测量,对测量结果进行加权平均运算,恢复出一个与各输入参考时钟相关的互同步时钟基准,再将该时钟基准送给一个通常意义上的主从同步的锁相环,得到本地系统所需的各种频率时钟,从而将复杂的互同步过程转化为简单的主从同步过程。本发明提供了一种简单地产生互同步工作时钟的方法,它大大简化了传统的互同步时钟产生的复杂程度,从而易于调试、生产和维护。The present invention adopts a programmable logic device FPGA and a local high-speed working clock, completes the measurement of multiple input reference clocks through the method of sampling and counting, performs weighted average calculation on the measurement results, and restores a clock related to each input reference clock. Mutual synchronization clock reference, and then send the clock reference to a master-slave synchronization phase-locked loop in the usual sense to obtain various frequency clocks required by the local system, thus converting the complex mutual synchronization process into simple master-slave synchronization process. The invention provides a method for simply generating mutually synchronous working clocks, which greatly simplifies the complexity of traditional mutually synchronous clock generation, thereby facilitating debugging, production and maintenance.

附图说明 Description of drawings

图1是传统互同步方式各节点时钟的产生原理图。Fig. 1 is a schematic diagram of generation of clocks of each node in the traditional mutual synchronization mode.

图2是本发明产生互同步本地时钟的实现框图。Fig. 2 is a realization block diagram of generating mutually synchronous local clocks in the present invention.

图3是本发明高速工作时钟对输入参考时钟的采样计数示意图。FIG. 3 is a schematic diagram of sampling and counting of an input reference clock by a high-speed working clock in the present invention.

图4是本发明互同步时钟基准的产生的方法图。Fig. 4 is a diagram of a method for generating a mutually synchronous clock reference in the present invention.

具体实施方式 Detailed ways

本发明的实现时钟互同步的方法如图2,它分为两部分,可编程逻辑器件FPGA部分和传统的主从同步锁相环部分。The method for realizing clock mutual synchronization of the present invention is shown in Fig. 2, and it is divided into two parts, programmable logic device FPGA part and traditional master-slave synchronous phase-locked loop part.

FPGA部分主要是利用高速的本地时钟对多个输入参考时钟基准进行计数测量,对测量结果进行加权平均运算。根据运算后的结果和本地的高速时钟恢复出一个与各输入参考时钟相关的互同步时钟基准。图2、图3给出了FPGA部分实现上述功能的示意图。The FPGA part mainly uses the high-speed local clock to count and measure multiple input reference clock benchmarks, and performs weighted average calculation on the measurement results. According to the calculated result and the local high-speed clock, a mutually synchronous clock reference related to each input reference clock is recovered. Figure 2 and Figure 3 show the schematic diagrams of the FPGA part to realize the above functions.

传统主从同步锁相环的功能主要是根据图2中FPGA输出的互同步时钟基准,倍频出本地节点交换机所需的同步的工作时钟。The function of the traditional master-slave synchronous phase-locked loop is mainly based on the mutually synchronous clock reference output by the FPGA in Figure 2, and multiplies the frequency to obtain the synchronous working clock required by the local node switch.

在网络通信的各节点设备中,系统送给本地节点的时钟基准通常为较低频率的时钟(其它高速的时钟基准可以采用简单的分频的方法将其变为较低频率的时钟),在本地采用一个高速的工作时钟对各路输入时钟基准的周期进行计数测量。考虑到实际应用时,各路输入的时钟基准之间的频率差别很小,为提高测量的分辨率,可以采用对多个时钟周期进行计数的方法(本发明中设为M个周期)。如图3所示:In each node device of network communication, the clock reference sent by the system to the local node is usually a lower frequency clock (other high-speed clock references can be converted into a lower frequency clock by a simple frequency division method). A high-speed working clock is used locally to count and measure the period of each input clock reference. In consideration of practical application, the frequency difference between the clock references of each input is very small, in order to improve the resolution of measurement, a method of counting multiple clock cycles (set as M cycles in the present invention) can be used. As shown in Figure 3:

假设高速时钟的频率为f,输入基准频率分别为:f0+Δf1,f0+Δf2….f0+Δfn,其中f=K*f0,则通过时钟计数的方法可以分辩的最小频率差可由下式算得:Assuming that the frequency of the high-speed clock is f, the input reference frequencies are: f0+Δf1, f0+Δf2...f0+Δfn, where f=K*f0, then the minimum frequency difference that can be distinguished by clock counting can be calculated by the following formula :

M/f0-M/(f0+Δf1)=1/f    (式1)M/f0-M/(f0+Δf1)=1/f (Formula 1)

得出:inferred:

Δf1=f0/(M*K-1)         (式2)Δf1=f0/(M*K-1) (Formula 2)

考虑到f>>f0,可近似认为:Considering f>>f0, it can be approximated as:

Δf1≈f0/(M*K)           (式3)Δf1≈f0/(M*K) (Formula 3)

由式3,可知道通过调整M和K的值,可以得到任意精度的时钟差值,当然考虑到FPGA的工作时钟速率的限制,K值不可以无限大下去,可通过加大M值的方式,提供时钟的计算精度。From Equation 3, it can be known that by adjusting the values of M and K, the clock difference of any precision can be obtained. Of course, considering the limitation of the working clock rate of the FPGA, the value of K cannot be infinitely increased, and the value of M can be increased. , providing the computational precision of the clock.

通过上述的方法可以得出:每一路参考时钟基准在M个时钟周期内相对于高速时钟采样的计数值(num0+Δnum_i),其中num0=M*K,对所有的Δnum_i进行加权平均计算,便可得到最后所需的Δnum值,此时的(num0+Δnum)便是平均处理后的互同步时钟基准在M个周期内通过高速采样得到的计数值。Through the above method, it can be obtained: the count value (num0+Δnum_i) of each reference clock reference relative to the high-speed clock sampling within M clock cycles, where num0=M*K, weighted average calculation is performed on all Δnum_i, then The final required value of Δnum can be obtained, and (num0+Δnum) at this time is the count value obtained by high-speed sampling within M cycles of the averaged mutually synchronous clock reference.

下面给出一个具体的例子,作为具体设计的参考,假定本地工作时钟的频率为66MHz,输入的参考时钟基准为8KHz。该例子中K=8250,M取值为64,则对64个8KHz基准的周期进行计数采样,可分辨的最小频率差为2ppm左右。图2中的FPGA采用Altera的EP1K50FC256-3,锁相环采用普通的模拟锁相环TRU050GCLGA 16.384/2.048,恢复出系统所需的2.048M或16.384M时钟。A specific example is given below, as a reference for specific design, it is assumed that the frequency of the local working clock is 66MHz, and the input reference clock base is 8KHz. In this example, K=8250, and the value of M is 64, then 64 cycles of 8KHz reference are counted and sampled, and the minimum resolvable frequency difference is about 2ppm. The FPGA in Figure 2 uses Altera's EP1K50FC256-3, and the phase-locked loop uses an ordinary analog phase-locked loop TRU050GCLGA 16.384/2.048 to recover the 2.048M or 16.384M clock required by the system.

下面给出一个具体的例子,作为具体设计的参考,假定本地工作时钟的频率为66MHz,输入的参考时钟基准为8KHz。该例子中K=8250,M值取为64,则对64个8KHz基准的周期进行计数采样,可分辨的最小频率差为2ppm左右。图2中的FPGA采用Altera的EP1K50FC256-3,锁相环采用普通的模拟锁相环TRU050GCLGA 16.384/2.048,恢复出系统所需的2.048M或16.384M时钟。A specific example is given below, as a reference for specific design, it is assumed that the frequency of the local working clock is 66MHz, and the input reference clock base is 8KHz. In this example, K=8250, and the value of M is 64, then 64 cycles of 8KHz reference are counted and sampled, and the minimum resolvable frequency difference is about 2ppm. The FPGA in Figure 2 uses Altera's EP1K50FC256-3, and the phase-locked loop uses an ordinary analog phase-locked loop TRU050GCLGA 16.384/2.048 to recover the 2.048M or 16.384M clock required by the system.

由本地高速时钟f和(num0+Δnum)的值,通过下面的方法可恢复出互同步的参考时钟。图4形象地描述了该恢复过程。From the values of the local high-speed clock f and (num0+Δnum), the mutually synchronous reference clocks can be recovered by the following method. Figure 4 vividly describes the recovery process.

在图2的FPGA中构建一个以((M*K)/2+Δnum/2-M)作为周期阀值的计数器。计数器的时钟输入采用本地的高速时钟:每当收到本地高速时钟(频率为f)来的一个上升沿时,计数器的值便加上M。Build a counter with ((M*K)/2+Δnum/2-M) as the cycle threshold value in the FPGA of Figure 2 . The clock input of the counter adopts the local high-speed clock: whenever a rising edge from the local high-speed clock (frequency f) is received, the value of the counter is added to M.

另外,在FPGA中构建一个比较器,当上面计数器计数值大于或等于((M*K)/2+Δnum/2-M)时,将当前计数器值和周期阀值进行减法运算,得到的差值,赋给该计数器作为下一次计数的初值。同时驱动另一个输出的寄存器进行一次翻转,这个输出寄存器的值便是需要得的平均处理后的时钟基准。考虑到网络时钟的波动性,高速时钟对各路时钟基准的采样要持续进行,并实时周期性地更新图4中的计数器的阀值,保证产生的互同步基准能够正确的体现出当时的网络时钟状况。In addition, build a comparator in the FPGA. When the above counter count value is greater than or equal to ((M*K)/2+Δnum/2-M), the current counter value and the cycle threshold are subtracted, and the obtained difference is Value, assigned to the counter as the initial value of the next count. At the same time, another output register is driven to perform a flip, and the value of this output register is the clock reference after the average processing that needs to be obtained. Considering the fluctuation of the network clock, the high-speed clock should continuously sample the clock references of various channels, and periodically update the threshold value of the counter in Figure 4 in real time to ensure that the generated mutual synchronization reference can correctly reflect the current network clock condition.

采用本发明的方法得出的互同步时钟基准,原则上对输入时钟基准的频偏没有任何的限制,可以通过适当调节M和K的值,来得到正确的互同步的基准。实际应用时主要是受图2中主从同步锁相环压控晶振的牵引范围的限制,在上例中TRU050GCLGA16.384/2.048的牵引范围大概是50ppm左右。The mutually synchronous clock reference obtained by the method of the present invention has no restriction on the frequency deviation of the input clock reference in principle, and the correct mutual synchronization reference can be obtained by properly adjusting the values of M and K. In actual application, it is mainly limited by the pulling range of the master-slave synchronous phase-locked loop voltage-controlled crystal oscillator in Figure 2. In the above example, the pulling range of TRU050GCLGA16.384/2.048 is about 50ppm.

Claims (2)

1, a kind of method that realizes the clock mutually synchronization, the high speed operation clock that it is characterized in that its employing a slice programmable logic device and a this locality, utilize local clock at a high speed a plurality of input reference clock benchmark to be carried out count measurement by the method for sample count, and measurement result is weighted average calculating operation, recover a mutually synchronization clock reference relevant according to calculated result with local high-frequency clock with each input reference clock, give a phase-locked loop that the principal and subordinate is synchronous with this mutually synchronization clock reference again, the synchronous frequency multiplication of phase locked loop of principal and subordinate goes out the work clock of the required various frequencies of local node switch, thereby realizes the mutually synchronization process of each input reference clock and local clock;
Wherein, described as follows with the detailed process that local high-frequency clock recovers a mutually synchronization clock reference relevant with each input reference clock according to calculated result: establishing local high-frequency clock is f, the result of weighted average computing is Δ num, in programmable logic device, make up one with ((M*K)/2+ Δ num/2-M) counter as the cycle threshold values, wherein M is the number of clock cycle, K is the multiple of local high-frequency clock frequency based on input reference frequency f 0, local high-frequency clock is adopted in the clock input of counter, when receiving rising edge that local high-frequency clock comes, the value of counter just adds M, in programmable logic device, make up a comparator simultaneously, when the count value of described counter during more than or equal to ((M*K)/2+ Δ num/2-M), drive an output register and carry out once inside out, the value of described output register is the mutually synchronization clock reference relevant with each input reference clock.
2,, it is characterized in that the high-frequency clock of described this locality adopts a plurality of cycles of described a plurality of input reference clock benchmark that it is carried out count measurement by the described a kind of method that realizes the clock mutually synchronization of claim 1.
CNB2004100448847A 2004-05-26 2004-05-26 A Method for Realizing Mutual Synchronization of Clocks Expired - Fee Related CN100518045C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100448847A CN100518045C (en) 2004-05-26 2004-05-26 A Method for Realizing Mutual Synchronization of Clocks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100448847A CN100518045C (en) 2004-05-26 2004-05-26 A Method for Realizing Mutual Synchronization of Clocks

Publications (2)

Publication Number Publication Date
CN1585273A CN1585273A (en) 2005-02-23
CN100518045C true CN100518045C (en) 2009-07-22

Family

ID=34601803

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100448847A Expired - Fee Related CN100518045C (en) 2004-05-26 2004-05-26 A Method for Realizing Mutual Synchronization of Clocks

Country Status (1)

Country Link
CN (1) CN100518045C (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1333538C (en) * 2005-03-18 2007-08-22 北京北方烽火科技有限公司 Digital phase-lock method for clock signal in radio-frequency Layuan module
US7616657B2 (en) * 2006-04-11 2009-11-10 Altera Corporation Heterogeneous transceiver architecture for wide range programmability of programmable logic devices
EP2034642B1 (en) * 2007-09-07 2011-10-26 Siemens Aktiengesellschaft Method for transmitting synchronisation messages in a communications network
KR101705592B1 (en) * 2009-05-18 2017-02-10 삼성전자주식회사 Method and apparatus for performing time synchronization between nodes
CN102540211A (en) * 2011-12-22 2012-07-04 成都金本华科技有限公司 BD-1 (Big Dipper No. 1) satellite multiple crystal oscillator time service system and method thereof
CN103414511A (en) * 2013-08-21 2013-11-27 成都成电光信科技有限责任公司 Clock synchronization type network monitoring card
CN104378194A (en) * 2014-11-26 2015-02-25 重庆金美通信有限责任公司 Optimization method for mutual synchronization algorithm
CN109525381B (en) * 2018-12-11 2020-12-29 中国电子科技集团公司第五十四研究所 A clock synchronization device suitable for auxiliary multiplexer

Also Published As

Publication number Publication date
CN1585273A (en) 2005-02-23

Similar Documents

Publication Publication Date Title
CN103763055B (en) The method of precise synchronization time a kind of
CN105549379B (en) A kind of synchronous measuring apparatus triggered based on split-second precision benchmark and method
Ren et al. Self-correcting time synchronization using reference broadcast in wireless sensor network
US8959381B2 (en) Method and system for clock offset and skew estimation
KR101340752B1 (en) High-precision synchronisation method and system
CN101079629B (en) A digital phase lock device for seamless switching of SDH product clock board
CN100518045C (en) A Method for Realizing Mutual Synchronization of Clocks
CN101895385A (en) Time-setting clock system of merging unit for realizing clock switching
CN103684728A (en) Clock synchronization error compensation method of FC network
CN102013970A (en) Clock synchronization method and device thereof as well as base station clock device
CN109495203A (en) A kind of recovery system of PTP from clock
Coviello et al. A novel low-power time synchronization algorithm based on a fractional approach for wireless body area networks
CN104954015A (en) Method of generating a clock, and semiconductor device
CN116134400A (en) Timing Accuracy Maintenance to Reduce Power Consumption During System Sleep
CN105553593A (en) SDH (Synchronous Digital Hierarchy)-based multi-time source PTP (Precision Time Protocol) data synchronization and time monitoring system
CN1770633B (en) Clock phase-locked loop and clock phase-locked control method
CN100586055C (en) Clock transmission equipment for network synchronization between systems
Perišić et al. Time recursive frequency locked loop for the tracking applications
CN107153352A (en) A kind of pulse generation method based on digital frequency synthesis technology
CN110098885B (en) Clock synchronization circuit, device and method
CN110267295A (en) Time Synchronization Model and Method of Pulse-Coupled Oscillator Based on Firefly Synchronization
Terraneo et al. Jitter-compensated VHT and its application to WSN clock synchronization
CN104717737B (en) Industry wireless network time synchronism calibration method based on TDMA
Benarrouch et al. Heartbeat-based synchronization scheme for the human intranet: Modeling and analysis
CN107911207A (en) A kind of periodic signal synchronous method based on time adjustment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090722

Termination date: 20140526