Clock synchronization method, clock node, control device and clock synchronization system

By comprehensively utilizing the adjustment of time offset and frequency drift in the clock synchronization network, combined with the Kalman filtering algorithm, the problem that existing clock synchronization protocols are difficult to achieve high-precision clock synchronization is solved, and millisecond-level clock synchronization and micro-minimal frequency difference.

CN119483795APending Publication Date: 2025-02-18HUAWEI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311019195.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Existing clock synchronization protocols such as NTP protocols are difficult to achieve millisecond-level clock synchronization accuracy and slight frequency differences, and cannot meet the needs of scenarios such as financial e-commerce and global distributed databases.

Method used

By introducing reference clock nodes and clock nodes into the clock synchronization network, the time offset and frequency drift are used for comprehensive adjustment, and the frequency adjustment amount is optimized with the Kalman filtering algorithm to achieve clock synchronization.

Benefits of technology

It improves the accuracy and convergence speed of clock synchronization, and can achieve millisecond-level clock synchronization to meet the needs of scenarios such as financial e-commerce and global distributed databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483795A_ABST
    Figure CN119483795A_ABST
Patent Text Reader

Abstract

The invention discloses a clock synchronization method, a clock node, a control device and a clock synchronization system. And the first clock node determines the frequency adjustment amount of the clock of the first clock node in the kth time slice according to the one or more first time offsets, the first frequency drift amount and the topological information of the clock synchronization network, and then adjusts the clock of the first clock node according to the frequency adjustment amount. The clock synchronization network comprises a reference clock node and one or more clock nodes, the first clock node being one of the one or more clock nodes. The one or more first time offsets are time offsets of the first clock node relative to one or more adjacent nodes of the first clock node in the kth time slice, and the one or more adjacent nodes belong to the clock synchronization network. The first frequency drift amount is a frequency drift amount of the first clock node relative to the reference clock node in the k-th time slice. According to the scheme of the invention, high clock synchronization precision can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of clock synchronization, and in particular to a clock synchronization method, a clock node, a control device and a clock synchronization system. Background Art

[0002] In computer networks, the resonant frequency of clocks (such as quartz oscillators) is easily affected by temperature and other factors and changes nonlinearly. In addition, the resonant frequencies of different clocks are usually different, so the time offset will accumulate over time, leading to clock asynchrony. Clock asynchrony will affect the consistency of the coordinated work of various nodes in the network. Therefore, it is necessary to use clock synchronization (CS) technology to keep the clocks of various nodes consistent, so as to support functions such as event sequencing, task and resource scheduling.

[0003] The Network Time Protocol (NTP) is a commonly used clock synchronization protocol that provides users with a unified timing service through the network by establishing a designated clock source on the network. NTP provides services in the form of clients and servers. When the client needs clock synchronization, it sends an NTP clock information query packet to the server. After receiving the query packet, the server queries its own local time and returns an NTP information packet. The client receives the time returned by the server. Both packets contain the sending time and the receiving time. Through these four times, the time deviation and network delay between the client and the server can be calculated.

[0004] It can be seen that the NTP protocol simply calculates the time offset and transmission delay through the timestamp data detected back and forth by the master and slave clocks. This estimation method is not very accurate and can only achieve coarse-grained clock synchronization between tens of milliseconds and a few milliseconds. In terms of control, the NTP protocol mainly synchronizes the clock through time offset correction. This method will cause a small amount of temporary frequency surges, making it impossible to maintain time consistency continuously. However, scenarios such as the realization of transaction order in financial e-commerce and the transmission and update of data between sites in a global distributed database often require millisecond-level clock synchronization accuracy and tiny frequency differences, which the NTP protocol finds difficult to meet. Summary of the invention

[0005] The present application provides a clock synchronization method, a clock node, a control device and a clock synchronization system, which can achieve higher clock synchronization accuracy.

[0006] In a first aspect, the present application provides a clock synchronization method, which is applied to a first clock node: the first clock node first determines the frequency adjustment amount of the clock of the first clock node in the kth time slice based on one or more first time offsets, first frequency drifts and topology information of the clock synchronization network, and then the first clock node adjusts the clock of the first clock node according to the frequency adjustment amount.

[0007] The clock synchronization network includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes. The one or more first time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more neighboring nodes also belong to the clock synchronization network. The first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0008] In this solution, the first clock node determines the frequency adjustment amount of the clock of the first clock node in the kth time slice based on one or more first time offsets, the first frequency drift and the topological information of the clock synchronization network. In a similar manner, the first clock node can also determine the frequency adjustment amount of the local clock in other time slices. After frequency adjustment of multiple time slices, the clock of the first clock node can eventually be synchronized with the reference clock. Similarly, the clocks of other clock nodes outside the first clock node can also be synchronized with the reference clock, thereby achieving clock synchronization between all clock nodes in the clock synchronization network and the reference clock node. It can be seen that in the process of adjusting the local clock of the first clock node, this solution comprehensively considers the influence of the three aspects of the clocks of neighboring nodes, the reference clock and the network topology, which helps to improve the convergence speed and accuracy of clock synchronization.

[0009] Based on the first aspect, in a possible implementation, the first clock node may obtain timestamp data of one or more neighboring nodes, and then determine the one or more first time offsets and first frequency drifts according to the timestamp data.

[0010] That is, the first clock node can obtain the timestamp data of the neighboring nodes based on the interaction between the first clock node and the neighboring nodes, and then calculate the one or more first time offsets and the first frequency drift based on the timestamp data.

[0011] Based on the first aspect, in a possible implementation, the first clock node may determine one or more first time offsets and one or more second frequency drifts according to the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice. The first clock node then sends the one or more second frequency drifts to the control device, and enters the receiving control device to receive the first frequency drift sent by the control device.

[0012] That is, the first clock node can obtain the first frequency drift amount with the help of the control device, so as to calculate the frequency adjustment amount of the first clock node in the kth time slice. For example, when the neighboring nodes of the first clock node do not include the reference clock node, the first clock node cannot determine the first frequency drift amount by itself. At this time, the first clock node can first determine the frequency drift amount between itself and the neighboring nodes based on the timestamp data of the neighboring nodes, and then send it to the control device. Subsequently, the control device can determine the first frequency drift amount based on the frequency drift amount sent by the first clock node, the frequency drift amounts sent by other clock nodes, and the topology information of the clock synchronization network, and then send the first frequency drift amount to the first clock node.

[0013] Based on the first aspect, in a possible implementation, the first clock node may determine one or more second time offsets and second frequency drifts according to the timestamp data, wherein the one or more second time offsets are time offsets of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. Then, the first clock node determines the one or more first time offsets and first frequency drifts according to the one or more second time offsets, the second frequency drift, and the Kalman filter algorithm.

[0014] It should be understood that since timestamp data may be affected by communication delays, network congestion, etc., the time offset and frequency adjustment calculated based on the timestamp data may not be accurate enough and may deviate from the true value. Therefore, this solution obtains the optimal estimate of the time offset and frequency adjustment based on the Kalman filter algorithm, thereby optimizing the convergence speed and accuracy of clock synchronization.

[0015] Based on the first aspect, in a possible implementation, the first clock node may determine the first parameter and the second parameter according to the topology information of the clock synchronization network, and then determine the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0016] Based on the first aspect, in a possible implementation, the first clock node can determine the first parameter and the second parameter based on the topology information of the clock synchronization network, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0017] That is to say, in addition to the topology information of the clock synchronization network, the first parameter and the second parameter can also be determined based on the time slice length, the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice, which helps to improve the speed of clock synchronization.

[0018] Based on the first aspect, in a possible implementation, a first numerical value and the first frequency drift amount are weightedly summed according to the first parameter and the second parameter to obtain the frequency adjustment amount, wherein the first numerical value is a value obtained by dividing the sum of the one or more first time offsets by the second numerical value, the second numerical value is the product of the number of the one or more adjacent nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first numerical value and the first frequency drift amount, respectively.

[0019] In this solution, the first value corresponds to the sum of the time offsets of the first clock node relative to all neighboring nodes in the kth time slice, and the first frequency offset is the frequency offset of the first clock node relative to the reference clock node in the kth time slice. The first parameter and the second parameter are used as weights of the first value and the first frequency drift, respectively. Therefore, the first parameter is equivalent to adjusting the frequency influence of the clock of the neighboring node on the clock of the first clock node, and the second parameter is equivalent to adjusting the frequency influence of the reference clock on the clock of the first clock node.

[0020] Based on the first aspect, in a possible implementation, after the first clock node adjusts the clock of the first clock node according to the frequency adjustment amount, the first clock node may also continue to determine the frequency adjustment amount of the first clock node in the k+1th time slice (i.e., the next time slice) according to the first parameter, the second parameter, one or more third time offsets, and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0021] That is, the first parameter and the second parameter used in the kth time slice can continue to be used to determine the frequency adjustment amount of the first clock node in the k+1th time slice.

[0022] In a second aspect, the present application provides another clock synchronization method, which is applied to a control device. The control device receives one or more groups of information sent by one or more clock nodes. Among them, the clock synchronization network includes one or more clock nodes and a reference clock node, one or more groups of information correspond to one or more clock nodes one by one, the first clock node is one of the one or more clock nodes, and a group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and one or more second frequency drifts are the frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice, and one or more neighboring nodes belong to the clock synchronization network. Then, the control device determines one or more frequency adjustment amounts based on the one or more groups of information and the topological information of the clock synchronization network, and the one or more frequency adjustment amounts correspond to one or more clock nodes one by one, and then instructs the corresponding clock node to adjust the clock frequency in the kth time slice according to the one or more frequency adjustment amounts.

[0023] In this solution, the control device 200 is responsible for determining the frequency adjustment amount of each clock node in each time slice. Each clock node does not calculate the frequency adjustment amount locally, which can reduce the calculation pressure of each clock node. Then, the control device 200 instructs the corresponding clock node to adjust the frequency according to the determined frequency adjustment amount, thereby achieving clock synchronization. It should be understood that since the control device 200 comprehensively considers the influence of the three aspects of the clock of the adjacent node, the reference clock and the network topology when determining the frequency adjustment amount for each clock node, it helps to improve the convergence speed and accuracy of clock synchronization.

[0024] Based on the second aspect, in a possible implementation, the control device may determine one or more first time offsets and first frequency drifts based on the above one or more groups of information. The above one or more first time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes in the kth time slice, and the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. Then, the control device may determine the frequency adjustment amount corresponding to the first clock node based on the above one or more first time offsets, the first frequency drift and the topology information of the clock synchronization network.

[0025] Based on the second aspect, in a possible implementation manner, the control device may determine the one or more first time offsets and the first frequency drift according to the one or more groups of information and a Kalman filter algorithm.

[0026] Based on the second aspect, in a possible implementation, the control device first determines the first parameter and the second parameter according to the topology information of the clock synchronization network, and then determines the frequency adjustment amount corresponding to the first clock node according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0027] Based on the second aspect, in a possible implementation, the control device can determine the first parameter and the second parameter based on the topology information of the clock synchronization network, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0028] Based on the second aspect, in a possible implementation, the control device may perform a weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter, thereby obtaining a frequency adjustment amount corresponding to the first clock node. The first value is a value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift, respectively.

[0029] Based on the second aspect, in a possible implementation, the control device may determine the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to the one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0030] In a third aspect, the present application also provides a clock synchronization method, which is applied to a control device. The control device can determine a first parameter and a second parameter based on the topology information of the clock synchronization network, wherein the clock synchronization network includes a reference clock node and one or more clock nodes. Then, the control device sends the first parameter and the second parameter to the one or more clock nodes, wherein the first clock node is any one of the one or more clock nodes, and the frequency adjustment amount of the first clock node in the kth time slice is determined by the first clock node according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift, and the one or more first time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more neighboring nodes belong to the clock synchronization network, and the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice, and the first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0031] Based on the third aspect, in a possible implementation, the control device can determine the first parameter and the second parameter based on the topology information of the clock synchronization network, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0032] Based on the third aspect, in a possible implementation, before the control device determines the first parameter and the second parameter, the control device may receive one or more groups of information sent by one or more clock nodes. The above one or more groups of information correspond to one or more clock nodes one by one, the first clock node is one of the one or more clock nodes, and the group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, the one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more second frequency drifts are the frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network. Then, the control device may determine the time offsets and frequency drifts of the above one or more clock nodes relative to the reference clock node in the kth time slice based on the topological information of the clock synchronization network and the above one or more groups of information.

[0033] In a fourth aspect, the present application provides another clock synchronization method, which is applied to a first clock node. The first clock node receives a first parameter and a second parameter sent by a control device. The first parameter and the second parameter are determined by the control device according to the topology information of the clock synchronization network, and the clock synchronization network includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes. Then, the first clock node determines the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift, and then adjusts the clock of the first clock node according to the frequency adjustment amount. The one or more first time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more neighboring nodes belong to the clock synchronization network. The first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice, and the first parameter and the second parameter correspond to one or more first time offsets and first frequency drifts, respectively.

[0034] Based on the fourth aspect, in a possible implementation, the first clock node may obtain timestamp data of one or more neighboring nodes, and then determine one or more first time offsets and first frequency drifts according to the timestamp data.

[0035] Based on the fourth aspect, in a possible implementation, the first clock node determines one or more first time offsets and one or more second frequency drifts according to the timestamp data, and then sends the one or more second frequency drifts to the control device. The one or more second frequency drifts are frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice. Subsequently, the first clock node receives the first frequency drift sent by the control device.

[0036] Based on the fourth aspect, in a possible implementation, the first clock node determines one or more second time offsets and second frequency drifts according to the timestamp data. The one or more second time offsets are time offsets of the first clock node relative to one or more neighboring nodes in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. Then, the first clock node determines one or more first time offsets and first frequency drifts according to the one or more second time offsets, the second frequency drift and the Kalman filter algorithm.

[0037] Based on the fourth aspect, in a possible implementation, the first clock node may perform a weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter to obtain a frequency adjustment amount. The first value is a value obtained by dividing the sum of one or more first time offsets by the second value, the second value is the product of the number of one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift, respectively.

[0038] Based on the fourth aspect, in a possible implementation, the first clock node may also determine the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0039] It can be seen that in the implementation schemes of the third aspect and the fourth aspect, the control device 200 is responsible for determining the first parameter and the second parameter, and then sending the first parameter and the second parameter to each clock node, which can alleviate the calculation pressure of the clock node to a certain extent. Each clock node can calculate the frequency adjustment amount locally based on the first parameter and the second parameter sent by the control device 200, and then adjust the local clock. It should be understood that since this method comprehensively considers the influence of the three aspects of the clock of the neighboring node, the reference clock, and the network topology when determining the frequency adjustment amount for each clock node, it helps to improve the convergence speed and accuracy of clock synchronization.

[0040] In a fifth aspect, the present application also provides a clock node, comprising a unit or module for executing a method as in any one of the implementation schemes in the first aspect or the fourth aspect.

[0041] In a sixth aspect, the present application also provides a clock node, comprising a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the clock node executes a unit or module of a method as in any one of the implementation schemes in the first aspect or the fourth aspect.

[0042] In a seventh aspect, the present application also provides a control device, comprising a unit or module for executing a method as in any one of the embodiments of the second aspect or the third aspect.

[0043] In an eighth aspect, the present application also provides a control device, comprising a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the control device executes a unit or module of the method of any embodiment of the second aspect or the third aspect.

[0044] In the ninth aspect, the present application also provides a clock synchronization system, including a control device and a clock synchronization network, the clock synchronization network including a reference clock node and one or more clock nodes, the first clock node is one of the one or more clock nodes, the first clock node is used to execute a method as in any implementation scheme of the first aspect or the fourth aspect and / or the control device is used to execute a method as in any implementation scheme of the second aspect or the third aspect.

[0045] In the tenth aspect, the present application also provides a computer storage medium, including computer program instructions. When the above-mentioned computer program instructions are executed by an electronic device, the electronic device executes a method as implemented in any one of the first, second, third or fourth aspects.

[0046] In the eleventh aspect, the present application also provides a computer program product comprising instructions, characterized in that when the instructions are executed by an electronic device, the electronic device executes a method as in any one of the embodiments of the first aspect, the second aspect, the third aspect or the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.

[0048] Figure 1 is a schematic diagram of the architecture of a clock synchronization system provided in an embodiment of the present application;

[0049] Figure 2 It is a flowchart of a clock synchronization method provided in an embodiment of the present application;

[0050] Figure 3 is a schematic diagram of synchronization relationships of five different clock synchronization networks 100 provided in an embodiment of the present application;

[0051] Figure 4 is a flowchart of another clock synchronization method provided in an embodiment of the present application;

[0052] Figure 5 is a flowchart of another clock synchronization method provided in an embodiment of the present application;

[0053] Figure 6 is a schematic diagram of the structure of a clock node provided in an embodiment of the present application;

[0054] Figure 7 is a schematic diagram of the structure of another clock node provided in an embodiment of the present application;

[0055] Figure 8is a structural schematic diagram of a control device provided in an embodiment of the present application;

[0056] Fig. 9 It is a structural schematic diagram of another control device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] See also Figure 1 , Figure 1 1 is a schematic diagram of the architecture of a clock synchronization system provided by an embodiment of the present application, including a clock synchronization network 100 and a control device 200, wherein the clock synchronization network 100 includes a reference clock node and one or more clock nodes. It should be understood that Figure 1 Only the first clock node and the second clock node are taken as examples for drawing. In fact, the clock synchronization network 100 may have more or fewer clock nodes, which is not specifically limited in the embodiment of the present application.

[0058] For ease of description, the embodiments of the present application refer to both reference clock nodes and clock nodes as nodes, and the positional relationship between nodes is not limited. A node can be some electronic device, such as a server, a network device, a mobile terminal device, a smart home device, an industrial device, a medical device, etc. Different nodes can be devices of the same type or different types, and the embodiments of the present application do not specifically limit them. Each node is configured with a corresponding clock, and the clock on the reference clock node is called a reference clock, which is usually a clock with a higher accuracy, and the clock (local clock) on each clock node needs to be synchronized to the reference clock.

[0059] The control device 200 may be some electronic device or device cluster, such as a controller, a server, a network device, etc. The control device 200 and a node in the clock synchronization network 100 may be the same device or different devices, which is not specifically limited in the embodiments of the present application. The control device 200 is used to achieve clock synchronization between all nodes in the clock synchronization network 100, that is, the control device 200 is used to help the clocks on all clock nodes in the clock synchronization network 100 synchronize to the reference clock on the reference clock node. Optionally, the control device 200 may be deployed in a data center, an edge environment, or other environments in a cloud environment, which is not specifically limited in the embodiments of the present application.

[0060] Based on the above clock synchronization system, the clock synchronization principle involved in the embodiments of the present application is introduced below.

[0061] Assume that the time of the reference clock on the reference clock node in the clock synchronization network 100 is t, and the time of the local clock of a clock node (denoted as clock node i) in the clock synchronization network 100 is x(t). According to the characteristic that the frequency of the computer clock is almost unchanged in a short time, x(t) satisfies the following equation (1):

[0062] x(t)=x(t0)+r(t-t0) (1)

[0063] Where t0 is the start time of the reference clock, r(t-t0) is the time change of the local clock of clock node i in a short time (t-t0), and r is the frequency of the local clock of clock node i in a short time. Therefore, the time offset offset(t) and frequency drift drift(t) of the local clock of clock node i relative to the reference clock can be given by equations (2) and (3) respectively:

[0064] offset(t)=tx(t) (2)

[0065]

[0066] Discretize t into {t0,…,t k ,t k+1 ,…}, then at the tth k At time t, the time offset of the local clock of clock node i relative to the reference clock is offset(t k+1 ) can be given by formula (4):

[0067] offset(t k+1 ) = t k+1 -x(t k+1 ) (4)

[0068] =t k +τ-[x(t k )+rτ]

[0069] =t k -x(t k )+(1-r)τ

[0070] =offset(t k )+drift(t k )τ

[0071] The time slice length τ is not specifically limited in the present embodiment and can be set and adjusted according to the actual application scenario. Further rewriting equation (4) into a matrix form can obtain the following equation (5):

[0072]

[0073] in,

[0074] From the definition, when drift≠0, the offset will change over time, so it is necessary to control the clock so that X k=0, that is, the local clock of clock node i is synchronized with the reference clock.

[0075] It should be understood that clock control can be divided into time adjustment and frequency adjustment. Time adjustment is to add the adjustment amount to the current time of the clock, while frequency adjustment is to rewrite the step time of a single pulse of the clock. Let the time adjustment amount be u time , the frequency adjustment amount is u freq , then the adjusted local clock x of clock node i new (t) satisfies the following equation (6):

[0076] x new (t) = x(t0) + u time +(r+u freq )(t-t0) (6)

[0077] Similarly, t is discretized into {t0,…,t k ,t k+1 ,…}, then according to formula (6), we can get formula (7):

[0078]

[0079] set up Then formula (7) can be rewritten as formula (8):

[0080] X k+1 =ΦX k +Γu k (8)

[0081] From formula (8), we can see that in order to make the clock converge faster and more stably, we should design u k The specific expression of is the key. Therefore, the embodiment of the present application will provide a frequency adjustment scheme based on dynamics, and use the adjustment scheme to design the final clock synchronization method.

[0082] From formula (8), we can see that u freq Can affect X at the same time k+1 Therefore, we can consider only the frequency adjustment and thus design u freq formula to achieve clock synchronization.

[0083] One idea is to continuously change the frequency of the local clock of clock node i so that the time offset of the local clock relative to the reference clock at the next moment is zero. This process is similar to applying force to a moving ball so that it stops at the target position at the next moment. Although the speed of the ball may not be zero at this time, the force can be adjusted again so that the ball still stops at this position at the next moment, thereby eventually making the ball stop at this position.

[0084] The above idea can be transformed into solving the following equation (9):

[0085]

[0086] According to formula (9), we can further obtain formula (10):

[0087]

[0088] Depend on It can be seen that the "small ball" is subject to the elastic force and friction (-drift(t k )), the process is similar to damped vibration. Considering that the offset and drift obtained in actual application scenarios may have certain deviations from the true values ​​and other influencing factors, two adjustment parameters α and β can be added on the basis of formula (10), so that formula (10) can be rewritten into a more general form, namely formula (11):

[0089]

[0090] It can be seen that formula (11) is a proportional-integral-derivative (PID) control that ignores the integral term. When α>0, β=0, The force on the "ball" is proportional to the offset and in the opposite direction of the offset. At this time, offset(t k ) is similar to simple harmonic oscillation, and synchronization will not be achieved in the end. Therefore, the Adjusting the clock does not necessarily ensure clock synchronization. This depends on the selection of parameters α and β. The corresponding necessary and sufficient conditions will be given later.

[0091] It should be noted that the above method of adding adjustment parameters is only an example and does not constitute a specific limitation. There are other ways to add adjustment parameters. For example, more adjustment parameters can be added (such as adding an adjustment parameter γ to the right side of equation (11)), or only one of the above parameters α and β can be added, or offset (t k ) and the adjustment parameter α, β and drift(t k ) is set to an addition / subtraction relationship, and so on.

[0092] Next, consider the synchronization of the clocks of one or more clock nodes with the reference clock. Clock node i can obtain the clock x of clock node i. i (t) The clock x of neighboring node j relative to clock node i j (t) time offsetij (t), as shown in formula (12):

[0093] offset ij (t) = x j (t)-x i (t),j∈Ν i (12)

[0094] Among them, N i is the set of all neighboring nodes of clock node i. Neighboring node j is N i One of the nodes in the clock synchronization network 100 may be a reference clock node or other clock nodes different from the clock node i in the clock synchronization network 100.

[0095] Similarly, the synchronization process of the clocks of one or more clock nodes with the reference clock can be approximated as follows: in an elastic network composed of multiple "small balls", each "small ball" will be subject to the combined force of the adjacent "small balls", so equation (12) can be further expanded into the form of equation (13):

[0096]

[0097] Among them, |Ν i | is the number of all neighboring nodes of clock node i. Combined with formula (13), formula (11) can be further expanded into formula (14):

[0098]

[0099] Formula (14) also needs to satisfy certain parameter conditions to achieve synchronization of the entire clock synchronization network 100, that is, clock synchronization between all clock nodes and the reference clock node. The corresponding necessary and sufficient conditions are given below.

[0100] Assume that the clock synchronization network 100 includes n+1 nodes, one of which is a reference clock node, and the other n nodes are all clock nodes, where n is a positive integer. According to the topological structure of the clock synchronization network 100, G(V,E) can be obtained, where V = {1,2,…,n} is the set of all clock nodes (a total of n clock nodes) in the clock synchronization network 100, and E = {ij|i,j∈V and offset ij (t) can be calculated as an edge set, let offset i0 (t k ),drift i (t k ) is t k The time offset and frequency drift of node i to the reference clock node at time t k+1, the time offset of the local clock of clock node i to the reference clock i0 (t k+1 ) and drift i (t k+1 ) can be given by equations (15) and (16) respectively:

[0101]

[0102]

[0103] Further rewriting equations (15) and (16) into matrix form, we obtain equation (17):

[0104]

[0105] Among them, x k =[offset 10 (t k ),…,offset n0 (t k ),drift1(t k ),…,drift n (t k )] T The clocks of n clock nodes at t k The state vector at the moment, I is the n-order unit matrix. As shown in formula (18), It can be uniquely determined by G(V,E):

[0106]

[0107] Formula (17) reveals the state changes of the clocks of n clock nodes under the frequency control rule of formula (14). Rewriting formula (17) into a more general form, we get formula (19):

[0108] x k+1 =Ax k (19)

[0109] Among them, the matrix A can be expressed by formula (20).

[0110]

[0111] It can be seen that equation (19) is an iterative equation. Since the clock synchronization of the entire clock synchronization network 100 is achieved, it depends on x kWhether it can converge to 0 during the iteration process, therefore, analyzing the role of matrix A in the iteration and the influence of parameters on matrix A is the key to exploring whether the clock can be synchronized. Next, from the perspective of matrix eigenvalues ​​and eigenspace, the convergence of formula (19) is analyzed, and the necessary and sufficient conditions to ensure clock synchronization are given.

[0112] First, we give the following Lemma 1:

[0113] Lemma 1: Given x k+1 =Ax k , let the eigenvalue of A be lim k→∞ x k =0 if and only if |λ1|<1, when the algebraic multiplicity of all eigenvalues ​​is equal to the geometric multiplicity, and the convergence rate is determined by |λ1|.

[0114] The above lemma shows that clock synchronization can be achieved in the entire clock synchronization network 100 if and only if the maximum eigenvalue of A is less than 1. The following theorem will reveal the relationship between the eigenvalue of A and the parameters, thereby further deriving the parameter range that ensures clock synchronization.

[0115] Theorem 1. It is known that A can be expressed by (20), then the eigenvalue of A satisfies the following equation (21):

[0116]

[0117] in, For the matrix The characteristic value of .

[0118] set up Then, from formula (21), we can further deduce the expression (22) of the eigenvalue of matrix A:

[0119]

[0120] Combined with Lemma 1, we can obtain the parameter range within which Equation (19) can converge, as shown in Theorem 2.

[0121] Theorem 2. The state equation (19) can converge to zero if and only if the parameters α and β satisfy the following conditions:

[0122] (1)β>0;

[0123] (2) in

[0124] Theorem 2 above gives the conditions that parameters α and β must satisfy when the state equation (19) converges, but different parameters correspond to different attenuation rates. In order to make the state equation (19) converge to zero as quickly as possible, the influence of parameters α and β on the convergence performance will be further analyzed to obtain an optimization method to achieve the best convergence performance.

[0125] First, define the convergence performance index J as x k The sum of the squares of each component is summed over discrete time, so J can be expressed by equation (23):

[0126]

[0127] Given a symmetric matrix P, satisfying equation (24):

[0128]

[0129] Combined with equation (19), the left side of equation (24) can be further written as equation (25):

[0130]

[0131] According to equation (24) and equation (25), we can get equation (26):

[0132] A T PA-P=-I (26)

[0133] According to equations (24) to (26), equation (23) can be further rewritten as equation (27):

[0134]

[0135] When the matrix A satisfies the conditions given in Lemma 1, lim k→∞ x k =0, so equation (27) can be transformed into equation (28):

[0136]

[0137] In order to minimize J, the optimization problem shown in formula (29) is obtained:

[0138]

[0139] st A T PA-P=-I and |λ1(A)|<1

[0140] It can be understood that when the time slice length τ and G(V,E) are given, the matrix P can be represented by α and β, so that J can be written as a function of α and β. Then, within the convergence range given by Theorem 2, by solving the values ​​of α and β that minimize J, a set of optimal α and β parameters will eventually be obtained. The solution method is not specifically limited in the embodiment of the present application. In fact, when there are many clock nodes in the clock synchronization network 100, the above solution may become very complicated. It can be seen from the convergence of the series that when formula (19) converges, the formula (23) The part will become very small, and the approximate value of J can be directly calculated at this time Thus, the algorithm is used to find the optimal set of α and β parameters.

[0141] In real scenarios, timestamp data may be contaminated by noise such as communication delays and network congestion delays. Therefore, the offset and drift calculated based on the timestamp data may deviate from the actual values. If the calculated data is directly used to adjust the clock, this error may be magnified, thereby affecting the accuracy of clock synchronization.

[0142] The Kalman Filtering algorithm can correct and reconstruct the theoretical state of the system through measurement data to obtain the optimal estimate of the system state. Therefore, in some possible embodiments, a Kalman filter model can be established for the control equation (7) to obtain the optimal estimate of offset and drift.

[0143] The Kalman filter formula for clock synchronization is derived below. Let Z k is the measurement vector composed of offset and drift calculated from the timestamp data, then the state equation of the system can be given by equation (30):

[0144]

[0145] Among them, {W k} is the model error, {V k} is the measurement error, and the two are uncorrelated white noise sequences and are unrelated to X0.

[0146] Let X k+1 The optimal linear estimate of Formula (31):

[0147]

[0148] Next, we solve K k+1 Make Minimum. According to formula (31), we can get formula (32):

[0149]

[0150] Therefore, from the independence, we can get formula (33):

[0151]

[0152] in, Note: k+1|k =ΦP k Φ T +Q k , then formula (33) can be further written as formula (34):

[0153]

[0154] Therefore, when K k+1 =P k+1|k (P k+1|k +R k+1 ) -1 hour, Minimum, we can get formula (35):

[0155]

[0156] In summary, we can obtain the following Kalman filter formula for clock synchronization (36):

[0157]

[0158] The above formula shows that It is obtained by adding the weighted value of the theoretical value to the prediction error, K k+1 is the Kalman gain, which is the weight of the prediction error. Therefore, the Kalman filter is essentially a process of continuously correcting and reconstructing the estimated value through the measurement vector, and its performance in iteration will be affected by the initial conditions and Q k ,R k+1 Next, the parameters will be further determined to obtain the final Kalman filter model.

[0159] The matrix Q used in the Kalman filter formula to describe the system dynamics k ,R k+1 It is usually assumed to have a specific parametric form, which can be determined using maximum likelihood estimation (MLE). Then we can get formula (37):

[0160]

[0161] Assume {W k},{V k}, X0 are independent of each other and all obey normal distribution, which satisfies the following equations (38) and (39):

[0162]

[0163]

[0164] Then formula (37) can be further expressed as formula (40):

[0165]

[0166] The likelihood function can be further derived from the above formula to obtain formula (41):

[0167]

[0168] Taking the logarithm and simplifying it, we finally get the optimization problem shown in formula (42):

[0169]

[0170] st P0,Q,R positive definite

[0171] By collecting clock synchronization data, the simulated annealing algorithm (SA) is used to solve the above optimization problem, and finally the values ​​of P0, Q, and R are obtained as follows:

[0172]

[0173] Substituting the values ​​of P0, Q, and R into equation (36) can form the final Kalman filter model.

[0174] Based on the above content, the first embodiment of the clock synchronization method provided by the present application is introduced below.

[0175] See also Figure 2 , Figure 2 It is a flow chart of a clock synchronization method provided in an embodiment of the present application. The method is applied to a first clock node and includes the following steps S201 to S202.

[0176] S201. A first clock node determines a frequency adjustment amount of a clock of the first clock node in a kth time slice according to one or more first time offsets, a first frequency drift, and topology information of a clock synchronization network.

[0177] Among them, the first clock node belongs to the clock synchronization network 100. The clock synchronization network 100 includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes (can be any one). The first clock node has one or more neighboring nodes, which may include a reference clock node and / or at least one clock node in the clock synchronization network 100 other than the first clock node, that is, the one or more neighboring nodes also belong to the clock synchronization network 100. The first clock node can obtain the topology information of the clock synchronization network 100 from the control device 200, or can obtain the topology information of the clock synchronization network 100 by other means, which is not specifically limited in the embodiments of the present application. For other contents about the clock synchronization network 100, please refer to Figure 1 The relevant introduction will not be repeated here.

[0178] It should be understood that, for any clock node in the clock synchronization network 100, the neighboring nodes refer to other clock nodes that have a neighbor relationship (adjacent) with the clock node in the clock synchronization network 100, and the clock node can obtain its own time offset and frequency drift relative to the neighboring nodes to adjust the local clock of the clock node. In other words, during the clock synchronization process, the local clock of the clock node will be affected by the clocks of its neighboring nodes.

[0179] For example, Figure 3 Five different clock synchronization networks 100 are shown, namely topo0, topo1, topo2, topo3 and topo4. Arrows in the figure represent the clock synchronization relationship between all nodes (including reference clock nodes and one or more clock nodes) in the clock synchronization network 100.

[0180] A dotted single arrow indicates a one-way synchronization relationship. The clock of the node (head node) pointed to by the dotted single arrow can be directly affected by the clock of the node (tail node) at the other end of the arrow, but the clock of the tail node is not directly affected by the clock of the head node. For example, during the clock synchronization process, the head node can obtain the timestamp data of the tail node of the arrow, so the head node can calculate its time offset and frequency drift relative to the tail node based on the obtained timestamp data, and then adjust the clock of the head node based on the calculated time offset and frequency drift (the specific adjustment method will be introduced later).

[0181] The solid double arrows represent a bidirectional synchronization relationship, and the nodes at both ends of the solid double arrows affect each other during the clock synchronization process. For example, for a node at either end of the solid double arrow, it can obtain the timestamp data of the node at the other end, and then calculate the time offset and frequency drift of the node relative to the node at the other end based on the obtained timestamp data, and then adjust the clock of the node based on the calculated time offset and frequency drift (the specific adjustment method will be introduced later).

[0182] by Figure 3 Take topo4 in as an example, the clock synchronization network 100 represented by topo4 has three nodes, including a reference clock node, clock node 1 and clock node 2. For clock node 1, the reference clock node and clock node 2 are both its neighboring nodes, and the clock of clock node 1 can be directly affected by the clock of the reference clock node (i.e., the reference clock) and the clock of clock node 2. Specifically, clock node 1 can obtain the timestamp data of the reference clock node through the interaction of time messages between it and the reference clock node or the broadcast time, and then calculate the time offset and frequency drift of clock node 1 relative to the reference clock node. Similarly, clock node 1 can also obtain the timestamp data of clock node 2, and then calculate the time offset and frequency drift of clock node 1 relative to clock node 2. Then, clock node 1 can adjust the local clock according to the above two sets of data calculated (the specific adjustment method will be introduced later). For clock node 2, only clock node 1 is its neighboring node, so clock node 2 can obtain the timestamp data of clock node 1, and then calculate the time offset and frequency adjustment of clock node 2 relative to clock node 1, which can be used to adjust the clock of clock node 2 (the specific adjustment method will be introduced later).

[0183] It should be understood that the kth time slice in the embodiment of the present application refers to a certain time slice, and k can be a positive integer. Regarding the time slice length τ, the embodiment of the present application does not make specific restrictions, and can be set and adjusted according to the actual application scenario.

[0184] The one or more first time offsets refer to the time offsets of the first clock node relative to one or more neighboring nodes in the kth time slice, and the one or more first time offsets correspond to the one or more neighboring nodes. That is, for any neighboring node (set as neighboring node j) of the first clock node (set as clock node i), the first time offset corresponding to neighboring node j refers to the time offset of the first clock node in the kth time slice (corresponding to t k = The time offset and frequency drift of clock node i relative to neighboring node j at the time instant. The specific calculation method can be referred to the formula (12) in the previous text, which will not be repeated here.

[0185] The first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0186] Optionally, when the neighboring nodes of the first clock node include a reference clock node, the first clock node can obtain the timestamp data of one or more neighboring nodes (including the reference clock node), and then can calculate the one or more first time offsets and the first frequency drift based on the timestamp data. The embodiment of the present application does not specifically limit the above calculation method, such as the calculation can be based on a support vector machine (SVM) or other algorithms / models. For example, the first clock node can obtain the upper and lower limits of the time offset and the timestamp data of the neighboring nodes, input them into the local SVM model, and then the SVM model can output the corresponding estimated values ​​of the time offset and frequency offset.

[0187] Optionally, when the neighboring nodes of the first clock node do not include the reference clock node, the first clock node cannot calculate the first frequency drift amount by itself. At this time, the first clock node can first obtain the timestamp data of one or more neighboring nodes, and then calculate one or more second frequency drift amounts based on the timestamp data, and then send the one or more second frequency drift amounts to the control device 200. Among them, the one or more second frequency drift amounts are the frequency drift amounts of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the one or more second frequency drift amounts correspond to the one or more neighboring nodes of the first clock node one by one. For any neighboring node of the first clock node, its corresponding second frequency drift amount refers to the frequency drift amount of the first clock node relative to the neighboring node in the kth time slice. Similarly, other clock nodes other than the first clock node can also send their frequency drift amounts relative to the corresponding neighboring nodes in the kth time slice to the control device 200. Based on the above information sent by the above one or more clock nodes (including the first clock node) and the topology information of the clock synchronization network 100, the control device 200 can help the first clock node calculate the first frequency drift amount, and then send the first frequency drift amount to the first clock node. Correspondingly, the first clock node receives the first frequency drift amount sent by the control device 200 for adjusting the local clock. It should be understood that each clock node in this embodiment calculates the frequency adjustment amount locally, and the control device 200 is only responsible for providing the required data (such as the above first frequency drift amount) to the clock node, but is not responsible for calculating the frequency adjustment amount, which can reduce the calculation pressure of the control device 200 and the communication pressure with the clock node.

[0188] by Figure 3For example, take topo4 in Figure 10 as an example, consider clock node 2 as the first clock node, and only clock node 1 is the neighboring node of clock node 2. Clock node 2 can obtain the timestamp data of clock node 1, and then calculate the frequency drift of clock node 2 relative to clock node 1 in the kth time slice (i.e., the second frequency drift), and then send it to the control device 200. Similarly, clock node 1 can obtain the timestamp data of the reference clock node (i.e., one of the neighboring nodes of clock node 1), and then calculate the frequency drift of clock node 1 relative to the reference clock node in the kth time slice, and then send it to the control device 200. The control device 200 can calculate the frequency drift of clock node 2 relative to the reference clock node in the kth time slice (i.e., the first frequency drift) according to the above two frequency drifts sent by clock node 1 and clock node 2 and the topology information of the clock synchronization network 100, and then send the first frequency drift to clock node 2 for determining the frequency adjustment amount of clock node 2 in the kth time slice.

[0189] Similarly, clock node 2 can obtain the timestamp data of clock node 1, and then calculate the time offset of clock node 2 relative to clock node 1 in the kth time slice, and then send it to the control device 200. Based on the timestamp data of the reference clock node, clock node 1 can calculate the time offset of clock node 1 relative to the reference clock node in the kth time slice, and then send it to the control device 200. The control device 200 can calculate the time offset of clock node 2 relative to the reference clock node in the kth time slice according to the above two time offsets sent by clock node 1 and clock node 2 and the topology information of the clock synchronization network 100.

[0190] It should be understood that in real scenarios, the timestamp data may be contaminated by noise such as communication delays and network congestion delays. Therefore, the various time offsets and frequency drifts calculated based on the timestamp data may have a certain deviation from the true value. If the clock is adjusted directly using the calculated data, this error may be amplified, thereby affecting the convergence speed and accuracy of clock synchronization. At this time, optimization can be performed based on the Kalman filter algorithm.

[0191] In a possible implementation scheme, the first clock node may first determine one or more second time offsets and second frequency drifts based on the acquired timestamp data of one or more neighboring nodes. The one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. Since they are calculated by the first clock node based on the acquired timestamp data, there may be a certain error with the true value. Then, the first clock node may determine one or more first time offsets and first frequency drifts (i.e., the optimal estimates of offset and drift obtained after Kalman filtering) based on the one or more second time offsets, second frequency drifts and Kalman filtering algorithm, which are then used to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0192] In a possible implementation scheme, when the neighboring nodes of the first clock node do not include the reference clock node, the first clock node can first determine one or more second time offsets and second frequency drifts based on the timestamp data of one or more neighboring nodes obtained by itself, and then send the second frequency drift to the control device 200. Similarly, other clock nodes other than the first clock node can also obtain the timestamp data of the corresponding neighboring nodes, and then calculate the frequency drift relative to the neighboring nodes in the kth time slice, and then send it to the control device 200. Then, the control device 200 can determine the frequency drift of the first clock node relative to the reference clock node in the kth time slice based on the information sent by each clock node and the topology information of the clock synchronization network 100, and then send it to the first clock node. Subsequently, the first clock node can filter the one or more second time offsets and the frequency drift sent by the control device 200 based on the Kalman filtering algorithm, so as to obtain one or more first time offsets and first frequency drifts (i.e., the optimal estimates of offset and drift obtained after Kalman filtering), which are then used to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0193] In a possible implementation scheme, the first clock node may first determine one or more second time offsets and one or more second frequency drifts based on the timestamp data of one or more neighboring nodes obtained by itself, and then send the one or more second time offsets and one or more second frequency drifts to the control device 200. The one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice. The one or more second frequency drifts are the frequency drifts of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice. Similarly, other clock nodes other than the first clock node may also obtain the timestamp data of the corresponding neighboring nodes, and then calculate their time offsets and frequency drifts relative to the neighboring nodes in the kth time slice, and then send them to the control device 200. Then, the control device 200 may determine the third frequency drift of the first clock node relative to the reference clock node in the kth time slice based on the above information sent by each clock node. Subsequently, the control device 200 can filter the above one or more second time offsets and the third frequency drift based on the Kalman filter algorithm, thereby obtaining one or more first time offsets and the first frequency drift (i.e., the optimal estimate of the offset and drift obtained after the Kalman filter), and then send them to the first clock node for determining the frequency adjustment amount of the first clock node in the kth time slice. In other words, the Coleman filter algorithm can be sent to the control device 200 for execution, which can reduce the calculation pressure of the first clock node to a certain extent.

[0194] For the specific application of the Kalman filter algorithm, please refer to the relevant introduction of equations (30) to (42) in the previous text, which will not be repeated here.

[0195] Optionally, the first clock node may first determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, and then determine the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0196] For example, as described above, when the parameters α and β satisfy the conditions of Theorem 2, the clock synchronization state equation (19) can converge to 0, indicating that the clocks of all clock nodes in the time synchronization network 100 are synchronized with the reference clock. It can be understood that the conditions of Theorem 2 and the matrix The eigenvalue of Related, formula (18) shows that the matrix is uniquely determined by G(V, E), which corresponds to the topology information of the clock synchronization network 100. Therefore, the first clock node can determine the parameter range that can ensure the convergence of the state equation (19) according to the topology information of the clock synchronization network 100, and then select a set of α and β as the first parameter and the second parameter respectively within the above parameter range to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0197] Optionally, the first clock node can determine the first parameter and the second parameter based on the topology information of the clock synchronization network 100, the time slice length, and the time offset and frequency drift of one or more clock nodes (i.e., all clock nodes) in the clock synchronization network 100 relative to the reference clock node in the kth time slice.

[0198] Continuing with the previous example, the first clock node can first determine the parameter range of α and β that can make the state equation (19) converge according to the topological information of the clock synchronization network 100. From the previous introduction to equation (29), it can be seen that when the time slice length τ and G(V, E) are given, the matrix P can be represented by α and β. At this time, the time offset and frequency drift of all clock nodes (i.e., n clock nodes) in the kth time slice relative to the reference clock node are regarded as x0, and x0 is brought into the above equation (29), so that the convergence performance index J of equation (29) can be written as a function of α and β. Then, with the goal of minimizing J, a set of better α and β values ​​(as the first parameter and the second parameter) can be determined at the first clock node within the parameter range given in Theorem 2, and then the frequency adjustment amount of the first clock node in the kth time slice is determined based on this set of better α and β values, which helps to improve the convergence speed and steady-state accuracy of clock synchronization.

[0199] The embodiments of the present application do not specifically limit the method of determining a set of better α and β values. For example, a set of α and β values ​​that minimizes / is less than a set threshold value of the convergence performance index J of formula (29) can be solved by a certain algorithm. Alternatively, multiple groups of different α and β values ​​can be selected randomly or in other ways within the parameter range given by Theorem 2, and then by comparing the values ​​of the convergence performance index J corresponding to each group of α and β, the group of α and β values ​​corresponding to the highest convergence performance index J is used as the first parameter and the second parameter, so as to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0200] Optionally, the first clock node can perform a weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter, thereby obtaining the frequency adjustment amount of the first clock node in the kth time slice. The first value is the value obtained by dividing the sum of the one or more first time offsets by the second value, and the second value is the product of the number of the one or more neighboring nodes and the length of the time slice. The first parameter and the second parameter are the weights of the first value and the first frequency drift, respectively.

[0201] For example, referring to the formula (14) in the previous text, it is assumed that the first clock node is clock node i. τ is the time slice length, N i is the set of all neighboring nodes of clock node i (i.e., one or more neighboring nodes mentioned above), |Ν i | is the number of all neighboring nodes of clock node i, then τ and N i The product of is the second value. i One of the nodes in ij (t k ) represents the time slice k (corresponding to t k ), the time offset of clock node i relative to neighboring node j, and thus In time slice k, the sum of the time offsets of clock node i relative to all its neighboring nodes corresponds to the first value. i (t k ) is the frequency drift of clock node i relative to the reference clock node in the kth time slice, which corresponds to the first frequency drift mentioned above. Therefore, after a set of α and β values ​​are determined as the first parameter and the second parameter in the above manner, the set of α and β values ​​are substituted into formula (14) to calculate the frequency adjustment value of the first clock node in the kth time slice:

[0202] It should be understood that for other clock nodes in the clock synchronization network 100 except the first clock node, the same first parameter and second parameter can also be determined in the above manner, and then the frequency adjustment amount of the clock of the clock node in the kth time slice can be determined based on the first parameter and the second parameter, which will not be introduced in detail here.

[0203] S202: The first clock node adjusts the clock of the first clock node according to the frequency adjustment amount.

[0204] The frequency adjustment amount is the frequency adjustment amount of the first clock node in the kth time slice.

[0205] Optionally, in the next time slice of the kth time slice (i.e., the k+1th time slice), the first clock node may continue to obtain one or more third time offsets and third frequency drifts, and then determine the frequency adjustment amount of the first clock node in the k+1th time slice in combination with the first parameter and the second parameter determined in step S201. Among them, the one or more third time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes in the k+1th time slice, and the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice. The first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively. Regarding the specific method of obtaining the one or more third time offsets and the third frequency drift, reference may be made to the method of obtaining the one or more first time offsets and the first frequency drift in step S201, which will not be described in detail here.

[0206] For example, after the first clock node adjusts the local clock according to the frequency adjustment amount of the kth time slice, it enters the next time slice (i.e., the k+1th time slice). Referring to the method of steps S201 and S202, the first clock node can obtain the time offset of the first clock node relative to one or more of its neighboring nodes in the k+1th time slice, i.e., the one or more third time offsets, and obtain the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, i.e., the third frequency drift. Then, the first clock node determines the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, the one or more third time offsets, and the third frequency drift, with reference to the method of determining the frequency adjustment amount of the kth time slice in the foregoing text, and then continues to adjust the clock of the first clock node according to the frequency adjustment amount of the k+1th time slice.

[0207] It can be understood that each clock node in the clock synchronization network 100 can refer to the method of steps S201 and S202 to determine its time adjustment amount in each time slice, and then adjust the local clock. After adjusting the clock frequency of multiple time slices, the local clocks of all clock nodes in the clock synchronization network 100 can eventually be synchronized to the reference clock, that is, the clock synchronization of the entire clock synchronization network 100 is achieved.

[0208] In summary, the clock synchronization method of the embodiment of the present application determines the frequency adjustment amount of the clock of the first clock node in the kth time slice according to one or more first time offsets, the first frequency drift amount and the topological information of the clock synchronization network 100. In a similar manner, the first clock node can determine the frequency adjustment amount of the local clock in other time slices. After the frequency adjustment of multiple time slices, the clock of the first clock node can be synchronized with the reference clock. Similarly, the clocks of other clock nodes outside the first clock node can also be synchronized with the reference clock, thereby realizing the clock synchronization between all clock nodes and the reference clock node in the clock synchronization network 100. Among them, the above-mentioned one or more first time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes, and the first frequency offset is the frequency drift amount of the first clock node relative to the reference clock node. It can be seen that the method of the embodiment of the present application comprehensively considers the influence of the three aspects of the clock of the neighboring node, the reference clock and the network topology in the process of adjusting the local clock of the first clock node, which helps to improve the convergence speed and accuracy of clock synchronization.

[0209] The second embodiment of the clock synchronization method provided by the present application is introduced below.

[0210] See also Figure 4 , Figure 4 It is a flow chart of another clock synchronization method provided in an embodiment of the present application. The method is applied to the control device 200 and includes the following steps S401 to S403.

[0211] S401: The control device 200 receives one or more groups of information sent by one or more clock nodes.

[0212] Among them, the clock synchronization network 100 includes the above-mentioned one or more clock nodes and the reference clock node, and the above-mentioned one or more groups of information correspond to the above-mentioned one or more clock nodes one by one. The first clock node is one of the above-mentioned one or more clock nodes (can be any one), and the corresponding group of information of the first clock node in the above-mentioned one or more groups of information includes: one or more second time offsets and one or more second frequency drifts. The above-mentioned one or more second time offsets refer to: the time offset of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice. The above-mentioned one or more second frequency drifts refer to: the frequency drift of the first clock node relative to the above-mentioned one or more neighboring nodes in the kth time slice. The above-mentioned one or more neighboring nodes also belong to the clock synchronization network 100, and can include the reference clock node and / or at least one clock node in the clock synchronization network 100 other than the first clock node.

[0213] For example, the first clock node can obtain the timestamp data of one or more of its neighboring nodes, and then determine the one or more second time offsets and one or more second frequency drifts based on the timestamp data, and then send the above group of information to the control device 200. For details, please refer to the relevant introduction in step S201, which will not be repeated here. Similarly, other clock nodes can also obtain the timestamp data of the corresponding neighboring nodes, and then calculate the time offset and frequency drift of the clock node relative to the neighboring nodes, and then send the above group of information to the control device 200. Therefore, the control device 200 can obtain a group of information sent by each clock node in the clock synchronization network 100, which is then used to determine the frequency adjustment amount of each clock node in the kth time slice.

[0214] S402: The control device 200 determines one or more frequency adjustment amounts according to the one or more groups of information and the topology information of the clock synchronization network 100, wherein the one or more frequency adjustment amounts correspond one-to-one to the one or more clock nodes.

[0215] Optionally, the control device 200 may first determine one or more first time offsets and first frequency drifts according to the one or more groups of information, and then determine the frequency adjustment amount corresponding to the first clock node according to the one or more first time offsets, the first frequency drift and the topology information of the clock synchronization network 100. The one or more first time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0216] For example, in the case where the neighboring nodes of the first clock node include a reference clock node, the first clock node can obtain the timestamp data of all neighboring nodes, and then determine the frequency drift of the first clock node relative to the reference clock node in the kth time slice based on the timestamp data, and determine the time offset of the first clock node relative to all neighboring nodes in the kth time slice, and then send the above information to the control device 200. The control device 200 determines that the neighboring nodes of the first clock node include the reference clock node based on the topology information of the clock synchronization network 100, so the control device 200 can directly use the frequency drift sent by the first clock node as the first frequency drift to determine the frequency adjustment of the first clock node in the kth time slice. Similarly, the control device 200 can also directly use the time offsets of all neighboring nodes sent by the first clock node as the first time offset to determine the frequency adjustment of the first clock node in the kth time slice.

[0217] In the case where the neighboring nodes of the first clock node do not include the reference clock node, the first clock node obtains the timestamp data of all the neighboring nodes, and then can determine the time offset and frequency drift of the first clock node relative to each neighboring node in the kth time slice based on the above timestamp data, and then send them to the control device 200. The control device 200 can directly use the time offsets of all the neighboring nodes sent by the first clock node as the first time offset to determine the frequency adjustment amount of the first clock node in the kth time slice. Since the neighboring nodes of the first clock node do not include the reference clock node, the control device 200 needs to determine the first frequency drift amount of the first clock node relative to the reference clock node in the kth time slice based on the frequency drift amount sent by the first clock node to the control device 200, the frequency drift amount sent by other clock nodes to the control device 200, and the topology information of the clock synchronization network 100, so as to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0218] Optionally, in order to optimize the convergence speed and accuracy of clock synchronization, the control device 200 may also determine the first time offset and the first frequency drift according to the above one or more sets of information and the Kalman filter algorithm. For details, please refer to the relevant introduction in step S201, which will not be repeated here.

[0219] Optionally, the control device 200 may first determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, and then determine the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0220] Optionally, the control device 200 may determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, the time slice length, and the time offset and frequency drift of one or more clock nodes (i.e., all clock nodes) in the clock synchronization network 100 relative to the reference clock node in the kth time slice. It should be understood that the time offset and frequency drift of each clock node relative to the reference clock node in the kth time slice can be determined by the above-mentioned various information received by the control device 200, which will not be described in detail here.

[0221] Optionally, the control device 200 may perform a weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter, thereby obtaining the frequency adjustment amount of the first clock node in the kth time slice. The first value is a value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift, respectively.

[0222] For the specific method of determining the first parameter and the second parameter, please refer to the relevant introduction in step S201, which will not be repeated here.

[0223] S403: The control device 200 instructs the corresponding clock node to adjust the clock frequency according to the one or more frequency adjustment amounts.

[0224] For example, after the control device 200 determines one or more frequency adjustment amounts through step S402, the one or more frequency adjustment amounts can be sent to the corresponding clock nodes, so that each clock node can adjust the frequency of the local clock according to the received frequency adjustment amount in the k+1th time slice, and enter the next time slice after the adjustment.

[0225] Optionally, after the frequency adjustment amounts corresponding to all clock nodes (i.e., the one or more frequency adjustment amounts) are determined, the control device 200 may send the determined one or more frequency adjustment amounts to the corresponding clock nodes. Alternatively, the control device 200 may determine the frequency adjustment amount corresponding to each clock node respectively, and whenever the frequency adjustment amount corresponding to a clock node is determined, the frequency adjustment amount may be sent to the corresponding clock node.

[0226] Optionally, the control device 200 may continue to determine the frequency adjustment amount of the first clock node in the k+1th time slice based on the first parameter and the second parameter determined in step S402, combined with one or more third time offsets and third frequency drifts. Among them, the one or more third time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes in the k+1th time slice, and the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice. The first parameter and the second parameter correspond to one or more third time offsets and third frequency drifts, respectively. Regarding the specific method of obtaining the one or more third time offsets and third frequency drifts, reference may be made to the method of obtaining one or more first time offsets and first frequency drifts in step SS402, which will not be repeated here.

[0227] It should be understood that the control device 200 can determine the frequency adjustment amount in each time slice for all clock nodes in the clock synchronization network 100 in the manner described above. After the clock frequency is adjusted for multiple time slices, the local clocks of all clock nodes in the clock synchronization network 100 can eventually be synchronized to the reference clock, that is, the clock synchronization of the entire clock synchronization network 100 is achieved.

[0228] In summary, the method of the embodiment of the present application is that the control device 200 is responsible for determining the frequency adjustment amount of each clock node in each time slice, and each clock node does not calculate the frequency adjustment amount locally, which can reduce the calculation pressure of each clock node. Then, the control device 200 instructs the corresponding clock node to adjust the frequency according to the determined frequency adjustment amount, thereby achieving clock synchronization. It should be understood that since the control device 200 comprehensively considers the influence of the three aspects of the clock of the adjacent node, the reference clock, and the network topology when determining the frequency adjustment amount for each clock node, it helps to improve the convergence speed and accuracy of clock synchronization.

[0229] The third embodiment of the clock synchronization method provided by the present application is introduced below.

[0230] See also Figure 5 , Figure 5 It is a flowchart of another clock synchronization method provided in an embodiment of the present application, including the following steps S501 to S503.

[0231] S501 : The control device 200 determines a first parameter and a second parameter according to topology information of the clock synchronization network 100 .

[0232] The clock synchronization network 100 includes a reference clock node and one or more clock nodes. For other contents of the clock synchronization network 100, please refer to Figure 1 The relevant introduction is not repeated here.

[0233] Optionally, the control device 200 can determine the first parameter and the second parameter based on the following three factors: topology information of the first clock synchronization network 100, time slice length, and time offset and frequency drift of the above one or more clock nodes relative to the reference clock node in the kth time slice.

[0234] For the specific method of determining the first parameter and the second right, reference may be made to the related introduction in steps S201 and S402, which will not be described in detail here.

[0235] Optionally, before step S501, the control device 200 may also receive one or more groups of information sent by one or more clock nodes, and then determine the time offset and frequency drift of each of the one or more clock nodes relative to the reference clock node in the kth time slice according to the topology information of the clock synchronization network 100 and the one or more groups of information. The one or more groups of information correspond to the one or more clock nodes one by one. The first clock node is one of the one or more clock nodes (can be any one), and the group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts. The one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the kth time slice, and the one or more second frequency drifts are the frequency drifts of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network 100. For details, please refer to the relevant introduction of step S402, which will not be repeated here.

[0236] S502: The control device 200 sends a first parameter and a second parameter to one or more clock nodes. Correspondingly, the one or more clock nodes (including the first clock node) receive the first parameter and the second parameter sent by the control device 200.

[0237] S503: The first clock node determines a frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets, and the first frequency drift.

[0238] Among them, the first clock node is any one of the one or more clock nodes mentioned above. The one or more first clock offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more neighboring nodes belong to the clock synchronization network 100, and may include a reference clock node and / or at least one clock node in the clock synchronization network 100 other than the first clock node. The first frequency offset is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0239] It should be understood that since the actions of the various clock nodes in the clock synchronization network 100 are similar, Figure 5 Step S503 in the embodiment is described by taking one of the clock nodes (ie, the first clock node) as an example, but this does not mean that the clock synchronization network 100 can only have one clock node. The clock synchronization network 100 can also include more clock nodes.

[0240] Optionally, before step S503, the first clock node may obtain timestamp data of one or more neighboring nodes, and then determine the one or more first time offsets and first frequency drifts according to the timestamp data.

[0241] Optionally, before step S503, the first clock node may determine the one or more first time offsets and one or more second frequency drifts based on the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice. Then, the first clock node sends the one or more second frequency drifts to the control device 200. Based on the one or more second frequency drifts sent by the first clock node and the information sent by other clock nodes, the control device 200 may determine the first frequency drift and then send it to the first clock node. Accordingly, the first clock node receives the first frequency drift sent by the control device 200 to determine the frequency adjustment amount of the first clock node in the kth time slice.

[0242] Optionally, before step S503, the first clock node may determine one or more second time offsets and second frequency drifts based on the above timestamp data, wherein the above one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. Then, the first clock node determines the above one or more first time offsets and first frequency drifts based on the above one or more second time offsets, the second frequency drift and the Kalman filter algorithm. For the Kalman filter algorithm, please refer to the relevant introduction in step S201, which will not be repeated here.

[0243] Optionally, after the first clock node receives the first parameter and the second parameter sent by the control device 200, the first clock node can perform a weighted summation of the first numerical value and the first frequency drift amount according to the first parameter and the second parameter, thereby obtaining the frequency adjustment amount of the first clock node in the kth time slice. Among them, the first numerical value is the value obtained by dividing the sum of the above one or more first time offsets by the second numerical value, and the second numerical value is the product of the number of the above one or more neighboring nodes and the length of the time slice. The first parameter and the second parameter are the weights of the first numerical value and the first frequency drift amount, respectively. For details, please refer to the relevant introduction in step S201, which will not be repeated here.

[0244] Optionally, in the next time slice of the kth time slice (i.e., the k+1th time slice), the first clock node may continue to obtain one or more third time offsets and third frequency drifts, and then determine the frequency adjustment amount of the first clock node in the k+1th time slice in combination with the first parameter and the second parameter sent by the control device 200. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0245] In summary, the method of the embodiment of the present application is that the control device 200 is responsible for determining the first parameter and the second parameter, and then sending the first parameter and the second parameter to each clock node, which can reduce the calculation pressure of the clock node to a certain extent. Each clock node calculates the frequency adjustment amount locally based on the first parameter and the second parameter sent by the control device 200, and then adjusts the local clock. It should be understood that since this method comprehensively considers the influence of the three aspects of the clock of the neighboring node, the reference clock, and the network topology when determining the frequency adjustment amount for each clock node, it helps to improve the convergence speed and accuracy of clock synchronization.

[0246] It should be understood that Figure 2 , Figure 4 and Figure 5 The clock synchronization method provided in the embodiment helps to improve the accuracy and speed of clock synchronization because it takes into account the time offset of the clock node relative to its neighboring nodes, the frequency drift of the clock node relative to the reference clock node, and the influence of the clock synchronization network 100. Moreover, the method has no limitation on the topological structure of the clock synchronization network 100, has a wide range of applications, and can be applied to various scenarios requiring clock synchronization, which are not specifically limited in the embodiments of the present application.

[0247] For example, in financial and e-commerce scenarios, the server needs to match bids and quotations according to the order of transactions, and these transactions usually come from different clients. In order to avoid disagreements in the order of transactions, it is necessary to ensure that the clocks of each client are synchronized. At this time, the above-mentioned clients can be regarded as clock nodes in the embodiments of the present application, and the reference clock can be selected as needed (for example, the network clock / a high-precision clock / the local clock of the server is used as the reference clock), and then the clock synchronization method based on the embodiment of the present application is used to synchronize the clocks between the clients.

[0248] For example, in a smart home scenario, various smart home devices (such as smart lights, smart sockets, smart air conditioners, smart TVs, etc.) can be regarded as clock nodes in the embodiments of the present application, and a time server or other device can be used as the control device 200. The clocks of the smart home devices can be synchronized based on the clock synchronization method of the embodiments of the present application, and functions such as timing switches can be realized, thereby improving the level of intelligence of the home.

[0249] For example, in an industrial automation scenario, various industrial equipment can be regarded as clock nodes in the embodiments of the present application, and then the clocks of various industrial equipment can be synchronized based on the clock synchronization method of the embodiments of the present application, so as to better control the operation of the industrial equipment and improve production efficiency.

[0250] For example, in scenarios such as medical care, various medical devices can be regarded as clock nodes in the embodiments of the present application, and the clocks of the medical devices can be synchronized based on the clock synchronization method of the embodiments of the present application. This can realize functions such as timed start of the medical devices, which helps to improve the intelligence level and treatment efficiency of the medical devices.

[0251] For example, in an energy management scenario, various energy-consuming devices can be regarded as clock nodes in the embodiments of the present application. The clocks of energy-consuming devices can be synchronized based on the clock synchronization method of the embodiments of the present application, which can support functions such as timed start-up of energy-consuming devices and help save energy consumption.

[0252] See also Figure 6 , Figure 6 1 is a schematic diagram of the structure of a clock node 600 provided in an embodiment of the present application, including a determination module 601 and an adjustment module 602.

[0253] The determination module 601 is used to determine the frequency adjustment amount of the clock of the first clock node in the kth time slice according to one or more first time offsets, the first frequency drift amount and the topology information of the clock synchronization network 100. The clock synchronization network 100 includes a reference clock node and one or more clock nodes, the first clock node is one of the one or more clock nodes, the one or more first time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes in the kth time slice, the first frequency drift amount is the frequency drift amount of the first clock node relative to the reference clock node in the kth time slice, and the one or more neighboring nodes belong to the clock synchronization network 100. For other contents of the clock synchronization network 100, please refer to the previous introduction, which will not be repeated here.

[0254] The adjustment module 602 is used to adjust the clock of the first clock node according to the frequency.

[0255] Optionally, the clock node 600 further includes a transceiver module 603, which is used to obtain the timestamp data of the one or more neighboring nodes, and the determination module 601 is further used to determine the one or more first time offsets and first frequency drifts according to the timestamp data.

[0256] Optionally, the determination module 601 is specifically used to: determine one or more first time offsets and one or more second frequency drifts according to the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to the one or more neighboring nodes in the kth time slice. The transceiver module 603 is also used to send the one or more second frequency drifts to the control device 200, and is also used to receive the first frequency drift sent by the control device 200.

[0257] Optionally, the determination module 601 is specifically used to: determine one or more second time offsets and second frequency drifts according to the above timestamp data, and then determine one or more first time offsets and first frequency drifts according to the one or more second time offsets, the second frequency drifts and the Kalman filter algorithm. The one or more second time offsets are time offsets of the first clock node relative to one or more of its neighboring nodes in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0258] Optionally, the determination module 601 is specifically used to: determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, and then determine the frequency adjustment amount according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0259] Optionally, the determination module 601 determines the first parameter and the second parameter according to the topology information of the clock synchronization network 100, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0260] Optionally, the determination module 601 is specifically used to: perform weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter, so as to obtain the frequency adjustment amount of the first clock node in the kth time slice. The first value is the value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are the weights of the first value and the first frequency drift, respectively.

[0261] Optionally, the determination module 601 is further used to determine the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0262] Reuse Figure 6 In addition, the embodiment of the present application also provides another clock node 600, including a determination module 601, an adjustment module 602 and a transceiver module 603.

[0263] The transceiver module 603 is used to receive the first parameter and the second parameter sent by the control device 200. The first parameter and the second parameter are determined by the control device 200 according to the topology information of the clock synchronization network 100. The clock synchronization network 100 includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes.

[0264] The determination module 601 is used to determine the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift. The one or more first time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the kth time slice, and the one or more neighboring nodes belong to the clock synchronization network 100. The first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0265] The adjustment module 602 is configured to adjust the clock of the first clock node according to the frequency adjustment amount.

[0266] Optionally, the transceiver module 603 is further used to obtain timestamp data of one or more neighboring nodes, and the determination module 601 is further used to determine the one or more first time offsets and first frequency drifts according to the timestamp data.

[0267] Optionally, the determination module 601 is specifically used to: determine one or more first time offsets and one or more second frequency drifts according to the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice. The transceiver module 603 is used to send the one or more second frequency drifts to the control device 200, and is also used to receive the first frequency drift sent by the control device 200.

[0268] Optionally, the determination module 601 is specifically used to: determine one or more second time offsets and second frequency drifts according to the timestamp data, and then determine one or more first time offsets and first frequency drifts according to the one or more second time offsets, the second frequency drifts and the Kalman filter algorithm. The one or more second time offsets are time offsets of the first clock node relative to one or more of its neighboring nodes in the kth time slice, and the second frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0269] Optionally, the determination module 601 is specifically used to: perform weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter, so as to obtain the frequency adjustment amount of the first time node in the kth time slice. The first value is a value obtained by dividing the sum of one or more first time offsets by the second value, the second value is the product of the number of one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift, respectively.

[0270] Optionally, the determination module 601 is further used to determine the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0271] It should be noted that Figure 6 The clock node 600 is only described by taking the above functional module division method as an example. In actual applications, other functional modules can be divided inside the clock node 600 as needed to complete all or part of the functions described above. Figure 6The clock node 600 may be an electronic device equipped with a clock, such as a server, a network device, a mobile terminal device, a smart home device, an industrial device, a medical device, etc., which is not specifically limited in the present embodiment. The clock node 600 may be used to execute the following Figure 2 , Figure 4 or Figure 5 The method / steps on the first time node side in the embodiment can be referred to the previous description and will not be repeated here.

[0272] The embodiment of the present application also provides another clock node 600, including a processor and a memory. The processor is used to execute instructions stored in the memory, so that the clock node 600 executes Figure 2 , Figure 4 or Figure 5 The method / steps on the first clock node side in the embodiment.

[0273] Figure 7 It is a structural diagram of another clock node 600 provided in an embodiment of the present application.

[0274] The clock node 600 includes a processor 701, a memory 702, and a communication interface 703. The clock node 600 is specifically used to implement Figure 2 , Figure 4 or Figure 5 The method on the first time node side in the embodiment. Among them, the processor 701, the memory 702 and the communication interface 703 can be interconnected through the internal bus 704, and can also communicate through other means such as wireless transmission. The embodiment of the present application takes the connection through the bus 704 as an example. The bus 704 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer express link (CXL) bus, a cache coherent interconnect for accelerators (CCIX) bus, etc. The bus 704 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0275] The processor 701 may be composed of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 701 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 702, which enables the clock node 600 to provide a variety of services.

[0276] The memory 702 is used to store program codes, and the execution is controlled by the processor 701. The memory 702 may include a volatile memory, such as a random access memory (RAM); the memory 702 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 702 may also include a combination of the above types. The memory 702 may store program codes, specifically including a memory for executing Figure 2 , Figure 4 or Figure 5 The program code of the method on the first time node side in the embodiment will not be described in detail here.

[0277] The communication interface 703 may be a wired interface (e.g., an Ethernet interface) or a wireless interface (e.g., a cellular network interface or a wireless LAN interface), or may be an internal interface (e.g., a high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) bus interface). The wired interface or the wireless interface is used to communicate with other devices or modules.

[0278] It should be noted that this embodiment can be implemented by a general physical server, such as an ARM server or an X86 server, or by a virtual machine based on a general physical server combined with NFV technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. This application does not make specific limitations. It should be understood that Figure 7 The clock node 600 shown may also be a server cluster composed of at least one server, which is not specifically limited in this application. The clock node 600 may also be a host, a laptop, a desktop computer, a smart phone, and other devices, which are not specifically limited.

[0279] It also needs to be explained. Figure 7 This is only a possible implementation of the embodiment of the present application. In actual applications, the clock node 600 may also include more or fewer components, and the present application does not make specific limitations. For content not shown or described in the embodiment of the present application, please refer to Figure 2 , Figure 4 or Figure 5 The relevant description of the embodiments will not be repeated here.

[0280] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a control device 200 provided in an embodiment of the present application, including a transceiver module 201 and a determination module 202 .

[0281] The transceiver module 201 is used to receive one or more groups of information sent by one or more clock nodes. The clock synchronization network 100 includes one or more clock nodes and a reference clock node, the one or more groups of information correspond to the one or more clock nodes, the first clock node is one of the one or more clock nodes, and the group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, the one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more second frequency drifts are the frequency drifts of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network 100.

[0282] The determination module 202 is used to determine one or more frequency adjustment amounts according to the one or more groups of information and the topology information of the clock synchronization network 100. The one or more frequency adjustment amounts correspond to one or more clock nodes one by one, and each frequency adjustment amount is the frequency adjustment amount of the clock of the corresponding clock node in the kth time slice.

[0283] The transceiver module 201 is further configured to instruct the corresponding clock node to adjust the clock frequency in the kth time slice according to the one or more frequency adjustment amounts.

[0284] Optionally, the determination module 202 is specifically used to: determine one or more first time offsets and first frequency drifts according to the above one or more groups of information, and then determine the frequency adjustment amount corresponding to the first clock node according to the above one or more first time offsets, first frequency drifts and topology information. The above one or more first time offsets are the time offsets of the first clock node relative to one or more of its neighboring nodes in the kth time slice, and the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice.

[0285] Optionally, the determination module 202 is specifically configured to determine one or more first time offsets and first frequency drifts according to the one or more groups of information and a Kalman filter algorithm.

[0286] Optionally, the determination module 202 is specifically used to: determine the first parameter and the second parameter according to the topology information, and then determine the frequency adjustment amount corresponding to the first clock node according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift. The first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

[0287] Optionally, the determination module 202 is specifically used to determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0288] Optionally, the determination module 202 is specifically used to: perform weighted summation of the first value and the first frequency drift according to the first parameter and the second parameter to obtain the frequency adjustment amount corresponding to the first clock node. The first value is the value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift, respectively.

[0289] Optionally, the determination module 202 is further used to determine the frequency adjustment amount of the first clock node in the k+1th time slice according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift. The one or more third time offsets are the time offsets of the first clock node relative to one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

[0290] Reuse Figure 8 In addition to the structure of the present application, an embodiment of the present application also provides another control device 200, including a transceiver module 201 and a determination module 202.

[0291] The determination module 202 is used to determine a first parameter and a second parameter according to topology information of the clock synchronization network 100 , wherein the clock synchronization network 100 includes a reference clock node and one or more clock nodes.

[0292] The transceiver module 201 is used to send the first parameter and the second parameter to the one or more clock nodes. The first clock node is any one of the one or more clock nodes, the frequency adjustment amount of the first clock node in the kth time slice is determined by the first clock node according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift, the one or more first time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, the one or more neighboring nodes belong to the clock synchronization network 100, the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice, and the first parameter and the second parameter correspond to one or more first time offsets and the first frequency drift, respectively.

[0293] Optionally, the determination module 202 is specifically used to determine the first parameter and the second parameter according to the topology information of the clock synchronization network 100, the time slice length, and the time offset and frequency drift of the one or more clock nodes relative to the reference clock node in the kth time slice.

[0294] Optionally, the transceiver module 201 is also used to: receive one or more groups of information sent by one or more clock nodes, wherein one or more groups of information correspond to one or more clock nodes one by one, the first clock node is one of the one or more clock nodes, and the group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, the one or more second time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more second frequency drifts are the frequency drifts of the first clock node relative to one or more neighboring nodes in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network. The determination module 202 is also used to: determine the time offsets and frequency drifts of one or more clock nodes relative to the reference clock node in the kth time slice according to the topology information of the clock synchronization network 100 and one or more groups of information.

[0295] It should be noted that Figure 8 The control device 200 is only described by taking the above functional module division method as an example. In actual applications, other functional modules can be divided inside the control device 200 as needed to complete all or part of the functions described above. Figure 8 The control device 200 is specifically used to execute Figure 2 , Figure 4 or Figure 5 The method steps for controlling the device 200 in the embodiment can be referred to the above description and will not be repeated here.

[0296] The embodiment of the present application also provides another control device 200, including a processor and a memory. The processor is used to execute instructions stored in the memory, so that the control device 200 executes Figure 2 , Figure 4 or Figure 5 Method steps on the control device 200 side in the embodiment.

[0297] Fig. 9 It is a structural diagram of another control device 200 provided in an embodiment of the present application.

[0298] The control device 200 includes a processor 901, a memory 902, and a communication interface 903. The control device 200 is specifically used to implement Figure 2 , Figure 4 or Figure 5The method of controlling the device 200 side in the embodiment. Among them, the processor 901, the memory 902 and the communication interface 903 can be interconnected through the internal bus 904, and can also communicate through other means such as wireless transmission. The embodiment of the present application takes the connection through the bus 904 as an example. The bus 904 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer express link (CXL) bus, a cache coherent interconnect for accelerators (CCIX) bus, etc. The bus 904 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0299] The processor 901 may be composed of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 901 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 902, which enables the control device 200 to provide a variety of services.

[0300] The memory 902 is used to store program codes, and the execution is controlled by the processor 901. The memory 902 may include a volatile memory, such as a random access memory (RAM); the memory 902 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 902 may also include a combination of the above types. The memory 902 may store program codes, specifically including a memory for executing Figure 2 , Figure 4 or Figure 5 The program code of the method for controlling the device 200 in the embodiment will not be described in detail here.

[0301] The communication interface 903 may be a wired interface (e.g., an Ethernet interface) or a wireless interface (e.g., a cellular network interface or a wireless LAN interface), or may be an internal interface (e.g., a high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) bus interface). The wired interface or the wireless interface is used to communicate with other devices or modules.

[0302] It should be noted that this embodiment can be implemented by a general physical server, such as an ARM server or an X86 server, or by a virtual machine based on a general physical server combined with NFV technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. This application does not make specific limitations. It should be understood that Fig. 9 The control device 200 shown may also be a server cluster composed of at least one server, which is not specifically limited in this application. The control device 200 may also be a host, a laptop, a desktop computer, a smart phone, etc., which is not specifically limited.

[0303] It also needs to be explained. Fig. 9 This is only a possible implementation of the embodiment of the present application. In actual applications, the control device 200 may also include more or fewer components, and the present application does not make specific limitations. For content not shown or described in the embodiment of the present application, please refer to Figure 2 , Figure 4 or Figure 5 The relevant description of the embodiments will not be repeated here.

[0304] The embodiment of the present application also provides a clock synchronization system, including a clock synchronization network 100 and a control device 200. The clock synchronization network 100 includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes. The first clock node is used to execute Figure 2 , Figure 4 or Figure 5 The method steps and / or control device 200 on the first clock node side of the embodiment are used to perform Figure 2 , Figure 4 or Figure 5 Method steps on the control device 200 side in the embodiment.

[0305] The present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a processor / electronic device, Figure 2 , Figure 4 or Figure 5 The method on the first clock node / control device 200 side in the embodiment is implemented.

[0306] The present application also provides a computer program product. When the computer program product is run on a processor, Figure 2 , Figure 4 or Figure 5 The method on the first clock node / control device 200 side in the embodiment is implemented.

[0307] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0308] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present application are still within the scope of the invention.

Claims

1. A clock synchronization method, characterized in that: Applied to a first clock node, the method includes: Determine a frequency adjustment amount of the clock of the first clock node in the kth time slice according to one or more first time offsets, a first frequency drift amount, and topology information of a clock synchronization network, wherein the clock synchronization network comprises a reference clock node and one or more clock nodes, the first clock node is one of the one or more clock nodes, the one or more first time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, the first frequency drift amount is a frequency drift amount of the first clock node relative to the reference clock node in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network; The clock of the first clock node is adjusted according to the frequency adjustment amount.

2. The method according to claim 1, characterized in that Before determining the frequency adjustment amount of the clock of the first clock node in the kth time slice according to the one or more first time offsets, the first frequency drift and the topology information of the clock synchronization network, the method further includes: Obtaining timestamp data of the one or more neighboring nodes; The one or more first time offsets and the first frequency drift are determined based on the timestamp data.

3. The method according to claim 2, characterized in that The determining the one or more first time offsets and the first frequency drift according to the timestamp data comprises: Determine the one or more first time offsets and the one or more second frequency drifts according to the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to the one or more neighboring nodes in the kth time slice; Sending the one or more second frequency drift amounts to a control device; The first frequency drift amount sent by the control device is received.

4. The method according to claim 2, characterized in that: The determining the one or more first time offsets and the first frequency drift according to the timestamp data comprises: Determine one or more second time offsets and second frequency drifts according to the timestamp data, wherein the one or more second time offsets are time offsets of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the second frequency drift is a frequency drift of the first clock node relative to the reference clock node in the kth time slice; The one or more first time offsets and the first frequency drift are determined according to the one or more second time offsets, the second frequency drift, and a Kalman filter algorithm.

5. The method according to any one of claims 1 to 4, characterized in that The determining, according to one or more first time offsets, first frequency drifts, and topology information of the clock synchronization network, a frequency adjustment amount of the clock of the first clock node in the kth time slice includes: Determining a first parameter and a second parameter according to topology information of the clock synchronization network; The frequency adjustment amount is determined according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift, wherein the first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

6. The method according to claim 5, characterized in that The determining the first parameter and the second parameter according to the topology information of the clock synchronization network includes: The first parameter and the second parameter are determined according to the topology information of the clock synchronization network, the time slice length, and the time offset and frequency drift of each of the one or more clock nodes relative to the reference clock node in the kth time slice.

7. The method according to claim 5 or 6, characterized in that: The determining the frequency adjustment amount according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift amount includes: A first value and the first frequency drift amount are weightedly summed according to the first parameter and the second parameter to obtain the frequency adjustment amount, wherein the first value is a value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift amount, respectively.

8. The method according to any one of claims 5 to 7, characterized in that After adjusting the clock of the first clock node according to the frequency adjustment amount, the method further includes: The frequency adjustment amount of the first clock node in the k+1th time slice is determined according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift, wherein the one or more third time offsets are the time offsets of the first clock node relative to the one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

9. A clock synchronization method, characterized in that: Applied to a control device, the method comprises: Receive one or more groups of information sent by one or more clock nodes, wherein a clock synchronization network includes the one or more clock nodes and a reference clock node, the one or more groups of information correspond to the one or more clock nodes one-to-one, a first clock node is one of the one or more clock nodes, a group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, the one or more second time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in a k-th time slice, the one or more second frequency drifts are frequency drifts of the first clock node relative to the one or more neighboring nodes in the k-th time slice, and the one or more neighboring nodes all belong to the clock synchronization network; Determining one or more frequency adjustment amounts according to the one or more groups of information and the topology information of the clock synchronization network, wherein the one or more frequency adjustment amounts correspond one-to-one to the one or more clock nodes; Instruct a corresponding clock node to adjust the clock frequency in the kth time slice according to the one or more frequency adjustment amounts.

10. The method according to claim 9, characterized in that The determining one or more frequency adjustment amounts according to the one or more groups of information and the topology information of the clock synchronization network includes: Determine one or more first time offsets and first frequency drifts according to the one or more sets of information, wherein the one or more first time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the first frequency drift is a frequency drift of the first clock node relative to a reference clock node in the kth time slice; A frequency adjustment amount corresponding to the first clock node is determined according to the one or more first time offsets, the first frequency drift amount, and the topology information.

11. The method according to claim 10, characterized in that The determining one or more first time offsets and first frequency drifts according to the one or more sets of information comprises: One or more first time offsets and first frequency drifts are determined based on the one or more sets of information and a Kalman filter algorithm.

12. The method according to claim 10 or 11, characterized in that: The determining, according to the one or more first time offsets, the first frequency drift, and the topology information, a frequency adjustment amount corresponding to the first clock node includes: Determine a first parameter and a second parameter according to the topology information; A frequency adjustment amount corresponding to the first clock node is determined according to the first parameter, the second parameter, the one or more first time offsets and the first frequency drift, wherein the first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

13. The method according to claim 12, characterized in that The determining the first parameter and the second parameter according to the topology information includes: The first parameter and the second parameter are determined according to the topology information, the time slice length, and the time offset and frequency drift of each of the one or more clock nodes relative to the reference clock node in the kth time slice.

14. The method according to claim 12 or 13, characterized in that The determining the frequency adjustment amount corresponding to the first clock node according to the first parameter, the second parameter, the one or more first time offsets, and the first frequency drift includes: A first value and the first frequency drift amount are weightedly summed according to the first parameter and the second parameter to obtain a frequency adjustment amount corresponding to the first clock node, wherein the first value is a value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more adjacent nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift amount, respectively.

15. The method according to any one of claims 12 to 14, characterized in that After determining the first parameter and the second parameter, the method further includes: The frequency adjustment amount of the first clock node in the k+1th time slice is determined according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift, wherein the one or more third time offsets are the time offsets of the first clock node relative to the one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

16. A clock synchronization method, characterized in that: Applied to a control device, the method comprises: Determine a first parameter and a second parameter according to topology information of a clock synchronization network, wherein the clock synchronization network includes a reference clock node and one or more clock nodes; The first parameter and the second parameter are sent to the one or more clock nodes, wherein the first clock node is any one of the one or more clock nodes, the frequency adjustment amount of the first clock node in the kth time slice is determined by the first clock node according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift, the one or more first time offsets are the time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, the one or more neighboring nodes all belong to the clock synchronization network, the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice, and the first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively.

17. The method according to claim 16, characterized in that The determining of the first parameter and the second parameter according to the topology information of the clock synchronization network includes: The first parameter and the second parameter are determined according to the topology information, the time slice length, and the time offset and frequency drift of each of the one or more clock nodes relative to the reference clock node in the kth time slice.

18. The method according to claim 17, characterized in that Before determining the first parameter and the second parameter, the method further includes: Receive one or more groups of information sent by the one or more clock nodes, wherein the one or more groups of information correspond to the one or more clock nodes one-to-one, a first clock node is one of the one or more clock nodes, a group of information corresponding to the first clock node includes one or more second time offsets and one or more second frequency drifts, the one or more second time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in a k-th time slice, the one or more second frequency drifts are frequency drifts of the first clock node relative to the one or more neighboring nodes in the k-th time slice, and the one or more neighboring nodes all belong to the clock synchronization network; Determine, according to the topology information and the one or more groups of information, the time offset and frequency drift of each of the one or more clock nodes relative to the reference clock node in the kth time slice.

19. A clock synchronization method, characterized in that: Applied to a first clock node, the method includes: receiving a first parameter and a second parameter sent by a control device, wherein the first parameter and the second parameter are determined by the control device according to topology information of a clock synchronization network, the clock synchronization network includes a reference clock node and one or more clock nodes, and the first clock node is one of the one or more clock nodes; Determine a frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and a first frequency drift, wherein the one or more first time offsets are time offsets of the first clock node relative to one or more neighboring nodes of the first clock node in the kth time slice, and the one or more neighboring nodes all belong to the clock synchronization network, the first frequency drift is the frequency drift of the first clock node relative to the reference clock node in the kth time slice, and the first parameter and the second parameter correspond to the one or more first time offsets and the first frequency drift, respectively; The clock of the first clock node is adjusted according to the frequency adjustment amount.

20. The method according to claim 19, characterized in that Before determining the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift, the method further includes: Obtaining timestamp data of the one or more neighboring nodes; The one or more first time offsets and the first frequency drift are determined based on the timestamp data.

21. The method according to claim 20, characterized in that The determining the one or more first time offsets and the first frequency drift according to the timestamp data comprises: Determine the one or more first time offsets and the one or more second frequency drifts according to the timestamp data, wherein the one or more second frequency drifts are frequency drifts of the first clock node relative to the one or more neighboring nodes in the kth time slice; Sending the one or more second frequency drift amounts to a control device; The first frequency drift amount sent by the control device is received.

22. The method according to claim 20, characterized in that The determining the one or more first time offsets and the first frequency drift according to the timestamp data comprises: Determine one or more second time offsets and second frequency drifts according to the timestamp data, wherein the one or more second time offsets are time offsets of the first clock node relative to the one or more neighboring nodes in the kth time slice, and the second frequency drift is a frequency drift of the first clock node relative to the reference clock node in the kth time slice; The one or more first time offsets and the first frequency drift are determined according to the one or more second time offsets, the second frequency drift, and a Kalman filter algorithm.

23. The method according to any one of claims 19 to 22, characterized in that The determining the frequency adjustment amount of the first clock node in the kth time slice according to the first parameter, the second parameter, one or more first time offsets and the first frequency drift includes: The frequency adjustment amount is obtained by performing weighted summation of a first value and the first frequency drift amount according to the first parameter and the second parameter, wherein the first value is a value obtained by dividing the sum of the one or more first time offsets by the second value, the second value is the product of the number of the one or more neighboring nodes and the length of the time slice, and the first parameter and the second parameter are weights of the first value and the first frequency drift amount, respectively.

24. The method according to any one of claims 19 to 23, characterized in that After adjusting the clock of the first clock node according to the frequency adjustment amount, the method further includes: The frequency adjustment amount of the first clock node in the k+1th time slice is determined according to the first parameter, the second parameter, one or more third time offsets and the third frequency drift, wherein the one or more third time offsets are the time offsets of the first clock node relative to the one or more neighboring nodes in the k+1th time slice, the third frequency drift is the frequency drift of the first clock node relative to the reference clock node in the k+1th time slice, and the first parameter and the second parameter correspond to the one or more third time offsets and the third frequency drift, respectively.

25. A clock node, characterized in that: Comprising units or modules for performing the method as claimed in any one of claims 1-8 or 19-24.

26. A clock node, characterized in that: It comprises a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the clock node executes the method as described in any one of claims 1-8 or 19-24.

27. A control device, characterized in that: Comprising units or modules for performing the method as claimed in any one of claims 9-15 or 16-18.

28. A control device, characterized in that: The device comprises a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the control device executes the method as claimed in any one of claims 9 to 15 or 16 to 18.

29. A clock synchronization system, characterized in that: It includes a control device and a clock synchronization network, the clock synchronization network includes a reference clock node and one or more clock nodes, the first clock node is one of the one or more clock nodes, the first clock node is used to execute the method as described in any one of claims 1-8 or 19-24 and / or the control device is used to execute the method as described in any one of claims 9-15 or 16-18.

30. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, and when the computer program instructions are executed by a processor, the processor performs the method according to any one of claims 1 to 24.