Method and device for time synchronization, network equipment and medium

By using frequency indication information and frequency level information in communication network equipment, the problem of degradation of time synchronization performance caused by frequency level degradation of frequency servers is solved, and better time signal source selection and time synchronization performance optimization are achieved.

CN119628771APending Publication Date: 2025-03-14HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311190553.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-14
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In a communication network, when the frequency level of the frequency server deteriorates, the network device may continue to track the time server, resulting in the output time synchronization packet performance degradation, but the device still selects the degraded time signal source, affecting the time synchronization performance.

Method used

By receiving the frequency indication information in the time synchronization message and the frequency level information in the frequency level message, the device sends a new time synchronization message, including frequency indication information reflecting the frequency level changes, so that other devices can promptly understand the time performance changes and select a better time signal source.

Benefits of technology

The quality of network equipment selection time signal source is improved, the optimization of time synchronization performance is ensured, and the degradation of time synchronization performance caused by frequency level deterioration is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119628771A_ABST
    Figure CN119628771A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for time synchronization, network equipment and a medium. The method comprises the following steps: a first device receives a first time synchronization message sent by a second device, wherein the first time synchronization message comprises first frequency indication information; a first frequency level message sent by a third device is received, the first frequency level message comprises first frequency level information, and the first frequency level information is used for representing the frequency level of a clock of the third device; and sending a second time synchronization message to a fourth device according to the first frequency indication information and the first frequency level information, the second time synchronization message comprising second frequency indication information. The method is beneficial for the network device to select the master time device with better quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and apparatus, network equipment and medium for time synchronization. Background Art

[0002] In a communication network, each network device has its own clock. In order to meet the needs of communication service delivery, the clocks of each network device need to be synchronized. In a communication network, there are usually frequency servers, time servers, and multiple network devices. The frequency server is used to provide a frequency signal source, and the time server is used to provide a time signal source. The frequency signal source provided by the frequency server is transmitted to the network device step by step, and the time signal source provided by the time server is transmitted to the network device step by step, thereby achieving clock synchronization between each network device.

[0003] In the related art, a method for implementing clock synchronization between a first device and a second device includes: the first device receives a first time synchronization message sent by the second device, the first time synchronization message includes first time level information, and the first time level information is used to indicate the time level of a first time server tracked by the second device. The first device determines whether the second device is its own master time device according to the first time level information.

[0004] However, when the frequency level of the first frequency server tracked by the second device deteriorates, the second device continues to track the first time server in normal state, and the first time level information in the first time synchronization message output by the second device will not change, but the performance of the first time synchronization message output by the second device will decrease. However, since the first device selects the time signal source according to the first time level information, the first device will continue to select the second device as its master time device. At this time, if the time level of the second time server tracked by the backup master time device of the first device is the same as the time level of the first time server tracked by the second device, but the frequency level of the second frequency server tracked by the backup master time device is higher than the frequency level of the first frequency server, the first device continues to select the second device as the master time device, which means that the first device has not selected the optimal time signal source, affecting the time synchronization performance of the system. Summary of the invention

[0005] The present application provides a method and apparatus for time synchronization, a network device and a medium, which are beneficial to improving the quality of a time signal source selected by a network device.

[0006] In a first aspect, the present application provides a method for time synchronization. The method includes: a first device receives a first time synchronization message sent by a second device, the first time synchronization message includes first frequency indication information; receives a first frequency level message sent by a third device, the first frequency level message includes first frequency level information, and the first frequency level information is used to indicate the frequency level of the clock of the third device; and according to the first frequency indication information and the first frequency level information, sends a second time synchronization message to a fourth device, the second time synchronization message includes second frequency indication information.

[0007] In the present application, the first device sends a second time synchronization message to the fourth device based on the first frequency indication information in the received first time synchronization message and the first frequency level information in the first frequency level message. The second frequency indication information in the second time synchronization message can reflect the changes in the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information, so that the fourth device can promptly know whether the performance of the time transmitted by the first device has declined according to the second frequency indication information, thereby facilitating the fourth device to select a time signal source with better quality.

[0008] In the present application, the first device and the fourth device are both network devices, the second device is an upstream device of the first device, and may be a network device or a time server, and the third device is an upstream device of the first device, and may be a network device or a frequency server. Optionally, the network device includes but is not limited to an optical transport network (OTN) device, a packet transport network (PTN) device, a router, and the like.

[0009] Optionally, the first time synchronization message and the second time synchronization message are both announcement messages, and the first frequency indication information and the second frequency indication information are both carried in a frequency traceable flag field of the announcement message.

[0010] The frequency traceable flag field is an existing field in the announce message. The first frequency indication information is carried by the frequency traceable flag field, and there is no need to modify the announce message format, which is simple to implement.

[0011] Optionally, the first frequency level message is a synchronization status message (sync status message, SSM).

[0012] Optionally, the second frequency indication information is determined by the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information. That is, the second frequency indication information can reflect the lower frequency level of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information. Since both the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information will affect the performance of the time sent by the first device, the second frequency indication information in the second time synchronization message sent by the first device needs to be determined based on the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information.

[0013] In a possible implementation, the second frequency indication information is used to indicate the relationship between the lower frequency level of the frequency level indicated by the first frequency indication information and the frequency level indicated by the first frequency level information and the set frequency level, that is, the second frequency indication information indirectly indicates the frequency level, rather than directly indicating the frequency level. Optionally, the set frequency level is a primary reference clock (PRC). When the frequency level indicated by the first frequency indication information or the frequency level indicated by the first frequency level information is lower than the PRC, it indicates that the time performance of the first device is poor, and the second frequency indication information is false FALSE; or, when the frequency level indicated by the first frequency indication information and the frequency level indicated by the first frequency level information are both equal to or higher than the PRC, it indicates that the time performance of the first device is good, and the second frequency indication information is true TRUE.

[0014] When the second frequency indication information is used to indicate the relationship between the frequency level indicated by the first frequency indication information and the lower frequency level among the frequency levels indicated by the first frequency level information and the set frequency level, only 1 bit is needed to carry the second frequency indication information, which can adapt to the number of bits contained in the frequency traceable flag field in the announce message.

[0015] When the frequency level is set to PRC, the second frequency indication information may be determined in the following three situations:

[0016] First, when the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is false (FALSE);

[0017] Second, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is lower than the PRC, the second frequency indication information is FALSE;

[0018] Third, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is true (TRUE).

[0019] Optionally, the method further includes: in response to determining that the highest level (grandmaster, GM) clock levels of the first device and the second device are both out of hold, determining whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information, the third frequency indication information being the local frequency indication information of the first device, or, in response to determining that the GM clock levels of the fifth device and the second device are both out of hold, determining whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information, the third frequency indication information being carried in the third time synchronization message sent by the fifth device to the first device. Here, out of hold means that the GM device tracked by the device has lost the time signal source and the time performance is unavailable.

[0020] When the GM clock levels of the first device and the second device are both out of hold, or when the GM clock levels of the fifth device and the second device are both out of hold, the frequency accuracy has a greater impact on the time synchronization performance. Therefore, it is possible to preferentially determine whether the second device is the master time device of the first device based on the first frequency indication information and the third frequency indication information, which is conducive to the first device selecting a master time device with better quality.

[0021] Optionally, determining whether the second device is the master time device of the first device based on the first frequency indication information and the third frequency indication information includes: a first step, comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result; a second step, determining whether the second device is the master time device of the first device based on the first comparison result.

[0022] Optionally, the first step includes the following three situations: first, when the frequency level indicated by the first frequency indication information is higher than or equal to PRC, and the frequency level indicated by the third frequency indication information is lower than PRC, the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; second, when the frequency level indicated by the first frequency indication information is lower than PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to PRC, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device; third, when the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to PRC, or the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information. In other words, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information and the time performance of the second device are to be determined.

[0023] Optionally, in the second step, determining whether the second device is the master clock of the first device includes any one of the following three methods:

[0024] Mode 1: when the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information, determining that the second device is a candidate master time device for the first device;

[0025] Mode 2: when the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device, determining that the second device is not the master time device of the first device;

[0026] Method three: when the frequency level indicated by the first frequency indication information of the first comparison result is equal to the frequency level indicated by the third frequency indication information, determine whether the second device is the master time device of the first device based on the time level information of the first device and the time level information of the second device.

[0027] Optionally, the method further includes: in response to determining that at least one of the GM clock level of the first device and the GM clock level of the second device is not out of hold, and the time level information of the second device is the same as the time level information of the first device, determining whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information. Here, being in hold means that the device loses the time signal source but the time performance is still available.

[0028] In this case, determining whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information includes: comparing the first frequency indication information and the third frequency indication information to obtain a second comparison result; and secondly, determining whether the second device is the master time device of the first device according to the second comparison result. The generation process of the second comparison result is the same as the generation process of the first comparison result.

[0029] Optionally, determining whether the second device is the master time device of the first device according to the second comparison result includes any one of the following three methods:

[0030] Mode 1: when the second comparison result shows that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information, determining that the second device is a candidate master time device for the first device;

[0031] Mode 2: when the second comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device, determining that the second device is not the master time device of the first device;

[0032] Mode 3: The first time synchronization message also includes first configuration information. The first configuration information includes at least one of priority 1 of the second device's highest level master clock, priority 2 of the second device's highest level master clock, the second device's local priority, and the second device's highest level master clock identity.

[0033] When the second comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, compare the first configuration information with the local configuration information of the first device to obtain a third comparison result; the local configuration information includes at least one of the priority one of the highest level master clock of the first device, the priority two of the highest level master clock of the first device, the local priority of the first device and the identity of the highest level master clock of the first device; based on the third comparison result, determine whether the second device is the master time device of the first device.

[0034] In this implementation, when the frequency levels indicated by the first frequency indication information and the third frequency indication information are both lower than PRC, the frequency level difference has little impact on the performance of the time synchronization message, and other parameters need to be compared further at this time; similarly, when the frequency levels indicated by the first frequency indication information and the third frequency indication information are both higher than or equal to PRC, the frequency level difference has little impact on the performance of the time synchronization message, and other parameters need to be compared further at this time. When one of the frequency levels indicated by the first frequency indication information and the third frequency indication information is higher than or equal to PRC and the other is lower than PRC, the frequency level difference corresponding to the two has a greater impact on the performance of the time synchronization message output by the device, and therefore, it is necessary to preferentially select the device corresponding to the higher frequency level as the master time device.

[0035] In the second aspect, the present application provides a method for time synchronization. The method includes: a target device receives a first time synchronization message sent by a second device, the first time synchronization message including first frequency indication information; in response to determining that the highest level GM clock level of the first device and the highest level GM clock level of the second device are both maintained, the target device determines whether the second device is the master time device of the target device according to the first frequency indication information and the third frequency indication information. Wherein, the target device is the first device, and the third frequency indication information is the local frequency indication information of the first device; or, the target device is a device other than the first device and the second device, and the third frequency indication information is carried in the second time synchronization message sent by the first device and received by the target device.

[0036] In a possible implementation manner, the first frequency indication information and the third frequency indication information are both used to indicate a relationship between a frequency level and a set frequency level. For example, the set frequency level is PRC.

[0037] When the first frequency indication information is TRUE, the frequency level indicated by the first frequency indication information is higher than or equal to the PRC. Alternatively, when the first frequency indication information is FALSE, the frequency level indicated by the first frequency indication information is lower than the PRC.

[0038] When the third frequency indication information is TRUE, the frequency level indicated by the third frequency indication information is higher than or equal to the PRC. Alternatively, when the third frequency indication information is FALSE, the frequency level indicated by the third frequency indication information is lower than the PRC.

[0039] In another possible implementation manner, the first frequency indication information and the third frequency indication information are both frequency level information.

[0040] Optionally, determining whether the second device is the master time device of the first device based on the first frequency indication information and the third frequency indication information includes: comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result; and determining whether the second device is the master time device of the target device based on the first comparison result.

[0041] Optionally, the comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result includes: when the frequency level indicated by the first frequency indication information is higher than or equal to PRC, and the frequency level indicated by the third frequency indication information is lower than PRC, the first comparison result indicates that the timing performance of the second device is better than the timing performance of the device corresponding to the third frequency indication information; or, when the frequency level indicated by the first frequency indication information is lower than PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to PRC, the first comparison result indicates that the timing performance of the device corresponding to the third frequency indication information is better than the timing performance of the second device; or, when the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to PRC, or the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information.

[0042] In a third aspect, the present application provides a device for time synchronization. The device for time synchronization has the function of implementing the method described in the first aspect or any optional method of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0043] In a fourth aspect, the present application provides a device for time synchronization. The device for time synchronization has the function of implementing the method described in the second aspect or any optional method of the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions.

[0044] In a fifth aspect, a network device is provided. The network device includes a processor and a memory. The memory is used to store software programs and modules. The processor implements the method in the first aspect or any possible implementation of the first aspect by running or executing the software program and / or module stored in the memory, or implements the method in the second aspect or any possible implementation of the second aspect.

[0045] Optionally, the number of the processors is one or more, and the number of the memories is one or more.

[0046] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0047] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.

[0048] In a sixth aspect, a computer program product is provided. The computer program product includes computer program code, and when the computer program code is executed by a computer, the computer executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.

[0049] In the seventh aspect, the present application provides a computer-readable storage medium, which is used to store program codes executed by a processor, and the program codes include instructions for implementing the method in any possible implementation of the first aspect above, or instructions for implementing the method in any possible implementation of the second aspect above or the second aspect.

[0050] In an eighth aspect, the present application provides a chip, comprising a processor, the processor being used to call and execute instructions stored in a memory from the memory, so that a network device equipped with the chip executes a method in any possible implementation of the above-mentioned first aspect, or implements the above-mentioned second aspect or a method in any possible implementation of the second aspect.

[0051] In a ninth aspect, the present application provides another chip. The other chip includes an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected via an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method in any possible implementation of the first aspect above, or execute the method in the second aspect above or any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a structural diagram of a communication system provided in an embodiment of the present application;

[0053] Figure 2 It is a structural diagram of a network device provided in an embodiment of the present application;

[0054] Figure 3 is a schematic diagram of a method for time synchronization provided by an embodiment of the present application;

[0055] Figure 4 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application;

[0056] Figure 5 is a process diagram of a method for time synchronization provided by an embodiment of the present application;

[0057] Figure 6 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application;

[0058] Figure 7 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application;

[0059] Figure 8 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application;

[0060] Fig. 9 It is a process diagram of a method for time synchronization provided by an embodiment of the present application;

[0061] Fig.10 is a block diagram of a device for time synchronization provided by an embodiment of the present application;

[0062] Fig.11 It is a structural diagram of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0064] Figure 1 Schematic diagram of a communication system provided by an embodiment of the present application. Figure 1 As shown, the communication system includes at least two time servers, at least two frequency servers and multiple network devices. The multiple network devices are interconnected. Each time server is used to provide a time signal source, which is transmitted step by step through multiple network devices. Each frequency server is used to provide a frequency signal source, which is transmitted step by step through multiple network devices. Optionally, the network device can be an OTN device, a PTN device, a router, etc.

[0065] Figure 1There are two time servers, two frequency servers, and nine network devices. The two time servers are time server 1 and time server 2, and the two frequency servers are frequency server 1 and frequency server 2. The nine network devices are NE 1 to NE 9. The time signal source provided by time server 1 is transmitted to NE 9 through NE 3 and NE 4 in sequence. The frequency signal source provided by frequency server 1 is transmitted to NE 9 through NE 1, NE 2, NE 3, and NE 4 in sequence. The time signal source provided by time server 2 is transmitted to NE 9 through NE 7 and NE 8 in sequence. The frequency signal source provided by frequency server 1 is transmitted to NE 9 through NE 5, NE 6, NE 7, and NE 8 in sequence.

[0066] The time server transmits time information through time synchronization messages (e.g., 1588 messages), and the frequency server transmits frequency signals through physical layer signals and transmits frequency level information of physical layer signals through physical layer messages. The time synchronization messages include, but are not limited to, announcement messages. The physical layer signals include, but are not limited to, synchronous Ethernet clock (SyncE) signals, synchronous OTN clock (SyncO) signals, etc. The physical layer messages include, but are not limited to, synchronous Ethernet clock messages, synchronous OTN clock messages, etc.

[0067] Optionally, the time information includes time level information and frequency indication information. The time level information includes parameters such as the GM clock level (clockclass), the GM clock accuracy (clockaccuracy), and the offset scaled log variance value (offset scaled log variance value) of the GM clock. The frequency indication information is used to indicate the frequency level. The frequency level information is used to indicate the frequency level.

[0068] In the embodiment of the present application, the frequency level includes a primary reference clock (PRC), a primary level synchronization supply unit (SSU-A) (also known as a switching station slave clock), a secondary level synchronization supply unit (SSU-B) (also known as a local station slave clock), a synchronous equipment clock (SEC), etc.

[0069] It should be noted that Figure 1In the figure, a communication system including two time servers, two frequency servers and nine network devices is used as an example for illustration. In other embodiments, the communication system may include a larger number of time servers, a larger number of frequency servers or a larger number of network devices.

[0070] Figure 2 Schematic diagram of the structure of a network device provided in an embodiment of the present application. Figure 2 As shown, the network device includes a main control board and at least one circuit board. The main control board is connected to the circuit board.

[0071] Each circuit board includes multiple message transceivers and multiple ports. The message transceivers and ports are connected in a one-to-one correspondence. The message transceiver is used to receive messages received by the connected port and send the messages received from the port to the main control board for time synchronization; and receive synchronized time information from the main control board, and send messages to other network devices through the connected ports according to the synchronized time information. The messages received and sent by the message transceiver from the corresponding port include at least the aforementioned time synchronization message carrying time information.

[0072] The main control board includes a frequency module and a time module. The frequency module is used to recover the frequency signal based on the received physical layer signal, and pass the recovered frequency signal to the time module. The time module uses the frequency signal as the reference for time synchronization. When the time synchronization message is lost, the frequency signal can provide the network device with time retention performance within a certain period of time. The time module determines the master time device based on the time level information and frequency indication information in the time synchronization message received by each circuit board, and adjusts the time of this device based on the time information carried by the time synchronization message to ensure that the time of this device is synchronized with the time information of the master time device.

[0073] Figure 2 In the example, each circuit board includes 2 message transceivers and 2 ports. In other examples, the number of message transceivers and ports included in the circuit board can be greater than 2, such as 3, 4, etc.

[0074] Figure 3 FIG. 1 is a schematic diagram of a method for time synchronization provided by an embodiment of the present application. Figure 3 As shown, the method includes the following steps 301 to 303.

[0075] 301: A first device receives a first time synchronization message sent by a second device, where the first time synchronization message includes first frequency indication information.

[0076] Exemplarily, the first frequency indication information is used to indicate a frequency level. The frequency level indicated by the first frequency indication information is related to the time performance of the second device. The higher the frequency level indicated by the first frequency indication information, the better the time performance of the second device. Conversely, the lower the frequency level indicated by the first frequency indication information, the worse the time performance of the second device.

[0077] 302: The first device receives a first frequency level message sent by a third device, where the first frequency level message includes first frequency level information, and the first frequency level information is used to indicate a frequency level of a clock of the third device.

[0078] 303: The first device sends a second time synchronization message to the fourth device according to the first frequency indication information and the first frequency level information, where the second time synchronization message includes the second frequency indication information.

[0079] Among them, the first device and the fourth device are Figure 1 The second device is an upstream device of the first device and can be Figure 1 The third device is an upstream device of the first device and can be Figure 1 It is understandable that the upstream device of the present application includes an upstream device directly connected to the first device and an upstream device indirectly connected to the first device. For example, the first device may be Figure 1 NE4 in the example, at this time, the second device may be an NE3 device or a time server 1, and the third device may be an NE2 device or an NE1 device. Exemplarily, the second frequency indication information is used to indicate a frequency level. The frequency level indicated by the second frequency indication information is related to the time performance of the first device. The higher the frequency level indicated by the second frequency indication information, the better the time performance of the first device. Conversely, the lower the frequency level indicated by the second frequency indication information, the worse the time performance of the first device.

[0080] In an embodiment of the present application, the first device sends a second time synchronization message to the fourth device based on the first frequency indication information in the received first time synchronization message and the first frequency level information in the first frequency level message. The second frequency indication information in the second time synchronization message can reflect the changes in the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information, so that the fourth device can promptly know whether the time performance transmitted by the first device has declined according to the second frequency indication information, thereby facilitating the fourth device to select a time signal source with better quality.

[0081] Optionally, the first time synchronization message and the second time synchronization message are both announce messages, and the first frequency indication information and the second frequency indication information are both carried in the frequency traceable flag field in the notification message. In the related art, the frequency traceable flag field is used to carry indication information indicating the frequency level of the time server. In the embodiment of the present application, the frequency traceable flag field is used to carry the second frequency indication information so that the fourth device can promptly know whether the time performance transmitted by the first device has decreased. The frequency traceable flag field is an existing field in the announce message. The second frequency indication information is carried by the frequency traceable flag field, and there is no need to modify the announce message format, which is simple to implement.

[0082] Optionally, the first frequency level message is SSM.

[0083] Optionally, the second frequency indication information is determined by the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information. That is, the second frequency indication information can reflect the lower frequency level of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information. Since the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information affects the time performance sent by the first device, the second frequency indication information in the second time synchronization message needs to be determined based on the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information.

[0084] In a possible implementation, the second frequency indication information is used to indicate the relationship between the lower frequency level among the frequency level indicated by the first frequency indication information and the frequency level indicated by the first frequency level information and the set frequency level, that is, the second frequency indication information indirectly indicates the frequency level rather than directly indicating the frequency level.

[0085] Exemplarily, when the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information is lower than the set frequency, the second frequency indication information is FALSE; or, when the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information is equal to or higher than the set frequency, the second frequency indication information is TRUE.

[0086] Optionally, the frequency level is set to PRC. It is understandable that the frequency level may also be set to other frequency levels, such as SSU-A. The following takes the frequency level being set to PRC as an example to introduce the technical solution of the present application.

[0087] When the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information is lower than the PRC, the second frequency indication information is FALSE; or, when the lower value of the frequency level indicated by the first frequency indication information and the frequency level represented by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is TRUE.

[0088] When the second frequency indication information is used to indicate the relationship between the frequency level indicated by the first frequency indication information and the lower frequency level among the frequency levels indicated by the first frequency level information and the set frequency level, the second frequency level information can be implemented using only 1 bit, which can adapt to the number of indication bits of the frequency traceable flag field in the announce message.

[0089] When the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is FALSE; or, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is lower than the PRC, the second frequency indication information is FALSE; or, when the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the first frequency level information is lower than the PRC, the second frequency indication information is FALSE; or, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is TRUE.

[0090] The first device also sends a second frequency level message to the fourth device, the second frequency level message including second frequency level information, the second frequency level information being used to indicate the frequency level of the clock of the first device. In this way, the fourth device can determine the master time device according to the second frequency indication information and the second frequency level information.

[0091] Combine the following Figure 1 The process of the first device sending the second time synchronization message carrying the second frequency indication information is illustrated by way of example.

[0092] For example, NE 3 is the first device, the time server 1 is the second device, NE 2 is the third device, and NE 4 is the fourth device. Among them, the first frequency indication information in the first time synchronization message sent by the time server 1 is TRUE, and the first frequency level information in the first frequency level message sent by NE 2 is SSU-A. The second frequency indication information in the second time synchronization message sent by NE 3 to NE 4 is FALSE.

[0093] For another example, NE 4 is the first device, NE 3 is the second device, NE 3 is also the third device, and NE 9 is the fourth device. Among them, the first frequency indication information sent by NE 3 is FALSE, and the first frequency level information in the first frequency level message sent by NE 3 is SSU-A. The second frequency indication information in the second time synchronization message sent by NE 4 to NE 9 is FALSE.

[0094] Next, the process of the first device performing time synchronization according to the frequency indication information in the time synchronization message in the embodiments of the present application will be described in detail. In the following text, one of device A and device B is the aforementioned first device, and the other is the aforementioned second device. Figures 4 to 8 The methods provided by the illustrated embodiments can all be executed by the target device, and the target device can be the first device or other devices other than the first device and the second device.

[0095] Figure 4 It is a schematic diagram of another method for time synchronization provided by the embodiments of the present application. As Figure 4 shown, the method includes the following steps:

[0096] 501: Compare the GM clock levels of device A and device B. If the GM clock level of device A is greater than the GM clock level of device B (i.e., A > B), then step 509 is executed; if the GM clock level of device A is equal to the GM clock level of device B (A = B), then step 502 is executed; if the GM clock level of device A is less than the GM clock level of device B (A < B), then step 510 is executed.

[0097] 502: Compare the GM clock accuracies of device A and device B. If the GM clock accuracy of device A is greater than the GM clock accuracy of device B (i.e., A > B), then step 509 is executed; if the GM clock accuracy of device A is equal to the GM clock accuracy of device B (i.e., A = B), then step 507 is executed; if the GM clock accuracy of device A is less than the GM clock accuracy of device B (i.e., A < B), then step 510 is executed.

[0098] 503: Compare the variance values ​​of the deviations of the GM clocks of device A and device B. If the variance value of the deviation of the GM clock of device A is greater than the variance value of the deviation of the GM clock of device B (i.e., A>B), execute step 509; if the variance value of the deviation of the GM clock of device A is equal to the variance value of the deviation of the GM clock of device B (i.e., A=B), execute step 504; if the variance value of the deviation of the GM clock of device A is less than the variance value of the deviation of the GM clock of device B (i.e., A<B), execute step 510.

[0099] Through the steps 501-503, it is possible to determine whether device B is the master time device of device A according to the time level information. When the time level information indicates that the time level of device B is lower than the time level of device A, device B is a candidate master time device of device A. It should be noted that if there is only one candidate master time device of device A, device B is the master time device of device A; if there are at least two candidate master time devices of device A, it is necessary to follow Figure 4 The process shown selects a candidate master time device with better quality as the master time device. When the time level information indicates that the time level of device B is higher than the time level of device A, device B is not the master time device of device A. When the time level information indicates that the time level of device B is equal to the time level of device A, step 504 is performed again, that is, determining whether device B is the master time device of device A based on the frequency indication information.

[0100] Here, the time level information includes the GM clock level, the GM clock accuracy, and the variance value of the deviation of the GM clock.

[0101] The time level information indicating that the time level of device B is lower than the time level of device A may mean that: the GM clock level of device B is greater than the GM clock level of device A; or, the GM clock level of device B is equal to the GM clock level of device A but the GM clock accuracy of device B is greater than the GM clock accuracy of device A; or, the GM clock level of device B is equal to the GM clock level of device A, the GM clock accuracy of device B is equal to the GM clock accuracy of device A, but the variance value of the deviation of the GM clock of device B is greater than the variance value of the deviation of the GM clock of device A.

[0102] The time level information indicating that the time level of device B is higher than the time level of device A may mean that: the GM clock level of device B is lower than the GM clock level of device A; or, the GM clock level of device B is equal to the GM clock level of device A but the GM clock accuracy of device B is lower than the GM clock accuracy of device A; or, the GM clock level of device B is equal to the GM clock level of device A, the GM clock accuracy of device B is equal to the GM clock accuracy of device A but the variance value of the deviation of the GM clock of device B is lower than the variance value of the deviation of the GM clock of device A.

[0103] The time level information indicating that the time level of device B is equal to the time level of device A may mean: the GM clock level of device B is equal to the GM clock level of device A, the GM clock accuracy of device B is equal to the GM clock accuracy of device A, and the variance value of the deviation of the GM clock of device B is equal to the variance value of the deviation of the GM clock of device A.

[0104] 504: Compare the frequency indication information of device A and device B. If the frequency indication information of device A is FALSE and the frequency indication information of device B is TRUE, execute step 509; if the frequency indication information of device A and the frequency indication information of device B are both TRUE or the frequency indication information of device A and device B are both FALSE, execute step 505. If the frequency indication information of device A is TRUE and the frequency indication information of device B is FALSE, execute step 510.

[0105] Here, the frequency indication information of device A is the third frequency indication information, which is the local frequency indication information of device A, or is carried in the third time synchronization message sent to device A by other network devices (such as the fifth device).

[0106] When the frequency indication information is TRUE, the frequency level indicated by the frequency indication information is higher than or equal to the PRC. Alternatively, when the frequency indication information is FALSE, the frequency level indicated by the frequency indication information is lower than the PRC.

[0107] When the frequency levels indicated by the frequency indication information of device A and the frequency indication information of device B are both lower than PRC, the frequency level difference has little impact on the performance of the time synchronization message output by the device, and other parameters can be compared at this time; similarly, when the frequency levels of device A and device B are both higher than or equal to PRC, the frequency level difference has little impact on the performance of the time synchronization message, and other parameters can be compared at this time. However, when the frequency level of one of device A and device B is higher than or equal to PRC and the frequency level of the other is lower than PRC, the frequency level difference has a greater impact on the performance of the time synchronization message output by the device. Therefore, it is necessary to give priority to selecting the device with better performance of the output time synchronization message as the master clock device, that is, select the device with a higher frequency level indicated by the frequency indication information as the master time device.

[0108] 505: Compare the priority 2 of the GM clock of device A and device B. If the priority 2 of the GM clock of device A is greater than the priority 2 of the GM clock of device B (i.e., A>B), execute step 509; if the priority 2 of the GM clock of device A is equal to the priority 2 of the GM clock of device B (i.e., A=B), execute step 506. If the priority 2 of the GM clock of device A is less than the priority 2 of the GM clock of device B (i.e., A<B), execute step 510.

[0109] 506: Compare the local priorities of device A and device B. If the local priority of device A is greater than the local priority of device B (A>B), execute step 509; if the local priority of device A is equal to the local priority of device B (A=B), execute step 507. If the local priority of device A is less than the local priority of device B (A<B), execute step 510.

[0110] The local priority of the device may be the local priority of the port that receives the time synchronization message.

[0111] 507: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of device A and device B are both less than or equal to 127, other parameters can be compared in the existing manner, which will not be described in detail here; if the clock level of device A or device B is greater than 127, execute 508.

[0112] 508: Compare the values ​​of the GM clock ID of device A and device B. If the value of the GM clock ID of device A is greater than the value of the GM clock ID of device B (i.e., A>B), execute step 509; if the value of the GM clock ID of device A is less than the value of the GM clock ID of device B (i.e., A<B), execute step 510. If the value of the GM clock ID of device A is equal to the value of the GM clock ID of device B (i.e., A=B), other parameters can be compared in the existing manner, which will not be described in detail here.

[0113] exist Figure 4 In the illustrated embodiment, the priority 2, local priority and GM clock ID of the GM clock of the device are all configuration information, which is information pre-configured and stored in the device.

[0114] Through steps 505 to 508, when the second comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, the first configuration information and the local configuration information of the first device are compared to obtain the third comparison result; and based on the third comparison result, it is determined whether the second device is the master time device of the first device.

[0115] 509: Device B is better than device A.

[0116] That is, a second comparison result indicating that the time performance of device B is better than the time performance of device A is obtained, so that it can be determined that device B can be a candidate master time device of device A.

[0117] 510: Device A is better than device B.

[0118] That is, the second comparison result is used to indicate that the time performance of device A is better than the time performance of device B, so that it can be determined that device B is not the master time device of device A.

[0119] It should be noted that Figure 4 The method shown can be regarded as an improvement of the A-BMCA algorithm defined in ITU G.8275.1, which adds comparison of frequency indication information on the basis of the A-BMCA algorithm defined in ITU G.8275.1. Since the influence of frequency accuracy on the performance of time synchronization message is considered during time synchronization, a path with better accuracy can be selected, thereby improving the time synchronization accuracy.

[0120] Combine the following Figure 1 The working principle of the method for time synchronization provided in the embodiment of the present application is described. Figure 1 As shown, the time signal source provided by time server 1 is sequentially transmitted to NE 9 through NE 3 and NE 4. The frequency signal source provided by frequency server 1 is sequentially transmitted to NE 9 through NE 1, NE 2, NE 3 and NE 4. The time signal source provided by time server 2 is sequentially transmitted to NE 9 through NE 7 and NE 8. The frequency signal source provided by frequency server 1 is sequentially transmitted to NE 9 through NE 5, NE6, NE 7 and NE 8.

[0121] Among them, time server 1 is in a normal state. In the time synchronization message output by time server 1, the GM clock level is 6, the frequency indication information is TRUE, and the frequency level indicated by the frequency indication information is PRC or higher than PRC. The frequency level of frequency server 1 is SSU-A. The frequency level information provided by frequency server 1 is transmitted to NE 3 through NE 1 and NE 2 in sequence, that is, the frequency level of the frequency level information received by NE 3 is SSU-A. Since the frequency level indicated by the frequency level information received by NE 3 is lower than PRC, it will affect the performance of the time synchronization message output by NE 3. In the time synchronization message output by NE 3, the GM clock level is 6, and the frequency indication information is FALSE, that is, the frequency indication information output by NE 3 is used to indicate the lower frequency level between the frequency level (SSU-A) indicated by the frequency level information received by NE 3 and the frequency level indicated by the frequency indication information. In this way, NE4 can promptly learn that the performance of the time synchronization message output by NE3 has declined. Since the frequency level information received by NE 4 indicates the frequency level is SSU-A, the local frequency indication information of NE 4 is FALSE, and the frequency indication information in the time synchronization message received by NE 4 is also FALSE. Therefore, the frequency indication information in the time synchronization message output by NE 4 is also FALSE. NE 9 receives and compares the time synchronization message sent by NE 4 with the time synchronization message sent by NE 8. Since the GM clock level in the time synchronization message sent by NE 4 is equal to the GM clock level in the time synchronization message sent by NE 8, the frequency indication information in the time synchronization message sent by NE 4 and the frequency indication information in the time synchronization message sent by NE8 are continued to be compared. Since the frequency indication information in the time synchronization message sent by NE4 is FALSE, and the frequency indication information in the time synchronization message sent by NE 8 is TRUE, it means that the performance of the time synchronization message sent by NE 8 is better than the performance of the time synchronization message sent by NE4. Therefore, NE 9 selects NE 8 as the master time device to track the time of NE 8.

[0122] Figure 5 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application. Figure 4 The difference between the embodiments shown is that the timing of comparing the frequency indication information is different. Figure 5 As shown, the method includes the following steps.

[0123] 601: Compare the GM clock levels of Device A and Device B. If the GM clock level of Device A is greater than that of Device B (i.e., A > B), then execute Step 609; if the GM clock level of Device A is equal to that of Device B (A = B), then execute Step 602; if the GM clock level of Device A is less than that of Device B (A < B), then execute Step 610.

[0124] 602: Compare the GM clock accuracies of Device A and Device B. If the GM clock accuracy of Device A is greater than that of Device B (i.e., A > B), then execute Step 609; if the GM clock accuracy of Device A is equal to that of Device B (i.e., A = B), then execute Step 607; if the GM clock accuracy of Device A is less than that of Device B (i.e., A < B), then execute Step 610.

[0125] 603: Compare the variance values of the deviations of the GM clocks of Device A and Device B. If the variance value of the deviation of the GM clock of Device A is greater than that of Device B (i.e., A > B), then execute Step 609; if the variance value of the deviation of the GM clock of Device A is equal to that of Device B (i.e., A = B), then execute Step 604; if the variance value of the deviation of the GM clock of Device A is less than that of Device B (i.e., A < B), then execute Step 610.

[0126] 604: Compare the second priority of the GM clocks of Device A and Device B. If the second priority of the GM clock of Device A is greater than that of Device B (i.e., A > B), then execute Step 609; if the second priority of the GM clock of Device A is equal to that of Device B (i.e., A = B), then execute Step 605. If the second priority of the GM clock of Device A is less than that of Device B (i.e., A < B), then execute Step 610.

[0127] 605: Compare the frequency indication information of Device A and Device B. If the frequency indication information of Device A is FALSE and that of Device B is TRUE, then execute Step 609; if the frequency indication information of both Device A and Device B is TRUE or the frequency indication information of both Device A and Device B is FALSE, then execute Step 606. If the frequency indication information of Device A is TRUE and that of Device B is FALSE, then execute Step 610.

[0128] For related content, refer to the aforementioned Step 504, which will not be elaborated here.

[0129] 606: Compare the local priorities of device A and device B. If the local priority of device A is greater than the local priority of device B (A>B), execute step 609; if the local priority of device A is equal to the local priority of device B (A=B), execute step 607. If the local priority of device A is less than the local priority of device B (A<B), execute step 610.

[0130] The local priority of the device may be the local priority of the port that receives the time synchronization message.

[0131] 607: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of device A and device B are both less than or equal to 127, other parameters can be compared in an existing manner, which will not be described in detail here; if the clock level of device A or device B is greater than 127, execute 608.

[0132] 608: Compare the values ​​of the GM clock ID of device A and device B. If the value of the GM clock ID of device A is greater than the value of the GM clock ID of device B (i.e., A>B), execute step 609; if the value of the GM clock ID of device A is less than the value of the GM clock ID of device B (i.e., A<B), execute step 610. If the value of the GM clock ID of device A is equal to the value of the GM clock ID of device B (i.e., A=B), other parameters can be compared in the existing manner, which will not be described in detail here.

[0133] 609: Device B is better than device A.

[0134] For related content, please refer to 509 and detailed description is omitted here.

[0135] 610: Device A is better than device B.

[0136] For related content, please refer to 510, and detailed description is omitted here.

[0137] It should be noted that Figure 5 The method shown can be regarded as an improvement of the A-BMCA algorithm defined in ITU G.8275.1, which adds comparison of frequency indication information on the basis of the A-BMCA algorithm defined in ITU G.8275.1. Since the influence of frequency accuracy on the performance of time synchronization message is considered during time synchronization, a path with better accuracy can be selected, thereby improving the time synchronization accuracy.

[0138] Figure 5In the illustrated embodiment, both the local priority and the GM clock ID belong to the configuration information. Through steps 606 to 608, when the second comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, the first configuration information is compared with the local configuration information of the first device to obtain a third comparison result; and based on the third comparison result, it is determined whether the second device is the master time device of the first device.

[0139] Figure 6 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application. Different from Figure 4 the illustrated embodiment in the timing of comparing the frequency indication information. As Figure 6 shown, the method includes the following steps.

[0140] 701: Compare the GM clock levels of device A and device B. If the GM clock level of device A is greater than the GM clock level of device B (i.e., A > B), then perform step 709; if the GM clock level of device A is equal to the GM clock level of device B (A = B), then perform step 702; if the GM clock level of device A is less than the GM clock level of device B (A < B), then perform step 710.

[0141] 702: Compare the GM clock precisions of device A and device B. If the GM clock precision of device A is greater than the GM clock precision of device B (i.e., A > B), then perform step 709; if the GM clock precision of device A is equal to the GM clock precision of device B (i.e., A = B), then perform step 707; if the GM clock precision of device A is less than the GM clock precision of device B (i.e., A < B), then perform step 710.

[0142] 703: Compare the variance values of the deviations of the GM clocks of device A and device B. If the variance value of the deviation of the GM clock of device A is greater than the variance value of the deviation of the GM clock of device B (i.e., A > B), then perform step 709; if the variance value of the deviation of the GM clock of device A is equal to the variance value of the deviation of the GM clock of device B (i.e., A = B), then perform step 704; if the variance value of the deviation of the GM clock of device A is less than the variance value of the deviation of the GM clock of device B (i.e., A < B), then perform step 710.

[0143] 704: Compare the priority 2 of the GM clock of device A and device B. If the priority 2 of the GM clock of device A is greater than the priority 2 of the GM clock of device B (i.e., A>B), execute step 709; if the priority 2 of the GM clock of device A is equal to the priority 2 of the GM clock of device B (i.e., A=B), execute step 705. If the priority 2 of the GM clock of device A is less than the priority 2 of the GM clock of device B (i.e., A<B), execute step 710.

[0144] 705: Compare the local priorities of device A and device B. If the local priority of device A is greater than the local priority of device B (A>B), execute step 709; if the local priority of device A is equal to the local priority of device B (A=B), execute step 706. If the local priority of device A is less than the local priority of device B (A<B), execute step 710.

[0145] The local priority of the device may be the local priority of the port that receives the time synchronization message.

[0146] 706: Compare the frequency indication information of device A and device B. If the frequency indication information of device A is FALSE and the frequency indication information of device B is TRUE, execute step 709; if the frequency indication information of device A and the frequency indication information of device B are both TRUE or the frequency indication information of device A and device B are both FALSE, execute step 707. If the frequency indication information of device A is TRUE and the frequency indication information of device B is FALSE, execute step 710.

[0147] For related content, please refer to the aforementioned step 504, which will not be repeated here.

[0148] 707: Determine whether the GM clock levels of device A and device B are less than or equal to 127. If the GM clock levels of device A and device B are both less than or equal to 127, other parameters can be compared in the existing manner, which will not be described in detail here; if the GM clock level of device A or device B is greater than 127, execute 708.

[0149] 708: Compare the values ​​of the GM clock ID of device A and device B. If the value of the GM clock ID of device A is greater than the value of the GM clock ID of device B (i.e., A>B), execute step 709; if the value of the GM clock ID of device A is less than the value of the GM clock ID of device B (i.e., A<B), execute step 710. If the value of the GM clock ID of device A is equal to the value of the GM clock ID of device B (i.e., A=B), other parameters can be compared in the existing manner, which will not be described in detail here.

[0150] 709: Device B is better than device A.

[0151] For related content, please refer to 509 and detailed description is omitted here.

[0152] 710: Device A is better than device B.

[0153] For related content, please refer to 510, and detailed description is omitted here.

[0154] It should be noted that Figure 6 The method shown can be regarded as an improvement of the A-BMCA algorithm defined in ITU G.8275.1, which adds comparison of frequency indication information on the basis of the A-BMCA algorithm defined in ITU G.8275.1. Since the influence of frequency accuracy on the performance of time synchronization message is considered during time synchronization, a path with better accuracy can be selected, thereby improving the time synchronization accuracy.

[0155] Figure 6 In the illustrated embodiment, both the local priority and the GM clock ID belong to the configuration information. Through the steps 707 to 708, when the second comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, the first configuration information is compared with the local configuration information of the first device to obtain the third comparison result; and according to the third comparison result, it is determined whether the second device is the master time device of the first device.

[0156] Figure 7 FIG. 1 is a schematic diagram of a method for time synchronization according to another embodiment of the present application. Figure 4 The difference between the shown embodiments is that Figure 7 In the embodiment shown, it is first determined whether the GM clock levels of device A and device B are both outside the hold state, and a method for determining the master time device is selected based on the determination result. Figure 7 As shown, the method comprises the following steps:

[0157] 800: Determine whether the GM clock levels of device A and device B are both outside the hold. If the GM clock level of at least one of device A and device B is not outside the hold, execute Figure 4 501-510 of , or, Figure 5 601-610 in the Figure 6 701-710 in; if the GM clock levels of device A and device B are both outside the hold, execute step 801.

[0158] The GM clock level of the device is out of hold, which means that the GM device tracked by the device has lost the time signal source and the time performance is unavailable. The device is not out of hold, which includes any of the following situations: the GM device tracked by the device has not lost the time signal source, or the GM device tracked by the device has lost the time signal source, but the time performance is still available (that is, the GM clock level of the device is in hold).

[0159] Optionally, it can be determined whether device A is out of hold according to the GM clock level of device A. For example, when the GM clock level of device A is greater than 135, it indicates that the GM clock level of device A is out of hold. For another example, when the GM clock level of device A is equal to any parameter in a parameter value set, it indicates that the GM clock level of device A is out of hold. The parameter value set may be {140, 150, 160, 165}.

[0160] Similarly, it can be determined whether device B is out of hold according to the GM clock level of device B. For example, when the GM clock level of device B is greater than 135, it indicates that the GM clock level of device B is out of hold. For another example, when the GM clock level of device B is equal to any parameter in the parameter value set, it indicates that the GM clock level of device A is out of hold. The parameter value set can be {140, 150, 160, 165}.

[0161] Among them, the GM clock level is equal to 140, which means that the time source is lost, the time performance is unavailable, and the physical layer signal frequency is a first-level clock (the corresponding quality level is enhanced protected real time clock (ePRTC), protected real time clock (PRTC), ePRC or PRC); the GM clock level is equal to 150, which means that the time source is lost, the time performance is unavailable, and the physical layer signal frequency is a second-level clock (the corresponding quality level is SSU-A); the GM clock level is equal to 160, which means that the time source is lost, the time performance is unavailable, and the physical layer signal frequency is a third-level clock (the corresponding quality level is SSU-A); the GM clock level is equal to 165, which means that the time source is lost, the time performance is unavailable, and the physical layer signal frequency is inferior to the third-level clock.

[0162] 801: Compare the frequency indication information of device A and device B. If the frequency indication information of device A is FALSE and the frequency indication information of device B is TRUE, execute step 809; if the frequency indication information of device A and the frequency indication information of device B are both TRUE or the frequency indication information of device A and device B are both FALSE, execute step 802. If the frequency indication information of device A is TRUE and the frequency indication information of device B is FALSE, execute step 810.

[0163] For related content, refer to the aforementioned step 504, which will not be elaborated here.

[0164] 802: Compare the GM clock levels of Device A and Device B. If the GM clock level of Device A is greater than that of Device B (i.e., A > B), then execute step 809; if the GM clock level of Device A is equal to that of Device B (A = B), then execute step 803; if the GM clock level of Device A is less than that of Device B (A < B), then execute step 810.

[0165] 803: Compare the GM clock precisions of Device A and Device B. If the GM clock precision of Device A is greater than that of Device B (i.e., A > B), then execute step 809; if the GM clock precision of Device A is equal to that of Device B (i.e., A = B), then execute step 804; if the GM clock precision of Device A is less than that of Device B (i.e., A < B), then execute step 810.

[0166] 804: Compare the variance values of the deviations of the GM clocks of Device A and Device B. If the variance value of the deviation of the GM clock of Device A is greater than that of Device B (i.e., A > B), then execute step 809; if the variance value of the deviation of the GM clock of Device A is equal to that of Device B (i.e., A = B), then execute step 805; if the variance value of the deviation of the GM clock of Device A is less than that of Device B (i.e., A < B), then execute step 810.

[0167] 805: Compare the second priorities of the GM clocks of Device A and Device B. If the second priority of the GM clock of Device A is greater than that of Device B (i.e., A > B), then execute step 809; if the second priority of the GM clock of Device A is equal to that of Device B (i.e., A = B), then execute step 806. If the second priority of the GM clock of Device A is less than that of Device B (i.e., A < B), then execute step 810.

[0168] 806: Compare the local priorities of Device A and Device B. If the local priority of Device A is greater than that of Device B (i.e., A > B), then execute step 809; if the local priority of Device A is equal to that of Device B (i.e., A = B), then execute step 807. If the local priority of Device A is less than that of Device B (i.e., A < B), then execute step 810.

[0169] Among them, the local priority of the device can be the local priority of the port that receives the time synchronization message.

[0170] 807: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of device A and device B are both less than or equal to 127, other parameters can be compared in the existing manner, which will not be described in detail here; if the clock level of device A or device B is greater than 127, execute 808.

[0171] 808: Compare the values ​​of the GM clock ID of device A and device B. If the value of the GM clock ID of device A is greater than the value of the GM clock ID of device B (i.e., A>B), execute step 809; if the value of the GM clock ID of device A is less than the value of the GM clock ID of device B (i.e., A<B), execute step 810. If the value of the GM clock ID of device A is equal to the value of the GM clock ID of device B (i.e., A=B), other parameters can be compared in the existing manner, which will not be described in detail here.

[0172] 809: Device B is better than device A.

[0173] For related content, please refer to 509 and detailed description is omitted here.

[0174] 810: Device A is better than device B.

[0175] For related content, please refer to 510, and detailed description is omitted here.

[0176] When the GM clock levels of device A and device B are both out of hold, it is possible that the frequency level indicated by the frequency indication information sent by one device is lower than the frequency level indicated by the frequency indication information sent by another device, but the time level of the device is higher than the time level of the other device. First determine whether the GM clock levels of device A and device B are both out of hold. When the GM clock levels of device A and device B are both out of hold, first compare the frequency indication information of device A and device B, and give priority to selecting the device with a higher frequency level indicated by the sent frequency indication information as the main time device, which is conducive to improving the time transfer performance of the system.

[0177] For example, Figure 8As shown, the time synchronization message is transmitted step by step between the three network devices NE A, NE B and NE C. When the three network devices have not lost the time signal source, the GM clock level of NE A is 6 and the frequency level is PRC; the GM clock level of NE B is 248 and the frequency level is PRC; the GM clock level of NE C is 248 and the frequency level is PRC. When the link between NE A and NE B fails (for example, it is interrupted), NE B and NE C both lose the time signal source, and the local GM clock level of NE B is 165 and the local frequency level is SSU-A; the local GM clock level of NE C is 248 and the local frequency level is PRC. At this time, the time level of NE C is lower than the time level of NE B, but the local frequency level of NE C is higher than the local frequency level of NE B. Since the time retention performance maintained by NE C using the PRC frequency is better than the time retention performance maintained by NE B using the SSU-A frequency, at this time, in order to obtain better time performance, NE B should track the time of NE C. And through Figure 8 The process shown allows NEB to track NEC's time.

[0178] It should be noted that in Figure 8 In the illustrated embodiment, the relationship between the frequency indication information indicating the frequency level and the set frequency level (e.g., PRC) is used as an example for explanation. In other embodiments, the frequency indication information may also be frequency level information, which is the lower value of the frequency level indicated by the frequency indication information in the received time synchronization message and the frequency level indicated by the frequency level information in the received frequency level message.

[0179] Optionally, Figures 4 to 8 In the process shown, the frequency indication information of device A can be the local frequency indication information of device A, or the frequency indication information in the time synchronization message sent by other devices to device A. Generally, the network device compares the information in all received time synchronization messages and the local information of the network device, and selects the time device with the best quality for time synchronization.

[0180] When the frequency indication information of device A is the frequency indication information in the time synchronization message sent by other devices to device A, Figure 8 The illustrated embodiment is performed by a network device other than the device A and the device B (eg, the aforementioned fifth device).

[0181] Still Figure 1For example, NE 4 is device A and is the aforementioned target device, NE 3 is device B, NE 4 compares the local frequency indication information of NE 4 with the frequency indication information in the time synchronization message sent by NE 3, and determines whether NE 3 is the master time device of NE 4 according to the comparison result. For another example, NE 9 is the target device, NE 4 is device A, NE 8 is device B, NE9 compares the frequency indication information in the time synchronization message sent by NE 4 with the frequency indication information in the time synchronization message sent by NE 8, and determines whether NE 4 is the master time device of NE 9 according to the comparison result.

[0182] Fig. 9 1 is a block diagram of a device for time synchronization provided by an embodiment of the present application. The device can be implemented as all or part of a first device through software, hardware, or a combination of both. The device 900 may include: a receiving unit 901 and a sending unit 902.

[0183] The receiving unit 901 is used to receive a first time synchronization message sent by a second device, including first frequency indication information; and receive a first frequency level message sent by a third device, including first frequency level information, wherein the first frequency level information is used to indicate the frequency level of the clock of the third device. The sending unit 902 is used to send a second time synchronization message to a fourth device according to the first frequency indication information and the first frequency level information, wherein the second time synchronization message includes second frequency indication information.

[0184] Optionally, both the first time synchronization message and the second time synchronization message are notification messages, and both the first frequency indication information and the second frequency indication information are carried in a frequency tracking flag field of the notification message.

[0185] Optionally, the first frequency level message is SSM.

[0186] Optionally, the second frequency indication information is determined by a lower value of a frequency level indicated by the first frequency indication information and a frequency level indicated by the first frequency level information.

[0187] Optionally, the device also includes: a determination unit 903, which is used to determine whether the second device is the master time device of the first device in response to determining that the GM clock levels of the first device and the second device are both out of maintenance, according to the first frequency indication information and the third frequency indication information, and the third frequency indication information is the local frequency indication information of the first device; or, in response to determining that the GM clock levels of the fifth device and the second device are both out of maintenance, determine whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information, and the third frequency indication information is carried in the third time synchronization message sent by the fifth device to the first device.

[0188] Optionally, the determining unit 903 includes:

[0189] A comparing subunit 9031 is configured to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result;

[0190] The determination subunit 9032 is used to determine whether the second device is the master time device of the first device according to the first comparison result.

[0191] Optionally, the comparing subunit 9031 is configured to obtain the first comparison result in the following manner:

[0192] When the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the timing performance of the second device is better than the timing performance of the device corresponding to the third frequency indication information; or, when the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the timing performance of the device corresponding to the third frequency indication information is better than the timing performance of the second device; or, when the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to the PRC, or the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than the PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the second frequency indication information.

[0193] Optionally, the determining subunit 9032 is configured to determine that the second device is a candidate master time device of the first device when the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or

[0194] When the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device, determining that the second device is not the master time device of the first device; or

[0195] When the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the second frequency indication information, it is determined whether the second device is the master time device of the first device based on the time level information of the first device and the time level information of the second device.

[0196] Fig.10 1000 is a block diagram of a device for time synchronization provided by an embodiment of the present application. The device can be implemented as all or part of a first device through software, hardware, or a combination of both. The device 1000 may include: a receiving unit 1001 and a determining unit 1002.

[0197] The receiving unit 1001 is used to receive a first time synchronization message sent by a second device, and the first time synchronization message includes first frequency indication information. The determining unit 1002 is used to determine whether the second device is the master time device of the target device according to the first frequency indication information and the third frequency indication information in response to determining that the highest level GM clock level of the first device and the highest level GM clock level of the second device are both maintained. The target device is the first device, and the third frequency indication information is the local frequency indication information of the first device; or the target device is a device other than the first device and the second device, and the third frequency indication information is carried in the second time synchronization message sent by the first device.

[0198] Optionally, the determination unit 1002 includes: a comparison subunit 10021 and a determination subunit 10022. The comparison subunit 10021 is used to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result; the determination subunit 10022 is used to determine whether the second device is the master time device of the target device according to the first comparison result.

[0199] In a possible implementation manner, the first frequency indication information and the third frequency indication information are both used to indicate a relationship between a frequency level and a set frequency level. For example, the set frequency level is PRC.

[0200] When the first frequency indication information is TRUE, the frequency level indicated by the first frequency indication information is higher than or equal to the PRC. Alternatively, when the first frequency indication information is FALSE, the frequency level indicated by the first frequency indication information is lower than the PRC.

[0201] When the third frequency indication information is TRUE, the frequency level indicated by the third frequency indication information is higher than or equal to the PRC. Alternatively, when the third frequency indication information is FALSE, the frequency level indicated by the third frequency indication information is lower than the PRC.

[0202] Correspondingly, the comparison subunit 10021 is used to, when the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the timing performance of the second device is better than the timing performance of the device corresponding to the third frequency indication information; or, when the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the timing performance of the device corresponding to the third frequency indication information is better than the timing performance of the second device; or, when the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to the PRC, or the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than the PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information.

[0203] It should be noted that the device for time synchronization provided in the above embodiment only uses the division of the above functional units as an example when performing time synchronization. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. In addition, the device for time synchronization provided in the above embodiment and the method embodiment for time synchronization belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0204] The descriptions of the processes corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.

[0205] Fig.11 1 is a schematic diagram of the structure of a network device 1100 provided in an embodiment of the present application. Fig.11 As shown, the network device 1100 includes at least one processor 1101 , a memory 1102 , and at least one network interface 1103 .

[0206] Optionally, the network device 1100 is a single physical computer. Alternatively, the network device 1100 includes multiple physical computers, and at least one processor 1101, a memory 1102, and at least one network interface 1103 of the network device 1100 are distributed on different physical computers. For example, the network device 1100 is a cluster computer.

[0207] The processor 1101 is, for example, a general-purpose central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the scheme of the present application. For example, the processor 1101 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0208] The memory 1102 is, for example, a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. Optionally, the memory 1102 exists independently and is connected to the processor 1101 through an internal connection 1104. Alternatively, the memory 1102 and the processor 1101 are optionally integrated together.

[0209] The network interface 1103 uses any transceiver-like device for communicating with other devices or communication networks. The network interface 1103 includes, for example, at least one of a wired network interface or a wireless network interface. The wired network interface is, for example, an Ethernet interface. The Ethernet interface is, for example, an optical interface, an electrical interface, or a combination thereof. The wireless network interface is, for example, a wireless local area network (WLAN) interface, a cellular network interface, or a combination thereof.

[0210] In some embodiments, the processor 1101 includes one or more CPUs, such as Fig.11 CPU0 and CPU1 are shown in the figure.

[0211] In some embodiments, the network device 1100 optionally includes multiple processors, such as Fig.11 1 and 1105. Each of these processors is, for example, a single-core processor (single-CPU), or a multi-core processor (multi-CPU). The processor here optionally refers to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0212] In some embodiments, the network device 1100 further includes an internal connection 1104. The processor 1101, the memory 1102, and the at least one network interface 1103 are connected via the internal connection 1104. The internal connection 1104 includes a path to transmit information between the above components. Optionally, the internal connection 1104 is a single board or a bus. Optionally, the internal connection 1104 is divided into an address bus, a data bus, a control bus, etc.

[0213] In some embodiments, the network device 1100 further includes an input / output interface 1106. The input / output interface 1106 is connected to the internal connection 1104.

[0214] In some embodiments, the input / output interface 1106 is used to connect to an input device to receive commands or data related to the above method embodiments input by a user through an input device, such as the aforementioned clock priority 2, local priority, etc. The input device includes but is not limited to a keyboard, a touch screen, a microphone, a mouse, or a sensor device, etc.

[0215] Optionally, the processor 1101 implements the method in the above embodiment by reading the program code 1110 stored in the memory 1102, or the processor 1101 implements the method in the above embodiment by the program code stored internally. In the case where the processor 1101 implements the method in the above embodiment by reading the program code 1110 stored in the memory 1102, the memory 1102 stores the program code for implementing the method provided in the embodiment of the present application.

[0216] For more details on how the processor 1101 implements the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here.

[0217] In some embodiments, a computer-readable storage medium is also provided, which stores computer instructions. When the computer instructions stored in the computer-readable storage medium are executed by a network device, the network device executes the method for time synchronization provided above.

[0218] In some embodiments, a computer program product is also provided, which includes one or more computer program instructions. When the computer program instructions are loaded and executed by a computer, the computer executes the method for time synchronization provided by the above method embodiment.

[0219] In some embodiments, a chip is also provided, including a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method for time synchronization provided by the above method embodiment.

[0220] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meanings understood by persons of ordinary skill in the field to which this application belongs. The words "first", "second", "third" and similar terms used in the patent application specification and claims of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one" or "one" do not indicate a quantitative limitation, but rather indicate the presence of at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before "include" or "comprises" include the elements or objects listed after "include" or "comprises" and their equivalents, and do not exclude other elements or objects. A and / or B means that there are three situations: A; B; and A and B.

[0221] The above is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for time synchronization, characterized in that: The method comprises: The first device receives a first time synchronization message sent by the second device, where the first time synchronization message includes first frequency indication information; receiving a first frequency level message sent by a third device, where the first frequency level message includes first frequency level information, where the first frequency level information is used to indicate a frequency level of a clock of the third device; A second time synchronization message is sent to a fourth device according to the first frequency indication information and the first frequency level information, where the second time synchronization message includes second frequency indication information.

2. The method according to claim 1, characterized in that: The first time synchronization message and the second time synchronization message are both notification messages, and the first frequency indication information and the second frequency indication information are both carried in a frequency tracking flag field of the notification message.

3. The method according to claim 1 or 2, characterized in that: The first frequency level message is a synchronization status message SSM.

4. The method according to any one of claims 1 to 3, characterized in that: The second frequency indication information is determined by a lower value of a frequency level indicated by the first frequency indication information and a frequency level indicated by the first frequency level information.

5. The method according to claim 4, characterized in that When the frequency level indicated by the first frequency indication information is lower than the reference clock PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is false FALSE; Or, when the frequency level indicated by the first frequency indication information is equal to or higher than the reference clock PRC, and the frequency level indicated by the first frequency level information is lower than the PRC, the second frequency indication information is false FALSE; Alternatively, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is true TRUE.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to determining that the GM clock levels of the first device and the second device are both out of maintenance, determining whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information, the third frequency indication information being the local frequency indication information of the first device, or, In response to determining that the GM clock levels of the fifth device and the second device are both maintained, determine whether the second device is the master time device of the first device according to the first frequency indication information and the third frequency indication information, and the third frequency indication information is carried in the third time synchronization message sent by the fifth device to the first device.

7. The method according to claim 6, characterized in that The determining, according to the first frequency indication information and the third frequency indication information, whether the second device is the master time device of the first device includes: comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result; According to the first comparison result, it is determined whether the second device is the master time device of the first device.

8. The method according to claim 7, characterized in that The comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result includes: When the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or, When the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device; or, When the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to the PRC, or when the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than the PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information.

9. The method according to claim 8, characterized in that The determining, according to the first comparison result, whether the second device is the master time device of the first device includes: When the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information, determining that the second device is a candidate master time device of the first device; or When the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device, determining that the second device is not the master time device of the first device; or When the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, determine whether the second device is the master time device of the first device according to the time level information of the first device and the time level information of the second device.

10. A method for time synchronization, characterized in that: The method comprises: The target device receives a first time synchronization message sent by the second device, where the first time synchronization message includes first frequency indication information; In response to determining that the highest level GM clock level of the first device and the highest level GM clock level of the second device are both out of maintenance, the target device determines whether the second device is the master time device of the target device according to the first frequency indication information and the third frequency indication information; The target device is the first device, and the third frequency indication information is the local frequency indication information of the first device; or, the target device is a device other than the first device and the second device, and the third frequency indication information is carried in the second time synchronization message sent by the first device.

11. The method according to claim 10, characterized in that: The determining, according to the first frequency indication information and the third frequency indication information, whether the second device is the master time device of the first device includes: comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result; According to the first comparison result, it is determined whether the second device is the master time device of the target device.

12. The method according to claim 11, characterized in that The method further includes: comparing the first frequency indication information and the third frequency indication information to obtain a first comparison result, including: When the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or, When the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device; or, When the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to the PRC, or when the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than the PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information.

13. A device for time synchronization, characterized in that: The device comprises: A receiving unit, configured to receive a first time synchronization message sent by a second device, including first frequency indication information; and receive a first frequency level message sent by a third device, including first frequency level information, wherein the first frequency level information is used to indicate a frequency level of a clock of the third device; A sending unit is used to send a second time synchronization message to a fourth device according to the first frequency indication information and the first frequency level information, wherein the second time synchronization message includes the second frequency indication information.

14. The device according to claim 13, characterized in that The first time synchronization message and the second time synchronization message are both notification messages, and the first frequency indication information and the second frequency indication information are both carried in a frequency tracking flag field of the notification message.

15. The device according to claim 13 or 14, characterized in that The first frequency level message is a synchronization status message SSM.

16. The device according to any one of claims 13 to 15, characterized in that The second frequency indication information is determined by a lower value of a frequency level indicated by the first frequency indication information and a frequency level indicated by the first frequency level information.

17. The device according to claim 16, characterized in that When the frequency level indicated by the first frequency indication information is lower than the reference clock PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is false FALSE; Or, when the frequency level indicated by the first frequency indication information is equal to or higher than the reference clock PRC, and the frequency level indicated by the first frequency level information is lower than the PRC, the second frequency indication information is false FALSE; Alternatively, when the frequency level indicated by the first frequency indication information is equal to or higher than the PRC, and the frequency level indicated by the first frequency level information is equal to or higher than the PRC, the second frequency indication information is true TRUE.

18. The device according to any one of claims 13 to 17, characterized in that The device also includes: A determination unit is used to determine whether the second device is the master time device of the first device in response to determining that the GM clock levels of the first device and the second device are both out of maintenance, according to the first frequency indication information and the third frequency indication information, wherein the third frequency indication information is the local frequency indication information of the first device, or, in response to determining that the GM clock levels of the fifth device and the second device are both out of maintenance, determine whether the second device is the master time device of the first device in response to determining that the GM clock levels of the fifth device and the second device are both out of maintenance, according to the first frequency indication information and the third frequency indication information, wherein the third frequency indication information is carried in a third time synchronization message sent by the fifth device to the first device.

19. The device according to claim 18, characterized in that The determining unit comprises: a comparing subunit, configured to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result; A determination subunit is used to determine whether the second device is the master time device of the first device according to the first comparison result.

20. The device according to claim 19, characterized in that The comparison subunit is configured to obtain the first comparison result in the following manner: When the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or, When the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device; or, When the frequency levels indicated by the first frequency indication information and the third frequency indication information are both higher than or equal to PRC, or the frequency levels of the clocks indicated by the first frequency indication information and the third frequency indication information are both lower than PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the second frequency indication information.

21. The device according to claim 20, characterized in that The determining subunit is configured to determine that the second device is a candidate master time device for the first device when the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or When the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device, determining that the second device is not the master time device of the first device; or When the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information, determine whether the second device is the master time device of the first device according to the time level information of the first device and the time level information of the second device.

22. A device for time synchronization, characterized in that: include: A receiving unit, configured to receive a first time synchronization message sent by a second device, wherein the first time synchronization message includes first frequency indication information; A determining unit, configured to determine, in response to determining that the highest level GM clock level of the first device and the highest level GM clock level of the second device are both out of maintenance, whether the second device is a master time device of the target device according to the first frequency indication information and the third frequency indication information; The target device is the first device, and the third frequency indication information is the local frequency indication information of the first device; or, the target device is a device other than the first device and the second device, and the third frequency indication information is carried in the second time synchronization message sent by the first device.

23. The device according to claim 22, characterized in that The determining unit comprises: a comparing subunit, configured to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result; A determination subunit is used to determine whether the second device is the master time device of the target device according to the first comparison result.

24. The device according to claim 23, characterized in that The comparison subunit is used to When the frequency level indicated by the first frequency indication information is higher than or equal to the PRC, and the frequency level indicated by the third frequency indication information is lower than the PRC, the first comparison result indicates that the time performance of the second device is better than the time performance of the device corresponding to the third frequency indication information; or, When the frequency level indicated by the first frequency indication information is lower than the PRC, and the frequency level indicated by the third frequency indication information is higher than or equal to the PRC, the first comparison result indicates that the time performance of the device corresponding to the third frequency indication information is better than the time performance of the second device; or, When the frequency levels indicated by both the first frequency indication information and the third frequency indication information are higher than or equal to the PRC, or when the frequency levels of the clocks indicated by both the first frequency indication information and the third frequency indication information are lower than the PRC, the first comparison result indicates that the frequency level indicated by the first frequency indication information is equal to the frequency level indicated by the third frequency indication information.

25. A network device, characterized in that: The network device includes a processor and a memory, the memory is used to store a software program, and the processor runs or executes the software program stored in the memory so that the network device implements the method according to any one of claims 1 to 9, or implements the method according to any one of claims 10 to 12.

26. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes executed by a processor, wherein the program codes include instructions for implementing the method according to any one of claims 1 to 9, or implementing the method according to any one of claims 10 to 12.