[go: up one dir, main page]

CN108650050A - A kind of distributed network clock synchronous method - Google Patents

A kind of distributed network clock synchronous method Download PDF

Info

Publication number
CN108650050A
CN108650050A CN201810439744.1A CN201810439744A CN108650050A CN 108650050 A CN108650050 A CN 108650050A CN 201810439744 A CN201810439744 A CN 201810439744A CN 108650050 A CN108650050 A CN 108650050A
Authority
CN
China
Prior art keywords
timestamp
message
clock
synchronization
slave device
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
Application number
CN201810439744.1A
Other languages
Chinese (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.)
Xidian University
Original Assignee
Xidian University
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 Xidian University filed Critical Xidian University
Priority to CN201810439744.1A priority Critical patent/CN108650050A/en
Publication of CN108650050A publication Critical patent/CN108650050A/en
Pending legal-status Critical Current

Links

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/0641Change of the master or reference, e.g. take-over or failure of the master
    • 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
    • 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/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Landscapes

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

Abstract

本发明涉及一种分布式网络时钟同步方法,应用于分布式网络,包括:通过时钟选择算法确定主设备以及从设备;测量所述主设备与所述从设备的链路延时;通过所述链路延时获取所述主设备与所述从设备的时间差;通过所述主设备和所述时间差完成所述从设备的时钟同步。本发明实施例通过测量链路延时,并且通过链路延时计算时间差,然后实现时钟同步,使得分布式网络的时钟同步精度到达纳秒级别,并且使该分布式网络具有较强的稳定性,即当分布式网络中的设备出现异常时,该分布式网络能够在很短时间内自适应调整网络结构,重新选择合适的主时钟并完成时钟同步。

The present invention relates to a distributed network clock synchronization method, which is applied to a distributed network, including: determining a master device and a slave device through a clock selection algorithm; measuring the link delay between the master device and the slave device; The link delay acquires the time difference between the master device and the slave device; the clock synchronization of the slave device is completed through the master device and the time difference. The embodiments of the present invention measure the link delay, calculate the time difference through the link delay, and then realize clock synchronization, so that the clock synchronization accuracy of the distributed network reaches the nanosecond level, and the distributed network has strong stability , that is, when a device in the distributed network is abnormal, the distributed network can adaptively adjust the network structure in a short time, reselect the appropriate master clock and complete clock synchronization.

Description

一种分布式网络时钟同步方法A Distributed Network Clock Synchronization Method

技术领域technical field

本发明属于电子与通信领域,具体涉及一种分布式网络时钟同步方法。The invention belongs to the field of electronics and communication, and in particular relates to a distributed network clock synchronization method.

背景技术Background technique

随着现代信息技术的发展,各种应用控制设备逐步走向分布化、智能化、网络化,网络时钟同步的精度要求也愈来愈高。网络时钟同步能够为电信、移动通信基站、小灵通基站、GSM网络优化等系统提供高精度的时间和频率同步信号。因此,其同步能力受到了广泛的重视,在很多网络系统的研发中都是关键技术。With the development of modern information technology, various application control devices are gradually becoming distributed, intelligent, and networked, and the accuracy requirements for network clock synchronization are getting higher and higher. Network clock synchronization can provide high-precision time and frequency synchronization signals for telecommunications, mobile communication base stations, PHS base stations, GSM network optimization and other systems. Therefore, its synchronization ability has been widely valued, and it is a key technology in the research and development of many network systems.

传统的分布式网络时钟同步是采用NTP(网络时间协议(Network Time Protocol)传送方式实现,即在国际互联网上传递统一、标准的时间。具体是通过在分布式网络上指定若干时钟源站点,为用户提供授时服务,并且这些站点间应该能够相互比对,提高准确度。以通信道为媒介同步授时,如计算机网络、电话网络等。Traditional distributed network clock synchronization is realized by using NTP (Network Time Protocol) transmission mode, that is, to transmit unified and standard time on the Internet. Specifically, by specifying several clock source sites on the distributed network, for Users provide time service, and these sites should be able to compare with each other to improve accuracy. Synchronize time service through communication channels, such as computer networks and telephone networks.

然而,这种授时方式由于时间信号通过信道传送到不同终端的延时不同,只能满足中等精度时间用户的要求,即只能满足ms级别的时间同步精度需求。但是,在工业控制领域中,一些对时间同步要求十分严格的网络系统,现行的Internet网络时间协议(NTP),简单网络时间协议(SNTP)等均不能达到所要求的同步精度,特别是对于无线时间同步基站所需的us级时间精度更是远远不够的。However, this timing method can only meet the requirements of medium-precision time users due to the different delays of time signals transmitted to different terminals through channels, that is, it can only meet the requirements of time synchronization accuracy at the ms level. However, in the field of industrial control, some network systems that require very strict time synchronization, the current Internet Network Time Protocol (NTP), Simple Network Time Protocol (SNTP), etc. cannot achieve the required synchronization accuracy, especially for wireless The us-level time accuracy required by time synchronization base stations is far from enough.

发明内容Contents of the invention

为了解决现有技术中存在的上述问题,本发明提供了一种分布式网络时钟同步方法。本发明要解决的技术问题通过以下技术方案实现:In order to solve the above-mentioned problems in the prior art, the present invention provides a distributed network clock synchronization method. The technical problem to be solved in the present invention is realized through the following technical solutions:

本发明实施例提供了一种分布式网络时钟同步方法,应用于分布式网络,包括:An embodiment of the present invention provides a distributed network clock synchronization method, which is applied to a distributed network, including:

通过时钟选择算法确定主设备以及从设备;Determine the master device and slave device through the clock selection algorithm;

测量所述主设备与所述从设备的链路延时;measuring the link delay between the master device and the slave device;

通过所述链路延时获取所述主设备与所述从设备的时间差;Obtaining the time difference between the master device and the slave device through the link delay;

通过所述主设备和所述时间差完成所述从设备的时钟同步。Clock synchronization of the slave device is accomplished through the master device and the time difference.

在本发明的一个实施例中,所述通过时钟选择算法确定主设备以及从设备之前还包括:In one embodiment of the present invention, before determining the master device and the slave device through the clock selection algorithm, it also includes:

判断所述分布式网络中的各设备是否支持时钟同步协议;Judging whether each device in the distributed network supports a clock synchronization protocol;

若是,则运行时钟选择算法;If so, run the clock selection algorithm;

若否,则结束时钟同步。If not, end clock synchronization.

在本发明的一个实施例中,所述通过时钟选择算法确定主设备以及从设备包括:In one embodiment of the present invention, the determining the master device and the slave device through the clock selection algorithm includes:

将所述分布式网络中的各设备运行所述时钟同步算法,其中,所述时钟同步算法为BMCA算法;Each device in the distributed network runs the clock synchronization algorithm, wherein the clock synchronization algorithm is a BMCA algorithm;

根据运行结果确定主时钟;Determine the main clock according to the running results;

所述主时钟对应的设备为所述主设备,剩余设备为所述从设备。The device corresponding to the master clock is the master device, and the remaining devices are the slave devices.

在本发明的一个实施例中,所述测量所述主设备与所述从设备的链路延时包括:In an embodiment of the present invention, the measuring the link delay between the master device and the slave device includes:

通过所述从设备向所述主设备发送延迟请求报文,并记录第一时间戳;其中,所述第一时间戳为所述延迟请求报文发送时间点;Sending a delay request message to the master device through the slave device, and recording a first timestamp; wherein, the first timestamp is the sending time point of the delay request message;

通过所述主设备接收所述延迟请求报文,并记录第二时间戳;其中,所述第二时间戳为所述延迟请求报文接收时间点;receiving the delay request message through the master device, and recording a second time stamp; wherein the second time stamp is the receiving time point of the delay request message;

通过所述主设备向所述从设备发送延迟响应报文,并记录第三时间戳;其中,所述第三时间戳为所述延迟响应报文发送时间点;Sending a delayed response message to the slave device through the master device, and recording a third timestamp; wherein, the third timestamp is the sending time point of the delayed response message;

通过所述主设备向所述从设备发送延迟响应跟随报文;Sending a delay response following message to the slave device through the master device;

通过所述从设备接收所述延迟响应报文,并记录第四时间戳;其中,所述第四时间戳为所述延迟响应报文接收时间点;receiving the delayed response message through the slave device, and recording a fourth timestamp; wherein, the fourth timestamp is the receiving time point of the delayed response message;

通过所述从设备接收所述延迟响应跟随报文;receiving the delayed response following message through the slave device;

通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时。The link delay is calculated by using the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp.

在本发明的一个实施例中,所述延迟响应报文包含所述第二时间戳,所述延迟响应跟随报文包含所述第三时间戳。In an embodiment of the present invention, the delayed response packet includes the second timestamp, and the delayed response follow-up packet includes the third timestamp.

在本发明的一个实施例中,通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时满足:In an embodiment of the present invention, the link delay calculated by the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp satisfies:

其中,link_delay为所述链路延时,t1为所述第一时间戳,t2为所述第二时间戳,t3为所述第三时间戳,t4为所述第四时间戳。Wherein, link_delay is the link delay, t1 is the first timestamp, t2 is the second timestamp, t3 is the third timestamp, and t4 is the fourth timestamp.

在本发明的一个实施例中,所述通过所述链路延时获取所述主设备与所述从设备的时间差包括:In an embodiment of the present invention, the acquiring the time difference between the master device and the slave device through the link delay includes:

通过所述主设备向所述从设备发送同步报文,并记录第五时间戳;其中,所述第五时间戳为所述同步报文的发送时间点;Sending a synchronization message to the slave device through the master device, and recording a fifth timestamp; wherein, the fifth timestamp is the sending time point of the synchronization message;

通过所述主设备向所述从设备发送跟随报文,其中所述跟随报文包含所述第五时间戳;sending a follow-up message to the slave device through the master device, wherein the follow-up message includes the fifth timestamp;

通过所述从设备接收所述同步报文,并记录第六时间戳;其中,所述第六时间戳为所述同步报文接收时间点;Receive the synchronization message through the slave device, and record a sixth time stamp; wherein, the sixth time stamp is the receiving time point of the synchronization message;

通过所述从设备接收所述跟随报文;receiving the following message through the slave device;

根据所述第五时间戳和所述第六时间戳计算所述主设备与所述从设备的时间差。Calculate the time difference between the master device and the slave device according to the fifth time stamp and the sixth time stamp.

在本发明的一个实施例中,通过所述第五时间戳,所述第六时间戳计算所述时间差满足:In an embodiment of the present invention, the time difference calculated by the fifth timestamp and the sixth timestamp satisfies:

D=link_delay+t6-t5D=link_delay+t6-t5

其中,D为所述时间差,link_delay为所述链路延时,t5为所述第五时间戳,t6为所述第六时间戳。Wherein, D is the time difference, link_delay is the link delay, t5 is the fifth timestamp, and t6 is the sixth timestamp.

在本发明的一个实施例中,还包括所述从设备有下一级设备时,通过所述同步方法,完成所述下一级设备的时钟同步。In an embodiment of the present invention, when the slave device has a next-level device, the synchronization method is used to complete the clock synchronization of the next-level device.

在本发明的一个实施例中,所述时钟选择算法和所述分布式网络时钟同步均为周期性运行。In an embodiment of the present invention, both the clock selection algorithm and the distributed network clock synchronization run periodically.

与现有技术相比,本发明的有益效果:Compared with prior art, the beneficial effect of the present invention:

1)本发明提供的时钟同步方法提供了更为可靠的时间同步方案,使得时间同步精度到达纳秒级别,相对于以前微妙级的同步精度,可以满足一些对时钟同步要求十分严格的分布式网络的需求;1) The clock synchronization method provided by the present invention provides a more reliable time synchronization solution, so that the time synchronization accuracy can reach the nanosecond level. Compared with the previous micro-level synchronization accuracy, it can meet some distributed networks that have strict clock synchronization requirements needs;

2)本发明提供的时钟同步方法使分布式网络具有较强的鲁棒性,当网络中的超主时钟或其他设备出现异常时,该分布式网络能够在很短时间内自适应调整网络结构,重新选择合适的时钟源并完成时钟同步任务。2) The clock synchronization method provided by the present invention makes the distributed network have strong robustness. When the super master clock or other devices in the network are abnormal, the distributed network can self-adaptively adjust the network structure in a short time , reselect an appropriate clock source and complete the clock synchronization task.

附图说明Description of drawings

图1为本发明实施例提供的一种分布式网络时钟同步方法的流程图;Fig. 1 is a flow chart of a distributed network clock synchronization method provided by an embodiment of the present invention;

图2为本发明实施例提供的一种分布式网络时钟同步方法的实现流程示意图;Fig. 2 is a schematic diagram of the implementation flow of a distributed network clock synchronization method provided by an embodiment of the present invention;

图3为本发明实施例提供的一种分布式网络时钟同步方法的测量链路延时原理示意图;3 is a schematic diagram of the principle of measuring link delay of a distributed network clock synchronization method provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种分布式网络时钟同步方法的时钟同步原理示意图。FIG. 4 is a schematic diagram of a clock synchronization principle of another distributed network clock synchronization method provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合具体实施例对本发明做进一步详细的描述,但本发明的实施方式不限于此。The present invention will be described in further detail below in conjunction with specific examples, but the embodiments of the present invention are not limited thereto.

实施例一Embodiment one

请参见图1,图1为本发明实施例提供的一种分布式网络时钟同步方法的流程图。本发明的时钟同步方法可以用于分布式网络的时钟同步,应用于分布是网络,具体地,该方法包括一下步骤:Please refer to FIG. 1 . FIG. 1 is a flowchart of a distributed network clock synchronization method provided by an embodiment of the present invention. The clock synchronization method of the present invention can be used for clock synchronization of a distributed network, and is applied to a distributed network. Specifically, the method includes the following steps:

步骤1、通过时钟选择算法确定主设备以及从设备;Step 1. Determine the master device and the slave device through the clock selection algorithm;

步骤2、测量所述主设备与所述从设备的链路延时;Step 2, measuring the link delay between the master device and the slave device;

步骤3、通过所述链路延时获取所述主设备与所述从设备的时间差;Step 3, acquiring the time difference between the master device and the slave device through the link delay;

步骤4、通过所述主设备和所述时间差完成所述从设备的时钟同步。Step 4. Complete the clock synchronization of the slave device through the master device and the time difference.

其中,对于步骤1之前,还可以包括:Among them, before step 1, it may also include:

步骤X1、判断所述分布式网络中的各设备是否支持时钟同步协议;Step X1, judging whether each device in the distributed network supports the clock synchronization protocol;

若是,则运行时钟选择算法;If so, run the clock selection algorithm;

若否,则结束时钟同步。If not, end clock synchronization.

其中,对于步骤1、可以包括:Wherein, for step 1, may include:

步骤11、将所述分布式网络中的各设备运行所述时钟同步算法,其中,所述时钟同步算法为BMCA算法;Step 11, running each device in the distributed network with the clock synchronization algorithm, wherein the clock synchronization algorithm is a BMCA algorithm;

步骤12、根据运行结果确定主时钟;Step 12, determine the main clock according to the operation result;

步骤13、所述主时钟对应的设备为所述主设备,剩余设备为所述从设备。Step 13, the device corresponding to the master clock is the master device, and the remaining devices are the slave devices.

其中,对于步骤2,可以包括:Among them, for step 2, may include:

步骤21、通过所述从设备向所述主设备发送延迟请求报文,并记录第一时间戳;其中,所述第一时间戳为所述延迟请求报文发送时间点;Step 21, sending a delay request message to the master device through the slave device, and recording a first timestamp; wherein, the first timestamp is the sending time point of the delay request message;

步骤22、通过所述主设备接收所述延迟请求报文,并记录第二时间戳;其中,所述第二时间戳为所述延迟请求报文接收时间点;Step 22, receiving the delay request message through the master device, and recording a second timestamp; wherein, the second timestamp is the receiving time point of the delay request message;

步骤23、通过所述主设备向所述从设备发送延迟响应报文,并记录第三时间戳;其中,所述第三时间戳为所述延迟响应报文发送时间点;Step 23, sending a delayed response message to the slave device through the master device, and recording a third timestamp; wherein, the third timestamp is the sending time point of the delayed response message;

步骤24、通过所述主设备向所述从设备发送延迟响应跟随报文;Step 24, sending a delay response following message to the slave device through the master device;

步骤25、通过所述从设备接收所述延迟响应报文,并记录第四时间戳;其中,所述第四时间戳为所述延迟响应报文接收时间点;Step 25, receiving the delayed response message through the slave device, and recording a fourth timestamp; wherein, the fourth timestamp is the receiving time point of the delayed response message;

步骤26、通过所述从设备接收所述延迟响应跟随报文;Step 26, receiving the delayed response following message through the slave device;

步骤27、通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时。Step 27. Calculate the link delay according to the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp.

进一步地,步骤23和步骤25中的所述延迟响应报文包含所述第二时间戳,步骤24和步骤26中的所述延迟响应跟随报文包含所述第三时间戳。Further, the delayed response message in steps 23 and 25 includes the second timestamp, and the delayed response follow-up message in steps 24 and 26 includes the third timestamp.

进一步地,步骤27中的通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时满足:Further, in step 27, calculating the link delay through the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp satisfies:

其中,link_delay为所述链路延时,t1为所述第一时间戳,t2为所述第二时间戳,t3为所述第三时间戳,t4为所述第四时间戳。Wherein, link_delay is the link delay, t1 is the first timestamp, t2 is the second timestamp, t3 is the third timestamp, and t4 is the fourth timestamp.

其中,对于步骤3,可以包括:Among them, for step 3, may include:

步骤31、通过所述主设备向所述从设备发送同步报文,并记录第五时间戳;其中,所述第五时间戳为所述同步报文的发送时间点;Step 31. Send a synchronization message to the slave device through the master device, and record a fifth timestamp; wherein, the fifth timestamp is the sending time point of the synchronization message;

步骤32、通过所述主设备向所述从设备发送跟随报文,其中所述跟随报文包含所述第五时间戳;Step 32. Send a follow-up message to the slave device through the master device, wherein the follow-up message includes the fifth timestamp;

步骤33、通过所述从设备接收所述同步报文,并记录第六时间戳;其中,所述第六时间戳为所述同步报文接收时间点;Step 33: Receive the synchronization message through the slave device, and record a sixth time stamp; wherein, the sixth time stamp is the receiving time point of the synchronization message;

步骤34、通过所述从设备接收所述跟随报文;Step 34, receiving the following message through the slave device;

步骤35、根据所述第五时间戳和所述第六时间戳计算所述主设备与所述从设备的时间差。Step 35. Calculate the time difference between the master device and the slave device according to the fifth time stamp and the sixth time stamp.

进一步地,步骤35中的时间差满足:Further, the time difference in step 35 satisfies:

D=link_delay+t6-t5D=link_delay+t6-t5

其中,D为所述时间差,link_delay为所述链路延时,t5为所述第五时间戳,t6为所述第六时间戳。Wherein, D is the time difference, link_delay is the link delay, t5 is the fifth timestamp, and t6 is the sixth timestamp.

其中,对于步骤4之后,还可以包括:Wherein, after step 4, it may also include:

所述从设备有下一级设备时,通过所述同步方法,完成所述下一级设备的时钟同步When the slave device has a next-level device, the clock synchronization of the next-level device is completed through the synchronization method

进一步地,步骤1、步骤2、步骤3和步骤4中的所述时钟选择算法和所述分布式网络时钟同步均为周期性运行。Further, the clock selection algorithm and the distributed network clock synchronization in step 1, step 2, step 3 and step 4 all run periodically.

在本实施例中,通过时钟算法算法确定超主时钟,并测量链路延时,并在时钟同步时加上链路延时,使得时钟同步精度到达纳秒级别,可以满足一些对时钟同步要求十分严格的分布式网络系统的需求。In this embodiment, the super master clock is determined by the clock algorithm, and the link delay is measured, and the link delay is added when the clock is synchronized, so that the clock synchronization accuracy reaches the nanosecond level, which can meet some clock synchronization requirements Very strict requirements for distributed network systems.

实施例二Embodiment two

请参见图2,图2为本发明实施例提供的一种分布式网络时钟同步方法的实现流程示意图;图3为本发明实施例提供的一种分布式网络时钟同步方法的测量链路延时原理示意图;图4为本发明实施例提供的一种分布式网络时钟同步方法的时钟同步原理示意图。本实施例在上述实施例的基础上,进一步对该时钟同步方法进行详细描述。具体地,该方法包括如下步骤:Please refer to Fig. 2, Fig. 2 is a schematic diagram of the implementation flow of a distributed network clock synchronization method provided by an embodiment of the present invention; Fig. 3 is a measurement link delay of a distributed network clock synchronization method provided by an embodiment of the present invention Schematic diagram of the principle; FIG. 4 is a schematic diagram of the clock synchronization principle of a distributed network clock synchronization method provided by an embodiment of the present invention. This embodiment further describes the clock synchronization method in detail on the basis of the foregoing embodiments. Specifically, the method includes the following steps:

步骤1、发送接收报文Step 1. Send and receive messages

分布式网络中的每一个节点都是一个时间感知系统,每个时间感知系统都对应一个设备,每一个设备。当分布式网络中的各节点上电后,即分布式网络各设备通电运行后,相连的两个设备之间互相发送报文,确定各设备是否支持支持802.1AS协议,若支持则运行时钟选择算法,若不支持则结束时钟同步。Each node in the distributed network is a time-aware system, and each time-aware system corresponds to a device, each device. When each node in the distributed network is powered on, that is, after each device in the distributed network is powered on and running, the two connected devices send messages to each other to determine whether each device supports the 802.1AS protocol, and if so, run the clock selection Algorithm, if not supported, end clock synchronization.

优选地,时钟选择算法为BMC算法,BMC算法即最佳主时钟算法是IEEE1588(精确时钟同步协议)的最主要的核心技术之一,按IEEE1588协议进行时钟同步的系统通过运行最佳主时钟算法来选择系统中的主时钟。其他时钟全以主时钟作为参考进行时钟同步。其中,IEEE1588是关于网络测量和控制系统的时间协议,可达到较高的网络对时精度,实现高精度的时间同步。Preferably, the clock selection algorithm is the BMC algorithm, and the BMC algorithm is the best master clock algorithm, which is one of the most important core technologies of IEEE1588 (accurate clock synchronization protocol). The system that performs clock synchronization according to the IEEE1588 protocol runs the best master clock algorithm to select the master clock in the system. All other clocks use the master clock as a reference for clock synchronization. Among them, IEEE1588 is a time protocol for network measurement and control systems, which can achieve high network time synchronization accuracy and high-precision time synchronization.

步骤2、运行BMC算法,确定主设备Step 2. Run the BMC algorithm to determine the master device

分布式网络中各设备之间发送Announce报文(宣告报文),其中,各设备接收并处理其他设备的报文信息,并通过Announce报文进行交互,比较各时钟信息,并选出主时钟,其中,主时钟所在设备为主设备,与主设备相连的设备为从设备,并确定主设备与分布式网络中其他设备的同步路径。Announce messages (announcement messages) are sent between devices in the distributed network. Each device receives and processes message information of other devices, interacts through Announce messages, compares the information of each clock, and selects the master clock , where the device where the master clock is located is the master device, and the device connected to the master device is the slave device, and the synchronization path between the master device and other devices in the distributed network is determined.

步骤3、测量主设备与从设备的链路延时Step 3. Measure the link delay between the master device and the slave device

如图3所示,确定主设备后,从设备向主设备发送delay_Req报文(延迟请求报文),报文发送后,从设备记录该报文的发出时间戳,并将该报文发出的时间点记录为第一时间戳;As shown in Figure 3, after the master device is determined, the slave device sends a delay_Req message (delay request message) to the master device. After the message is sent, the slave device records the sending timestamp of the message, and sends the message The time point is recorded as the first timestamp;

优选地,主设备接收从设备发出的delay_Req报文后,主设备记录接收该报文的时间点,并将接收该报文的时间点记录为第二时间戳;Preferably, after the master device receives the delay_Req message sent from the device, the master device records the time point of receiving the message, and records the time point of receiving the message as the second timestamp;

优选地,主设备向从设备发送delay_Resp报文(延迟响应报文),其中,delay_Resp报文包含了第二时间戳,delay_Resp报文发送成功后,主设备记录发送时间点,并将发送该报文的时间点记录为第三时间戳。紧接着,主设备向从设备发送delay_Resp_Follow_Up报文(延迟响应跟随报文),其中delay_Resp_Follow_Up报文包含第三时间戳;Preferably, the master device sends a delay_Resp message (delayed response message) to the slave device, wherein the delay_Resp message includes a second timestamp, and after the delay_Resp message is successfully sent, the master device records the sending time point, and will send the message The time point of the document is recorded as the third time stamp. Immediately afterwards, the master device sends a delay_Resp_Follow_Up message (delayed response follow message) to the slave device, wherein the delay_Resp_Follow_Up message includes a third timestamp;

优选地,从设备接收到delay_Resp报文,并通过该报文获取第二时间戳,然后,记录接收该报文的时间点,并将该时间点记录为第四时间戳,最后,接收delay_Resp_Follow_Up报文获取时间戳第三时间戳,;Preferably, the delay_Resp message is received from the device, and the second time stamp is obtained through the message, then, the time point of receiving the message is recorded, and the time point is recorded as the fourth time stamp, and finally, the delay_Resp_Follow_Up message is received Text acquisition timestamp third timestamp,;

优选地,主设备通过公式计算主设备到从设备的链路延时,则其计算公式为:Preferably, the master device calculates the link delay from the master device to the slave device through a formula, then the calculation formula is:

其中,link_delay为链路延时,t1为第一时间戳,t2为第二时间戳,t3为第三时间戳,t4为第四时间戳。Wherein, link_delay is a link delay, t1 is a first timestamp, t2 is a second timestamp, t3 is a third timestamp, and t4 is a fourth timestamp.

步骤4、完成从设备的时钟同步。Step 4. Complete the clock synchronization of the slave device.

如图4所示,测量出链路延时后,主设备向从设备发送Sync报文(同步报文),在发出该报文后记录发送时间点,并将该时间点记录为第五时间戳。紧接着,主时钟向从设备发送Follow_Up报文(跟随报文),其中,Follow_Up报文包含第五时间戳。As shown in Figure 4, after measuring the link delay, the master device sends a Sync message (synchronization message) to the slave device, records the sending time point after sending the message, and records this time point as the fifth time stamp. Immediately afterwards, the master clock sends a Follow_Up message (following message) to the slave device, wherein the Follow_Up message includes a fifth time stamp.

优选地,从设备接收Sync报文后,并记录接收该报文的时间点,并将该时间点记录为第六时间戳,从设备收取Follow_Up报文后,获取第五时间戳。Preferably, after receiving the Sync message, the slave device records the time point of receiving the message, and records the time point as the sixth time stamp, and obtains the fifth time stamp after receiving the Follow_Up message from the device.

优选地,从设备计算从设备与主设备的时间差,则时间差的计算公式为:Preferably, the slave device calculates the time difference between the slave device and the master device, then the calculation formula of the time difference is:

D=link_delay+t6-t5D=link_delay+t6-t5

其中,D为时间差,t5为第五时间戳,t6为第六时间戳。Wherein, D is the time difference, t5 is the fifth time stamp, and t6 is the sixth time stamp.

优选地,从设备在主设备的基础上通过通过时间差D来校正从时钟的同步时钟,并完成从设备的时钟同步。Preferably, the slave device corrects the synchronization clock of the slave clock by passing the time difference D on the basis of the master device, and completes the clock synchronization of the slave device.

步骤5,逐级同步,完成分布式网络的时钟同步Step 5, step-by-step synchronization, to complete the clock synchronization of the distributed network

从设备完成时钟同步后,同理,向与从设备相连的下一级设备依次完成测量链路延时和时间差,其中,链路延时为从设备到其所连接的下一级设备的链路延时,时间差为从设备到其所连接的下一级设备的时间差,并与从设备时钟同步。以此类推,直到完成分布式网络的时钟同步。After the slave device completes clock synchronization, similarly, the link delay and time difference are sequentially measured to the next-level device connected to the slave device, where the link delay is the link from the slave device to the next-level device connected to it. Road delay, the time difference is the time difference from the slave device to the next-level device it is connected to, and is synchronized with the clock of the slave device. And so on, until the clock synchronization of the distributed network is completed.

优选地,BMC算法为周期性运行,分布是网络时钟同步也为周期性运行,其中,BMC算法和时钟同步的时间周期通过Signaling报文(信令报文)获取,Signaling报文通过设备的Signal配置接口设置。Preferably, the BMC algorithm runs periodically, and the distribution is that the network clock synchronization is also a periodic operation. Wherein, the time period of the BMC algorithm and clock synchronization is obtained through a Signaling message (signaling message), and the Signaling message is passed through the Signaling message of the device. Configure interface settings.

本发明实施例通过测量链路延时,并且通过链路延时计算时间差,然后实现时钟同步,使得分布式网络的时钟同步精度到达纳秒级别,并且使该分布式网络具有较强的稳定性,即当分布式网络中的设备出现异常时,该分布式网络能够在很短时间内自适应调整网络结构,重新选择合适的主时钟并完成时钟同步。The embodiments of the present invention measure the link delay, calculate the time difference through the link delay, and then realize clock synchronization, so that the clock synchronization accuracy of the distributed network reaches the nanosecond level, and the distributed network has strong stability , that is, when a device in the distributed network is abnormal, the distributed network can adaptively adjust the network structure in a short time, reselect the appropriate master clock and complete clock synchronization.

实施例三Embodiment Three

分布式网络是由分布在不同地点且具有多个终端的节点机互连而成的。网中任一点均至少与两条线路相连,当任意一条线路发生故障时,通信可转经其他链路完成,具有较高的可靠性,同时,网络易于扩充。A distributed network is formed by the interconnection of node machines distributed in different locations and having multiple terminals. Any point in the network is connected to at least two lines. When any line fails, the communication can be completed through other links, which has high reliability. At the same time, the network is easy to expand.

优选地,分布式网络中的全部节点构成了一个时钟同步系统域,域中的所有节点分别包括时钟源,桥和端站,其中,时钟源的数量为一个,端站的数量为至少一个,桥的数量为至少一个。分布式网络中的每一个节点为一个时间感知系统,即时钟源、桥和端站都为时间感知系统。Preferably, all nodes in the distributed network constitute a clock synchronization system domain, and all nodes in the domain include clock sources, bridges and end stations respectively, wherein the number of clock sources is one, and the number of end stations is at least one, The number of bridges is at least one. Each node in the distributed network is a time-aware system, that is, clock sources, bridges and end stations are all time-aware systems.

优选地,时间感知系统包括:同步站点同步站点模块(Sitesync)、第一端口(portsync 1)、第二端口(portsync 2)、数据中转模块(Md)、主时钟模块(ClockMaster)和从时钟模块(ClockSlave),其中,同步站点模块是根据时钟选择算法选取的结果,来确定数据流向,并调用相关的功能模块;第一端口,是用于将所述同步站点模块发送的信息填充报文,并发出所述报文;第二端口,是用于接收并解析报文,并将所述报文发送给所述同步站点模块;数据中转模块,是与外部连接,获取报文信息,并完成报文的转发;主时钟模块,跟时钟源连接,是用于提供标准时间信息,并将所述标准时间信息发送给所述同步站点模块;从时钟模块,接收和发送信息给所述同步站点模块,通过所述信息计算链路延时,根据所述链路延时计算与上一级节点的时间差,并通过所述时间差校正本地时钟。Preferably, the time awareness system includes: a synchronous site synchronous site module (Sitesync), a first port (portsync 1), a second port (portsync 2), a data transfer module (Md), a master clock module (ClockMaster) and a slave clock module (ClockSlave), wherein, the synchronous site module determines the data flow direction according to the result selected by the clock selection algorithm, and calls the relevant functional modules; the first port is used to fill the message with the information sent by the synchronous site module, and send the message; the second port is used to receive and parse the message, and send the message to the synchronization station module; the data transfer module is connected to the outside, obtains the message information, and completes the Message forwarding; the master clock module is connected to the clock source and is used to provide standard time information and send the standard time information to the synchronization site module; the slave clock module receives and sends information to the synchronization site A module that calculates the link delay based on the information, calculates the time difference with the upper node according to the link delay, and corrects the local clock based on the time difference.

优选地,时钟选择算法是通过该时间感知系统所在的分布式网络的各节点之间发送Announce报文(宣告报文),其中,各节点接收并处理其他节点的报文信息,并通过Announce报文进行交互,比较各时钟信息,并选出主时钟,和分布式网络的时钟同步路径,其中,主时钟所在节点为主节点,与主节点相连的节点为从节点,并确定主节点与分布式网络中其他节点的同步路径。Preferably, the clock selection algorithm is to send an Announce message (announcement message) between each node of the distributed network where the time-aware system is located, wherein each node receives and processes message information of other nodes, and passes the Announce message It interacts with the text, compares the information of each clock, and selects the master clock, and the clock synchronization path of the distributed network. Among them, the node where the master clock is located is the master node, and the node connected to the master node is the slave node, and the master node and the distributed network are determined. Synchronization paths to other nodes in the network.

优选地,当该时间感知系统通过时钟选择算法选择为主时钟时,则该时间感知系统所在节点为主节点,主节点所在设备为主设备,与其相连接的其他节点为从节点,从节点设备为从设备,同步站点模块根据时钟选择算法调用主时钟模块,第一端口和数据中转模块,其中,主时钟模块与时钟源相连,主时钟提供时钟同步的标准时间。当该时间感知系统为从时钟时,则该时间感知系统所在节点为从节点,同步站点模块根据时钟选择算法调用数据中转模块、第二端口和从时钟模块,其中,从时钟计算出获得的主时钟信息与本地时钟的时间差,并校正本地时钟。当该从节点还存在下一级节点时,同步站点模块还调用第一端口,通过第一端口将校正后的时间发送给下一级节点。Preferably, when the time-aware system is selected as the master clock through the clock selection algorithm, the node where the time-aware system is located is the master node, the device where the master node is located is the master device, and other nodes connected to it are slave nodes, and the slave node device As a slave device, the synchronization station module calls the main clock module, the first port and the data transfer module according to the clock selection algorithm, wherein the main clock module is connected to the clock source, and the main clock provides the standard time for clock synchronization. When the time-aware system is a slave clock, the node where the time-aware system is located is a slave node, and the synchronization station module calls the data transfer module, the second port, and the slave clock module according to the clock selection algorithm, wherein the slave clock calculates the obtained master The time difference between the clock information and the local clock, and correct the local clock. When the slave node still has a next-level node, the synchronization station module also calls the first port, and sends the corrected time to the next-level node through the first port.

优选地,当本节点发送报文给下一级节点时,首先通过该节点同步站点模块选择调用模块,选择调用的主时钟模块或者从时钟模块发送信息给同步站点模块,同步站点模块将信息发送给第一端口,发送的信息经过第一端口的报文填充后以报文的形式发送给数据中转模块,数据中转模块通过与网卡接口连接,将报文发送给下一级点。Preferably, when this node sends a message to the next-level node, first select the call module through the node synchronization station module, select the called master clock module or the slave clock module to send information to the synchronization station module, and the synchronization station module sends the information For the first port, the sent information is filled with the message of the first port and then sent to the data transfer module in the form of a message. The data transfer module sends the message to the next level point by connecting with the network card interface.

优选地,当本节点接收上一级节点报文时,首先通过数据中转模块接收报文,并且数据中转模块可以获取时间戳信息,然后将报文和时间戳信息发送给第二端口,第二段口解析报文,并将解析后的报文信息和时间戳信息发送给同步站点模块,最后同步站点模块将这些信息发送给从时钟模块。Preferably, when the node receives the message from the upper node, it first receives the message through the data transfer module, and the data transfer module can obtain the timestamp information, and then send the message and the timestamp information to the second port, the second The section port parses the message, and sends the parsed message information and time stamp information to the synchronization station module, and finally the synchronization station module sends the information to the slave clock module.

优选地,当两个存在时钟同步主从关系的相连的时间感知系统要完成时钟同步时,首相需要测量链路延时,如图3所示,测量链路延时包括:Preferably, when two connected time-aware systems with a clock synchronization master-slave relationship are to complete clock synchronization, the prime minister needs to measure link delay, as shown in Figure 3, the measurement of link delay includes:

通过分布式网络节点向上游相连节点发送延迟请求报文,并记录第一时间戳,其中,第一时间戳为延迟请求报文发送时间点;通过上游相连时钟节点接收延迟请求报文,并记录第二时间戳,其中,第二时间戳为延迟请求报文接收时间点;上游相连时钟节点向本节点发送延迟响应报文,并记录发送时间的第三间戳,其中,延迟响应报文包含第二时间戳;本节点接收延迟响应报文,获取第二时间戳,并记录接收时间的第四时间戳;上游相连时钟节点向本节点发送延迟响应跟随报文,其中延迟响应跟随报文包含有第三时间戳;本节点接收延迟响应跟随报文,获取第三时间戳;最后,通过公式计算链路延时,计算链路延时的公式为:Send the delay request message to the upstream connected node through the distributed network node, and record the first timestamp, where the first timestamp is the time point when the delay request message is sent; receive the delay request message through the upstream connected clock node, and record The second time stamp, wherein the second time stamp is the receiving time point of the delayed request message; the upstream connected clock node sends the delayed response message to the node, and records the third time stamp of the sending time, wherein the delayed response message contains The second timestamp; the node receives the delayed response message, obtains the second timestamp, and records the fourth timestamp of the receiving time; the clock node connected to the upstream sends a delayed response follow message to the node, wherein the delayed response follow message contains There is a third timestamp; the node receives the delayed response follow-up message and obtains the third timestamp; finally, the link delay is calculated by the formula, and the formula for calculating the link delay is:

其中,link_delay为链路延时,t1为第一时间戳,t2为第二时间戳,t3为第三时间戳,t4为第四时间戳。Wherein, link_delay is a link delay, t1 is a first timestamp, t2 is a second timestamp, t3 is a third timestamp, and t4 is a fourth timestamp.

优选地,如图4所示,测量时间差包括:通过上游相连节点向本节点发送同步报文,并记录第五时间戳;其中,第五时间戳为同步报文的发送时间点;通过上游相连节点向本节点发送跟随报文,其中跟随报文包含第五时间戳;通过本节点接收同步报文,并记录第六时间戳;其中,第六时间戳为同步报文接收时间点;通过本节点接收跟随报文;根据第五时间戳和第六时间戳计算上游相连节点与本节点的时间差,计算时间差的公式为:Preferably, as shown in Figure 4, measuring the time difference includes: sending a synchronization message to this node through an upstream connected node, and recording the fifth timestamp; wherein, the fifth timestamp is the sending time point of the synchronization message; The node sends a following message to the node, wherein the following message contains the fifth timestamp; the synchronization message is received by the node, and the sixth timestamp is recorded; the sixth timestamp is the receiving time point of the synchronization message; The node receives the following message; calculates the time difference between the upstream connected node and the current node according to the fifth timestamp and the sixth timestamp. The formula for calculating the time difference is:

D=link_delay+t6-t5D=link_delay+t6-t5

其中,link_delay为链路延时,D为时间差,t5为第五时间戳,t6为第六时间戳。Wherein, link_delay is the link delay, D is the time difference, t5 is the fifth timestamp, and t6 is the sixth timestamp.

优选地,本节点完成时钟同步后,同理,向与相连的下一级节点依次完成测量链路延时和时间差,完成时间同步,其中链路延时为本节点到其所连接的下一级设备的链路延时,并与本节点时钟同步。以此类推,直到完成分布式网络的时钟同步。Preferably, after this node completes the clock synchronization, similarly, it sequentially completes the measurement of link delay and time difference to the next-level node connected to it, and completes time synchronization, wherein the link delay is from the current node to the next node connected to it. The link delay of the upper-level equipment is synchronized with the local node clock. And so on, until the clock synchronization of the distributed network is completed.

优选地,delay_Req报文、delay_Resp报文、Sync报文为事件报文;Pdelay_Resp_Follow_Up报文、Follow_Up报文为通用报文,其中,事件报文需要在发送和接收的时候记录精确的时间戳,通用报文不用记录时间戳。Preferably, the delay_Req message, the delay_Resp message, and the Sync message are event messages; the Pdelay_Resp_Follow_Up message and the Follow_Up message are general messages, wherein the event message needs to record accurate timestamps when sending and receiving, and the general Messages do not need to record timestamps.

优选地,从时钟在计算出与主时钟的时间差后,通过时钟源接口函数,调用时钟调节函数,修正与主时钟之间的时间差,从而完成与主时钟的时钟同步。Preferably, after calculating the time difference with the master clock, the slave clock calls the clock adjustment function through the clock source interface function to correct the time difference with the master clock, thereby completing the clock synchronization with the master clock.

优选地,时钟选择算法为周期性运行,分布是网络时钟同步也为周期性运行,其中,时钟选择算法和时钟同步的时间周期通过Signaling报文(信令报文)获取,Signaling报文通过设备的Signal配置接口设置。Preferably, the clock selection algorithm is a periodic operation, and the distribution is that the network clock synchronization is also a periodic operation, wherein the clock selection algorithm and the time period of clock synchronization are obtained through a Signaling message (signaling message), and the Signaling message is passed through the device The Signal configuration interface settings.

在本实施例中,通过测量相连设备之间的链路延时进一步计算时间差,并通过时间差校正同步时钟,逐级完成分布式网络的时钟同步,采用该方式可以使分布式网络达到纳秒级别的时钟同步精度,而且该分布式网络时钟同步的稳定性较强,能更满足更多设备的需求。In this embodiment, the time difference is further calculated by measuring the link delay between connected devices, and the synchronous clock is corrected by the time difference, and the clock synchronization of the distributed network is completed step by step. Using this method, the distributed network can reach the nanosecond level The clock synchronization accuracy is high, and the distributed network clock synchronization is more stable, which can better meet the needs of more devices.

以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本发明的保护范围。The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be assumed that the specific implementation of the present invention is limited to these descriptions. For those of ordinary skill in the technical field of the present invention, without departing from the concept of the present invention, some simple deduction or replacement can be made, which should be regarded as belonging to the protection scope of the present invention.

Claims (10)

1.一种分布式网络时钟同步方法,其特征在于,应用于分布式网络,包括:1. A distributed network clock synchronization method, characterized in that it is applied to a distributed network, comprising: 通过时钟选择算法确定主设备以及从设备;Determine the master device and slave device through the clock selection algorithm; 测量所述主设备与所述从设备的链路延时;measuring the link delay between the master device and the slave device; 通过所述链路延时获取所述主设备与所述从设备的时间差;Obtaining the time difference between the master device and the slave device through the link delay; 通过所述主设备和所述时间差完成所述从设备的时钟同步。Clock synchronization of the slave device is accomplished through the master device and the time difference. 2.根据权利要求1所述的同步方法,其特征在于,所述通过时钟选择算法确定主设备以及从设备之前还包括:2. The synchronization method according to claim 1, characterized in that, before determining the master device and the slave device by the clock selection algorithm, it also includes: 判断所述分布式网络中的各设备是否支持时钟同步协议;Judging whether each device in the distributed network supports a clock synchronization protocol; 若是,则运行时钟选择算法;If so, run the clock selection algorithm; 若否,则结束时钟同步。If not, end clock synchronization. 3.根据权利要求1所述的同步方法,其特征在于,所述通过时钟选择算法确定主设备以及从设备包括:3. The synchronization method according to claim 1, wherein said determining the master device and the slave device through a clock selection algorithm comprises: 将所述分布式网络中的各设备运行所述时钟同步算法,其中所述时钟同步算法为BMCA算法;Running the clock synchronization algorithm on each device in the distributed network, wherein the clock synchronization algorithm is a BMCA algorithm; 根据运行结果确定主时钟;Determine the main clock according to the running results; 所述主时钟对应的设备为所述主设备,剩余设备为所述从设备。The device corresponding to the master clock is the master device, and the remaining devices are the slave devices. 4.根据权利要求1所述的同步方法,其特征在于,所述测量所述主设备与所述从设备的链路延时包括:4. The synchronization method according to claim 1, wherein the measuring the link delay between the master device and the slave device comprises: 通过所述从设备向所述主设备发送延迟请求报文,并记录第一时间戳;其中,所述第一时间戳为所述延迟请求报文发送时间点;Sending a delay request message to the master device through the slave device, and recording a first timestamp; wherein, the first timestamp is the sending time point of the delay request message; 通过所述主设备接收所述延迟请求报文,并记录第二时间戳;其中,所述第二时间戳为所述延迟请求报文接收时间点;receiving the delay request message through the master device, and recording a second time stamp; wherein the second time stamp is the receiving time point of the delay request message; 通过所述主设备向所述从设备发送延迟响应报文,并记录第三时间戳;其中,所述第三时间戳为所述延迟响应报文发送时间点;Sending a delayed response message to the slave device through the master device, and recording a third timestamp; wherein, the third timestamp is the sending time point of the delayed response message; 通过所述主设备向所述从设备发送延迟响应跟随报文;Sending a delay response following message to the slave device through the master device; 通过所述从设备接收所述延迟响应报文,并记录第四时间戳;其中,所述第四时间戳为所述延迟响应报文接收时间点;receiving the delayed response message through the slave device, and recording a fourth timestamp; wherein, the fourth timestamp is the receiving time point of the delayed response message; 通过所述从设备接收所述延迟响应跟随报文;receiving the delayed response following message through the slave device; 通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时。The link delay is calculated by using the first time stamp, the second time stamp, the third time stamp, and the fourth time stamp. 5.根据权利要求4所述的同步方法,其特征在于,所述延迟响应报文包含所述第二时间戳,所述延迟响应跟随报文包含所述第三时间戳。5. The synchronization method according to claim 4, wherein the delayed response packet includes the second timestamp, and the delayed response follow-up packet includes the third timestamp. 6.根据权利要求4所述的同步方法,其特征在于,通过所述第一时间戳,所述第二时间戳,所述第三时间戳,所述第四时间戳计算所述链路延时满足:6. The synchronization method according to claim 4, wherein the link delay is calculated by using the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp is satisfied when: 其中,link_delay为所述链路延时,t1为所述第一时间戳,t2为所述第二时间戳,t3为所述第三时间戳,t4为所述第四时间戳。Wherein, link_delay is the link delay, t1 is the first timestamp, t2 is the second timestamp, t3 is the third timestamp, and t4 is the fourth timestamp. 7.根据权利要求6所述的同步方法,其特征在于,所述通过所述链路延时获取所述主设备与所述从设备的时间差包括:7. The synchronization method according to claim 6, wherein said obtaining the time difference between the master device and the slave device through the link delay comprises: 通过所述主设备向所述从设备发送同步报文,并记录第五时间戳;其中,所述第五时间戳为所述同步报文的发送时间点;Sending a synchronization message to the slave device through the master device, and recording a fifth timestamp; wherein, the fifth timestamp is the sending time point of the synchronization message; 通过所述主设备向所述从设备发送跟随报文,其中所述跟随报文包含所述第五时间戳;sending a follow-up message to the slave device through the master device, wherein the follow-up message includes the fifth timestamp; 通过所述从设备接收所述同步报文,并记录第六时间戳;其中,所述第六时间戳为所述同步报文接收时间点;Receive the synchronization message through the slave device, and record a sixth time stamp; wherein, the sixth time stamp is the receiving time point of the synchronization message; 通过所述从设备接收所述跟随报文;receiving the following message through the slave device; 根据所述第五时间戳和所述第六时间戳计算所述主设备与所述从设备的时间差。Calculate the time difference between the master device and the slave device according to the fifth time stamp and the sixth time stamp. 8.根据权利要求7所述的同步方法,其特征在于,通过所述第五时间戳,所述第六时间戳计算所述时间差满足:8. The synchronization method according to claim 7, wherein the time difference calculated by the fifth timestamp and the sixth timestamp satisfies: D=link_delay+t6-t5D=link_delay+t6-t5 其中,D为所述时间差,link_delay为所述链路延时,t5为所述第五时间戳,t6为所述第六时间戳。Wherein, D is the time difference, link_delay is the link delay, t5 is the fifth timestamp, and t6 is the sixth timestamp. 9.根据权利要求1所述的同步方法,其特征在于,还包括所述从设备有下一级设备时,通过所述同步方法,完成所述下一级设备的时钟同步。9. The synchronization method according to claim 1, further comprising, when the slave device has a next-level device, completing the clock synchronization of the next-level device through the synchronization method. 10.根据权利要求1所述的同步方法,其特征在于,所述时钟选择算法和所述分布式网络时钟同步均为周期性运行。10. The synchronization method according to claim 1, wherein both the clock selection algorithm and the distributed network clock synchronization run periodically.
CN201810439744.1A 2018-05-09 2018-05-09 A kind of distributed network clock synchronous method Pending CN108650050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810439744.1A CN108650050A (en) 2018-05-09 2018-05-09 A kind of distributed network clock synchronous method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810439744.1A CN108650050A (en) 2018-05-09 2018-05-09 A kind of distributed network clock synchronous method

Publications (1)

Publication Number Publication Date
CN108650050A true CN108650050A (en) 2018-10-12

Family

ID=63753859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810439744.1A Pending CN108650050A (en) 2018-05-09 2018-05-09 A kind of distributed network clock synchronous method

Country Status (1)

Country Link
CN (1) CN108650050A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981204A (en) * 2019-02-21 2019-07-05 福建星云电子股份有限公司 A kind of Multi-Machine Synchronous method of BMS analogue system
CN110099439A (en) * 2019-04-16 2019-08-06 新华三技术有限公司 Method for synchronizing time and device
CN110557826A (en) * 2019-09-20 2019-12-10 北京邮电大学 Clock synchronization method and device
CN111835446A (en) * 2019-04-19 2020-10-27 杭州海康威视数字技术股份有限公司 Method, device and medium for determining master equipment
CN112040472A (en) * 2020-08-10 2020-12-04 烽火通信科技股份有限公司 Clock synchronization method, system and readable storage medium
CN112152744A (en) * 2019-06-28 2020-12-29 比亚迪股份有限公司 Clock synchronization method and device, FPGA chip and optical fiber communication network
CN112751636A (en) * 2019-10-29 2021-05-04 华为数字技术(苏州)有限公司 Method, related device and system for acquiring absolute timestamp
CN114124616A (en) * 2022-01-25 2022-03-01 浙江中控研究院有限公司 Clock synchronization optimization method based on EPA bus structure
CN114244465A (en) * 2021-12-25 2022-03-25 江苏信而泰智能装备有限公司 Cascade system main equipment selection method, selection device and cascade system
CN114978395A (en) * 2022-04-26 2022-08-30 国家电网有限公司 High-reliability time synchronization method of time-sensitive network
CN116436555A (en) * 2023-06-09 2023-07-14 新华三技术有限公司 Time synchronization method and device and distributed network equipment
CN116506096A (en) * 2023-06-26 2023-07-28 北京象帝先计算技术有限公司 Clock synchronization method, system, component and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195735A (en) * 2010-03-11 2011-09-21 杭州华三通信技术有限公司 Time synchronization method for multi-subsystem equipment and subsystem
CN102983927A (en) * 2012-12-12 2013-03-20 南京协澳智能控制系统有限公司 Time compensation method for master-slave clock timing based on IEEE 1588 protocol
CN103442312A (en) * 2013-09-06 2013-12-11 国家电网公司 Intelligent power distribution network time synchronization system and method based on PTN+EPON communication system
CN103995471A (en) * 2014-05-23 2014-08-20 华中科技大学 Clock synchronization method of distributed control system
CN105323054A (en) * 2014-06-26 2016-02-10 中兴通讯股份有限公司 Clock synchronization method and device
CN106130681A (en) * 2016-07-25 2016-11-16 广州市国飞信息科技有限公司 High-accuracy clock synchronization method, module, equipment and system for time dissemination system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195735A (en) * 2010-03-11 2011-09-21 杭州华三通信技术有限公司 Time synchronization method for multi-subsystem equipment and subsystem
CN102983927A (en) * 2012-12-12 2013-03-20 南京协澳智能控制系统有限公司 Time compensation method for master-slave clock timing based on IEEE 1588 protocol
CN103442312A (en) * 2013-09-06 2013-12-11 国家电网公司 Intelligent power distribution network time synchronization system and method based on PTN+EPON communication system
CN103995471A (en) * 2014-05-23 2014-08-20 华中科技大学 Clock synchronization method of distributed control system
CN105323054A (en) * 2014-06-26 2016-02-10 中兴通讯股份有限公司 Clock synchronization method and device
CN106130681A (en) * 2016-07-25 2016-11-16 广州市国飞信息科技有限公司 High-accuracy clock synchronization method, module, equipment and system for time dissemination system

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981204A (en) * 2019-02-21 2019-07-05 福建星云电子股份有限公司 A kind of Multi-Machine Synchronous method of BMS analogue system
CN110099439A (en) * 2019-04-16 2019-08-06 新华三技术有限公司 Method for synchronizing time and device
CN110099439B (en) * 2019-04-16 2021-06-22 新华三技术有限公司 Time synchronization method and device
CN111835446A (en) * 2019-04-19 2020-10-27 杭州海康威视数字技术股份有限公司 Method, device and medium for determining master equipment
CN112152744A (en) * 2019-06-28 2020-12-29 比亚迪股份有限公司 Clock synchronization method and device, FPGA chip and optical fiber communication network
CN110557826B (en) * 2019-09-20 2020-12-04 北京邮电大学 A clock synchronization method and device
CN110557826A (en) * 2019-09-20 2019-12-10 北京邮电大学 Clock synchronization method and device
CN112751636A (en) * 2019-10-29 2021-05-04 华为数字技术(苏州)有限公司 Method, related device and system for acquiring absolute timestamp
CN112040472A (en) * 2020-08-10 2020-12-04 烽火通信科技股份有限公司 Clock synchronization method, system and readable storage medium
CN112040472B (en) * 2020-08-10 2022-10-18 烽火通信科技股份有限公司 Clock synchronization method, system and readable storage medium
CN114244465A (en) * 2021-12-25 2022-03-25 江苏信而泰智能装备有限公司 Cascade system main equipment selection method, selection device and cascade system
CN114124616A (en) * 2022-01-25 2022-03-01 浙江中控研究院有限公司 Clock synchronization optimization method based on EPA bus structure
CN114124616B (en) * 2022-01-25 2022-05-27 浙江中控研究院有限公司 Clock synchronization optimization method based on EPA bus structure
CN114978395A (en) * 2022-04-26 2022-08-30 国家电网有限公司 High-reliability time synchronization method of time-sensitive network
CN116436555A (en) * 2023-06-09 2023-07-14 新华三技术有限公司 Time synchronization method and device and distributed network equipment
CN116436555B (en) * 2023-06-09 2023-08-18 新华三技术有限公司 Time synchronization method and device and distributed network equipment
CN116506096A (en) * 2023-06-26 2023-07-28 北京象帝先计算技术有限公司 Clock synchronization method, system, component and equipment
CN116506096B (en) * 2023-06-26 2023-10-20 北京象帝先计算技术有限公司 Clock synchronization methods, systems, components, devices

Similar Documents

Publication Publication Date Title
CN108650050A (en) A kind of distributed network clock synchronous method
CN108599888A (en) A kind of distributed network clock synchronizing system
US7864747B2 (en) System and method for communicating timing to a remote node
KR101290643B1 (en) Method and system for bearing time synchronization protocol in optical transport network
JP7401656B2 (en) METHODS, APPARATUS AND SYSTEM AND STORAGE MEDIA FOR SELECTING CLOCK SOURCES
CN102412955B (en) Time deviation acquisition methods when optical fiber is asymmetric between master-slave equipment and communication system
CN103929293A (en) Asymmetric delay time synchronization method and system
CN103916950A (en) Time synchronization method and system
CN103166792B (en) Line asymmetrical compensation method, equipment and system
CN105723638A (en) A method for detecting timing references affected by a change in path delay asymmetry between nodes in a communications network
CN106899370A (en) A kind of clock chain circuit changing method, device and base station
US20220038252A1 (en) Methods, Apparatus and Computer-Readable Media for Synchronization Over an Optical Network
US20220007321A1 (en) Network Entities and Methods for a Wireless Network System for Determining Time Information
CN108134644B (en) Synchronization method, device, synchronization device and system
CN103259640A (en) Method and device for synchronizing time
CN108683472A (en) A kind of clock synchronizing method based on Time delay measurement
CN103546268A (en) Method and device for compensating system time
CN102342051B (en) For coming the method for synchronised clock and relevant system and module by separating transmission first and second data via at least one time distribution protocol
CN102457346A (en) Time synchronization implementation method and clock node
CN103580768B (en) A kind of method for synchronizing time and device
CN104066102B (en) Fault location test method, system and the device of clock synchronization system
CN114258126A (en) Data processing method and device
KR20100062786A (en) Time synchronized system and time synchronization method in the next generation convergence network
CN113424466B (en) Method and device for clock synchronization
CN114765586A (en) Method, device and system for detecting time synchronization performance

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20181012