US-12621073-B2 - Method and apparatus for determining clock, and storage medium
Abstract
A method and an apparatus are provided for determining a network device receiving a first signal and at least one second signal, wherein the first signal carries data to be sent through a first flexible Ethernet interface. A first physical layer clock is determined based on the first signal. A second physical layer clock is determined based on the at least one second signal or the first physical layer clock and the at least one second signal. The first physical layer clock or the second physical layer clock is used as a sending clock of a non-flexible Ethernet interface. The network device includes the first flexible Ethernet interface and the non-flexible Ethernet interface.
Inventors
- Jingfei LYU
- Fanshun Meng
- Jinhui Wang
- Wei Su
Assignees
- HUAWEI TECHNOLOGIES CO., LTD.
Dates
- Publication Date
- 20260505
- Application Date
- 20231023
- Priority Date
- 20210423
Claims (20)
- 1 . A method for determining a clock, the method comprising: receiving, by a first network device, a first signal and at least one second signal, wherein the first signal carries data to be sent through a first flexible Ethernet interface; determining, by the first network device, a first physical layer clock based on the first signal; determining, by the first network device, a second physical layer clock based on the at least one second signal or the first physical layer clock and the at least one second signal; and adopting, by the first network device, the first physical layer clock or the second physical layer clock as a sending clock of a non-flexible Ethernet interface, wherein the first network device comprises the first flexible Ethernet interface and the non-flexible Ethernet interface.
- 2 . The method according to claim 1 , wherein determining, by the first network device, the second physical layer clock based on the at least one second signal comprises: determining, by the first network device, the second physical layer clock based on a physical layer clock quality level associated with the at least one second signal; and/or determining, by the first network device, the second physical layer clock based on a physical layer clock priority associated with the at least one second signal.
- 3 . The method according to claim 1 , wherein determining, by the first network device, the second physical layer clock based on the first physical layer clock and the at least one second signal comprises: determining, by the first network device, the second physical layer clock based on a physical layer clock quality level associated with the first physical layer clock and a physical layer clock quality level associated with the at least one second signal; and/or determining, by the first network device, the second physical layer clock based on a physical layer clock priority associated with the first physical layer clock and a physical layer clock priority associated with the at least one second signal.
- 4 . The method according to claim 1 , wherein adopting, by the first network device, the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface comprises: adopting, by the first network device, the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface according to a configuration command.
- 5 . The method according to claim 1 , wherein adopting, by the first network device, the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface comprises: adopting, by the first network device, the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface based on a physical layer clock quality level of the first physical layer clock and a physical layer clock quality level of the second physical layer clock; and/or adopting, by the first network device, the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface based on a physical layer clock priority of the first physical layer clock and a physical layer clock priority of the second physical layer clock.
- 6 . The method according to claim 1 , further comprising: adopting, by the first network device, the first physical layer clock as a sending clock of the first flexible Ethernet interface.
- 7 . The method according to claim 1 , wherein the first network device is an edge device of an optical transport network, and the first signal comes from the optical transport network.
- 8 . The method according to claim 1 , wherein a type of the first flexible Ethernet interface comprises a flexible Ethernet (FlexE), a slicing packet network (SPN), or a metro transport network (MTN).
- 9 . The method according to claim 1 , wherein a type of the non-flexible Ethernet interface comprises an Ethernet interface, a synchronous digital hierarchy (SDH), a synchronous optical network (SONET), an optical supervisory channel (OSC), or an optical transport unit (OUT).
- 10 . The method according to claim 1 , wherein the first signal carries flexible Ethernet data received through a first optical transport unit (OUT) interface of the first network device.
- 11 . The method according to claim 1 , wherein any one of the at least one second signal carries overhead data received through a first optical transport unit (OUT) interface of the first network device; any one of the at least one second signal carries data received through an optical supervisory channel (OSC) interface of the first network device; or any one of the at least one second signal carries data received through an Ethernet interface of the first network device.
- 12 . An apparatus for determining a clock, the apparatus comprising: a processor; a memory coupled to the processor and storing program instructions that, upon execution by the processor, cause the apparatus to: receive a first signal and at least one second signal, wherein the first signal carries data to be sent through a first flexible Ethernet interface; determine a first physical layer clock based on the first signal; and determine a second physical layer clock based on the at least one second signal or the first physical layer clock and the at least one second signal, wherein the first physical layer clock or the second physical layer clock is used adopted as a sending clock of a non-flexible Ethernet interface, and wherein the apparatus comprises the first flexible Ethernet interface and the non-flexible Ethernet interface.
- 13 . The apparatus according to claim 12 , wherein the program instructions, upon execution by the processor, further cause the apparatus to: determine the second physical layer clock based on a physical layer clock quality level associated with the at least one second signal; and/or determine the second physical layer clock based on a physical layer clock priority associated with the at least one second signal.
- 14 . The apparatus according to claim 12 , wherein the program instructions, upon execution by the processor, further cause the apparatus to: determine the second physical layer clock based on a physical layer clock quality level associated with the first physical layer clock and a physical layer clock quality level associated with the at least one second signal; and/or determine the second physical layer clock based on a physical layer clock priority associated with the first physical layer clock and a physical layer clock priority associated with the at least one second signal.
- 15 . The apparatus according to claim 12 , wherein the program instructions, upon execution by the processor, further cause the apparatus to: adopt the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface according to a configuration command.
- 16 . The apparatus according to claim 12 , wherein the program instructions, upon execution by the processor, further cause the apparatus to: adopt the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface based on a physical layer clock quality level of the first physical layer clock and a physical layer clock quality level of the second physical layer clock; and/or adopt the first physical layer clock or the second physical layer clock as the sending clock of the non-flexible Ethernet interface based on a physical layer clock priority of the first physical layer clock and a physical layer clock priority of the second physical layer clock.
- 17 . The apparatus according to claim 12 , wherein the program instructions, upon execution by the processor, further cause the apparatus to: adopt the first physical layer clock as a sending clock of the first flexible Ethernet interface.
- 18 . The apparatus according to claim 12 , wherein the apparatus is an edge device of an optical transport network, and the first signal comes from the optical transport network.
- 19 . The apparatus according to claim 12 , wherein a type of the first flexible Ethernet interface comprises a flexible Ethernet (FlexE), a slicing packet network (SPN), or a metro transport network (MTN).
- 20 . A non-transitory computer-readable storage medium storing a computer program, wherein upon the computer program being executed by a computer, a method for determining a clock is implemented, the method comprising: receiving, a first signal and at least one second signal, wherein the first signal carries data to be sent through a first flexible Ethernet interface; determining, a first physical layer clock based on the first signal; determining, a second physical layer clock based on the at least one second signal or the first physical layer clock and the at least one second signal; and adopting, the first physical layer clock or the second physical layer clock as a sending clock of a non-flexible Ethernet interface, wherein a first network device comprises the first flexible Ethernet interface and the non-flexible Ethernet interface.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2022/086985 filed on Apr. 15, 2022, which claims priority to Chinese Patent Application No. 202110443130.2, filed on Apr. 23, 2021 and Chinese Patent Application No. 202110605060.6, filed on May 31, 2021. All of the aforementioned patent applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD Embodiments of this application relate to the field of communication, and in particular, to a method and an apparatus for determining a clock, and a storage medium. BACKGROUND An edge device of an optical transport network (OTN) includes an optical transport unit (OTU) interface, a flexible Ethernet (FlexE) interface, and at least one non-flexible Ethernet interface. The at least one non-flexible Ethernet interface includes a first non-flexible Ethernet interface and a second non-flexible Ethernet interface. The edge device communicates with the OTN through the OTU interface, receives flexible Ethernet data and/or non-flexible Ethernet data through the OTU interface, and receives the non-flexible Ethernet data through the first non-flexible Ethernet interface. The edge device further sends the received flexible Ethernet data through the flexible Ethernet interface, sends the non-flexible Ethernet data through the second non-flexible Ethernet interface, or sends, through the second non-flexible Ethernet interface, non-flexible Ethernet data generated by the edge device. The edge device includes a local crystal oscillator. The edge device uses a clock generated by the local crystal oscillator as a sending clock of the second non-flexible Ethernet interface. In other words, based on the clock generated by the local crystal oscillator, the edge device sends the received non-flexible Ethernet data through the second non-flexible Ethernet interface, or sends, through the second non-flexible Ethernet interface, the non-flexible Ethernet data generated by the edge device. Because the edge device usually uses the clock generated by the local crystal oscillator to send the non-flexible Ethernet data through the second non-flexible Ethernet interface, the edge device cannot continue transmitting a clock of an upstream device through the second non-flexible Ethernet interface. SUMMARY This application provides a method and an apparatus for determining a clock, and a storage medium, so that a network device can use a clock of an upstream device as a sending clock of a non-flexible Ethernet interface. Technical solutions are as follows: According to a first aspect, this application provides a method for determining a clock. In the method, a first network device receives a first signal and at least one second signal, where the first signal carries data to be sent through a first flexible Ethernet interface. The first network device determines a first physical layer clock based on the first signal. The first network device determines a second physical layer clock based on the at least one second signal or the first physical layer clock and the at least one second signal. The first network device uses the first physical layer clock or the second physical layer clock as a sending clock of a non-flexible Ethernet interface. The first network device includes the first flexible Ethernet interface and the non-flexible Ethernet interface. In the method, the first network device determines the second physical layer clock based on the at least one second signal or the first physical layer clock and the at least one second signal. Because the second physical layer clock is determined based on the first signal, and both the first signal and the at least one second signal are signals received by the first network device, the first physical layer clock or the second physical layer clock is used as the sending clock of the non-flexible Ethernet interface. Therefore, the sending clock of the non-flexible Ethernet interface is obtained based on a signal (the first signal or the second signal) received by the first network device. In this way, the first network device may use a clock of an upstream device that sends the signal as the sending clock of the non-flexible Ethernet interface, so that the clock of the upstream device continues to be transmitted through the non-flexible Ethernet interface. In addition, in conventional technologies, a clock generated by a local crystal oscillator is used, and non-flexible Ethernet data is sent through a non-flexible Ethernet interface. However, in the method, because the sending clock of the non-flexible Ethernet interface is obtained based on the signal (the first signal or the second signal) received by the first network device, a clock generated based on the received signal is used as the sending clock of the non-flexible Ethernet interface. Therefore, the edge device may transmit the clock of the upstream device through the non-flexible Ethernet interface of the e