An algorithm to improve time synchronization accuracy in a master-slave network topology.

By calculating the master-slave clock skew and link delay in a master-slave network topology, selecting the slave clock with the best synchronization effect, and using maximum likelihood estimation to correct the clock skew, the synchronization error problem caused by asymmetric link delay in the PTP protocol is solved, and high-precision time synchronization is achieved.

CN116366194BActive Publication Date: 2026-06-30JILIN UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JILIN UNIVERSITY
Filing Date
2023-04-13
Publication Date
2026-06-30

Smart Images

  • Figure CN116366194B_ABST
    Figure CN116366194B_ABST
Patent Text Reader

Abstract

This invention discloses an algorithm for improving time synchronization accuracy in a master-slave network topology. The algorithm comprises the following steps: S1, establishing a master-slave network topology; S2, exchanging messages to obtain four timestamps and calculating the master-slave clock offset and average link delay, sending an Optimize_Req message to the master clock; S3, selecting the optimal master-slave clock offset from multiple offsets and calculating the asymmetric link delay ratio for each synchronization; S4, if the current link delay is approximately symmetrical, the master-slave clock offset is used to update the slave clock; S5, if the current link delay is asymmetric, the clock offset estimate is obtained using the maximum likelihood estimation algorithm, and an Optimize_Resp message is sent to the slave clock to update it. This invention improves the PTP time synchronization protocol by using the above algorithm, adding two message transmissions. The master clock receives the synchronization results from multiple slave clocks, further performs filtering and optimization, and then sends the updated results to the slave clocks, allowing the slave clocks to adjust themselves.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and in particular to an algorithm for improving time synchronization accuracy based on a master-slave network topology. Background Technology

[0002] With the advent of the era of intelligent living, the number of network devices used by people has increased dramatically, placing higher demands and standards on network communication quality. Network time synchronization technology is a crucial component in ensuring the timeliness, reliability, and security of network communication. Currently, many fields, such as power systems, measurement and control systems, and navigation and positioning systems, require high-precision time synchronization.

[0003] The IEEE 1588 protocol standard (Precision Time Protocol, PTP) defines a set of time synchronization technology standards. When using hardware timestamps to implement the PTP protocol, the time synchronization accuracy can reach the sub-microsecond level. When using software timestamps to implement the PTP protocol, the synchronization accuracy can reach the microsecond level. PTP time synchronization technology is a widely used time synchronization protocol after NTP time synchronization technology.

[0004] However, with the increasing complexity of network structures and the diversification of application scenarios, the synchronization effect of the PTP protocol has been affected to some extent. The protocol mentions that an effective method to improve accuracy is to use hardware timestamps, as close as possible to the physical layer's timestamp. However, currently, there are few devices on the market that support IEEE 1588 protocol hardware timestamps, and they are expensive.

[0005] Secondly, current research almost exclusively focuses on time synchronization in single-hop or multi-hop wired networks based on a master clock and a slave clock. As networks expand, users may simultaneously access multiple terminals. Therefore, the collaborative working mode of multiple terminals within the same local area network will become a crucial aspect of improving user service quality and enhancing user experience.

[0006] Finally, when calculating the master-slave clock offset for time synchronization in the PTP protocol, the assumption of symmetrical link delays between the master and slave clocks, along with the occurrence of random delays during message transmission, will introduce significant errors to clock synchronization. Therefore, asymmetric link delay is an inherent flaw in the PTP protocol. In real-world network communication, due to factors such as different uplink and downlink communication rates, different message lengths, and different buffering times at switching nodes, the path delays between the master and slave links will never be identical and will not completely cancel each other out. Summary of the Invention

[0007] The purpose of this invention is to provide an algorithm for improving time synchronization accuracy in a master-slave network topology environment. In the same local area network, under a network topology structure with one master clock and multiple slave clocks, the algorithm enables time synchronization between the master and slave clocks, thereby improving the time synchronization accuracy between the master and slave clocks.

[0008] To achieve the above objectives, this invention provides an algorithm for improving time synchronization accuracy based on a master-slave network topology. S1: Establish a network topology with a master clock and multiple slave clocks. The master clock and multiple slave clocks exchange synchronization messages according to the PTP protocol.

[0009] S2. Based on the message exchange in S1, four timestamps t1, t2, t3 and t4 are obtained. The master-slave clock offset and average link delay between the master clock and each slave clock are calculated. Each slave clock sets the master-slave clock offset and average link delay as an Optimize_Req message and sends it to the master clock.

[0010] S3. Filter the multiple master-slave clock deviations obtained in S2, calculate the asymmetric link delay ratio for each synchronization based on the selected optimal master-slave clock deviation, and select an appropriate value range.

[0011] S4. According to the range of values ​​for the asymmetric link delay ratio in S3, if the asymmetric link delay ratio is within the range, then the link delays of the master clock and the slave clock are approximately symmetrical, and this master-slave clock deviation is used to update the slave clock.

[0012] S5. Based on the range of the asymmetric link delay ratio in S3, if the asymmetric link delay ratio is not within the range, the maximum likelihood estimation algorithm is used to obtain the estimated clock deviation for this synchronization. The estimated clock deviation is set as the Optimize_Resp message and sent to the slave clock to update the slave clock.

[0013] Preferably, in S1, the following steps are performed sequentially: S11, preparing for time synchronization; S12, the master clock sends a message and a sending timestamp to the slave clock; S13, the slave clock receives the message and records the receiving timestamp; S14, the slave clock sends a message to the master clock; and S15, the master clock receives the message and sends an arrival timestamp.

[0014] S11. Preparing for time synchronization: The master clock sends Announce messages to multiple slave clocks to announce its own clock source information. After receiving the Announce messages, the slave clocks enter the listening state to prepare for time synchronization.

[0015] S12. Master clock sends messages and timestamps to slave clocks: Set the interval period for the master clock to send Sync messages to multiple slave clocks. The master clock sends Sync messages to slave clocks according to the interval period and records the timestamp t1. After the Sync message is sent, the timestamp t1 is encapsulated in the Follow_up message and sent to the slave clock.

[0016] S13. Receive messages from the clock and record the received timestamp: Receive the Sync message from the clock and record the received timestamp t2, and extract the sending timestamp t1 from the Follow_up message;

[0017] S14. Send a message from the slave clock to the master clock: The slave clock returns and sends a Delay_Req message to the master clock, and records the sending timestamp t3;

[0018] S15. The master clock receives the message and sends the arrival timestamp: The master clock receives the Delay_Req message and records the reception timestamp t4. It then encapsulates the reception timestamp t4 into the Delay_Resp message and returns the Delay_Resp message to the slave clock.

[0019] Preferably, in S2, the following steps are performed sequentially: S21, calculate the master-slave clock offset; S22, calculate the average link delay; and S23, send an Optimize_Req message to the master clock.

[0020] S21. Calculate the master-slave clock offset: Define the master-slave clock offset as offset.

[0021]

[0022] S22. Calculate the average link delay: Define the average link delay as delay.

[0023]

[0024] S23. Send an Optimize_Req message to the master clock: Set the master-slave clock offset and average link delay as the Optimize_Req message and send it to the master clock.

[0025] Preferably, in S3, the following steps are performed sequentially: S31, averaging all master-slave clock offsets; S32, discarding each master-slave clock offset; and S33, repeating the above operations to obtain the optimal master-slave clock offset.

[0026] S31. Calculate the average of all master-slave clock offsets: Take the absolute values ​​of the master-slave clock offsets, add them together, and calculate the average. Define the average as 'average', the number of slave clocks as 'length', and the nth slave clock as 'i'.

[0027]

[0028] Where length = n, and n is the number of slave clocks;

[0029] S32. Discard each master-slave clock offset: discard the master-slave clock offset i Compared with the average value, if the master-slave clock offset is... i If the offset is greater than the average, discard it; otherwise, retain the master-slave clock offset. i ;

[0030] S33. Repeat the above operation to obtain the optimal master-slave clock offset: [The remaining master-slave clock offset is then processed.] i Repeat steps S31 and S32 until the optimal master-slave clock offset is obtained.

[0031] Preferably, in S4, S41 is performed sequentially to calculate the asymmetric link delay ratio, and S42 is performed to determine whether the link delay is approximately symmetric.

[0032] S41. Calculate the asymmetric link delay ratio: Define the asymmetric link delay ratio as R, and the master-slave link delay as t. ms The delay from the main link is t. sm ,

[0033]

[0034] After calculating all R values, we analyze their cumulative distribution and set the range of R values ​​with relatively dense distribution as the range for judging whether the link delay is approximately symmetrical.

[0035] S42. Determine if the link delay is approximately symmetrical: If the value of R is 1, the link delay is absolutely symmetrical; if the value of R is within the range, the link delay is approximately symmetrical; if the value of R is outside the range, the link delay is asymmetrical.

[0036] Preferably, in S5, the following steps are performed sequentially: S51, maximum likelihood estimation is performed to modify and correct the master-slave clock deviation of asymmetric link delay; S52, an Optimize_Resp message is sent to the slave clock.

[0037] S51. Modify and correct the master-slave clock skew of asymmetric link delay using maximum likelihood estimation:

[0038] Modeling based on the Gaussian distribution, the formula for the Gaussian distribution is:

[0039]

[0040] The mean is μ, and the variance is σ. 2 ;

[0041] Setting, delay ms The value range is [1-2delay], then

[0042] delay sm =2delay-delay ms ;

[0043] Define the uplink delay between the master clock and each slave clock as X(i), and the downlink delay between the master clock and each slave clock as Y(i). The resulting link delay observation function is:

[0044] U(i)=t2(i)-t1(i)=delay ms (i)+θ+X(i)

[0045] Where U(i) is the master-slave message transmission observation time, delay ms (i) represents the link delay, θ represents the clock offset to be estimated, X(i) represents the random delay increment, and i represents the i-th synchronization.

[0046] D(i)=t4(i)-t3(i)=delay sm (i)-θ+Y(i)

[0047] Where D(i) is the slave-master message transmission observation time, delay sm (i) represents the link delay, θ represents the estimated clock skew, Y(i) represents the random delay increment, and i represents the i-th synchronization.

[0048] During the Nth synchronization process, based on Observations yielded the maximum likelihood function for the clock deviation:

[0049]

[0050] Taking the logarithm of the maximum likelihood function for clock skew is:

[0051]

[0052] Differentiate the maximum likelihood function of the clock deviation after taking the logarithm:

[0053]

[0054] The final maximum likelihood estimate of the clock bias is:

[0055]

[0056] The optimal estimate of the master-slave clock bias is obtained from the above formula;

[0057] S52. Send Optimize_Resp message to slave clock: The master clock sends the best estimate of the master-slave clock deviation to the slave clock in an Optimize_Resp message, and the slave clock adjusts itself according to the received result.

[0058] Therefore, the present invention employs an algorithm for improving time synchronization accuracy based on a master-slave network topology environment, which adopts the above method. Its beneficial effects are as follows:

[0059] 1. A master-slave network topology is more applicable to today's complex and ever-changing network environment;

[0060] 2. When multiple slave clocks perform time synchronization simultaneously, the PTP time synchronization protocol is improved by adding two message transmissions. The master clock can receive the synchronization results from multiple slave clocks and select the slave clock with the best synchronization effect. Other slave clocks use this as a reference to update their time, ultimately achieving the goal of improving the overall time synchronization effect. At the same time, the clock deviation of the slave clocks converges faster.

[0061] 3. When correcting the master-slave clock skew, the maximum likelihood estimation is applied to obtain the best estimate of the master-slave clock skew, so that the master-slave clock skew is estimated once for each synchronization cycle, so that the master and slave clocks can dynamically update the slave clock during the synchronization process.

[0062] 4. The algorithm proposed in this invention is implemented on the master clock side. After the optimize_Req message, the master clock can receive the initial master-slave time deviation and the average link delay of this synchronization with the slave clock. Then, the master clock applies the algorithm proposed in this invention to improve the time synchronization accuracy, and sends the new master-slave clock deviation back to the slave clock through the Optimize_Resp message to update the clock.

[0063] 5. This algorithm uses the link delay and master-slave clock deviation obtained during the master-slave clock synchronization process to model the uplink and downlink transmission random delays respectively, obtains the random delay increment function in the network, estimates the clock deviation in the current synchronization process, and thus updates and adjusts the slave clock, making the synchronization process more accurate and stable.

[0064] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0065] Figure 1 This is a schematic diagram of a master-slave network topology in Embodiment 1 of the present invention;

[0066] Figure 2 This is a schematic diagram illustrating the working process of the improved PTP time synchronization protocol in this invention;

[0067] Figure 3 This is a flowchart of the algorithm in this invention;

[0068] Figure 4 This is a flowchart for selecting the optimal master-slave time deviation in this invention. Detailed Implementation

[0069] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0070] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0071] Example 1

[0072] like Figure 1 As shown, a network topology is constructed using five PCs. One PC is selected as the master clock, and the remaining four are selected as slave clocks. The master and slave clocks are connected via a switch. The number of synchronization cycles N between the master and slave clocks is set to 1000, and the synchronization period is 1 second.

[0073] S11. Prepare for time synchronization: Enter the command to call the LinuxPTP main program in the Linux terminal of each PC. The master clock will automatically broadcast an Announce message to all slave clocks in the local area network. After receiving the Announce message, the slave clocks will enter the listening state to prepare for time synchronization.

[0074] S12. Master clock sends messages and timestamps to slave clocks: Set the interval period for the master clock to send Sync messages to multiple slave clocks. The master clock sends Sync messages to slave clocks according to the interval period and records the timestamp t1. After the Sync message is sent, the timestamp t1 is encapsulated in the Follow_up message and sent to the slave clock.

[0075] S13. Receive messages from the clock and record the received timestamp: Receive the Sync message from the clock and record the received timestamp t2, and extract the sending timestamp t1 from the Follow_up message.

[0076] S14. Send a message from the slave clock to the master clock: The slave clock returns and sends a Delay_Req message to the master clock, and records the sending timestamp t3.

[0077] S15. The master clock receives the message and sends the arrival timestamp: The master clock receives the Delay_Req message and records the reception timestamp t4. It then encapsulates the reception timestamp t4 into the Delay_Resp message and returns the Delay_Resp message to the slave clock.

[0078] S21. Calculate the master-slave clock offset: Define the master-slave clock offset as offset.

[0079]

[0080] S22. Calculate the average link delay: Define the average link delay as delay.

[0081]

[0082] S23. Send an Optimize_Req message to the master clock: Set the master-slave clock offset to offset and the average link delay to delay and send an Optimize_Req message to the master clock. The data format is shown in Table 1. The header adopts the PTP protocol format.

[0083] Table 1. Optimize_Req message data format

[0084]

[0085] S31. Calculate the average of all master-slave clock offsets: Take the absolute values ​​of the master-slave clock offsets, add them together, and calculate the average. Define the average as 'average', the number of slave clocks as 'length', and the nth slave clock as 'i'.

[0086]

[0087] Where length = n, and n is the number of slave clocks.

[0088] S32. Discard each master-slave clock offset: such as Figure 4 As shown, the master-slave clock offset is... i Compared with the average value, if the master-slave clock offset is... i If the offset is greater than the average, then discard the master-slave clock skew offset. i Conversely, the master-slave clock offset is retained. i .

[0089] S33. Repeat the above operation to obtain the optimal master-slave clock offset: [The remaining master-slave clock offset is then processed.] i Repeat steps S31 and S32 until the optimal master-slave clock offset is obtained.

[0090] While filtering the master-slave clock offset, the average link delay is also filtered to achieve the goal of selecting the best synchronization for the four master-slave clocks.

[0091] S41. Calculate the asymmetric link delay ratio: Since network traffic and load changes are unpredictable, the master-slave link delay differs from the slave-master link delay. Therefore, it is necessary to calculate the asymmetric link delay ratio for each synchronization process. Define the asymmetric link delay ratio as R, and the master-slave link delay as t. ms The delay from the main link is t. sm ,

[0092]

[0093] After calculating all R values, their cumulative distribution is analyzed. The range where the R values ​​are relatively densely distributed is set as the range for judging whether the link delay is symmetrical. Within this range, it indicates that the impact of link asymmetry is relatively low. Therefore, the master-slave clock offset can be directly used to update the slave clock.

[0094] S42. Determine if the link delay is approximately symmetrical: If the value of R is 1, the link delay is absolutely symmetrical; if the value of R is within the range, the link delay is approximately symmetrical; if the value of R is outside the range, the link delay is asymmetrical.

[0095] S51. Modify and correct the asymmetric link delay in S42 using maximum likelihood estimation:

[0096] Modeling based on the Gaussian distribution, the formula for the Gaussian distribution is:

[0097]

[0098] The mean is μ, and the variance is σ. 2 ;

[0099] Setting, delay ms The value range is [1-2delay], then

[0100] delay sm =2delay-delay ms ;

[0101] Based on the selected optimal master-slave clock offset and average link delay, the uplink delay and downlink delay are modeled separately to obtain the random delay increment.

[0102] Define the uplink delay between the master clock and each slave clock as X(i), and the downlink delay between the master clock and each slave clock as Y(i). The resulting link delay observation function is:

[0103] U(i)=t2(i)-t1(i)=delay ms (i)+θ+X(i)

[0104] Where U(i) is the master-slave message transmission observation time, delay ms (i) represents the link delay, θ represents the clock offset to be estimated, X(i) represents the random delay increment, and i represents the i-th synchronization.

[0105] D(i)=t4(i)-t3(i)=delay sm (i)-θ+Y(i)

[0106] Where D(i) is the slave-master message transmission observation time, delay sm (i) represents the link delay, θ represents the estimated clock skew, Y(i) represents the random delay increment, and i represents the i-th synchronization.

[0107] During the Nth synchronization process, based on Observations yielded the maximum likelihood function for the clock deviation:

[0108]

[0109] Taking the logarithm of the maximum likelihood function for clock skew is:

[0110]

[0111] Differentiate the maximum likelihood function of the clock deviation after taking the logarithm:

[0112]

[0113] The final maximum likelihood estimate of the clock bias is:

[0114]

[0115] The best estimate of the clock deviation is obtained from the above formula.

[0116] S52. Send Optimize_Resp message to slave clock: The master clock sends the best estimate of the master-slave clock deviation to the slave clock in the form of an Optimize_Resp message. The data format of the Optimize_Resp message is shown in Table 2. The slave clock adjusts itself according to the received result.

[0117] Table 2. Optimize_Resp Message Data Format

[0118]

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for improving time synchronization accuracy in a master-slave network topology environment, characterized in that: S1. Establish a network topology with a master clock and multiple slave clocks. The master clock and multiple slave clocks exchange synchronization messages according to the PTP protocol. S2. Based on the message exchange in S1, four timestamps t1, t2, t3 and t4 are obtained. The master-slave clock offset and average link delay between the master clock and each slave clock are calculated. Each slave clock sets the master-slave clock offset and average link delay as an Optimize_Req message and sends it to the master clock. S3. Filter the multiple master-slave clock deviations obtained in S2, calculate the asymmetric link delay ratio for each synchronization based on the selected optimal master-slave clock deviation, and select an appropriate value range. In S3, proceed sequentially with S31, checking all master-slave clock offsets. offset Calculate the average value, S32, for each master-slave clock bias. offset To determine the optimal master-slave clock offset, repeat the above steps in step S33. offset ; S31. For all master-slave clock skews offset Calculate the average value for the master-slave clock skew. offset Take the absolute values ​​of the terms, add them together, and then calculate the average. Define the average as... average From the number of clocks length Which one is the clock? i , in, length=n,n The number of clocks; S32, Regarding each master-slave clock offset offset Perform a rounding: adjust the master-slave clock skew and average Compare the magnitudes of the master-slave clock offsets. Greater than average If the clock bias is positive, discard it; otherwise, retain the master-slave clock bias. ; S33. Repeat the above operation to obtain the optimal master-slave clock offset. offset : Regarding the retained master-slave clock bias Repeat steps S31 and S32 until the optimal master-slave clock offset is obtained. offset ; S4. According to the range of values ​​for the asymmetric link delay ratio in S3, if the asymmetric link delay ratio is within the range, then the link delays of the master clock and the slave clock are approximately symmetrical, and this master-slave clock deviation is used to update the slave clock. S5. Based on the range of the asymmetric link delay ratio in S3, if the asymmetric link delay ratio is not within the range, the maximum likelihood estimation algorithm is used to obtain the estimated clock deviation for this synchronization. The estimated clock deviation is set as the Optimize_Resp message and sent to the slave clock to update the slave clock.

2. The method for improving time synchronization accuracy based on a master-slave network topology as described in claim 1, characterized in that: In S1, the following steps are performed sequentially: S11, preparing for time synchronization; S12, the master clock sends a message and a sending timestamp to the slave clock; S13, the slave clock receives the message and records the receiving timestamp; S14, the slave clock sends a message to the master clock; and S15, the master clock receives the message and sends an arrival timestamp. S11. Preparing for time synchronization: The master clock sends Announce messages to multiple slave clocks to announce its own clock source information. After receiving the Announce messages, the slave clocks enter the listening state to prepare for time synchronization. S12. Master clock sends messages and timestamps to slave clocks: Set the interval period for the master clock to send Sync messages to multiple slave clocks. The master clock sends Sync messages to slave clocks according to the interval period and records the timestamp t1. After the Sync message is sent, the timestamp t1 is encapsulated in the Follow_up message and sent to the slave clock. S13. Receive messages from the clock and record the received timestamp: Receive the Sync message from the clock and record the received timestamp t2, and extract the sending timestamp t1 from the Follow_up message; S14. Send a message from the slave clock to the master clock: The slave clock returns and sends a Delay_Req message to the master clock, and records the sending timestamp t3; S15. The master clock receives the message and sends the arrival timestamp: The master clock receives the Delay_Req message and records the reception timestamp t4. It then encapsulates the reception timestamp t4 into the Delay_Resp message and returns the Delay_Resp message to the slave clock.

3. The method for improving time synchronization accuracy based on a master-slave network topology as described in claim 1, characterized in that: In S2, the following steps are performed sequentially: S21, calculate the master-slave clock offset; S22, calculate the average link delay; and S23, send an Optimize_Req message to the master clock. S21. Calculate the master-slave clock offset: Define the master-slave clock offset as offset. offset = ; S22. Calculate the average link delay: Define the average link delay as... delay , delay ; S23. Send an Optimize_Req message to the master clock: adjust the master-slave clock offset to 0. offset and average link delay delay Set it to the Optimize_Req message and send it to the master clock.

4. The method for improving time synchronization accuracy based on a master-slave network topology as described in claim 1, characterized in that: In S4, proceed sequentially to S41, calculate the asymmetric link delay ratio, and S42, determine whether the link delay is approximately symmetric. S41. Calculate the asymmetric link delay ratio: Define the asymmetric link delay ratio as R, and the master-slave link delay as t. ms The delay from the main link is t. sm , After calculating all R values, we analyze their cumulative distribution and set the range of R values ​​with relatively dense distribution as the range for judging whether the link delay is approximately symmetrical. S42. Determine if the link delay is approximately symmetrical: If the value of R is 1, the link delay is absolutely symmetrical; if the value of R is within the range, the link delay is approximately symmetrical; if the value of R is outside the range, the link delay is asymmetrical.

5. The method for improving time synchronization accuracy based on a master-slave network topology as described in claim 1, characterized in that: In S5, the following steps are performed sequentially: S51, maximum likelihood estimation is performed to modify and correct the master-slave clock deviation of asymmetric link delay; S52, Optimize_Resp message is sent to the slave clock. S51. Modify and correct the master-slave clock skew of asymmetric link delay using maximum likelihood estimation: Modeling based on the Gaussian distribution, the formula for the Gaussian distribution is: Where the mean is μ and the variance is μ. ; set up, The range of values ​​is ,but ; Define the uplink delay between the master clock and each slave clock as: The downlink delay between the master clock and each slave clock is The obtained link delay observation function is: in, Master-slave message transmission observation time, For link delay, For the clock bias to be estimated, For random delay increments, For the first Secondary synchronization; in, To transmit observation time from the main message, For link delay, To include estimated clock skew, For random delay increments, For the first Secondary synchronization; During the Nth synchronization process, based on , Observations yielded the maximum likelihood function for the clock deviation: Taking the logarithm of the maximum likelihood function for clock skew is: Differentiate the maximum likelihood function of the clock deviation after taking the logarithm: The final maximum likelihood estimate of the clock bias is: The optimal estimate of the master-slave clock bias is obtained from the above formula; S52. Send Optimize_Resp message to slave clock: The master clock sends the best estimate of the master-slave clock deviation to the slave clock in an Optimize_Resp message, and the slave clock adjusts itself according to the received result.