Method for avoiding clock loop, upstream network element, downstream network element and storage medium

By generating and sending ancestral clock information with different priorities in the upstream network element and sending it to the downstream network element using PTP and GPS links, the problem of clock loops in the network is solved, and the ease of use and flexibility of time synchronization are achieved.

CN115549835BActive Publication Date: 2025-09-26ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110736290.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-09-26
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

When a network includes both GPS links and PTP links, clock loops are prone to occur in the time synchronization link.

Method used

The upstream network element generates and sends grandparent clock information with different priorities, and sends it to the downstream network element using the PTP link and GPS link respectively. This ensures that the downstream network element selects the time source with the higher priority as the PTP time source to avoid clock loops.

Benefits of technology

Without the need to manually configure the GPS port time source priority, the usability and flexibility of mixed selection of PTP and GPS time sources are guaranteed, avoiding clock loops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115549835B_ABST
    Figure CN115549835B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a method for avoiding clock loops, an upstream network element, a downstream network element and a storage medium. The upstream network element is set to use the priority value provided by the time source as the priority value of the ancestral clock to obtain first ancestral clock information; if there is a downstream network element connected via a PTP link, a first message is generated according to the first ancestral clock information, and the first message is sent to the downstream network element via the PTP link; if there is a downstream network element connected via a GPS link, second ancestral clock information is generated according to the first ancestral clock information, and a second message is generated according to the second ancestral clock information, and the second message is sent to the downstream network element via the GPS link; the priority corresponding to the second ancestral clock information is lower than the priority corresponding to the first ancestral clock information, so that the downstream network element that receives the first ancestral clock information and the second ancestral clock information selects the time source corresponding to the first ancestral clock information with a high priority as the PTP time source, thereby avoiding clock loops.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of communications, and in particular to a method for avoiding clock looping, an upstream network element, a downstream network element, and a storage medium. Background Art

[0002] The IEEE 1588 protocol (i.e., Precision Clock Synchronization Protocol for Networked Measurement and Control Systems) has received significant attention and has been widely used in test and control systems, automation, remote communications, and power systems. It defines a Precision Time Protocol (PTP) that synchronizes independently running clocks on separate nodes within a measurement and control system to a single, high-precision and reliable clock. This enables sub-microsecond synchronization of clocks in sensors, actuators, and other terminal devices in distributed bus systems using standard Ethernet or other multicast technologies.

[0003] At present, some networks contain both Global Positioning System Time (GPS) links and PTP links. When the PTP link is normal, the devices / network elements / nodes (hereinafter collectively referred to as network elements) in the network usually directly obtain the time source in the time information transmitted through the PTP link as the PTP time source. When it is necessary to obtain the time source in the time information transmitted through the GPS link as the PTP time source, it is necessary to manually configure the priority of the time source in the time information transmitted through the GPS link. However, the manually configured priority often results in the priority of the time source being lower than the time priority of the parent clock, which easily leads to the problem of clock looping in the time synchronization link. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a method, upstream network element, downstream network element and storage medium for avoiding clock loops, aiming to solve the technical problem that clock loops are prone to occur in time synchronization links in networks that include both GPS links and PTP links.

[0005] To solve the above technical problems, an embodiment of the present application provides a method for avoiding clock loops, which is applied to upstream network elements in a network. The method for avoiding clock loops includes: receiving a priority value of a clock sent by a time source; using the priority value as the priority value of the ancestral clock to obtain first ancestral clock information; if there is a downstream network element connected via a Precision Time Protocol (PTP) link, generating a first message based on the first ancestral clock information, and sending the first message to the downstream network element via the PTP link; if there is a downstream network element connected via a Global Positioning System (GPS) link, generating a second ancestral clock information based on the first ancestral clock information, and generating a second message based on the second ancestral clock information, and sending the second message to the downstream network element via the GPS link; wherein the priority corresponding to the second ancestral clock information is lower than the priority corresponding to the first ancestral clock information, so that the downstream network element that receives the first ancestral clock information and the second ancestral clock information selects the time source corresponding to the first ancestral clock information with a higher priority as the PTP time source.

[0006] To achieve the above-mentioned purpose, an embodiment of the present application also provides a method for avoiding clock loops, which is applied to a downstream network element in a network, and the downstream network element is connected to the upstream network element in the network through a PTP link and a GPS link. The method for avoiding clock loops includes: receiving a first message carrying first ancestor clock information sent by the upstream network element through the PTP link, and the priority value in the first ancestor clock information is the same as the priority value of the clock sent by the time source; receiving a second message carrying second ancestor clock information sent by the upstream network element through the GPS link, and the priority corresponding to the second ancestor clock information is lower than the priority corresponding to the first ancestor clock information, and the priority values ​​in the second ancestor clock information are all greater than the priority values ​​in the first ancestor clock information; when the PTP link is available, based on the best master clock algorithm, the time source of the PTP port that receives the first message is used as the PTP time source; when the PTP link is unavailable and the GPS link is available, based on the best master clock algorithm, the time source of the GPS port that receives the second message is used as the PTP time source.

[0007] To achieve the above-mentioned purpose, an embodiment of the present application also provides an upstream network element for avoiding clock loops, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for avoiding clock loops as described above for upstream network elements in a network.

[0008] To achieve the above-mentioned purpose, an embodiment of the present application also provides a downstream network element for avoiding clock loops, including: a local clock; at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for avoiding clock loops as described above for downstream network elements in a network.

[0009] To achieve the above objectives, an embodiment of the present application further provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the above-described method for avoiding clock looping in an upstream network element in a network, or the method for avoiding clock looping in a downstream network element in a network.

[0010] The present application proposes a method for avoiding clock loops, an upstream network element, a downstream network element, and a storage medium. For any upstream network element in a network, when it is determined that the upstream network element has a downstream network element connected via a GPS link, second ancestor clock information with a lower priority than the first ancestor clock information is generated based on the first ancestor clock information sent by the time source with the same clock priority value, and a second message is generated based on the second ancestor clock information. The second message carrying the second ancestor clock information with a lower priority than the first ancestor clock information is sent to the corresponding downstream network element via the GPS link, so that the downstream network element that receives both the first ancestor clock information and the second ancestor clock information can select the perspective source corresponding to the first ancestor clock information with a higher priority as the PTP time source, thereby ensuring that each network element in a network that includes both PTP links and GPS links can use the time source with a higher priority as the PTP time source when achieving time synchronization, thereby avoiding clock loops in a network that includes both PTP links and GPS links.

[0011] In addition, due to the method for avoiding clock loops, upstream network elements, downstream network elements and storage media proposed in this application, without the need for manual intervention to configure the priority of the time source of the GPS port, it is possible to ensure that a network that includes both PTP links and GPS links will not experience clock loops while achieving time synchronization, thereby significantly enhancing the ease of configuration and flexibility when PTP and GPS are mixed to select time sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] One or more embodiments are exemplarily described by the figures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments.

[0013] Figure 1 This is a flow chart of a method for avoiding clock looping in an upstream network element in a network, provided by an embodiment of the present application;

[0014] Figure 2 yes Figure 1 A schematic diagram of the specific format of the first message involved in the illustrated embodiment;

[0015] Figure 3 yes Figure 1 A schematic diagram of the specific format of the second message involved in the illustrated embodiment;

[0016] Figure 4 yes Figure 1 A schematic diagram illustrating the interaction between the time source, upstream network element, and downstream network element involved in the illustrated embodiment to prevent clock loops;

[0017] Figure 5 This is a flow chart of a method for avoiding clock looping in a downstream network element in a network, provided by an embodiment of the present application;

[0018] Figure 6 This is a schematic diagram of the structure of an upstream network element for avoiding clock looping provided by an embodiment of the present application;

[0019] Figure 7 This is a structural diagram of a downstream network element for avoiding clock looping provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In the embodiments of this application, the term "and / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0021] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in each embodiment of the present application, many technical details are proposed to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present application. The various embodiments can be combined and referenced with each other under the premise of no contradiction.

[0023] See also Figure 1 , Figure 1 This is a flowchart of a method for avoiding clock looping provided in an embodiment of the present application. In this embodiment, the method is mainly applied to upstream network elements in the network.

[0024] It should be noted that the networking mentioned in this embodiment includes at least two network elements, one of which is used to receive the priority information of the clock of the time source, specifically the priority value, and is subsequently referred to as the upstream network element; and the other network element is used to receive the message sent by the upstream network element through the corresponding link, such as the PTP link and the GPS link, and is subsequently referred to as the downstream network element.

[0025] In addition, it is worth mentioning that in actual applications, if the network includes more than two network elements, there may be one network element that can be regarded as an upstream network element relative to the downstream network element with which it communicates, and can be regarded as a downstream network element relative to the upstream network element with which it communicates.

[0026] In addition, the network elements in the networking mentioned in this embodiment may specifically be devices in the automation system that require time information, such as computers, protection devices, fault filters, event sequence recording devices, safety automatic devices, etc., which are not listed one by one here and are not limited in this embodiment.

[0027] To better understand the method for avoiding clock looping provided by this embodiment, the following Figure 1 Provide specific instructions.

[0028] like Figure 1 As shown, the method for avoiding clock looping provided in this embodiment includes the following steps:

[0029] Step 101: Receive a clock priority value sent by a time source.

[0030] It is understandable that in actual applications, if the upstream network element is a network element in the network connected to the network time source server, then the time source mentioned in 101 is no longer the time source provided by the network time source server.

[0031] In one example, the network time source server refers to a high-tech device developed for time calibration of computers, automation devices, etc. This product can obtain standard time signals from GPS satellites (Beidou satellites, B code interfaces, PTP), and transmit these signals through various interfaces (NTP / SNTP, serial ports, B codes, PTP, pulses) to devices that require time information in the automation system, namely the upstream network elements mentioned in this embodiment. In this way, there is a standard time source in the system, thereby achieving time consistency of the entire system, that is, realizing time synchronization.

[0032] Furthermore, it is understandable that in this technical field, a clock priority is typically described as having two values: a first priority and a second priority, and each value corresponds to a specific value. Therefore, the aforementioned value of the clock priority received from the time source specifically includes the first priority value and the second priority value.

[0033] Step 102: Use the priority value as the priority value of the master clock to obtain first master clock information.

[0034] That is, the priority value in the first ancestor clock information is the same as the priority value provided by the time source.

[0035] Step 103: If there is a downstream network element connected via a Precision Time Protocol (PTP) link, generate a first message according to the first ancestor clock information, and send the first message to the downstream network element via the PTP link.

[0036] Specifically, if there is a downstream network element connected via a PTP link, it means that both the current upstream network element and the downstream network element have PTP ports.

[0037] Correspondingly, the upstream network element specifically sends the first message carrying the first ancestor clock information to the PTP link through the PTP port. After transmission through the PTP link, when the first message reaches the downstream network element, the downstream network element will obtain the first message from the PTP link through its own PTP port.

[0038] In addition, in one example, the first message is specifically an announce message.

[0039] It is understandable that, in actual applications, the content carried by the announce message at least includes the above-mentioned priority value.

[0040] In order to formally distinguish it from the first priority level 1 and the second priority level 2 of the time source, the priority value in the first grandmaster clock information can be represented by grandmasterPriority.

[0041] Correspondingly, the priority value corresponding to priority1 in the time source in the first grandmaster clock information is represented by grandmasterPriority1, and the priority value corresponding to priority2 in the time source is represented by grandmasterPriority2.

[0042] For details about other contents carried in the announce message, see Figure 2 As shown, no further details are given here.

[0043] Step 104: If there is a downstream network element connected via a global positioning system time GPS link, generate second ancestor clock information based on the first ancestor clock information, and generate a second message based on the second ancestor clock information, and send the second message to the downstream network element via the GPS link.

[0044] Specifically, if there is a downstream network element connected via a GPS link, it means that both the current upstream network element and the downstream network element have GPS ports.

[0045] Correspondingly, the upstream network element specifically sends the second message carrying the second ancestor clock information to the GPS link through the GPS port. After transmission through the GPS link, when the second message reaches the downstream network element, the downstream network element will obtain the second message from the GPS link through its own GPS port.

[0046] In addition, in one example, the GPS link can transmit a link with content in the CMTOD format of the TOD frame protocol, such as a link in the form of 1pss+TOD.

[0047] Correspondingly, in this case, the second message is specifically a CMTOD message. For details about the content carried in the CMTOD message, see Figure 3 , I will not go into details here.

[0048] In addition, it should be noted that for time synchronization of each network element in the network, the principle followed is that the larger the priority value, the lower the priority. At the same time, because the GPS link requires link delay compensation, the synchronization accuracy of the time source corresponding to the GPS port is not as good as the synchronization accuracy of the time source corresponding to the PTP port. In other words, when a GPS link and a PTP link exist simultaneously between two network elements, if the PTP link is normally available, the time source corresponding to the PTP port needs to be used as the PTP time source for link time synchronization.

[0049] Based on this principle, the above-mentioned generation of the second ancestor clock information based on the first ancestor clock information is actually to increase the priority value in the first ancestor clock information by a certain value, that is, the priority value in the second ancestor clock information must be greater than the priority value in the first ancestor clock information. In this way, it can be ensured that the priority corresponding to the first ancestor clock information is higher than the priority corresponding to the second ancestor clock information, so that when the downstream network element receives both the first ancestor clock information transmitted through the PTP link and the second ancestor clock information transmitted through the GPS link, it can select the time source corresponding to the PTP port that receives the first ancestor clock information with a higher priority as the PTP time source.

[0050] In addition, it is worth mentioning that the increase of a certain value (preset value) in the priority value of the first ancestor clock information in this embodiment does not mean arbitrarily increasing the preset value. The preset value needs to ensure that the time source corresponding to the priority value in the second ancestor clock information is available.

[0051] In order to meet this condition, it is necessary to determine a preset value before generating the second ancestor clock information according to the first ancestor clock information.

[0052] Regarding the method of determining the preset value, in this embodiment, specifically, the number of network elements included in the network is first determined, and then the preset value is determined according to the number of network elements and the available time source threshold set for the network elements in the network.

[0053] Specifically, when determining the preset value based on the number of network elements and the available time source threshold set for the network elements in the network, the following steps are performed: dividing the available time threshold by the number of network elements to obtain a reference value; and selecting a value smaller than the reference value as the preset value. That is, the preset value cannot be greater than the parameter value, or in other words, the product of the preset value and the number of network elements cannot be greater than the available time threshold.

[0054] In order to better understand the method for avoiding clock looping provided in this embodiment, the following Figure 4 To explain in detail:

[0055] The time source communicates with the upstream network element DUT1 in the networking using a PTP link. The time source sends time priority information to DUT1 through the PTP link, specifically: priority1 = 100, priority2 = 120.

[0056] DUT1 is configured with a PTP port and a GPS port, and establishes a PTP link with the downstream network element DUT3 which is also configured with a PTP port through the PTP port, and establishes a GPS link with the downstream network element DUT2 which is also configured with a GPS port through the GPS port. Figure 4 Specifically, it is a GPS link in the form of 1pps+TOD.

[0057] At the same time, DUT1 forms a master-slave relationship with the time source according to the Best Master Clock (BMC) algorithm.

[0058] After ensuring that the above operations are completed, DUT1 sends the announce message carrying the first ancestor clock information to the PTP link between DUT3 through the PTP port for transmission, and sends the CMTOD message carrying the second ancestor clock information with a lower priority than the first ancestor clock information (specifically, the priority value in the second ancestor clock information is greater than the priority value in the first ancestor clock information) to the GPS link in the form of 1pps+TOD between DUT2 through the GPS port for transmission.

[0059] Accordingly, DUT3 obtains the announce message carrying the first ancestor clock information from the PTP link between DUT1 and DUT3 through the PTP port.

[0060] As described above, the priority value in the first grandmaster clock information is actually the priority value of the time source. Therefore, grandmasterPriority1 in the first grandmaster clock information is the same as priority1 in the time source, and both are 100.

[0061] Similarly, grandmasterPriority2 in the first ancestor clock information is the same as priority2 in the time source, and both are 120.

[0062] For DUT3, since PTP link is also used to connect with DUT3, DUT3, as the upstream network element of DUT2, also sends the first grandmaster clock information to DUT2, that is, the value of grandmasterPriority1 in the first grandmaster clock information received by DUT2 from DUT3 is also 100, and the value of grandmasterPriority2 is also 120.

[0063] That is, any network element in the network, as long as it is connected through a PTP link, will have the same priority value in the transmitted clock information as the time source.

[0064] For DUT2, the CMTOD message carrying the second ancestor clock information is obtained from the 1pps+TOD GPS link between DUT1 and the GPS port.

[0065] Since it has been introduced above that the priority value in the second grandmaster clock information is greater than the priority value in the first grandmaster clock information, the preset value for acceleration determination is 1, that is, +1 based on the priority value in the first grandmaster clock information, then the priority information in the second grandmaster clock information is specifically: grandmasterPriority1=100+1=101, grandmasterPriority2=120+1=121.

[0066] That is, any network element in the network, as long as it is connected via a GPS link, will have a priority value in the clock information it transmits that is greater than the priority value in the clock information received by the upstream network element connected to it by a preset value.

[0067] Thus, the operation of configuring the priority of the time source corresponding to the GPG port when the time source corresponding to the GPS end is used as the PTP time source in the PTP protocol is completed without manual intervention.

[0068] From the above description, it is not difficult to find that the method for avoiding clock loops provided in this embodiment is that, for any upstream network element in the network, when it is determined that the upstream network element has a downstream network element connected through a GPS link, second ancestor clock information with a lower priority than the first ancestor clock information is generated based on the first ancestor clock information with the same clock priority value as the time source, and a second message is generated based on the second ancestor clock information, and the second message carrying the second ancestor clock information with a lower priority than the first ancestor clock information is sent to the corresponding downstream network element through the GPS link, so that the downstream network element that receives both the first ancestor clock information and the second ancestor clock information can select the time source corresponding to the first ancestor clock information with a higher priority as the PTP time source, thereby ensuring that each network element in the network that includes both PTP links and GPS links can use the time source with a higher priority as the PTP time source when realizing time synchronization, thereby avoiding clock loops in the network that includes both PTP links and GPS links.

[0069] In addition, due to the method for avoiding clock loops provided by this embodiment, without the need for manual intervention to configure the priority of the time source of the GPS port, it is possible to ensure that a network that includes both PTP links and GPS links will not experience clock loops while achieving time synchronization, thereby significantly enhancing the ease of configuration and flexibility when PTP and GPS are mixed to select time sources.

[0070] See also Figure 5 , Figure 5 This is a flowchart of a method for avoiding clock looping provided in an embodiment of the present application. In this embodiment, the method is mainly applied to downstream network elements in the network.

[0071] It should be noted that the networking mentioned in this embodiment includes at least two network elements, one of which is used to receive the priority information of the clock of the time source, specifically the priority value, and is subsequently referred to as the upstream network element; and the other network element is used to receive the message sent by the upstream network element through the corresponding link, such as the PTP link and the GPS link, and is subsequently referred to as the downstream network element.

[0072] In addition, it is worth mentioning that in actual applications, if the network includes more than two network elements, there may be one network element that can be regarded as an upstream network element relative to the downstream network element with which it communicates, and can be regarded as a downstream network element relative to the upstream network element with which it communicates.

[0073] In addition, the network elements in the networking mentioned in this embodiment may specifically be devices in the automation system that require time information, such as computers, protection devices, fault filters, event sequence recording devices, safety automatic devices, etc., which are not listed one by one here and are not limited in this embodiment.

[0074] To better understand the method for avoiding clock looping provided by this embodiment, the following Figure 5 Provide specific instructions.

[0075] like Figure 5 As shown, the method for avoiding clock looping provided in this embodiment includes the following steps:

[0076] Step 501: Receive a first message carrying first ancestor clock information sent by the upstream network element through the PTP link, and receive a second message carrying second ancestor clock information sent by the upstream network element through the GPS link.

[0077] Specifically, the first ancestor clock information in this embodiment includes the following: Figure 1 The priority value mentioned in the illustrated embodiment and as can be seen from the above description, the priority value in the first ancestor clock information is the same as the priority value of the clock sent by the time source.

[0078] In addition, the priority corresponding to the second ancestor clock information in this embodiment is lower than the priority corresponding to the first ancestor clock information. Specifically, the priority value in the second ancestor clock information is greater than the priority value in the first ancestor clock information.

[0079] Step 502: When the PTP link is available, the time source of the PTP port that receives the first message is used as the PTP time source based on the best master clock algorithm; when the PTP link is unavailable and the GPS link is available, the time source of the GPS port that receives the second message is used as the PTP time source based on the best master clock algorithm.

[0080] Specifically, in actual applications, it is possible that the priority of the local clock of the current downstream network element is higher than the time source of the PTP port that receives the first message, or the time source of the GPS port that receives the second message, which is selected based on the BMC algorithm. Therefore, when the time source of the PTP port that receives the first message is used as the PTP time source based on the best master clock algorithm, it is necessary to first determine whether the priority of the local clock is lower than the priority of the time source of the PTP port that receives the first message, that is, first obtain the priority value of the local clock; then compare the priority value of the local clock with the priority value in the first ancestor clock information; if the priority value of the local clock is greater than the priority value in the first ancestor clock information, then execute the operation of using the time source of the PTP port that receives the first message as the PTP time source based on the best master clock algorithm; if the priority value of the local clock is less than the priority value in the first clock information, then use the local clock as the PTP time source.

[0081] Correspondingly, when the time source of the GPS port that receives the second message is used as the PTP time source based on the best master clock algorithm, it is also necessary to first determine whether the priority of the local clock is lower than the priority of the time source of the GPS port that receives the second message, that is, first obtain the priority value of the local clock; then compare the priority value of the local clock with the priority value in the second ancestral clock information. If the priority value of the local clock is greater than the priority value in the second ancestral clock information, then execute the operation of using the time source of the GPS port that receives the second message as the PTP time source based on the best master clock algorithm; if the priority value of the local clock is less than the priority value in the second clock information, then use the local clock as the PTP time source.

[0082] In order to better understand the method for avoiding clock looping provided in this embodiment, the following still combines Figure 4 To explain in detail:

[0083] The time source communicates with the upstream network element DUT1 in the networking using a PTP link. The time source sends time priority information to DUT1 through the PTP link, specifically: priority1 = 100, priority2 = 120.

[0084] DUT1 is configured with a PTP port and a GPS port, and establishes a PTP link with the downstream network element DUT3 which is also configured with a PTP port through the PTP port, and establishes a GPS link with the downstream network element DUT2 which is also configured with a GPS port through the GPS port. Figure 4 Specifically, it is a GPS link in the form of 1pps+TOD.

[0085] At the same time, DUT1 forms a master-slave relationship with the time source according to the Best Master Clock (BMC) algorithm.

[0086] After ensuring that the above operations are completed, DUT1 sends the announce message carrying the first ancestor clock information to the PTP link between DUT3 through the PTP port for transmission, and sends the CMTOD message carrying the second ancestor clock information with a lower priority than the first ancestor clock information (specifically, the priority value in the second ancestor clock information is greater than the priority value in the first ancestor clock information) to the GPS link in the form of 1pps+TOD between DUT2 through the GPS port for transmission.

[0087] Accordingly, DUT3 obtains the announce message carrying the first ancestor clock information from the PTP link between DUT1 and DUT3 through the PTP port.

[0088] As described above, the priority value in the first grandmaster clock information is actually the priority value of the time source. Therefore, grandmasterPriority1 in the first grandmaster clock information is the same as priority1 in the time source, and both are 100.

[0089] Similarly, grandmasterPriority2 in the first ancestor clock information is the same as priority2 in the time source, and both are 120.

[0090] For DUT3, since PTP link is also used to connect with DUT3, DUT3, as the upstream network element of DUT2, also sends the first grandmaster clock information to DUT2, that is, the value of grandmasterPriority1 in the first grandmaster clock information received by DUT2 from DUT3 is also 100, and the value of grandmasterPriority2 is also 120.

[0091] That is, any network element in the network, as long as it is connected through a PTP link, will have the same priority value in the transmitted clock information as the time source.

[0092] For DUT2, the CMTOD message carrying the second ancestor clock information is obtained from the 1pps+TOD GPS link between DUT1 and the GPS port.

[0093] Since it has been introduced above that the priority value in the second grandmaster clock information is greater than the priority value in the first grandmaster clock information, the preset value for acceleration determination is 1, that is, +1 based on the priority value in the first grandmaster clock information, then the priority information in the second grandmaster clock information is specifically: grandmasterPriority1=100+1=101, grandmasterPriority2=120+1=121.

[0094] That is, any network element in the network, as long as it is connected via a GPS link, will have a priority value in the clock information it transmits that is greater than the priority value in the clock information received by the upstream network element connected to it by a preset value.

[0095] When the PTP link between DUT2 and DUT3 is disconnected, DUT2 selects the GPS port's time source as the PTP time source according to the BMC algorithm. When the PTP link between DUT2 and DUT3 is communicating normally, DUT2 selects the time source of the PTP port connected to DUT3 as the PTP time source according to the BMC algorithm. Based on this principle, DUT2 will not transmit the time information obtained through the GPS port back to DUT1 through DUT3, which means that a clock loop will not occur.

[0096] Assume that priority 1 and priority 2 of the local clocks corresponding to DUT1, DUT2, and DUT3 are all 128.

[0097] When DUT2 needs to select a time source, it is found through comparison that the local clock has the lowest priority, that is, it is not considered.

[0098] In addition, in an example, when DUT1 sends corresponding clock information to DUT2 and DUT3, and DUT3 sends corresponding clock information to DUT2, it is possible to first determine whether the priority value in the corresponding first ancestor clock information and the priority value in the second ancestor clock information are greater than the priority value of the local clock. If so, the local clock is transmitted backward as the corresponding time source.

[0099] Therefore, the method for avoiding clock loops provided in this embodiment is that for any downstream network element in the network, if the downstream network element is connected to the upstream network element in the network (which may be the same upstream network element or different upstream network elements) through a PTP link and a GPS link respectively, and receives a first message carrying first ancestor clock information sent by the upstream network element through the PTP link, and receives a second message carrying lower priority than the first ancestor clock information sent by the upstream network element through the GPS link, then when the PTP link is available, based on the best master clock algorithm, the time source of the PTP port that receives the first message with high accuracy is used as the PTP time source. When the PTP link is unavailable but the GPS link is available, the time source of the GPS port that receives the second message is selected as the PTP time source, thereby ensuring that each network element in the network that includes both PTP links and GPS links can use the time source with high priority as the PTP time source when achieving time synchronization, thereby avoiding clock loops in the network that includes both PTP links and GPS links.

[0100] In addition, due to the method for avoiding clock loops provided by this embodiment, without the need for manual intervention to configure the priority of the time source of the GPS port, it is possible to ensure that a network that includes both PTP links and GPS links will not experience clock loops while achieving time synchronization, thereby significantly enhancing the ease of configuration and flexibility when PTP and GPS are mixed to select time sources.

[0101] In addition, it should be understood that the step division of the various methods above is only for the purpose of clear description. During implementation, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0102] See also Figure 6 , Figure 6 This is a structural diagram of an upstream network element for avoiding clock looping provided in an embodiment of the present application.

[0103] like Figure 6 As shown, the upstream network element provided by this embodiment includes: at least one processor 601; and a memory 602 communicatively connected to the at least one processor 601.

[0104] Among them, the memory 602 stores instructions that can be executed by at least one processor 601, and the instructions are executed by at least one processor 601 so that at least one processor 601 can execute the method for avoiding clock looping applied to upstream network elements described in the above method embodiment.

[0105] The memory 602 and processor 601 are connected using a bus. The bus can include any number of interconnected buses and bridges, connecting various circuits of one or more processors 601 and memory 602. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor 601 is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor 601.

[0106] The processor 601 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 602 can be used to store data used by the processor 601 when performing operations.

[0107] See also Figure 7 , Figure 7 This is a structural diagram of a downstream network element for avoiding clock looping provided in an embodiment of the present application.

[0108] like Figure 7 As shown, the downstream network element provided by this embodiment includes: at least one processor 701; a memory 702 communicatively connected to the at least one processor 701; and a local clock 703.

[0109] The memory 702 stores instructions that can be executed by at least one processor 701. The instructions are executed by at least one processor 701 so that the at least one processor 701 can execute the method for avoiding clock looping described in the above method embodiment.

[0110] The memory 702 and processor 701 are connected using a bus. The bus may include any number of interconnected buses and bridges, connecting various circuits of one or more processors 701 and memory 702. The bus may also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor 701 is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor 701.

[0111] The processor 701 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 702 can be used to store data used by the processor 701 when performing operations.

[0112] The present application also relates to a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for avoiding clock looping described in any of the above method embodiments.

[0113] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0114] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.

Claims

1. A method for avoiding clock looping, characterized in that: Applied to an upstream network element in a network, the method for avoiding clock looping includes: The priority value of the clock sent by the receiving time source; Using the priority value as the priority value of the master clock, obtaining first master clock information; If there is a downstream network element connected through a Precision Time Protocol (PTP) link, generate a first message according to the first ancestor clock information, and send the first message to the downstream network element through the PTP link; If there is a downstream network element connected via a global positioning system (GPS) time link, generate second ancestor clock information according to the first ancestor clock information, generate a second message according to the second ancestor clock information, and send the second message to the downstream network element via the GPS link; Among them, the priority corresponding to the second ancestor clock information is lower than the priority corresponding to the first ancestor clock information, so that the downstream network element that receives the first ancestor clock information and the second ancestor clock information selects the time source corresponding to the first ancestor clock information with high priority as the PTP time source.

2. The method for avoiding clock looping according to claim 1, wherein: Generating the second ancestor clock information according to the first ancestor clock information includes: A preset value is added to the priority value in the first ancestor clock information to obtain second ancestor clock information.

3. The method for avoiding clock looping according to claim 2, wherein: Before generating the second ancestor clock information according to the first ancestor clock information, the method further includes: Determining the number of network elements included in the networking; The preset value is determined according to the number of network elements and an available time source threshold set for the network elements in the networking.

4. The method for avoiding clock looping according to claim 3, wherein: The determining the preset value according to the number of network elements and an available time source threshold set for the network elements in the networking includes: Dividing the available time threshold by the number of network elements to obtain a reference value; A value smaller than the reference value is selected as the preset value.

5. A method for avoiding clock looping, characterized in that: Applied to a downstream network element in a network, the downstream network element is connected to an upstream network element in the network via a PTP link and a GPS link, and the method for avoiding clock looping includes: receiving, through the PTP link, a first message carrying first ancestor clock information sent by the upstream network element, wherein a priority value in the first ancestor clock information is the same as a priority value of a clock sent by a time source; receiving, through the GPS link, a second message carrying second ancestor clock information sent by the upstream network element, wherein the priority corresponding to the second ancestor clock information is lower than the priority corresponding to the first ancestor clock information, and the priority values ​​in the second ancestor clock information are all greater than the priority values ​​in the first ancestor clock information; When the PTP link is available, using a time source of the PTP port receiving the first message as a PTP time source based on a best master clock algorithm; When the PTP link is unavailable and the GPS link is available, the time source of the GPS port receiving the second message is used as the PTP time source based on the best master clock algorithm.

6. The method for avoiding clock looping according to claim 5, wherein: Before using the time source of the PTP port receiving the first message as the PTP time source based on the best master clock algorithm, the method further includes: Get the priority value of the local clock; If the priority value of the local clock is greater than the priority value in the first ancestor clock information, executing the step of using the time source of the PTP port receiving the first message as the PTP time source based on the best master clock algorithm; If the priority value of the local clock is smaller than the priority value in the first ancestor clock information, the local clock is used as the PTP time source.

7. The method for avoiding clock looping according to claim 5, wherein: Before using the time source of the GPS port receiving the second message as the PTP time source based on the best master clock algorithm, the method further includes: Get the priority value of the local clock; If the priority value of the local clock is greater than the priority value in the second ancestor clock information, executing the step of using the time source of the GPS port receiving the second message as the PTP time source based on the best master clock algorithm; If the priority value of the local clock is smaller than the priority value in the second ancestor clock information, the local clock is used as the PTP time source.

8. An upstream network element for avoiding clock looping, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for avoiding clock looping according to any one of claims 1 to 4.

9. A downstream network element for avoiding clock looping, characterized in that: include: local clock; at least one processor; as well as, A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor so as to enable the at least one processor to execute the method for avoiding clock looping as described in any one of claims 5 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for avoiding clock looping according to any one of claims 1 to 4 or the method for avoiding clock looping according to any one of claims 5 to 7 is implemented.

Citation Information

Patent Citations

  • Method, device and system for processing clock information

    CN102130736A

  • Multi-clock-ring based method for avoiding clock jitter in switching process

    CN102546073A