CN117118553A - A clock synchronization method and communication device - Google Patents
A clock synchronization method and communication device Download PDFInfo
- Publication number
- CN117118553A CN117118553A CN202210537892.3A CN202210537892A CN117118553A CN 117118553 A CN117118553 A CN 117118553A CN 202210537892 A CN202210537892 A CN 202210537892A CN 117118553 A CN117118553 A CN 117118553A
- Authority
- CN
- China
- Prior art keywords
- time
- clock
- message
- deviation
- frequency
- 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/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
- H04J3/0667—Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
Description
技术领域Technical field
本申请涉及同步技术领域,尤其涉及一种时钟同步方法及通信装置。The present application relates to the field of synchronization technology, and in particular, to a clock synchronization method and communication device.
背景技术Background technique
时钟同步可以使得网络中的各个节点的时间、频率,相位等同步,从而可使得各个节点正常交互。例如,以节点A需要同步节点B为例,节点A和节点B均设置有时钟模块和处理模块。处理模块可以处理相关报文以及收集时间戳,并发送所得到报文和时间戳信息,时钟模块可根据接收的时间戳信息进行时钟信息,例如时间偏差、频率偏差等,从而调整本地的实时时钟,以实现各个节点的时钟同步。然而,该过程需要被同步的节点(例如节点B)向需要同步的节点(例如节点A)发送报文,这就需要在节点A部署精准时间协议(precisiontime protocol,PTP),即要求节点A具有PTP功能,导致网络内节点的数量受限。Clock synchronization can synchronize the time, frequency, phase, etc. of each node in the network, so that each node can interact normally. For example, take node A that needs to synchronize node B as an example. Both node A and node B are equipped with clock modules and processing modules. The processing module can process related messages and collect timestamps, and send the obtained messages and timestamp information. The clock module can obtain clock information, such as time deviation, frequency deviation, etc., based on the received timestamp information, thereby adjusting the local real-time clock. , to achieve clock synchronization of each node. However, this process requires the node to be synchronized (such as node B) to send a message to the node that needs to be synchronized (such as node A). This requires deploying the precision time protocol (PTP) on node A, which requires node A to have The PTP function limits the number of nodes in the network.
发明内容Contents of the invention
本申请提供一种时钟同步方法及通信装置,以解决网络内节点数量受限的问题。This application provides a clock synchronization method and communication device to solve the problem of limited number of nodes in the network.
第一方面,本申请实施例提供一种时钟同步方法,该方法可由第一通信装置执行,第一通信装置可以是通信设备或能够支持通信设备实现该方法所需的功能的通信装置,例如芯片系统。下面以所述通信设备是第一设备为例进行描述。示例性地,所述第一通信装置为第一设备,或者为设置在第一设备中的芯片,或者为用于实现第一设备的功能的其他部件。该方法包括:In a first aspect, embodiments of the present application provide a clock synchronization method, which can be executed by a first communication device. The first communication device can be a communication device or a communication device that can support the communication device to implement the functions required by the method, such as a chip. system. The following description takes the communication device as the first device as an example. Illustratively, the first communication device is a first device, or a chip provided in the first device, or other components used to implement the functions of the first device. The method includes:
第一设备接收第二设备发送的多个第一报文,并根据多个第一报文对应的多个第一时间和多个第二时间确定第一设备的时钟与第二设备的参考时钟之间的偏差,从而基于所述偏差校准第一设备的时钟。其中,多个第一报文和多个第一时间一一对应,第一时间为对应的第一报文的发送时间。多个第一时间和多个第二时间一一对应,多个第二时间中的一个第二时间为多个第一时间中的一个第一时间对应的第一报文的接收时间。The first device receives multiple first messages sent by the second device, and determines the clock of the first device and the reference clock of the second device based on multiple first times and multiple second times corresponding to the multiple first messages. deviation between them, thereby calibrating the clock of the first device based on the deviation. Wherein, multiple first messages correspond to multiple first times one-to-one, and the first time is the sending time of the corresponding first message. A plurality of first times and a plurality of second times correspond one to one, and a second time among the plurality of second times is the reception time of the first message corresponding to a first time among the plurality of first times.
第一设备和第二设备位于同一个网络,第一设备可认为是需要时钟同步的设备,第二设备可认为是参考时钟源。在本申请实施例中,第二设备可以是网络中除第一设备之外的任意设备。即本申请实施例可将网络中的任意一个时钟作为参考时钟,从而无需外接时钟源,可降低设备的部署成本和管理成本。第二设备将携带发送时间的报文发送给第一设备,第一设备可根据第一报文的发送时间以及接收第一报文的时间计算相较于第二设备(即参考时钟)的时钟偏差、频偏,或者相位差等,实现第一设备与第二设备的时钟同步。通过本申请实施例提供的方法,不需要第一设备向第二设备反馈报文,因此,无需第二设备部署PTP的相关协议,从而可以使得网络部署更多的设备,即可解决网络内设备数量受限的问题。The first device and the second device are located on the same network. The first device can be considered as a device that requires clock synchronization, and the second device can be considered as a reference clock source. In this embodiment of the present application, the second device may be any device in the network except the first device. That is, the embodiment of the present application can use any clock in the network as a reference clock, thereby eliminating the need for an external clock source and reducing equipment deployment costs and management costs. The second device sends the message carrying the sending time to the first device. The first device can calculate the clock compared to the second device (ie, the reference clock) based on the sending time of the first message and the time of receiving the first message. Deviation, frequency offset, or phase difference, etc., to achieve clock synchronization between the first device and the second device. Through the method provided by the embodiments of this application, the first device does not need to feed back a message to the second device. Therefore, the second device does not need to deploy PTP-related protocols, which allows the network to deploy more devices and solve the problem of devices within the network. Limited number of questions.
在一种可能的实现方式中,所述方法还包括:第一设备接收第三设备发送的至少一个第二报文,每个第二报文包括所述第一时间;第一设备根据至少一个第二报文对应的至少一个第一时间和至少一个第三时间确定第一设备的时钟与第二设备的参考时钟之间的偏差。至少一个第一时间和至少一个第三时间一一对应,至少一个第三时间中的一个第三时间为该第三时间对应的第二报文的接收时间。In a possible implementation, the method further includes: the first device receiving at least one second message sent by the third device, each second message including the first time; the first device according to at least one At least one first time and at least one third time corresponding to the second message determine the deviation between the clock of the first device and the reference clock of the second device. At least one first time corresponds to at least one third time, and one of the at least one third time is the reception time of the second message corresponding to the third time.
第三设备是与第一设备和第二设备位于同一个网络的设备。第三设备发送的第二报文包括第一时间,可理解为,第三设备接收到第二设备发送的第一报文,向网络内的其他设备转发第一报文。这样即使第一设备没有接收到第二设备广播或组播的第一报文,也可以从第三设备接收到携带第一时间的第二报文。从而第一设备可根据从第三设备接收的第二报文中的第一时间,以及接收第二报文的第三时间确定第一设备的时钟和第二设备的时钟之间的偏差。即可提高第一设备确定第一设备的时钟和第二设备的时钟之间的偏差的成功率。The third device is a device located on the same network as the first device and the second device. The second message sent by the third device includes the first time, which can be understood as the third device receives the first message sent by the second device and forwards the first message to other devices in the network. In this way, even if the first device does not receive the first message broadcast or multicast by the second device, it can still receive the second message carrying the first time from the third device. Therefore, the first device can determine the deviation between the clock of the first device and the clock of the second device based on the first time in the second message received from the third device and the third time of receiving the second message. That is, the success rate of the first device in determining the deviation between the clock of the first device and the clock of the second device is improved.
在可能的实现方式中,所述偏差包括频率偏差,第一设备根据多个第一时间和多个第二时间确定第一设备的时钟与第二设备的参考时钟之间的偏差,包括:In a possible implementation, the deviation includes a frequency deviation, and the first device determines the deviation between the clock of the first device and the reference clock of the second device based on a plurality of first times and a plurality of second times, including:
第一设备将多组时间戳映射到二维坐标系,并基于目标函数确定第一直线。其中,多组时间戳中的一组时间戳包括一个第一时间和对应的第四时间。二维坐标以第一时间为横坐标,以第四时间为纵坐标,第四时间为第二时间与第一时间的差值。第一直线的斜率为第一设备的时钟与第二设备的参考时钟之间的频率差值。目标函数使得二维坐标系内的多组时间戳位于第一直线的同一侧。可以理解的是,一组时间戳包括一个报文的发送时间和对应的该报文的接收时间与发送时间的时间差,多组时间戳以发送时间作为横坐标,以所述时间差作为纵坐标映射到二维坐标系。这多组时间戳在二维坐标系的总体倾斜趋势可表征第一设备的时钟与第二设备的参考时钟之间的频率差值。通过目标函数使得二维坐标系内的多组时间戳位于第一直线的同一侧,从而得到较为准确的频率差值。The first device maps multiple sets of time stamps to a two-dimensional coordinate system and determines a first straight line based on the objective function. Wherein, one set of timestamps among the multiple sets of timestamps includes a first time and a corresponding fourth time. The two-dimensional coordinates use the first time as the abscissa, the fourth time as the ordinate, and the fourth time is the difference between the second time and the first time. The slope of the first straight line is the frequency difference between the clock of the first device and the reference clock of the second device. The objective function makes multiple sets of timestamps in the two-dimensional coordinate system lie on the same side of the first straight line. It can be understood that a set of timestamps includes the sending time of a message and the corresponding time difference between the receiving time and the sending time of the message. Multiple sets of timestamps are mapped with the sending time as the abscissa and the time difference as the ordinate. to a two-dimensional coordinate system. The overall tilt trend of the multiple sets of time stamps in the two-dimensional coordinate system can represent the frequency difference between the clock of the first device and the reference clock of the second device. Through the objective function, multiple sets of time stamps in the two-dimensional coordinate system are located on the same side of the first straight line, thereby obtaining a more accurate frequency difference.
在可能的实现方式中,目标函数满足:s.t.axi+b-yi≤ε,其中,xi=t1,i,yi=t2,i-t1,i,ε为预设参数,t1,i和t2,i-t1,i为第i组时间戳。通过该目标函数,使得第一直线ax+b中的a趋于稳定值,从而得到较为精确频率偏差。Among possible implementations, the objective function satisfies: stax i +by i ≤ε, where, x i =t 1,i , y i =t 2,i -t 1,i , ε is the preset parameter, t 1,i and t 2,i -t 1, i is the i-th group of timestamps. Through this objective function, a in the first straight line ax+b tends to a stable value, thereby obtaining a more accurate frequency deviation.
在可能的实现方式中,所述方法还包括:第一设备确定第一直线在多组时间戳中横坐标最大的一组时间戳上的取值为相位偏差。以第一直线在多组时间戳中横坐标最大的一组时间戳上的取值作为相位偏差,可过滤掉报文传输过程中的噪声,从而支持设备端到端的部署。In a possible implementation, the method further includes: the first device determines that the value of the first straight line on a set of timestamps with the largest abscissa among the multiple sets of timestamps is the phase deviation. Using the value of the first straight line on the time stamp with the largest abscissa among multiple sets of timestamps as the phase deviation can filter out noise during packet transmission, thus supporting end-to-end deployment of equipment.
在可能的实现方式中,第一设备首次确定的相位偏差为相位调整的基准值。这样可以维持时钟相位偏差,避免由于相位偏差的累积,或者出现相位偏差的跳变而导致时钟同步失败。In a possible implementation, the phase deviation determined for the first time by the first device is a reference value for phase adjustment. This can maintain the clock phase deviation and avoid clock synchronization failure due to accumulation of phase deviation or jump of phase deviation.
在可能的实现方式中,第一设备基于所述偏差校准第一设备的时钟,包括:In a possible implementation, the first device calibrates the clock of the first device based on the deviation, including:
第一设备确定频率补偿值,根据频率补偿值校准第一设备的时钟的频率。其中,频率补偿值为所述频率差值与时钟频率的比值。由于频率差值与时钟频率的比值,即频率补偿值会影响时钟每次收到脉冲信号后的时间增加值,因此,基于频率补偿值可校准第一设备的时钟。且无需锁定数字锁相环,可以降低对晶振稳定性的要求,从而降低第一设备的晶振成本。The first device determines a frequency compensation value, and calibrates the frequency of the clock of the first device according to the frequency compensation value. The frequency compensation value is the ratio of the frequency difference to the clock frequency. Since the ratio of the frequency difference to the clock frequency, that is, the frequency compensation value, will affect the time increment of the clock after each pulse signal is received, therefore, the clock of the first device can be calibrated based on the frequency compensation value. And there is no need to lock the digital phase-locked loop, which can reduce the requirements for the stability of the crystal oscillator, thereby reducing the crystal oscillator cost of the first device.
在可能的实现方式中,第一报文以广播方式或组播方式发送。这样第二设备所在网络中的任意设备以第二设备的时钟作为参考时钟,从而能够实现网络内各个设备的时钟同步。In a possible implementation manner, the first message is sent in a broadcast mode or a multicast mode. In this way, any device in the network where the second device is located uses the clock of the second device as a reference clock, thereby achieving clock synchronization of each device in the network.
在可能的实现方式中,第一报文在控制面生成,并通过数据面端口发送。可以理解的是,相较于控制面来说,在数据面生成时间戳更为准确可靠。因此,通过数据面端口发送第一报文,可提高时钟同步的精度。In a possible implementation, the first message is generated on the control plane and sent through the data plane port. It is understandable that compared to the control plane, generating timestamps on the data plane is more accurate and reliable. Therefore, sending the first message through the data plane port can improve the accuracy of clock synchronization.
在可能的实现方式中,第一时间在控制面或数据面确定。第一时间,即第一报文的发送时间可以在控制面产生,也可以在数据面产生,更为灵活。In a possible implementation, it is determined on the control plane or data plane at the first time. The first time, that is, the sending time of the first message can be generated on the control plane or on the data plane, which is more flexible.
在可能的实现方式中,第一设备和第二设备直接通信,也就是,支持设备的点到点部署。当然,第一设备和第二设备之间也可以部署其他设备,适用范围更广。In a possible implementation, the first device and the second device communicate directly, that is, point-to-point deployment of the devices is supported. Of course, other devices can also be deployed between the first device and the second device, with a wider scope of application.
第二方面,本申请实施例提供了一种通信装置,所述通信装置具有实现上述第一方面的方法实施例中行为的功能,有益效果可以参见第一方面的描述,此处不再赘述。该通信装置可以是第一方面中的第一设备,或者该通信装置可以是能够实现第一方面提供的方法的装置,例如芯片或芯片系统。In the second aspect, embodiments of the present application provide a communication device, which has the function of implementing the behavior in the method embodiment of the first aspect. For beneficial effects, please refer to the description of the first aspect, and will not be described again here. The communication device may be the first device in the first aspect, or the communication device may be a device capable of implementing the method provided in the first aspect, such as a chip or a chip system.
在一个可能的设计中,该通信装置包括用于执行第一方面的方法的相应手段(means)或模块。例如,所述通信装置:包括处理单元(有时也称为处理模块或处理器)和/或收发单元(有时也称为收发模块或收发器)。这些单元(模块)可以执行上述第一方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible design, the communication device includes corresponding means or modules for performing the method of the first aspect. For example, the communication device includes a processing unit (sometimes also called a processing module or processor) and/or a transceiver unit (sometimes also called a transceiver module or transceiver). These units (modules) can perform the corresponding functions in the above-mentioned method examples of the first aspect. For details, please refer to the detailed description in the method examples, which will not be described again here.
第三方面,本申请实施例提供一种通信装置,该通信装置可以为上述实施例中第一方面中的通信装置,或者为设置在第一方面中的通信装置中的芯片或芯片系统。该通信装置包括通信接口以及处理器,可选的,还包括存储器。其中,该存储器用于存储计算机程序,处理器与存储器、通信接口耦合,当处理器读取所述计算机程序或指令时,使通信装置执行上述方法实施例中由第一设备所执行的方法。In a third aspect, embodiments of the present application provide a communication device. The communication device may be the communication device in the first aspect of the above embodiments, or a chip or chip system provided in the communication device in the first aspect. The communication device includes a communication interface and a processor, and optionally, a memory. The memory is used to store computer programs, and the processor is coupled to the memory and the communication interface. When the processor reads the computer program or instructions, the communication device causes the communication device to execute the method executed by the first device in the above method embodiment.
第四方面,本申请实施例提供了一种通信装置,该通信装置包括输入输出接口和逻辑电路。输入输出接口用于输入和/或输出信息。逻辑电路用于执行第一方面中所述的方法。In a fourth aspect, embodiments of the present application provide a communication device, which includes an input-output interface and a logic circuit. Input and output interfaces are used to input and/or output information. Logic circuitry is used to perform the method described in the first aspect.
第五方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器和/或通信接口,用于实现第一方面中所述的方法。在一种可能的实现方式中,所述芯片系统还包括存储器,用于保存计算机程序。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a fifth aspect, embodiments of the present application provide a chip system, which includes a processor and may also include a memory and/or a communication interface for implementing the method described in the first aspect. In a possible implementation, the chip system further includes a memory for storing a computer program. The chip system can be composed of chips or include chips and other discrete devices.
第六方面,本申请实施例提供了一种通信系统,所述通信系统包括第一设备和第二设备,其中,第一设备用于执行上述第一方面中由第一设备所执行的方法,第二设备用于执行上述第一方面中由第二设备所执行的方法。或者,所述通信系统还可以包括更多个第一设备和/或更多个第二设备。In a sixth aspect, embodiments of the present application provide a communication system, which includes a first device and a second device, wherein the first device is configured to perform the method performed by the first device in the first aspect, The second device is configured to perform the method performed by the second device in the above first aspect. Alternatively, the communication system may also include more first devices and/or more second devices.
第七方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,当该计算机程序被运行时,实现上述第一方面中的方法。In a seventh aspect, the present application provides a computer-readable storage medium that stores a computer program. When the computer program is run, the method in the first aspect is implemented.
第八方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被运行时,使得上述第一方面中的方法被执行。In an eighth aspect, a computer program product is provided. The computer program product includes: computer program code. When the computer program code is run, the method in the first aspect is executed.
上述第二方面至第八方面及其实现方式的有益效果可以参考对第一方面及其实现方式的有益效果的描述。For the beneficial effects of the above second to eighth aspects and their implementation, reference can be made to the description of the beneficial effects of the first aspect and their implementation.
附图说明Description of drawings
图1为本申请实施例提供的同步以太网的原理示意图;Figure 1 is a schematic diagram of the principle of synchronous Ethernet provided by the embodiment of the present application;
图2为本申请实施例提供的基于时间戳实现两个设备时钟同步的原理示意图;Figure 2 is a schematic diagram of the principle of achieving clock synchronization of two devices based on timestamps provided by an embodiment of the present application;
图3为本申请实施例的一种应用场景;Figure 3 is an application scenario of the embodiment of the present application;
图4为本申请实施例的时钟同步方法的流程示意图;Figure 4 is a schematic flow chart of a clock synchronization method according to an embodiment of the present application;
图5为本申请实施例提供的在数据面产生时间戳的示意图;Figure 5 is a schematic diagram of generating timestamps on the data plane according to an embodiment of the present application;
图6为本申请实施例提供的在控制面产生时间戳的示意图;Figure 6 is a schematic diagram of generating timestamps on the control plane according to an embodiment of the present application;
图7为本申请实施例适用的广播场景示意图;Figure 7 is a schematic diagram of a broadcast scenario applicable to the embodiment of the present application;
图8为本申请实施例适用的组播场景示意图;Figure 8 is a schematic diagram of a multicast scenario applicable to the embodiment of this application;
图9为本申请实施例提供的两个设备时钟同步的示意图;Figure 9 is a schematic diagram of clock synchronization of two devices provided by an embodiment of the present application;
图10为本申请实施例提供的通信装置的一种结构示意图;Figure 10 is a schematic structural diagram of a communication device provided by an embodiment of the present application;
图11为本申请实施例提供的通信装置的另一种结构示意图。Figure 11 is another schematic structural diagram of a communication device provided by an embodiment of the present application.
具体实施方式Detailed ways
首先,介绍本申请实施例涉及的部分用语或概念,以便于本领域技术人员理解本申请实施例提供的方案。First, some terms or concepts involved in the embodiments of the present application are introduced to facilitate those skilled in the art to understand the solutions provided by the embodiments of the present application.
1)时钟同步,包括时间同步、频率同步和相位同步三种类型。其中,时间同步指不同的时钟的协调通用时间(universal time coordinated,UTC)绝对一致。例如,时钟A的UTC和时钟B的UTC相同,那么时钟A和时钟B的时间同步。两个时钟的UTC不同,也可以认为,两个时钟存在时钟偏移。应理解,时钟偏移为两个时钟之间的相对差值。举例来说,在同一个时刻,时钟1的UTC为12:00,时钟2的UTC为12:01,时钟1相对于时钟2的时钟偏移为-1秒钟,时钟2相对于时钟1的时钟偏移为1秒钟。1) Clock synchronization, including three types: time synchronization, frequency synchronization and phase synchronization. Among them, time synchronization means that the coordinated universal time (universal time coordinated, UTC) of different clocks is absolutely consistent. For example, if the UTC of clock A is the same as the UTC of clock B, then the times of clock A and clock B are synchronized. The UTC of the two clocks is different, and it can also be considered that there is a clock offset in the two clocks. It should be understood that clock offset is the relative difference between two clocks. For example, at the same moment, the UTC of clock 1 is 12:00, the UTC of clock 2 is 12:01, the clock offset of clock 1 relative to clock 2 is -1 second, and the clock offset of clock 2 relative to clock 1 The clock offset is 1 second.
频率同步指信号的频率保持不变,例如,从起始时刻开始,经过一段时间,信号的频率跟踪到基准频率。需要说明的是,频率同步不要求信号的频率在起始时刻与基准频率一致。举例来说,信号A在第一时刻的频率为f1,信号B在第二时刻的频率为f2,经过第一时长,f1变为f,经过第二时长,f2变为f。如果f1和f2不同,第一时刻和第二时刻可以不同,第一时长和第二时长也可以不同。信号的频率不同步,也可以认为信号在不同时刻存在频偏,也称为偏移速度(drift)。应理解,偏移速度指两个时钟之间的偏移量随时间变化的速率,表示经过单位时间,时钟偏移变化的大小。单位时间可以是秒或微秒等。Frequency synchronization means that the frequency of the signal remains unchanged. For example, starting from the starting moment, after a period of time, the frequency of the signal tracks to the reference frequency. It should be noted that frequency synchronization does not require the frequency of the signal to be consistent with the reference frequency at the starting moment. For example, the frequency of signal A at the first moment is f1, and the frequency of signal B at the second moment is f2. After the first duration, f1 becomes f, and after the second duration, f2 becomes f. If f1 and f2 are different, the first moment and the second moment can be different, and the first duration and the second duration can also be different. If the frequency of the signal is not synchronized, it can also be considered that the signal has a frequency deviation at different times, which is also called drift. It should be understood that the offset speed refers to the rate at which the offset between the two clocks changes with time, and represents the size of the clock offset change after unit time. The unit time can be seconds or microseconds, etc.
相位同步是在频率同步的基础上,信号的两个时间差保持不变。也可以理解为,在频率同步的基础上,调整相位,使得相位跟踪到基准相位。与频率同步类似,相位同步不要求信号的相位在起始时刻与基准相位一致。举例来说,信号A在第一时刻的相位为θ1,信号B在第二时刻的相位为θ2,经过第一时长,θ1变为θ,经过第二时长,θ2变为θ。如果θ1和θ2不同,第一时刻和第二时刻可以不同。Phase synchronization is based on frequency synchronization, and the two time differences of the signal remain unchanged. It can also be understood that on the basis of frequency synchronization, the phase is adjusted so that the phase tracks the reference phase. Similar to frequency synchronization, phase synchronization does not require the phase of the signal to be consistent with the reference phase at the starting moment. For example, the phase of signal A at the first moment is θ1, and the phase of signal B at the second moment is θ2. After the first duration, θ1 becomes θ, and after the second duration, θ2 becomes θ. If θ1 and θ2 are different, the first moment and the second moment can be different.
2)同步以太网(synchronization ethernet,SyncE),是一种时钟同步的技术。SyncE指接收端通过以太网物理层(physical layer,PHY)芯片从串行数据码流中恢复出发送端的时钟,从而实现时钟同步。为了方便理解,请参见图1,为同步以太网的原理示意图。图1以网络包括设备1和设备2为例,设备1为发送端,设备2为接收端。从图1中可以看出,发送端和接收端都包括物理层芯片,发送端还包括时钟1,且外接时钟源1;接收端还包括锁相环,且外接时钟源2。应理解,由于SyncE存在信号噪声较大的缺陷,因此需要通过锁相环处理噪声。2) Synchronization ethernet (SyncE) is a clock synchronization technology. SyncE means that the receiving end recovers the clock of the transmitting end from the serial data stream through the Ethernet physical layer (PHY) chip, thereby achieving clock synchronization. For easy understanding, please refer to Figure 1, which is a schematic diagram of the principle of synchronous Ethernet. Figure 1 takes the network as an example including device 1 and device 2. Device 1 is the sender and device 2 is the receiver. As can be seen from Figure 1, both the sending end and the receiving end include physical layer chips. The sending end also includes clock 1 and is connected to clock source 1; the receiving end also includes a phase-locked loop and is connected to clock source 2. It should be understood that since SyncE has the defect of large signal noise, the noise needs to be processed through a phase-locked loop.
发送端通过物理层芯片向接收端发送串行数据码流,接收端根据该串行数据码流恢复出发送端的时钟。应理解,外接的时钟源1可以为发送端提供基准时间。同理,外接的时钟源2为接收端提供基准时间。接收端可根据发送端的时钟和外接的时钟源2调整本地的时钟。调整之后的本地时钟可以认为是接收端的系统时钟,接收端可根据该系统时钟进行业务传输。例如,接收端的业务模块可以获取系统时钟,并根据该系统时钟传输业务。又例如,接收端的物理层芯片可以获取系统时钟,并根据该系统时钟向发送端发送串行数据码流。The sending end sends a serial data code stream to the receiving end through the physical layer chip, and the receiving end recovers the clock of the sending end based on the serial data code stream. It should be understood that the external clock source 1 can provide the reference time for the sending end. In the same way, the external clock source 2 provides the reference time for the receiving end. The receiving end can adjust the local clock according to the clock of the transmitting end and the external clock source 2. The adjusted local clock can be considered as the system clock of the receiving end, and the receiving end can perform service transmission according to the system clock. For example, the service module at the receiving end can obtain the system clock and transmit services based on the system clock. For another example, the physical layer chip at the receiving end can obtain the system clock and send a serial data stream to the transmitting end based on the system clock.
3)基于时间戳的时钟同步方法,即需要同步的设备可向被同步设备发送第一报文以及第一报文的第一发送时间,被同步设备记录接收第一报文的第一接收时间,并向需要同步的设备发送第二报文以及第一接收时间和第二报文的第二发送时间。需要同步的设备接收第二报文,并记录第二报文的第二接收时间。需要同步的设备可根据第一发送时间、第一接收时间、第二发送时间和第二接收时间进行时钟信息的计算,进而调整本地的时钟。其中,第一发送时间和第一接收时间可以认为是一组单向时间戳,同理,第二发送时间和第二接收时间也是一组单向时间戳。也就是,单向时间戳包括发送端向接收端发送的报文所记录的该报文的发送时间戳,以及接收端接收该报文的接收时间戳。3) Time stamp-based clock synchronization method, that is, the device that needs to be synchronized can send the first message and the first sending time of the first message to the device to be synchronized, and the device to be synchronized records the first reception time of receiving the first message. , and sends the second message, the first receiving time and the second sending time of the second message to the device that needs to be synchronized. The device that needs to be synchronized receives the second message and records the second reception time of the second message. The device that needs to be synchronized can calculate the clock information based on the first sending time, the first receiving time, the second sending time and the second receiving time, and then adjust the local clock. The first sending time and the first receiving time can be considered as a set of one-way timestamps. Similarly, the second sending time and the second receiving time are also a set of one-way timestamps. That is, the one-way timestamp includes the sending timestamp of the message recorded by the sending end to the receiving end, and the receiving timestamp of the receiving end receiving the message.
为了便于理解,请参见图2,需要同步的设备为设备1,被同步设备为设备2,第一发送时间为TXa,第一接收时间为RXb,第二发送时间为txb,第二接收时间为rxa。设基准时钟为t,设备1相较于t的偏移为Δta,设备2相较于t的偏移为Δtb,那么可知设备1的时钟ta=t+Δta,设备2的时钟tb=t+Δtb,设备1和设备2之间的时钟偏差offset=Δtb-Δta。假设,设备1发送给设备2的报文和设备2发送给设备1的报文的单项延迟(One Way Delay,OWD)相同,那么设备1可计算出:For ease of understanding, please refer to Figure 2. The device that needs to be synchronized is device 1, the device to be synchronized is device 2, the first sending time is TXa, the first receiving time is RXb, the second sending time is txb, and the second receiving time is rxa. Assume that the reference clock is t, the offset of device 1 compared to t is Δt a , and the offset of device 2 compared to t is Δt b . Then it can be seen that the clock of device 1 is t a =t+Δt a , and the clock of device 2 is Δt a t b =t + Δt b , the clock offset between device 1 and device 2 is offset = Δt b −Δt a . Assuming that the One Way Delay (OWD) of the packet sent by device 1 to device 2 and the packet sent by device 2 to device 1 are the same, then device 1 can calculate:
设备1基于OWD和offset可以调整本地时钟,例如,可将ta调整为tb+offset-OWD,或者,tb+offset-OWD,从而实现设备1和设备2的时钟同步。Device 1 can adjust the local clock based on OWD and offset. For example, t a can be adjusted to t b +offset-OWD, or t b +offset-OWD, thereby achieving clock synchronization between device 1 and device 2.
4)本申请实施例中,对于名词的数目,除非特别说明,表示“单数名词或复数名词”,即"一个或多个”。“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。例如,A/B,表示:A或B。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),表示:a,b,c,a和b,a和c,b和c,或a和b和c,其中a,b,c可以是单个,也可以是多个。4) In the embodiments of this application, the number of nouns, unless otherwise specified, means "singular noun or plural noun", that is, "one or more". "At least one" means one or more, and "plurality" means two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. For example, A/B means: A or B. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c means: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c Can be single or multiple.
本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的大小、内容、顺序、时序、优先级或者重要程度等。例如,第一报文和第二报文,可以是同一个报文,也可以是不同的报文,且,这种名称也并不是表示这两个报文的内容、优先级或者重要程度等的不同。另外,本申请所介绍的各个实施例中对于步骤的编号,只是为了区分不同的步骤,并不用于限定步骤之间的先后顺序。The ordinal words such as "first" and "second" mentioned in the embodiment of this application are used to distinguish multiple objects and are not used to limit the size, content, order, timing, priority or importance of multiple objects. For example, the first message and the second message can be the same message or different messages, and this name does not indicate the content, priority or importance of the two messages. s difference. In addition, the numbering of steps in the various embodiments introduced in this application is only to distinguish different steps and is not used to limit the order between steps.
在分布式网络中,为了保证各个节点的正常交互,各个节点需要时钟同步。例如,任意一个节点可基于SyncE技术实现与其他节点的时钟同步,或者,也可以基于时间戳的时钟同步方法实现与其他节点的时钟同步。然而,从图1中可以看出,基于SyncE技术实现时钟同步,需要发送端和接收端都外接时钟源,以尽量提高时钟同步的精确度,显然会增加部署成本。另外,接收端需要设置处理噪声的锁相环,这就需要接收端配置具有较高稳定性的晶振,从而增加了接收端的硬件成本。且,SyncE需要逐跳部署设备,从这个角度来说,也会增加部署成本,也会增加管理所部署的设备的成本。图2基于时间戳的时钟同步方法,要求接收端向发送端反馈报文,这就需要在需要同步的设备部署PTP,也就是要求,需要同步的设备具备PTP功能。没有部署PTP的节点无法实现时钟同步,从而限制了网络中节点的数量。In a distributed network, in order to ensure the normal interaction of each node, each node needs clock synchronization. For example, any node can achieve clock synchronization with other nodes based on SyncE technology, or it can also achieve clock synchronization with other nodes based on a timestamp-based clock synchronization method. However, as can be seen from Figure 1, clock synchronization based on SyncE technology requires both the sender and the receiver to connect external clock sources to maximize the accuracy of clock synchronization, which will obviously increase deployment costs. In addition, the receiving end needs to set up a phase-locked loop to handle noise, which requires the receiving end to be equipped with a crystal oscillator with higher stability, thus increasing the hardware cost of the receiving end. Moreover, SyncE needs to deploy devices hop by hop. From this perspective, it will also increase the cost of deployment and the cost of managing the deployed devices. Figure 2 The clock synchronization method based on timestamp requires the receiving end to feed back a message to the sending end. This requires deploying PTP on the device that needs to be synchronized, which means that the device that needs to be synchronized is required to have PTP functionality. Nodes without PTP deployed cannot achieve clock synchronization, thus limiting the number of nodes in the network.
鉴于此,提供本申请实施例的技术方案。在该方案中,可将网络中的任意一个时钟作为参考时钟,从而无需外接时钟源,降低设备的部署成本和管理成本。被选定作为参考时钟的设备(也可以称为被时钟同步设备)可以向需要时钟同步的设备发送携带发送时间的报文,需要时钟同步的设备可基于时间戳的时钟同步方法实现与被时钟同步设备的时钟同步。例如,被时钟同步设备将携带发送时间的第一报文发送给多个设备,这多个设备中的任意设备可基于接收第一报文的时间以及第一报文的发送时间计算相较于被时钟同步设备的时钟偏差、频偏,相位差等,从而实现与被时钟同步设备的时钟同步。由于网络内任意节点都可以作为参考时钟,因此,通过该方法可实现网络内各个节点的时钟同步。且不需要时钟同步的设备向被时钟同步设备反馈报文,因此,需要时钟同步设备无需部署PTP,即对需要时钟同步设备的功能要求较低,从而可使得网络部署更多的节点。In view of this, technical solutions of embodiments of the present application are provided. In this solution, any clock in the network can be used as the reference clock, eliminating the need for an external clock source and reducing equipment deployment and management costs. The device selected as the reference clock (also called the clocked device) can send a message carrying the sending time to the device that needs clock synchronization. The device that needs clock synchronization can realize the clock synchronization method based on the timestamp with the clocked device. Synchronize the device's clock synchronization. For example, the clock-synchronized device sends the first message carrying the sending time to multiple devices. Any device among the multiple devices can calculate the comparison based on the time of receiving the first message and the sending time of the first message. The clock deviation, frequency offset, phase difference, etc. of the device being clocked to be synchronized can be realized to achieve clock synchronization with the device being clocked to be synchronized. Since any node in the network can be used as a reference clock, this method can achieve clock synchronization of each node in the network. And devices that do not need clock synchronization feed back packets to the devices being clocked synchronized. Therefore, devices that require clock synchronization do not need to deploy PTP, which means that the functional requirements of the devices that require clock synchronization are lower, which allows the network to deploy more nodes.
为了使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施例作进一步地详细描述。In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
本申请实施例提供的技术方案可适用于需要时钟同步的系统,例如分布式网络(下文以此为例)。请参见图3,为本申请实施例的一种应用场景。在图3中包括n+1个客户端,这n+1个客户端中的任意一个客户端的时钟被选定为参考时钟。为了便于区分,将被选定为参考时钟的客户端称为客户端S,那么其余客户端例如为客户端1-客户端n。也可以理解为,客户端S是被时钟同步的设备,客户端1-客户端n中的任一客户端可基于客户端S的时钟实现时钟同步。下面以图3所示的场景介绍本申请实施例提供的方案。图3中的各个客户端可以通过网络进行信息的交互。这里的网络可以是媒体访问控制(media access control,MAC)层或无线链路控制(radio link control,RLC)层,也可以是无线资源控制(radioresources control,RRC)层。其中,MCA层/RLC层也可以称为L2层,RRC层也称为L3层。The technical solutions provided by the embodiments of the present application can be applied to systems that require clock synchronization, such as distributed networks (hereinafter, this is used as an example). Please refer to Figure 3, which is an application scenario of an embodiment of the present application. Figure 3 includes n+1 clients, and the clock of any one of the n+1 clients is selected as the reference clock. For ease of distinction, the client selected as the reference clock is called client S, and the remaining clients are, for example, client 1-client n. It can also be understood that client S is a device synchronized by a clock, and any client from client 1 to client n can achieve clock synchronization based on the clock of client S. The following uses the scenario shown in Figure 3 to introduce the solution provided by the embodiment of the present application. Each client in Figure 3 can exchange information through the network. The network here can be a media access control (media access control, MAC) layer or a radio link control (radio link control, RLC) layer, or it can be a radio resource control (radioresources control, RRC) layer. Among them, the MCA layer/RLC layer may also be called the L2 layer, and the RRC layer may also be called the L3 layer.
本申请实施例提供一种时钟同步方法,请参见图4,为该方法的流程图。在下文的介绍过程中,以该方法应用于图3所示的网络架构为例。下文所述的第一设备例如为图3所示客户端1-客户端n中的任一客户端,下文所述的第二设备例如为图3所示的客户端S。An embodiment of the present application provides a clock synchronization method. Please refer to Figure 4, which is a flow chart of the method. In the following introduction process, this method is applied to the network architecture shown in Figure 3 as an example. The first device described below is, for example, any one of client 1 to client n shown in FIG. 3 , and the second device described below is, for example, client S shown in FIG. 3 .
S401、第二设备发送多个第一报文,其中,每个第一报文携带第一时间,该第一时间为对应第一报文的发送时间。S401. The second device sends multiple first messages, where each first message carries a first time, and the first time is the sending time of the corresponding first message.
作为参考时钟源的第二设备可发送多个第一报文,以用于需要时钟同步的设备(本文以第一设备为例)实现与第二设备的时钟同步。其中,第一报文携带第一报文的发送时间。第一设备接收这多个第一报文,可基于各个第一报文的发送时间和接收时间来确定第一设备与第二设备之间的时钟偏差、相位偏差,频率偏差等,从而实现与第二设备的时钟同步。可以理解的是,一个第一报文的发送时间和接收时间为一组单向时间戳。从这个角度来讲,也可以认为,第一设备可根据与第二设备之间的多组单向时间戳,实现与第二设备的时钟同步。为方便描述,下文以多个第一报文是M个第一报文为例,其中,M为大于或等于2的整数。第一报文的发送时间称为第一时间,第一设备接收该第一报文的时间称为第二时间。可以理解的是,M个第一报文对应M个第一时间和M个第二时间,其中,M个第一时间和M个第二时间一一对应。一组单向时间戳包括一个第一时间,以及与该第一时间对应的第二时间。The second device serving as the reference clock source can send multiple first messages to enable a device that requires clock synchronization (the first device is taken as an example in this article) to achieve clock synchronization with the second device. The first message carries the sending time of the first message. The first device receives the plurality of first messages and can determine the clock deviation, phase deviation, frequency deviation, etc. between the first device and the second device based on the sending time and receiving time of each first message, thereby achieving communication with The clock of the second device is synchronized. It can be understood that the sending time and receiving time of a first message are a set of one-way timestamps. From this perspective, it can also be considered that the first device can achieve clock synchronization with the second device based on multiple sets of one-way timestamps with the second device. For convenience of description, the following takes an example in which the plurality of first messages are M first messages, where M is an integer greater than or equal to 2. The time when the first message is sent is called the first time, and the time when the first device receives the first message is called the second time. It can be understood that M first messages correspond to M first times and M second times, where the M first times and M second times correspond one to one. A set of one-way timestamps includes a first time and a second time corresponding to the first time.
第二设备可以在控制面确定第一时间,也可以在数据面确定第一时间。也可以理解为,第二设备发送第一报文时,可以在控制面产生发送时间戳(第一时间),也可以在数据面产生发送时间戳(第一时间)。为方便理解,下面结合附图介绍第二设备确定第一时间的过程。The second device may determine the first time on the control plane or may determine the first time on the data plane. It can also be understood that when the second device sends the first message, it may generate a sending timestamp (first time) on the control plane, or it may generate a sending timestamp (first time) on the data plane. For ease of understanding, the process of the second device determining the first time is introduced below with reference to the accompanying drawings.
请参见图5,为在数据面产生时间戳的示意图。图5中,数字面的时间为时钟板所提供的实时时钟(real time clock,RTC),例如为图5中的RTC1。控制面的时间为晶振所提供的RTC,例如为RTC2。第二设备可以对第一报文进行标识,第一报文到达物理端口时由PTP硬件时钟(PTP hardware clock,PHC)产生时间戳,即第一时间(RTC1)。该RTC1可以存储在寄存器中,也可以放在第一报文的负载字段。可以理解的是,每个第一报文的第一时间都可以存储在寄存器,任意一个第一报文的第一时间在覆盖之前被读取。Please refer to Figure 5, which is a schematic diagram of generating timestamps on the data plane. In Figure 5, the time on the digital surface is the real time clock (RTC) provided by the clock board, for example, RTC1 in Figure 5. The time of the control plane is the RTC provided by the crystal oscillator, for example, RTC2. The second device can identify the first packet. When the first packet arrives at the physical port, a timestamp is generated by a PTP hardware clock (PHC), that is, the first time (RTC1). The RTC1 can be stored in a register or placed in the payload field of the first message. It can be understood that the first time of each first message can be stored in the register, and the first time of any first message is read before overwriting.
请参见图6,为在控制面产生时间戳的示意图。图6中,控制面的时间为晶振所提供的RTC,例如为RTC2。第二设备在发送第一报文之前,可以通过系统调用获取时间函数“clock_gettime”从用户态获取第一时间,再将第一时间放在第一报文的负载字段。应理解,用户态能够运行操作系统中的用户层的程序。Please refer to Figure 6, which is a schematic diagram of generating timestamps on the control plane. In Figure 6, the time of the control plane is the RTC provided by the crystal oscillator, for example, RTC2. Before sending the first message, the second device can obtain the first time from the user state through the system call function "clock_gettime", and then place the first time in the payload field of the first message. It should be understood that the user mode can run user-level programs in the operating system.
本申请实施例对于在控制面产生第一时间,还是在数据面产生第一时间不作限制。具体可根据同步精度选择在控制面或数据面产生第一时间。例如,同步精度要求纳秒级,那么可选择在数据面产生第一时间。同步精度要求微秒级,那么可选择在控制面产生第一时间。The embodiment of the present application does not limit whether the control plane is generated first or the data plane is generated first. Specifically, the first time can be generated on the control plane or the data plane according to the synchronization accuracy. For example, if synchronization accuracy requires nanosecond level, you can choose to generate the first time on the data plane. Synchronization accuracy requires microsecond level, so you can choose to generate the first time on the control plane.
相较于控制面来说,在数据面生成时间戳更为准确可靠。因此,在本申请实施例中,第二设备可在控制面生成第一报文,通过数据面端口发送该第一报文,从而提高时钟同步的精度。Compared with the control plane, generating timestamps on the data plane is more accurate and reliable. Therefore, in this embodiment of the present application, the second device can generate the first message on the control plane and send the first message through the data plane port, thereby improving the accuracy of clock synchronization.
在可能的实现方式中,第二设备可以广播第一报文或组播第一报文。即第一报文以广播方式或组播方式发送。这样,第二设备所在网络中的任意设备都可以以第二设备的时钟作为参考时钟,从而能够实现网络内各个设备的时钟同步。第二设备可以是网络中任意一个设备,从这个角度来说,网络中的任意设备可以广播或组播第一报文,对于接收第一报文的设备来说,以任意设备的时钟作为参考时钟,从而无需外接参考时钟源,也能够实现网络内各个设备的时钟同步。In a possible implementation manner, the second device may broadcast the first message or multicast the first message. That is, the first message is sent in broadcast mode or multicast mode. In this way, any device in the network where the second device is located can use the clock of the second device as a reference clock, thereby achieving clock synchronization of each device in the network. The second device can be any device in the network. From this perspective, any device in the network can broadcast or multicast the first message. For the device that receives the first message, the clock of any device is used as a reference. Clock, thus eliminating the need for an external reference clock source and enabling clock synchronization of various devices within the network.
举例来说,请参见图7,为本申请实施例的一种应用场景示意图,图7以第二设备广播第一报文为例。图7中的第二设备即参考时钟,客户端1-客户端n中的任意客户端可直接或间接与第二设备连接。第一设备为客户端1-客户端n中的任意一个客户端。例如,第二设备可在控制面获取第一时间,并封装携带第一时间的第一报文,再通过数据面端口向广播地址发送第一报文。客户端1-客户端n中的任意客户端可接收第一报文。如果第二设备广播多个第一报文,第二设备可周期性在控制面获取第一时间,并封装携带第一时间的第一报文。其中,第二设备可以本地广播,即不跨路由广播,广播地址可以是本地网址,例如,255.255.255.255。或者,第二设备也可以跨路由广播,例如,广播地址可以是子网地址,例如,192.168.2.255。或者,广播地址可以是全子网地址,例如,192.168.0.0。具体的,如图7所示,第二设备可使用广播网际协议(internet protocol,IP)地址和广播MAC目的地址将携带第一时间的第一报文广播给网络中客户端1-客户端n。如图7所示,广播地址即目的IP为192.168.1.255。For example, please refer to Figure 7, which is a schematic diagram of an application scenario according to an embodiment of the present application. Figure 7 takes the second device broadcasting the first message as an example. The second device in Figure 7 is the reference clock, and any client from client 1 to client n can be directly or indirectly connected to the second device. The first device is any one of client 1 to client n. For example, the second device can obtain the first time on the control plane, encapsulate the first message carrying the first time, and then send the first message to the broadcast address through the data plane port. Any client among client 1-client n can receive the first message. If the second device broadcasts multiple first messages, the second device can periodically obtain the first time on the control plane and encapsulate the first message carrying the first time. The second device can broadcast locally, that is, it does not broadcast across routes, and the broadcast address can be a local URL, for example, 255.255.255.255. Alternatively, the second device can also broadcast across routes, for example, the broadcast address can be a subnet address, for example, 192.168.2.255. Alternatively, the broadcast address can be a full-subnet address, such as 192.168.0.0. Specifically, as shown in Figure 7, the second device can use a broadcast Internet protocol (IP) address and a broadcast MAC destination address to broadcast the first message carrying the first time to client 1-client n in the network. . As shown in Figure 7, the broadcast address, that is, the destination IP is 192.168.1.255.
请参见图8,为本申请实施例的另一种应用场景示意图,图8以第二设备组播第一报文为例。图8中的第二设备即参考时钟,客户端1-客户端n中的部分客户端可作为一个组与第二设备直接连接或间接连接。第二设备可在控制面获取第一时间,并封装携带第一时间的第一报文,再通过数据面端口向组播地址发送第一报文。组播地址标识的一组客户端可接收第一报文。其中,组播地址可以是事先为一组客户端设置的,例如,组播地址的范围可以是224.0.0.0~239.255.255.255。Please refer to Figure 8, which is a schematic diagram of another application scenario according to the embodiment of the present application. Figure 8 takes the second device multicasting the first message as an example. The second device in Figure 8 is the reference clock, and some of the clients from client 1 to client n can be directly or indirectly connected to the second device as a group. The second device can obtain the first time on the control plane, encapsulate the first message carrying the first time, and then send the first message to the multicast address through the data plane port. A group of clients identified by the multicast address can receive the first message. The multicast address may be set in advance for a group of clients. For example, the multicast address may range from 224.0.0.0 to 239.255.255.255.
具体的,第二设备可使用IP地址和广播MAC目的地址将携带第一时间的第一报文组播给一组客户端。如图8所示,组播地址即目的IP为224.0.0.10。第二设备可以使用组播路由算法向组播地址发送第一报文,实现第一报文在广域网中的传递。例如,组播路由算法可基于独立组播协议(protocol independent multicast,PIM),也可以基于位索引显示复制(bit index explicit replication,BIER)。可以理解的是,PIM组播是指建立组播分发树,利用单播路由表对组播报文执行逆向路径转发(reverse path forwarding,RPF)检查,生成组播路由表,用于转发组播报文。BIER组播指基于位索引的显示复制路由协议,分为Overlay,BIER,Underlay三层,不需要建立组播分发树,也不需要中间节点保存任何组播流状态。Specifically, the second device may use the IP address and the broadcast MAC destination address to multicast the first message carrying the first time to a group of clients. As shown in Figure 8, the multicast address, that is, the destination IP is 224.0.0.10. The second device may use a multicast routing algorithm to send the first message to the multicast address to realize delivery of the first message in the wide area network. For example, the multicast routing algorithm can be based on protocol independent multicast (PIM) or bit index explicit replication (BIER). It can be understood that PIM multicast refers to establishing a multicast distribution tree, using unicast routing tables to perform reverse path forwarding (RPF) checks on multicast packets, and generating multicast routing tables for forwarding multicasts. message. BIER multicast refers to a bit-index-based explicit replication routing protocol, which is divided into three layers: Overlay, BIER, and Underlay. It does not require the establishment of a multicast distribution tree, nor does it require intermediate nodes to save any multicast flow status.
S402、第一设备根据多个第一报文对应的多个第一时间和多个第二时间确定第一设备的时钟与第二设备的时钟之间的偏差。S402. The first device determines the deviation between the clock of the first device and the clock of the second device based on multiple first times and multiple second times corresponding to the multiple first messages.
第一设备接收到第二设备发送的每个第一报文时,根据第一设备自身的时钟产生接收时间戳(本文中称为第二时间)。以第二设备发送M个第一报文为例,对于第一设备来说,可获得M个第一报文中的M个第一时间,以及与M个第一时间一一对应的M个第二时间。即第一设备可获得M组时间戳,一组时间戳包括第二设备发送一个第一报文的发送时间和第一设备接收该第一报文的接收时间。When the first device receives each first message sent by the second device, it generates a reception timestamp (herein referred to as the second time) based on the first device's own clock. Taking the second device sending M first messages as an example, for the first device, M first times in the M first messages can be obtained, and M first times corresponding to the M first times can be obtained The second time. That is, the first device can obtain M sets of timestamps, and one set of timestamps includes the sending time when the second device sends a first message and the receiving time when the first device receives the first message.
第一设备可根据M组时间戳确定第一设备的时钟与第二设备的时钟之间的偏差。该偏差可以是时钟偏差,也可以是频率偏差,也可以是相位偏差,或者,该偏差可以是上述三种偏差中的至少两种偏差。也就是说,第一设备可根据M组时间戳确定第一设备的时钟与第二设备的时钟之间的时钟偏差、频率偏差,或者相位偏差中的至少一种偏差。在可能的实现方式中,第一设备可以定期根据接收到的多个第一报文的发送时间以及接收时间确定与第二设备的时钟之间的偏差。或者,第一设备也可以在被动触发下,根据接收到的多个第一报文的发送时间以及接收时间确定与第二设备的时钟之间的偏差。The first device may determine a deviation between the clock of the first device and the clock of the second device based on the M sets of timestamps. The deviation may be a clock deviation, a frequency deviation, or a phase deviation, or the deviation may be at least two of the above three deviations. That is to say, the first device may determine at least one of clock deviation, frequency deviation, or phase deviation between the clock of the first device and the clock of the second device according to the M sets of time stamps. In a possible implementation, the first device may periodically determine the deviation from the clock of the second device based on the sending time and receiving time of the multiple received first messages. Alternatively, the first device may also determine the deviation from the clock of the second device based on the sending time and receiving time of the multiple received first messages under passive triggering.
下面介绍第一设备如何确定第一设备的时钟与第二设备的时钟之间的偏差。The following describes how the first device determines the deviation between the clock of the first device and the clock of the second device.
第一设备可将M组时间戳映射到二维坐标系,其中,该多组时间戳中的一组时间戳包括一个第一时间和对应的第四时间,该第四时间为一个报文的第二时间与第一时间之间的时间差。二维坐标以第一时间为横坐标,以第四时间为纵坐标。可以理解的是,M组时间戳在二维坐标系是离散的,M组时间戳的总体倾斜趋势可以表征第一设备的时钟与第二设备的时钟之间的频率偏差drift。因此,可在M组时间戳中确定一条直线,该直线的斜率即为第一设备的时钟与第二设备的时钟之间的频率偏差drift。为方便描述,该直线在本文中称为第一直线。第一设备确定第一设备的时钟与第二设备的时钟之间的频率偏差drift,实质上就是求解第一直线。The first device can map M sets of timestamps to a two-dimensional coordinate system, where one set of timestamps in the multiple sets of timestamps includes a first time and a corresponding fourth time, and the fourth time is a message The time difference between the second time and the first time. The two-dimensional coordinates take the first time as the abscissa and the fourth time as the ordinate. It can be understood that the M sets of timestamps are discrete in the two-dimensional coordinate system, and the overall tilt trend of the M sets of timestamps can represent the frequency deviation drift between the clock of the first device and the clock of the second device. Therefore, a straight line can be determined among the M sets of timestamps, and the slope of the straight line is the frequency deviation drift between the clock of the first device and the clock of the second device. For convenience of description, this straight line is called the first straight line in this article. The first device determines the frequency deviation drift between the clock of the first device and the clock of the second device, which is essentially solving the first straight line.
第一设备可基于目标函数确定第一直线,该目标函数可以认为是能够使得二维坐标系内的M组时间戳位于第一直线的同一侧的函数。例如,目标函数满足:The first device may determine the first straight line based on an objective function, which may be considered as a function that enables M sets of time stamps in the two-dimensional coordinate system to be located on the same side of the first straight line. For example, the objective function satisfies:
s.t.axi+b-yi≤ε,其中,xi=t1,i,yi=t2,i-t1,i,ε为预设参数,t1,i和t2,i-t1,i为第i组时间戳。求解a和b可得到第一直线,即第一直线y=ax+b。 stax i +by i ≤ε, where, x i =t 1,i , y i =t 2,i -t 1,i , ε is the preset parameter, t 1,i and t 2,i -t 1, i is the i-th group of timestamps. Solving a and b can get the first straight line, that is, the first straight line y=ax+b.
为了获得更优的a和b,即确定最优的第一直线,在求解第一直线时,还可以对M组时间戳去噪。例如,可计算每个时间戳点(t1,i,t2,i-t1,i)到所计算得到的第一直线的距离,获得距离序列(即包括M个距离)。可采用中位数绝对偏差判别法筛选距离序列中的噪点并清除,直到a趋于稳定值,获得最优的第一直线。可以理解的是,中位数绝对偏差判别法,即对于序列x1,…,xn,记:MAD:=median(xi-median(x)),如果|xi-median(x)|>4.4478×MAD,那么将xi视作噪点。In order to obtain better a and b, that is, to determine the optimal first straight line, when solving the first straight line, M sets of timestamps can also be denoised. For example, the distance from each time stamp point (t 1,i ,t 2,i -t 1,i ) to the calculated first straight line can be calculated to obtain a distance sequence (that is, including M distances). The median absolute deviation discrimination method can be used to screen and clear the noise points in the distance sequence until a tends to a stable value and the optimal first straight line is obtained. It can be understood that the median absolute deviation discrimination method, that is, for the sequence x 1 ,...,x n , remember: MAD:=median(x i -median(x)), if |x i -median(x)| >4.4478×MAD, then x i is regarded as noise point.
进一步地,第一设备可确定第一直线在M组时间戳中横坐标最大的一组时间戳上的取值为相位偏差offset。以第一直线在多组时间戳中横坐标最大的一组时间戳上的取值作为相位偏差offset,可过滤掉报文传输过程中的噪声,从而支持设备端到端的部署。也就是说,第一设备和第二设备之间无需部署其他设备,即第一设备和第二设备可以直接通信。另外,第一设备可将第一设备首次确定的相位偏差offset0作为相位调整的基准值,这样可以维持时钟相位偏差,避免由于相位偏差offset的累积,或者出现相位偏差的跳变而导致时钟同步失败。Further, the first device may determine that the value of the first straight line on a set of timestamps with the largest abscissa among the M sets of timestamps is the phase deviation offset. Using the value of the first straight line on the time stamp with the largest abscissa among multiple sets of timestamps as the phase deviation offset can filter out noise during packet transmission, thus supporting end-to-end deployment of equipment. That is to say, there is no need to deploy other devices between the first device and the second device, that is, the first device and the second device can communicate directly. In addition, the first device can use the phase offset offset0 determined for the first time by the first device as the reference value for phase adjustment. This can maintain the clock phase deviation and avoid clock synchronization failure due to the accumulation of phase deviation offset or the occurrence of a jump in the phase deviation. .
S403、第一设备基于第一设备的时钟与第二设备的时钟之间的偏差校准第一设备的时钟。S403. The first device calibrates the clock of the first device based on the deviation between the clock of the first device and the clock of the second device.
第一设备可根据频率偏差drift对第一设备的时钟的频率进行补偿,从而实现与第二设备的时钟的频率同步。在本申请实施例中,第一设备可根据频率偏差drift与时钟频率的比值对第一设备的时钟的频率进行补偿。为方便描述,本文将频率偏差drift与时钟频率的比值称为频率补偿值。可以理解的是,频率补偿值会影响时钟每次收到脉冲信号后的时间增加值,即第一设备在每次时钟收到脉冲信号后增加的数值为1/时钟频率+频率补偿值。因此,基于频率补偿值可校准第一设备的时钟。且通过频率补偿值来校准第一设备的时钟的频率,无需锁定数字锁相环,可以降低对晶振稳定性的要求,从而降低第一设备的晶振成本。第一设备以首次计算出来的相位偏差offset0作为相位调整的基准值,即使得第一设备的相位相较于第二设备的时钟的相位差稳定在offset0。The first device can compensate the frequency of the clock of the first device according to the frequency deviation drift, thereby achieving frequency synchronization with the clock of the second device. In this embodiment of the present application, the first device may compensate the frequency of the clock of the first device according to the ratio of the frequency deviation drift to the clock frequency. For convenience of description, this article calls the ratio of frequency deviation drift to clock frequency the frequency compensation value. It can be understood that the frequency compensation value will affect the time increment value after each time the clock receives a pulse signal, that is, the value increased by the first device each time after the clock receives a pulse signal is 1/clock frequency + frequency compensation value. Therefore, the clock of the first device can be calibrated based on the frequency compensation value. Moreover, by using the frequency compensation value to calibrate the frequency of the clock of the first device, there is no need to lock the digital phase-locked loop, which can reduce the requirements for the stability of the crystal oscillator, thereby reducing the cost of the crystal oscillator of the first device. The first device uses the phase deviation offset0 calculated for the first time as the reference value for phase adjustment, that is, the phase difference between the first device and the clock of the second device is stabilized at offset0.
例如,请参见图9,为第一设备和第二设备时钟同步的示意图。第二设备广播携带发送时间的第一报文。第二设备接收第一报文,在数据面产生时间戳(第一时间和第二时间),并将产生的时间戳发送给控制面。控制面可根据时间戳确定第一设备的时钟和第二设备的时钟之间的偏差,并将偏差发送给数据面。图9以偏差为频率补偿值为例。数据面可根据频率补偿值对第一设备的时钟的频率进行补偿,从而实现与第二设备的时钟之间的同步。For example, please refer to Figure 9, which is a schematic diagram of clock synchronization of the first device and the second device. The second device broadcasts the first message carrying the sending time. The second device receives the first message, generates a timestamp (first time and second time) on the data plane, and sends the generated timestamp to the control plane. The control plane may determine the offset between the clock of the first device and the clock of the second device based on the timestamp and send the offset to the data plane. Figure 9 takes the deviation as the frequency compensation value as an example. The data plane can compensate the frequency of the clock of the first device according to the frequency compensation value, thereby achieving synchronization with the clock of the second device.
本申请实施例中,需要时钟同步的设备可基于与被时钟同步的设备之间的多组单向时间戳实现与被时钟同步的设备之间的时钟同步。相较于目前如图2所示的时钟同步方法,无需时钟同步的设备部署PTP,即对需要时钟同步的设备的功能要求较低,从而可使得网络部署更多的节点。另外,被时钟同步的设备可以是网络内的任意设备,即网络内任意节点都可以作为参考时钟,因此,无需外接参考时钟源,可减少部署成本。In this embodiment of the present application, a device that requires clock synchronization can achieve clock synchronization with a clock-synchronized device based on multiple sets of one-way timestamps with the clock-synchronized device. Compared with the current clock synchronization method shown in Figure 2, PTP is deployed on devices that do not require clock synchronization, that is, the functional requirements of the devices that require clock synchronization are lower, which allows the network to deploy more nodes. In addition, the device to be clock synchronized can be any device in the network, that is, any node in the network can be used as a reference clock. Therefore, there is no need to connect an external reference clock source, which can reduce deployment costs.
考虑到,第二设备广播或组播M个第一报文,第一设备可能接收到M个第一报文中的部分报文,从而导致第一设备无法根据所接收的第一报文确定第一设备的时钟与第二设备的时钟之间的偏差。例如,第二设备广播2个第一报文,第一设备接收到1个第一报文,就无法确定第一设备的时钟与第二设备的时钟之间的偏差。Considering that the second device broadcasts or multicasts M first messages, the first device may receive some of the M first messages, resulting in the first device being unable to determine based on the received first messages. The offset between the clock of the first device and the clock of the second device. For example, if the second device broadcasts two first messages and the first device receives one first message, the deviation between the clock of the first device and the clock of the second device cannot be determined.
为此,在本申请实施例中,网络中的任意设备接收到第一报文之后,可将该第一报文广播或组播给网络中的其他设备。网络中的第三设备接收到第二设备广播的第一报文之后,可以广播或组播该第一报文。为了方便描述,下文将第三设备转发第二设备广播的第一报文,称为第三设备发送第二报文。如果第一设备从第三设备接收到多个第二报文,那么基于这多个第二报文分别对应的第一时间和第三时间,也可确定第一设备的时钟与第二设备的时钟之间的偏差。这样即使第一设备没有从第二设备接收到多个第一报文,也可以基于从第三设备接收的多个第二报文确定第一设备的时钟与第二设备的时钟之间的偏差,以尽量避免第一设备无法确定第一设备的时钟与第二设备的时钟之间的偏差。To this end, in this embodiment of the present application, after receiving the first message, any device in the network can broadcast or multicast the first message to other devices in the network. After receiving the first message broadcast by the second device, the third device in the network may broadcast or multicast the first message. For convenience of description, below the third device forwards the first message broadcast by the second device, which is called the third device sending the second message. If the first device receives multiple second messages from the third device, based on the first time and the third time respectively corresponding to the multiple second messages, the clock of the first device and the clock of the second device can also be determined. Deviation between clocks. In this way, even if the first device does not receive multiple first messages from the second device, it can still determine the deviation between the clock of the first device and the clock of the second device based on the multiple second messages received from the third device. , to try to avoid the first device being unable to determine the deviation between the clock of the first device and the clock of the second device.
S404、第三设备发送多个第二报文,相应的,第一设备接收这多个第二报文。S404. The third device sends multiple second messages, and correspondingly, the first device receives the multiple second messages.
第三设备与第一设备和第二设备可位于同一个网络。第二设备广播或组播第一报文,第三设备可接收来自第二设备的第一报文。与第一设备类似,第三设备也可以根据从第二设备接收的多个第一报文分别对应的第一时间以及第三设备接收第一报文的时间确定第三设备的时钟与第二设备的时钟之间的偏差。具体可参考前述第一设备确定第一设备的时钟与第二设备的时钟之间的偏差的相关内容,此处不再赘述。可以理解的是,第三设备确定第三设备的时钟与第二设备的时钟之间的偏差之后,也可以根据该偏差实现与第二设备的时钟同步。从而第三设备也可以作为网络中的参考时钟源,以此类推,网络中的任意设备都可以作为参考时钟,从而无需外接参考时钟。The third device may be located on the same network as the first device and the second device. The second device broadcasts or multicasts the first message, and the third device can receive the first message from the second device. Similar to the first device, the third device may also determine the clock of the third device and the second time according to the first time respectively corresponding to the plurality of first messages received from the second device and the time when the third device receives the first message. Difference between device clocks. For details, reference may be made to the related content of the first device determining the deviation between the clock of the first device and the clock of the second device, which will not be described again here. It can be understood that, after the third device determines the deviation between the clock of the third device and the clock of the second device, it can also achieve clock synchronization with the second device based on the deviation. Therefore, the third device can also be used as the reference clock source in the network, and by analogy, any device in the network can be used as the reference clock, eliminating the need for an external reference clock.
在本申请实施例中,第三设备还可以转发第一报文。例如,第三设备可广播或组播第二报文,该第二报文携带第一时间。从而网络中的第一设备也可能从第三设备接收到第二报文。由于第三设备转发第二设备广播或组播的第一报文,即使第一设备接收不到第二设备广播的第一报文,第一设备也可以从第三设备接收的第二报文获知第一时间,从而根据第二报文对应的第一时间,以及接收第二报文的第三时间确定第一设备的时钟与第二设备的时钟之间的偏差,可避免第一设备无法确定第一设备的时钟和第二设备的时钟之间的偏差。In this embodiment of the present application, the third device can also forward the first message. For example, the third device may broadcast or multicast a second message, and the second message carries the first time. Therefore, the first device in the network may also receive the second message from the third device. Since the third device forwards the first message broadcast or multicast by the second device, even if the first device cannot receive the first message broadcast by the second device, the first device can receive the second message from the third device. Knowing the first time and determining the deviation between the clock of the first device and the clock of the second device based on the first time corresponding to the second message and the third time of receiving the second message can avoid the failure of the first device. A deviation between the first device's clock and the second device's clock is determined.
需要说明的是,如果第一设备从第二设备接收到多个第一报文,那么基于这多个第一报文分别对应的第一时间和第二时间,可确定第一设备的时钟与第二设备的时钟之间的偏差。如果第一设备从第三设备接收到多个第二报文,那么基于这多个第二报文分别对应的第一时间和第三时间,也可确定第一设备的时钟与第二设备的时钟之间的偏差。另外,本对于第一设备来说,第一设备接收最新的报文,可根据该报文的发送时间以及接收时间,结合历史所接收的报文对应的单向时间戳(也称为历史时间戳)确定第一设备的时钟与第二设备的时钟之间的偏差。在一段时间内可接收多个第一报文,或者多个第二报文。第一设备可基于所接收的多个第一报文中的部分第一报文分别对应的第一时间和第二时间确定第一设备的时钟和第二设备的时钟之间的偏差,也可以基于所接收的全部第一报文分别对应的第一时间和第二时间确定第一设备的时钟和第二设备的时钟之间的偏差。同理,第一设备可基于所接收的多个第二报文中的部分第二报文分别对应的第一时间和第三时间确定第一设备的时钟和第二设备的时钟之间的偏差,也可以基于所接收的全部第二报文分别对应的第一时间和第三时间确定第一设备的时钟和第二设备的时钟之间的偏差。It should be noted that if the first device receives multiple first messages from the second device, then based on the first time and the second time respectively corresponding to the multiple first messages, the clock of the first device and The deviation between the clocks of the second device. If the first device receives multiple second messages from the third device, based on the first time and the third time respectively corresponding to the multiple second messages, the clock of the first device and the clock of the second device can also be determined. Deviation between clocks. In addition, for the first device, when receiving the latest message, the first device can combine the one-way timestamp (also called historical time) corresponding to the message received in history according to the sending time and receiving time of the message. Stamp) determines the offset between the first device's clock and the second device's clock. Multiple first messages or multiple second messages can be received within a period of time. The first device may determine the deviation between the clock of the first device and the clock of the second device based on the first time and the second time respectively corresponding to part of the first messages among the received plurality of first messages, or may The deviation between the clock of the first device and the clock of the second device is determined based on the first time and the second time respectively corresponding to all the received first messages. Similarly, the first device may determine the deviation between the clock of the first device and the clock of the second device based on the first time and the third time respectively corresponding to some of the second messages among the received plurality of second messages. , the deviation between the clock of the first device and the clock of the second device may also be determined based on the first time and the third time respectively corresponding to all the second messages received.
需要说明的是,S404可以在S403之前执行,也可以在S402之前执行。且S404不是必须执行的步骤,即是可选的步骤,因此在图4中以虚线示意。It should be noted that S404 can be executed before S403 or before S402. And S404 is not a step that must be performed, that is, it is an optional step, so it is shown with a dotted line in Figure 4 .
经过实验可知通过本申请实施例提供的方法,各个设备确定与参考时钟之间的偏差较为稳定。例如,请参见表1,示出了基于本申请实施例提供的方法所确定的频率偏差与基于图2即双向时间戳所确定的频率偏差的比较结果。表1中的线性回归系数越大,表示各个设备确定与参考时钟之间的偏差越稳定。表1以包括两个设备为例。表1以两个设备是内网中的设备为例,即所涉及的时间戳为物理时间戳。其中,“IP地址”的设备布局在同一位置,例如A市;“IP地址”的设备布局在同一位置,例如B市;的设备布局在同一位置,例如C市。Through experiments, it can be seen that through the method provided by the embodiment of the present application, the deviation between each device and the reference clock is relatively stable. For example, please refer to Table 1, which shows the comparison results between the frequency deviation determined based on the method provided by the embodiment of the present application and the frequency deviation determined based on the two-way timestamp in Figure 2. The larger the linear regression coefficient in Table 1 is, the more stable the deviation between each device and the reference clock is. Table 1 takes two devices as an example. Table 1 takes the two devices as devices on the intranet as an example, that is, the timestamps involved are physical timestamps. Among them, the equipment of " IP address " is arranged in the same location, such as city A; the equipment of " IP address " is arranged in the same location, such as city B; The equipment is laid out in the same location, such as City C.
表1Table 1
表1中,单向时间戳计算的频率偏差均值也就是通过本申请实施例提供的方法计算的频率偏差均值,双向时间戳计算的频率偏差均值也就是通过图2所示的方法计算的频率偏差均值。从表1中可以看出,通过本申请实施例提供的方法计算的频率偏差更为稳定。In Table 1, the average frequency deviation calculated by the one-way timestamp is also the average frequency deviation calculated by the method provided in the embodiment of this application, and the average frequency deviation calculated by the two-way time stamp is the frequency deviation calculated by the method shown in Figure 2 mean. It can be seen from Table 1 that the frequency deviation calculated by the method provided in the embodiment of the present application is more stable.
又例如,请参见表2,也示出了基于本申请实施例提供的方法所确定的频率偏差与基于图2即双向时间戳所确定的频率偏差的比较结果。表2与表1的不同之处在于,表2中的设备是虚拟网中的设备,即所涉及的时间戳为用户态下的虚拟时间戳。其中,“IP地址”的设备布局在同一位置,例如B市;的设备布局在同一位置,例如C市。For another example, please refer to Table 2, which also shows the comparison results between the frequency deviation determined based on the method provided by the embodiment of the present application and the frequency deviation determined based on the two-way timestamp in Figure 2. The difference between Table 2 and Table 1 is that the devices in Table 2 are devices in the virtual network, that is, the timestamps involved are virtual timestamps in user mode. Among them, the equipment of " IP address " is laid out in the same location, such as city B; The equipment is laid out in the same location, such as City C.
表2Table 2
表2中,单向时间戳计算的频率偏差均值也就是通过本申请实施例提供的方法计算的频率偏差均值,双向时间戳计算的频率偏差均值也就是通过图2所示的方法计算的频率偏差均值。从表2中可以看出,通过本申请实施例提供的方法计算的频率偏差更为稳定。In Table 2, the average frequency deviation calculated by the one-way timestamp is also the average frequency deviation calculated by the method provided in the embodiment of this application, and the average frequency deviation calculated by the two-way timestamp is also the frequency deviation calculated by the method shown in Figure 2 mean. It can be seen from Table 2 that the frequency deviation calculated by the method provided in the embodiment of the present application is more stable.
所述本申请提供的实施例中,分别从需要时钟同步的设备(即第一设备)和被时钟同步的设备(即第二设备),设置网络中更多设备之间交互的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,第一设备和第二设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the embodiments provided by the present application, the present application is implemented from the perspective of the device that requires clock synchronization (i.e., the first device) and the device that is clock synchronized (i.e., the second device), and sets up interactions between more devices in the network. The method provided by the example is introduced. In order to implement each function in the method provided by the above embodiments of the present application, the first device and the second device may include a hardware structure and/or a software module to implement the above-mentioned functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Each function. Whether one of the above functions is performed as a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
下面结合附图介绍本申请实施例中用来实现上述方法的通信装置。The communication device used to implement the above method in the embodiment of the present application will be introduced below with reference to the accompanying drawings.
图10为本申请实施例提供的通信装置1000的示意性框图。该通信装置1000可以包括处理模块1010和收发模块1020。可选地,还可以包括存储单元,该存储单元可以用于存储指令(代码或者程序)和/或数据。处理模块1010和收发模块1020可以与该存储单元耦合,例如,处理模块1010可以读取存储单元中的指令(代码或者程序)和/或数据,以实现相应的方法。上述各个模块可以独立设置,也可以部分或者全部集成。Figure 10 is a schematic block diagram of a communication device 1000 provided by an embodiment of the present application. The communication device 1000 may include a processing module 1010 and a transceiver module 1020. Optionally, a storage unit may also be included, which may be used to store instructions (code or programs) and/or data. The processing module 1010 and the transceiver module 1020 can be coupled with the storage unit. For example, the processing module 1010 can read the instructions (code or program) and/or data in the storage unit to implement the corresponding method. Each of the above modules can be set up independently or partially or fully integrated.
一些可能的实施方式中,通信装置1000能够对应实现上述方法实施例中第一设备的行为和功能,通信装置1000可以为第一设备,也可以为应用于第一设备中的部件(例如芯片或者电路),也可以是第一设备中的芯片或芯片组或芯片中用于执行相关方法功能的一部分。In some possible implementations, the communication device 1000 can correspondingly implement the behaviors and functions of the first device in the above method embodiments. The communication device 1000 can be the first device, or can be a component (such as a chip or a device) used in the first device. circuit), or it may be a chip or a chipset in the first device or a part of the chip used to perform related method functions.
例如,通信装置1000实现本申请实施例中第一设备执行的方法。其中,收发模块1020用于接收第二设备发送的多个第一报文,每个第一报文携带第一时间,该第一时间为对应的第一报文的发送时间。处理模块1010用于根据多个第一报文对应的多个第一时间和多个第二时间确定通信装置1000的时钟与第二设备的时钟之间的偏差,基于所述偏差校准通信装置1000的时钟,其中,多个第一时间和多个第二时间一一对应,多个第二时间中的一个第二时间为多个第一时间中的一个第一时间对应的第一报文的接收时间。For example, the communication device 1000 implements the method executed by the first device in the embodiment of the present application. The transceiver module 1020 is configured to receive multiple first messages sent by the second device. Each first message carries a first time, and the first time is the sending time of the corresponding first message. The processing module 1010 is configured to determine a deviation between the clock of the communication device 1000 and the clock of the second device based on the multiple first times and the multiple second times corresponding to the multiple first messages, and calibrate the communication device 1000 based on the deviation. A clock, wherein multiple first times and multiple second times correspond one to one, and one second time among the multiple second times is the first message corresponding to one first time among the multiple first times. Receive time.
作为一种可选的实现方式,收发模块1020还用于接收第三设备发送的至少一个第二报文,每个第二报文包括来自第二设备的第一报文的第一时间。处理模块1010还用于根据至少一个第二报文对应的至少一个第一时间和至少一个第三时间确定通信装置1000的时钟与第二设备的参考时钟之间的偏差。其中,至少一个第一时间和至少一个第三时间一一对应,至少一个第三时间中的一个第三时间为一个第三时间对应的第二报文的接收时间。As an optional implementation manner, the transceiving module 1020 is also configured to receive at least one second message sent by the third device, where each second message includes the first time of the first message from the second device. The processing module 1010 is further configured to determine the deviation between the clock of the communication device 1000 and the reference clock of the second device based on at least one first time and at least one third time corresponding to at least one second message. Wherein, at least one first time and at least one third time correspond one to one, and a third time in the at least one third time is a reception time of the second message corresponding to the third time.
作为一种可选的实现方式,所述偏差包括频率偏差,处理模块1010根据多个第一报文对应的多个第一时间和多个第二时间确定通信装置1000的时钟与第二设备的时钟之间的偏差,包括:As an optional implementation manner, the deviation includes a frequency deviation, and the processing module 1010 determines the difference between the clock of the communication device 1000 and the clock of the second device based on the plurality of first times and the plurality of second times corresponding to the plurality of first messages. Deviation between clocks, including:
将多组时间戳映射到第二坐标系,该多组时间戳中的一个时间戳包括一个第一时间和对应的第四时间,二维坐标以第一时间为横坐标,以第四时间为纵坐标,第四时间为第二时间与第一时间的差值;Multiple sets of timestamps are mapped to the second coordinate system. One timestamp in the multiple sets of timestamps includes a first time and a corresponding fourth time. The two-dimensional coordinates take the first time as the abscissa and the fourth time as On the ordinate, the fourth time is the difference between the second time and the first time;
基于目标函数确定第一直线,该第一直线的斜率为通信装置1000的时钟与第二设备的时钟之间的频率差值,目标函数使得二维坐标系内的多组时间戳位于第一直线的同一侧。A first straight line is determined based on an objective function, the slope of which is the frequency difference between the clock of the communication device 1000 and the clock of the second device. The objective function is such that multiple sets of time stamps in the two-dimensional coordinate system are located at the first same side of a line.
作为一种可选的实现方式,目标函数满足:As an optional implementation method, the objective function satisfies:
s.t.axi+b-yi≤ε,其中,xi=t1,i,yi=t2,i-t1,i,ε为预设参数,t1,i和t2,i-t1,i为第i组时间戳。 stax i +by i ≤ε, where, x i =t 1,i , y i =t 2,i -t 1,i , ε is the preset parameter, t 1,i and t 2,i -t 1, i is the i-th group of timestamps.
作为一种可选的实现方式,处理模块1010还用于确定第一直线在多组时间戳中横坐标最大的一组时间戳上的取值为相位偏差。As an optional implementation manner, the processing module 1010 is also configured to determine that the value of the first straight line on a set of timestamps with the largest abscissa among the multiple sets of timestamps is the phase deviation.
作为一种可选的实现方式,处理模块1010首次确定的相位偏差为相位调整的基准值。As an optional implementation manner, the phase deviation determined for the first time by the processing module 1010 is the reference value for phase adjustment.
作为一种可选的实现方式,处理模块1010具体用于:As an optional implementation method, the processing module 1010 is specifically used to:
确定频率偏差值,根据该频率补偿值校准所述时钟的偏差,该频率偏差值为频率差值与时间频率的比值。A frequency deviation value is determined, and the deviation of the clock is calibrated according to the frequency compensation value. The frequency deviation value is the ratio of the frequency difference to the time frequency.
作为一种可选的实现方式,第一报文以广播方式或组播方式发送。As an optional implementation manner, the first message is sent in broadcast mode or multicast mode.
作为一种可选的实现方式,第一报文在控制面生成,并通过数据面端口发送。As an optional implementation method, the first message is generated on the control plane and sent through the data plane port.
作为一种可选的实现方式,第一时间在控制面或数据面确定。As an optional implementation method, it is determined on the control plane or data plane at the first time.
作为一种可选的实现方式,通信装置1000和第二设备直接通信。As an optional implementation manner, the communication device 1000 communicates directly with the second device.
应理解,本申请实施例中的处理模块1010可以由处理器或处理器相关电路组件实现,收发模块1020可以由收发器或收发器相关电路组件或者通信接口实现。It should be understood that the processing module 1010 in the embodiment of the present application can be implemented by a processor or processor-related circuit components, and the transceiver module 1020 can be implemented by a transceiver or transceiver-related circuit components or a communication interface.
图11为本申请实施例提供的通信装置1100的示意性框图。其中,该通信装置1100可以是第一设备,能够实现本申请实施例提供的方法中第一设备的功能。通信装置1100也可以是能够支持第一设备实现本申请实施例提供的方法中对应的功能的装置,其中,该通信装置1100可以为芯片系统。本申请实施例中,芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。具体的功能可以参见上述方法实施例中的说明。Figure 11 is a schematic block diagram of a communication device 1100 provided by an embodiment of the present application. The communication device 1100 may be a first device, capable of realizing the functions of the first device in the method provided by the embodiments of the present application. The communication device 1100 may also be a device that can support the first device to implement the corresponding function in the method provided by the embodiment of the present application, wherein the communication device 1100 may be a chip system. In the embodiments of this application, the chip system may be composed of chips, or may include chips and other discrete devices. For specific functions, please refer to the description in the above method embodiment.
通信装置1100包括一个或多个处理器1101,可用于实现或用于支持通信装置1100实现本申请实施例提供的方法中第一设备的功能。具体参见方法示例中的详细描述,此处不做赘述。处理器1101也可以称为处理单元或处理模块,可以实现一定的控制功能。处理器1101可以是通用处理器或者专用处理器等。例如,包括:中央处理器,应用处理器,调制解调处理器,图形处理器,图像信号处理器,数字信号处理器,视频编解码处理器,控制器,存储器,和/或神经网络处理器等。所述中央处理器可以用于对通信装置1100进行控制,执行软件程序和/或处理数据。不同的处理器可以是独立的器件,也可以是集成在一个或多个处理器中,例如,集成在一个或多个专用集成电路上。The communication device 1100 includes one or more processors 1101, which can be used to implement or support the communication device 1100 to implement the function of the first device in the method provided by the embodiment of the present application. For details, please refer to the detailed description in the method example and will not be repeated here. The processor 1101 can also be called a processing unit or processing module, and can implement certain control functions. The processor 1101 may be a general-purpose processor or a special-purpose processor, or the like. For example, include: central processing unit, application processor, modem processor, graphics processor, image signal processor, digital signal processor, video codec processor, controller, memory, and/or neural network processor wait. The central processing unit may be used to control the communication device 1100, execute software programs and/or process data. Different processors may be independent devices, or may be integrated in one or more processors, for example, integrated on one or more application specific integrated circuits.
可选地,通信装置1100中包括一个或多个存储器1102,用以存储指令1104,所述指令可在所述处理器1101上被运行,使得通信装置1100执行上述方法实施例中描述的方法。存储器1102和处理器1101可以单独设置,也可以集成在一起,也可以认为存储器1102和处理器1101耦合。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。处理器1101可能和存储器1102协同操作。所述至少一个存储器中的至少一个可以包括于处理器中。需要说明的是,存储器1102不是必须的,所以在图11中以虚线进行示意。Optionally, the communication device 1100 includes one or more memories 1102 to store instructions 1104, which can be executed on the processor 1101, so that the communication device 1100 executes the method described in the above method embodiment. The memory 1102 and the processor 1101 may be provided separately or integrated together, or the memory 1102 and the processor 1101 may be considered coupled. The coupling in the embodiment of this application is an indirect coupling or communication connection between devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information interaction between devices, units or modules. Processor 1101 may cooperate with memory 1102. At least one of the at least one memory may be included in the processor. It should be noted that the memory 1102 is not necessary, so it is illustrated with a dotted line in FIG. 11 .
可选地,所述存储器1102中还可以存储有数据。所述处理器和存储器可以单独设置,也可以集成在一起。在本申请实施例中,存储器1102可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。Optionally, the memory 1102 may also store data. The processor and memory can be provided separately or integrated together. In this embodiment of the present application, the memory 1102 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or it may be a volatile memory (volatile memory). For example, random-access memory (RAM). Memory is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory in the embodiment of the present application can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and/or data.
可选地,通信装置1100可以包括指令1103(有时也可以称为代码或程序),所述指令1103可以在所述处理器上被运行,使得所述通信装置1100执行上述实施例中描述的方法。处理器1101中可以存储数据。Optionally, the communication device 1100 may include instructions 1103 (sometimes also referred to as codes or programs), and the instructions 1103 may be executed on the processor, causing the communication device 1100 to perform the methods described in the above embodiments. . Data may be stored in processor 1101.
可选地,通信装置1100还可以包括收发器1105以及天线1106。所述收发器1105可以称为收发单元,收发模块、收发机、收发电路、收发器,输入输出接口等,用于通过天线1106实现通信装置1100的收发功能。Optionally, the communication device 1100 may also include a transceiver 1105 and an antenna 1106. The transceiver 1105 may be called a transceiver unit, transceiver module, transceiver, transceiver circuit, transceiver, input/output interface, etc., and is used to realize the transceiver function of the communication device 1100 through the antenna 1106.
本申请中描述的处理器1101和收发器1105可实现在集成电路(integratedcircuit,IC)、模拟IC、射频集成电路(radio frequency identification,RFID)、混合信号IC、ASIC、印刷电路板(printed circuit board,PCB)、或电子设备等上。实现本文描述的通信装置,可以是独立设备(例如,独立的集成电路,手机等),或者可以是较大设备中的一部分(例如,可嵌入在其他设备内的模块),具体可以参照前述关于终端设备,以及网络设备的说明,在此不再赘述。The processor 1101 and the transceiver 1105 described in this application can be implemented in an integrated circuit (IC), an analog IC, a radio frequency identification (RFID), a mixed signal IC, an ASIC, or a printed circuit board (printed circuit board). , PCB), or electronic equipment, etc. The communication device that implements the communication described in this article can be an independent device (for example, an independent integrated circuit, a mobile phone, etc.), or it can be a part of a larger device (for example, a module that can be embedded in other devices). For details, please refer to the above-mentioned information. The description of terminal equipment and network equipment will not be repeated here.
可选地,通信装置1100还可以包括以下一个或多个部件:无线通信模块,音频模块,外部存储器接口,内部存储器,通用串行总线(universal serial bus,USB)接口,电源管理模块,天线,扬声器,麦克风,输入输出模块,传感器模块,马达,摄像头,或显示屏等等。可以理解,在一些实施例中,通信装置1100可以包括更多或更少部件,或者某些部件集成,或者某些部件拆分。这些部件可以是硬件,软件,或者软件和硬件的组合实现。Optionally, the communication device 1100 may also include one or more of the following components: a wireless communication module, an audio module, an external memory interface, an internal memory, a universal serial bus (USB) interface, a power management module, and an antenna. Speakers, microphones, input and output modules, sensor modules, motors, cameras, or displays, etc. It can be understood that in some embodiments, the communication device 1100 may include more or fewer components, or some components may be integrated, or some components may be separated. These components may be implemented in hardware, software, or a combination of software and hardware.
需要说明的是,上述实施例中的通信装置可以是第一设备也可以是电路,也可以是应用于第一设备中的芯片或者其他具有上述第一设备功能的组合器件、部件等。当通信装置是第一设备时,收发模块可以是收发器,可以包括天线和射频电路等,处理模块可以是处理器,例如:中央处理模块(central processing unit,CPU)。当通信装置是具有上述第一设备功能的部件时,收发模块可以是射频单元,处理模块可以是处理器。当通信装置是芯片系统时,该通信装置可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是CPU,还可以是网络处理器(networkprocessor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logicdevice,PLD)或其他集成芯片。处理模块可以是芯片系统的处理器。收发模块或通信接口可以是芯片系统的输入输出接口或接口电路。例如,接口电路可以为代码/数据读写接口电路。所述接口电路,可以用于接收代码指令(代码指令存储在存储器中,可以直接从存储器读取,或也可以经过其他器件从存储器读取)并传输至处理器;处理器可以用于运行所述代码指令以执行上述方法实施例中的方法。又例如,接口电路也可以为通信处理器与收发机之间的信号传输接口电路。It should be noted that the communication device in the above embodiments may be a first device or a circuit, or may be a chip used in the first device or other combined devices or components having the functions of the first device. When the communication device is the first device, the transceiver module may be a transceiver, which may include an antenna, a radio frequency circuit, etc., and the processing module may be a processor, such as a central processing unit (CPU). When the communication device is a component with the above-mentioned first device function, the transceiver module may be a radio frequency unit, and the processing module may be a processor. When the communication device is a chip system, the communication device may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (system on chip). , SoC), it can also be a CPU, it can be a network processor (network processor, NP), it can also be a digital signal processing circuit (digital signal processor, DSP), or it can be a microcontroller (micro controller unit, MCU), It can also be a programmable logic device (PLD) or other integrated chip. The processing module may be a processor of a chip system. The transceiver module or communication interface may be the input/output interface or interface circuit of the chip system. For example, the interface circuit may be a code/data read and write interface circuit. The interface circuit can be used to receive code instructions (code instructions are stored in the memory and can be read directly from the memory, or can also be read from the memory through other devices) and transmitted to the processor; the processor can be used to run all The code instructions are used to execute the methods in the above method embodiments. For another example, the interface circuit may also be a signal transmission interface circuit between the communication processor and the transceiver.
当该通信装置为芯片类的装置或者电路时,该装置可以包括收发单元和处理单元。其中,所述收发单元可以是输入输出电路和/或通信接口;处理单元为集成的处理器或者微处理器或者集成电路。When the communication device is a chip-like device or circuit, the device may include a transceiver unit and a processing unit. The transceiver unit may be an input-output circuit and/or a communication interface; the processing unit may be an integrated processor or microprocessor or an integrated circuit.
本申请实施例还提供一种通信系统,具体的,通信系统包括至少一个第一设备和至少一个第二设备。示例性的,通信系统包括用于实现上述图4的相关功能的第一设备和第二设备。具体请参考上述方法实施例中的相关描述,这里不再赘述。An embodiment of the present application also provides a communication system. Specifically, the communication system includes at least one first device and at least one second device. Exemplarily, the communication system includes a first device and a second device for implementing the related functions of Figure 4 mentioned above. For details, please refer to the relevant descriptions in the above method embodiments, which will not be described again here.
本申请实施例中还提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行图4中第一设备执行的方法。An embodiment of the present application also provides a computer-readable storage medium, which includes instructions that, when run on a computer, cause the computer to execute the method executed by the first device in Figure 4 .
本申请实施例中还提供一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机执行图4中第一设备执行的方法。An embodiment of the present application also provides a computer program product, which includes instructions that, when run on a computer, cause the computer to execute the method executed by the first device in Figure 4 .
本申请实施例提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现前述方法中第一设备的功能;或者用于实现前述方法中第二设备的功能。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。Embodiments of the present application provide a chip system. The chip system includes a processor and may also include a memory for realizing the functions of the first device in the foregoing method; or for realizing the functions of the second device in the foregoing method. The chip system can be composed of chips or include chips and other discrete devices.
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各种说明性逻辑块(illustrative logical block)和步骤(step),能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or a combination of computer software and electronic hardware. accomplish. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the part that essentially contributes to the technical solution of the present application or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions to enable a A computer device (which may be a personal computer, a server, or a network device, etc.) executes all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), RAM, magnetic disk or optical disk and other media that can store program codes.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and equivalent technologies, the present application is also intended to include these modifications and variations.
Claims (25)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210537892.3A CN117118553A (en) | 2022-05-17 | 2022-05-17 | A clock synchronization method and communication device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210537892.3A CN117118553A (en) | 2022-05-17 | 2022-05-17 | A clock synchronization method and communication device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117118553A true CN117118553A (en) | 2023-11-24 |
Family
ID=88807956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210537892.3A Pending CN117118553A (en) | 2022-05-17 | 2022-05-17 | A clock synchronization method and communication device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117118553A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118826939A (en) * | 2024-08-01 | 2024-10-22 | 北京津发科技股份有限公司 | Clock synchronization method, system, device and medium for human-machine environment data acquisition |
CN119154982A (en) * | 2024-10-09 | 2024-12-17 | 中国传媒大学 | Time synchronization method and system based on time synchronization gateway |
-
2022
- 2022-05-17 CN CN202210537892.3A patent/CN117118553A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118826939A (en) * | 2024-08-01 | 2024-10-22 | 北京津发科技股份有限公司 | Clock synchronization method, system, device and medium for human-machine environment data acquisition |
CN119154982A (en) * | 2024-10-09 | 2024-12-17 | 中国传媒大学 | Time synchronization method and system based on time synchronization gateway |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20230370185A1 (en) | Network Devices, Methods and/or Systems for Use in a Media Nework | |
JP5554363B2 (en) | Media clock negotiation | |
CN102893555B (en) | Rate-varying multicast transmission for clock distribution in packet networks | |
US8879552B2 (en) | Precision time protocol offloading in a PTP boundary clock | |
US7724780B2 (en) | Synchronization of one or more source RTP streams at multiple receiver destinations | |
US9628209B2 (en) | Time synchronization in distributed network testing equipment | |
CN117118553A (en) | A clock synchronization method and communication device | |
US20010024455A1 (en) | Reference time distribution over a network | |
AU2012216611B2 (en) | Communications system for transmission of signals between terminal equipment connected to intermediate equipment connected to an Ethernet network | |
CN101882990B (en) | Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system | |
US20110129048A1 (en) | Synchronized system for distributing and processing signals, in particular audio signals in a wireless loudspeaker network | |
CN102263629B (en) | Method for time synchronization among boards, clock board and NE (network element) device | |
CN103916950A (en) | Time synchronization method and system | |
JP2012511267A (en) | Improved method, system and apparatus for signal synchronization | |
WO2012003746A1 (en) | Method and device for realizing boundary clock | |
WO2011134371A1 (en) | Method for synchronizing clocks and clock synchronization device | |
CN112511253B (en) | A synchronization method, device, equipment and storage medium | |
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 | |
CN104836654B (en) | A kind of clock synchronizing method based on Ethernet POWERLINK | |
Diarra et al. | Improved clock synchronization start-up time for Ethernet AVB-based in-vehicle networks | |
JP2003110562A (en) | System and method for time synchronization | |
CN107113754B (en) | Method for transmitting data between network devices via a non-deterministic network | |
CN116366195A (en) | Mechanism for accurate time synchronization in a data center network | |
JP7451721B2 (en) | Clock port attribute recovery methods, devices, and systems | |
CN114389733A (en) | PTP master clock device, clock synchronization method and storage medium |
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 |