Method for correcting clock bias, readable storage medium, electronic device and computer program product

By acquiring and processing the clock deviation measurement values ​​and average values ​​of multiple message cycles, using the median filtering method to eliminate outliers, calculating the correction value and correcting the clock deviation, the problem of insufficient clock synchronization accuracy in the IEEE-1588 standard network is solved, and higher clock synchronization accuracy and stability are achieved.

CN120434763BActive Publication Date: 2025-10-17ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510914859.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-10-17
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

In IEEE-1588 standard networks, factors such as link delay jitter can lead to insufficient clock synchronization accuracy.

Method used

By obtaining the clock deviation measurement values ​​and average values ​​of multiple message cycles, using the median filtering method to eliminate abnormal values, calculating the correction value and correcting the clock deviation, the clock synchronization accuracy is improved.

Benefits of technology

It improves the clock synchronization accuracy, stability and synchronization precision between network nodes and eliminates the impact of link delay jitter on clock synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120434763B_ABST
    Figure CN120434763B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a clock deviation correction method, a readable storage medium, an electronic device and a computer program product. The method is applied to a terminal device and includes: obtaining i first clock deviation measurement values of a kth message period, a first clock deviation average value of actual clock deviation values of previous k-1 message periods, and a first average value of correction values of the previous k-1 message periods; determining a mean value of the i first clock deviation measurement values as a second clock deviation measurement value; determining a correction value of each first clock deviation measurement value and a second average value of the correction values of the i first clock deviation measurement values according to the i first clock deviation measurement values and the first clock deviation average value; determining a target correction value of the kth message period according to the first average value and the second average value, and correcting the second clock deviation measurement value based on the target correction value. The problem of insufficient clock synchronization accuracy in the clock synchronization process is solved, and the clock synchronization accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of communication, in particular to a clock offset correction method, a readable storage medium, an electronic device and a computer program product. BACKGROUND

[0002] With the development of modern communication technology, the industrial Ethernet has put forward higher requirements for precision in more and more complex environments. In the Ethernet, the IEEE-1588 standard is applied to the Precision Time Protocol (PTP) as a means of propagating master timing, which provides a clock synchronization method for nodes in the network, and can truly achieve sub-microsecond or even higher clock synchronization accuracy. A batch of IEEE-1588 supporting devices have emerged.

[0003] However, there are still many factors that will affect the actual precision in the actual application of IEEE-1588. For example, link delay jitter and time error. SUMMARY

[0004] Embodiments of the present application provide a clock offset correction method, a readable storage medium, an electronic device and a computer program product to at least solve the problem of insufficient clock synchronization accuracy due to factors such as link delay jitter in the clock synchronization process between network nodes in the related art.

[0005] According to an embodiment of the present application, a clock offset correction method is provided, applied to a terminal device, comprising:

[0006] obtaining i first clock offset measurement values of the kth message period, a first clock offset average value of actual values of the clock offset of the previous k-1 message periods, and a first average value of correction values of the previous k-1 message periods; wherein k≥2, i≥1, k and i are positive integers; determining the average of the i first clock offset measurement values of the kth message period as a second clock offset measurement value of the kth message period; determining a correction value corresponding to each of the i first clock offset measurement values and a second average value of the correction values of the i first clock offset measurement values according to the i first clock offset measurement values and the first clock offset average value; determining a target correction value of the kth message period according to the first average value and the second average value, and correcting the second clock offset measurement value based on the target correction value.

[0007] According to another embodiment of the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program, wherein the computer program is set to execute the steps in any of the above method embodiments when running.

[0008] According to a further embodiment of the present application, an electronic device is also provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor being arranged to execute the computer program to perform the steps of any of the method embodiments described above.

[0009] According to a further embodiment of the present application, a computer program product is also provided, comprising a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.

[0010] In the embodiments of the present application, the i first clock deviation measurement values of the kth message period, the first clock deviation average value of the actual values of the clock deviation of the previous k-1 message periods, and the first average value of the correction values of the previous k-1 message periods are obtained; wherein k≥2, i≥1, k and i are positive integers; the average of the i first clock deviation measurement values of the kth message period is determined as a second clock deviation measurement value of the kth message period; the correction value corresponding to each of the i first clock deviation measurement values and the second average value of the correction values of the i first clock deviation measurement values are determined according to the i first clock deviation measurement values and the first clock deviation average value; the target correction value of the kth message period is determined according to the first average value and the second average value, and the second clock deviation measurement value is corrected based on the target correction value. The problem of insufficient clock synchronization accuracy due to the influence of factors such as link delay jitter in the clock synchronization process between network nodes in the related art is solved, and the clock synchronization accuracy is improved. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 is a hardware structure block diagram of a mobile terminal running the method embodiments of the present application;

[0012] Figure 2 is a networking architecture diagram according to the embodiments of the present application;

[0013] Figure 3 is a message flow diagram according to the embodiments of the present application;

[0014] Figure 4 is a flow diagram of a clock deviation correction method according to the embodiments of the present application;

[0015] Figure 5 is a 1588 message time synchronization principle diagram according to the embodiments of the present application;

[0016] Figure 6 is a variance correction schematic diagram according to the embodiments of the present application;

[0017] Figure 7 is a structure block diagram of an electronic device according to the embodiments of the present application. DETAILED DESCRIPTION

[0018] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0019] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence.

[0020] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking the case of running on a mobile terminal, Figure 1 is a hardware structure block diagram of the mobile terminal running the method embodiments of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processor 102 (the processor 102 can include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal can also include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can also include more or less components than those shown in Figure 1 , or have a different configuration from Figure 1 .

[0021] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as the computer program corresponding to the clock offset correction method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0022] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the mobile terminal. In an example, the transmission device 106 includes a network interface controller (NIC) configured to connect to other network devices via a base station to communicate with the Internet. In an example, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet via a wireless manner.

[0023] The networking architecture of the embodiments of the present application can include network devices, intermediate devices, and terminal devices, for example, Figure 2 is a networking architecture diagram according to the embodiments of the present application. The embodiments of the present application can run on the networking architecture as shown in Figure 2 , which includes servers, switches, and terminal devices. Figure 2

[0024] The terminal device can be a base station or other device terminal, and the terminal device can be interconnected via switches and network devices, or can be parallel or serial cascaded via multiple switches.

[0025] The network device can be a server (e.g., 1588 server) and the like, which can serve as a master clock device in the entire synchronization network and is responsible for sending time information for time synchronization of the terminal device.

[0026] The intermediate device (e.g., a switch) can be composed of switches in the network, which can be responsible for transmitting PTP messages in the network to realize communication between the network device and the terminal device. The switch can be deployed in a serial or parallel cascaded manner to support a larger scale network.

[0027] The terminal device (e.g., a base station / other device terminal) can receive time information from the network device and adjust its local clock according to the received time information to achieve clock synchronization with the network device.

[0028] For example, Figure 3 is a message flow diagram according to the embodiments of the present application, as shown in Figure 3 ​As shown, the terminal device configures packet sending frequency and PTP protocol and the like in the initialization stage, and negotiates with the network device through negotiation mode and establishes connection. After that, the terminal device and the service network device perform message receiving and sending interaction, and the terminal device performs clock deviation value calculation and correction. The terminal device can take the configured message period as a calculation period, and in the process of realizing synchronization, the clock deviation actual value of the historical message period and the clock deviation measurement value of the current calculation period are obtained, wherein the clock deviation measurement value of the current calculation period can be calculated through the time information carried in the message interaction with the network device, and by comparing the clock deviation actual value of the historical message period and the clock deviation measurement value of the current calculation period, the correction value required by the current calculation period is determined, so as to realize the correction of the clock deviation measurement value of the current calculation period and the compensation and calibration of the clock deviation.

[0029] In the embodiment, a clock deviation correction method running on the mobile terminal or the networking architecture is provided, Figure 4 is a flowchart of the clock deviation correction method according to the embodiment of the application, and is applied to a terminal device, such as Figure 4 As shown, the flowchart includes the following steps:

[0030] In step S401, i first clock deviation measurement values of the kth message period, a first clock deviation average value of clock deviation actual values of the previous k-1 message periods, and a first average value of correction values of the previous k-1 message periods are obtained; wherein k≥2, i≥1, k and i are positive integers.

[0031] In the embodiment, the network device can periodically send messages for clock synchronization, and the terminal device can calculate the time delay and clock deviation of message transmission according to the time information carried in the received message, and adjust the local time to be consistent with the network device.

[0032] Exemplarily, the kth message period in the embodiment can be a current message period to be determined for correction value, and the previous k-1 message periods can be historical message periods that have completed correction, and the historical message periods can be one or more.

[0033] As an example, the clock deviation actual value of each message period in the previous k-1 message periods can be a clock deviation value corrected based on the correction value of the respective message period.

[0034] In an exemplary embodiment, before the first clock deviation average value of the clock deviation actual values of the previous k-1 message periods, the following is further included:

[0035] Obtain the third clock deviation measurement value of each message period of the first k-1 message periods and the correction value corresponding to the third clock deviation measurement value; correct the third clock deviation measurement value based on the correction value corresponding to the third clock deviation measurement value to obtain the actual clock deviation value of each message period of the first k-1 message periods.

[0036] As an example, the average of the actual clock deviation values ​​of the first k-1 message periods can be calculated to obtain a first clock deviation average value. The first clock deviation average value can be used to determine the correction value corresponding to each of the i first clock deviation measurement values ​​of the kth message period.

[0037] As an example, the correction value of each message period in the first k-1 message periods may be obtained based on the correction value of its corresponding historical message period and the clock deviation measurement value in its own period.

[0038] As an example, the i first clock deviation measurement values ​​of the kth message period may be multiple clock deviation measurement values ​​measured in the current message period, wherein each first clock deviation measurement value may be measured by the terminal device based on time information carried in a message interacting with the network device. The terminal device may first configure the parameters to take effect and establish a connection with the network device. After the connection is established, the network device may exchange messages at the packet sending frequency configured by the terminal device.

[0039] In an exemplary embodiment, preset message configuration information is synchronized to the network device so that the network device sends the synchronization message based on the message configuration information; wherein, the message configuration information includes at least one of the following: configuration information of message packet sending frequency, configuration information of negotiation mode, configuration information of single and double steps, configuration information of protocol, configuration information of transmission type, and time deviation authorization code.

[0040] The terminal device can initialize the configuration of information such as the packet transmission frequency and PTP protocol, and negotiate with the network device to establish a connection through the negotiation mode. After the connection is established, the terminal device and the service network device can send and receive messages, and the terminal device can calculate and correct the time deviation to achieve clock synchronization.

[0041] Taking 1588 messages as an example, the initialization configuration of the terminal device may include but is not limited to:

[0042] 1) Configuration of the 1588 packet sending frequency; (For example, the parameter value of the 1588 packet sending frequency configuration can be 16);

[0043] 2) Configuring the 1588 negotiation mode (for example, enabling the negotiation mode);

[0044] 3) 1588 single-step and dual-step configuration (for example, it can be configured in dual-step mode);

[0045] 4) 1588 protocol configuration (for example, G.8265.1 / G.8275.1 / G.8275.2, etc.);

[0046] 5) Configuration of 1588 transmission type (for example, multicast / unicast, etc.);

[0047] 6) Time deviation authorization code (for example, an 8-bit number, which can be configured as 90).

[0048] During clock synchronization, the terminal device can use the actual deviation value of the historical message cycle (i.e., the actual clock deviation value of the previous k-1 message cycles) and the correction value corresponding to the actual deviation value (i.e., the correction value used to correct the actual clock deviation value of the previous k-1 message cycles) as the basis for correcting the clock deviation measurement value of the current message cycle.

[0049] As an example, taking the configured message period as a calculation period, a set of time information obtained from the network device each time can be calculated to obtain a clock deviation measurement value (i.e., a first clock measurement deviation value) for the calculation period. By calculating multiple sets of time information for the calculation period, multiple first clock deviation measurement values ​​for the calculation period can be obtained. By calculating the average value of the multiple first clock deviation measurement values, the clock deviation measurement value for the calculation period can be obtained.

[0050] In an exemplary embodiment, each of the i first clock deviation measurement values ​​of the k-th message period is obtained by:

[0051] Receive a synchronization message sent by the network device in the kth message period, the synchronization message carrying first time information of the network device sending the synchronization message; determine second time information of receiving the synchronization message; send a delay request message to the network device, the delay request message carrying third time information of the terminal device sending the delay request message; receive a delay response message sent by the network device in response, the delay response message carrying fourth time information of the network device receiving the delay request message; determine the first clock deviation measurement value based on the first time information, the second time information, the third time information and the fourth time information.

[0052] For example, Figure 5 This is a schematic diagram of the 1588 message time synchronization principle according to an embodiment of the present application, such as Figure 5As shown in , after the terminal device configuration parameters take effect and establish a connection with the network device, the network device can exchange messages at the packet sending frequency configured by the terminal device. Figure 5 As shown in the figure, T1 is the time when the network device sends the synchronization message, Follow_Up[T1] is the accompanying message of T1, which usually contains detailed information about T1 to enable the terminal device to perform more accurate clock offset calculation (i.e., the second time information). T2 is the time when the terminal device receives the synchronization message; T3 is the time when the terminal device sends the delay request message; and T4 is the time when the network device receives the delay request message. The terminal device's local synchronization time T4 = T3 + Delay - Clock offset measurement value Toffset. T1, T2, T3, and T4 are the set of time information for the message period, used to calculate a clock offset measurement value within that message period.

[0053] like Figure 5 As shown in the figure, assuming that the transmission path is symmetrical, the clock offset measurement value Toffset and the delay (i.e., network transmission delay) Delay of the terminal device relative to the network device can be calculated using the following two formulas:

[0054]

[0055]

[0056] As an example, the correction value of the calculation cycle can be determined based on the actual deviation value of the historical message cycle, the correction value corresponding to the actual deviation value, and the clock deviation measurement value of the current message cycle. The correction value of the calculation cycle can be used to correct the clock deviation measurement value of the calculation cycle, thereby realizing the correction of the clock deviation of the calculation cycle and the compensation calibration of the clock deviation.

[0057] Step S402: Determine the average of the i first clock deviation measurement values ​​of the k-th message period as the second clock deviation value of the k-th message period.

[0058] If the terminal device clock phase is directly corrected after each set of clock deviation measurements, the phase will jump continuously in the positive and negative vector directions, making the correction very unstable. Therefore, this application uses the message period as the unit and uses the average of the clock deviation measurements within a message period as the clock deviation measurement value to be corrected for that message period.

[0059] In an exemplary embodiment, where i>3, before determining the average of the i first clock deviation measurement values ​​of the k-th message period as the second clock deviation value to be corrected for the k-th message period, the method further includes:

[0060] identify the maximum first clock offset measurement value and the minimum first clock offset measurement value from all the first clock offset measurement values of the kth message period, and eliminate the maximum first clock offset measurement value and the minimum first clock offset measurement value; from the first clock offset measurement values after eliminating the maximum first clock offset measurement value and the minimum first clock offset measurement value, determine a first clock offset measurement value whose difference between two first clock offset measurement values exceeds a preset threshold range as a third clock offset measurement value and eliminate the first clock offset measurement value.

[0061] In the embodiments of the present application, the terminal device can use the median filtering method to calculate and continuously correct the clock offset to eliminate accidental impulse interference and improve synchronization accuracy.

[0062] As an example, the median filtering method can refer to that for all clock offset measurement values in any one period, the maximum clock offset measurement value and the minimum clock offset measurement value can be removed, and from the clock offset measurement values after removing the maximum clock offset measurement value and the minimum clock offset measurement value, a clock offset measurement value whose difference between any two clock offset measurement values exceeds a preset threshold range can be removed.

[0063] For example, for the clock offset measurement values of a period, the maximum offset value and the minimum offset value are removed, and the offset values greater than 1500 and less than -1500 between any two offset values are removed, and finally the obtained clock offset measurement values can be stored in a list data structure.

[0064] The average value of the remaining clock offset measurement values stored in the list can be calculated, and the calculation formula can be as follows:

[0065]

[0066] It should be noted that the median filtering method of the embodiments of the present application can be applied to any one of the first k-1 message periods, and the median filtering can be performed before the clock offset measurement values of any one of the first k-1 message periods are obtained, and the median filtering method is the same as the above process, which will not be described in detail herein.

[0067] In step S403, a correction value corresponding to each of the i first clock offset measurement values and a second average value of the correction values of the i first clock offset measurement values are determined according to the i first clock offset measurement values and the first clock offset average value.

[0068] Exemplarily, the correction value of each of the i first clock deviation measurement values and the second average of the correction values of the i first clock deviation measurement values can be determined according to the first average of the correction values of the previous k-1 packet periods and the i first clock deviation measurement values of the kth packet period. For example, the average of the correction values of the kth packet period (i.e., the second average) or the average of the correction values of each packet period can be represented by the following formula:

[0069]

[0070] The average of the correction values of the previous k-1 packet periods (i.e., the first average) can be represented as:

[0071]

[0072] As an example, in the case that the kth packet period is the current packet period and the i first clock deviation measurement value in the kth packet period is the current clock deviation measurement value, the correction value of the current clock deviation measurement value can be determined based on the historical clock deviation actual values (i.e., the clock deviation actual values of the previous k-1 packet periods) of the current clock measurement value and the current clock deviation measurement value.

[0073] The historical packet period can be one or more. If the historical packet period is more than one, the average of the historical clock deviation actual values of the more than one historical packet periods can be used as the basis for determining the correction value of the current clock deviation measurement value. For example, the difference between the average of the historical clock deviation actual values and the current clock deviation measurement value can be used as the correction value of the current clock deviation measurement value.

[0074] As an example, the correction value of the first packet period in the historical packet period can be initialized as a preset value, and the clock deviation actual value corresponding to each clock deviation measurement value in the first packet period can be calculated based on the preset value. The size of the preset value can be set according to actual conditions, which is not limited in the embodiments of the present application.

[0075] For example, if the current packet period is the second packet period and the current clock deviation measurement value is the first clock deviation measurement value in the second packet period, the average of the multiple clock deviation actual values of the historical packet period (i.e., the first packet period) of the second packet period (i.e., the first clock deviation average) can be calculated, and the correction value of the first clock deviation measurement value in the second packet period can be determined based on the average of the clock deviation actual values of the first packet period and the first clock deviation measurement value in the second packet period.

[0076] In an exemplary embodiment, the determining, according to the i first clock bias measurement values and the first clock bias average value, of a correction value corresponding to each of the i first clock bias measurement values comprises:

[0077] For each of the first clock bias measurement values, a difference between the first clock bias average value and each of the first clock bias measurement values of the kth message period is determined as the correction value corresponding to the first clock bias measurement value.

[0078] Step S404, determining, according to the first average value and the second average value, of a target correction value of the kth message period, and correcting the second clock bias measurement value based on the target correction value.

[0079] Exemplarily, a first average value of the correction values of the first k-1 message periods and a second average value of the correction values of the kth message period can be recalculated as an average value, and the calculated average value can be taken as the target correction value of the kth message period.

[0080] For example, the target correction value can be expressed as:

[0081]

[0082] Since the correction value is recursively calculated, the correction value needs to be initialized.

[0083] For example, in an embodiment of the present application, the message correction value of the first message period can be initialized as 0, and the correction value of the second message period can be calculated using the average value of the clock bias measurement value filtered by the median filtering method of the first message period (since the correction value of the first message period is 0, the clock bias measurement value of the first message period is the actual value of its clock bias) and the difference between each clock bias measurement value of the second message period, for example, which can be expressed by the following formula:

[0084]

[0085] From the third message period, the target correction value can be determined using the formula

[0086] The embodiment of the present application statistically processes the clock bias measurement value based on the recursive method, and further determines the correction value of the clock bias measurement value of the message period. The clock bias measurement value processed by using the correction value can be used for phase correction, and the phase correction can be more stable and accurate.

[0087] ​In the embodiment of the present application, the i first clock deviation measurement values of the kth message period, the first clock deviation average value of the actual values of the clock deviation of the previous k-1 message periods, and the first average value of the correction values of the previous k-1 message periods are obtained; wherein k≥2, i≥1, k and i are positive integers; the average of the i first clock deviation measurement values of the kth message period is determined as the second clock deviation measurement value of the kth message period; the correction value corresponding to each first clock deviation measurement value of the i first clock deviation measurement values and the second average value of the correction values of the i first clock deviation measurement values are determined according to the i first clock deviation measurement values and the first clock deviation average value; the target correction value of the kth message period is determined according to the first average value and the second average value, and the second clock deviation measurement value is corrected based on the target correction value. The problem that the clock synchronization precision is insufficient due to the influence of factors such as link delay jitter in the clock synchronization process between network nodes in the related art is solved, the clock synchronization precision is improved, and the synchronization precision of the entire network is further improved.

[0088] In an exemplary embodiment, further comprising:

[0089] According to the correction value variance corresponding to the i first clock deviation measurement values of the kth message period, the correction value variance of the kth message period is determined; the correction value variance is encapsulated into the delay request message of the kth message period, and the delay request message is sent to the network device.

[0090] For example, Figure 6 is a variance correction schematic diagram according to the embodiment of the present application, as Figure 6 shown, the delay deviation curve can be drawn on the maintenance interface of the terminal device through the correction value variance, which can be used to observe the stability of the phase precision of the entire network for a long time.

[0091] As shown in Figure 6 , the calculation method of the correction variance value can be as follows:

[0092] a. The correction value sequence c is divided into N blocks according to the configuration frequency t;

[0093] b. The average of n data in each block is calculated respectively;

[0094]

[0095] c. The correction value variance of t periods is calculated by calculating the difference between the average values of adjacent two blocks:

[0096] .

[0097] In an exemplary embodiment, the message configuration information includes a time offset authorization code, and the encapsulating the correction value variance into the delay request message of the kth message cycle includes:

[0098] encapsulating the time offset authorization code into a first reserved field of the delay request message, and encapsulating the correction value variance into a second reserved field of the delay request message.

[0099] As an example, the correction value variance may be encapsulated into the last set of delay request Delay_Req message headers of each cycle of the PTP protocol. For example, Table 1 is a message header of a Delay_Req message before encapsulation, and Table 2 is a message header of a Delay_Req message after encapsulation, as shown in Table 1 and Table 2.

[0100] Table 1

[0101]

[0102] Table 2

[0103]

[0104] wherein,

[0105] 1) reserved (1) can be an error authorization code;

[0106] 2) reserved (2) can be the value of reserved (1) and XOR;

[0107] 3) the device instrument or the maintenance terminal can XOR reserved (2) and reserved (1) to recover the actual correction variance.

[0108] The terminal device can send the correction value variance to the device instrument or the operation and maintenance center (OMC) in real time for storage. Through the OMC maintenance interface, a deviation trend graph of the correction value variance can be drawn, so that through long-term statistical analysis of the deviation trend graph, the link delay problem can be accurately understood.

[0109] Those skilled in the art can clearly understand that the method according to the above-mentioned embodiments can be realized by means of software on a general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the methods described in the various embodiments of the present application.

[0110] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the method embodiments when running.

[0111] In an example embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0112] Figure 7 is a structural block diagram of an electronic device according to an embodiment of the present application, as Figure 7 The embodiments of the present application also provide an electronic device 70, which includes a processor 701 and a memory 702, and the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the method embodiments.

[0113] In an example embodiment, the electronic device can also include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0114] The specific examples in the embodiments can refer to the examples described in the above embodiments and example embodiments, and the embodiments will not be described here.

[0115] The embodiments of the present application also provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the steps in any of the method embodiments.

[0116] It is apparent that those skilled in the art can modify and / or change the above-described modules or steps of the present application with general computing devices, which can be centralized on a single computing device or distributed on a network composed of multiple computing devices, which can be implemented by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different orders, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.

[0117] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for correcting clock deviation, characterized in that: Applied to terminal equipment, including: Obtain i first clock deviation measurement values ​​of the kth message period, a first clock deviation average value of the actual clock deviation values ​​of the previous k-1 message periods, and a first average value of the corrected values ​​of the previous k-1 message periods; wherein k ≥ 2, i ≥ 1, and k and i are positive integers; Determine the average of the i first clock deviation measurement values ​​of the k-th message period as the second clock deviation measurement value of the k-th message period; determining, based on the i first clock deviation measurement values ​​and the first clock deviation average value, a correction value corresponding to each of the i first clock deviation measurement values ​​and a second average value of the correction values ​​of the i first clock deviation measurement values; A target correction value for the k-th message period is determined according to the first average value and the second average value, and the second clock deviation measurement value is corrected based on the target correction value.

2. The method according to claim 1, characterized in that Before the first clock deviation average value of the actual clock deviation values ​​of the first k-1 message periods, it also includes: Obtaining a third clock deviation measurement value for each message period of the first k-1 message periods and a correction value corresponding to the third clock deviation measurement value; The third clock deviation measurement value is corrected based on the correction value corresponding to the third clock deviation measurement value to obtain the actual clock deviation value of each message period of the first k-1 message periods.

3. The method according to claim 2, characterized in that in, i>3, before determining the average of the i first clock deviation measurement values ​​of the k-th message period as the second clock deviation value to be corrected of the k-th message period, the method further includes: Identifying a maximum first clock deviation measurement value and a minimum first clock deviation measurement value among all first clock deviation measurement values ​​of the kth message period, and removing the maximum first clock deviation measurement value and the minimum first clock deviation measurement value; From the first clock deviation measurement values ​​after excluding the maximum first clock deviation measurement value and the minimum first clock deviation measurement value, the first clock deviation measurement value whose difference between the two first clock deviation measurement values ​​exceeds the preset threshold range is determined as the third clock deviation measurement value and is eliminated.

4. The method according to claim 1, wherein in, Each of the i first clock deviation measurement values ​​of the k-th message period is obtained by: receiving a synchronization message sent by the network device in the kth message period, where the synchronization message carries first time information at which the network device sends the synchronization message; Determining second time information of receiving the synchronization message; Sending a delay request message to the network device, where the delay request message carries third time information at which the terminal device sends the delay request message; receiving a delay response message sent by the network device, where the delay response message carries fourth time information at which the network device receives the delay request message; The first clock deviation measurement value is determined based on the first time information, the second time information, the third time information, and the fourth time information.

5. The method according to claim 4, characterized in that Also includes: Synchronizing preset message configuration information to the network device, so that the network device sends the synchronization message based on the message configuration information; The message configuration information includes at least one of the following: message sending frequency configuration information, negotiation mode configuration information, single-step and double-step configuration information, protocol configuration information, transmission type configuration information, and time deviation authorization code.

6. The method according to claim 1, characterized in that in, The determining, based on the i first clock deviation measurement values ​​and the first clock deviation average value, a correction value corresponding to each of the i first clock deviation measurement values ​​includes: For each of the first clock deviation measurement values, a difference between the first clock deviation average value and each first clock deviation measurement value of the k-th message period is determined as a correction value corresponding to the first clock deviation measurement value.

7. The method according to claim 5, characterized in that Also includes: Determining a correction value variance of the kth message period according to the correction values ​​corresponding to the i first clock deviation measurement values ​​of the kth message period; The correction value variance is encapsulated into the delay request message of the kth message period, and the delay request message is sent to the network device.

8. The method according to claim 7, characterized in that The message configuration information includes a time deviation authorization code, and the step of encapsulating the correction value variance into the delay request message of the k-th message period includes: The time deviation authorization code is encapsulated into a first reserved field of the delay request message, and the correction value variance is encapsulated into a second reserved field of the delay request message.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Time synchronization correction method and device, equipment and storage medium

    CN117560758A

  • Clock synchronization method and apparatus, device, storage medium, and computer program

    WO2024120469A1