Method, device, system and storage medium for implementing clock source selection

By carrying the first mark in the first message, indicating that the time synchronization of the upstream node is uncertain, and the downstream node does not use the port clock source data carrying the first mark, solving the time jump problem caused by the node restarting or switching the clock source. Ensures the time synchronization and normal business progress of the entire network.

CN112771817BActive Publication Date: 2025-02-18HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080003884.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-09-06
Filing Date
2020-06-04
Publication Date
2025-02-18
Estimated Expiration
2040-06-04

AI Technical Summary

Technical Problem

In the application scenarios of IEEE 1588 and NTP protocols, when the node restarts or switches the clock source, it may cause a time jump, affecting the time synchronization of the entire network and the normal operation of services.

Method used

By carrying the first mark in the first message, the time synchronization of the upstream node is not determined. When selecting a clock source, the downstream node does not use the clock source data corresponding to the port carrying the first mark, thereby avoiding time jumps.

Benefits of technology

It effectively avoids downstream node time jumps due to uncertain time synchronization of upstream nodes, ensuring stable time synchronization of the entire network and normal business progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112771817B_ABST
    Figure CN112771817B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, system and storage medium for realizing clock source selection, which belongs to the field of clock technology. The method includes: a first node receives a first message sent by a second node through a first port on the first node; when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting the clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain. When the time synchronization of the upstream second node is uncertain, the first mark is carried in the first message to indicate that the time synchronization of the second node is uncertain. After receiving the first message carrying the first mark through the first port, when selecting the clock source, the clock source data corresponding to the first port is not used to select the clock source, so as to avoid the time jump of the downstream node due to the uncertainty of the time synchronization of the upstream node, thereby affecting the time jump of the entire network and the normal operation of the business.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of clock technology, and in particular to a method, device, system and storage medium for implementing clock source selection. Background Art

[0002] As distributed systems are increasingly used in communications and network applications, clock synchronization becomes increasingly important, and the Network Time Protocol (NTP) has been widely used as a clock synchronization method. In addition, in order to meet the increasing number of high-precision time synchronization requirements, the Institute of Electrical and Electronics Engineers (IEEE) 1588 protocol standard, which synchronizes the most accurate clock in a distributed system with other clocks, has also emerged. Among them, the full name of the IEEE 1588 protocol standard is the IEEE 1588 precision clock synchronization protocol for network measurement and control systems, or precision timing protocol (PTP) for short. Whether in the IEEE 1588 application scenario or the NTP scenario, how to select the clock source is the key to maintaining clock synchronization. Summary of the invention

[0003] The embodiments of the present application provide a method, device, system and storage medium for implementing clock source selection to solve the problems provided by related technologies. The technical solutions are as follows:

[0004] On the one hand, a method for implementing clock source selection is provided, the method comprising: a first node receives a first message sent by a second node through a first port on the first node; when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

[0005] After the first node receives the first message carrying the first mark through the first port, the first node does not use the clock source data corresponding to the first port to select the clock source when selecting the clock source, so as to avoid the time jump of the downstream node due to the uncertainty of the upstream node time synchronization, thereby affecting the time jump of the entire network and the normal operation of the business.

[0006] In an exemplary embodiment, when selecting a clock source, the first node does not select a clock source corresponding to the first port, including: when selecting a clock source, the first node does not use clock source data received through the first port to select a clock source.

[0007] In an exemplary embodiment, when selecting a clock source, the first node does not use the clock source data received through the first port to select a clock source, including: setting the clock source data set corresponding to the first port to an empty set according to the first mark; and selecting a clock source according to the clock source data sets corresponding to each port of the first node. By setting the clock source data set corresponding to the first port to an empty set, when selecting a clock source according to the clock source data sets corresponding to each port of the first node, the clock source data of the first port will not be selected, thereby avoiding the time jump of the downstream node due to the uncertainty of the time synchronization of the upstream node.

[0008] In an exemplary embodiment, when selecting a clock source, the first node does not use the clock source data received through the first port to select a clock source, including: setting the clock source data set corresponding to the first port to an empty set according to the first mark; and selecting a clock source according to a non-empty clock source data set in the clock source data sets corresponding to each port of the first node. By setting the clock source data set corresponding to the first port to an empty set, when selecting a clock source, the clock source is selected according to a non-empty clock source data set in the clock source data sets corresponding to each port of the first node, without the need to filter the clock source data set in the empty set, thereby simplifying the selection process.

[0009] In an exemplary embodiment, setting the clock source data set corresponding to the first port to an empty set according to the first mark includes: setting the value of the signal anomaly attribute of the first port to a first value based on the first mark, used to indicate that a signal anomaly occurs in the first port; and setting the clock source data set corresponding to the first port to an empty set based on the first value of the signal anomaly attribute.

[0010] In an exemplary embodiment, the signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and the first value of portDS.SF is true TRUE. Since the port signal failure attribute portDS.SF is an attribute defined in an existing standard, setting the clock source data set corresponding to the first port to an empty set based on the port signal failure attribute portDS.SF can be applicable to the existing standard, thereby improving the applicability of the method provided in the embodiment of the present application.

[0011] In an exemplary embodiment, setting the value of the signal anomaly attribute of the first port to a first value based on the first mark includes: determining that a packet timing signal failure PTSF event occurs at the first port based on the first mark; and setting the value of portDS.SF of the first port to a first value based on the PTSF event.

[0012] In an exemplary embodiment, the PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event, or an extended PTSF event. Since the packet timing signal failure-loss of synchronization PTSF-lossSync event and the packet timing signal failure-unusable PTSF-unusable event are events defined in existing standards, they can be applied to existing standards, thereby improving the applicability of the method provided in the embodiment of the present application. In addition, the PTSF event is extended by the extended PTSF event, and the method for determining the port signal failure attribute portDS.SF is extended.

[0013] In an exemplary embodiment, the first message is an Announce message.

[0014] In an exemplary embodiment, the synchronization undetermined mark synchronizationUncertain in the Announce message is used to carry the first mark, and when the value of the synchronizationUncertain is a third value, it is used to indicate that the time synchronization of the second node is uncertain.

[0015] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.

[0016] In a second aspect, a method for implementing clock source selection is provided, the method comprising: a second node generates a first announcement message, when the time synchronization of the second node is uncertain, the level corresponding to the target parameter carried in the first announcement message is lower than the reference level, and the reference level is the level corresponding to the target parameter when the second node is time synchronized; the first announcement message is sent to the first node, and the parameters carried in the first announcement message are used to select the clock source.

[0017] In one implementation, the second node is an intermediate node, and before generating the first Announce message, it also receives a second Announce message sent by an upstream node, and accordingly generates the first Announce message according to the second Announce message. In this implementation, the target parameter carried by the first Announce message is inferior to the target parameter carried by the second Announce message (i.e., the level of the target parameter carried by the second Announce message is used as the reference level).

[0018] In another implementation, when the second node is a time server, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in lock mode (ie, the level of the target parameter when the time server is in lock mode is used as the benchmark level).

[0019] When the time synchronization of the second upstream node is uncertain, by carrying a target parameter with a level lower than the benchmark level in the first Announce message, the first downstream node will not select the clock source corresponding to the port receiving the first Announce message when selecting the clock source due to the low level of the target parameter in the first Announce message, so as to avoid the time jump of the downstream node due to the uncertain time synchronization of the upstream node, thereby affecting the time jump of the entire network and the normal operation of the business.

[0020] In an exemplary embodiment, the target parameter is one or more of a clock class clockclass, a clock accuracy clockAccuracy, and a logarithmic variance offsetScaledLogVariance parameter.

[0021] In an exemplary embodiment, the second node generates a first Announce message, including: the second node receives a second Announce message sent by an upstream node, modifies the level of a target parameter in the second Announce message to obtain the first Announce message, or generates the first Announce message based on information in the second Announce message.

[0022] According to a third aspect, a device for implementing clock source selection is provided, which is applied to a first node, and comprises: a receiving module, used to receive a first message sent by a second node through a first port on the first node; and a selection module, used to cause the first node to not select the clock source corresponding to the first port when selecting a clock source when the first message carries a first mark, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

[0023] In an exemplary embodiment, the selection module is used to select a clock source without using the clock source data received through the first port when selecting a clock source.

[0024] In an exemplary embodiment, the selection module is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select a clock source according to the clock source data sets corresponding to the ports of the first node, or select a clock source according to a non-empty clock source data set in the clock source data sets corresponding to the ports of the first node.

[0025] In an exemplary embodiment, the selection module is used to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, indicating that a signal anomaly occurs at the first port; and based on the first value of the signal anomaly attribute, set the clock source data set corresponding to the first port to an empty set.

[0026] In an exemplary embodiment, the signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

[0027] In an exemplary embodiment, the selection module is used to determine that a packet timing signal fail PTSF event occurs at the first port based on the first mark; and set the value of portDS.SF of the first port to a first value based on the PTSF event.

[0028] In an exemplary embodiment, the PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event, or an extended PTSF event.

[0029] In an exemplary embodiment, the first message is an Announce message.

[0030] In an exemplary embodiment, the synchronization undetermined mark synchronizationUncertain in the Announce message is used to carry the first mark, and when the value of the synchronizationUncertain is a third value, it is used to indicate that the time synchronization of the second node is uncertain.

[0031] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.

[0032] In a fourth aspect, a device for implementing clock source selection is provided, the device being applied to a second node, the device comprising:

[0033] A generation module, configured to generate a first Announce message when the time synchronization of the second node is uncertain, wherein the level corresponding to the target parameter carried in the first Announce message is lower than the reference level, and the reference level is the level corresponding to the target parameter of the second node during time synchronization;

[0034] The sending module is used to send the first Announce message to the first node, and the parameters carried in the first Announce message are used to select a clock source.

[0035] In one implementation, the second node is an intermediate node, and the generating module is specifically used to generate the first Announce message according to the second Announce message received from the upstream node of the second node. In this implementation, the target parameter carried by the first Announce message is inferior to the target parameter carried by the second Announce message (i.e., the level of the target parameter carried by the second Announce message is used as the reference level).

[0036] In another implementation, when the second node is a time server, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in lock mode (ie, the level of the target parameter when the time server is in lock mode is used as the benchmark level).

[0037] In an exemplary embodiment, the target parameter is one or more of a clock class clockclass, a clock accuracy clockAccuracy, and a logarithmic variance offsetScaledLogVariance parameter.

[0038] In an exemplary embodiment, the generation module is used to receive a second Announce message sent by an upstream node, modify the level of a target parameter in the second Announce message to obtain the first Announce message, or generate the first Announce message according to information in the second Announce message.

[0039] In a fifth aspect, a system for implementing clock source selection is provided, the system comprising: a first node and a second node; the second node is used to send a first message to a first port of the first node; the first node is used to receive the first message sent by the second node through a first port on the first node; when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

[0040] In an exemplary embodiment, the first node is used to select a clock source without using the clock source data received through the first port when selecting a clock source.

[0041] In an exemplary embodiment, the first node is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select a clock source according to the clock source data sets corresponding to each port of the first node, or select a clock source according to a non-empty clock source data set in the clock source data sets corresponding to each port of the first node.

[0042] In an exemplary embodiment, the first node is used to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, indicating that a signal anomaly occurs at the first port; and based on the first value of the signal anomaly attribute, set the clock source data set corresponding to the first port to an empty set.

[0043] In an exemplary embodiment, the signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

[0044] In an exemplary embodiment, the first node is used to determine that a packet timing signal failure PTSF event occurs in the first port based on the first mark; and set the value of portDS.SF of the first port to a first value based on the PTSF event.

[0045] In an exemplary embodiment, the PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event, or an extended PTSF event.

[0046] In an exemplary embodiment, the first message is an Announce message.

[0047] In an exemplary embodiment, the synchronization undetermined mark synchronizationUncertain in the Announce message is used to carry the first mark, and when the value of the synchronizationUncertain is a third value, it is used to indicate that the time synchronization of the second node is uncertain.

[0048] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.

[0049] In a sixth aspect, a system for implementing clock source selection is provided, the system comprising: a first node and a second node; the second node is used to generate a first announcement message when the time synchronization of the second node is uncertain, the level corresponding to the target parameter carried in the first announcement message is lower than the reference level, and the reference level is the level corresponding to the target parameter of the second node during time synchronization; the first announcement message is sent to the first node; the first node is used to receive the first announcement message sent by the second node, and the parameters carried in the first announcement message are used to select a clock source.

[0050] In one implementation, the second node is an intermediate node, and is also used to receive a second Announce message sent by an upstream node before generating the first Announce message, and accordingly, when generating the first Announce message, is specifically used to generate the first Announce message according to the second Announce message. In this implementation, the target parameter carried by the first Announce message is inferior to the target parameter carried in the second Announce message (i.e., the level of the target parameter carried in the second Announce message is used as the reference level).

[0051] In another implementation, when the second node is a time server, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in lock mode (ie, the level of the target parameter when the time server is in lock mode is used as the benchmark level).

[0052] In an exemplary embodiment, the target parameter is one or more of a clock class clockclass, a clock accuracy clockAccuracy, and a logarithmic variance offsetScaledLogVariance parameter.

[0053] In an exemplary embodiment, the second node is used to receive a second Announce message sent by an upstream node, modify the level of a target parameter in the second Announce message to obtain the first Announce message, or generate the first Announce message according to information in the second Announce message.

[0054] A device for implementing clock source selection is also provided, the device comprising: a port and a processor, the port is used to communicate with other nodes, and the processor is used to implement any of the above methods for implementing clock source selection. When the device for implementing clock source selection is a first node, the port is the above first port.

[0055] A computer-readable storage medium is also provided, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement any of the above methods for implementing clock source selection.

[0056] Another communication device is provided, the device comprising: a transceiver, a memory and a processor. The transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method in any possible implementation mode described above.

[0057] As an exemplary embodiment, the number of the processors is one or more, and the number of the memories is one or more.

[0058] As an exemplary embodiment, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

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

[0060] A computer program (product) is provided, the computer program (product) comprising: a computer program code, when the computer program code is executed by a computer, the computer is enabled to execute the methods in the above aspects.

[0061] A chip is provided, comprising a processor, for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.

[0062] Another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, the processor is used to execute the code in the memory, and when the code is executed, the processor is used to execute the methods in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a 1588 synchronization network scenario provided in an embodiment of the present application;

[0064] Figure 2 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0065] Figure 3 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0066] Figure 4 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0067] Figure 5 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0068] Figure 6 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0069] Figure 7 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0070] Figure 8 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;

[0071] Fig. 9 A schematic diagram of the structure of a device for implementing clock source selection provided in an embodiment of the present application;

[0072] Fig.10 A schematic diagram of the structure of a device for implementing clock source selection provided in an embodiment of the present application;

[0073] Fig.11 A schematic diagram of the structure of a device for implementing clock source selection provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0075] In the application scenario of IEEE 1588 or NTP, when a node in the network restarts or switches the clock source due to power failure or fault repair, the output time of the node will change compared with the time before the restart or clock source switching. If the downstream node uses the node that restarts after power failure or fault repair or selects the clock source as the clock source, the output time of the downstream node will also change, which will affect the time change of the entire network and the normal operation of the business.

[0076] by Figure 1Taking the IEEE 1588 synchronization network scenario shown as an example, the network includes nodes A, B, C, D, E and F. Among them, node E includes two ports, port 1 and port 2. Port 1 corresponds to node B and is used to receive the PTP message sent by node B. Port 2 corresponds to node D and is used to receive the PTP message sent by node D. Under normal circumstances, both node A and node C track the global positioning system (GPS). The clock class (clockClass) in the announcement message sent by node A and node C to downstream nodes B and D is 6, and other parameters representing the IEEE 1588 quality level in the Announce message, such as clock accuracy (clockAccuracy), offset scale log variance (offsetScaledLogVariance), etc. are also the same. The clockClass in the Announce message sent by node B and node D to the downstream node E is also 6, and other parameters representing the IEEE 1588 quality level in the Announce message, such as clockAccuracy, offsetScaledLogVariance, etc., are also the same.

[0077] The ports of each node have four port states, including master state (master, M), slave state (slave, S), passive state (passive, P) and uncalibrated (UNCALIBRATED) state. The communication port with the port state of Master is referred to as the Master port. The Master port is used to broadcast the best quality clock source selected by this node to the entire network; the port in the Slave state (referred to as the Slave port) and the port in the UNCALIBRATED state are used to track the clock of the upstream node. In the process of using a certain port to track the clock of the upstream node for time synchronization, the state of the port will change from the Slave state to the UNCALIBRATED state, or from the UNCALIBRATED state to the Slave state according to the state of time synchronization; the Passive port is in an intermediate position, neither broadcasting the clock source nor tracking the clock of the upstream node. When the port state appears to be Passive, it generally means that there are two or more clock sources of comparable quality in the entire PTP network system. For example Figure 1As shown in the figure, the state of the port corresponding to node B on node E is slave, and the state of the port corresponding to node D on node E is passive. According to the IEEE1588v2 protocol and the International Telecommunication Union Telecommunication Standardization Sector (ITU-T) G.8275.1 protocol, node E selects node B or node D as the clock source to be tracked based on the best master clock (BMC) algorithm. Figure 1 For example, if the clockID of node A is smaller than the clockID of node C, the primary tracking path of node E is A->B->E, and the backup path is C->D->E.

[0078] If node B loses power, node E will select the backup path C->D->E for synchronization, and node E can ensure that the time output to node F has no jumps. When node B is powered on again, node A sends a PTP message to node B, so node B will first synchronize with node A, that is, synchronize with the time of node A based on the PTP message of node A. In the process of synchronizing with the time of node A, the time synchronization of node B is uncertain, wherein the uncertainty of the time synchronization of the node means that the time of the node has a large adjustment within the synchronization time period. The embodiment of the present application does not limit the method of determining that the time has a large adjustment, and illustratively includes but is not limited to determining that the time has a large adjustment based on the following three situations. Among them, in situations 1, 2A and 3A, the node is an intermediate node, and in situations 2B and 3B, the node is a source node (i.e., a time server). The source node refers to a node that performs time synchronization by directly tracking satellite signals (such as GPS signals), such as Figure 1 The intermediate nodes are nodes A and C in the figure. The intermediate nodes refer to the nodes that synchronize time by tracking the upstream nodes, such as Figure 1 Nodes B, D, E, and F in the network. Accordingly, the clock source signal of the source node is the tracked satellite signal, and the clock source signal of the intermediate node is the time signal obtained by tracking the upstream node, which can usually be considered as the time signal of the upstream node.

[0079] Case 1: The node is restarted or the clock source is switched. The ingress port of the node is in the UNCALIBRATED state, indicating that the node is undergoing clock synchronization. In this case, the time of the node is usually greatly adjusted. Therefore, in this case, the time synchronization of the node is uncertain.

[0080] In an exemplary embodiment, in this case, it can be considered that after the reference time, the time synchronization of the node is determined. The reference time can be set based on experience or based on an application scenario, and the embodiment of the present application does not limit the reference time.

[0081] Case 2: includes Case 2A and Case 2B.

[0082] Case 2A: The node is an intermediate node. The node periodically detects whether the time difference with the clock source signal (i.e., the time difference with the upstream node) is less than the threshold. If the time difference is greater than the threshold, it can be understood that the node's ingress port is in an uncalibrated state. In this case, the node's time is usually greatly adjusted, so the node's time synchronization is uncertain.

[0083] Case 2B: The node is a source node (ie, a time server). The node periodically detects whether the time difference with the clock source signal (ie, the time difference with the received satellite signal) is less than a threshold. If the time difference is greater than the threshold, it is determined that the time synchronization of the node is uncertain.

[0084] Case 3: includes Case 3A and Case 3B.

[0085] Case 3A: The node is an intermediate node. After the node restarts or changes the clock source, it detects whether the time difference with the upstream node is less than the threshold. If the time difference is greater than the threshold, it can be understood that the node's ingress port is in an uncalibrated state. In this case, the node's time is usually greatly adjusted, so the node's time synchronization is uncertain.

[0086] Case 3B: The node is a source node. After the node restarts or switches the clock source, it detects whether the time difference with the received satellite signal is less than the threshold. If the time difference is greater than the threshold, it is determined that the time synchronization of the node is uncertain.

[0087] It can be understood that both the above cases 2 and 3 use the time difference with the upstream node to determine that the time synchronization of the node is uncertain. For the case where the time difference with the upstream node is less than the threshold, the time synchronization of the node can be determined. In addition, the thresholds in cases 2A, 2B, 3A, and 3B can be the same or different. The size of the threshold can be set based on experience or limited based on the application scenario. The embodiment of the present application does not limit the size of the threshold.

[0088] by Figure 1For example, during the time synchronization process of node B, the time of node B will be adjusted according to the time of node A (i.e., the time in the clock source signal). In addition, node B can also determine whether the time of node B is synchronized by whether the time difference between node B and node A is less than a threshold. For example, after node B receives the PTP message from node A, the time difference between node B and node A is calculated based on the PTP message from node A. If the time difference is less than the threshold, it indicates that the time of node B is synchronized with the time of the clock source signal, that is, the time of node B is in a synchronization determination state (hereinafter referred to as synchronization determination or synchronization). If the time difference is not less than the threshold, it indicates that the time of node B is in a synchronization uncertainty state (hereinafter referred to as synchronization uncertainty).

[0089] If the time synchronization of node B is uncertain, the output time of node B will change. If node B sends a PTP message to node E, node E will select the clock source corresponding to the port that receives the PTP message, which will cause the output time of node E to change. This situation needs to be avoided in the application of 1588, otherwise it will affect the time change of the entire network and the normal operation of the business. The above only takes the IEEE1588 scenario as an example. For NTP, when the clock is synchronized, there is also the problem that the output time of the node changes, which affects the time change of the entire network and the normal operation of the business.

[0090] In this regard, an embodiment of the present application provides a method for selecting a clock source, which notifies the downstream node whether the time of each node on the clock source path is synchronized by carrying a first mark in a first message. If the downstream node detects that the time synchronization of the upstream clock source is uncertain, the downstream node does not select the clock source corresponding to the port of the upstream node, which can avoid affecting the output time of the downstream node. Next, taking the upstream node as the second node, the downstream node as the first node, and the clock source selected by the first node as an example, the method for selecting a clock source provided by an embodiment of the present application is explained. Figure 2 As shown, the method includes the following process:

[0091] 201. A first node receives a first message sent by a second node through a first port on the first node.

[0092] The first node is connected to one or more upstream second nodes, and the first node can receive a first message sent by the second node through a first port on the first node, and the first message includes but is not limited to a PTP message or an NTP message. Exemplarily, taking the first message as any type of message in the PTP message as an example, there are five types of PTP messages in IEEE1588v1, namely, synchronization (sync) message, follow (follow_up) message, delay request (delay_req) message, delay response (delay_resp) message and management (management) message. Verision2 adds three types of PTP messages in the peer-delay mechanism on the basis of verision1, namely, point delay request (Pdelay_req) message, point delay response (Pdelay_resp) message and point delay response follow (Pdelay_resp_Follow_up) message. In addition, signaling messages and announcement messages are also added.

[0093] Among them, messages such as sync, delay_req, follow_up and delay_resp are used to generate and communicate time information for synchronizing ordinary clocks and boundary clocks through a delay request-response mechanism. Messages such as Pdelay_req, Pdelay_resp and Pdelay_resp_Follow_up are used to measure the link delay between two clock ports through a peer delay mechanism. The Announce message is used to establish a synchronization path, send the status and feature information of the node and the root node of the Announce message; the management message is used to query and update the PTP data set maintained by the clock, and the signaling message is used for other purposes, such as coordinating the sending frequency of unicast messages between the master and the slave. In the method provided in the embodiment of the present application, the first node can receive any of the above-mentioned first messages sent by the second node to the first node through the first port.

[0094] In an exemplary embodiment, if the second node is not synchronized to the time of the upstream node of the second node due to power failure or fault repair, the first message may be carried with a first mark to notify the downstream node that the time synchronization of the upstream second node is uncertain. In the method provided in the embodiment of the present application, the first mark may be carried in an existing field of the first message, or in a newly defined field of the first message. The embodiment of the present application does not limit the manner in which the first message carries the first mark.

[0095] Taking the first message sent by the second node to the first port of the first node as an Announce message as an example, if the time synchronization of the second node is uncertain, the Announce message sent by the second node to the first node carries a first mark, and the first mark indicates that the time synchronization of the second node is uncertain. In an exemplary embodiment, the first mark can be carried in an existing field of the Announce message, or in a newly added field of the Announce message. Taking the example of carrying the first mark in an existing field of the Announce message, the first mark can be carried by the synchronization uncertainty mark (synchronizationUncertain) in the Announce message. Exemplarily, when the value of synchronizationUncertain is TRUE, it is used to indicate that the time synchronization of the second node is uncertain. Alternatively, the value of synchronizationUncertain can also be other values ​​besides TRUE and FLASE, and the embodiment of the present application does not limit the value of synchronizationUncertain used to indicate that the time synchronization of the second node is uncertain. In addition, no matter what form the value of synchronizationUncertain used to indicate the uncertainty of time synchronization of the second node is expressed in, the Announce message sent by the second node may carry other parameters in addition to the first mark, for example, the parameters carried include clockClass, clockAccuracy, offsetScaledLogVariance, etc.

[0096] In addition to using synchronizationUncertain in the Announce message to carry the first mark, the method provided in the embodiment of the present application also supports using other parameters in the Announce message to carry the first mark when the time synchronization of the second node is uncertain. For example, when the second node determines that the time synchronization is uncertain, the second node sets the value of one or more parameters such as clockClass, clockAccuracy and offsetScaledLogVariance in the Announce message to be sent to a specific value, and indicates that the time synchronization of the second node is uncertain through the specific value. Figure 1Taking the network shown as an example, under normal circumstances, after both nodes A and C track GPS, the clockClass in the Announce message sent by nodes A and C to downstream nodes B and D is 6. When the second node determines that the time synchronization of the second node is uncertain, the second node sets the clockClass of the Announce message to 187 or 248 and then sends it to the first node, thereby indicating that the time synchronization of the second node is uncertain by using the specific value of clockClass 187 or 248, so that the first node will not select the second node as the clock source.

[0097] It should be noted that the embodiment of the present application does not limit which of the above methods is used to carry the first mark. Considering that in the IEEE 1588v2 standard, when a node is in the slave port state and a clock source is selected, the clockClass of the Announce message sent by the node at the master port should be the clockClass received by the slave port, and should not be the clockClass received by the slave port downgraded before being sent out. In this regard, if the existing IEEE1588v2 standard is not changed, the above method of carrying the first mark through synchronizationUncertain in the Announce message can be used.

[0098] 202. When the first message carries the first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source. The first mark is used to indicate that the time synchronization of the second node is uncertain.

[0099] After the first node receives the first message sent by the second node, the first node parses the first message. If the first message is parsed to carry the first mark, it can be determined that the time synchronization of the second node is uncertain, and when selecting the clock source, the clock source corresponding to the first port is not selected. Exemplarily, when the first node selects the clock source, the method of not selecting the clock source corresponding to the first port includes but is not limited to not using the clock source data received through the first port to select the clock source when the first node selects the clock source. The first node receives the first message through the first port, and when selecting the clock source, the clock source data received through the first port is not used to select the clock source, and the clock source corresponding to the first port will not be selected, thereby avoiding time jumps.

[0100] In an exemplary embodiment, after the first port of the first node receives the first message carrying the first mark, since the first mark indicates that the time synchronization of the second node is uncertain, the first node can record the uncertain state of the time synchronization of the second node. For example, the first node records that the first port receives the first message carrying the first mark, so that when the first node selects a clock source, based on the recorded uncertain state of the time synchronization of the second node, the first node does not use the clock source data received by the first port, and thus does not select the clock source corresponding to the first port when selecting a clock source.

[0101] In addition to the above-mentioned method of recording the port corresponding to the first mark, each port of the first node has a clock source data set. For example, taking the first message as an announce message, the first message carries not only the first mark but also clock source data, such as clockClass and clockID, and the clock source data set includes clock source data such as clockClass and clockID in the announce message. Therefore, when the time synchronization of the second node is uncertain, when the first node selects the clock source, it does not use the clock source data received through the first port to select the clock source, and can also include but is not limited to the following two methods:

[0102] Method 1: When selecting a clock source, the first node sets the clock source data set corresponding to the first port to an empty set according to the first mark; and selects a clock source according to the clock source data sets corresponding to each port of the first node.

[0103] In the first method, since the first message carries the first mark, and the first mark indicates that the time synchronization of the second node is uncertain, when the first node selects the clock source, the clock source data set corresponding to the first port is set to an empty set according to the first mark, and then the clock source is selected according to the clock source data sets corresponding to the ports of the first node. The clock source data sets corresponding to the ports of the first node include the clock source data set corresponding to the first port, that is, when the first node selects the clock source, the first node can obtain the clock source data sets corresponding to all ports of the first node, and then compare the clock source data in all the clock source data sets to select the clock source. Since the clock source data set corresponding to the first port is an empty set, the clock source data received through the first port will not be used to select the clock source. For example, the method of selecting the clock source can refer to the BMC source selection process of ITU-T G.8275.1 and G.8275.2 released in March 2018.

[0104] Method 2: When selecting a clock source, the first node sets the clock source data set corresponding to the first port to an empty set according to the first mark; and selects a clock source according to clock source data in non-empty clock source data sets in the clock source data sets corresponding to each port of the first node.

[0105] In the second method, since the first message carries the first mark, and the first mark indicates that the time synchronization of the second node is uncertain, when the first node selects the clock source, it sets the clock source data set corresponding to the first port to an empty set according to the first mark. Unlike the first method, in the second method, after the first node sets the clock source data set corresponding to the first port to an empty set, it does not select the clock source according to the clock source data sets corresponding to all ports of the first node, but only obtains the non-empty clock source data set and selects the clock source according to the non-empty clock source data set. In other words, in the second method, the first node compares the clock source data in the non-empty clock source data set to select the clock source.

[0106] In an exemplary embodiment, whether it is the above-mentioned method one or the above-mentioned method two, when the first node selects the clock source, the method of setting the clock source data set corresponding to the first port to an empty set according to the first mark includes but is not limited to: when the first node selects the clock source, the value of the signal anomaly attribute of the first port is set to a first value based on the first mark to indicate that a signal anomaly occurs in the first port; based on the first value of the signal anomaly attribute, the clock source data set corresponding to the first port is set to an empty set.

[0107] For example, the current ITU-T G.8275.2 defines the signal failure attribute portDS.SF. If the value of portDS.SF of the first port is a first value, such as true (TRUE), then the first node sets the clock source data set (Erbest) corresponding to the first port to an empty set. Therefore, in the method provided in the embodiment of the present application, the signal failure attribute portDS.SF of the port can be used as a signal abnormality attribute. If the first value of portDS.SF of the first port is TRUE, the clock source data set (Erbest) of the first port is set to an empty set.

[0108] Wherein, the value of portDS.SF of the first port can be determined by a packet timing signal fail (PTSF) event. Exemplarily, the value of the signal anomaly attribute of the first port is set to a first value based on a first mark, including: determining that a PTSF event occurs at the first port based on the first mark; and setting the value of portDS.SF of the first port to a first value based on the PTSF event. Wherein, the default value of the PTSF event can be FALSE, indicating that no PTSF event occurs. After a PTSF event occurs, the value of the PTSF event can be set to TRUE. When the value of the PTSF event is TRUE, the value of portDS.SF of the first port is set to the first value.

[0109] For example, in ITU-T G.8275.2, the attribute portDS.SF is determined based on the packet timing signal failure-loss of synchronization (PTSF-lossSync) event and the packet timing signal failure-unusable (PTSF-unusable) event. If the port cannot receive the PTP message, it is determined that the PTSF-lossSync event has occurred, and the value of the PTSF-lossSync event is set to the second value (for example, the second value is TRUE), otherwise it is FALSE; if the performance of the PTP message received by the port exceeds the tolerance range of this node, it is determined that the PTSF-unusable event has occurred, and the value of the PTSF-unusable event is set to the second value (for example, the second value is TRUE), otherwise it is FALSE. If a PTSF-lossSync event or a PTSF-unusable event occurs, the value of portDS.SF is TRUE. In the method provided in the embodiment of the present application, it can be determined based on the first mark that a PTSF-lossSync event or a PTSF-unusable event has occurred, so that the value of portDS.SF is the first value (for example, TRUE). In addition, the method provided in the embodiment of the present application also supports the extension of a new PTSF event to trigger setting the value of the portDS.SF attribute of the first port to a first value. Exemplarily, the synchronizationUncertain in the received Announce message corresponds to a new extended PTSF event, for example: the extended PTSF event is named the packet timing signal failure-synchronization uncertainty (PTSF-syncUncertain) event, which is used to indicate that the first port has a signal abnormality due to uncertain time synchronization of the upstream node. When the value of synchronizationUncertain in the received Announce message is TRUE, it is determined that a PTSF-syncUncertain event has occurred, the value of the PTSF-syncUncertain event is set to a second value (for example, TRUE), and the value of portDS.SF is set to the first value.

[0110] In summary, if a PTSF-lossSync event, a PTSF-unusable event, or an extended PTSF event (such as PTSF-syncUncertain) occurs, the value of portDS.SF is TRUE, thereby setting Erbest of the first port to an empty set, so that the first node does not use the clock source data corresponding to the first port when selecting a clock source. Therefore, the value of the signal anomaly attribute of the first port is set to the first value based on the first mark, including but not limited to the following methods:

[0111] Method 1: Taking the extended PTSF event as the PTSF-syncUncertain event as an example, based on the first mark, it is determined that the PTSF-syncUncertain event occurs on the first port, which is used to indicate that a signal abnormality event occurs on the first port due to uncertain time synchronization of the upstream node; based on the PTSF-syncUncertain event, the value of portDS.SF of the first port is set to the first value.

[0112] Exemplarily, when a PTSF-syncUncertain event occurs, the value of the PTSF-syncUncertain event is set to a second value, such as the second value is TRUE, that is, when the PTSF-syncUncertain event occurs, it indicates that the first port has a signal abnormality event due to the uncertainty of the time synchronization of the upstream node, thereby triggering the value of portDS.SF of the first port to be set to the first value, for example, the value of portDS.SF is TRUE, thereby triggering the setting of the clock source data set corresponding to the first port to an empty set. In addition, when a PTSF-syncUncertain event occurs, the second value of the PTSF-syncUncertain event can also be set to FALSE, that is, when the PTSF-syncUncertain event occurs, the value of the PTSF-syncUncertain event is FALSE, indicating that the first port has a signal abnormality event due to the uncertainty of the time synchronization of the upstream node, thereby triggering the setting of the value of portDS.SF of the first port to be set to the first value, for example, the value of portDS.SF is TRUE, thereby triggering the setting of the clock source data set corresponding to the first port to an empty set. Alternatively, the second value of the PTSF-syncUncertain event may also be other forms of expression besides TRUE and FALSE, which is not limited in the embodiment of the present application.

[0113] Method 2: determining that a PTSF-lossSync event occurs on the first port based on the first flag; and setting the value of portDS.SF of the first port to a first value based on the PTSF-lossSync event.

[0114] Exemplarily, when a PTSF-lossSync event occurs, the value of the PTSF-lossSync event is set to a second value, and the second value is TRUE. That is, when the value of the PTSF-lossSync event is TRUE, it indicates that the first port has a signal abnormality event due to uncertain time synchronization of the upstream node, thereby triggering the value of portDS.SF of the first port to be set to the first value, for example, the value of portDS.SF is TRUE, thereby triggering the setting of the clock source data set corresponding to the first port to an empty set. Alternatively, the second value of the PTSF-lossSync event can also be other forms of expression besides TRUE, which is not limited in the embodiments of the present application.

[0115] Method three: determining that a PTSF-unusable event occurs on the first port based on the first flag; and setting the value of portDS.SF of the first port to a first value based on the PTSF-unusable event.

[0116] Exemplarily, when a PTSF-unusable event occurs, the value of the PTSF-unusable event is set to a second value, such as TRUE. That is, when the value of the PTSF-unusable event is TRUE, it indicates that the first port has a signal abnormality event due to uncertain time synchronization of the upstream node, thereby triggering the value of portDS.SF of the first port to be set to the first value, such as the value of portDS.SF is TRUE, thereby triggering the setting of the clock source data set corresponding to the first port to an empty set. Alternatively, the second value of the PTSF-unusable event can also be other forms of expression besides TRUE, which is not limited in the embodiments of the present application.

[0117] The method provided by the embodiment of the present application, when the time synchronization of the second node upstream is uncertain, carries a first mark in the first message to indicate that the time synchronization of the second node is uncertain. When the first node downstream receives the first message carrying the first mark through the first port, the clock source data corresponding to the first port is not used to select the clock source when selecting the clock source, thereby avoiding the time jump of the downstream node due to the uncertainty of the time synchronization of the upstream node, thereby affecting the time jump of the entire network and the normal operation of the service.

[0118] Next, Figure 1 Taking the network shown in FIG. 1 as an example, several possible implementation methods of the method provided in the embodiment of the present application are illustrated. Among them, Figure 1 Node E in the example is the first node, node B is the second node, and the first message is the Announce message. Figure 3 As shown, the method for implementing clock source selection includes:

[0119] 301, when the time synchronization of node B is uncertain, node B sends an Announce message to node E, and the value of synchronizationUncertain in the Announce message is TRUE.

[0120] 302. The first port of the node E receives the Announce message, parses and obtains that the value of synchronizationUncertain in the Announce message is TRUE, and sets the clock source data set corresponding to the first port to an empty set.

[0121] 303 , the node E obtains the clock source data sets of all ports of the node E, including clock source data sets whose data sets are empty sets and clock source data sets whose data sets are not empty sets.

[0122] 304 , the node E selects a clock source according to the clock source data in the non-empty clock source data set, and does not use the clock source data corresponding to the first port to select a clock source.

[0123] For the process of node E selecting a clock source, refer to the BMC source selection process of ITU-T G.8275.1 and G.8275.2 released in March 2018.

[0124] Still Figure 1 The network shown in Figure 1 Node E is the first node, node B is the second node, and the first message is an Announce message as an example to illustrate the method provided in the embodiment of the present application. Figure 4 As shown, the method for implementing clock source selection includes:

[0125] 401, when the time synchronization of node B is uncertain, node B sends an Announce message to node E, and the value of synchronizationUncertain in the Announce message is TRUE.

[0126] 402. The first port of the node E receives the Announce message, parses and obtains that the value of synchronizationUncertain in the Announce message is TRUE, and sets the value of portDS.SF of the first port to TRUE.

[0127] 403. Node E sets the clock source data set corresponding to the first port to an empty set based on the value of portDS.SF.

[0128] 404 , the node E obtains the clock source data sets of all ports of the node E, including clock source data sets whose data sets are empty sets and clock source data sets whose data sets are not empty sets.

[0129] 405 , the node E selects a clock source according to the clock source data in the non-empty clock source data set, and does not use the clock source data corresponding to the first port to select a clock source.

[0130] For the process of node E selecting a clock source, refer to the BMC source selection process of ITU-T G.8275.1 and G.8275.2 released in March 2018.

[0131] Still Figure 1 The network shown in Figure 1 Node E is the first node, node B is the second node, and the first message is an Announce message as an example to illustrate the method provided in the embodiment of the present application. Figure 5 As shown, the method for implementing clock source selection includes:

[0132] 501, when the time synchronization of node B is uncertain, node B sends an Announce message to node E, and the value of synchronizationUncertain in the Announce message is TRUE.

[0133] 502. The first port of the node E receives the Announce message, parses and obtains that the value of synchronizationUncertain in the Announce message is TRUE, and determines that a PTSF-syncUncertain event occurs on the first port.

[0134] 503 , the node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-syncUncertain event.

[0135] 504. Node E sets the clock source data set corresponding to the first port to empty based on the value of portDS.SF.

[0136] 505 , the node E obtains the clock source data sets of all ports of the node E, including the clock source data sets whose data sets are empty sets and the clock source data sets whose data sets are not empty sets.

[0137] 506. Node E selects a clock source according to the clock source data in the non-empty clock source data set, and does not use the clock source data corresponding to the first port to select a clock source.

[0138] For the process of node E selecting a clock source, refer to the BMC source selection process of ITU-T G.8275.1 and G.8275.2 released in March 2018.

[0139] Still Figure 1 The network shown in Figure 1Node E is the first node, node B is the second node, and the first message is an Announce message as an example to illustrate the method provided in the embodiment of the present application. Figure 6 As shown, the method for implementing clock source selection includes:

[0140] 601, when the time synchronization of node B is uncertain, node B sends an Announce message to node E, and the value of synchronizationUncertain in the Announce message is TRUE.

[0141] 602. The first port of the node E receives the Announce message, parses and obtains that the value of synchronizationUncertain in the Announce message is TRUE, and determines that a PTSF-lossSync event occurs on the first port.

[0142] 603 , node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-lossSync event.

[0143] 604 , node E sets the clock source data set of the first port to empty based on the value of portDS.SF.

[0144] 605 , the node E obtains the clock source data sets of all ports of the node E, including clock source data sets whose data sets are empty sets and clock source data sets whose data sets are not empty sets.

[0145] 606. Node E selects a clock source according to the clock source data in the non-empty clock source data set, and does not use the clock source data corresponding to the first port to select a clock source.

[0146] Among them, the process of node E selecting the clock source, the source selection process can be found in the BMC source selection process of ITU-TG.8275.1 and G.8275.2 released in March 2018.

[0147] Still Figure 1 The network shown in Figure 1 Node E is the first node, node B is the second node, and the first message is an Announce message as an example to illustrate the method provided in the embodiment of the present application. Figure 7 As shown, the method for implementing clock source selection includes:

[0148] 701, when the time synchronization of node B is uncertain, node B sends an Announce message to node E, and the value of synchronizationUncertain in the Announce message is TRUE.

[0149] 702. The first port of the node E receives the Announce message, parses and obtains that the value of synchronizationUncertain in the Announce message is TRUE, and determines that a PTSF-unusable event occurs on the first port.

[0150] 703 , node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-unusable event.

[0151] 704 , node E sets the clock source data set of the first port to empty based on the value of portDS.SF.

[0152] 705 , the node E obtains the clock source data sets of all ports of the node E, including the clock source data sets whose data sets are empty sets and the clock source data sets whose data sets are not empty sets.

[0153] 706. Node E selects a clock source according to the clock source data in the non-empty clock source data set, and does not use the clock source data corresponding to the first port to select a clock source.

[0154] For the process of node E selecting a clock source, refer to the BMC source selection process of ITU-T G.8275.1 and G.8275.2 released in March 2018.

[0155] It should be noted that the above Figure 2-Figure 7 In the illustrated embodiment, only the case where the time synchronization of the second node is uncertain, after the first node receives the first message carrying the first mark sent by the second node through the first port of the first node, the clock source corresponding to the first port is not selected to avoid time jumps. If the time of the second node is subsequently synchronized, a second message is sent to the first node, and the second message may carry a second mark, and the second mark is used to indicate the time synchronization of the second node. After the first node receives the second message carrying the second mark, the clock source data set corresponding to the port of the second node on the first node may not be set to an empty set, so that the clock source corresponding to the first port is selected as the object, and the clock source is selected accordingly. For example, still taking Figure 1Taking the network shown in the figure as an example, after the time of node B is synchronized, the value of the synchronization uncertainty mark synchronizationUncertain of the Announce message sent by node B on the master port is FALSE, that is, the second mark is carried by the value of synchronizationUncertain to notify the downstream that the time of node B has been synchronized. Node E selects node B or node D as the clock source to track based on the BMC algorithm. Since the downstream node E receives the Announce message from node B on port 1 and parses it to find that the value of synchronizationUncertain of node B's Announce message is FALSE, node E sets the Erbest data set of port 1 to be equal to the Announce message information of node B, and still uses Figure 1 For example, if the clockID of node A is smaller than the clockID of node C, node E will reselect port 1 to track to node B.

[0156] In an exemplary embodiment, in addition to the above-mentioned method of indicating that the time synchronization of the second node is uncertain by the first mark, so that the downstream first node does not select the clock source corresponding to the first port that receives the first message of the second node, the method provided in the embodiment of the present application also supports parameter degradation to make the clock source of the first port not be selected, thereby avoiding time jumps in the first node. The specific implementation method includes implementation method A and implementation method B in the following method.

[0157] like Figure 8 As shown, the method for implementing clock source selection provided by the embodiment of the present application includes:

[0158] 801. The second node generates a first Announce message, where the first Announce message includes a target parameter.

[0159] The target parameter in the first Announce message includes at least one of a first target parameter and a second target parameter.

[0160] The first target parameter is used to characterize the master clock priority, such as the master clock priority 1 in the PTP protocol.

[0161] (grandmasterPriority1), master clock priority 2 (grandmasterPriority2).

[0162] The second target parameter is used to characterize the quality of the master clock, such as the grandmaster clock quality (grandmasterClockQuality) in the PTP protocol, and may specifically include at least one of the following quality parameters:

[0163] Parameters used to characterize the traceability of a clock to the International Atomic Time (TAI), such as the clock class in the PTP protocol;

[0164] Parameters used to characterize clock accuracy, such as clockAccuracy in the PTP protocol;

[0165] Parameters used to characterize clock stability, such as the logarithmic variance of the offset scale (offsetScaledLogVariance).

[0166] The second node may be an intermediate node or a source node. When the second node is an intermediate node, it will first receive a second Announce message sent by an upstream node before step 801, and generate the first Announce message according to the second Announce message in step 801.

[0167] As mentioned above, the time of the second node may be in a synchronization determined state or in a synchronization uncertain state. According to an embodiment of the present application, when the time of the second node is in a synchronization uncertain state, the target parameter carried by the first Announce message is an inferior parameter, and when the time of the second node is in a synchronization determined state, the target parameter carried by the first Announce message is a superior parameter.

[0168] In implementation A, when the time synchronization of the second node is uncertain (i.e., in a synchronization uncertain state), the level corresponding to the target parameter carried in the first Announce message is lower than the reference level, and the reference level is the level corresponding to the target parameter of the second node when the time is synchronized (i.e., in a synchronization determined state). In a specific implementation, the target parameter in the first Announce message can be set to a preset value, and the level corresponding to the preset value is lower than the reference level. For example, the target parameter includes clockclass and clockAccuracy, and the preset value corresponding to clockclass is 248, and the preset value corresponding to clockAccuracy is unknown. In addition, when the time of the second node is synchronized, the level corresponding to the target parameter carried in the first Announce message is the reference level.

[0169] When the second node is an intermediate node, the level of the target parameter carried in the second Announce message can be used as the benchmark level, and accordingly, the target parameter carried by the first Announce message is inferior to the target parameter carried in the second Announce message. For example, the clockclass carried in the second Announce message is 6, and the value of the clockclass carried in the first Announce message is a value greater than 6, such as 187 or 248. It should be noted that when the target parameter includes more than one parameter, the target parameter carried by the first Announce message is inferior to the target parameter carried by the second Announce message, which means that all parameters in the target parameters carried by the first Announce message are inferior to the corresponding parameters in the target parameters carried in the second Announce message. For example, if the target parameters include clockclass and clockAccuracy, the clockclass carried by the first Announce message is inferior to the clockclass carried by the second Announce message, and the clockAccuracy carried by the first Announce message is inferior to the clockAccuracy carried by the second Announce message.

[0170] When the second node is a source node (i.e., a time server), the level corresponding to the target parameter when the time server is in lock mode can be used as the reference level, and accordingly, the target parameter carried by the first Announce message is inferior to the target parameter when the time server is in lock mode. The target parameter when the time server is in lock mode can be defined by the PTP protocol. For example, the PTP protocol defines that the clockclass when the time server is in lock mode is 6, and the value of the clockclass carried in the first Announce message is a value greater than 6, such as 248. In addition, when the time synchronization of the time server is determined, the target parameter carried in the first Announce message is the target parameter when the time server is in lock mode.

[0171] Since the level corresponding to the target parameter is lower than the reference level, when selecting a clock source, the first node is less likely to select the clock source corresponding to the port receiving the first Announce message.

[0172] It should be noted that, due to different standards, the reference levels corresponding to the target parameters of the second node during time synchronization are different. Different reference levels lead to different values ​​of the target parameters. The reference levels of each node are usually the same. In cases where the reference levels of each node may be different, the level corresponding to the target parameter carried by the second node in the first Announce message may be lower than the minimum value of the reference levels of all types of nodes. For example, for the target parameter clockclass, in the 1588v2, G.8275.1 and G.8275.2 protocol standards, when the clockclass is at the reference level, the value of the clockclass is 6. In the G8265.1 protocol standard, when the clockclass is at the reference level, the value of the clockclass is 84.

[0173] Exemplarily, in the 1588v2 protocol standard, when clockclass is the base level, the value of the clockclass is 6. If the time synchronization of the second node is uncertain, the value of the clockclass can be set to 187 or 248. The level corresponding to the clockclass value of 187 or 248 is lower than the level corresponding to the clockclass value of 6, and is also lower than the level corresponding to the clockclass value of 84. In this case, if the level of the target parameter in the first Announce message sent by other time synchronized nodes is higher than the level of the target parameter in the first Announce message sent by the second node, the first node does not select the clock source corresponding to the port that receives the first Announce message.

[0174] In addition, the master clock identifier included in the first Announce message may also be a clock identifier (clockIdentity) in a default dataset (default dataset) of the second node.

[0175] Regarding the manner in which the second node generates the first Announce message according to the second Announce message, in an exemplary embodiment, the manner includes but is not limited to the following manner:

[0176] Method 1: Modify the level of the target parameter in the second Announce message to obtain the first Announce message. When modifying, modify the target parameter in the second Announce message to a parameter with a level lower than that of the target parameter. For example, if the clockclass in the second Announce message is 6, modify the value of clockclass to a value greater than 6, such as 248.

[0177] In this way, the second node acts as an intermediate node and receives the second Announce message sent by the upstream node. If the time of the upstream node is synchronized, the level of the target parameter in the second Announce message is the baseline level of the upstream node. The baseline levels of different nodes may be different. When the time synchronization is uncertain, the second node modifies the level of the target parameter in the second Announce message, such as downgrading the target parameter in the second Announce message, thereby obtaining the first Announce message carrying the downgraded target parameter. Among them, if the baseline levels of each node are the same, the level corresponding to the downgraded target parameter carried in the first Announce message is lower than the baseline level of the second node. If the baseline levels of each node are different, the level corresponding to the downgraded target parameter carried in the first Announce message is lower than the minimum value of the baseline level of all types of nodes.

[0178] It should be noted that, since the source port and destination port corresponding to the second Announce message and the first Announce message are different, in the process of modifying the second Announce message to obtain the first Announce message, in addition to downgrading the target parameters, the source port and destination port addresses in the second Announce message are also modified.

[0179] Method 2: Generate the first Announce message based on the information in the second Announce message. When generating the first Announce message, fill the parameters with a lower level than the target parameters in the second Announce message into the corresponding fields of the first Announce message. For example, if the clockclass in the second Announce message is 6, fill a value greater than 6 (such as 248) into the clockclass field of the first Announce message.

[0180] In the second method, the second node acts as an intermediate node. After receiving the second Announce message, the second node parses the second Announce message to obtain the information in the second Announce message. Afterwards, the second node generates the first Announce message based on the second node's own situation and the information in the second Announce message when time synchronization is uncertain. In other words, the difference between the second method and the first method is that the second method does not modify the second Announce message, but regenerates a new Announce message, namely the first Announce message.

[0181] In implementation mode B, the target parameter carried in the first Announce message is a default clock parameter of the second node, such as a parameter in a default dataset of the second node. The default clock parameter is a preset parameter.

[0182] It should be noted that, since the value in the default clock parameter is usually a relatively poor value, the level corresponding to the default clock parameter of the second node is usually lower than the reference level in Implementation A.

[0183] In addition, the master clock identifier included in the first Announce message may also be a clock identifier (clockIdentity) in a default dataset (default dataset) of the second node.

[0184] The manner in which the second node generates the first Announce message according to the second Announce message refers to the above-mentioned manner 1 and manner 2, which will not be described in detail.

[0185] It should be noted that both the above method 1 and method 2 take the second node as an intermediate node as an example. For the case where the second node is the first node in the network to initiate an Announce message (i.e., the source node) rather than an intermediate node, the second node can directly generate the first Announce message based on its own situation when time synchronization is uncertain.

[0186] 802. The second node sends a first Announce message to the first node. The parameters carried in the first Announce message are used to select a clock source.

[0187] After the second node sends the first Announce message to the first node, the first node parses the first Announce message. If the baseline levels of the nodes are the same, the level corresponding to the downgraded target parameter carried in the first Announce message is lower than the baseline level of the second node. If the baseline levels of the nodes are different, the level corresponding to the downgraded target parameter carried in the first Announce message is lower than the minimum value of the baseline levels of all types of nodes. Therefore, when selecting a clock source, the first node will not select the clock source corresponding to the port that receives the first Announce message.

[0188] The method provided in the embodiment of the present application, when the time synchronization of the second upstream node is uncertain, carries a target parameter whose level is lower than the reference level in the first Announce message, so that when the first downstream node selects a clock source, due to the low level of the target parameter in the first Announce message, it does not select the clock source corresponding to the port receiving the first Announce message, thereby avoiding the time jump of the downstream node due to the uncertain time synchronization of the upstream node, thereby affecting the time jump of the entire network and the normal operation of the business.

[0189] It should be noted that the above Figure 8 In the illustrated embodiment, only the case where the time synchronization of the second node is not determined, the first node does not select the clock source corresponding to the port receiving the first Announce message, thereby avoiding time jumps is explained as an example. If the time of the second node is subsequently synchronized, the level of the target parameter in the Announce message sent to the first node can be the reference level of the second node, so that the first node selects the clock source corresponding to the port receiving the first Announce message as the selection object for clock source selection.

[0190] The embodiment of the present application provides a device for implementing clock source selection, the device is applied to a first node, see Fig. 9 , the device comprises:

[0191] The receiving module 901 is configured to receive a first message sent by a second node through a first port on a first node;

[0192] The selection module 902 is used for, when the first message carries the first mark, the first node does not select the clock source corresponding to the first port when selecting the clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

[0193] In an exemplary embodiment, the selection module 902 is used to select the clock source without using the clock source data received through the first port when selecting the clock source.

[0194] In an exemplary embodiment, the selection module 902 is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select the clock source according to the clock source data sets corresponding to the ports of the first node, or select the clock source according to the non-empty clock source data sets in the clock source data sets corresponding to the ports of the first node.

[0195] In an exemplary embodiment, the selection module 902 is used to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, indicating that a signal anomaly occurs at the first port; based on the first value of the signal anomaly attribute, the clock source data set corresponding to the first port is set to an empty set.

[0196] In an exemplary embodiment, the signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

[0197] In an exemplary embodiment, the selection module 902 is configured to determine that a packet timing signal fail PTSF event occurs at the first port based on the first flag; and set the value of portDS.SF of the first port to a first value based on the PTSF event.

[0198] In an exemplary embodiment, the PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event, or an extended PTSF event.

[0199] In an exemplary embodiment, the first message is an Announce message.

[0200] In an exemplary embodiment, the synchronization undetermined flag synchronizationUncertain in the Announce message is used to carry the first flag, and when the value of synchronizationUncertain is the third value, it is used to indicate that the time synchronization of the second node is uncertain.

[0201] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.

[0202] The embodiment of the present application provides a device for implementing clock source selection, the device is applied to the second node, see Fig.10 , the device comprises:

[0203] The generating module 1001 is configured to generate a first Announce message.

[0204] The sending module 1002 is used to send a first Announce message to the first node, and the parameters carried in the first Announce message are used to select a clock source.

[0205] The specific implementation of the generation module 1001 includes the following implementation X and implementation Y, which correspond to the following respectively: Figure 8 Embodiment A and embodiment B in the method examples shown.

[0206] Implementation method X: When the time synchronization of the second node is uncertain, the level corresponding to the target parameter carried in the first Announce message generated by the generation module 1001 is lower than the reference level, and the reference level is the level corresponding to the target parameter of the second node during time synchronization.

[0207] In an exemplary embodiment, the target parameter is one or more of the clock class clockclass, the clock accuracy clockAccuracy, and the offset scaled logarithmic variance offsetScaledLogVariance parameters.

[0208] When the second node is an intermediate node, in an exemplary embodiment, the generation module 1001 is used to receive the second Announce message sent by the upstream node, and generate the first Announce message according to the second Announce message. In this implementation, the target parameter carried by the first Announce message is inferior to the target parameter carried in the second Announce message (that is, the level of the target parameter carried in the second Announce message is used as the reference level). When generating the first Announce message, the level of the target parameter in the second Announce message can be modified to obtain the first Announce message, or, based on the information in the second Announce message, a first announcement message is generated.

[0209] When the second node is a time server, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in lock mode (ie, the level of the target parameter when the time server is in lock mode is used as the reference level).

[0210] Implementation method Y: When the time synchronization of the second node is uncertain, the target parameters carried in the first Announce message generated by the generation module 1001 are the default clock parameters of the second node, such as the parameters in the default dataset of the second node.

[0211] It should be understood that the above Fig. 9 and Fig.10 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0212] An embodiment of the present application provides a system for implementing clock source selection, the system comprising: a first node and a second node;

[0213] The second node is used to send a first message to the first port of the first node;

[0214] The first node is used to receive a first message sent by a second node through a first port on the first node; when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

[0215] In an exemplary embodiment, the first node is configured to select a clock source without using clock source data received through the first port when selecting a clock source.

[0216] In an exemplary embodiment, the first node is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select the clock source according to the clock source data sets corresponding to the ports of the first node, or select the clock source according to the non-empty clock source data sets in the clock source data sets corresponding to the ports of the first node.

[0217] In an exemplary embodiment, the first node is used to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, indicating that a signal anomaly occurs at the first port; based on the first value of the signal anomaly attribute, the clock source data set corresponding to the first port is set to an empty set.

[0218] In an exemplary embodiment, the signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

[0219] In an exemplary embodiment, the first node is configured to determine that a packet timing signal fail PTSF event occurs at the first port based on the first flag; and set the value of portDS.SF of the first port to a first value based on the PTSF event.

[0220] In an exemplary embodiment, the PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event, or an extended PTSF event.

[0221] In an exemplary embodiment, the first message is an Announce message.

[0222] In an exemplary embodiment, the synchronization undetermined flag synchronizationUncertain in the Announce message is used to carry the first flag, and when the value of synchronizationUncertain is the third value, it is used to indicate that the time synchronization of the second node is uncertain.

[0223] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.

[0224] It should be understood that the above system and Figure 2 The method embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, which will not be repeated here.

[0225] An embodiment of the present application provides a system for implementing clock source selection, the system comprising: a first node and a second node;

[0226] The second node is used to generate a first Announce message and send the first Announce message to the first node;

[0227] The first node is used to receive a first Announce message sent by the second node, where the parameters carried in the first Announce message are used to select a clock source.

[0228] like Figure 8 As described in implementation A of the method embodiment shown, when the time synchronization of the second node is uncertain, the level corresponding to the target parameter carried in the first Announce message is lower than the reference level, and the reference level is the level corresponding to the target parameter of the second node during time synchronization.

[0229] In an exemplary embodiment, the target parameter is one or more of the clock class clockclass, the clock accuracy clockAccuracy, and the offset scaled logarithmic variance offsetScaledLogVariance parameters.

[0230] In an exemplary embodiment, the second node is used to receive a second Announce message sent by an upstream node, and generate the first Announce message according to the second Announce message. In this implementation, the target parameter carried by the first Announce message is inferior to the target parameter carried in the second Announce message (i.e., the level of the target parameter carried in the second Announce message is used as the reference level). When generating the first Announce message, the level of the target parameter in the second Announce message can be modified to obtain the first Announce message, or, based on the information in the second Announce message, a first announcement message is generated.

[0231] When the second node is a time server, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in lock mode (ie, the level of the target parameter when the time server is in lock mode is used as the reference level).

[0232] like Figure 8As described in implementation B of the method embodiment shown, when the time synchronization of the second node is uncertain, the target parameters carried in the first Announce message are the default clock parameters of the second node, such as the parameters in the default dataset of the second node.

[0233] It should be understood that the above system and Figure 8 The method embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, which will not be repeated here.

[0234] See also Fig.11 The embodiment of the present application further provides a device 1100 for implementing clock source selection. Fig.11 The device 1100 for implementing clock source selection is used to perform the operations involved in the method for implementing clock source selection. The device 1100 for implementing clock source selection includes: a processor 1102 and a port 1103, and the processor 1102 and the port 1103 are connected via a bus 1104.

[0235] The port 1103 is used to communicate with other devices in the network. The port 1103 can be implemented in a wireless or wired manner. The processor 1102 is used to implement any of the above-mentioned methods for implementing clock source selection.

[0236] In an exemplary embodiment, the device 1100 for implementing clock source selection also includes a memory 1101, which stores at least one instruction, and the at least one instruction is loaded and executed by a processor 1102. The memory 1101, the processor 1102 and the port 1103 are connected via a bus 1104.

[0237] It should be understood that Fig.11Only a simplified design of a device 1100 for implementing clock source selection is shown. In practical applications, the device for selecting a clock source may include any number of interfaces, processors or memories. In addition, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the advanced RISC machines (ARM) architecture.

[0238] Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0239] The memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory, wherein the nonvolatile memory may be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).

[0240] A computer-readable storage medium is also provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement any of the methods for selecting a clock source as described above.

[0241] The present application provides a computer program. When the computer program is executed by a computer, a processor or a computer can be enabled to perform the corresponding operations and / or processes in the above method embodiments.

[0242] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.

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

Claims

1. A method for implementing clock source selection, characterized in that: The method comprises: The first node receives a first message sent by the second node through a first port on the first node; When the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

2. The method according to claim 1, characterized in that When selecting a clock source, the first node does not select the clock source corresponding to the first port, including: when selecting a clock source, the first node does not use clock source data received through the first port to select a clock source.

3. The method according to claim 2, characterized in that When selecting a clock source, the first node does not use the clock source data received through the first port to select a clock source, including: According to the first mark, the clock source data set corresponding to the first port is set to an empty set; A clock source is selected according to a clock source data set corresponding to each port of the first node, or a clock source is selected according to a non-empty clock source data set in the clock source data set corresponding to each port of the first node.

4. The method according to claim 3, characterized in that: The step of setting the clock source data set corresponding to the first port to an empty set according to the first mark includes: Setting the value of the signal anomaly attribute of the first port to a first value based on the first mark, so as to indicate that a signal anomaly occurs at the first port; Based on the first value of the signal anomaly attribute, a clock source data set corresponding to the first port is set to an empty set.

5. The method according to claim 4, characterized in that The signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

6. The method according to claim 5, characterized in that The step of setting the value of the signal anomaly attribute of the first port to a first value based on the first mark includes: determining, based on the first mark, that a packet timing signal failure PTSF event occurs on the first port; Based on the PTSF event, a value of portDS.SF of the first port is set to a first value.

7. The method according to claim 6, characterized in that The PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event or an extended PTSF event.

8. The method according to any one of claims 1 to 7, characterized in that: The first message is an Announce message.

9. The method according to claim 8, characterized in that The synchronization undetermined flag synchronizationUncertain in the Announce message is used to carry the first flag, and when the value of the synchronizationUncertain is TRUE, it is used to indicate that the time synchronization of the second node is uncertain.

10. A method for implementing clock source selection, characterized in that: The method comprises: The second node generates a first Announce message, and when the time synchronization of the second node is uncertain, the target parameter carried in the first Announce message is inferior to the target parameter carried in the second Announce message received from the upstream node of the second node; The second node sends the first Announce message to the first node, and the target parameter carried in the first Announce message is used by the first node to select a clock source.

11. The method according to claim 10, characterized in that The target parameter includes a first target parameter and / or a second target parameter, wherein the first target parameter is used to characterize the master clock priority, and the second target parameter is used to characterize the master clock quality.

12. The method according to claim 11, characterized in that The second target parameter includes one or more of a parameter for characterizing the traceability of the International Atomic Time (TAI) of the clock, a parameter for characterizing the accuracy of the clock, and a parameter for characterizing the stability of the clock.

13. The method according to claim 12, characterized in that The parameters used to characterize the traceability of the international atomic time TAI of the clock include the clock class clockclass, the parameters used to characterize the clock accuracy include the clock accuracy clockAccuracy, and the parameters used to characterize the clock stability include the logarithmic variance offsetScaledLogVariance of the offset scale.

14. The method according to any one of claims 10 to 13, characterized in that: The first Announce message further includes a master clock identifier, and the master clock identifier included in the first Announce message is different from the master clock identifier included in the second Announce message.

15. The method according to claim 14, characterized in that The master clock identifier included in the first Announce message is the clock identifier clockIdentity in the default dataset of the second node.

16. The method according to any one of claims 10-13 and 15, characterized in that: The time synchronization uncertainty of the second node includes: The port of the second node for receiving the second Announce message is in an uncalibrated UNCALIBRATED state; or, A time difference between the time of the second node and the time of the clock source signal is greater than a threshold.

17. The method according to claim 14, characterized in that The time synchronization uncertainty of the second node includes: The port of the second node for receiving the second Announce message is in an uncalibrated UNCALIBRATED state; or, A time difference between the time of the second node and the time of the clock source signal is greater than a threshold.

18. A method for implementing clock source selection, characterized in that: The method comprises: The time server generates a first Announce message, when the time synchronization of the time server is uncertain, the target parameter carried in the first Announce message is inferior to the target parameter when the time server is in a locked mode; The time server sends the first Announce message to the first node, and the target parameter carried in the first Announce message is used by the first node to select a clock source.

19. The method according to claim 18, characterized in that The target parameter includes a first target parameter and / or a second target parameter, wherein the first target parameter is used to characterize the master clock priority, and the second target parameter is used to characterize the master clock quality.

20. The method according to claim 19, characterized in that The second target parameter includes one or more of a parameter for characterizing the traceability of the International Atomic Time (TAI) of the clock, a parameter for characterizing the accuracy of the clock, and a parameter for characterizing the stability of the clock.

21. The method according to claim 20, characterized in that The parameters used to characterize the traceability of the international atomic time TAI of the clock include the clock class clockclass, the parameters used to characterize the clock accuracy include the clock accuracy clockAccuracy, and the parameters used to characterize the clock stability include the logarithmic variance offsetScaledLogVariance of the offset scale.

22. The method according to any one of claims 18 to 21, characterized in that: The time synchronization uncertainty of the time server includes that the time difference between the time of the time server and the time of the received satellite signal is greater than a threshold.

23. A method for implementing clock source selection, characterized in that: The method comprises: The second node generates a first Announce message, and when the time synchronization of the second node is uncertain, the target parameter carried in the first Announce message is a default clock parameter of the second node; The second node sends the first Announce message to the first node, and the target parameter carried in the first Announce message is used by the first node to select a clock source.

24. The method according to claim 23, characterized in that The target parameter includes a first target parameter and / or a second target parameter, wherein the first target parameter is used to characterize the master clock priority, and the second target parameter is used to characterize the master clock quality.

25. The method according to claim 24, characterized in that The second target parameter includes one or more of a parameter for characterizing the traceability of the International Atomic Time (TAI) of the clock, a parameter for characterizing the accuracy of the clock, and a parameter for characterizing the stability of the clock.

26. The method according to claim 25, characterized in that The parameters used to characterize the traceability of the international atomic time TAI of the clock include the clock class clockclass, the parameters used to characterize the clock accuracy include the clock accuracy clockAccuracy, and the parameters used to characterize the clock stability include the logarithmic variance offsetScaledLogVariance of the offset scale.

27. The method according to any one of claims 23 to 26, characterized in that: Before the second node generates the first Announce message, the method further includes: the second node receiving a second Announce message sent by an upstream node; The second node generating the first Announce message includes: generating the first Announce message according to the second Announce message.

28. The method according to any one of claims 23 to 26, characterized in that: The default clock parameters of the second node are parameters in a default dataset of the second node.

29. The method according to claim 27, characterized in that The default clock parameters of the second node are parameters in a default dataset of the second node.

30. The method according to any one of claims 23-26 and 29, characterized in that: The time synchronization uncertainty of the second node includes: The port of the second node for receiving the second Announce message is in an UNCALIBRATED state; or, A time difference between the time of the second node and the time of the clock source signal is greater than a threshold.

31. The method according to claim 27, characterized in that The time synchronization uncertainty of the second node includes: The port of the second node for receiving the second Announce message is in an UNCALIBRATED state; or, A time difference between the time of the second node and the time of the clock source signal is greater than a threshold.

32. The method according to claim 28, characterized in that The time synchronization uncertainty of the second node includes: The port of the second node for receiving the second Announce message is in an UNCALIBRATED state; or, A time difference between the time of the second node and the time of the clock source signal is greater than a threshold.

33. A device for implementing clock source selection, characterized in that: The device is applied to a first node, and includes: A receiving module, configured to receive a first message sent by a second node through a first port on the first node; A selection module is used for, when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

34. The device according to claim 33, characterized in that The selection module is used to select a clock source without using the clock source data received through the first port when selecting a clock source.

35. The device according to claim 34, characterized in that The selection module is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select a clock source according to the clock source data set corresponding to each port of the first node, or select a clock source according to a non-empty clock source data set in the clock source data set corresponding to each port of the first node.

36. The device according to claim 35, characterized in that The selection module is configured to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, so as to indicate that a signal anomaly occurs at the first port; Based on the first value of the signal anomaly attribute, a clock source data set corresponding to the first port is set to an empty set.

37. The device according to claim 36, characterized in that The signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

38. The device according to claim 37, characterized in that The selection module is used to determine that a packet timing signal failure PTSF event occurs at the first port based on the first mark; and set the value of portDS.SF of the first port to a first value based on the PTSF event.

39. The device according to claim 38, characterized in that The PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event or an extended PTSF event.

40. The device according to any one of claims 33 to 39, characterized in that: The first message is an Announce message.

41. The device according to claim 40, characterized in that The synchronization undetermined flag synchronizationUncertain in the Announce message is used to carry the first flag, and when the value of the synchronizationUncertain is TRUE, it is used to indicate that the time synchronization of the second node is uncertain.

42. A device for implementing clock source selection, characterized in that: The device comprises: a generating module and a sending module; The generating module is used to perform the operation of generating a first Announce message according to any one of the methods described in claims 10-32; The sending module is used to send the first Announce message to the first node, and the target parameter carried in the first Announce message is used by the first node to select a clock source.

43. A system for implementing clock source selection, characterized in that: The system comprises: a first node and a second node; The second node is used to send a first message to the first port of the first node; The first node is used to receive a first message sent by the second node through a first port on the first node; when the first message carries a first mark, the first node does not select the clock source corresponding to the first port when selecting a clock source, and the first mark is used to indicate that the time synchronization of the second node is uncertain.

44. The system according to claim 43, characterized in that The first node is used for selecting a clock source without using the clock source data received through the first port when selecting a clock source.

45. The system according to claim 44, characterized in that The first node is used to set the clock source data set corresponding to the first port to an empty set according to the first mark; select a clock source according to the clock source data sets corresponding to the ports of the first node, or select a clock source according to a non-empty clock source data set in the clock source data sets corresponding to the ports of the first node.

46. ​​The system according to claim 45, characterized in that The first node is used to set the value of the signal anomaly attribute of the first port to a first value based on the first mark, so as to indicate that a signal anomaly occurs at the first port; Based on the first value of the signal anomaly attribute, a clock source data set corresponding to the first port is set to an empty set.

47. The system according to claim 46, characterized in that The signal abnormality attribute of the first port is a port signal failure attribute portDS.SF, and a first value of portDS.SF is true TRUE.

48. The system according to claim 47, characterized in that The first node is configured to determine, based on the first mark, that a packet timing signal failure PTSF event occurs at the first port; and, based on the PTSF event, set a value of portDS.SF of the first port to a first value.

49. The system according to claim 48, characterized in that The PTSF event is a packet timing signal failure-loss of synchronization PTSF-lossSync event, a packet timing signal failure-unusable PTSF-unusable event or an extended PTSF event.

50. The system according to any one of claims 43 to 49, characterized in that: The first message is an Announce message.

51. A system for implementing clock source selection, characterized in that: The system comprises: a first node and a second node; The second node is used to implement the method according to any one of claims 10-32; The first node is used to receive a first Announce message sent by the second node, and select a clock source according to a target parameter carried in the first Announce message.

52. A device for implementing clock source selection, characterized in that: The device comprises: a port and a processor, wherein the port is used to communicate with other nodes, and the processor is used to implement the method for clock source selection described in any one of claims 1-32.

53. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the method for implementing clock source selection as described in any one of claims 1-32.

54. A computer program product, characterized in that The computer program product comprises computer program codes, and when the computer program codes are executed by a computer, the computer is enabled to execute the method for implementing clock source selection as claimed in any one of claims 1 to 32.

Citation Information

Patent Citations

  • Method and device for selecting time synchronization sources

    CN102957488A

  • Synchronization time source selection indication method, device and system

    CN105323086A