Method, device, system and storage medium for implementing clock source selection
By carrying marks when selecting clock source and setting the clock source data set to an empty set, the time jump problem caused by node restart or clock source switching in IEEE 1588 and NTP protocols is solved, ensuring the stability of time synchronization throughout the network.
Patent Information
- Application Number
- CN202210112059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-06
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2039-09-06
AI Technical Summary
In IEEE 1588 and NTP protocols, time jumps may occur when node restarts or clock source switches, affecting the overall network time synchronization and normal operation of services.
By carrying marks when selecting clock sources, downstream nodes avoid using upstream nodes to synchronize uncertain clock sources, set the corresponding clock source data set as an empty set, and select clock sources for other ports to avoid time jumps.
It effectively avoids downstream node time jumps due to uncertain time synchronization of upstream nodes, ensuring the stability of time synchronization of the entire network and the normal operation of services.
Smart Images

Figure CN114448548B_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application with application number 201910844122.1. Technical Field
[0002] 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
[0003] 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
[0004] 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:
[0005] 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.
[0006] 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.
[0007] 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.
[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 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.
[0009] 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.
[0010] 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.
[0011] 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.
[0012] 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.
[0013] 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.
[0014] In an exemplary embodiment, the first message is an Announce message.
[0015] 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.
[0016] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.
[0017] In a second aspect, a method for implementing clock source selection is provided, the method comprising: when the time synchronization of a second node is uncertain, the second node generates a first announcement message, 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 a clock source.
[0018] 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.
[0019] 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.
[0020] 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.
[0021] 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.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] In an exemplary embodiment, the first message is an Announce message.
[0029] 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.
[0030] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.
[0031] In a fourth aspect, a device for implementing clock source selection is provided, the device being applied to a second node, the device comprising:
[0032] 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;
[0033] 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.
[0034] 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.
[0035] 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.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] In an exemplary embodiment, the first message is an Announce message.
[0044] 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.
[0045] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] As an exemplary embodiment, the number of the processors is one or more, and the number of the memories is one or more.
[0053] As an exemplary embodiment, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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
[0058] Figure 1 A schematic diagram of a 1588 synchronization network scenario provided in an embodiment of the present application;
[0059] Figure 2A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0060] Figure 3 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0061] Figure 4 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0062] Figure 5 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0063] Figure 6 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0064] Figure 7 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0065] Figure 8 A flow chart of a method for implementing clock source selection provided in an embodiment of the present application;
[0066] Fig. 9 A schematic diagram of the structure of a device for implementing clock source selection provided in an embodiment of the present application;
[0067] Fig.10 A schematic diagram of the structure of a device for implementing clock source selection provided in an embodiment of the present application;
[0068] 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
[0069] 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.
[0070] 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.
[0071] 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.
[0072] The ports of each node have three port states, including master state (master, M), slave state (slave, S) and passive state (passive, P). The communication port with the port state of Master is referred to as Master port. The Master port is used to broadcast the best quality clock source selected by this node to the entire network; the Slave port is used to track the clock of the upstream node; 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 1 As 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 1For 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.
[0073] 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 does not jump. 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.
[0074] 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.
[0075] 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.
[0076] Case 2: The node periodically checks 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.
[0077] Case 3: After the node is restarted or the clock source is changed, the time difference with the upstream node is detected to be 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.
[0078] It can be understood that both the above-mentioned cases 2 and 3 judge that the time synchronization of the node is uncertain by detecting that the time difference with the upstream node is greater than the threshold. For the case where the time difference with the upstream node is less than the threshold, the time synchronization of the node can be judged. In addition, the thresholds in cases 2 and 3 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.
[0079] by Figure 1 For example, during the time synchronization process of node B, the time of node B will be adjusted according to the time of node A. 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 of node A, the time difference between node B and node A is calculated based on the PTP message of node A. If the time difference is less than the threshold, it indicates that the time synchronization of node B is in place. If the time difference is not less than the threshold, it indicates that the time synchronization of node B is uncertain.
[0080] 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.
[0081] 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:
[0082] 201. A first node receives a first message sent by a second node through a first port on the first node.
[0083] 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.
[0084] 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; management is used to query and update the PTP data set maintained by the clock, and signaling 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 an 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.
[0085] 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.
[0086] 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 TURE, 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 TURE 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.
[0087] 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 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, so that the first node will not select the second node as the clock source.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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:
[0093] 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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:
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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:
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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:
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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:
[0123] 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.
[0124] 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.
[0125] 503 , the node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-syncUncertain event.
[0126] 504. Node E sets the clock source data set corresponding to the first port to empty based on the value of portDS.SF.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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:
[0131] 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.
[0132] 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.
[0133] 603 , node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-lossSync event.
[0134] 604 , node E sets the clock source data set of the first port to empty based on the value of portDS.SF.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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:
[0139] 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.
[0140] 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.
[0141] 703 , node E sets the value of portDS.SF of the first port to TRUE based on the PTSF-unusable event.
[0142] 704 , node E sets the clock source data set of the first port to empty based on the value of portDS.SF.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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 prevent the clock source of the first port from being selected, thereby avoiding time jumps in the first node. Figure 8 As shown, the method for implementing clock source selection provided by the embodiment of the present application includes:
[0148] 801, when the time synchronization of the second node is uncertain, the second node generates a first Announce message, and 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.
[0149] In an exemplary embodiment, the target parameter is one or more of clockclass, clockAccuracy, and offsetScaledLogVariance. Since the level corresponding to the target parameter is lower than the reference level, the first node will not select the clock source corresponding to the port receiving the first Announce message when selecting a clock source.
[0150] 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 protocol standard, 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.
[0151] For example, 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. The level corresponding to the clockclass value of 87 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.
[0152] Regarding the manner in which the second node generates the first Announce message, in an exemplary embodiment, the manner includes but is not limited to the following manner:
[0153] Method 1: The second node receives the second Announce message sent by the upstream node, modifies the level of the target parameter in the second Announce message, and obtains the first Announce message.
[0154] In this way, the second node acts as an intermediate node, and after receiving 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.
[0155] 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.
[0156] Method 2: Generate the first Announce message according to the information in the second Announce message.
[0157] 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.
[0158] It should be noted that both the above methods 1 and 2 take the second node as an intermediate node as an example. When the second node is the first node in the network to initiate an Announce message 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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:
[0164] The receiving module 901 is configured to receive a first message sent by a second node through a first port on a first node;
[0165] 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.
[0166] 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.
[0167] 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.
[0168] 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.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] In an exemplary embodiment, the first message is an Announce message.
[0173] 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.
[0174] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.
[0175] 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:
[0176] The generating module 1001 is used 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;
[0177] 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.
[0178] 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.
[0179] In an exemplary embodiment, the generation module 1001 is used to receive a second Announce message sent by an upstream node, modify the level of the target parameter in the second Announce message to obtain a first Announce message, or generate a first Announce message according to information in the second Announce message.
[0180] 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.
[0181] An embodiment of the present application provides a system for implementing clock source selection, the system comprising: a first node and a second node;
[0182] The second node is used to send a first message to the first port of the first node;
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] In an exemplary embodiment, the first message is an Announce message.
[0191] 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.
[0192] In an exemplary embodiment, the third value of synchronizationUncertain is TRUE.
[0193] 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.
[0194] An embodiment of the present application provides a system for implementing clock source selection, the system comprising: a first node and a second node;
[0195] The second node is used 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; and send the first Announce message to the first node;
[0196] 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.
[0197] 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.
[0198] 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 a first Announce message, or generate a first Announce message according to information in the second Announce message.
[0199] 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.
[0200] 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.
[0201] 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.
[0202] 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.
[0203] It should be understood that Fig.11 Only 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.
[0204] 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.
[0205] 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).
[0206] 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.
[0207] 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.
[0208] 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.
[0209] 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, and the uncertainty of the time synchronization of the second node is related to a large adjustment of the time of the second node.
2. The method according to claim 1, characterized in that The large adjustment of the time of the second node is determined according to that the time difference between the second node and an upstream node of the second node is greater than a threshold.
3. The method according to claim 1, characterized in that A large adjustment in the timing of the second node corresponds to an ingress port of the second node being in an uncalibrated state.
4. The method according to any one of claims 1 to 3, 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.
5. The method according to claim 4, 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 the clock source data sets corresponding to the ports of the first node, or a clock source is selected only according to the non-empty clock source data sets in the clock source data sets corresponding to the ports of the first node.
6. The method according to claim 5, 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.
7. The method according to claim 6, 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.
8. The method according to claim 7, 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.
9. The method according to claim 8, 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.
10. The method according to any one of claims 1-3 and 5-9, characterized in that: The first message is an Announce message.
11. The method according to claim 10, 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.
12. The method according to claim 4, characterized in that The first message is an Announce message.
13. The method according to claim 12, 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.
14. A method for implementing clock source selection, characterized in that: The method comprises: The second node generates a first message, where the first message carries a first mark, where the first mark is used to indicate that time synchronization of the second node is uncertain, and the uncertainty of time synchronization of the second node is related to a large adjustment of the time of the second node; The second node sends the first message to the first node, and the first mark is used for the first node to not select the clock source corresponding to the port on the first node that receives the first message when selecting a clock source.
15. The method according to claim 14, characterized in that The method further comprises: When the second node detects that the time difference between the second node and an upstream node of the second node is greater than a threshold, it is determined that the time of the second node has been greatly adjusted.
16. The method according to claim 15, characterized in that The second node detecting that the time difference between the second node and an upstream node of the second node is greater than a threshold includes: the second node periodically detecting that the time difference between the second node and an upstream node of the second node is greater than the threshold.
17. The method according to claim 15, characterized in that The second node detecting that the time difference between the second node and an upstream node of the second node is greater than a threshold includes: after the second node is restarted or the clock source is changed, detecting that the time difference between the second node and an upstream node of the second node is greater than the threshold.
18. The method according to claim 14, characterized in that In case the ingress port of the second node is in an uncalibrated state, the timing of the second node is greatly adjusted.
19. The method according to any one of claims 14 to 18, characterized in that: The first message is an Announce message.
20. A method for implementing clock source selection, characterized in that: The method comprises: When the time of the second node is greatly adjusted, the second node generates a first Announce message, the level corresponding to the target parameter carried in the first Announce message is lower than the reference level, the reference level is the level corresponding to the target parameter during time synchronization of the second node, and the large adjustment of the time of the second node is related to the uncertainty of the time synchronization of the second node; The first Announce message is sent to the first node, where the target parameter carried in the first Announce message is used to select a clock source.
21. The method according to claim 20, characterized in that The target parameter is one or more of the clock class clockclass, the clock accuracy clockAccuracy, or the logarithmic variance offsetScaledLogVariance parameter of the offset scale.
22. The method according to claim 20 or 21, characterized in that The second node generates a first Announce message, including: The second node receives a second Announce message sent by an upstream node of the second 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 according to information in the second Announce message.
23. 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, the first mark is used to indicate that the time synchronization of the second node is uncertain, and the uncertainty of the time synchronization of the second node is related to a large adjustment of the time of the second node.
24. The device according to claim 23, 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.
25. The device according to claim 24, 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 the clock source according to the clock source data sets corresponding to the ports of the first node, or select the clock source only according to the non-empty clock source data sets in the clock source data sets corresponding to the ports of the first node.
26. The device according to claim 25, 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.
27. The device according to claim 26, 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.
28. The device according to claim 27, 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.
29. The device according to claim 28, 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.
30. The device according to any one of claims 23 to 29, characterized in that: The first message is an Announce message.
31. The device according to claim 30, 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.
32. A device for implementing clock source selection, characterized in that: The device is applied to a second node, and includes: A generating module, configured to generate a first message, wherein 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, and the uncertainty of the time synchronization of the second node is related to a large adjustment of the time of the second node; The sending module is used to send the first message to the first node, and the first mark is used for the first node to not select the clock source corresponding to the port on the first node that receives the first message when selecting a clock source.
33. The device according to claim 32, characterized in that The generating module is further configured to determine that the time of the second node has been significantly adjusted when the second node detects that the time difference between the second node and an upstream node of the second node is greater than a threshold.
34. The device according to claim 33, characterized in that The generating module is used to periodically detect whether the time difference between the second node and the upstream node of the second node is greater than the threshold.
35. The device according to claim 33, characterized in that The generating module is used to detect that the time difference between the second node and an upstream node of the second node is greater than the threshold after the second node is restarted or the clock source is changed.
36. The device according to claim 32, characterized in that In case the ingress port of the second node is in an uncalibrated state, the timing of the second node is greatly adjusted.
37. The device according to any one of claims 32 to 36, characterized in that: The first message is an Announce message.
38. A device for implementing clock source selection, characterized in that: The device is applied to a second node, and includes: A generation module, used for generating a first announcement message when the time of the second node is greatly adjusted, wherein 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 synchronized with the time, and the large adjustment of the time of the second node is related to the uncertainty of the time synchronization of the second node; 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 to select a clock source.
39. The device according to claim 38, characterized in that The target parameter is one or more of the clock class clockclass, the clock accuracy clockAccuracy, or the logarithmic variance offsetScaledLogVariance parameter of the offset scale.
40. The device according to claim 38 or 39, characterized in that The generating module is used to receive a second Announce message sent by an upstream node of the second 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.
41. A system for implementing clock source selection, characterized in that: The system comprises an apparatus as claimed in any one of claims 23-31 and an apparatus as claimed in any one of claims 32-37.
42. 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 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 when the second node is time synchronized; send the first Announce message to the first node, and the triggering condition of the uncertain time synchronization of the second node includes that the ingress port of the second node is in an uncalibrated state; The first node is used to receive the first Announce message sent by the second node, and select a clock source according to a target parameter carried in the first Announce message.
43. The system according to claim 42, characterized in that The target parameter is one or more of the clock class clockclass, the clock accuracy clockAccuracy, or the logarithmic variance offsetScaledLogVariance parameter of the offset scale.
44. The system according to claim 42 or 43, characterized in that The second node is used to receive a second Announce message sent by an upstream node of the second node, modify the level of the target parameter in the second Announce message to obtain the first Announce message, or generate the first Announce message according to the information in the second Announce message.
45. 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 enable the device to implement the method for selecting a clock source as described in any one of claims 1-22.
46. 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 a processor to implement the method for selecting a clock source as described in any one of claims 1-22.
47. 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 selecting a clock source as claimed in any one of claims 1 to 22.
