Time synchronization method and apparatus, network device, and medium
By using the second frequency indication information in the second time synchronization message in the communication network to reflect the changes in the first frequency indication information and the first frequency level information, the problem of degradation of the time synchronization performance caused by the deterioration of the frequency server frequency level is solved, and a higher quality time signal source selection and more stable time synchronization performance are achieved.
Patent Information
- Application Number
- PCT/CN2024/116288
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-14
- Filing Date
- 2024-09-02
- Publication Date
- 2025-03-20
AI Technical Summary
In a communication network, when the network device selects a time signal source, the time synchronization performance decreases due to the deterioration of the frequency level of the frequency server, which affects the time synchronization performance of the system.
By receiving the first frequency indication information in the first time synchronization message and the first frequency level information in the first frequency level message, the first device sends a second time synchronization message to the fourth device, including the second frequency indication information to reflect the changes in the first frequency indication information and the first frequency level information, thereby helping the fourth device to select a higher quality time signal source.
The quality of network equipment selection time signal source is improved, ensuring the stability and efficiency of time synchronization performance.
Smart Images

Figure CN2024116288_20032025_PF_FP_ABST
Abstract
Description
Method and apparatus for time synchronization, network equipment, and medium
[0001] This application claims priority to Chinese patent application No. 202311190553.3, filed on September 14, 2023, entitled “Method and apparatus, network equipment and medium for time synchronization”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a method and apparatus for time synchronization, network equipment, and medium. Background Art
[0003] In a communications network, each network device has its own clock. To meet the needs of communication service delivery, the clocks of each network device need to be synchronized. A communications network typically includes a frequency server, a time server, and multiple network devices. The frequency server provides a frequency signal source, while the time server provides a time signal source. The frequency signal source provided by the frequency server is transmitted to each network device in a step-by-step manner, and the time signal source provided by the time server is transmitted to each network device in a step-by-step manner, thus achieving clock synchronization between each network device.
[0004] In related art, a method for achieving clock synchronization between a first device and a second device includes: the first device receiving a first time synchronization message sent by the second device, the first time synchronization message including first time level information indicating the time level of a first time server tracked by the second device; and the first device determining whether the second device is its master time device based on the first time level information.
[0005] 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 status, 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 be reduced. However, since the first device selects the time signal source based on 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.
[0006] Summary of the Invention
[0007] 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.
[0008] In a first aspect, the present application provides a method for time synchronization. The method includes: a first device receiving a first time synchronization message sent by a second device, the first time synchronization message including first frequency indication information; receiving a first frequency level message sent by a third device, the first frequency level message including first frequency level information, the first frequency level information being used to indicate the frequency level of a clock of the third device; and sending a second time synchronization message to a fourth device based on the first frequency indication information and the first frequency level information, the second time synchronization message including second frequency indication information.
[0009] 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.
[0010] 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, and a router.
[0011] 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.
[0012] The frequency traceable flag field is an existing field in the announce message. The frequency traceable flag field carries the first frequency indication information, and there is no need to modify the announce message format, which is simple to implement.
[0013] Optionally, the first frequency level message is a synchronization status message (sync status message, SSM).
[0014] 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 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.
[0015] In one possible embodiment, 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.
[0016] 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.
[0017] When the frequency level is set to PRC, the second frequency indication information may be determined in the following three situations:
[0018] 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);
[0019] 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;
[0020] 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).
[0021] Optionally, the method further includes: in response to determining that the 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 based on 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 hold, 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, wherein the third frequency indication information is carried in a 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 its time signal source and its time performance is unavailable.
[0022] When the GM clock levels of the first device and the second device are both outside the hold, or when the GM clock levels of the fifth device and the second device are both outside the 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.
[0023] 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.
[0024] 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 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; second, 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; 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 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. 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.
[0025] 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:
[0026] Mode 1: When 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, determining that the second device is a candidate master time device for the first device;
[0027] 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;
[0028] 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.
[0029] 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 based on the first frequency indication information and the third frequency indication information. Here, being in hold means that the device has lost its time signal source but its time performance is still available.
[0030] In this case, 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 second comparison result; and secondly, determining whether the second device is the master time device of the first device based on the second comparison result. The process for generating the second comparison result is the same as the process for generating the first comparison result.
[0031] 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:
[0032] 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;
[0033] 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;
[0034] Mode 3: The first time synchronization message further 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 an identity identifier of the second device's highest-level master clock.
[0035] 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 and 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.
[0036] In this embodiment, when the frequency levels indicated by the first frequency indication information and the third frequency indication information are both lower than the PRC, the frequency level difference has little impact on the performance of the time synchronization message, and at this time, it is necessary to continue to compare other parameters; 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 the PRC, the frequency level difference has little impact on the performance of the time synchronization message, and at this time, it is necessary to continue to compare other parameters. 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 the PRC and the other is lower than the 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. Therefore, it is necessary to give priority to selecting the device corresponding to the higher frequency level as the master time device.
[0037] In the second aspect, the present application provides a method for time synchronization. The method includes: the target device receives a first time synchronization message sent by the second device, the first time synchronization message includes first frequency indication information; the target device responds 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, and 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 and received by the target device.
[0038] In a possible implementation, 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.
[0039] 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.
[0040] 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.
[0041] In another possible implementation manner, the first frequency indication information and the third frequency indication information are both frequency level information.
[0042] 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.
[0043] 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 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 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.
[0044] In a third aspect, the present application provides an apparatus for time synchronization. The apparatus for time synchronization has the function of implementing the method described in the first aspect or any optional embodiment 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.
[0045] In a fourth aspect, the present application provides an apparatus for time synchronization. The apparatus for time synchronization has the function of implementing the method described in the second aspect or any optional embodiment 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.
[0046] 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 of the first aspect or any possible implementation of the first aspect, or implements the method of the second aspect or any possible implementation of the second aspect, by running or executing the software programs and / or modules stored in the memory.
[0047] Optionally, there are one or more processors and one or more memories.
[0048] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0049] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0050] In a sixth aspect, a computer program product is provided. The computer program product includes computer program code, which, when executed by a computer, causes the computer to perform the method of the first aspect or any possible implementation of the first aspect, or the method of the second aspect or any possible implementation of the second aspect.
[0051] In the seventh aspect, the present application provides a computer-readable storage medium, which is used to store program codes executed by a processor, wherein the program codes include instructions for implementing the method in any possible implementation of the above-mentioned first aspect, or instructions for implementing the method in any possible implementation of the above-mentioned second aspect or the second aspect.
[0052] 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.
[0053] 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 configured to execute code in the memory. When the code is executed, the processor is configured to execute the method in any possible implementation of the first aspect described above, or to execute the method in the second aspect described above or any possible implementation of the second aspect.
[0054] It should be understood that the beneficial effects achieved by the technical solutions of the second to ninth aspects of this application and the corresponding possible implementation methods can be referred to the technical effects of the first aspect and its corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] FIG1 is a schematic structural diagram of a communication system provided in an embodiment of the present application;
[0056] FIG2 is a schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0057] FIG3 is a schematic diagram of a method for time synchronization provided in an embodiment of the present application;
[0058] FIG4 is a schematic diagram of another method for time synchronization provided in an embodiment of the present application;
[0059] FIG5 is a process diagram of a method for time synchronization provided by an embodiment of the present application;
[0060] FIG6 is a schematic diagram of another method for time synchronization provided in an embodiment of the present application;
[0061] FIG7 is a schematic diagram of another method for time synchronization provided in an embodiment of the present application;
[0062] FIG8 is a schematic diagram of another method for time synchronization provided in an embodiment of the present application;
[0063] FIG9 is a block diagram of an apparatus for time synchronization provided in an embodiment of the present application;
[0064] FIG10 is a block diagram of an apparatus for time synchronization provided in an embodiment of the present application;
[0065] FIG11 is a schematic structural diagram of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0067] Figure 1 is a schematic diagram of a communication system provided by an embodiment of the present application. As shown in Figure 1, 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 devices may include OTN devices, PTN devices, routers, etc.
[0068] Figure 1 shows 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 NEs 1 through NE 9. The time signal source provided by time server 1 is transmitted to NE 9 via NE 3 and NE 4 in sequence. The frequency signal source provided by frequency server 1 is transmitted to NE 9 via 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 via NE 7 and NE 8 in sequence. The frequency signal source provided by frequency server 1 is transmitted to NE 9 via NE 5, NE 6, NE 7, and NE 8 in sequence.
[0069] The time server transmits time information via time synchronization messages (e.g., 1588 messages), and the frequency server transmits frequency signals and frequency level information via physical layer signals. Time synchronization messages include, but are not limited to, announce messages. Physical layer signals include, but are not limited to, synchronous Ethernet (SyncE) signals and synchronous OTN (SyncO) signals. Physical layer messages include, but are not limited to, synchronous Ethernet (SyncE) messages and synchronous OTN (SyncO) messages.
[0070] Optionally, the time information includes time class information and frequency indication information. The time class information includes parameters such as the GM clock class (clockclass), GM clock accuracy (clockaccuracy), and the offset scaled log variance value of the GM clock. The frequency indication information is used to indicate the frequency class. The frequency class information is used to indicate the frequency class.
[0071] 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 transfer station slave clock), a secondary level synchronization support unit (SSU-B) (also known as a local station slave clock), a synchronous equipment clock (SEC), etc.
[0072] It should be noted that Figure 1 illustrates an example in which a communication system includes two time servers, two frequency servers and nine network devices. In other embodiments, the communication system may include a larger number of time servers, or a larger number of frequency servers or a larger number of network devices.
[0073] Figure 2 is a schematic diagram of the structure of a network device provided in an embodiment of the present application. As shown in Figure 2, the network device includes a main control board and at least one circuit board. The main control board is connected to the circuit board.
[0074] Each circuit board includes multiple message transceivers and multiple ports. The message transceivers are connected to the ports in a one-to-one correspondence. The message transceivers are used to receive messages from the connected ports and send these messages to the main control board for time synchronization. They also receive synchronized time information from the main control board and, based on this synchronized time information, send messages to other network devices via the connected ports. The messages received and sent by the message transceivers from the corresponding ports include at least the aforementioned time synchronization messages carrying time information.
[0075] 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 this frequency signal as the basis for time synchronization. When the time synchronization message is lost, the frequency signal can provide network devices with time retention performance for 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 the local device based on the time information carried in the time synchronization message to ensure that the time of the local device is synchronized with the time information of the master time device.
[0076] FIG2 illustrates an example in which each circuit board includes two message transceivers and two ports. In other examples, the number of message transceivers and ports included in the circuit board may be greater than two, such as three or four.
[0077] FIG3 is a schematic diagram of a method for time synchronization provided by an embodiment of the present application. As shown in FIG3 , the method includes the following steps 301 to 303 .
[0078] 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.
[0079] 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 timing performance of the second device. A higher frequency level indicated by the first frequency indication information indicates better timing performance of the second device. Conversely, a lower frequency level indicated by the first frequency indication information indicates worse timing performance of the second device.
[0080] 302: The first device receives a first frequency level message sent by the third device, where 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.
[0081] 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.
[0082] Among them, the first device and the fourth device are both network devices in Figure 1. The second device is an upstream device of the first device, which can be a network device or a time server in Figure 1. The third device is an upstream device of the first device, which can be a network device or a frequency server in Figure 1. It can be understood that the upstream device of the present application includes an upstream device directly connected to the first device, and also includes an upstream device not directly connected to the first device. For example, the first device can be NE4 in Figure 1. In this case, the second device can be an NE3 device, or a time server 1, and the third device can be an NE2 device, or an NE1 device. Exemplarily, the second frequency indication information is used to indicate the 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.
[0083] 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.
[0084] Optionally, both the first time synchronization message and the second time synchronization message are 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 declined. The frequency traceable flag field is an existing field in the announce message. By carrying the second frequency indication information through the frequency traceable flag field, there is no need to modify the announce message format, and the implementation is simple.
[0085] Optionally, the first frequency level message is SSM.
[0086] 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.
[0087] In one possible implementation, the second frequency indication information is used to indicate the relationship between the lower frequency level between 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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 represented by the first frequency level information and the set frequency level, only 1 bit is needed to implement the second frequency level information, which can adapt to the number of indication bits of the frequency traceable flag field in the announce message.
[0092] 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.
[0093] 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 based on the second frequency indication information and the second frequency level information.
[0094] The following describes an example of a process in which the first device sends a second time synchronization message carrying second frequency indication information with reference to FIG. 1 .
[0095] 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.
[0096] 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.
[0097] Next, a detailed description will be given of the process in which the first device performs time synchronization according to the frequency indication information in the time synchronization message in the embodiments of the present application. In the following text, one of device A and device B is the aforementioned first device, and the other is the aforementioned second device. The methods provided in the embodiments shown in FIGS. 4 to 8 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.
[0098] FIG. 4 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application. As shown in FIG. 4, the method includes the following steps:
[0099] 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 execute step 509; if the GM clock level of device A is equal to the GM clock level of device B (A = B), then execute step 502; if the GM clock level of device A is less than the GM clock level of device B (A < B), then execute step 510.
[0100] 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 execute step 509; if the GM clock accuracy of device A is equal to the GM clock accuracy of device B (i.e., A = B), then execute step 503; if the GM clock accuracy of device A is less than the GM clock accuracy of device B (i.e., A < B), then execute step 510.
[0101] 503: Compare the variance values of the GM clock deviations of device A and device B. If the variance value of the GM clock deviation of device A is greater than the variance value of the GM clock deviation of device B (i.e., A>B), execute step 509; if the variance value of the GM clock deviation of device A is equal to the variance value of the GM clock deviation of device B (i.e., A=B), execute step 504; if the variance value of the GM clock deviation of device A is less than the variance value of the GM clock deviation of device B (i.e., A<B), execute step 510.
[0102] Through steps 501-503, it is possible to determine whether device B is the master time device of device A based on 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 the candidate master time device of device A. It should be noted that if there is only one candidate master time device for device A, device B is the master time device of device A; if there are at least two candidate master time devices for device A, it is necessary to select the candidate master time device with better quality as the master time device according to the process shown in Figure 4. 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 executed again, that is, whether device B is the master time device of device A is determined based on the frequency indication information.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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 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.
[0108] 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).
[0109] 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.
[0110] 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 devices, and other parameters can be compared at this time. Similarly, when the frequency levels of both device A and device B are 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 devices. Therefore, it is necessary to give priority to selecting the device with better performance in outputting the time synchronization message as the master clock device, that is, to select the device with a higher frequency level indicated by the frequency indication information as the master time device.
[0111] 505: Compare the GM clock priority levels 2 of device A and device B. If the GM clock priority level 2 of device A is greater than the GM clock priority level 2 of device B (i.e., A>B), proceed to step 509. If the GM clock priority level 2 of device A is equal to the GM clock priority level 2 of device B (i.e., A=B), proceed to step 506. If the GM clock priority level 2 of device A is less than the GM clock priority level 2 of device B (i.e., A<B), proceed to step 510.
[0112] 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.
[0113] The local priority of the device may be the local priority of the port that receives the time synchronization message.
[0114] 507: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of both device A and device B are less than or equal to 127, continue comparing other parameters in the existing manner, which will not be repeated here. If the clock level of either device A or device B is greater than 127, proceed to 508.
[0115] 508: Compare the GM clock identity document (ID) values of device A and device B. If the GM clock ID value of device A is greater than the GM clock ID value of device B (i.e., A>B), execute step 509; if the GM clock ID value of device A is less than the GM clock ID value of device B (i.e., A<B), execute step 510. If the GM clock ID value of device A is equal to the GM clock ID value of device B (i.e., A=B), other parameters can be compared in the existing manner and will not be further described here.
[0116] In the embodiment shown in FIG4 , the second priority level, the local priority level, and the GM clock ID of the device's GM clock are all configuration information, which is information pre-configured and stored in the device.
[0117] 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.
[0118] 509: Device B is superior to device A.
[0119] That is, a second comparison result is obtained, indicating that the time performance of device B is better than the time performance of device A, so that it can be determined that device B can be a candidate master time device of device A.
[0120] 510: Device A is superior to device B.
[0121] 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.
[0122] It should be noted that the method shown in Figure 4 can be considered an improvement to the A-BMCA algorithm defined in ITU G.8275.1, adding frequency indication information comparison. Because the impact of frequency accuracy on the performance of time synchronization messages is considered during time synchronization, a more accurate path can be selected, thereby improving time synchronization accuracy.
[0123] The following describes the working principle of the method for time synchronization provided by an embodiment of the present application with reference to Figure 1. As shown in Figure 1, the time signal source provided by time server 1 is sequentially transmitted to NE 9 via NE 3 and NE 4. The frequency signal source provided by frequency server 1 is sequentially transmitted to NE 9 via NE 1, NE 2, NE 3, and NE 4. The time signal source provided by time server 2 is sequentially transmitted to NE 9 via NE 7 and NE 8. The frequency signal source provided by frequency server 1 is sequentially transmitted to NE 9 via NE 5, NE 6, NE 7, and NE 8.
[0124] Among them, the time server 1 is in a normal state. In the time synchronization message output by the 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 the frequency server 1 is SSU-A. The frequency level information provided by the 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 timely learn that the performance of the time synchronization message output by NE3 has decreased. Since the frequency level indicated by the frequency level information received by NE 4 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 and 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 NE 8 are continued to be compared. Since the frequency indication information in the time synchronization message sent by NE4 is FALSE, while 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 and tracks the time of NE 8.
[0125] FIG. 5 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application. The difference from the embodiment shown in FIG. 4 is the timing of comparing the frequency indication information. As shown in FIG. 5, the method includes the following steps.
[0126] 601: 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), step 609 is executed; if the GM clock level of device A is equal to the GM clock level of device B (A = B), step 602 is executed; if the GM clock level of device A is less than the GM clock level of device B (A < B), step 610 is executed.
[0127] 602: Compare the GM clock accuracy 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), execute step 609; if the GM clock accuracy of device A is equal to that of device B (i.e., A=B), execute step 603; if the GM clock accuracy of device A is less than that of device B (i.e., A<B), execute step 610.
[0128] 603: Compare the variance values of the GM clock deviations of device A and device B. If the variance value of the GM clock deviation of device A is greater than the variance value of the GM clock deviation of device B (i.e., A>B), execute step 609; if the variance value of the GM clock deviation of device A is equal to the variance value of the GM clock deviation of device B (i.e., A=B), execute step 604; if the variance value of the GM clock deviation of device A is less than the variance value of the GM clock deviation of device B (i.e., A<B), execute step 610.
[0129] 604: Compare the GM clock priority levels 2 of device A and device B. If the GM clock priority level 2 of device A is greater than the GM clock priority level 2 of device B (i.e., A>B), execute step 609. If the GM clock priority level 2 of device A is equal to the GM clock priority level 2 of device B (i.e., A=B), execute step 605. If the GM clock priority level 2 of device A is less than the GM clock priority level 2 of device B (i.e., A<B), execute step 610.
[0130] 605: 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 609. If the frequency indication information of device A and device B are both TRUE or the frequency indication information of device A and device B are both FALSE, execute step 606. If the frequency indication information of device A is TRUE and the frequency indication information of device B is FALSE, execute step 610.
[0131] For related content, please refer to the aforementioned step 504 and will not be repeated here.
[0132] 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.
[0133] The local priority of the device may be the local priority of the port that receives the time synchronization message.
[0134] 607: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of both device A and device B are less than or equal to 127, continue comparing other parameters in the existing manner, which will not be repeated here. If the clock level of either device A or device B is greater than 127, proceed to 608.
[0135] 608: Compare the GM clock ID values of device A and device B. If the GM clock ID value of device A is greater than the GM clock ID value of device B (i.e., A>B), execute step 609; if the GM clock ID value of device A is less than the GM clock ID value of device B (i.e., A<B), execute step 610. If the GM clock ID value of device A is equal to the GM clock ID value of device B (i.e., A=B), other parameters can be compared in the existing manner, which will not be repeated here.
[0136] 609: Device B is superior to device A.
[0137] For related content, please refer to 509 and detailed description is omitted here.
[0138] 610: Device A is superior to device B.
[0139] For related content, please refer to 510, and detailed description is omitted here.
[0140] It should be noted that the method shown in Figure 5 can be considered an improvement to the A-BMCA algorithm defined in ITU G.8275.1, adding frequency indication information comparison. Because the impact of frequency accuracy on the performance of time synchronization messages is considered during time synchronization, a more accurate path can be selected, thereby improving time synchronization accuracy.
[0141] In the embodiment shown in Figure 5 , both the local priority and the GM clock ID are configuration information. Steps 606 to 608 implement a method for comparing the first configuration information with the local configuration information of the first device to obtain a third comparison result 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; and determining whether the second device is the master time device of the first device based on the third comparison result.
[0142] FIG6 is a schematic diagram of another method for time synchronization provided by an embodiment of the present application. The difference from the embodiment shown in FIG4 is that the timing of comparing frequency indication information is different. As shown in FIG6 , the method includes the following steps.
[0143] 701: 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 709; if the GM clock level of Device A is equal to that of Device B (A = B), then execute Step 702; if the GM clock level of Device A is less than that of Device B (A < B), then execute Step 710.
[0144] 702: 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 709; if the GM clock accuracy of Device A is equal to that of Device B (i.e., A = B), then execute Step 703; if the GM clock accuracy of Device A is less than that of Device B (i.e., A < B), then execute Step 710.
[0145] 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 that of Device B (i.e., A > B), then execute Step 709; 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 704; 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 710.
[0146] 704: 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 709; 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 705. 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 710.
[0147] 705: 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 709; if the local priority of Device A is equal to that of Device B (i.e., A = B), then execute Step 706. If the local priority of Device A is less than that of Device B (i.e., A < B), then execute Step 710.
[0148] Herein, the local priority of the device may be the local priority of the port receiving the time synchronization message.
[0149] 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 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.
[0150] For related content, please refer to the aforementioned step 504 and will not be repeated here.
[0151] 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 both device A and device B are less than or equal to 127, other parameters may be compared in the existing manner, which will not be described here. If the GM clock level of either device A or device B is greater than 127, proceed to 708.
[0152] 708: Compare the GM clock ID values of device A and device B. If the GM clock ID value of device A is greater than the GM clock ID value of device B (i.e., A>B), execute step 709; if the GM clock ID value of device A is less than the GM clock ID value of device B (i.e., A<B), execute step 710. If the GM clock ID value of device A is equal to the GM clock ID value of device B (i.e., A=B), other parameters can be compared in the existing manner and will not be further described here.
[0153] 709: Device B is superior to device A.
[0154] For related content, please refer to 509 and detailed description is omitted here.
[0155] 710: Device A is superior to device B.
[0156] For related content, please refer to 510, and detailed description is omitted here.
[0157] It should be noted that the method shown in Figure 6 can be considered an improvement to the A-BMCA algorithm defined in ITU G.8275.1, adding frequency indication information comparison. Because the impact of frequency accuracy on the performance of time synchronization messages is considered during time synchronization, a more accurate path can be selected, thereby improving time synchronization accuracy.
[0158] In the embodiment shown in Figure 6, both the local priority and the GM clock ID are configuration information. Through 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 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.
[0159] FIG7 is a schematic diagram of a time synchronization method according to another embodiment of the present application. The difference from the embodiment shown in FIG4 is that the embodiment shown in FIG7 first determines whether the GM clock levels of device A and device B are both outside the maintenance range, and then selects a method for determining the master time device based on the determination result. As shown in FIG7, the method includes the following steps:
[0160] 800: Determine whether the GM clock levels of both device A and device B are outside the hold. If the GM clock level of at least one of device A and device B is not outside the hold, execute steps 501-510 in Figure 4, 601-610 in Figure 5, or 701-710 in Figure 6. If the GM clock levels of both device A and device B are outside the hold, execute step 801.
[0161] A device's GM clock level being out of holdover means the GM device being tracked by the device has lost its time signal source and its time performance is unavailable. A device being out of holdover includes any of the following situations: the GM device being tracked by the device has not lost its time signal source, or the GM device being tracked by the device has lost its time signal source but its time performance is still available (i.e., the device's GM clock level is within holdover).
[0162] Alternatively, whether device A is out of hold can be determined based on its GM clock level. For example, if device A's GM clock level is greater than 135, it indicates that device A's GM clock level is out of hold. For another example, if device A's GM clock level is equal to any parameter in a parameter value set, it indicates that device A's GM clock level is out of hold. The parameter value set can be {140, 150, 160, 165}.
[0163] Similarly, whether device B is out of hold can be determined based on its GM clock level. For example, if device B's GM clock level is greater than 135, it indicates that device B's GM clock level is out of hold. For another example, if device B's GM clock level is equal to any parameter in a parameter value set, it indicates that device A's GM clock level is out of hold. The parameter value set can be {140, 150, 160, 165}.
[0164] Among them, the GM clock level equal to 140 indicates that the time source is lost and the time performance is unavailable, and the physical layer signal frequency is a primary clock (the corresponding quality level is enhanced protected real time clock (ePRTC), protected real time clock (PRTC), ePRC or PRC); the GM clock level equal to 150 indicates that the time source is lost and the time performance is unavailable, and the physical layer signal frequency is a secondary clock (the corresponding quality level is SSU-A); the GM clock level equal to 160 indicates that the time source is lost and the time performance is unavailable, and the physical layer signal frequency is a tertiary clock (the corresponding quality level is SSU-A); the GM clock level equal to 165 indicates that the time source is lost and the time performance is unavailable, and the physical layer signal frequency is inferior to the tertiary clock.
[0165] 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, then 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, then execute step 802. If the frequency indication information of device A is TRUE and the frequency indication information of device B is FALSE, then execute step 810.
[0166] For relevant content, see the foregoing step 504 and will not be elaborated here.
[0167] 802: 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 execute step 809; if the GM clock level of device A is equal to the GM clock level of device B (A = B), then execute step 803; if the GM clock level of device A is less than the GM clock level of device B (A < B), then execute step 810.
[0168] 803: 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 execute step 809; if the GM clock precision of device A is equal to the GM clock precision of device B (i.e., A = B), then execute step 804; if the GM clock precision of device A is less than the GM clock precision of device B (i.e., A < B), then execute step 810.
[0169] 804: Compare the variance values of the GM clock deviations of device A and device B. If the variance value of the GM clock deviation of device A is greater than the variance value of the GM clock deviation of device B (i.e., A>B), execute step 809; if the variance value of the GM clock deviation of device A is equal to the variance value of the GM clock deviation of device B (i.e., A=B), execute step 805; if the variance value of the GM clock deviation of device A is less than the variance value of the GM clock deviation of device B (i.e., A<B), execute step 810.
[0170] 805: Compare the GM clock priority levels 2 of device A and device B. If the GM clock priority level 2 of device A is greater than the GM clock priority level 2 of device B (i.e., A>B), execute step 809. If the GM clock priority level 2 of device A is equal to the GM clock priority level 2 of device B (i.e., A=B), execute step 806. If the GM clock priority level 2 of device A is less than the GM clock priority level 2 of device B (i.e., A<B), execute step 810.
[0171] 806: 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 809. If the local priority of device A is equal to the local priority of device B (A=B), execute step 807. If the local priority of device A is less than the local priority of device B (A<B), execute step 810.
[0172] The local priority of the device may be the local priority of the port that receives the time synchronization message.
[0173] 807: Determine whether the clock levels of device A and device B are less than or equal to 127. If the clock levels of both device A and device B are less than or equal to 127, continue comparing other parameters in the existing manner, which will not be repeated here. If the clock level of either device A or device B is greater than 127, proceed to 808.
[0174] 808: Compare the GM clock ID values of device A and device B. If the GM clock ID value of device A is greater than the GM clock ID value of device B (i.e., A>B), execute step 809; if the GM clock ID value of device A is less than the GM clock ID value of device B (i.e., A<B), execute step 810. If the GM clock ID value of device A is equal to the GM clock ID value of device B (i.e., A=B), other parameters can be compared in the existing manner and will not be further described here.
[0175] 809: Device B is superior to device A.
[0176] For related content, please refer to 509 and detailed description is omitted here.
[0177] 810: Device A is better than device B.
[0178] For related content, please refer to 510, and detailed description is omitted here.
[0179] When the GM clock levels of both device A and device B are out of hold, it is possible that the frequency indication information sent by one device indicates a lower frequency level than the frequency indication information sent by the other 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 both device A and device B are out of hold. If the GM clock levels of both device A and device B are out of hold, first compare the frequency indication information of device A and device B, and preferentially select the device with the higher frequency level indicated by the frequency indication information sent as the master time device. This helps improve the system's time transfer performance.
[0180] For example, as shown in Figure 8, time synchronization messages are transmitted sequentially between three network devices: NE A, NE B, and NE C. When none of the three network devices have lost their time signal sources, NE A's GM clock level is 6 and its frequency level is PRC; NE B's GM clock level is 248 and its frequency level is PRC; and NE C's GM clock level is 248 and its frequency level is PRC. When the link between NE A and NE B fails (e.g., is interrupted), both NE B and NE C lose their time signal sources. NE B's local GM clock level is 165 and its local frequency level is SSU-A; NE C's local GM clock level is 248 and its local frequency level is PRC. At this point, NE C's time level is lower than NE B's, but its local frequency level is higher than NE B's. Since NE C's timekeeping performance using PRC frequencies is superior to NE B's timekeeping performance using SSU-A frequencies, NE B should track NE C's time for better time performance. The process shown in Figure 8 allows NE B to track NEC's time.
[0181] It should be noted that in the embodiment shown in FIG8 , the frequency indication information is used to indicate the relationship between the frequency level and the set frequency level (e.g., PRC). 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.
[0182] Optionally, in the processes shown in Figures 4 to 8, the frequency indication information of device A may be the local frequency indication information of device A, or the frequency indication information in a time synchronization message sent by another device to device A. Typically, a network device compares the information in all received time synchronization messages with the local information of the network device and selects the time device with the best quality for time synchronization.
[0183] When the frequency indication information of device A is the frequency indication information in the time synchronization message sent to device A by other devices, the embodiment shown in FIG8 is executed by a network device other than device A and device B (eg, the aforementioned fifth device).
[0184] Still using Figure 1 as an example, let's assume that NE 4 is device A and the aforementioned target device, and NE 3 is device B. NE 4 compares NE 4's local frequency indication information 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 based on the comparison result. For another example, let's assume that NE 9 is the target device, NE 4 is device A, and NE 8 is device B. NE 9 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 based on the comparison result.
[0185] Figure 9 is a block diagram of an apparatus for time synchronization provided by an embodiment of the present application. The apparatus can be implemented as all or part of a first device through software, hardware, or a combination of both. The apparatus 900 may include: a receiving unit 901 and a sending unit 902.
[0186] The receiving unit 901 is 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, where the first frequency level information is used to indicate the frequency level of a clock of the third device. The sending unit 902 is configured to send a second time synchronization message to a fourth device based on the first frequency indication information and the first frequency level information, where the second time synchronization message includes second frequency indication information.
[0187] 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.
[0188] Optionally, the first frequency level message is SSM.
[0189] 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.
[0190] 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.
[0191] Optionally, the determining unit 903 includes:
[0192] a comparing subunit 9031, configured to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result;
[0193] The determining subunit 9032 is configured to determine, based on the first comparison result, whether the second device is the master time device of the first device.
[0194] Optionally, the comparing subunit 9031 is configured to obtain the first comparison result in the following manner:
[0195] 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.
[0196] Optionally, the determining subunit 9032 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
[0197] 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
[0198] 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.
[0199] Figure 10 is a block diagram of an apparatus for time synchronization provided by an embodiment of the present application. The apparatus can be implemented as all or part of a first device through software, hardware, or a combination of both. The apparatus 1000 may include: a receiving unit 1001 and a determining unit 1002.
[0200] The receiving unit 1001 is used to receive a first time synchronization message sent by a second device, wherein 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 based on 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.
[0201] Optionally, the determining unit 1002 includes: a comparing subunit 10021 and a determining subunit 10022. The comparing subunit 10021 is configured to compare the first frequency indication information and the third frequency indication information to obtain a first comparison result; and the determining subunit 10022 is configured to determine whether the second device is the master time device of the target device based on the first comparison result.
[0202] In a possible implementation, 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.
[0203] 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.
[0204] 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.
[0205] Accordingly, 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 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 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.
[0206] It should be noted that the apparatus for time synchronization provided in the above embodiment only uses the division of the above functional units as an example to illustrate 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 can be divided into different functional units to complete all or part of the functions described above. In addition, the apparatus for time synchronization provided in the above embodiment and the method embodiment for time synchronization are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0207] The descriptions of the processes corresponding to the above figures have different focuses. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.
[0208] FIG11 is a schematic diagram of the structure of a network device 1100 provided in an embodiment of the present application. As shown in FIG11 , the network device 1100 includes at least one processor 1101 , a memory 1102 , and at least one network interface 1103 .
[0209] Optionally, the network device 1100 is a single physical computer. Alternatively, the network device 1100 includes multiple physical computers, and the at least one processor 1101, 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.
[0210] 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 solution 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.
[0211] The memory 1102 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device 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, an optical disc storage (including a compact 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 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 via an internal connection 1104. Alternatively, the memory 1102 and the processor 1101 are optionally integrated together.
[0212] The network interface 1103 uses any transceiver-like device for communicating with other devices or communication networks. For example, the network interface 1103 includes at least one of a wired network interface and a wireless network interface. For example, the wired network interface is an Ethernet interface. For example, the Ethernet interface is an optical interface, an electrical interface, or a combination thereof. For example, the wireless network interface is a wireless local area network (WLAN) interface, a cellular network interface, or a combination thereof.
[0213] In some embodiments, processor 1101 includes one or more CPUs, such as CPU0 and CPU1 shown in FIG. 11 .
[0214] In some embodiments, network device 1100 optionally includes multiple processors, such as processor 1101 and processor 1105 shown in FIG11 . Each of these processors is, for example, a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein optionally refers to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0215] In some embodiments, network device 1100 further includes internal connections 1104. Processor 1101, memory 1102, and at least one network interface 1103 are connected via internal connections 1104. Internal connections 1104 include pathways that transmit information between the aforementioned components. Optionally, internal connections 1104 are boards or buses. Optionally, internal connections 1104 are divided into address buses, data buses, control buses, and the like.
[0216] 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 .
[0217] In some embodiments, the input / output interface 1106 is configured to connect to an input device and receive commands or data related to the above method embodiments input by a user through the input device, such as the aforementioned clock priority 2 and local priority. Input devices include, but are not limited to, a keyboard, a touch screen, a microphone, a mouse, or a sensor device.
[0218] 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 internally stored program code. 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 that implements the method provided in the embodiment of the present application.
[0219] 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.
[0220] In some embodiments, a computer-readable storage medium is further 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.
[0221] 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.
[0222] 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.
[0223] Unless otherwise defined, the technical or scientific terms used herein shall have the usual meaning 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, words such as "one" or "a" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "include" or "comprising" and similar terms mean that the elements or objects appearing before "include" or "comprising" cover the elements or objects listed after "include" or "comprising" 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.
[0224] The above is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection 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 the first frequency indication information and the third frequency indication information are both higher than or equal to 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 used 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.
Citation Information
Patent Citations
Method and device for determining master clock device, and other method, device, and system
CN103250371A
Method and clock for time synchronization
CN107046449A
Synchronization status information processing method and device
CN107437971A
Time synchronization method and device
CN112511255A
Method and apparatus for clock source management
WO2021238377A1