A clock synchronization method, apparatus and bearer network equipment

By preventing devices from tracking the primary clock signal in the PTP clock source group and selecting backup devices, the problem of base station time synchronization not meeting the standard in 5G networks is solved, achieving efficient time synchronization between base stations and improving network performance.

CN114980181BActive Publication Date: 2025-10-31HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110221605.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-27
Publication Date
2025-10-31
Estimated Expiration
2041-02-27

AI Technical Summary

Technical Problem

In 5G mobile networks, the time synchronization requirements between base stations fail to meet the ITU-T Rec.G.8275.1/Y1369.1 protocol standard. In particular, when the link between the common clock and the base station fails, the number of synchronization nodes exceeds three, resulting in time asynchrony and affecting handover and CoMP cooperation performance.

Method used

By preventing devices from tracking the primary PTP clock signal in the Precision Time Protocol (PTP) clock source group and reselecting a higher-priority backup device, the time synchronization between the devices and the base station is ensured, meeting the standard requirements.

Benefits of technology

It effectively ensures time synchronization between base stations, meets the ITU-T Rec.G.8275.1/Y1369.1 protocol standard, avoids time synchronization problems caused by link failures, and improves network performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114980181B_ABST
    Figure CN114980181B_ABST
Patent Text Reader

Abstract

This application discloses a clock synchronization method, apparatus, and bearer network equipment. The method includes: a first device as the primary device in a Precision Time Protocol (PTP) clock source group; a fourth device as a backup device in the PTP clock source group; and a second and third device communicating with each device in the PTP clock source group via links. The second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The first device determines that the link between the first and third devices is faulty. The first device prevents the second device from tracking the primary PTP clock signal of the first device. That is, when the first device determines that the link between the first and third devices is faulty, the first device prevents the second device from tracking the primary PTP clock signal of the first device, allowing both the second and third devices to re-track other higher-priority devices in the PTP clock source group, effectively ensuring time synchronization between the second and third devices and meeting standard requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a clock synchronization method, apparatus and bearer network equipment. Background Technology

[0002] Fifth-generation (5G) systems and new radio (NR) systems will widely adopt time division duplexing (TDD) technology. Under TDD, base station transmission and reception operate on a single frequency, using time division to differentiate between transmission and reception in different time slots. In practical applications, the need for time synchronization between multiple base stations arises in at least the following situations:

[0003] First, the basic services of the TDD standard of the two base stations need to be synchronized in time. For example, when a mobile terminal enters the signal coverage area of ​​two base stations, the mobile terminal needs to switch between the two base stations. If the time of the two base stations is not synchronized, time slot disorder can easily occur, resulting in information loss during handover.

[0004] Secondly, the cooperative characteristics of the two base stations also require time synchronization. For example, two base stations may cooperate using Coordinated Multiple Points (CoMP) technology. The essence of CoMP technology is to collaboratively process interference, avoid interference, or convert interference into useful signals between different base stations, providing users with higher speeds and thus improving network utilization. Therefore, CoMP can improve the performance of cell edge networks. Cell edge users simultaneously receive and transmit signals with multiple cells, and CoMP cooperation occurs between multiple cells, requiring time synchronization to ensure signal coordination.

[0005] In summary, in 5G mobile networks, to ensure time synchronization among all base stations on the synchronization link, the number of synchronization nodes between the common clock and each base station should not differ by more than three. When a link failure occurs between the common clock and the first base station, the ITU-T Rec.G.8275.1 / Y1369.1(03 / 2020) protocol (G.8275.1 is a widely used time synchronization technology in the telecommunications field, derived from the Precision Time Protocol (PTP) technology) running on the bearer network equipment will trigger a node reselection and refresh of the tracking relationship. After the tracking relationship is refreshed, the link between the common clock and the first base station changes, resulting in a difference of more than three nodes between the common clock and other base stations, which does not meet the standard requirements. Summary of the Invention

[0006] The clock synchronization method, apparatus, and bearer network equipment provided in this application ensure that each base station achieves clock synchronization under the premise of meeting standard requirements when a fault occurs.

[0007] In a first aspect, embodiments of this application provide a clock synchronization method. The execution subject of this method can be a first device or a component located in the first device (e.g., a chip, chip system, or processor). The following description uses the first device as the execution subject. The method includes: the first device determining a link failure between the first device and a third device, wherein the first device is the primary device in a Precision Time Protocol (PTP) clock source group, the PTP clock source group further includes a fourth device, which is a backup device in the PTP clock source group, the third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link. Before the link between the first device and the third device fails, the second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The first device prevents the second device from tracking the primary PTP clock signal of the first device.

[0008] Thus, when the first device determines that the link between the first device and the third device has failed, the first device prevents the second device from tracking the primary PTP clock signal of the first device, so that both the second and third devices can re-track other high-priority devices in the PTP clock source group, effectively ensuring time synchronization between the second and third devices and meeting the standard requirements.

[0009] In some implementations, after the first device prevents the second device from tracking the primary PTP clock signal of the first device, the method further includes: the second device tracking the backup PTP clock signal of the fourth device.

[0010] In some implementations, after the first device determines that the link between the first device and the third device is faulty, the method further includes: the third device tracking the backup PTP clock signal of the fourth device.

[0011] In one specific implementation, the primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device come from the same clock source.

[0012] In some implementations, after the first device determines that the link between the first device and the third device has failed, the method further includes: the first device determining that the PTP clock signal on which the fifth device operates does not need to be switched, wherein the fifth device communicates with each device in the PTP clock source group via a link, and the fifth device tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails. The first device allows the fifth device to continue tracking the primary PTP clock signal of the first device.

[0013] In one specific implementation, the first device determines that the PTP clock signal used by the fifth device does not need to be switched. Specifically, the first device determines that its stored PTP clock switching table does not include a first identifier corresponding to the fifth device. The PTP clock switching table indicates devices allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device. In this embodiment, although the fifth device tracks the primary PTP clock signal of the first device before the link between the first and third devices fails, after the link failure, considering that the fifth device may have other services with less stringent time synchronization requirements, the fifth device can continue tracking the primary PTP clock signal of the first device.

[0014] In one specific implementation, the first device determines that the PTP clock signal based on the fifth device does not need to be switched. Specifically, the first device determines that the PTP clock holding table stored by the first device includes a first identifier corresponding to the fifth device. The PTP clock holding table is used to indicate devices that are not allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device.

[0015] In one specific implementation, the first device determines that the link between the first device and the third device is faulty, specifically by the first device determining that the PTP port on the first device that connects to the link between the first device and the third device is in an unavailable state.

[0016] In some implementations, before the first device determines a link failure between the first device and the third device, the method further includes: the first device receiving a first notification message sent by a second device, the first notification message being used to notify the first device of devices communicating with the second device and belonging to the PTP clock source group. The first device receiving a second notification message sent by a third device, the second notification message being used to notify the first device of devices communicating with the third device and belonging to the PTP clock source group. Based on the first and second notification messages, the first device adds a first PTP port and a second PTP port to a first PTP switching group, the first PTP port indicating a PTP port on the first device connected to the link between the first device and the second device, and the second PTP port indicating a PTP port on the first device connected to the link between the first device and the third device.

[0017] In one specific implementation, the first device adds the first PTP port and the second PTP port to the first PTP switching group according to the first and second announcement messages. Specifically, the first device determines that the device announced in the first announcement message, which communicates with the second device and belongs to the PTP clock source group, is the same as the device announced in the second announcement message, which communicates with the third device and belongs to the PTP clock source group. The first device then adds the first PTP port and the second PTP port to the first PTP switching group.

[0018] In some implementations, the method further includes: a first device preventing all devices connected to PTP ports in a first PTP switching group from tracking the master PTP clock signal.

[0019] When a link fails between a third device connected to the first device via the first PTP port in the first PTP switching group, the first device prevents all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal. This allows all devices connected to PTP ports in the first PTP switching group to reselect a source and track the backup PTP clock signal of the fourth device, ensuring time synchronization for all devices connected to PTP ports in the first PTP switching group.

[0020] In one specific implementation, the first and second announcement messages are any of the following message types: Announce message, Signaling message, and Management message.

[0021] In some implementations, the first device includes a first PTP switching group, the first PTP switching group including a first PTP port and a second PTP port, the first PTP port indicating a PTP port on the first device connected to a link between the first device and a second device, and the second PTP port indicating a PTP port on the first device connected to a link between the first device and a third device, the method including: the first device preventing all devices connected to all PTP ports in the first PTP switching group from tracking a master PTP clock signal.

[0022] Secondly, embodiments of this application provide a clock synchronization method. The execution subject of this method can be a first device or a component located in the first device (e.g., a chip, chip system, or processor). The following description uses the first device as the execution subject. The method includes: a second device sending a first notification message to the first device. The first notification message is used to notify the first device of devices communicating with the second device and belonging to a PTP clock source group. The first device is the primary device in the Precision Time Protocol (PTP) clock source group, which also includes other devices. A third device communicates with each device in the PTP clock source group via a link, and the second device communicates with each device in the PTP clock source group via a link. The second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The third device sends a second notification message to the first device. The second notification message is used to notify the first device of devices communicating with the third device and belonging to the PTP clock source group. The first device is used to add the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates the PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates the PTP port on the first device that is connected to the link between the first device and the third device.

[0023] In one specific implementation, the first device is used to add the first PTP port and the second PTP port to a first PTP switching group according to the first announcement message and the second announcement message. Specifically, the first device is used to determine that the device announced in the first announcement message that communicates with the second device and belongs to the PTP clock source group is the same as the device announced in the second announcement message that communicates with the third device and belongs to the PTP clock source group. The first device is used to add the first PTP port and the second PTP port to the first PTP switching group.

[0024] In one specific implementation, the first announcement message and the second communication message are any of the following message types: Announce message, Signaling message, and Management message.

[0025] Thirdly, embodiments of this application provide a clock synchronization device, comprising: a first device for determining a link failure between the first device and a third device, wherein the first device is a primary device in a Precision Time Protocol (PTP) clock source group, the PTP clock source group further includes a fourth device, which is a backup device in the PTP clock source group, the third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link, and before a link failure occurs between the first device and the third device, the second device tracks the primary PTP clock signal of the first device and the third device tracks the primary PTP clock signal of the first device. The first device is also configured to prevent the second device from tracking the primary PTP clock signal of the first device.

[0026] Thus, when the first device determines that the link between the first device and the third device has failed, the first device prevents the second device from tracking the primary PTP clock signal of the first device, so that both the second and third devices can re-track other high-priority devices in the PTP clock source group, effectively ensuring time synchronization between the second and third devices and meeting the standard requirements.

[0027] In some implementations, the device further includes a second device for tracking a backup PTP clock signal of the fourth device.

[0028] In some implementations, the device may also include a third device for tracking a backup PTP clock signal from a fourth device.

[0029] In one specific implementation, the primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device come from the same clock source.

[0030] In some implementations, the apparatus further includes: a first device further configured to determine that the PTP clock signal upon which the fifth device operates does not require switching, wherein the fifth device communicates with each device in the PTP clock source group via a link, and the fifth device tracks the primary PTP clock signal of the first device until the link between the first device and the third device fails. The first device is also configured to allow the fifth device to continue tracking the primary PTP clock signal of the first device.

[0031] In this embodiment, although the fifth device tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails, after the link between the first device and the third device fails, considering that the fifth device may have other services with less stringent time synchronization requirements, the fifth device can continue to track the primary PTP clock signal of the first device.

[0032] In some possible implementations, the first device is further configured to determine that the first identifier corresponding to the fifth device is not included in the PTP clock switching table stored by the first device, wherein the PTP clock switching table is used to indicate devices that are allowed to switch the PTP clock signal being tracked, and the first identifier indicates the fifth device.

[0033] In some possible implementations, the first device is further configured to determine that the PTP clock holding table stored by the first device includes a first identifier corresponding to the fifth device, wherein the PTP clock holding table is used to indicate devices from which switching of tracked PTP clock signals is not permitted, and the first identifier indicates the fifth device.

[0034] In some implementations, the first device is also used to determine that the state of the PTP port on the first device that is connected to the link between the first device and the third device is unavailable.

[0035] In some implementations, the apparatus further includes: a first device further configured to receive a first notification message sent by a second device, the first notification message being used to notify the first device of devices communicating with the second device and belonging to the PTP clock source group. The first device is further configured to receive a second notification message sent by a third device, the second notification message being used to notify the first device of devices communicating with the third device and belonging to the PTP clock source group. The first device is further configured to add a first PTP port and a second PTP port to a first PTP switching group according to the first and second notification messages, wherein the first PTP port indicates a PTP port on the first device connected to the link between the first and second devices, and the second PTP port indicates a PTP port on the first device connected to the link between the first and third devices.

[0036] In some implementations, the first device is further configured to determine that the device notified in the first announcement message, communicating with the second device and belonging to the PTP clock source group, is the same as the device notified in the second announcement message, communicating with the third device and belonging to the PTP clock source group. The first device is further configured to add the first PTP port and the second PTP port to the first PTP switching group.

[0037] In some implementations, the first device is also used to prevent all devices connected to PTP ports in the first PTP switching group from tracking the master PTP clock signal.

[0038] When a link failure occurs between the first PTP port in the first PTP switching group and the third device connected to the first device, the first device prevents all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal. This allows all devices connected to PTP ports in the first PTP switching group to reselect a source and track the backup PTP clock signal of the fourth device, ensuring time synchronization for all devices connected to PTP ports in the first PTP switching group.

[0039] In one specific implementation, the first and second announcement messages are any of the following message types: Announce message, Signaling message, and Management message.

[0040] In some implementations, the first device includes a first PTP switching group, which includes a first PTP port and a second PTP port. The first PTP port indicates a PTP port on the first device that is connected to a link between the first device and a second device, and the second PTP port indicates a PTP port on the first device that is connected to a link between the first device and a third device. The first device is also configured to prevent any device connected to any PTP port in the first PTP switching group from tracking the master PTP clock signal.

[0041] Fourthly, embodiments of this application provide a clock synchronization device, comprising: a second device for sending a first notification message to a first device, the first notification message being used to notify the first device of devices communicating with the second device and belonging to a PTP clock source group. The first device is the primary device in the Precision Time Protocol (PTP) clock source group, which also includes other devices. A third device communicates with each device in the PTP clock source group via a link, and the second device communicates with each device in the PTP clock source group via a link. The second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The third device is used to send a second notification message to the first device, the second notification message being used to notify the first device of devices communicating with the third device and belonging to the PTP clock source group. The first device is used to add the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates the PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates the PTP port on the first device that is connected to the link between the first device and the third device.

[0042] In one specific implementation, the first device is further configured to: determine that the device announced in the first announcement message, communicating with the second device and belonging to the PTP clock source group, is the same as the device announced in the second announcement message, communicating with the third device and belonging to the PTP clock source group. The first device is configured to add the first PTP port and the second PTP port to the first PTP switching group.

[0043] In one specific implementation, the first and second announcement messages are any of the following message types: Announce message, Signaling message, and Management message.

[0044] Fifthly, a bearer network device includes: a unit for performing the steps of the first aspect, or a unit for performing the steps of the second aspect.

[0045] Sixthly, a computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform either the clock synchronization method of the first aspect or the clock synchronization method of the second aspect.

[0046] Seventhly, a computer program, when invoked by a processor, executes either the clock synchronization method of the first aspect or the clock synchronization method of the second aspect.

[0047] Eighthly, a chip system comprising one or more processors, wherein when the one or more processors execute instructions, the one or more processors execute either a clock synchronization method of the first aspect or a clock synchronization method of the second aspect.

[0048] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0049] Figure 1 A schematic diagram of the nodes that the common clock passes through to each base station;

[0050] Figure 2 This application provides a schematic diagram of the architecture of a communication system.

[0051] Figure 3 This is a schematic diagram of the structure of a receiving network device provided in an embodiment of this application;

[0052] Figure 4 A flowchart illustrating a transmission link connection method provided in an embodiment of this application;

[0053] Figure 5a This is a schematic diagram illustrating one application scenario of a clock synchronization method provided in an embodiment of this application;

[0054] Figure 5b A schematic diagram illustrating an application scenario of a clock synchronization method;

[0055] Figure 5c This is a second schematic diagram illustrating an application scenario of a clock synchronization method provided in an embodiment of this application.

[0056] Figure 6 A schematic diagram of port grouping of the first device in a clock synchronization method provided in this application embodiment;

[0057] Figure 7 This is a schematic diagram of a clock synchronization device provided in an embodiment of this application. Detailed Implementation

[0058] Currently, 5G / NR systems will widely adopt the time division duplex (TDD) standard. Under TDD, base station transmission and reception share a single frequency, and a time-division method is used to distinguish whether different time slots are for transmission or reception. In practical applications, the situations requiring time synchronization between multiple base stations include at least the following:

[0059] First, the basic services of the TDD standard of the two base stations need to be synchronized in time. For example, when a mobile terminal enters the signal coverage area of ​​two base stations, the mobile terminal needs to switch between the two base stations. If the time of the two base stations is not synchronized, time slot disorder can easily occur, resulting in information loss during handover.

[0060] Secondly, the cooperative characteristics of two base stations also require time synchronization. For example, two base stations may cooperate using CoMP technology. The essence of CoMP technology is to collaboratively process interference between different base stations, either by handling interference, avoiding interference, or converting interference into useful signals, thereby providing users with higher speeds and improving network utilization. Therefore, CoMP can improve the performance of cell edge networks. Cell edge users simultaneously receive and transmit signals with multiple cells, and CoMP cooperation occurs between multiple cells, requiring time synchronization to ensure signal coordination.

[0061] In summary, time synchronization is required between two base stations in a 5G mobile network. Typically, in standards, two base stations are considered synchronized if the synchronization accuracy is less than 260ns. For example, the relative time errors between all nodes from the common clock to the first base station, and the relative time errors between the common clock and all nodes from the second base station, both satisfy the following formula:

[0062]

[0063] Among them, cTE R =1.2*cTE, cTE R cTE represents the relative constant time error, while dTE represents the constant time error. LR =1.4*dTE L dTE LR dTE is the relative dynamic time error. L This represents the dynamic time error. N is the number of nodes between the common clock and the base station.

[0064] When the synchronization node meets the Class C requirements of the G.8273.2 standard, the maximum value of N can be 3. Therefore, in order for all base stations on the synchronization link to achieve time synchronization, the number of synchronization nodes that the common clock passes through on its way to each base station via the bearer network equipment should not differ by more than 3.

[0065] In the existing technology, Figure 1 This is a schematic diagram of the nodes the common clock passes through to each base station. (Example:) Figure 1As shown, nodes 1 through 5 constitute the common portion of the synchronization link. Nodes 6a, 7a, and 8a are the portions of the synchronization link used only for the first base station G1. Node 6b is the portion of the synchronization link used only for the second base station G2. Nodes 6c and 7c are the portions of the synchronization link used only for the third base station G3. It is evident that the number of nodes the common clock traverses to the first base station G1, the second base station G2, and the third base station G3 differs by no more than 3. When a link failure occurs between the common clock and a base station (such as the first base station G1), the G.8275.1 protocol running on the bearer network equipment triggers a node reselection and refreshes the tracking relationship. This refresh changes the link between the common clock and the first base station G1, resulting in a difference of more than 3 nodes between the common clock and the first base station G1, the second base station G2, and the third base station G3, which does not meet the standard requirements.

[0066] To address the aforementioned technical problems, this application provides a clock synchronization method. The method includes a first device determining a link failure between itself and a third device. The first device is the primary device in a Precision Time Protocol (PTP) clock source group. The PTP clock source group also includes a fourth device, which is a backup device in the PTP clock source group. The third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link. Before the link between the first and third devices fails, the second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The first device prevents the second device from tracking the primary PTP clock signal of the first device. In other words, when the first device determines that the link between itself and the third device has failed, the first device prevents the second device from tracking the primary PTP clock signal of the first device, allowing both the second and third devices to re-track other high-priority devices in the PTP clock source group. This effectively ensures time synchronization between the second and third devices, and further ensures that the base stations connected to the second and third devices are also time-synchronized, meeting standard requirements.

[0067] The clock synchronization method provided in this application embodiment is applied to, for example, Figure 2 In the communication system 200 shown.

[0068] Figure 2 This is a schematic diagram of the architecture of the communication system used in the embodiments of this application. Figure 2 As shown, the communication system 200 includes core network equipment 210, bearer network equipment 220, and base station (e.g., ...). Figure 2The system includes base stations 230, 240, and 250. The base stations are connected to the bearer network equipment 220, which in turn is connected to the core network equipment 210. The core network equipment 210, bearer network equipment 220, and base stations can be independent physical devices, or they can integrate the functions of the core network equipment 210, the logical functions of the bearer network equipment 220, and the logical functions of the base station onto the same physical device. Alternatively, a single physical device can integrate some of the functions of the core network equipment and some of the functions of the bearer network equipment. This communication system may also include other network devices, such as wireless relay equipment and wireless backhaul equipment. Figure 2 Not shown in the diagram. The embodiments of this application do not limit the number of core network devices, bearer network devices, and base stations included in the communication system.

[0069] The bearer network device 220 is the access device for the base station to access the communication system.

[0070] The base station can be an evolved NodeB (eNodeB), a base station in an NR communication system, a base station in a future communication system, or an access node in a WiFi system, etc. The embodiments of this application do not limit the specific technology or equipment form used in the base station. The base station can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on water; and it can also be deployed in the air on aircraft, balloons, and artificial satellites. The embodiments of this application do not limit the application scenarios of the base station.

[0071] in, Figure 2 The system shown can be a 5th generation (5G) communication system, a new radio (NR) system, or a next-generation communication system, etc., without restriction. Figure 2 The communication system shown is a 5G communication system as an example. The above-mentioned bearer network equipment can be the next-generation network side equipment (NR nodeB, gNB) in the 5G communication system.

[0072] Optionally, the relevant functions of the bearer network device in this application embodiment can be implemented by one device, multiple devices working together, or one or more functional modules within a single device. This application embodiment does not specifically limit this. It is understood that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, a combination of hardware and software, or virtualization functions instantiated on a platform (e.g., a cloud platform).

[0073] Figure 3 This is a schematic diagram of the structure of a bearer network device provided in an embodiment of this application.

[0074] like Figure 3As shown, the architecture of the bearer network can logically include, but is not limited to, at least one of the following: core layer, aggregation layer, and access layer. The access layer is the segment of the bearer network closest to the user, connecting base stations and other access equipment. Access layer speeds are relatively low, typically between 1 Gbit / s and 10 Gbit / s. The aggregation layer is above the access layer, meaning it connects to the access layer. The aggregation layer has a higher speed than the access layer, typically between 10 Gbit / s and 100 Gbit / s. The core layer is above the aggregation layer, meaning it connects to the aggregation layer and core network equipment. The core layer's speed is typically between 10 Gbit / s and 100 Gbit / s. For example... Figure 3 As shown, the core layer devices (metro core, MC), aggregation layer devices (aggregation, AGG), and access layer devices (access, ACC) can constitute... Figure 2 The bearer network equipment 220 in the middle.

[0075] The methods in the following embodiments can all be applied to devices with the above-described hardware structure (such as...). Figure 3 The methods described in the following embodiments can all be implemented in the bearer network device 220. Figure 3 The methods described in the following embodiments can be implemented in the core device MC of the bearer network device 220, or in the aggregation device AGG of the bearer network device 220, or in the access device ACC of the bearer network device 220.

[0076] Taking the implementation of the method in the embodiment within the aggregation network equipment of the bearer network equipment as an example, the first and fourth devices mentioned in this method are both aggregation devices (AGG), and the second and third devices are both access devices (ACC). The first device is the primary device in the Precision Time Protocol (PTP) clock source group, and the clock signal on the first device can be referred to as the primary PTP clock signal of the first device. The fourth device is the backup device in the PTP clock source group, and the clock signal on the fourth device can be referred to as the backup PTP clock signal of the fourth device. The second and third devices communicate with each device in the PTP clock source group via links. The second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device originate from the same clock source. The Precision Time Protocol (PTP) clock source group can be understood as a group of devices that provide clock signals and have a primary / backup relationship.

[0077] Figure 4 This is a flowchart illustrating a clock synchronization method provided in an embodiment of this application. Figure 4As shown, the clock synchronization method may include:

[0078] S401, The first device determines that there is a link failure between the first device and the third device.

[0079] Link failures between the first and third devices can include both physical layer link failures and protocol layer link failures. Specifically, physical layer link failures can include the following scenarios: First, a PTP port on the first device that connects to the link between the first and third devices fails. Second, a PTP port on the third device that connects to the link between the first and third devices fails. Third, a PTP port on the first device that connects to the link between the first and third devices fails, and a PTP port on the third device that connects to the link between the first and third devices fails. Fourth, the line connecting the first and third devices fails. Protocol layer link failures can be understood as the protocol indicating whether the connection between the first and second devices is "connected" or "not connected."

[0080] Specifically, S401 can be implemented as follows: the first device detects a link failure between the first device and the third device. Specifically, the first device detecting a link failure between the first device and the third device can include the following situations:

[0081] In the first scenario, the first device monitors the status of the link between itself and the third device. For example, the first device monitors whether the first device is functioning normally, or whether its PTP port is functioning correctly. Similarly, the first device monitors whether the third device is functioning normally, or whether its PTP port is functioning correctly. Taking the first device monitoring the PTP port of the first device as an example, if the first device detects an abnormal PTP port status, then the first device determines that the link between itself and the third device is faulty.

[0082] In the second scenario, the first device monitors the information transmission status between itself and the second device. For example, the first device monitors whether any information received from the second device is lost. If the first device detects that any information received from the second device is lost, it determines that the link between the first and second devices is faulty.

[0083] In the third scenario, the protocol used by the first device to monitor its operation indicates that the connection between the first and second devices is "connected" or "not connected". If the protocol used by the first device indicates that the connection between the first and second devices is "not connected", then the first device determines that there is a link failure between the first and third devices.

[0084] Of course, the implementation of S401 is not limited to the above-described content, and other methods can also be used. This application embodiment does not specifically limit it.

[0085] S402, The first device prevents the second device from tracking the master PTP clock signal of the first device.

[0086] This should be understood as follows: when the first device determines that the link between itself and the third device is faulty, the third device cannot track the primary PTP clock signal of the first device, while the second device can track the primary PTP clock signal of the first device. In this situation, the first device prevents the second device from tracking the primary PTP clock signal of the first device.

[0087] Specifically, the first device prevents the second device from tracking the primary PTP clock signal of the first device. This can be implemented in several ways: First, the first device stops receiving the synchronization clock signal sent by the second device. Second, the first electronic device sends an instruction to the second electronic device, instructing the second electronic device to track the backup PTP clock signal of the fourth device.

[0088] To ensure that the second and third devices maintain time synchronization, when a link failure occurs between the first and third devices, both the second and third devices need to reselect a source, as detailed below:

[0089] The process of source reselection between the first and third devices is as follows: When a link failure occurs between the first and third devices, the third device cannot track the primary PTP clock signal of the first device. The ITU-TRec.G.8275.1 / Y1369.1 (03 / 2020) protocol running on the third device will trigger source reselection, selecting a backup device from the Precision Time Protocol (PTP) clock source group. The third device receives the synchronization clock quality sent by the fourth device and other aggregation devices. The third device compares the synchronization clock quality sent by the third device, the synchronization clock quality sent by the fourth device, and the synchronization clock quality sent by other aggregation devices, determining that the synchronization clock quality sent by the fourth device has the highest priority. The third device sets the fourth device as the backup device and tracks the backup PTP clock signal of the fourth device.

[0090] Second, the implementation process of the second device re-selecting a clock source: After the first device prevents the second device from tracking the primary PTP clock signal of the first device, the second device tracks the backup PTP clock signal of the fourth device. Specifically, this can be implemented as follows: When a link failure occurs between the first and third devices, the first device prevents the second device from tracking the primary PTP clock signal of the first device. The ITU-T Rec.G.8275.1 / Y1369.1(03 / 2020) protocol running on the second device will trigger a re-selection of a clock source, selecting a backup device from the Precision Time Protocol (PTP) clock source group. The second device receives the synchronization clock quality sent by the fourth device and other aggregation devices. The second device compares the synchronization clock quality sent by the second device, the synchronization clock quality sent by the fourth device, and the synchronization clock quality sent by other aggregation devices, determining that the synchronization clock quality sent by the fourth device has the highest priority. The second device sets the fourth device as the backup device and tracks the backup PTP clock signal of the fourth device.

[0091] In this way, the second and third devices continue to track the backup PTP clock signal of the same backup device, ensuring that the number of nodes the common clock passes through to the second device is no more than 3 fewer than the number of nodes the common clock passes through to the third device. This ensures that the time of each base station connected to the second and third devices is synchronized, meeting the standard requirements.

[0092] For example, Figure 5a This is a schematic diagram illustrating one application scenario of a clock synchronization method provided in an embodiment of this application. For example... Figure 5a As shown, the first device mentioned in this application is Figure 5a The aggregation device AGG1 is connected to the active antenna unit (AAU), and the second device is... Figure 5a The access device ACC1 in the middle, the third device is Figure 5a The access device ACC2, the fourth device is Figure 5aThe aggregation device AGG2 is used in the network. Before a link failure occurs between aggregation device AGG1 and access device ACC2, the source selection process for access devices ACC1 and ACC2 is as follows: Timing ①: In the common clock domain, the common clock domain synchronizes the clock quality of the access devices. The core device MC sends the synchronized clock quality to aggregation devices AGG1 and AGG2. Timing ②: Aggregation devices AGG1 and AGG2 share information. Timing ③: Aggregation device AGG1 interacts with access devices ACC1 and ACC2 to synchronize the clock quality. Specifically: Access device ACC1 receives the synchronized clock quality sent by aggregation devices AGG1 and AGG2. Access device ACC1 compares the synchronized clock quality sent by access device ACC1, aggregation device AGG1, and aggregation device AGG2, determining that the synchronized clock quality sent by aggregation device AGG1 has the highest priority. Access device ACC1 sets aggregation device AGG1 as the primary device and tracks the primary PTP clock signal of the first device. Similarly, access device ACC2 receives the synchronization clock quality from aggregation devices AGG1 and AGG2 respectively. Access device ACC2 compares the synchronization clock quality sent by access device ACC2, aggregation device AGG1, and aggregation device AGG2, determining that the synchronization clock quality sent by aggregation device AGG1 has the highest priority. Access device ACC2 then sets aggregation device AGG1 as the master device and tracks the master PTP clock signal of aggregation device AGG1.

[0093] Figure 5b This is a schematic diagram illustrating an application scenario of a clock synchronization method. For example... Figure 5b As shown, when a link failure occurs between aggregation device AGG1 and access device ACC2, the ITU-T Rec.G.8275.1 / Y1369.1 (03 / 2020) protocol running on access device ACC2 will trigger a source reselection, choosing a backup device from the Precision Time Protocol (PTP) clock source group. Specifically, access device ACC2 receives synchronization clock quality data from aggregation device AGG2 and other aggregation devices. Access device ACC2 compares the synchronization clock quality data sent by access device ACC2, the synchronization clock quality data sent by aggregation device AGG2, and the synchronization clock quality data sent by other aggregation devices, determining that the synchronization clock quality data sent by aggregation device AGG2 has the highest priority. Access device ACC2 sets aggregation device AGG2 as the backup device and tracks the backup PTP clock signal of aggregation device AGG2. Meanwhile, access device ACC1 remains unchanged. Figure 5bThe source selection operation shown involves access device ACC1 maintaining a tracking connection to the primary PTP clock signal of aggregation device AGG1. Thus, the common clock travels through a first link connected by core device MC, aggregation device AGG1, and access device ACC1 to reach the first base station, and through a second link connected by core device MC, aggregation device AGG2, and access device ACC2 to reach the second base station. It is possible that the number of nodes traversed by the common clock on the first link to access device ACC1 differs from the number of nodes traversed by the common clock to access device ACC2 on the second link by more than three, causing time synchronization issues between the first base station connected to access device ACC1 and the second base station connected to access device ACC2, which does not meet the standard requirements.

[0094] Figure 5c This is a second schematic diagram illustrating an application scenario of a clock synchronization method provided in an embodiment of this application. For example... Figure 5c As shown in this embodiment, when a link failure occurs between aggregation device AGG1 and access device ACC2, aggregation device AGG1 determines that the link between aggregation device AGG1 and access device ACC2 is faulty. Aggregation device AGG1 prevents access device ACC1 from tracking the primary PTP clock signal of aggregation device AGG1. The ITU-T Rec.G.8275.1 / Y1369.1 (03 / 2020) protocol running on access device ACC1 triggers a source reselection, selecting a backup device from the Precision Time Protocol (PTP) clock source group. Specifically, access device ACC1 receives the synchronization clock quality sent by aggregation device AGG2 and other aggregation devices. Access device ACC1 compares the synchronization clock quality sent by access device ACC1, the synchronization clock quality sent by aggregation device AGG2, and the synchronization clock quality sent by other aggregation devices, determining that the synchronization clock quality sent by aggregation device AGG2 has the highest priority. Access device ACC1 sets aggregation device AGG2 as the backup device and tracks the backup PTP clock signal of aggregation device AGG2. In this way, both access devices ACC1 and ACC2 track the backup PTP clock signal of aggregation device AGG2. The common clock travels through the first link connected by core device MC, aggregation device AGG2, and access device ACC1 to reach the first base station, and through the second link connected by core device MC, aggregation device AGG2, and access device ACC2 to reach the second base station. The number of nodes traversed by the common clock to access device ACC1 on the first link is no more than 3 fewer than the number of nodes traversed by the common clock to access device ACC2 on the second link. This ensures that the time of each base station connected to access devices ACC1 and ACC2 is synchronized, meeting the standard requirements.

[0095] In some embodiments, before executing S401, the clock synchronization method provided in this application may further include:

[0096] S403, The first device receives the first notification message sent by the second device.

[0097] The first announcement message is used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group. The first announcement message is any of the following message types: Announce message, Signaling message, and Management message.

[0098] Example 1, taking the first announcement message as an example, it should be noted that the format of the Announce message defined by the IEEE 1588 standard is shown in Table 1 below:

[0099] Table 1

[0100]

[0101]

[0102] After the Announce message expands the TLV field, the TLV field format defined by the IEEE 1588 standard is shown in Table 2:

[0103] Table 2

[0104]

[0105] During the process of the second device interacting with the first and fourth devices to synchronize clock quality, the second device collects the clock identifiers (clock ID1) of the first device and clock ID2 of the fourth device. The second device then fills the collected clock ID1 and clock ID2 into the dataField field of the first Announce message. (See Table 3.)

[0106] Table 3

[0107]

[0108] The second device sends a first Announce message to the first device. The dataField field of the first Announce message carries the clock ID1 of the first device and the clock ID2 of the fourth device, which are collected by the second device. The first device receives the first Announce message sent by the second device through a first PTP port, and the first PTP port of the first device collects the clock ID1 and clockID2 carried in the dataField field of the first Announce message.

[0109] Example 2, taking the first notification message as the first Signaling message as an example, should be noted that the Signaling message format defined by the IEEE 1588 standard is shown in Table 4 below:

[0110] Table 4

[0111]

[0112]

[0113] During the process of the second device interacting with the first and fourth devices to synchronize clock quality, the second device collects the clock identifiers of the first device (clock ID1) and the fourth device (clock ID2). The second device then fills the collected clock ID1 and clock ID2 into the TLV field of the first Signaling message.

[0114] The second device sends a first signaling message to the first device. The TLV field of the first signaling message carries the clock ID1 of the first device and the clock ID2 of the fourth device, which are collected by the second device. The first device receives the first signaling message sent by the second device through the first PTP port. The first PTP port of the first device collects the clock ID1 and clock ID2 carried in the TLV field of the first signaling message.

[0115] Example 3, taking the first notification message as the first Management message as an example, should be noted that the Management message format defined by the IEEE 1588 standard is shown in Table 5 below:

[0116] Table 5

[0117]

[0118] During the process of the second device interacting with the first and fourth devices to synchronize clock quality, the second device collects the clock identifiers of the first device (clock ID1) and the fourth device (clock ID2). The second device then fills the collected clock ID1 and clock ID2 into the managementTLV field of the first Management message.

[0119] The second device sends a first Management message to the first device. The managementTLV field of the first Management message carries the clock ID1 of the first device and the clock ID2 of the fourth device, which are collected by the second device. The first device receives the first Management message sent by the second device through the first PTP port. The first device's first PTP port collects the clock ID1 and clock ID2 carried in the managementTLV field of the first Management message.

[0120] S404. The first device receives a second notification message sent by the third device. The second notification message is used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group.

[0121] The second announcement message is any of the following message types: Announce message, Signaling message, and Management message.

[0122] Following Example 1 above, taking the second Announce message as an example, during the process of the third device interacting with the first and fourth devices to synchronize clock quality, the third device collects the clock ID1 of the first device and the clock ID2 of the fourth device. The third device fills the collected clock ID1 and clock ID2 into the dataField field of the second Announce message (as shown in Table 3). The third device sends the second Announce message to the first device, and the dataField field of the second Announce message carries the clock ID1 of the first device and the clock ID2 of the fourth device collected by the third device. The first device receives the second Announce message sent by the third device through the second PTP port, and the second PTP port of the first device collects the clock ID1 and clock ID2 carried in the dataField field of the second Announce message.

[0123] Following Example 2 above, taking the second signaling message as an example, during the process of the third device interacting with the first and fourth devices to synchronize clock quality, the third device collects the clock ID1 of the first device and the clock ID2 of the fourth device. The third device fills the collected clock ID1 and clock ID2 into the TLV field of the second signaling message. The third device sends the second signaling message to the first device, and the TLV field of the second signaling message carries the clock ID1 of the first device and the clock ID2 of the fourth device collected by the third device. The first device receives the second signaling message sent by the third device through the second PTP port, and the second PTP port of the first device collects the clock ID1 and clock ID2 carried in the TLV field of the second signaling message.

[0124] Following Example 3 above, taking the second communication message as a second Management message as an example, during the process of the third device interacting with the first and fourth devices to synchronize clock quality, the third device collects the clock ID1 of the first device and the clock ID2 of the fourth device. The third device fills the collected clock ID1 and clock ID2 into the managementTLV field of the second Management message. The third device sends the second Management message to the first device, and the managementTLV field of the second Management message carries the clock ID1 of the first device and the clock ID2 of the fourth device collected by the third device. The first device receives the second Management message sent by the third device through the second PTP port, and the second PTP port of the first device collects the clock ID1 and clock ID2 carried in the managementTLV field of the second Management message.

[0125] S405. The first device adds the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message.

[0126] The first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device.

[0127] In this embodiment of the application, the electronic device can add the first PTP port and the second PTP port to the first PTP switching group in the following ways:

[0128] In the first method, the first device automatically determines the PTP port and adds it to the first PTP switching group. Specifically, the first device determines that the device in the first announcement message that communicates with the second device and belongs to the PTP clock source group is the same as the device in the second announcement message that communicates with the third device and belongs to the PTP clock source group. Alternatively, the first device determines that the device identifier of the primary device in the first announcement message that communicates with the second device and belongs to the PTP clock source group is the same as the device identifier of the primary device in the second announcement message that communicates with the third device and belongs to the PTP clock source group. Furthermore, the first device determines that the device identifier of the backup device in the first announcement message that communicates with the second device and belongs to the PTP clock source group is the same as the device identifier of the backup device in the second announcement message that communicates with the third device and belongs to the PTP clock source group. The first device then adds the first PTP port and the second PTP port to the first PTP switching group.

[0129] Specifically, as described above, the first PTP port of the first device collects clock ID1 and clock ID1 carried in the dataField field of the first Announce message, and the second PTP port of the first device collects clock ID1 and clock ID1 carried in the dataField field of the second Announce message. It is evident that the clock identifiers collected by the first PTP port and the second PTP port are completely identical. The first device adds the first PTP port and the second PTP port to the first PTP switching group.

[0130] For example, Figure 6 This is a schematic diagram showing the grouping of ports of the first device in a clock synchronization method provided in an embodiment of this application. Figure 6As shown, assume that the first device D is the master device in the Precision Time Protocol (PTP) clock source group, and the fourth device E is the backup device in the PTP clock source group. The ports of the first device D may include a first PTP port (port1), a second PTP port (port2), and a third PTP port (port3). Specifically, the first PTP port (port1) indicates the PTP port on the first device D that connects to the link between the first device D and the second device A. The second PTP port (port2) indicates the PTP port on the first device D that connects to the link between the first device D and the third device B. The third PTP port (port3) indicates the PTP port on the first device D that connects to the link between the first device D and the fifth device C. Table 6 is a statistical table of the clock identifiers of the first device D's port 2. As shown in Table 6, the clock identifiers Parentclock IDs collected by the first PTP port (port1) of the first device D include a and b. The clock identifiers Parentclock IDs collected by the second PTP port (port2) of the first device D include a and b. The clock identifiers collected by the third PTP port (port3) of the first device D include a, b, and n. As can be seen, the clock flags collected by the first PTP port and the second PTP port are completely identical. The first device D adds the first PTP port and the second PTP port to the first PTP switching group.

[0131] Table 6

[0132]

[0133] The second method involves pre-setting PTP ports and adding them to the first PTP switching group. This can be implemented in the following ways: First, manual selection is used. The first device includes a first PTP port and a second PTP port. The first PTP port indicates the PTP port on the first device that connects to the link between the first and second devices, and the second PTP port indicates the PTP port on the first device that connects to the link between the first and third devices. The first and second PTP ports in the first device are selected to form the first PTP switching group. In other words, the first and second PTP ports in the first device are manually pre-defined to form the first PTP switching group. Second, the first device includes a first PTP port and a second PTP port. The first PTP port indicates the PTP port on the first device that connects to the link between the first and second devices, and the second PTP port indicates the PTP port on the first device that connects to the link between the first and third devices. The first device receives instruction information, which instructs it to add the first and second PTP ports to the first PTP switching group. The instruction information may be sent by other devices in the bearer network equipment or by other devices other than the bearer network equipment. This application embodiment does not make specific limitations.

[0134] In some embodiments of this application, a clock synchronization method provided in this application further includes:

[0135] S406, The first device prevents all devices connected to the PTP ports in the first PTP switching group from tracking the master PTP clock signal.

[0136] The above implementation method can be used to form a first PTP switching group. The PTP ports of this first PTP switching group are used to connect the first device and the device tracking the primary PTP clock signal. When a link fails between the third device connected to the first device via the first PTP port in the first PTP switching group, the first device prevents all devices connected to the PTP ports in the first PTP switching group from tracking the primary PTP clock signal. In this way, all devices connected to the PTP ports in the first PTP switching group can reselect a source and track the backup PTP clock signal of the fourth device, ensuring time synchronization of all devices connected to the PTP ports in the first PTP switching group.

[0137] In some embodiments, after executing S401, the clock synchronization method provided in this application embodiment may further include:

[0138] S407. The first device determines that the PTP clock signal used by the fifth device does not require switching.

[0139] The fifth device communicates with each device in the PTP clock source group via a link, and tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails.

[0140] This step can be implemented in the following way:

[0141] Method 1: The first device determines that the PTP clock switching table stored by the first device does not include the first identifier corresponding to the fifth device. The PTP clock switching table is used to indicate devices that are allowed to switch tracking of PTP clock signals. The first identifier indicates the fifth device, which can be understood as follows: First, the first identifier can be the device identifier of the fifth device (such as an IP address).

[0142] Second, the first identifier can be the port identifier of the port on the first device that communicates with the fifth device.

[0143] Method 2: The first device determines that the PTP clock holding table stored by the first network device includes a first identifier corresponding to the fifth device. The PTP clock holding table is used to indicate devices whose PTP clock signals are not allowed to be switched, and the first identifier indicates the fifth device. The first identifier mentioned here is the same as the first identifier described above and will not be explained further.

[0144] S408, The first device allows the fifth device to keep tracking the master PTP clock signal of the first device.

[0145] In this embodiment, although the fifth device tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails, after the link between the first device and the third device fails, considering that the fifth device may have other services with less stringent time synchronization requirements, the fifth device can continue to track the primary PTP clock signal of the first device.

[0146] Taking the implementation of the method in the bearer network equipment as an example, the first and fourth devices mentioned in this method are both aggregation devices (AGG), and the second and third devices are both access devices (ACC). The first device is the primary device in the Precision Time Protocol (PTP) clock source group, and the clock signal on the first device can be called the primary PTP clock signal of the first device. The fourth device is the backup device in the PTP clock source group, and the clock signal on the fourth device can be called the backup PTP clock signal of the fourth device. The second and third devices communicate with each device in the PTP clock source group via links. The second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device originate from the same clock source. The Precision Time Protocol (PTP) clock source group can be understood as a group of devices that provide clock signals and have a primary / backup relationship.

[0147] This application provides a clock synchronization method, the execution subject of which can be the second device and the third device in the above embodiments. The method may include:

[0148] S701, the second device sends a first notification message to the first device. The first notification message is used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group.

[0149] The first device is the master device in the Precision Time Protocol (PTP) clock source group, which also includes other devices. The third device communicates with each device in the PTP clock source group via a link. The second device communicates with each device in the PTP clock source group via a link. The second device tracks the master PTP clock signal of the first device, and the third device tracks the master PTP clock signal of the first device.

[0150] The first announcement message is any of the following message types: Announce message, Signaling message, and Management message.

[0151] Specifically, during the process of the second device exchanging clock quality synchronization information with the first and fourth devices respectively, the second device collects the clock identifiers (clock ID1) of the first device and clock ID2 of the fourth device. The second device can then send the collected clock ID1 and clock ID2 to the first device in an Announce message, Signaling message, or Management message. Based on the Announce message, Signaling message, or Management message, the first device can identify the device communicating with the second device and belonging to the PTP clock source group. For detailed implementation, please refer to the above-mentioned related content; this application's embodiments will not repeat them further.

[0152] S702, the third device sends a second notification message to the first device. The second notification message is used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group.

[0153] The second announcement message is any of the following message types: Announce message, Signaling message, and Management message.

[0154] Specifically, during the process of the third device exchanging clock quality synchronization information with the first and fourth devices respectively, the third device collects the clock identifiers of the first device (clock ID1) and the fourth device (clock ID2). The third device can send the collected clock ID1 and clock ID2 to the first device in an Announce message, Signaling message, or Management message. Based on the Announce message, Signaling message, or Management message, the first device can identify the device communicating with the third device and belonging to the PTP clock source group.

[0155] In summary, based on the first and second notification messages, the first device determines that the device notified in the first notification message that communicates with the second device and belongs to the PTP clock source group is the same as the device notified in the second notification message that communicates with the third device and belongs to the PTP clock source group. Furthermore, the first device will add the first PTP port on the first device connected to the link between the first and second devices, and the second PTP port on the first device connected to the link between the first and third devices, to the first PTP switching group.

[0156] For details on the specific implementation of the embodiments of this application, please refer to the above-mentioned relevant content. The embodiments of this application will not be repeated here.

[0157] The various solutions in the above embodiments of this application can be combined without contradiction.

[0158] Figure 7 This is a schematic diagram of another clock synchronization device provided in an embodiment of this application. Figure 7 As shown in the figure, this application embodiment also provides a clock synchronization device 700, which includes: a first device 710 for determining a link failure between the first device 710 and a third device 730, wherein the first device 710 is the primary device in a Precision Time Protocol (PTP) clock source group, the PTP clock source group further includes a fourth device 740, which is a backup device in the PTP clock source group, the third device 730 communicates with each device in the PTP clock source group via a link, and a second device 720 communicates with each device in the PTP clock source group via a link. Before a link failure occurs between the first device 710 and the third device 730, the second device 720 tracks the primary PTP clock signal of the first device 710 and the third device 730 tracks the primary PTP clock signal of the first device 710.

[0159] The first device 710 is also used to prevent the second device 720 from tracking the master PTP clock signal of the first device 710.

[0160] Thus, when the first device 710 determines that the link between the first device 710 and the third device 730 has failed, the first device 710 prevents the second device 720 from tracking the primary PTP clock signal of the first device 710. This allows both the second device 720 and the third device 730 to re-track other high-priority devices in the PTP clock source group, effectively ensuring time synchronization between the second device 720 and the third device 730 and meeting the standard requirements.

[0161] Furthermore, the device also includes a second device 720 for tracking a backup PTP clock signal of the fourth device 740.

[0162] Furthermore, the device also includes a third device 730 for tracking a backup PTP clock signal of the fourth device 740.

[0163] Furthermore, the primary PTP clock signal of the first device 710 and the backup PTP clock signal of the fourth device 740 come from the same clock source.

[0164] Furthermore, the device also includes: the first device 710 is further configured to determine that the PTP clock signal on which the fifth device 750 is based does not need to be switched, wherein the fifth device 750 communicates with each device in the PTP clock source group via a link, and the fifth device 750 tracks the primary PTP clock signal of the first device 710 before the link between the first device 710 and the third device 730 fails.

[0165] The first device 710 is also used to allow the fifth device 750 to keep track of the master PTP clock signal of the first device 710.

[0166] In this embodiment, although the fifth device 750 tracks the primary PTP clock signal of the first device 710 before the link between the first device 710 and the third device 730 fails, after the link between the first device 710 and the third device 730 fails, considering that the fifth device 750 may have other services with less stringent time synchronization requirements, the fifth device 750 can continue to track the primary PTP clock signal of the first device 710.

[0167] Furthermore, the first device 710 is also used to determine that the first identifier corresponding to the fifth device 750 is not included in the PTP clock switching table stored by the first device 710, wherein the PTP clock switching table is used to indicate the device that is allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device 750.

[0168] Furthermore, the first device 710 is also used to determine that the PTP clock holding table stored by the first device 710 includes a first identifier corresponding to the fifth device 750, wherein the PTP clock holding table is used to indicate devices that are not allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device 750.

[0169] Furthermore, the first device 710 is also used to determine that the state of the PTP port on the first device 710 that is connected to the link between the first device 710 and the third device 730 is unavailable.

[0170] Furthermore, the device also includes: the first device 710 is further configured to receive a first notification message sent by the second device 720, the first notification message being used to notify the first device 710 of devices that communicate with the second device 720 and belong to the PTP clock source group;

[0171] The first device 710 is also used to receive a second notification message sent by the third device 730. The second notification message is used to notify the first device 710 of devices that communicate with the third device 730 and belong to the PTP clock source group.

[0172] The first device 710 is further configured to add the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates the PTP port on the first device 710 that is connected to the link between the first device 710 and the second device 720, and the second PTP port indicates the PTP port on the first device 710 that is connected to the link between the first device 710 and the third device 730.

[0173] Furthermore, the first device 710 is also used to determine that the device announced by the first notification message, which communicates with the second device 720 and belongs to the PTP clock source group, is the same as the device announced by the second notification message, which communicates with the third device 730 and belongs to the PTP clock source group.

[0174] The first device 710 is also used to add the first PTP port and the second PTP port to the first PTP switching group.

[0175] Furthermore, the first device 710 is also used to prevent all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal. When the link between the third device 730 and the first device 710 via the first PTP port in the first PTP switching group fails, the first device 710 prevents all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal. In this way, all devices connected to PTP ports in the first PTP switching group can reselect a source and track the backup PTP clock signal of the fourth device 740, ensuring time synchronization of all devices connected to PTP ports in the first PTP switching group.

[0176] Furthermore, the first and second announcement messages are any of the following message types: Announce message, Signaling message, and Management message.

[0177] Furthermore, the first device 710 includes a first PTP switching group, which includes a first PTP port and a second PTP port. The first PTP port indicates a PTP port on the first device 710 that is connected to the link between the first device 710 and the second device 720, and the second PTP port indicates a PTP port on the first device 710 that is connected to the link between the first device 710 and the third device 730.

[0178] The first device 710 is also used to prevent all devices connected to the PTP ports in the first PTP switching group from tracking the master PTP clock signal.

[0179] This application embodiment also provides a clock synchronization device, which includes: a second device for sending a first notification message to a first device, wherein the first notification message is used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group;

[0180] The third device is used to send a second notification message to the first device. The second notification message is used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group. The first device is the master device in the Precision Time Protocol (PTP) clock source group. The PTP clock source group also includes other devices. The third device communicates with each device in the PTP clock source group via a link. The second device communicates with each device in the PTP clock source group via a link. The second device tracks the master PTP clock signal of the first device, and the third device tracks the master PTP clock signal of the first device.

[0181] The first device is used to add the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates the PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates the PTP port on the first device that is connected to the link between the first device and the third device.

[0182] Furthermore, the first device is also used for:

[0183] The first device is used to determine that the device that is communicated with the second device and belongs to the PTP clock source group, as announced in the first announcement message, is the same as the device that is communicated with the third device and belongs to the PTP clock source group, as announced in the second announcement message.

[0184] The first device is used to add the first PTP port and the second PTP port to the first PTP switching group.

[0185] Furthermore, the first and second announcement messages are any of the following message types: Announce message, Signaling message, and Management message.

[0186] This application also provides a bearer network device, which includes: a unit for performing the steps described in any of the above claims, or a unit for performing the steps described in any of the above claims.

[0187] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0188] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0189] This application also provides a communication system, including the aforementioned access device and aggregation device.

[0190] This application also provides a chip including a processor and an interface circuit. The interface circuit is coupled to the processor. The processor is used to run computer programs or instructions to implement the above-described method. The interface circuit is used to communicate with other modules outside the chip.

[0191] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0192] In the description of this application, the words "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0193] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0194] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0195] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0196] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0197] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

[0198] It should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A clock synchronization method, characterized in that, The method includes: A first device determines that the link between the first device and the third device is faulty. The first device is the primary device in a Precision Time Protocol (PTP) clock source group, which also includes a fourth device, which is a backup device in the PTP clock source group. The third device communicates with each device in the PTP clock source group via a link. The second device communicates with each device in the PTP clock source group via a link. Before the link between the first device and the third device fails, the second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The first device prevents the second device from tracking the master PTP clock signal of the first device.

2. The method according to claim 1, characterized in that, After the first device prevents the second device from tracking the primary PTP clock signal of the first device, the method further includes: The second device tracks the backup PTP clock signal of the fourth device.

3. The method according to claim 1 or 2, characterized in that, After the first device determines that the link between the first device and the third device is faulty, the process further includes: The third device tracks the backup PTP clock signal of the fourth device.

4. The method according to claim 1 or 2, characterized in that, The primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device come from the same clock source.

5. The method according to claim 1 or 2, characterized in that, After the first device determines that the link between the first device and the third device is faulty, the process further includes: The first device determines that the PTP clock signal used by the fifth device does not need to be switched, wherein the fifth device communicates with each device in the PTP clock source group via a link, and the fifth device tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails. The first device allows the fifth device to keep tracking the master PTP clock signal of the first device.

6. The method according to claim 5, characterized in that, The first device determines that the PTP clock signal used by the fifth device does not require switching, including: The first device determines that the PTP clock switching table stored by the first device does not include the first identifier corresponding to the fifth device, wherein the PTP clock switching table is used to indicate devices that are allowed to switch the PTP clock signal being tracked, and the first identifier indicates the fifth device.

7. The method according to claim 5, characterized in that, The first device determines that the PTP clock signal used by the fifth device does not require switching, including: The first device determines that the PTP clock holding table stored by the first device includes a first identifier corresponding to the fifth device, wherein the PTP clock holding table is used to indicate devices that are not allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device.

8. The method according to claim 1 or 2, characterized in that, The first device determines a link failure between the first device and the third device, including: The first device determines that the PTP port on the first device that is connected to the link between the first device and the third device is in an unavailable state.

9. The method according to claim 1 or 2, characterized in that, Before the first device determines that the link between the first device and the third device is faulty, the process also includes: The first device receives a first notification message sent by the second device. The first notification message is used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group. The first device receives a second notification message sent by the third device, the second notification message being used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group; The first device adds the first PTP port and the second PTP port to the first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates the PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates the PTP port on the first device that is connected to the link between the first device and the third device.

10. The method according to claim 9, characterized in that, The first device adds the first PTP port and the second PTP port to the first PTP switching group according to the first notification message and the second notification message, including: The first device determines that the device announced by the first notification message, which communicates with the second device and belongs to the PTP clock source group, is the same as the device announced by the second notification message, which communicates with the third device and belongs to the PTP clock source group. The first device adds the first PTP port and the second PTP port to the first PTP switching group.

11. The method according to claim 9, characterized in that, The method further includes: The first device prevents all devices connected to the PTP ports in the first PTP switching group from tracking the primary PTP clock signal.

12. The method according to claim 9, characterized in that, The first announcement message and the second announcement message are any of the following message types: Announce message, Signaling message, and Management message.

13. The method according to claim 1 or 2, characterized in that, The first device includes a first PTP switching group, the first PTP switching group includes a first PTP port and a second PTP port, the first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device. The method includes: The first device prevents all devices connected to the PTP ports in the first PTP switching group from tracking the primary PTP clock signal.

14. A clock synchronization method, characterized in that, The first device is the master device in a Precision Time Protocol (PTP) clock source group, which also includes other devices. A third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link. The second device tracks the master PTP clock signal of the first device, and the third device tracks the master PTP clock signal of the first device. The method includes: The second device sends a first notification message to the first device. The first notification message is used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group. The third device sends a second notification message to the first device. The second notification message is used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group. The first device is configured to add a first PTP port and a second PTP port to a first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device.

15. The method according to claim 14, characterized in that, The first device is configured to add the first PTP port and the second PTP port to the first PTP switching group according to the first notification message and the second notification message, including: The first device is used to determine that the device announced by the first notification message, which communicates with the second device and belongs to the PTP clock source group, is the same as the device announced by the second notification message, which communicates with the third device and belongs to the PTP clock source group. The first device is used to add the first PTP port and the second PTP port to the first PTP switching group.

16. The method according to claim 14 or 15, characterized in that, The first announcement message and the second announcement message are any of the following message types: Announce message, Signaling message, and Management message.

17. A clock synchronization device, characterized in that, include: A first device is used to determine a link failure between the first device and a third device, wherein the first device is a primary device in a Precision Time Protocol (PTP) clock source group, the PTP clock source group further includes a fourth device, which is a backup device in the PTP clock source group, the third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link. Furthermore, before a link failure occurs between the first device and the third device, the second device tracks the primary PTP clock signal of the first device, and the third device tracks the primary PTP clock signal of the first device. The first device is also configured to prevent the second device from tracking the primary PTP clock signal of the first device.

18. The apparatus according to claim 17, characterized in that, Also includes: The second device is used to track the backup PTP clock signal of the fourth device.

19. The apparatus according to claim 17 or 18, characterized in that, Also includes: The third device is used to track the backup PTP clock signal of the fourth device.

20. The apparatus according to claim 17 or 18, characterized in that, The primary PTP clock signal of the first device and the backup PTP clock signal of the fourth device come from the same clock source.

21. The apparatus according to claim 17 or 18, characterized in that, Also includes: The first device is further configured to determine that the PTP clock signal on which the fifth device is based does not need to be switched, wherein the fifth device communicates with each device in the PTP clock source group via a link, and the fifth device tracks the primary PTP clock signal of the first device before the link between the first device and the third device fails. The first device is also configured to allow the fifth device to maintain tracking of the master PTP clock signal of the first device.

22. The apparatus according to claim 21, characterized in that, The first device is further configured to determine that the first identifier corresponding to the fifth device is not included in the PTP clock switching table stored by the first device, wherein the PTP clock switching table is used to indicate devices that are allowed to switch the PTP clock signal being tracked, and the first identifier indicates the fifth device.

23. The apparatus according to claim 21, characterized in that, The first device is further configured to determine that the PTP clock holding table stored by the first device includes a first identifier corresponding to the fifth device, wherein the PTP clock holding table is used to indicate devices that are not allowed to switch the tracked PTP clock signal, and the first identifier indicates the fifth device.

24. The apparatus according to claim 17 or 18, characterized in that, The first device is further configured to determine that the state of the PTP port on the first device that is connected to the link between the first device and the third device is unavailable.

25. The apparatus according to claim 17 or 18, characterized in that, Also includes: The first device is further configured to receive a first notification message sent by the second device, the first notification message being used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group; The first device is further configured to receive a second notification message sent by the third device, the second notification message being used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group; The first device is further configured to add a first PTP port and a second PTP port to a first PTP switching group according to the first notification message and the second notification message, wherein the first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device.

26. The apparatus according to claim 25, characterized in that, The first device is further configured to determine that the device announced by the first notification message, which communicates with the second device and belongs to the PTP clock source group, is the same as the device announced by the second notification message, which communicates with the third device and belongs to the PTP clock source group. The first device is also used to add the first PTP port and the second PTP port to the first PTP switching group.

27. The apparatus according to claim 25, characterized in that, The first device is also configured to prevent all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal.

28. The apparatus according to claim 25, characterized in that, The first announcement message and the second announcement message are any of the following message types: Announce message, Signaling message, and Management message.

29. The apparatus according to claim 17 or 18, characterized in that, The first device includes a first PTP switching group, which includes a first PTP port and a second PTP port. The first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device. The first device is also configured to prevent all devices connected to PTP ports in the first PTP switching group from tracking the primary PTP clock signal.

30. A clock synchronization device, characterized in that, The first device is the master device in a Precision Time Protocol (PTP) clock source group, which also includes other devices. A third device communicates with each device in the PTP clock source group via a link, and a second device communicates with each device in the PTP clock source group via a link. The second device tracks the master PTP clock signal of the first device, and the third device tracks the master PTP clock signal of the first device. The apparatus includes: The second device is used to send a first notification message to the first device, the first notification message being used to notify the first device of devices that communicate with the second device and belong to the PTP clock source group; The third device is used to send a second notification message to the first device, the second notification message being used to notify the first device of devices that communicate with the third device and belong to the PTP clock source group; The first device is configured to add a first PTP port and a second PTP port to a first PTP switching group according to the first announcement message and the second announcement message. The first PTP port indicates a PTP port on the first device that is connected to the link between the first device and the second device, and the second PTP port indicates a PTP port on the first device that is connected to the link between the first device and the third device.

31. The apparatus according to claim 30, characterized in that, The first device is also used for: The first device is used to determine that the device announced by the first notification message, which communicates with the second device and belongs to the PTP clock source group, is the same as the device announced by the second notification message, which communicates with the third device and belongs to the PTP clock source group. The first device is used to add the first PTP port and the second PTP port to the first PTP switching group.

32. The apparatus according to claim 30 or 31, characterized in that, The first announcement message and the second announcement message are any of the following message types: Announce message, Signaling message, and Management message.

33. A bearer network device, characterized in that, include: Used to perform the clock synchronization device according to any one of claims 17 to 29, or used to perform the clock synchronization device according to any one of claims 30 to 32.

34. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the clock synchronization method as described in any one of claims 1-13, or the clock synchronization method as described in any one of claims 14-16.

35. A computer program, characterized in that, When the program is invoked by the processor, the clock synchronization method of any one of claims 1-13 is executed, or the clock synchronization method of any one of claims 14-16 is executed.

36. A chip system, characterized in that, The method includes one or more processors, which, when executing instructions, perform a clock synchronization method as described in any one of claims 1-13, or a clock synchronization method as described in any one of claims 14-16.

Citation Information

Patent Citations

  • Clock synchronization method and device

    CN104092528A

  • Time synchronization method and time synchronization device

    JP2016152488A