CN118802046A - Time synchronization method, device, electronic device and storage medium - Google Patents
Time synchronization method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN118802046A CN118802046A CN202311040961.0A CN202311040961A CN118802046A CN 118802046 A CN118802046 A CN 118802046A CN 202311040961 A CN202311040961 A CN 202311040961A CN 118802046 A CN118802046 A CN 118802046A
- Authority
- CN
- China
- Prior art keywords
- time
- deviation
- slave device
- transmission information
- master
- 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
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/0676—Mutual
-
- 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/0682—Clock 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
Description
技术领域Technical Field
本公开涉及计算机技术领域,尤其涉及时间同步方法、装置、电子设备及存储介质。The present disclosure relates to the field of computer technology, and in particular to a time synchronization method, device, electronic device and storage medium.
背景技术Background Art
在通信网络中,大多数电信业务的正常运行要求全网设备之间的时间差异保持在合理的误差水平内,即时间同步。然而,由于设备存在一定的精度(例如为+/-20ns),在实际的传输网时间同步应用中,传输设备主要承担中间的BC(Boundary Clock,边界时钟)单元,通常有10到20跳传输设备,那么例如当设备增加到20跳之后,偏差会逐跳增加,理论上的偏差可能会达到400ns左右,随着跳数增加,精度偏差值会逐步增加。In the communication network, the normal operation of most telecommunications services requires that the time difference between the devices in the entire network be kept within a reasonable error level, that is, time synchronization. However, due to the certain accuracy of the equipment (for example, +/-20ns), in the actual transmission network time synchronization application, the transmission equipment mainly bears the intermediate BC (Boundary Clock) unit, and there are usually 10 to 20 hops of transmission equipment. For example, when the number of equipment increases to 20 hops, the deviation will increase hop by hop. Theoretically, the deviation may reach about 400ns. As the number of hops increases, the accuracy deviation value will gradually increase.
相关技术中,如果提升设备的精度,通过提升硬件能力提升单跳设备的时间同步精度,会对硬件要求较高,硬件成本较大;并且无法解决随设备跳数增加时间同步精度降低的问题。如果是实际部署时间同步应用时先测量端到端的时间偏差,并将该时间偏差补偿到系统中,以提升时间同步精度,这样在增加设备数量、光纤长度变化等情况下,各种网络组网变化时都需要重新测量,工程实施难度和成本较大。因此,相关技术中在解决时间同步的精度降低的问题时效率较低。In the related art, if the accuracy of the equipment is improved, the time synchronization accuracy of the single-hop equipment is improved by improving the hardware capabilities, which will have high hardware requirements and high hardware costs; and it cannot solve the problem of reduced time synchronization accuracy as the number of equipment hops increases. If the end-to-end time deviation is measured first when the time synchronization application is actually deployed, and the time deviation is compensated to the system to improve the time synchronization accuracy, then in the case of increasing the number of devices, changing the optical fiber length, etc., various network networking changes need to be re-measured, and the project implementation is difficult and costly. Therefore, the related art is less efficient in solving the problem of reduced time synchronization accuracy.
发明内容Summary of the invention
本公开提供了一种时间同步方法、装置、电子设备及存储介质。The present disclosure provides a time synchronization method, device, electronic device and storage medium.
根据本公开的第一方面,提供了一种时间同步方法,所述方法包括:According to a first aspect of the present disclosure, a time synchronization method is provided, the method comprising:
获取主设备与从设备之间计算得到的多组传输信息;其中,所述传输信息包括时间偏差和网络延时;Acquire multiple sets of transmission information calculated between the master device and the slave device; wherein the transmission information includes time deviation and network delay;
基于所述多组传输信息,获得所述主设备与所述从设备之间的平均时间偏差和平均网络延时;Based on the multiple groups of transmission information, obtain an average time deviation and an average network delay between the master device and the slave device;
基于所述平均时间偏差调整所述从设备的系统时间,并获取调整后的所述主设备与所述从设备之间的网络延时;并在所述网络延时与所述平均网络延时之间的差值小于第一阈值的情况下,获取所述主设备与所述从设备之间的时间偏差;Adjusting the system time of the slave device based on the average time deviation, and obtaining the adjusted network delay between the master device and the slave device; and obtaining the time deviation between the master device and the slave device when the difference between the network delay and the average network delay is less than a first threshold;
获取所述系统时间与主时钟之间的偏差,基于所述偏差调整所述系统时间,并在所述主设备与所述从设备之间的时间偏差小于第二阈值的情况下,基于所述时间偏差同步所述从设备的系统时间。Obtain a deviation between the system time and a master clock, adjust the system time based on the deviation, and synchronize the system time of the slave device based on the time deviation when the time deviation between the master device and the slave device is less than a second threshold.
根据本公开的第二方面,提供了一种时间同步装置,所述装置包括:According to a second aspect of the present disclosure, a time synchronization device is provided, the device comprising:
第一信息获取模块,用于获取主设备与从设备之间计算得到的多组传输信息;其中,所述传输信息包括时间偏差和网络延时;A first information acquisition module, used to acquire multiple sets of transmission information calculated between the master device and the slave device; wherein the transmission information includes time deviation and network delay;
第二信息获取模块,用于基于所述多组传输信息,获得所述主设备与所述从设备之间的平均时间偏差和平均网络延时;A second information acquisition module, configured to obtain an average time deviation and an average network delay between the master device and the slave device based on the multiple sets of transmission information;
第三信息获取模块,用于基于所述平均时间偏差调整所述从设备的系统时间,并获取调整后的所述主设备与所述从设备之间的网络延时;并在所述网络延时与所述平均网络延时之间的差值小于第一阈值的情况下,获取所述主设备与所述从设备之间的时间偏差;a third information acquisition module, configured to adjust the system time of the slave device based on the average time deviation, and obtain the adjusted network delay between the master device and the slave device; and obtain the time deviation between the master device and the slave device when the difference between the network delay and the average network delay is less than a first threshold;
时间同步模块,用于获取所述系统时间与主时钟之间的偏差,基于所述偏差调整所述系统时间,并在所述主设备与所述从设备之间的时间偏差小于第二阈值的情况下,基于所述时间偏差同步所述从设备的系统时间。A time synchronization module is used to obtain the deviation between the system time and the master clock, adjust the system time based on the deviation, and synchronize the system time of the slave device based on the time deviation when the time deviation between the master device and the slave device is less than a second threshold.
根据本公开的第三方面,提供了一种电子设备。该电子设备包括:存储器和处理器,所述存储器上存储有计算机程序,所述处理器执行所述程序时实现如以上所述的方法。According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
根据本公开的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现本公开的上述方法。According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.
本公开实施例提供的时间同步方法、装置、电子设备及存储介质,通过获取主设备与从设备之间包含时间偏差和网络延时的多组传输信息,并基于多组传输信息,获得主设备与从设备之间的平均时间偏差和平均网络延时,并基于平均时间偏差调整从设备的系统时间,并获取调整后的主设备与从设备之间的网络延时;并在网络延时与平均网络延时之间的差值小于第一阈值的情况下,获取主设备与从设备之间的时间偏差。获取系统时间与主时钟之间的偏差,基于偏差调整系统时间,并在主设备与从设备之间的时间偏差小于第二阈值的情况下,基于时间偏差同步从设备的系统时间。通过将引入的可预估的偏差与链路中的偏差进行抵消,从而能够提高时间同步精度。The time synchronization method, device, electronic device and storage medium provided by the embodiments of the present disclosure obtain multiple groups of transmission information containing time deviation and network delay between the master device and the slave device, and based on the multiple groups of transmission information, obtain the average time deviation and average network delay between the master device and the slave device, and adjust the system time of the slave device based on the average time deviation, and obtain the adjusted network delay between the master device and the slave device; and obtain the time deviation between the master device and the slave device when the difference between the network delay and the average network delay is less than a first threshold. Obtain the deviation between the system time and the master clock, adjust the system time based on the deviation, and synchronize the system time of the slave device based on the time deviation when the time deviation between the master device and the slave device is less than a second threshold. By offsetting the introduced predictable deviation with the deviation in the link, the time synchronization accuracy can be improved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
在下面结合附图对于示例性实施例的描述中,本公开的更多细节、特征和优点被公开,在附图中:Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
图1为本公开一示例性实施例提供的主从设备之间的交互示意图;FIG1 is a schematic diagram of interaction between master and slave devices provided by an exemplary embodiment of the present disclosure;
图2为本公开一示例性实施例提供的通过offset修正系统时间的示意图;FIG2 is a schematic diagram of correcting system time through offset provided by an exemplary embodiment of the present disclosure;
图3为本公开一示例性实施例提供的多跳过程中的offset取值范围的示意图;FIG3 is a schematic diagram of an offset value range in a multi-hop process provided by an exemplary embodiment of the present disclosure;
图4为本公开一示例性实施例提供的时间同步方法的流程示意性框图;FIG4 is a schematic block diagram of a time synchronization method according to an exemplary embodiment of the present disclosure;
图5为本公开一示例性实施例提供的时间同步装置的功能模块示意性框图;FIG5 is a schematic block diagram of functional modules of a time synchronization device provided by an exemplary embodiment of the present disclosure;
图6为本公开一示例性实施例提供的电子设备的结构框图;FIG6 is a structural block diagram of an electronic device provided by an exemplary embodiment of the present disclosure;
图7为本公开一示例性实施例提供的计算机系统的结构框图。FIG. 7 is a structural block diagram of a computer system provided by an exemplary embodiment of the present disclosure.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. In addition, the method embodiments may include additional steps and/or omit the steps shown. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
根据IEEE1588同步的基本原理,设备采用按固定步长调整时间精度的方式,以当前主流精度Class B为例,每跳设备精度为+/-20ns,因此在调整本设备的时间精度达到+/-20ns后,就不再调整。那么当设备增加到20跳之后,偏差逐跳增加,理论上的偏差应该会达到400ns左右,随着跳数增加,精度偏差值会逐步增加,因此需要进行时间同步,减少精度偏差。According to the basic principle of IEEE1588 synchronization, the device uses a fixed step to adjust the time accuracy. Taking the current mainstream accuracy Class B as an example, the accuracy of each hop device is +/-20ns. Therefore, after the time accuracy of this device is adjusted to +/-20ns, it will no longer be adjusted. Then when the device increases to 20 hops, the deviation increases hop by hop. Theoretically, the deviation should reach about 400ns. As the number of hops increases, the accuracy deviation value will gradually increase. Therefore, time synchronization is required to reduce the accuracy deviation.
其中,1588协议由IEEE定义,全称为“网络测量和控制系统的精密时钟同步协议”(Precision Clock Synchronization Protocol for Networked Measurement andControl Systems),简称PTP(Precision Time Protocol)协议。1588分为1588v1和1588v2两个版本,1588v1只能达到亚毫秒级的时间同步精度,而1588v2可以达到亚微秒级同步精度。1588v2被定义为时间同步的协议,能够用于设备之间的高精度时间同步。Among them, the 1588 protocol is defined by IEEE, and its full name is "Precision Clock Synchronization Protocol for Networked Measurement and Control Systems", or PTP (Precision Time Protocol) for short. 1588 is divided into two versions: 1588v1 and 1588v2. 1588v1 can only achieve sub-millisecond time synchronization accuracy, while 1588v2 can achieve sub-microsecond synchronization accuracy. 1588v2 is defined as a time synchronization protocol that can be used for high-precision time synchronization between devices.
应用时间同步的网络,可以称为时间同步网。时间同步网可以分为两级,其中一级节点可以采用1级时间同步设备,二级节点可以采用2级时间同步设备,二级节点以下可以包括服务器或客户端在内的需要时间同步的设备。A network that uses time synchronization can be called a time synchronization network. The time synchronization network can be divided into two levels, where the first-level nodes can use level 1 time synchronization equipment, and the second-level nodes can use level 2 time synchronization equipment. Devices that need time synchronization, including servers or clients, can be included below the second-level nodes.
本公开实施例支持1588v2(包括衍生协议,如ITU-T G.8275.1),能够对设备整网时间同步精度做出提升,解决在多跳场景下的网络时钟精度逐步劣化问题。并且本公开实施例依据1588V2同步原理,通过自动计算、自动调整主从设备偏差,从而达到整条同步链路时间偏差相互抵消的效果。The disclosed embodiment supports 1588v2 (including derivative protocols such as ITU-T G.8275.1), which can improve the time synchronization accuracy of the entire network of devices and solve the problem of gradual degradation of network clock accuracy in multi-hop scenarios. In addition, the disclosed embodiment automatically calculates and adjusts the master-slave device deviation based on the 1588v2 synchronization principle, thereby achieving the effect of offsetting the time deviation of the entire synchronization link.
根据报文是否携带时间戳,可以将1588v2报文分为两类:事件报文和通用报文。其中,事件报文为时间概念报文,进出设备端口时会打上精确的时间戳,用于计算主从时钟之间的时间偏移和路径延迟。事件报文包含:Sync、Delay_Req和Delay_Resp。实施例中可以采用事件报文,可以更方便的获取时间戳对应的时间,如图1所示,可以获取t1、t2、t3和t4。图1中的Master为主设备,Slave为从设备。Master与Slave之间为主从关系。Depending on whether the message carries a timestamp, 1588v2 messages can be divided into two categories: event messages and general messages. Among them, event messages are time-concept messages, which will be accurately timestamped when entering and exiting the device port, and are used to calculate the time offset and path delay between the master and slave clocks. Event messages include: Sync, Delay_Req, and Delay_Resp. In the embodiment, event messages can be used to more conveniently obtain the time corresponding to the timestamp. As shown in Figure 1, t1, t2, t3, and t4 can be obtained. The Master in Figure 1 is the master device, and the Slave is the slave device. The Master and Slave are in a master-slave relationship.
如图1所示,主设备在时刻t1发送Sync报文。如果主设备为one-step模式,则t1随Sync报文传送到从设备,从设备在时刻t2接收到Sync报文,并从Sync报文中获取t1;从设备在时刻t3发送延时请求报文Delay_Req给主设备,主设备在时刻t4接收到Delay_Req报文,主设备随后通过延时回答报文Delay_Resp将t4发送给从设备。As shown in Figure 1, the master device sends a Sync message at time t1. If the master device is in one-step mode, t1 is transmitted to the slave device along with the Sync message. The slave device receives the Sync message at time t2 and obtains t1 from the Sync message. The slave device sends a delay request message Delay_Req to the master device at time t3. The master device receives the Delay_Req message at time t4. The master device then sends t4 to the slave device through a delay reply message Delay_Resp.
1588v2时间同步的基本原理是主从设备(Master-Slave)之间双向收发时间同步报文,根据报文的收发时间戳,计算得到两个设备之间的往返总时延。如果两个方向的时延相同,往返总时延除2就是单向时延,据此可以得到Slave到Master的时间偏差。The basic principle of 1588v2 time synchronization is that the master and slave devices (Master-Slave) send and receive time synchronization messages in both directions. The total round-trip delay between the two devices is calculated based on the sending and receiving timestamps of the messages. If the delays in both directions are the same, the total round-trip delay divided by 2 is the one-way delay, based on which the time deviation from the slave to the master can be obtained.
实施例中通过offset表示主从设备的时间偏差,delay表示网络传输造成的延时时间,如果图1中的收发路径延时一致,那么存在如下关系:In the embodiment, offset represents the time deviation between the master and slave devices, and delay represents the delay time caused by network transmission. If the delays of the sending and receiving paths in FIG1 are consistent, the following relationship exists:
delay = [(t2 - t1) + (t4 - t3)] / 2 (1)delay = [(t2 - t1) + (t4 - t3)] / 2 (1)
offset = [(t2 - t1) - (t4 - t)] / 2 (2)offset = [(t2 - t1) - (t4 - t)] / 2 (2)
如图2所示,设备通过1588v2协议计算出本地时钟和主时钟源的时间偏差offset,然后修正本地时钟。这样周而复始、不断进行的同步过程,确保了Slave对Master的时间同步。As shown in Figure 2, the device calculates the time offset between the local clock and the master clock source through the 1588v2 protocol, and then corrects the local clock. This repetitive and continuous synchronization process ensures that the Slave is synchronized with the Master.
如果Master和Slave之间的路径延时不对称,则会引入同步误差,误差的大小为两个方向路径延时差值的二分之一。所以1588v2高精度时间同步的关键在于:两个节点之间的时延尽量稳定,没有抖动。链路时延一般都能满足这个条件,但设备的转发时延抖动很大,因此在IEEE标准的1588v2协议中需要将时延校正字段参与到Delay方式的计算中,从而得到正确的平均路径时延Delay和时间偏移Offset。实施例中,假设△为Master的Tx路径(发送路径)与Rx路径(接收路径)的延时差值,那么就存在如下关系:If the path delay between the Master and Slave is asymmetric, a synchronization error will be introduced, and the size of the error is half of the difference in the path delays in the two directions. Therefore, the key to 1588v2 high-precision time synchronization is that the delay between the two nodes is as stable as possible, without jitter. Link delays can generally meet this condition, but the forwarding delay jitter of the device is large. Therefore, in the IEEE standard 1588v2 protocol, the delay correction field needs to be involved in the calculation of the Delay method to obtain the correct average path delay Delay and time offset Offset. In the embodiment, assuming that △ is the delay difference between the Master's Tx path (transmitting path) and the Rx path (receiving path), then the following relationship exists:
delay = ((t2 –t1) + (t4–t3)) / 2-△ / 2 (3)delay = ((t2 –t1) + (t4–t3)) / 2-△ / 2 (3)
offset = ((t2 –t1) - (t4–t3)) / 2 -△ / 2 (4)offset = ((t2 –t1) - (t4–t3)) / 2 -△ / 2 (4)
因此,在频率同步的前提下,由于链路不对称引起的时间偏差为链路不对称延时的一半,而只要把链路不对称引起的偏差抵消掉,那么就可以极大的提升整个网络的时间精度,从而使普通精度的设备,完成高精度网络的效果。Therefore, under the premise of frequency synchronization, the time deviation caused by link asymmetry is half of the link asymmetric delay. As long as the deviation caused by link asymmetry is offset, the time accuracy of the entire network can be greatly improved, so that ordinary precision equipment can achieve the effect of a high-precision network.
实施例中,有关Δ的计算,设备内部不会在每一跳精确计算Δ的值,而是可以通过设备正向调节一定量的offset或负向调节一定量的offset,以便在链路末端抵消掉部分Δ偏差。实施例中的Δ可以是指收发链路不对称引入的偏差,该偏差越大,1588的时间精度越差,本公开实施例通过不同的设备的Δ互相抵消,从而达到最终整个链路的Δ趋近于0,从而提供整个链路的1588的时间精度。In the embodiment, regarding the calculation of Δ, the device will not accurately calculate the value of Δ at each hop, but can adjust a certain amount of offset in the positive direction or negative direction through the device, so as to offset part of the Δ deviation at the end of the link. The Δ in the embodiment may refer to the deviation introduced by the asymmetry of the transceiver link. The larger the deviation, the worse the time accuracy of 1588. In the embodiment of the present disclosure, the Δ of different devices offset each other, so that the Δ of the entire link approaches 0, thereby providing the time accuracy of 1588 for the entire link.
实施例中,获取Δ的方式可以包括:可以通过专用的仪表测量获得;还可以通过收发路径的光纤长度转换计算,不同的光纤、波长、折射率导致每米的延时稍有差异,但偏差不大;还可以设备内部计算,可以通过两个时间已同步的设备(此时offset已知为0),使用offset公式来反向计算得到Δ。In an embodiment, methods for obtaining Δ may include: obtaining it through measurement with a dedicated instrument; it may also be calculated through conversion of the optical fiber length of the transmitting and receiving paths. Different optical fibers, wavelengths, and refractive indices result in slightly different delays per meter, but the deviation is not large; it may also be calculated within the device, and Δ may be obtained by reversely calculating through two time-synchronized devices (at this time, the offset is known to be 0) using the offset formula.
实施例中,为消掉链路不对称引起的偏差,以提升设备的时间精度,实施例可以包括以下步骤:In the embodiment, in order to eliminate the deviation caused by link asymmetry and improve the time accuracy of the device, the embodiment may include the following steps:
步骤一:整个网落配置好1588之后,经过BMC(Best Master Clock,最佳主时钟算法移动通信网)算法协商出结果,状态决策完成之后,Slave设备开始提取t1、t2、t3、t4,并依据此通过上述方式计算主从设备之间的offset和delay,此时先不调整slave端的系统时间。每一组t1、t2、t3、t4可以计算出一次delay和offset,可以丢弃第1组t1、t2、t3、t4计算的值,以便消除首次报文协商引入误差,并且该操作并不影响计算速度。Step 1: After the entire network is configured with 1588, the BMC (Best Master Clock) algorithm negotiates the result. After the state decision is completed, the slave device begins to extract t1, t2, t3, and t4, and calculates the offset and delay between the master and slave devices in the above manner. At this time, the system time on the slave end is not adjusted. Each group of t1, t2, t3, and t4 can calculate the delay and offset once, and the values calculated for the first group of t1, t2, t3, and t4 can be discarded to eliminate the error introduced by the first message negotiation, and this operation does not affect the calculation speed.
步骤二:每一组t1、t2、t3、t4可以计算出一次delay和offset,缓存计算结果delay和offset,实施例中可以经过至少3次计算之后,比较连续3次的delay和offset,如果3次结果之间相差在5ns,即3次获得的delay之间的差值、3次获得的offset之间的差值分别都小于阈值,则认为得到稳定的delay和offset,计算3次的平均值,记录此平均值的delay和offset值为结果,否则丢弃本次3组的计算,重新执行步骤二。其中,该阈值取决于系统精度,系统时钟越稳定,此值可设置越小,实施例以该阈值为5ns为例进行说明,实施例不限于此。Step 2: For each group of t1, t2, t3, and t4, a delay and offset can be calculated once, and the calculated delay and offset are cached. In the embodiment, after at least 3 calculations, the delay and offset of 3 consecutive times can be compared. If the difference between the 3 results is 5ns, that is, the difference between the delay obtained 3 times and the difference between the offset obtained 3 times are respectively less than the threshold, it is considered that a stable delay and offset are obtained, and the average value of 3 times is calculated, and the delay and offset values of this average value are recorded as the result, otherwise the calculation of the 3 groups is discarded and step 2 is re-executed. Among them, the threshold depends on the system accuracy. The more stable the system clock is, the smaller this value can be set. The embodiment takes the threshold of 5ns as an example for explanation, and the embodiment is not limited to this.
步骤三:直接按照上述步骤计算的offset值调整slave端的系统时间一次,停止调整之后重新按照步骤二计算delay和offset值,比较此次delay与步骤二记录的delay,相差在5ns以内则认为系统正常,记录此offset值,否则认为系统异常,重新按照步骤三计算。Step 3: Adjust the system time of the slave end according to the offset value calculated in the above steps. After stopping the adjustment, recalculate the delay and offset values according to step 2. Compare the delay with the delay recorded in step 2. If the difference is within 5ns, the system is considered normal and the offset value is recorded. Otherwise, the system is considered abnormal and recalculated according to step 3.
步骤四:根据上述步骤得到的offset值的正负,判断当前系统与主时钟对应的时间之间的时间偏差。如果时间偏差为正,则说明第一次offset调整少了,需要继续正向调整,如果时间偏差为负,则说明第一次offset调整多了,需要反向调整。重复执行步骤三,直到offset计算结果在20ns以内趋近于0为止,最终得到一个系统的稳定的offset。需要说明的是,最终得到的该offset取值可根据经验值获得,此值为时间误差调整的值,例如可根据系统实测获得更合理数值,实施例不限于此。经过上述步骤,相当于人为引入一些可预估的偏差,与链路非对称引入的偏差进行一个大概的抵消,从而自动提高时间同步精度,那么扩散到整网之后,就可以达到整精度可控的目标。Step 4: According to the positive or negative value of the offset value obtained in the above steps, determine the time deviation between the time corresponding to the current system and the master clock. If the time deviation is positive, it means that the first offset adjustment is too little, and it is necessary to continue to adjust in the positive direction. If the time deviation is negative, it means that the first offset adjustment is too much, and it is necessary to adjust in the reverse direction. Repeat step 3 until the offset calculation result approaches 0 within 20ns, and finally obtain a stable offset of the system. It should be noted that the final offset value can be obtained according to the empirical value. This value is the value of the time error adjustment. For example, a more reasonable value can be obtained according to the actual measurement of the system, and the embodiment is not limited to this. After the above steps, it is equivalent to artificially introducing some predictable deviations, which are roughly offset by the deviations introduced by the link asymmetry, thereby automatically improving the time synchronization accuracy. After spreading to the entire network, the goal of controllable accuracy can be achieved.
基于上述实施例,在本公开提供的实施例中,为了使整网时间同步精度进一步可控,还可以使用了step机制对整网进行时间同步。Based on the above embodiments, in the embodiments provided by the present disclosure, in order to make the time synchronization accuracy of the entire network further controllable, a step mechanism may be used to perform time synchronization on the entire network.
实施例中,具体可以由时钟接口模块和时钟处理模块共同实现时间同步。其中,时钟接口模块用于业务接入的同时提取和下插时钟报文及时钟信息,例如上述中的t1、t2、t3和t4;时钟处理模块负责解析接口模块提取的时钟信息并进行计算,根据计算结果调整本设备的时钟,并将时钟信息向下传递。In the embodiment, time synchronization can be realized by the clock interface module and the clock processing module. The clock interface module is used to extract and insert clock messages and clock information, such as t1, t2, t3 and t4 mentioned above, while the service is accessed; the clock processing module is responsible for parsing the clock information extracted by the interface module and performing calculations, adjusting the clock of the device according to the calculation results, and passing the clock information downward.
实施例中,在时钟处理模块接收到时钟接口模块提取的时钟信息后,检测到信息里的step值为奇数,在进行时钟调整时,向offset正数方向调整,控制停止调整的区间为0ns~20ns,offset的数值具体可以通过上述方式获得。检测到信息里的step为偶数时,向offset负数方向调整,即停止调整的区间为-20ns~0ns,通过这样的计算并调整后,时钟跟踪情况如图3所示,T-BC表示边界时钟。其中,step表示网络中的跳。跳,指的是网络中路径的度量单位,可以是数据包从一个有Ip地址的设备转移到与之相邻的另一个有Ip地址的设备上,即在网络上走了一步。In the embodiment, after the clock processing module receives the clock information extracted by the clock interface module, it detects that the step value in the information is an odd number. When adjusting the clock, it adjusts in the positive direction of the offset, and controls the interval for stopping the adjustment to be 0ns to 20ns. The value of the offset can be obtained specifically in the above manner. When it is detected that the step in the information is an even number, it adjusts in the negative direction of the offset, that is, the interval for stopping the adjustment is -20ns to 0ns. After such calculation and adjustment, the clock tracking situation is shown in Figure 3, and T-BC represents the boundary clock. Among them, step represents a jump in the network. A jump refers to the unit of measurement of a path in a network. It can be a data packet transferred from a device with an IP address to another adjacent device with an IP address, that is, it takes a step on the network.
实施例中,针对整个网络,可以包括多个节点,例如节点1、节点2、节点3...,在时间同步的过程中,奇节点统一向正偏,即offset取正值;偶节点统一向负偏,即offset取负值;因此端到端的偏差就是所有奇数节点的和加上所有偶数节点的和,正负偏差可以互相抵消大部分,使得端到端的时间偏差保持常态,远低于20跳网元的平均水平,不会出相关技术中出现偏差的极限值400ns,可以大幅提升端到端的时间同步精度。In an embodiment, the entire network may include multiple nodes, such as node 1, node 2, node 3... During time synchronization, odd nodes are uniformly biased toward the positive direction, that is, the offset takes a positive value; even nodes are uniformly biased toward the negative direction, that is, the offset takes a negative value; therefore, the end-to-end deviation is the sum of all odd nodes plus the sum of all even nodes, and the positive and negative deviations can offset each other for the most part, so that the end-to-end time deviation remains normal, which is far lower than the average level of 20-hop network elements, and will not exceed the limit value of 400ns of deviation in related technologies, which can greatly improve the end-to-end time synchronization accuracy.
这样前后两个设备的偏差可以大部分抵消,因此达到无论跳数增加多少,偏差都不会线性增加,而是控制在一跳网元左右的偏差,以主流精度Class B为例,精度为+/-20ns左右,远远高于实际业务需求的+/-1us。In this way, the deviation between the two devices can be mostly offset. Therefore, no matter how much the number of hops increases, the deviation will not increase linearly, but will be controlled within the deviation of one hop network element. Taking the mainstream accuracy Class B as an example, the accuracy is about +/-20ns, which is much higher than the +/-1us required by actual business needs.
基于上述实施例,在本公开提供的又一实施例中,提供了一种时间同步方法,如图4所示,该方法可以包括以下步骤:Based on the above embodiment, in another embodiment provided by the present disclosure, a time synchronization method is provided. As shown in FIG4 , the method may include the following steps:
在步骤S410中,获取主设备与从设备之间计算得到的多组传输信息。In step S410, multiple groups of transmission information calculated between the master device and the slave device are obtained.
其中,该传输信息包括时间偏差和网络延时。The transmission information includes time deviation and network delay.
实施例中,可以获得包含时间偏差和网络延时的多组传输信息,每组传输信息可以包含一个时间偏差和一个网络延时。In an embodiment, multiple groups of transmission information including time deviations and network delays may be obtained, and each group of transmission information may include a time deviation and a network delay.
在步骤S420中,基于多组传输信息,获得主设备与从设备之间的平均时间偏差和平均网络延时。In step S420, based on multiple groups of transmission information, the average time deviation and average network delay between the master device and the slave device are obtained.
实施例中,可以根据上述实施例提供的方式,可以计算主设备与从设备之间的时间偏差和网络延时,例如,可以获取主设备与从设备之间传输的目标报文和链路延时差值,并基于时间戳和链路延时差值获取时间偏差和网络延时。其中,该目标报文携带时间戳。该目标报文可以包括上述实施例中的Sync、Delay_Req和Delay_Resp报文等。In an embodiment, the time deviation and network delay between the master device and the slave device can be calculated according to the method provided in the above embodiment. For example, the target message and the link delay difference transmitted between the master device and the slave device can be obtained, and the time deviation and network delay can be obtained based on the timestamp and the link delay difference. The target message carries a timestamp. The target message can include the Sync, Delay_Req and Delay_Resp messages in the above embodiment.
实施例中,可以获得例如至少3组报文计算得到的offset和delay,并将获得的这3组offset和delay分别求平均,分别得到平均时间偏差和平均网络延时,即平均offset和平均delay。In an embodiment, offset and delay calculated from at least three groups of messages may be obtained, and the three groups of offsets and delays may be averaged to obtain average time deviation and average network delay, ie, average offset and average delay, respectively.
在步骤S430中,基于平均时间偏差调整从设备的系统时间,获取调整后的主设备与从设备之间的网络延时,并在网络延时与平均网络延时之间的差值小于第一阈值的情况下,获取主设备与从设备之间的时间偏差。In step S430, the system time of the slave device is adjusted based on the average time deviation, the adjusted network delay between the master device and the slave device is obtained, and when the difference between the network delay and the average network delay is less than a first threshold, the time deviation between the master device and the slave device is obtained.
实施例中,该第一阈值可以设定为5ns,还可以根据需要进行设定,实施例不限于此。In the embodiment, the first threshold value may be set to 5 ns, and may be set as required, but the embodiment is not limited thereto.
可以获取从设备的系统时间与主时钟对应的时间之间的时间差值,并基于时间差值调整第一时间偏差,获得调整后的时间偏差,并基于调整后的时间偏差调整从设备的系统时间。The time difference between the system time of the slave device and the time corresponding to the master clock can be obtained, and the first time deviation can be adjusted based on the time difference to obtain the adjusted time deviation, and the system time of the slave device can be adjusted based on the adjusted time deviation.
在步骤S440中,获取系统时间与主时钟之间的偏差,基于偏差调整系统时间,并在主设备与从设备之间的时间偏差小于第二阈值的情况下,基于时间偏差同步从设备的系统时间。In step S440, the deviation between the system time and the master clock is obtained, the system time is adjusted based on the deviation, and when the time deviation between the master device and the slave device is less than a second threshold, the system time of the slave device is synchronized based on the time deviation.
实施例中,可以根据上述获得的offset调整从设备的系统时间,在调整完成后重新计算主从设备之间的offset和delay,可以比较delay和delay之间的差值的绝对值是否小于第二阈值,该第二阈值可以是5ns,需要可以根据需要设定,实施例不限于此。如果delay和delay之间的差值的绝对值是否小于第二阈值,确认系统正常,否则确定系统异常,可以重新计算delay和offset。In the embodiment, the system time of the slave device can be adjusted according to the offset obtained above, and the offset and delay between the master and slave devices can be recalculated after the adjustment is completed. The absolute value of the difference between the delay and the delay can be compared to see whether it is less than a second threshold value. The second threshold value can be 5ns, which can be set as needed, and the embodiment is not limited thereto. If the absolute value of the difference between the delay and the delay is less than the second threshold value, it is confirmed that the system is normal, otherwise it is determined that the system is abnormal, and the delay and offset can be recalculated.
实施例中,在时间偏差不小于阈值的情况下,调整从设备的系统时间,直到时间偏差小于第二阈值,这样可以基于时间偏差同步从设备的系统时间,实现时间的同步。In the embodiment, when the time deviation is not less than a threshold, the system time of the slave device is adjusted until the time deviation is less than a second threshold, so that the system time of the slave device can be synchronized based on the time deviation to achieve time synchronization.
在本公开提供的实施例提供的时间同步方法,通过获取主设备与从设备之间包含时间偏差和网络延时的多组传输信息,并基于多组传输信息,获得主设备与从设备之间的平均时间偏差和平均网络延时,并基于平均时间偏差调整从设备的系统时间,并获取调整后的主设备与从设备之间的网络延时;并在网络延时与平均网络延时之间的差值小于第一阈值的情况下,获取主设备与从设备之间的时间偏差。获取系统时间与主时钟之间的偏差,基于偏差调整系统时间,并在主设备与从设备之间的时间偏差小于第二阈值的情况下,基于时间偏差同步从设备的系统时间。通过引入一些可预估的偏差,与链路非对称引入的偏差进行抵消,从而能够提高时间同步精度。The time synchronization method provided in the embodiment provided in the present disclosure obtains multiple groups of transmission information including time deviation and network delay between the master device and the slave device, and based on the multiple groups of transmission information, obtains the average time deviation and average network delay between the master device and the slave device, and adjusts the system time of the slave device based on the average time deviation, and obtains the adjusted network delay between the master device and the slave device; and when the difference between the network delay and the average network delay is less than a first threshold, obtains the time deviation between the master device and the slave device. Obtain the deviation between the system time and the master clock, adjust the system time based on the deviation, and when the time deviation between the master device and the slave device is less than a second threshold, synchronize the system time of the slave device based on the time deviation. By introducing some predictable deviations, the deviations introduced by link asymmetry are offset, thereby improving the accuracy of time synchronization.
基于上述实施例,在本公开提供的又一实施例中,上述目标报文至少包括N组报文,N组报文分别携带有时间戳;上述步骤S410可以包括以下步骤:Based on the above embodiment, in another embodiment provided by the present disclosure, the above target message includes at least N groups of messages, and the N groups of messages respectively carry timestamps; the above step S410 may include the following steps:
步骤S411,获取主设备与从设备之间传输的多组报文。Step S411, obtaining multiple groups of messages transmitted between the master device and the slave device.
其中,该报文携带时间戳。The message carries a timestamp.
步骤S412,基于多组报文分别携带的时间戳,获得主设备与从设备之间的多组传输信息,并丢弃多组传输信息中的第一组传输信息。Step S412: obtaining multiple groups of transmission information between the master device and the slave device based on the timestamps respectively carried by the multiple groups of messages, and discarding the first group of transmission information among the multiple groups of transmission information.
实施例中可以获取主设备与从设备之间传输的多组时间偏差和网络延时,可以丢弃多组时间偏差和网络延时中的第一组,并将的剩余组作为主设备与从设备之间计算得到的多组传输信息。具体的,实施例中可以获得多组时间偏差和网络延时,每组时间偏差和网络延时可以获得一组时间,例如t1、t2、t3和t4,每组时间可以分别计算得到一个时间偏差offset和网络延时delay,由于首次报文协商会引入误差,因此可以丢弃第一组报文计算得到的offset和delay,即将根据第一组t1、t2、t3和t4计算得到的offset和delay丢弃,得到包括时间偏差和网络延时的多组传输信息。In the embodiment, multiple groups of time deviations and network delays transmitted between the master device and the slave device can be obtained, the first group of the multiple groups of time deviations and network delays can be discarded, and the remaining groups are used as multiple groups of transmission information calculated between the master device and the slave device. Specifically, in the embodiment, multiple groups of time deviations and network delays can be obtained, and each group of time deviations and network delays can obtain a group of time, such as t1, t2, t3 and t4. Each group of time can be calculated to obtain a time deviation offset and a network delay delay respectively. Since the first message negotiation will introduce errors, the offset and delay calculated from the first group of messages can be discarded, that is, the offset and delay calculated based on the first group of t1, t2, t3 and t4 are discarded to obtain multiple groups of transmission information including time deviations and network delays.
在本公开提供的实施例中,基于上述实施例,上述步骤S420还可以包括以下步骤:In the embodiment provided by the present disclosure, based on the above embodiment, the above step S420 may further include the following steps:
步骤S421,判断多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值是否均小于第一阈值。Step S421, determining whether the difference between any two time offsets and the difference between any two network delays in the plurality of groups of transmission information are both smaller than a first threshold.
步骤S422,在多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值均小于第一阈值的情况下,计算多组传输信息中多个时间偏差的平均值和多个网络延时之间的平均值,分别得到平均时间偏差和平均网络延时。Step S422, when the difference between any two time deviations and the difference between any two network delays in multiple groups of transmission information are both less than the first threshold, calculate the average value of multiple time deviations and the average value between multiple network delays in the multiple groups of transmission information to obtain the average time deviation and the average network delay respectively.
并且实施例中,在多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值不均小于第一阈值的情况下,可以丢弃该多组传输信息,并重新计算主设备与从设备之间的多组传输信息,直到多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值均小于第一阈值。Furthermore, in an embodiment, when the difference between any two time deviations and the difference between any two network delays in multiple groups of transmission information are not both less than a first threshold, the multiple groups of transmission information can be discarded, and the multiple groups of transmission information between the master device and the slave device can be recalculated until the difference between any two time deviations and the difference between any two network delays in the multiple groups of transmission information are both less than the first threshold.
在本公开提供的实施例中,上述每一组t1、t2、t3和t4可以计算出一次delay和offset,经过至少3次计算之后,比较连续3次的delay和连续3次offset,如果3次结果之间相差在小于第一阈值,例如小于5ns,则认为得到稳定的delay和offset,计算3次的平均值,记录此平均值的delay和offset值为结果,否则丢弃本次3组的计算,重新计算delay和offset。这样可以将3次平均获得的offset作为第一时间偏差,并将3次平均获得的delay作为第一网络延时,这样获得的delay和offset更加准确。In the embodiment provided by the present disclosure, each of the above groups of t1, t2, t3 and t4 can calculate a delay and offset. After at least 3 calculations, the delay and offset of 3 consecutive times are compared. If the difference between the 3 results is less than the first threshold, for example, less than 5ns, it is considered that a stable delay and offset are obtained, and the average value of 3 times is calculated, and the delay and offset values of this average value are recorded as the result. Otherwise, the calculation of the 3 groups is discarded, and the delay and offset are recalculated. In this way, the offset obtained by the 3 averages can be used as the first time deviation, and the delay obtained by the 3 averages can be used as the first network delay, so that the delay and offset obtained are more accurate.
在本公开提供的实施例中,该方法还可以包括以下步骤:In the embodiments provided in the present disclosure, the method may further include the following steps:
在步骤S450中,获取时钟信息,所述时钟信息包含step值;In step S450, clock information is obtained, where the clock information includes a step value;
在步骤S460中,在所述step值为奇数时,调整从设备的系统时间,并在所述时间偏差在第一预设范围内时,停止调整所述系统时间;或者,在所述step值为偶数时,调整从设备的系统时间,并在所述时间偏差在第二预设范围内时,停止调整所述系统时间。In step S460, when the step value is an odd number, the system time of the slave device is adjusted, and when the time deviation is within a first preset range, the system time adjustment is stopped; or, when the step value is an even number, the system time of the slave device is adjusted, and when the time deviation is within a second preset range, the system time adjustment is stopped.
实施例中,具体可以由时钟接口模块和时钟处理模块共同实现时间同步。其中,时钟接口模块用于业务接入的同时提取和下插时钟报文及时钟信息,例如上述中的t1、t2、t3和t4;时钟处理模块负责解析接口模块提取的时钟信息并进行计算,根据计算结果调整本设备的时钟,并将时钟信息向下传递。可以结合上述图3及对应的实施例的描述,这里不再赘述。In the embodiment, time synchronization can be realized by the clock interface module and the clock processing module. The clock interface module is used to extract and insert clock messages and clock information, such as t1, t2, t3 and t4 mentioned above, while the service is accessed; the clock processing module is responsible for parsing the clock information extracted by the interface module and performing calculations, adjusting the clock of the device according to the calculation results, and passing the clock information downward. This can be combined with the description of the above FIG. 3 and the corresponding embodiment, which will not be repeated here.
基于上述实施例,在本公开提供的又一实施例中,该方法还可以包括以下步骤:Based on the above embodiment, in another embodiment provided by the present disclosure, the method may further include the following steps:
在步骤S470中,获取从设备对应的节点编号的奇偶性。In step S470, the parity of the node number corresponding to the slave device is obtained.
实施例中,不同主从设备之间的delay和offset按照上述方式计算得到的数值可能都不相同,但为了抵消不同设备之间链路不对称引起的偏差,需要确定不同从设备的offset的正负,以便在正网中进行抵消。In the embodiment, the values of delay and offset between different master and slave devices calculated in the above manner may be different, but in order to offset the deviation caused by link asymmetry between different devices, it is necessary to determine the positive and negative offsets of different slave devices so as to offset them in the positive network.
在步骤S480中,基于节点编号的奇偶性确定第二时间偏差对应的正负值。其中,每个从设备包括对应的节点编号,相邻节点编号的两个从设备的时间偏差对应的正负值不同。In step S480, the positive and negative values corresponding to the second time deviation are determined based on the parity of the node number, wherein each slave device includes a corresponding node number, and the positive and negative values corresponding to the time deviations of two slave devices with adjacent node numbers are different.
实施例中,可以通过获取节点的编号,编号为奇数的节点对应的offset为正值,编号为偶数的节点对应的offset为负值。例如,节点1、节点2、节点3...分别对应的offset的数值为20ns、-30ns、15ns...。这样端到端的偏差就是所有奇数节点的和加上所有偶数节点的和,正负偏差可以互相抵消大部分,端到端偏差保持常态,远低于20跳网元的平均水平,更不会出现极限值400ns,可以大幅提升端到端的时间同步精度。In the embodiment, the offset corresponding to the node with an odd number is a positive value, and the offset corresponding to the node with an even number is a negative value by obtaining the node number. For example, the offset values corresponding to node 1, node 2, node 3, etc. are 20ns, -30ns, 15ns, etc. respectively. In this way, the end-to-end deviation is the sum of all odd-numbered nodes plus the sum of all even-numbered nodes. The positive and negative deviations can offset each other for the most part, and the end-to-end deviation remains normal, which is far lower than the average level of 20-hop network elements, and the limit value of 400ns will not appear, which can greatly improve the end-to-end time synchronization accuracy.
在采用对应各个功能划分各个功能模块的情况下,本公开实施例提供了一种时间同步装置,该时间同步装置可以为服务器或应用于服务器的芯片。图5为本公开一示例性实施例提供的时间同步装置的功能模块示意性框图。如图5所示,该时间同步装置包括:In the case of dividing each functional module according to each function, an embodiment of the present disclosure provides a time synchronization device, which can be a server or a chip applied to a server. FIG5 is a schematic block diagram of the functional modules of a time synchronization device provided by an exemplary embodiment of the present disclosure. As shown in FIG5, the time synchronization device includes:
第一信息获取模块10,用于获取主设备与从设备之间计算得到的多组传输信息;其中,传输信息包括时间偏差和网络延时;The first information acquisition module 10 is used to acquire multiple sets of transmission information calculated between the master device and the slave device; wherein the transmission information includes time deviation and network delay;
第二信息获取模块20,用于基于所述多组传输信息,获得所述主设备与所述从设备之间的平均时间偏差和平均网络延时;A second information acquisition module 20, configured to obtain an average time deviation and an average network delay between the master device and the slave device based on the multiple sets of transmission information;
第三信息获取模块30,用于基于所述平均时间偏差调整所述从设备的系统时间,获取调整后的所述主设备与所述从设备之间的网络延时,并在所述网络延时与所述平均网络延时之间的差值小于第一阈值的情况下,获取所述主设备与所述从设备之间的时间偏差;A third information acquisition module 30 is used to adjust the system time of the slave device based on the average time deviation, obtain the adjusted network delay between the master device and the slave device, and obtain the time deviation between the master device and the slave device when the difference between the network delay and the average network delay is less than a first threshold;
时间同步模块30,用于获取所述系统时间与主时钟之间的偏差,基于所述偏差调整所述系统时间,并在所述主设备与所述从设备之间的时间偏差小于第二阈值的情况下,基于所述时间偏差同步所述从设备的系统时间。The time synchronization module 30 is used to obtain the deviation between the system time and the master clock, adjust the system time based on the deviation, and synchronize the system time of the slave device based on the time deviation when the time deviation between the master device and the slave device is less than a second threshold.
在本公开提供的又一实施例中,所述第一信息获取模块,具体用于:In another embodiment provided by the present disclosure, the first information acquisition module is specifically used to:
获取所述主设备与所述从设备之间传输的多组报文,所述报文携带时间戳;Acquire multiple groups of messages transmitted between the master device and the slave device, the messages carrying timestamps;
基于所述多组报文分别携带的时间戳,获得所述主设备与所述从设备之间的多组传输信息,并丢弃所述多组传输信息中的第一组传输信息。Based on the timestamps respectively carried by the multiple groups of messages, multiple groups of transmission information between the master device and the slave device are obtained, and the first group of transmission information among the multiple groups of transmission information is discarded.
在本公开提供的又一实施例中,所述第二信息获取模块,具体用于:In another embodiment provided by the present disclosure, the second information acquisition module is specifically used to:
判断所述多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值是否均小于第一阈值;Determine whether a difference between any two time deviations and a difference between any two network delays in the plurality of groups of transmission information are both less than a first threshold;
在所述多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值均小于第一阈值的情况下,计算所述多组传输信息中多个时间偏差的平均值和多个网络延时之间的平均值,分别得到所述平均时间偏差和平均网络延时。When the difference between any two time deviations and the difference between any two network delays in the multiple groups of transmission information are both smaller than a first threshold, the average values of multiple time deviations and the average values of multiple network delays in the multiple groups of transmission information are calculated to obtain the average time deviation and the average network delay, respectively.
在本公开提供的又一实施例中,所述装置还包括:In another embodiment provided by the present disclosure, the device further includes:
处理模块,用于在所述多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值不均小于第一阈值的情况下,丢弃所述多组传输信息,并重新计算所述主设备与所述从设备之间的多组传输信息,直到所述多组传输信息中任意两个时间偏差之间的差值和任意两个网络延时之间的差值均小于第一阈值。A processing module is used to discard the multiple groups of transmission information and recalculate the multiple groups of transmission information between the master device and the slave device when the difference between any two time deviations and the difference between any two network delays in the multiple groups of transmission information are not both less than a first threshold value, until the difference between any two time deviations and the difference between any two network delays in the multiple groups of transmission information are both less than the first threshold value.
在本公开提供的又一实施例中,所述时间同步模块,具体用于:In another embodiment provided by the present disclosure, the time synchronization module is specifically used to:
在所述系统时间与主时钟之间的偏差为正数的情况下,正向调整所述系统时间;When the deviation between the system time and the master clock is a positive number, adjusting the system time in a positive direction;
或者,在所述系统时间与主时钟之间的偏差为负数的情况下,反向调整所述系统时间;Alternatively, when the deviation between the system time and the master clock is a negative number, the system time is adjusted in the reverse direction;
在所述主设备与所述从设备之间的时间偏差小于第二阈值的情况下,停止调整所述系统时间。When the time deviation between the master device and the slave device is less than a second threshold, stop adjusting the system time.
在本公开提供的又一实施例中,所述装置还包括:In another embodiment provided by the present disclosure, the device further includes:
时钟信息获取模块,用于获取时钟信息,所述时钟信息包含step值;A clock information acquisition module, used to acquire clock information, wherein the clock information includes a step value;
调整模块,用于在所述step值为奇数时,调整从设备的系统时间,并在所述时间偏差在第一预设范围内时,停止调整所述系统时间;或者,在所述step值为偶数时,调整从设备的系统时间,并在所述时间偏差在第二预设范围内时,停止调整所述系统时间。The adjustment module is used to adjust the system time of the slave device when the step value is an odd number, and stop adjusting the system time when the time deviation is within a first preset range; or, when the step value is an even number, adjust the system time of the slave device, and stop adjusting the system time when the time deviation is within a second preset range.
在本公开提供的又一实施例中,所述装置还包括:In another embodiment provided by the present disclosure, the device further includes:
编号获取模块,用于获取所述从设备对应的节点编号的奇偶性;A number acquisition module, used to obtain the parity of the node number corresponding to the slave device;
范围确定模块,用于基于所述节点编号的奇偶性确定所述第二时间偏差对应的正负值;其中,每个从设备包括对应的节点编号,相邻节点编号的两个从设备的时间偏差对应的正负值不同。A range determination module is used to determine the positive and negative values corresponding to the second time deviation based on the parity of the node number; wherein each slave device includes a corresponding node number, and the positive and negative values corresponding to the time deviations of two slave devices with adjacent node numbers are different.
本公开实施例提供的时间同步装置,通过获取主设备与从设备之间包含时间偏差和网络延时的多组传输信息,并基于多组传输信息,获得主设备与从设备之间的平均时间偏差和平均网络延时,并基于平均时间偏差调整从设备的系统时间,并获取调整后的主设备与从设备之间的网络延时;并在网络延时与平均网络延时之间的差值小于第一阈值的情况下,获取主设备与从设备之间的时间偏差。获取系统时间与主时钟之间的偏差,基于偏差调整系统时间,并在主设备与从设备之间的时间偏差小于第二阈值的情况下,基于时间偏差同步从设备的系统时间。通过引入一些可预估的偏差,与链路中的偏差进行抵消,从而能够提高时间同步精度。The time synchronization device provided by the embodiment of the present disclosure obtains multiple groups of transmission information including time deviation and network delay between the master device and the slave device, and based on the multiple groups of transmission information, obtains the average time deviation and average network delay between the master device and the slave device, and adjusts the system time of the slave device based on the average time deviation, and obtains the adjusted network delay between the master device and the slave device; and obtains the time deviation between the master device and the slave device when the difference between the network delay and the average network delay is less than a first threshold. Obtain the deviation between the system time and the master clock, adjust the system time based on the deviation, and synchronize the system time of the slave device based on the time deviation when the time deviation between the master device and the slave device is less than a second threshold. By introducing some predictable deviations and offsetting the deviations in the link, the accuracy of time synchronization can be improved.
本公开实施例还提供一种电子设备,包括:至少一个处理器;用于存储所述至少一个处理器可执行指令的存储器;其中,所述至少一个处理器被配置为执行所述指令,以实现本公开实施例公开的上述方法。An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.
图6为本公开一示例性实施例提供的电子设备的结构示意图。如图6所示,该电子设备1800包括至少一个处理器1801以及耦接至处理器1801的存储器1802,该处理器1801可以执行本公开实施例公开的上述方法中的相应步骤。Fig. 6 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. As shown in Fig. 6, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801, and the processor 1801 can execute the corresponding steps in the above method disclosed in the embodiment of the present disclosure.
上述处理器1801还可以称为中央处理单元(central processing unit,CPU),其可以是一种集成电路芯片,具有信号的处理能力。本公开实施例公开的上述方法中的各步骤可以通过处理器1801中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1801可以是通用处理器、数字信号处理器(digital signal processing,DSP)、ASIC、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本公开实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储器1802中,例如随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质。处理器1801读取存储器1802中的信息,结合其硬件完成上述方法的步骤。The processor 1801 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 1801 or by instructions in the form of software. The processor 1801 may be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 1802, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 1801 reads the information in the memory 1802 and completes the steps of the method in combination with its hardware.
另外,根据本公开的各种操作/处理在通过软件和/或固件实现的情况下,可从存储介质或网络向具有专用硬件结构的计算机系统,例如图7所示的计算机系统1900安装构成该软件的程序,该计算机系统在安装有各种程序时,能够执行各种功能,包括诸如前文所述的功能等等。图7为本公开一示例性实施例提供的计算机系统的结构框图。In addition, when various operations/processes according to the present disclosure are implemented by software and/or firmware, the programs constituting the software can be installed from a storage medium or a network to a computer system with a dedicated hardware structure, such as the computer system 1900 shown in FIG. 7. When various programs are installed, the computer system can perform various functions, including functions such as those described above. FIG. 7 is a block diagram of a computer system provided by an exemplary embodiment of the present disclosure.
计算机系统1900旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and/or claimed herein.
如图7所示,计算机系统1900包括计算单元1901,该计算单元1901可以根据存储在只读存储器(ROM)1902中的计算机程序或者从存储单元1908加载到随机存取存储器(RAM)1903中的计算机程序,来执行各种适当的动作和处理。在RAM 1903中,还可存储计算机系统1900操作所需的各种程序和数据。计算单元1901、ROM 1902以及RAM 1903通过总线1904彼此相连。输入/输出(I/O)接口1905也连接至总线1904。As shown in FIG7 , the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the computer system 1900 can also be stored. The computing unit 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input/output (I/O) interface 1905 is also connected to the bus 1904.
计算机系统1900中的多个部件连接至I/O接口1905,包括:输入单元1906、输出单元1907、存储单元1908以及通信单元1909。输入单元1906可以是能向计算机系统1900输入信息的任何类型的设备,输入单元1906可以接收输入的数字或字符信息,以及产生与电子设备的用户设置和/或功能控制有关的键信号输入。输出单元1907可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频/音频输出终端、振动器和/或打印机。存储单元1908可以包括但不限于磁盘、光盘。通信单元1909允许计算机系统1900通过网络诸如因特网的与其他设备交换信息/数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和/或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和/或类似物。A plurality of components in the computer system 1900 are connected to the I/O interface 1905, including: an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. The input unit 1906 may be any type of device capable of inputting information to the computer system 1900, and the input unit 1906 may receive input digital or character information, and generate key signal inputs related to user settings and/or function control of the electronic device. The output unit 1907 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 1908 may include, but is not limited to, a disk, an optical disk. The communication unit 1909 allows the computer system 1900 to exchange information/data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and/or the like.
计算单元1901可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元1901的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元1901执行上文所描述的各个方法和处理。例如,在一些实施例中,本公开实施例公开的上述方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元1908。在一些实施例中,计算机程序的部分或者全部可以经由ROM 1902和/或通信单元1909而被载入和/或安装到电子设备1900上。在一些实施例中,计算单元1901可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行本公开实施例公开的上述方法。The computing unit 1901 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and/or installed on the electronic device 1900 via the ROM 1902 and/or the communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above methods disclosed in the embodiments of the present disclosure in any other appropriate manner (e.g., by means of firmware).
本公开实施例还提供一种计算机可读存储介质,其中,当所述计算机可读存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行本公开实施例公开的上述方法。The embodiment of the present disclosure further provides a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.
本公开实施例中的计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。上述计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。更具体的,上述计算机可读存储介质可以包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。The computer-readable storage medium in the disclosed embodiments may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specifically, the computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
本公开实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序被处理器执行时实现本公开实施例公开的上述方法。The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the embodiments of the present disclosure is implemented.
在本公开的实施例中,可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络(包括局域网(LAN)或广域网(WAN))连接到用户计算机,或者,可以连接到外部计算机。In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块、部件或单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块、部件或单元的名称在某种情况下并不构成对该模块、部件或单元本身的限定。The modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示例性的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
以上描述仅为本公开的一些实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).
虽然已经通过示例对本公开的一些特定实施例进行了详细说明,但是本领域的技术人员应该理解,以上示例仅是为了进行说明,而不是为了限制本公开的范围。本领域的技术人员应该理解,可在不脱离本公开的范围和精神的情况下,对以上实施例进行修改。本公开的范围由所附权利要求来限定。Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311040961.0A CN118802046A (en) | 2023-08-17 | 2023-08-17 | Time synchronization method, device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311040961.0A CN118802046A (en) | 2023-08-17 | 2023-08-17 | Time synchronization method, device, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118802046A true CN118802046A (en) | 2024-10-18 |
Family
ID=93024190
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311040961.0A Pending CN118802046A (en) | 2023-08-17 | 2023-08-17 | Time synchronization method, device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118802046A (en) |
-
2023
- 2023-08-17 CN CN202311040961.0A patent/CN118802046A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8995473B2 (en) | Ring based precise time data network clock phase adjustments | |
US10158441B1 (en) | Securing time between nodes | |
KR102031268B1 (en) | Method and apparatus for communicating time information between time-aware devices | |
US20170359139A1 (en) | Synchronization with Different Clock Transport Protocols | |
CN108259109B (en) | Network equipment in PTP domain and TOD synchronization method | |
WO2014032350A1 (en) | Method and node based on seamless redundant ring network for increasing precision of clock | |
US11099599B2 (en) | Communication device, cascaded network and internal synchronization method | |
US8949648B2 (en) | System and method to overcome wander accumulation to achieve precision clock distribution over large networks | |
CN102195766B (en) | Time synchronization method and clock device | |
CN104184534B (en) | Method for achieving accuracy of transparent clock path delay of IEEE1588 protocol | |
EP2448168A1 (en) | Method and system for bearing time synchronization protocol in optical transport network | |
US11456849B2 (en) | Method and apparatus for synchronizing different communication ports | |
CN102195735A (en) | Time synchronization method for multi-subsystem equipment and subsystem | |
WO2014187310A1 (en) | Method and apparatus for ptp synchronous network | |
CN110719135A (en) | Time calibration method and system and electronic device | |
CN104601269B (en) | Master-salve clock synchronous method and system | |
CN104838615A (en) | Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method | |
CN114389735A (en) | A Clock Synchronization Method Based on IEEE802.1AS Redundant Master Clock | |
WO2019169820A1 (en) | High-precision time synchronization method | |
CN108683472A (en) | A kind of clock synchronizing method based on Time delay measurement | |
JP2011023788A (en) | Network synchronization method and synchronization circuit | |
WO2020059137A1 (en) | Communication device, communication system, communication method, and communication program | |
Moreira et al. | IEEE 1588 Transparent Clock architecture for FPGA-based network devices | |
CN118802046A (en) | Time synchronization method, device, electronic device and storage medium | |
CN102404104B (en) | Adaptive synchronicity method and system based on different delayed time mechanism |
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 |