NETWORK TIMING METHOD AND DEVICE
FIG4 is a schematic diagram of a linear fitting curve according to an embodiment of the present application  FIG3 is a schematic diagram of a process of recording historical time correction data each time according to an embodiment of the present application
Assuming that the recorded historical time correction data includes the time correction data of 32 historical time-correction time points, wherein the time-correction difference value of each of historical time-correction time points is 2.1 seconds; the historical time-correction time points are set to orders of historical time corrections determined in chronological order of the historical time corrections, and the average time-correction time point of the historical time-correction time points is an average value of the orders of all the historical time corrections. The average time-correction time point of all the historical time-correction time points is: x‾=∑i=132i3216.5,the average total time-correction difference value of all the historical time-correction time points is: y‾=2.1×∑i=132i32=34.65. By calculation, the first parameter b=2.1 and the second parameter a=0 can be obtained, and thus the linear fitting equation y=2.1x can be obtained. The linear fitting curve as shown in FIG4 can be obtained. The abscissa of the curve shown in FIG4 is the orders of historical time-correction time points, and the ordinate of the curve is a total historical time-correction difference value corresponding to each of the historical time-correction time points.  FIG3 shows a process of recording each piece of historical time correction data according to the embodiment. A to-be-time-corrected network device 101 sends a time correction request to a time correction server 102 and records time T1 when the time correction request is sent. The time correction server 102 receives the time correction request, and records time T2 when the time correction request is received. The time correction server 102 analyses the time correction request, sends the time correction data to the to-be-time-corrected network device 101, and records time T3 when the time correction data is sent. The to-be-time-corrected network device 101 receives the time correction data and records the time T4 when the time correction data is received. The time correction data between the to-be-time-corrected network device 101 and the time correction server satisfies the following formula (7): {T2=T1+θ+δ1T4=T3−θ+δ2δ=δ1+δ2 where T2 is the time when the time correction server 102 receives the time correction request sent by the to-be-time-corrected network device 101; T1 is the time when the to-be-time-corrected network device 101 sends the time correction request; θ is the time-correction difference value of the to-be-time-corrected network device 101 with respect to the time correction server 102 at time T1; δ1 is the time consumed by the transmission of the time correction request over the network; T4 is the time when the time correction server 102 sends the time correction data; T3 is the time when the to-be-time-corrected network device 101 receives the time correction data sent by the time correction server 102; δ2 is the time consumed by the transmission of the time correction data over the network; δ is a round-trip transmission delay between the to-be-time-corrected network device 101 and the time correction server 102. The time correction data includes the time-correction difference value of the to-be-time-corrected network device 101 with respect to the time correction server 102 at time T1.
schematic diagram
8
formula
30
correction is performed every
4
formula
2
formula time-correction time points is current moment plus
3
formula
['7. The method of claim 1, wherein, obtaining a total current time-correction difference value for the current moment by a preset algorithm, according to the total historical time-correction difference value corresponding to each of the historical time-correction time points, comprises: determining an average time-correction time point of all the historical time-correction time points; determining an average total time-correction difference value for all the historical time-correction time points, according to the total historical  time-correction difference value corresponding to each of the historical time-correction time points; obtaining a first parameter by a first calculation formula, according to each of the historical time-correction time points, the total historical time-correction difference value corresponding to each of the historical time-correction time points, the average time-correction time point and the average total time-correction difference value, wherein the first calculation formula is: b = ∑ i = 1 n x i y i − n xy ‾ ∑ i = 1 n x i 2 − n x ‾ 2 , where, b is the first parameter,  x i  is the  i -th historical time-correction time point,  y i  is a time-correction difference value for the  i -th historical time-correction time point, n is the total number of the historical time-correction time points,  x  is the average time-correction time point,  y  is the average total time-correction difference value; obtaining a second parameter by a second calculation formula, according to the average time-correction time point, the average total time-correction difference value and the first parameter, wherein the second calculation formula is: a = y ‾ − b x ‾ , where,  a  is the second parameter,  y  is the average total time-correction difference value,  b  is the first parameter,  x  is the average time-correction time point; obtaining a total current time-correction difference value y for the current moment by substituting the first parameter and the second parameter into the  following linear fitting equation: y = bx + a  wherein,  y  is the total current time-correction difference value for the current moment,  b  is the first parameter, x is the time-correction time point of the current moment, and  a  is the second parameter.']