WO2020164100A1 - 时钟同步的方法和装置 - Google Patents

时钟同步的方法和装置 Download PDF

Info

Publication number
WO2020164100A1
WO2020164100A1 PCT/CN2019/075194 CN2019075194W WO2020164100A1 WO 2020164100 A1 WO2020164100 A1 WO 2020164100A1 CN 2019075194 W CN2019075194 W CN 2019075194W WO 2020164100 A1 WO2020164100 A1 WO 2020164100A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock
target clock
time
target
network element
Prior art date
Application number
PCT/CN2019/075194
Other languages
English (en)
French (fr)
Inventor
傅健新
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2019/075194 priority Critical patent/WO2020164100A1/zh
Priority to CN201980092010.3A priority patent/CN113424466B/zh
Publication of WO2020164100A1 publication Critical patent/WO2020164100A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • This application relates to the field of communication technology, and in particular to a method and device for clock synchronization.
  • some network elements with data transmission at least need to achieve synchronization of the sending clock for service sending.
  • clock synchronization methods include: clock synchronization based on serializer (Serdes) technology, clock synchronization based on Ethernet synchronization technology and the Institute of Electrical and Electronics Engineers (IEEE) 1588 protocol.
  • Serdes serializer
  • IEEE Institute of Electrical and Electronics Engineers
  • 1588 protocol the method of clock synchronization based on Serdes technology requires the use of multiple optical fibers or multiple wavelengths or the addition of a layer of optical transmission network (OTN) equipment when multiple transmission clocks need to be synchronized. More physical resources.
  • the clock synchronization method based on the 1588 protocol, the clock obtained after synchronization from the slave node is essentially the timing clock of the application layer. When the timing clock and the sending clock of the physical layer are different, the sending clock of the master node and the slave node is not actually realized. Synchronization.
  • the embodiment of the present application provides a method and device for clock synchronization.
  • the clock synchronization between network elements does not need to occupy more physical resources, and is simple and easy to implement.
  • a first aspect provides a clock synchronization method
  • the clock synchronization method includes: controlling a first timer of a first network element and a second timer of a second network element to be in a time-aligned state, and the time-aligned
  • the state is that the time increments of the first timer and the second timer are the same within the same time; in the state of time alignment, according to the occurrence time of two adjacent rising edges corresponding to the target clock or
  • the period information or frequency information of the target clock is obtained by the occurrence time of two adjacent falling edges, and the period information or frequency information of the target clock is used for the second network element to obtain a clock synchronized with the target clock
  • the target clock is any clock that needs to be transmitted from the first network element to the second network element; period information or frequency information of the target clock is sent to the second network element.
  • the clock synchronization in this solution is performed under the premise that the first timer of the first network element and the second timer of the second network element have the same time increment in the same time. Therefore, the first network element is required
  • the period information or frequency information of the target clock obtained at the time when the two adjacent rising edges or the time when the two adjacent falling edges occur corresponding to the target clock transmitted to the second network element can be directly used by the second network element.
  • the element is used to obtain the clock synchronized with the clock, that is, when the clock is synchronized, the first network element only needs to obtain the time according to the occurrence time of two adjacent rising edges or the occurrence time of two adjacent falling edges corresponding to the target clock
  • the period information or frequency information of the target clock is received, and the period information or frequency information of the target clock is sent to the second network element, so that the second network element performs clock synchronization according to the period information or frequency information of the target clock.
  • the method is simple and easy to implement.
  • the period information or frequency Information does not need to be transmitted by multiple optical fibers, that is, there is no need to set multiple optical fibers to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and the period information or frequency information does not require multiple Wavelength transmission means that there is no need to set multiple wavelengths to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and there is no need to set up OTN equipment. That is, the clock synchronization method in this solution also occupies fewer physical resources.
  • the period information or frequency information of the target clock can be obtained through but not limited to the following Three implementation methods are implemented:
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge;
  • the period information of the target clock includes: the first rising edge of the first rising edge A time and a second time when the second rising edge occurs.
  • the acquired period information of the target clock is the first time when the first rising edge occurs and the second time when the second rising edge occurs, and no other calculations are performed, and the efficiency of acquiring the period information of the target clock is high. .
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge; according to the occurrence time of the two adjacent rising edges corresponding to the target clock, Obtaining period information of the target clock includes:
  • the period information of the target clock includes a clock period corresponding to the target clock.
  • the acquired period information of the target clock is the clock period corresponding to the target clock calculated according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, so that the second network element There is no need to calculate and acquire the clock period corresponding to the target clock according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, which improves the efficiency of the second network element in acquiring a clock synchronized with the target clock.
  • the signaling overhead when sending the information of the clock period corresponding to the target clock to the second network element is more than that of comparing the first time and the first time. The signaling overhead when these two information are sent to the second network element at the second time is less.
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge; the two adjacent rising edges corresponding to the target clock are used to obtain the Period information of the target clock, including:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock.
  • the acquired period information of the target clock is the clock frequency corresponding to the target clock calculated according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, so that the second network element There is no need to calculate and acquire the clock frequency corresponding to the target clock according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, which improves the efficiency of the second network element in acquiring a clock synchronized with the target clock.
  • the signaling overhead when sending the information of the clock frequency corresponding to the target clock to the second network element is greater than that of comparing the first time and the second network element. The signaling overhead when these two information are sent to the second network element at the second time is less.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock in the first aspect may also be two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock may also be two adjacent falling edges of the target clock;
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • the period information or frequency information of the target clock includes the target
  • the frequency division coefficient of the clock enables the second network element to accurately obtain a clock synchronized with the target clock.
  • the sending period information or frequency information of the target clock to the second network element includes:
  • the period information or frequency information of the target clock is sent to the second network element through a message or a field segment used to transmit network overhead.
  • This solution provides a specific implementation method for sending period information or frequency information of the target clock to the second network element.
  • a second aspect provides a clock synchronization method, and the clock synchronization method includes:
  • the second timer that controls the second network element and the first timer of the first network element are in a time-aligned state, and the time-aligned state is that the first timer and the second timer are within the same time
  • the time increment is the same;
  • the target clock is any clock that needs to be transmitted from the first network element to the second network element;
  • a clock synchronized with the target clock is obtained.
  • the clock synchronization in this solution is performed on the premise that the first timer of the first network element and the second timer of the second network element have the same time increment in the same time. Therefore, the second network element can be based on The first network element sends the period information or frequency information of the target clock obtained according to the time when two adjacent rising edges or two adjacent falling edges corresponding to the target clock occur to obtain synchronization with the clock Clock.
  • the period information or frequency information of the clock that needs to be synchronized there is no need for multiple optical fiber transmission, that is, multiple optical fibers are not required to carry multiple services as in the prior art to achieve the purpose of synchronizing multiple clocks according to the service flow.
  • the period information or frequency information does not require multiple wavelengths.
  • To achieve the purpose of synchronizing multiple clocks according to the service flow there is no need to set multiple wavelengths to carry multiple services as in the prior art, and there is no need to set up OTN equipment. That is, the clock synchronization method in this solution is simple and easy to implement.
  • the period information of the target clock includes the following but not limited to the following two forms:
  • the first form when the appearance times of two adjacent rising edges corresponding to the target clock are the first time and the second time respectively, the period information of the target clock includes the first time and the second time.
  • This method can save the energy consumption of the first network element when acquiring the period information of the target clock.
  • the period information of the target clock includes the clock period corresponding to the target clock, and the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time.
  • the frequency information of the target clock may be in the following form:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock, and the target clock corresponds to
  • the clock frequency of is the reciprocal of the clock period corresponding to the target clock
  • the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time.
  • the acquiring a clock synchronized with the target clock according to period information or frequency information of the target clock includes:
  • a clock synchronized with the target clock is obtained.
  • This solution provides a specific implementation method for the second network element to obtain a clock synchronized with the target clock according to the period information or frequency information of the target clock.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock in the first aspect may also be two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock may also be two adjacent falling edges of the target clock;
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • a third aspect provides a clock synchronization device, and the clock synchronization device includes:
  • the control module is used to control the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, and the time-aligned state is that the first timer and all the timers are in the same time.
  • the time increment of the second timer is the same;
  • the obtaining module is further configured to obtain the period information of the target clock according to the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges corresponding to the target clock in the time-aligned state Or frequency information, the period information or frequency information of the target clock is used by the second network element to obtain a clock synchronized with the target clock, and the target clock is required to be transmitted from the first network element to the second network element. Any clock of the two network elements;
  • the sending module is configured to send period information or frequency information of the target clock to the second network element.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the period information of the target clock includes: a first time when the first rising edge occurs and a second time when the second rising edge occurs.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the acquiring module is specifically configured to acquire the absolute value of the difference between the first time when the first rising edge occurs and the second time when the second rising edge occurs to obtain the clock period corresponding to the target clock;
  • the period information of the target clock includes a clock period corresponding to the target clock.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the acquiring module is specifically used for:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock.
  • the sending module is specifically configured to:
  • the period information or frequency information of the target clock is sent to the second network element through a message or a field segment used to transmit network overhead.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock may also be the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock may also be two adjacent falling edges of the target clock;
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • a fourth aspect provides a clock synchronization device, the clock synchronization device includes:
  • the control module is configured to control the second timer of the second network element and the first timer of the first network element to be in a time-aligned state, and the time-aligned state is that the first timer and the first timer are in the same time
  • the time increment of the second timer is the same;
  • the receiving module is configured to receive period information or frequency information of a target clock from the first network element, where the period information or frequency information of the target clock is based on the first network element in the time-aligned state according to the target clock Corresponding to the occurrence time of two adjacent rising edges or the occurrence time of two adjacent falling edges, the target clock is any data that needs to be transmitted from the first network element to the second network element A clock
  • the obtaining module is configured to obtain a clock synchronized with the target clock according to period information or frequency information of the target clock.
  • the target clock The period information includes the first time and the second time, or the period information of the target clock includes the clock period corresponding to the target clock, and the clock period corresponding to the target clock is the first time and the second time The absolute value of the time difference.
  • the frequency information of the target clock includes a clock frequency corresponding to the target clock, and the clock frequency corresponding to the target clock is The reciprocal of the clock period, and the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time.
  • the acquisition module is specifically configured to:
  • a clock synchronized with the target clock is obtained.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock may also be the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock may also be two adjacent falling edges of the target clock;
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • a fifth aspect provides a communication device, the communication device includes a processor and a memory, the memory stores instructions, and the processor calls the instructions to control the execution of the following operations:
  • Control the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, and the time-aligned state is that the first timer and the second timer are within the same time
  • the time increment is the same;
  • the period information or frequency information of the target clock is acquired according to the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges corresponding to the target clock,
  • the period information or frequency information of the target clock is used by the second network element to obtain a clock synchronized with the target clock, and the target clock is any one that needs to be transmitted from the first network element to the second network element clock;
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the period information of the target clock includes: a first time when the first rising edge occurs and a second time when the second rising edge occurs.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the processor When the processor is used to control the execution of the operation of obtaining period information of the target clock according to the time when two adjacent rising edges corresponding to the target clock appear, it is specifically used to control the execution of the following operations:
  • the period information of the target clock includes a clock period corresponding to the target clock.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the processor When the processor is used to control and execute the operation of obtaining frequency information of the target clock according to the time when two adjacent rising edges corresponding to the target clock appear, it is specifically used to control the execution of the following operations:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock.
  • the processor when used to control the operation of sending period information or frequency information of the target clock to the second network element, specifically It is used to control the execution of the following operations: sending the period information or frequency information of the target clock to the second network element through a message or a field segment used to transmit network overhead.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • a sixth aspect provides a communication device, the communication device includes a processor and a memory, the memory stores instructions, and the processor calls the instructions to control the execution of the following operations:
  • the second timer that controls the second network element and the first timer of the first network element are in a time-aligned state, and the time-aligned state is that the first timer and the second timer are within the same time
  • the time increment is the same;
  • the target clock is any clock that needs to be transmitted from the first network element to the second network element;
  • a clock synchronized with the target clock is obtained.
  • the target clock The period information includes the first time and the second time, or the period information of the target clock includes the clock period corresponding to the target clock, and the clock period corresponding to the target clock is the first time and the second time The absolute value of the time difference.
  • the target clock The frequency information includes the clock frequency corresponding to the target clock, the clock frequency corresponding to the target clock is the reciprocal of the clock period corresponding to the target clock, and the clock period corresponding to the target clock is the first time and the The absolute value of the difference at the second time.
  • the processor is configured to control and execute the operation of obtaining a clock synchronized with the target clock according to period information or frequency information of the target clock It is specifically used to control the following operations:
  • a clock synchronized with the target clock is obtained.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of a clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • a seventh aspect provides a computer-readable storage medium, including a program or instruction.
  • the program or instruction runs on a computer, the method in the first aspect or any possible implementation of the first aspect is executed.
  • An eighth aspect provides a computer-readable storage medium, including a program or instruction, and when the program or instruction runs on a computer, the second aspect or the method in any possible implementation manner of the second aspect is executed.
  • the clock synchronization in this application is performed on the premise that the first timer of the first network element and the second timer of the second network element have the same time increment in the same time. Therefore, the first network element is required
  • the period information or frequency information of the target clock obtained at the time when the two adjacent rising edges or the time when the two adjacent falling edges occur corresponding to the target clock transmitted to the second network element can be directly used by the second network element.
  • the element is used to obtain the clock synchronized with the clock, that is, when the clock is synchronized, the first network element only needs to obtain the time according to the occurrence time of two adjacent rising edges or the occurrence time of two adjacent falling edges corresponding to the target clock
  • the period information or frequency information of the target clock is received, and the period information or frequency information of the target clock is sent to the second network element, so that the second network element performs clock synchronization according to the period information or frequency information of the target clock.
  • the method is simple and easy to implement.
  • the period information or frequency Information does not need to be transmitted by multiple optical fibers, that is, there is no need to set multiple optical fibers to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and the period information or frequency information does not require multiple Wavelength transmission means that there is no need to set multiple wavelengths to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and there is no need to set up OTN equipment. That is, the clock synchronization method in this solution also occupies fewer physical resources.
  • FIG. 1 is a schematic diagram of a clock-synchronized communication network model provided by an embodiment of the application
  • FIG. 2 is a schematic diagram 1 of the principle of clock synchronization provided by an embodiment of this application;
  • FIG. 3 is a second schematic diagram of the principle of clock synchronization provided by an embodiment of this application.
  • Fig. 4 is a schematic diagram of a transmission mode between network elements provided by an embodiment of the present application.
  • Fig. 5 is a schematic diagram 1 of an application scenario provided by an embodiment of the application.
  • Fig. 6 is a schematic diagram 1 of an application scenario provided by an embodiment of the application.
  • FIG. 7 is an interaction diagram of a clock synchronization method provided by an embodiment of this application.
  • FIG. 8 is a schematic block diagram 1 of a clock synchronization apparatus provided by an embodiment of this application.
  • FIG. 9 is a second schematic block diagram of a clock synchronization apparatus provided by an embodiment of this application.
  • FIG. 10 is a schematic block diagram 1 of a communication device provided by an embodiment of this application.
  • FIG. 11 is a second schematic block diagram of a communication device provided by an embodiment of this application.
  • FIG. 12 is a third schematic block diagram of a communication device provided by an embodiment of this application.
  • FIG. 13 is a fourth schematic block diagram of a communication device provided by an embodiment of this application.
  • Clock synchronization The frequency or phase between the signals maintains a certain strict and specific relationship.
  • the signals appear at the same rate at their corresponding effective instants, and the equipment in the communication network is maintained at the same rate, that is, the signals are kept constant. Phase difference.
  • Time synchronization that is, phase synchronization. If the frequency and phase between the signals are consistent, the phase difference between the signals is always zero.
  • the rising edge of the clock In digital circuits, the moment (time) when the digital level changes from low level (digital "0") to high level (digital "1") is called the rising edge.
  • Falling edge of the clock In digital circuits, the moment when the digital level changes from a high level (digital "1") to a low level (digital "0") is called a falling edge.
  • FIG. 1 is a schematic diagram of a clock-synchronized communication network model provided by an embodiment of the application, as shown in FIG. 1:
  • the upstream network element A uses the local clock as the transmission clock of the service flow.
  • the frequency of the transmission clock of the service flow of the network element A is 1 GHz, and the network element A sends one bit every 1 ns.
  • the sending clock of the service flow may also be called the service clock.
  • the network element B restores the transmission clock of the service flow sent by the network element A according to the service flow received from the network element A, and serves as the local clock of the network element B and also used as the signal transmission clock of the network element B.
  • the network element C restores the sending clock of the service flow sent by the network element B according to the service flow received from the network element B, and serves as the local clock of the network element C.
  • the downstream network element completes the clock synchronization with the upstream network element. Through step-by-step synchronization, the entire network finally achieves network-wide clock synchronization.
  • Synchronous digital hierarchy (SDH) networks, optical transmission network (optical transmission net, OTN) networks, and telecom Ethernet networks that support synchronous Ethernet are all typical applications based on the communication network model shown in Figure 1.
  • the first technology based on the serializer (Serdes) technology for clock synchronization.
  • FIG 2 is a schematic diagram 1 of the principle of clock synchronization provided by an embodiment of the application; referring to Figure 2, clock synchronization based on Serdes technology is the most commonly used clock synchronization technology.
  • clock synchronization based on Serdes technology is the most commonly used clock synchronization technology.
  • Serdes restores the serial bit stream to parallel data, and at the same time restores the service of the upstream network element of the network element The transmit clock of the stream.
  • one Serdes can only recover one clock, that is, in the case of a single wavelength, one optical fiber can only recover one transmission clock of the upstream network element.
  • a communication network such as the (5th generation, 5G) communication system
  • a communication network carries multiple services such as mobile communication network, Internet of Things, and autonomous driving
  • the entire communication network needs to complete multiple services for multiple services.
  • the transmission clock also called multi-domain clock
  • the number of fibers needs to be increased to carry multiple services (occupying more fibers) to complete the synchronization of the service clocks according to each service flow, or use wavelength division multiplexing
  • Use technology to use multiple wavelengths to carry multiple services (occupying more wavelength resources) to complete the synchronization of each transmission clock according to each service flow, or add a layer of OTN transmission equipment to handle multiple services (increase The physical equipment used) to complete the synchronization of each transmission clock according to each service flow.
  • the second technology clock synchronization technology based on 1588 protocol, that is, clock synchronization technology based on packet time synchronization protocol.
  • FIG. 3 is a schematic diagram 2 of the principle of clock synchronization provided by an embodiment of the application; see FIG. 3,
  • the master node sends a synchronization (Sync) message to the slave node, and records the packet sending time t 1 .
  • t 1 can be sent to the slave clock with the synchronization message.
  • the slave node records the arrival time t 2 of the synchronization message.
  • the slave node sends a delay request (Delay_req) message to the master node, and records the packet sending time t 3 .
  • the master node records the arrival time t 4 of the delay request message, and sends the delay request response message (Delay_resp) back to the slave node at t 4 .
  • the difference ⁇ t 1 between the time t 1 of sending synchronization messages in two adjacent periods and the arrival time t of the synchronization messages in two adjacent periods are obtained. 2, the difference ⁇ t 2, 2 according to the clock synchronization ⁇ t 1 and ⁇ t. If ⁇ t 1 > ⁇ t 2 , it means that the timing clock of the slave node is slow and needs to be adjusted faster; otherwise, it needs to be adjusted slower.
  • the following formula can be used to gradually adjust the slave node timing clock frequency f slave until the adjusted node timing clock frequency makes the measured ⁇ t 1 and ⁇ t 2 equal, that is, ⁇ t 1 - ⁇ t 2 in the following formula is equal to 0,
  • the left f master -f slave in the following formula is also equal to 0, and the clocks of the master node and the slave node are synchronized.
  • the 1588 protocol is essentially an application layer protocol, which means that the clock synchronized by the clock synchronization technology based on the 1588 protocol is the application layer timing clock.
  • the timing clock of the application layer and the sending clock used by the physical layer for service flow transmission may be different clocks or different clocks. Therefore, when the timing clock of the application layer is different from the sending clock of the physical layer used for service flow transmission, the synchronization of the sending clock of the physical layer used for service flow transmission between network elements is not realized. That is, the clock synchronization technology based on the 1588 protocol is suitable for scenarios where the timing clock of the application layer is the same as the sending clock of the physical layer for service flow transmission.
  • the embodiments of the present application propose the clock synchronization method of the present application
  • Fig. 5 is a schematic diagram 1 of an application scenario provided by an embodiment of the application.
  • the first network element 41 and the second network element 42 in Figure 5 can be any two network elements that require clock synchronization in the communication network.
  • the first network element can be the master node, and the second network element can be the slave. node.
  • the transmission mode between the first network element 41 and the second network element 42 is point-to-point transmission.
  • FIG. 6 is a second schematic diagram of an application scenario provided by an embodiment of the application.
  • the first network element 41 and the second network element 42 in Figure 6 can be any two network elements that need clock synchronization in the communication network.
  • the first network element can be the master node, and the second network element can be the slave. node.
  • the transmission mode between the first network element 41 and the second network element 42 is end-to-end transmission.
  • the first network element 41 transmits to the target clock corresponding to the second network element as needed
  • the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges obtain the period information or frequency information of the target clock, and send the period information or frequency information of the target clock to the second network element 42.
  • the second network element 42 acquires a clock synchronized with the target clock according to the period information or frequency information of the target clock, that is, the clock synchronization of the first network element 41 and the second network element 42 is realized.
  • the state where the first timer and the second timer are in a time-aligned state means that the time increments of the first timer and the second timer are the same within the same time.
  • the time increments of the first timer and the second timer are the same within the same time, including the case where the time of the first timer and the time of the second timer are the same.
  • the clock synchronization in this application means that the first timer of the first network element and the second timer of the second network element have the same time increment in the same time. Therefore, the first network element transmits to the second network as needed.
  • the period information or frequency information of the target clock obtained at the time of occurrence of two adjacent rising edges or the time of occurrence of two adjacent falling edges corresponding to the target clock of the element can be used by the second network element to obtain Clock synchronized clock.
  • the period information or frequency information is not Multiple optical fibers are required for transmission, that is, multiple optical fibers are not required to carry multiple services as in the prior art to achieve the purpose of synchronizing multiple clocks according to the service flow.
  • the period information or frequency information does not require multiple wavelengths to transmit.
  • the first network element can transmit the period information or frequency information of the clock that needs to be synchronized to the second network element, that is, it is not limited to the first network element and the second network element. Whether the transmission between network elements is point-to-point or end-to-end.
  • FIG. 7 is an interaction diagram of a clock synchronization method provided by an embodiment of this application. Referring to FIG. 7, the method in this embodiment includes:
  • Step S101 The first network element controls the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, and the time-aligned state is the first timer and the second timer in the same time.
  • the time increment of the device is the same.
  • Step S102 The second network element controls the second timer of the second network element to be in a state of time alignment with the first timer of the first network element.
  • the first network element may be the first network element 41 in FIG. 5 or FIG. 6, and the second network element may be the second network element 42 in FIG. 5 or FIG. 6.
  • step S101 the first network element controls the first timer of the first network element to be in a time-aligned state with the second timer of the second network element
  • step S102 the second network element controls the second timer of the second network element
  • the timer and the first timer of the first network element are in a time-aligned state", which requires cooperation. Therefore, in this embodiment, step S101 and step S102 are described together.
  • the same time increment of the first timer and the second timer within the same time includes the following two situations:
  • the first situation the time of the first timer is the same as the time of the second timer.
  • the second situation the time of the first timer and the time of the second timer are different, but the time increments of the first timer and the second timer are the same in the same time.
  • the state in which the first timer of the first network element and the second timer of the second network element are time-aligned can be implemented in the following but not limited to the following ways:
  • a global positioning system Global Positioning System, GPS
  • the first timer in the first network element performs time with the GPS receiver installed in the first network element.
  • Alignment that is, the first network element aligns the first timer with the GPS receiver installed in the first network element, that is, the first network element controls the first timer to be installed in the first network element within the same time
  • the time increment of the GPS receiver is the same.
  • a GPS receiver is installed in the second network element, and the second timer in the second network element is time-aligned with the GPS receiver installed in the second network element, that is, the second network element performs the second timer and the first The time of the GPS receiver installed in the two network elements is aligned, that is, the second network element controls the second timer to have the same time increment as the GPS receiver installed in the second network element within the same time.
  • the first network element controls the first timer to have the same time increment as the GPS receiver installed in the first network element within the same time, so that the first network element controls the first timer and the second timer of the first network element.
  • the second timer of the network element is in a time-aligned state.
  • the second network element realizes the second network by controlling the second timer to have the same time increment as the GPS receiver installed in the second network element within the same time.
  • the element controls the second timer of the second network element to be in a time-aligned state with the first timer of the first network element, and finally realizes the second timer of the second network element and the first timer of the first network element
  • the device is in a time-aligned state.
  • the second network element controls the second timer of the second network element and the first network element
  • the first timer of the second network element is in a time-aligned state. Therefore, the time alignment of the second timer of the second network element with the first timer of the first network element in the first manner is not a process that is only performed once. It is a cyclical process.
  • the first timer of the first network element and the second timer of the second network element are time aligned based on the 1588 protocol shown in FIG. 3.
  • the first network element sends a synchronization (Sync) message to the second network element, and records the packet sending time t 1 .
  • t 1 can be sent to the second network element along with the synchronization message.
  • the second network element records the arrival time t 2 of the synchronization message.
  • the second network element sends a delay request message (Delay_req) message to the first network element, and records the packet sending time t 3 .
  • Delay_req a delay request message
  • the first network element recording arrival delay request message the time t 4, and t 4 in response to the discharge delay request message (Delay_Resp) back to the second network element.
  • the second network element obtains four times t 1 to t 4 .
  • the time deviation between the first network element and the second network element is offset, the network delay (the delay caused by network transmission) is delay, and the link delays at both ends of the network transmission are equal.
  • the second network element can obtain the time offset offset and transmission delay delay between the first network element and the second network element through t 1 , t 2 , t 3 , and t 4 :
  • the second network element corrects the timer of the second network element according to the time offset offset and the transmission delay delay between the first network element and the second network element, so as to realize the first timer and the second timer of the first network element.
  • the time of the second timer of the network element is aligned.
  • the first network element realizes the purpose of controlling the first timer of the first network element to be in a state of time alignment with the second timer of the second network element by executing a and d
  • the second network element executes b, c, d, e, f achieve the purpose of the second network element controlling the second timer of the second network element to be in a time-aligned state with the first timer of the first network element, and finally realize the second network element of the second network element
  • the timer and the first timer of the first network element are in a time-aligned state.
  • the second network element controls the second timer of the second network element and the first network element
  • the first timer is in a time-aligned state. Therefore, in the second way, the time alignment between the second timer of the second network element and the first timer of the first network element is not a process that is only performed once. It is a cyclical process.
  • the third way is to synchronize the clock of the first timing clock of the first network element with the second timing clock of the second network element based on the 1588 protocol shown in FIG. 3, where the first timing clock is for controlling the first timer A clock for timing, and the second timing clock is a clock that controls the timing of the second timer.
  • the time increments of the first timer and the second timer in the same time are the same, that is, The first timer and the second timer are in a state of time alignment.
  • the fourth method is to synchronize the clock of the first timing clock of the first network element with the second timing clock of the second network element based on the 1588 protocol shown in FIG. 3, and then use the first method or the second method to make The first timer and the second timer have the same time.
  • time synchronization is achieved between the first network element and the second network element.
  • Step S103 In the time-aligned state, the first network element obtains period information or frequency of the target clock according to the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges corresponding to the target clock information.
  • the target clock is any clock that needs to be transmitted from the first network element to the second network element.
  • the first network element is based on the occurrence time of two adjacent rising edges or the appearance of two adjacent falling edges corresponding to the clock. Time, to obtain the period information or frequency information of the clock.
  • a clock that needs to be transmitted from the first network element to the second network element is taken as an example to illustrate that the first network element obtains period information or frequency information of the clock that needs to be transmitted from the first network element to the second network element.
  • the clock that needs to be transmitted from the first network element to the second network element is called the target clock.
  • the target clock is not divided in frequency.
  • two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the target clock itself. That is, when the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge, the first rising edge and the second rising edge are the two adjacent rising edges of the target clock itself.
  • the target clock is frequency-divided.
  • the two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the clock after the target clock is frequency-divided. That is, when the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge, the first rising edge and the second rising edge are the two adjacent rising edges of the clock divided by the target clock.
  • the target clock is not divided in frequency.
  • the two adjacent falling edges corresponding to the target clock are the two adjacent falling edges of the target clock itself. That is, when the two adjacent falling edges corresponding to the target clock are the first falling edge and the second falling edge, the first falling edge and the second falling edge are the two adjacent falling edges of the target clock itself.
  • the target clock is frequency-divided.
  • the two adjacent falling edges corresponding to the target clock are the two adjacent falling edges of the clock after the target clock is frequency-divided. That is, when the two adjacent falling edges corresponding to the target clock are the first falling edge and the second falling edge, the first falling edge and the second falling edge are the two adjacent falling edges of the clock divided by the target clock.
  • the first network element acquires period information or frequency information of the target clock according to the time when two adjacent rising edges corresponding to the target clock appear" in this embodiment will be described.
  • the first network element obtains period information or frequency information of the target clock according to the time when two adjacent rising edges corresponding to the target clock occur, including the following but not limited to the following three methods:
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge; the appearance times of the two adjacent rising edges corresponding to the target clock include: the first rising edge The first time of occurrence and the second time of the second rising edge.
  • the first method the period information of the target clock includes: the first time when the first rising edge occurs and the second time when the second rising edge occurs.
  • the acquired period information of the target clock is the first time when the first rising edge occurs and the second time when the second rising edge occurs.
  • the remaining calculations are not performed, and the efficiency of acquiring the period information of the target clock is high.
  • the second method According to the occurrence time of two adjacent rising edges corresponding to the target clock, obtaining the period information of the target clock includes:
  • the period information of the target clock includes the clock period corresponding to the target clock.
  • the clock period corresponding to the target clock is the clock period of the target clock itself.
  • the clock period corresponding to the target clock is the period of the clock after the target clock is divided.
  • the period information of the target clock may also include: the frequency division coefficient of the target clock. For example, if the target clock with a frequency of 1000MHz is divided by 1000, the frequency of the clock after the target clock is divided is 1KHz, and the frequency division coefficient of the target clock is 1000.
  • the acquired period information of the target clock is the clock period corresponding to the target clock calculated according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, so that the second network element does not need to
  • the clock period corresponding to the target clock is calculated and acquired by itself according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, which improves the efficiency of the second network element in acquiring the clock synchronized with the target clock.
  • the signaling overhead when sending the information of the clock period corresponding to the target clock to the second network element is more than that of comparing the first time and the first time. The signaling overhead when these two information are sent to the second network element at the second time is less.
  • the third method Obtain the period information of the target clock according to the two adjacent rising edges corresponding to the target clock, including:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock.
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock itself.
  • the clock frequency corresponding to the target clock is the frequency of the clock after the target clock is divided.
  • the frequency information of the target clock may also include: the frequency division coefficient of the target clock.
  • the acquired period information of the target clock is the clock frequency corresponding to the target clock calculated according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, so that the second network element does not need to
  • the clock frequency corresponding to the target clock is calculated and obtained by itself according to the first time when the first rising edge occurs and the second time when the second rising edge occurs, which improves the efficiency of the second network element in acquiring the clock synchronized with the target clock.
  • the signaling overhead when sending the information of the clock frequency corresponding to the target clock to the second network element is more than that of combining the first time and the second network element. The signaling overhead when these two information are sent to the second network element at the second time is less.
  • the first network element obtains the period information or frequency information of the target clock according to the occurrence time of the two adjacent falling edges corresponding to the target clock
  • the first network element corresponds to the target clock Obtain the period information or frequency information of the target clock by the occurrence time of two adjacent rising edges”, which will not be repeated here.
  • Step S104 The first network element sends the period information or frequency information of the target clock to the second network element.
  • the first network element sends the period information or frequency information of the target clock obtained in step S104 to the second network element.
  • the first network element can send the period information of the target clock to the second network element, as described above:
  • the period information of the target clock can be any of the following: (1) the first time when the first rising edge occurs and the second rising edge (2) The clock cycle corresponding to the target clock, see the description in step S103 for details; (3) The first time when the first falling edge occurs and the second time when the second falling edge occurs, the first The falling edge and the second falling edge are two adjacent falling edges corresponding to the target clock; (4) the clock period and frequency division coefficient corresponding to the target clock.
  • the first network element can also send the frequency information of the target clock to the second network element, as described above:
  • the period information of the target clock can be any of the following: (1) The clock frequency corresponding to the target clock, see step for details Explanation in S103; (2) Clock frequency and frequency division coefficient corresponding to the target clock.
  • the first network element may send period information or frequency information of the target clock to the second network element through a message.
  • the first network element may send the period information or frequency information of the target clock to the second network element through an Ethernet message in a common format.
  • the first network element may send the period information or frequency information of the target clock to the second network element through a field segment used to transmit network overhead.
  • the first network element also sends the frequency information of the target clock itself to the second network element, so that the second network element sends the frequency information of the target clock itself to the downstream network element of the second network element.
  • the first network element may send the frequency information of the target clock itself to the second network element through a control information message or the like.
  • the frequency division coefficient of the target clock may also be carried in a control information message that transmits frequency information of the target clock itself and sent to the second network element.
  • Step S105 The second network element obtains a clock synchronized with the target clock according to the period information or frequency information of the target clock.
  • obtaining a clock synchronized with the target clock includes:
  • the period information of the target clock received by the second network element from the first network element is the period information of the target clock
  • the period information of the target clock is the clock period corresponding to the target clock
  • the clock period corresponding to the target clock is directly acquired.
  • the second network element receives the period information of the target clock from the first network element, and the period information of the target clock includes the first time when the first rising edge occurs and the second time when the second rising edge occurs, then The second network element first obtains the corresponding clock period or clock frequency of the target clock according to the period information of the target clock.
  • the second network element obtaining the corresponding clock period of the target clock according to the period information of the target clock includes: obtaining the absolute value of the difference between the first time and the second time to obtain the corresponding clock period of the target clock.
  • the second network element obtains the corresponding clock frequency of the target clock according to the period information of the target clock: obtains the absolute value of the difference between the first time and the second time, obtains the corresponding clock period of the target clock; obtains the corresponding clock of the target clock The reciprocal of the period, the corresponding clock frequency of the target clock is obtained.
  • the clock frequency corresponding to the target clock is directly acquired.
  • the phase-locked loop circuit can be used to obtain a clock that is synchronized with the target clock: the phase-locked loop circuit will output a clock according to the clock period or clock frequency corresponding to the target clock.
  • the frequency of the clock is the same as that of the target clock, namely
  • the second network element obtains a clock synchronized with the target clock.
  • phase-locked loop circuit can be referred to the prior art, which will not be repeated in this embodiment.
  • the second network element may obtain clocks synchronized with the clock of the first network element through multiple phase-locked loop circuits.
  • the clock synchronization in this embodiment is performed on the premise that the first timer of the first network element and the second timer of the second network element have the same time increment in the same time. Therefore, the first network element is based on The period information or frequency information of the target clock acquired at the time when the two adjacent rising edges or the time when the two adjacent falling edges appear corresponding to the target clock that needs to be transmitted to the second network element occur can be directly used for the second network element.
  • the network element is used to obtain a clock synchronized with the clock, that is, when the clock is synchronized, the first network element only needs to be based on the time when two adjacent rising edges or two adjacent falling edges corresponding to the target clock occur.
  • the period information or frequency information of the target clock is acquired, and the period information or frequency information of the target clock is sent to the second network element, so that the second network element performs clock synchronization according to the period information or frequency information of the target clock That is, the method is simple and easy to implement.
  • the period information or frequency Information does not need to be transmitted by multiple optical fibers, that is, there is no need to set multiple optical fibers to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and the period information or frequency information does not require multiple Wavelength transmission means that there is no need to set multiple wavelengths to carry multiple services to achieve the purpose of synchronizing multiple clocks according to the service flow as in the prior art, and there is no need to set up OTN equipment. That is, the clock synchronization method in this solution also occupies fewer physical resources.
  • the static deviation can be When calculating the period corresponding to the target clock, the two times are subtracted and cancelled out.
  • the dynamic jitter that exists when the first timer of the first network element and the second timer of the second network element are time aligned, the accuracy of the time stamping of the first network element and the low pass of the second network element can be improved.
  • the filtering and jitter elimination ensures the accuracy of clock synchronization between the first network element and the second network element in this embodiment.
  • the clock synchronization process between the first network element and the second network element is not affected by the network type of communication between the first network element and the second network element, as long as the period information of the target clock or The frequency information can be transmitted to the second network element, that is, it is not limited to the point-to-point transmission or the end-to-end transmission between the first network element and the second network element.
  • FIG. 8 is a schematic block diagram 1 of a clock synchronization apparatus according to an embodiment of the application.
  • the clock synchronization apparatus 800 in this embodiment includes:
  • the control module 801 is configured to control the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, and the time-aligned state is that the first timer and the second timer in the same time The time increments of the second timer are the same;
  • the obtaining module 802 is further configured to obtain the period of the target clock according to the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges corresponding to the target clock in the time-aligned state Information or frequency information, the period information or frequency information of the target clock is used by the second network element to obtain a clock synchronized with the target clock, and the target clock is required to be transmitted from the first network element to the Any clock of the second network element;
  • the sending module 803 is configured to send period information or frequency information of the target clock to the second network element.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the period information of the target clock includes: a first time when the first rising edge occurs and a second time when the second rising edge occurs.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the acquiring module 802 is specifically configured to acquire the absolute value of the difference between the first time when the first rising edge occurs and the second time when the second rising edge occurs, to obtain the clock period corresponding to the target clock;
  • the period information of the target clock includes a clock period corresponding to the target clock.
  • two adjacent rising edges corresponding to the target clock are a first rising edge and a second rising edge
  • the obtaining module 802 is specifically used for:
  • the frequency information of the target clock includes the clock frequency corresponding to the target clock.
  • the sending module 803 is specifically configured to:
  • the period information or frequency information of the target clock is sent to the second network element through a message or a field segment used to transmit network overhead.
  • the two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • the device in this embodiment can be used to implement the technical solution corresponding to the first network element in the embodiment shown in FIG. 7, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 9 is a second schematic block diagram of a clock synchronization device provided by an embodiment of the application.
  • the clock synchronization device 900 in this embodiment includes:
  • the control module 901 is configured to control the second timer of the second network element and the first timer of the first network element to be in a time-aligned state, and the time-aligned state is that the first timer and the first timer are in the same time The time increments of the second timer are the same;
  • the receiving module 902 is configured to receive period information or frequency information of a target clock from the first network element, where the period information or frequency information of the target clock is the first network element according to the target clock in the time-aligned state The time of occurrence of two adjacent rising edges or the time of occurrence of two adjacent falling edges corresponding to the clock is obtained, and the target clock is the one that needs to be transmitted from the first network element to the second network element Any clock
  • the obtaining module 903 is configured to obtain a clock synchronized with the target clock according to period information or frequency information of the target clock.
  • the period information of the target clock includes the first time and the second time.
  • the period information of the target clock includes a clock period corresponding to the target clock, and the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time.
  • the frequency information of the target clock includes a clock frequency corresponding to the target clock
  • the clock frequency corresponding to the target clock is the reciprocal of the clock period corresponding to the target clock
  • the target clock The corresponding clock period is the absolute value of the difference between the first time and the second time.
  • the acquiring module 903 is specifically configured to:
  • a clock synchronized with the target clock is obtained.
  • the two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • the device in this embodiment can be used to implement the technical solution corresponding to the second network element in the embodiment shown in FIG. 7, and its implementation principles and technical effects are similar, and will not be repeated here.
  • FIG. 10 is a schematic block diagram 1 of a communication device provided by an embodiment of the application.
  • the communication device of this embodiment includes a processor 1001 and a memory 1002.
  • the memory 1002 stores instructions, and the processor 1001 calls The instructions control the execution of the following operations:
  • Control the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, and the time-aligned state is that the first timer and the second timer are within the same time
  • the time increment is the same;
  • the period information or frequency information of the target clock is acquired according to the appearance time of two adjacent rising edges or the appearance time of two adjacent falling edges corresponding to the target clock,
  • the period information or frequency information of the target clock is used by the second network element to obtain a clock synchronized with the target clock, and the target clock is any one that needs to be transmitted from the first network element to the second network element clock;
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge;
  • the period information of the target clock includes: the occurrence of the first rising edge The first time and the second time when the second rising edge occurs.
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge; the processor 1001 is used for controlling the execution of adjacent adjacent rising edges corresponding to the target clock.
  • the period information of the target clock is obtained, it is specifically used to control the execution of the following operations: obtaining the first time when the first rising edge occurs and the second rising edge The absolute value of the difference of the second time obtains the clock period corresponding to the target clock; correspondingly, the period information of the target clock includes the clock period corresponding to the target clock.
  • the processor 1001 is specifically configured to control the processor 1001 to perform the following operations when controlling and executing the operation of obtaining period information of the target clock according to the time when two adjacent rising edges corresponding to the target clock occur: Obtain the absolute value of the difference between the first time when the first rising edge occurs and the second time when the second rising edge occurs to obtain the clock period corresponding to the target clock.
  • the two adjacent rising edges corresponding to the target clock are the first rising edge and the second rising edge; the processor 1001 is controlling and executing the two adjacent rising edges corresponding to the target clock.
  • the operation of obtaining the frequency information of the target clock it is specifically used to control the execution of the following operations: obtaining the first time when the first rising edge occurs and the second when the second rising edge occurs.
  • the absolute value of the time difference obtains the clock period corresponding to the target clock; according to the reciprocal of the clock period corresponding to the target clock, the clock frequency corresponding to the target clock is obtained; accordingly, the frequency information of the target clock Including the clock frequency corresponding to the target clock.
  • the processor 1001 is specifically configured to control the processor 1001 to perform the following operations when controlling and executing the operation of acquiring the frequency information of the target clock according to the time when two adjacent rising edges corresponding to the target clock occur: Obtain the absolute value of the difference between the first time when the first rising edge occurs and the second time when the second rising edge occurs to obtain the clock period corresponding to the target clock; according to the clock period corresponding to the target clock The reciprocal of to obtain the clock frequency corresponding to the target clock.
  • the two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • the communication device of this embodiment may correspond to the first network element in the embodiment shown in FIG. 7, and is used to implement the technical solution corresponding to the first network element in the embodiment shown in FIG. 7. Its implementation principles and technical effects are similar , Not repeat them here.
  • FIG. 11 is a second schematic block diagram of a communication device provided by an embodiment of the application.
  • the communication device of this embodiment further includes a transceiver 1003 on the basis of the communication device shown in FIG. 10.
  • the processor 1001 when the processor 1001 is configured to control and execute an operation of controlling the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, specifically use The control processor 1001 and the transceiver 1003 perform an operation of controlling the first timer of the first network element and the second timer of the second network element to be in a time-aligned state.
  • the processor 1001 when the processor 1001 is configured to control and execute an operation of controlling the first timer of the first network element and the second timer of the second network element to be in a time-aligned state, specifically The processor 1001 is used to control the operation of controlling the first timer of the first network element and the second timer of the second network element to be in a time-aligned state.
  • the processor 1001 is specifically configured to control the transceiver 1003 to execute the operation of sending cycle information or frequency information of the target clock to the second network element when the processor 1001 is used to control An operation of sending period information or frequency information of the target clock to the second network element.
  • the processor 1001 when the processor 1001 is used to control the operation of sending the period information or frequency information of the target clock to the second network element, it is specifically used to control to perform the following operations:
  • the message or the field segment used to transmit network overhead sends the period information or frequency information of the target clock to the second network element.
  • the processor 1001 is specifically configured to control the transceiver 1003 to perform the following operations: send cycle information or frequency information of the target clock to the second network element through a message or a field segment used to transmit network overhead .
  • the communication device of this embodiment may correspond to the first network element in the embodiment shown in FIG. 7, and is used to implement the technical solution corresponding to the first network element in the embodiment shown in FIG. 7. Its implementation principles and technical effects are similar , I won’t repeat it here.
  • Figure 12 is a schematic block diagram of a communication device provided by an embodiment of the application.
  • the communication device of this embodiment includes a processor 1201 and a memory 1202.
  • the memory 1202 stores instructions, and the processor 1201 calls The instructions control the execution of the following operations:
  • the second timer that controls the second network element and the first timer of the first network element are in a time-aligned state, and the time-aligned state is that the first timer and the second timer are within the same time
  • the time increment is the same;
  • the target clock is any clock that needs to be transmitted from the first network element to the second network element;
  • a clock synchronized with the target clock is obtained.
  • the period information of the target clock includes the first time and the second time.
  • the period information of the target clock includes a clock period corresponding to the target clock, and the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time.
  • the frequency information of the target clock includes the target clock corresponding
  • the clock frequency corresponding to the target clock is the reciprocal of the clock period corresponding to the target clock
  • the clock period corresponding to the target clock is the absolute value of the difference between the first time and the second time .
  • the two adjacent rising edges corresponding to the target clock are two adjacent rising edges of the clock divided by the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the clock divided by the target clock;
  • the period information or frequency information of the target clock also includes the frequency division coefficient of the target clock, the clock period corresponding to the target clock is the period of the clock divided by the target clock, and the clock frequency corresponding to the target clock is The frequency of the clock divided by the target clock.
  • the two adjacent rising edges corresponding to the target clock are the two adjacent rising edges of the target clock; or,
  • Two adjacent falling edges corresponding to the target clock are two adjacent falling edges of the target clock
  • the clock period corresponding to the target clock is the clock period of the target clock
  • the clock frequency corresponding to the target clock is the clock frequency of the target clock
  • the communication device of this embodiment may correspond to the second network element in the embodiment shown in FIG. 7, and is used to implement the technical solution corresponding to the second network element in the embodiment shown in FIG. 7. Its implementation principles and technical effects are similar , Not repeat them here.
  • FIG. 13 is a schematic block diagram four of a communication device provided by an embodiment of this application.
  • the communication device of this embodiment on the basis of the communication device shown in FIG. 12, further includes: a transceiver 1203 and a phase-locked loop circuit 1204;
  • the processor 1201 is specifically configured to control the transceiver 1204 to perform the period of receiving the target clock from the first network element when the processor 1201 is used to control the execution of the period information or frequency information of the target clock received from the first network element. Operation of information or frequency information.
  • the processor 1201 When the processor 1201 is used to control and execute the operation of obtaining a clock synchronized with the target clock according to the period information or frequency information of the target clock, it is specifically used to control to perform the following operations: according to the period of the target clock Information or frequency information, obtain a clock period or clock frequency corresponding to the target clock; obtain a clock synchronized with the target clock according to the clock period or clock frequency corresponding to the target clock.
  • the processor 1201 is specifically configured to control the processor 1201 to perform the following operations: obtain the clock period or clock frequency corresponding to the target clock according to the period information or frequency information of the target clock, and specifically to control the lock
  • the phase loop circuit 1204 performs the following operations: obtain a clock synchronized with the target clock according to the clock period or clock frequency corresponding to the target clock.
  • the communication device of this embodiment may correspond to the second network element in the embodiment shown in FIG. 7, and is used to implement the technical solution corresponding to the second network element in the embodiment shown in FIG. 7. Its implementation principles and technical effects are similar , Not repeat them here.
  • An embodiment of the present application also provides a computer-readable storage medium, including a program or instruction, and when the program or instruction runs on a computer, the method corresponding to the second network element in the foregoing method embodiment is executed.
  • An embodiment of the present application also provides a computer-readable storage medium, including a program or instruction.
  • the program or instruction runs on a computer, the method corresponding to the second network element in the foregoing method embodiment is now executed.
  • processors mentioned in the embodiments of this application may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), and application-specific integrated circuits ( Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDR SDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • Synchronous Link Dynamic Random Access Memory Synchronous Link Dynamic Random Access Memory
  • DR RAM Direct Rambus RAM
  • the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component
  • the memory storage module
  • the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, rather than corresponding to the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

一种时钟同步的方法和装置,该方法包括:控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,该时间对齐的状态为在相同时间内该第一计时器和该第二计时器的时间增量相同(S101);在该时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取该目标时钟的周期信息或频率信息,该目标时钟的周期信息或频率信息用于该第二网元获取与该目标时钟同步的时钟,该目标时钟为需要从该第一网元传输至该第二网元的任一时钟(S103);将该目标时钟的周期信息或频率信息发送至该第二网元(S104)。上述时钟同步网元间的时钟同步占用的物理资源少,简单易实现。

Description

时钟同步的方法和装置 技术领域
本申请涉及通信技术领域,尤其涉及一种时钟同步的方法和装置。
背景技术
在移动通信技术中,一些网络中具有数据传输的网元间至少需要达成用于业务发送的发送时钟同步。
目前常用的时钟同步方法包括:基于串行器(Serdes)技术进行时钟同步,基于以太网同步技术以及电气和电子工程师协会(institute of electrical and electronics engineers,简称IEEE)1588协议进行时钟同步。其中,基于Serdes技术进行时钟同步的方法,在需要同步多个发送时钟时,需要采用多根光纤或者多个波长或者增加一层光传送网(optical transmission net,简称OTN)设备,即需占用较多的物理资源。基于1588协议进行时钟同步的方法,从节点同步后得到的时钟本质上为应用层的计时时钟,当计时时钟和物理层的发送时钟不相同时,实际上没有实现主节点和从节点的发送时钟的同步。
发明内容
本申请实施例提供一种时钟同步的方法和装置,网元间的时钟同步无需占用较多的物理资源,简单易实现。
第一方面提供一种时钟同步的方法,所述时钟同步的方法包括:控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案中的时钟同步是在第一网元的第一计时器和第二网元的第二计时器在相同时间内的时间增量相同的前提下进行的,因此,第一网元根据需要传输至第二网元的目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息可以直接被第二网元用来获取与该时钟同步的时钟,即在时钟同步时,第一网元只需根据目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息,并将该目标时钟的周期信息或频率信息发送至第二网元,以使第二网元根据该目标时钟的周期信息或频率信息进行时钟同步即可,方法简单易实现。
同时,在第一网元需要传输至第二网元的时钟具有多个时,由于第一网元传输至第二网元的是需要同步的时钟的周期信息或频率信息,该周期信息或频率信息不需要多根光纤传输,即不需要向现有技术中那样通过设置多根光纤来承载多个业务以达到根据业务流同步多个时钟的目的,该周期信息或频率信息也不需要多个波长来传输,即不需要向现有技术中那样通过设置多个波长来承载多个业务以达到根据业务流同步多个时钟的目的,同时也不需要设置OTN设备。即本方案中的时钟同步方法占用的物理资源也较少。
结合第一方面,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,可通过但不限于如下三种实施方式实现:
在第一种实施方式中:所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
该实施方式中,获取的目标时钟的周期信息为第一上升沿出现的第一时间和所述第二上升沿出现的第二时间,没有进行其余的计算,获取目标时钟的周期信息的效率高。
在第二种实施方式中:所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息,包括:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
该实施方式中,获取的目标时钟的周期信息为根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算得到的目标时钟对应的时钟周期,使得第二网元无需自行根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算获取目标时钟对应的时钟周期,提高了第二网元获取与目标时钟同步的时钟的效率。同时,由于在目标时钟的周期信息为目标时钟对应的时钟周期时,将目标时钟对应的时钟周期这一个信息发送至第二网元时的信令开销比将所述第一时间和所述第二时间这两个信息发送至第二网元时的信令开销要少。
在第三种实施方式中:所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述根据目标时钟对应的相邻的两个上升沿,获取所述目标时钟的周期信息,包括:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
该实施方式中,获取的目标时钟的周期信息为根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算得到的目标时钟对应的时钟频率,使得第二网元无需自行根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算获取目标时钟对应的时钟频率,提高了第二网元获取与目标时钟同步的时钟的效率。同时, 由于在目标时钟的周期信息为目标时钟对应的时钟频率时,将目标时钟对应的时钟频率这一个信息发送至第二网元时的信令开销比将所述第一时间和所述第二时间这两个信息发送至第二网元时的信令开销要少。
结合第一方面,在第一方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
此外,第一方面中的所述目标时钟对应的相邻的两个上升沿还可为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿还可为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案中在目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿时,在目标时钟的周期信息或频率信息中包括了所述目标时钟的分频系数,使得第二网元可以精确的获取与目标时钟同步的时钟。
结合第一方面,在第一方面的一种可能的实现方式中,所述将所述目标时钟的周期信息或频率信息发送至所述第二网元,包括:
通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案提供了将所述目标时钟的周期信息或频率信息发送至所述第二网元的具体实现方法。
第二方面提供一种时钟同步的方法,所述时钟同步的方法,包括:
控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
本方案中的时钟同步是在第一网元的第一计时器和第二网元的第二计时器在相同时间内的时间增量相同的前提下进行的,因此,第二网元可以根据第一网元发送的根据目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息来获取与该时钟同步的时钟。且在第一网元需要传输至第二网元的时钟具有多个时,由于第一网元传输至第二网元的是需要同步的时钟的周期信息或频率信息,该周期信息或频率信息不需要多根光纤传输,即不需要向现有技术中那样通过设置多根光纤来承载多个业务以达到根据业务流同步多个时钟的目的,该周期信息或频 率信息也不需要多个波长来传输,即不需要向现有技术中那样通过设置多个波长来承载多个业务以达到根据业务流同步多个时钟的目的,同时也不需要设置OTN设备。即本方案中的时钟同步方法简单易实现。
结合第二方面,在从所述第一网元接收目标时钟的周期信息的情况下,所述目标时钟的周期信息包括如下但不限于如下两种形式:
第一种形式:当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间。
该种方式可以节省第一网元在获取所述目标时钟的周期信息时的能耗。
第二种形式:所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
该种方式的有益效果,参见第一方面中的第二种实施方式的有益效果。
结合第二方面,在从所述第一网元接收目标时钟的频率信息的情况下,所述目标时钟的频率信息可为如下的形式:
当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
该种方式的有益效果,参见第一方面中的第三种实施方式的有益效果。
结合第二方面,在第二方面的一种可能的实现方式中,所述根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟,包括:
根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
本方案提供了第二网元根据目标时钟的周期信息或频率信息,获取与目标时钟同步的时钟的具体实现方法。
结合第二方面,在第二方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
此外,第一方面中的所述目标时钟对应的相邻的两个上升沿还可为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿还可为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案的有益效果参见第一方面对应实现方式的有益效果。
第三方面提供一种时钟同步的装置,所述时钟同步的装置包括:
控制模块,用于控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
获取模块,还用于在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
发送模块,用于将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案的有益效果参见第一方面的有益效果。
结合第三方面,在第三方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
本方案的有益效果参见第一方面的对应实现方式的有益效果。
结合第三方面,在第三方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述获取模块具体用于:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第三方面,在第三方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述获取模块具体用于:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第三方面,在第三方面的一种可能的实现方式中,所述发送模块具体用于:
通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第三方面,在第三方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟 频率为所述目标时钟分频后的时钟的频率。
此外,所述目标时钟对应的相邻的两个上升沿还可为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿还可为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案的有益效果参见第一方面对应实现方式的有益效果。
第四方面提供一种时钟同步的装置,所述时钟同步的装置包括:
控制模块,用于控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
接收模块,用于从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
获取模块,用于根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
本方案的有益效果参见第二方面的有益效果。
结合第四方面,在第四方面的一种可能的实现方式中,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第四方面,在第四方面的一种可能的实现方式中,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第四方面,在第四方面的一种可能的实现方式中,所述获取模块具体用于:
根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第四方面,在第四方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
此外,所述目标时钟对应的相邻的两个上升沿还可为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿还可为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案的有益效果参见第二方面对应实现方式的有益效果。
第五方面提供一种通信设备,所述通信设备包括处理器和存储器,所述存储器中存储有指令,所述处理器调用所述指令,控制执行如下操作:
控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案的有益效果参见第一方面的有益效果。
结合第五方面,在第五方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第五方面,在第五方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述处理器在用于控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息的操作时,具体用于控制执行如下操作:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第五方面,在第五方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述处理器在用于控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的频率信息的操作时,具体用于控制执行如下操作:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第五方面,在第五方面的一种可能的实现方式中,所述处理器在用于控制将所述目标时钟的周期信息或频率信息发送至所述第二网元的操作时,具体用于控制执行如下操作:通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本方案的有益效果参见第一方面对应实现方式的有益效果。
结合第五方面,在第五方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
此外,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案的有益效果参见第一方面对应实现方式的有益效果。
第六方面提供一种通信设备,所述通信设备包括处理器和存储器,所述存储器中存储有指令,所述处理器调用所述指令,控制执行如下操作:
控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
本方案的有益效果参见第二方面有益效果。
结合第六方面,在第六方面的一种可能的实现方式中,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第六方面,在第六方面的一种可能的实现方式中,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对 应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第六方面,在第六方面的一种可能的实现方式中,所述处理器在用于控制执行根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟的操作时,具体用于控制执行如下操作:
根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
本方案的有益效果参见第二方面对应实现方式的有益效果。
结合第六方面,在第六方面的一种可能的实现方式中,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
此外,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本方案的有益效果参见第二方面对应实现方式的有益效果。
第七方面提供一种计算机可读存储介质,包括程序或指令,当所述程序或指令在计算机上运行时,第一方面或第一方面的任一可能的实现方式中的方法被执行。
第八方面提供一种计算机可读存储介质,包括程序或指令,当所述程序或指令在计算机上运行时,第二方面或第二方面的任一可能的实现方式中的方法被执行。
本申请中的时钟同步是在第一网元的第一计时器和第二网元的第二计时器在相同时间内的时间增量相同的前提下进行的,因此,第一网元根据需要传输至第二网元的目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息可以直接被第二网元用来获取与该时钟同步的时钟,即在时钟同步时,第一网元只需根据目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息,并将该目标时钟的周期信息或频率信息发送至第二网元,以使第二网元根据该目标时钟的周期信息或频率信息进行时钟同步即可,方法简单易实现。
同时,在第一网元需要传输至第二网元的时钟具有多个时,由于第一网元传输至第二网元的是需要同步的时钟的周期信息或频率信息,该周期信息或频率信息不需要多根光纤传输,即不需要向现有技术中那样通过设置多根光纤来承载多个业务以达到根据业务流同 步多个时钟的目的,该周期信息或频率信息也不需要多个波长来传输,即不需要向现有技术中那样通过设置多个波长来承载多个业务以达到根据业务流同步多个时钟的目的,同时也不需要设置OTN设备。即本方案中的时钟同步方法占用的物理资源也较少。
附图说明
图1为本申请实施例提供的时钟同步的通信网络模型的示意图;
图2为本申请实施例提供的时钟同步的原理示意图一;
图3为本申请实施例提供的时钟同步的原理示意图二;
图4本申请实施例提供的网元间的传输方式的示意图;
图5为本申请实施例提供的应用场景示意图一;
图6为本申请实施例提供的应用场景示意图一;
图7为本申请实施例提供的时钟同步的方法的交互图;
图8为本申请实施例提供的时钟同步的装置的示意性框图一;
图9为本申请实施例提供的时钟同步的装置的示意性框图二;
图10为本申请实施例提供的通信设备的示意性框图一;
图11为本申请实施例提供的通信设备的示意性框图二;
图12为本申请实施例提供的通信设备的示意性框图三;
图13为本申请实施例提供的通信设备的示意性框图四。
具体实施方式
首先对本申请涉及的技术名词进行说明。
时钟同步:信号之间的频率或者相位上保持某种严格的特定关系,信号在其相对应的有效瞬间以同一速率出现,维持通信网络中的设备以相同的速率运行,即信号之间保持恒定相位差。
时间同步:即相位同步,若信号之间的频率和相位都保持一致,即信号之间相位差恒为零。
时钟的上升沿:数字电路中,数字电平从低电平(数字"0")变为高电平(数字"1")的那一瞬间(时刻)叫作上升沿。
时钟的下降沿:数字电路中,数字电平从高电平(数字"1")变为低电平(数字"0")的那一瞬间叫作下降沿。
图1为本申请实施例提供的时钟同步的通信网络模型的示意图,如图1所示:
(1)上游网元A使用本地时钟作为业务流的发送时钟,比如网元A的业务流的发送时钟的频率为1GHz,则网元A每1ns发送一个比特。其中,业务流的发送时钟也可称为业务时钟。
(2)网元B根据从网元A接收到的业务流恢复网元A发送业务流的发送时钟,作为网元B的本地时钟,也用作网元B的信号的发送时钟。
(3)网元C根据从网元B接收到的业务流恢复网元B发送业务流的发送时钟,作为网元C的本地时钟。
下游网元完成与上游网元的时钟同步,通过逐级同步,最终整个网络达成全网时钟同步。
同步数字体系(synchronous digital hierarchy,SDH)网络、光传送网(optical transmission net,OTN)网络、支持同步以太的电信以太网络,都为基于图1所示的通信网络模型的典型应用。
为了更好的说明本申请实施例的技术方案,首先对现有技术中涉及的几种时钟同步技术进行说明。
第一种技术:基于串行器(Serdes)技术进行时钟同步。
图2为本申请实施例提供的时钟同步的原理示意图一;参见图2,基于Serdes技术进行时钟同步,是最常用的时钟同步技术。网元中的光模块将光纤中传输的业务流的光信号转换为电信号的比特流后,由Serdes将串行比特流恢复为并行数据,同时恢复出该网元的上游网元的该业务流的发送时钟。但是,一路Serdes只能恢复1路时钟,即在波长单一的情况下,一根光纤只能恢复上游网元的一个发送时钟。
若通信网络(比如第五代((5th generation,5G)通信系统)中承载了移动通信网、物联网、自动驾驶多种业务,整个通信网络内需要完成用于多个业务发送到的多个发送时钟(也称为多域时钟)的同步,则需要增加光纤的数量来承载多个业务(占用较多的光纤),以根据各业务流完成各业务时钟的同步,或者,采用波分复用技术,使用多个波长来承载多个业务(占用了较多的波长资源),以根据各业务流完成各发送时钟的同步,或者,增加一层OTN传输设备来处理多个业务(增加了使用的物理设备)以根据各业务流完成各发送时钟的同步。
第二种技术:基于1588协议的时钟同步技术,即基于分组时间同步协议的时钟同步技术。
图3为本申请实施例提供的时钟同步的原理示意图二;参见图3,
a、主节点向从节点发同步(Sync)报文,并记录发包时间t 1。t 1可以随同步报文送给从时钟。
b.从节点记录同步报文的到达时间t 2
c.从节点向主节点发延迟请求(Delay_req)报文,并记录发包时间t 3
d.主节点记录延迟请求报文的到达时间t 4,并将t 4放延迟请求响应报文(Delay_resp)回送给从节点。
由于主节点是周期性发送同步报文的,在时钟同步过程中,获取相邻两个周期发送同步报文的时间t 1的差值Δt 1、相邻两个周期同步报文的到达时间t 2的差值Δt 2,根据Δt 1和Δt 2进行时钟同步。如果Δt 1>Δt 2,表示从节点的计时时钟慢了,需要调快;反之,需要调慢。具体可通过如下公式,逐步调整从节点计时时钟的频率f slave,直至从调整后节点计时时钟的频率使得测量得到的Δt 1和Δt 2相等,即如下公式中的Δt 1-Δt 2等于0,这样如下公式中的左边f master-f slave也等于0,主节点和从节点的时钟同步。
Figure PCTCN2019075194-appb-000001
需要说明的是,1588协议本质上是应用层协议,也就是说基于1588协议的时钟同步 技术同步的时钟为应用层的计时时钟。而应用层的计时时钟与物理层用于业务流发送的发送时钟(即图1中的本地时钟),可以是不同的时钟,也可以是不同的时钟。因此,当应用层的计时时钟与物理层的用于业务流发送的发送时钟不相同时,并没有实现网元间的物理层的用于业务流发送的发送时钟的同步。即基于1588协议的时钟同步技术适用于应用层的计时时钟与物理层的用于业务流发送的发送时钟相同的场景。且该技术适用于图1中的点到点的信号传输方式(P2P),不适用于如图4中所示的主节点和从节点之间需要穿越第三方网络,主节点和从节点之间的传输方式为端到端的信号传输方式(E2E)时的主节点和从节点之间的时钟同步,这是因为:若主节点与从节点之间的数据传输需要穿越第三方网络,则1588协议中涉及的报文的传输时延会出现抖动,即不同时刻发送的报文的传输时延可能不相同,因此,接收报文的一端在报文到达时所打的时戳就会收到影响。
本申请实施例基于上述技术问题,提出了本申请的时钟同步方法
图5为本申请实施例提供的应用场景示意图一。参见图5,图5中的第一网元41和第二网元42可为通信网络中任意两个需要时钟同步的网元,第一网元可为主节点,第二网元可为从节点。第一网元41和第二网元42之间的传输方式为点对点传输。
图6为本申请实施例提供的应用场景示意图二。参见图6,图6中的第一网元41和第二网元42可为通信网络中任意两个需要时钟同步的网元,第一网元可为主节点,第二网元可为从节点。第一网元41和第二网元42之间的传输方式是为端到端传输。
具体地,在第一网元41的第一计时器和第二网元42的第二计时器处于时间对齐的状态下,第一网元41根据需要传输至第二网元的目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间,获取该目标时钟的周期信息或频率信息,并将该目标时钟的周期信息或频率信息发送至第二网元42,第二网元42根据该目标时钟的周期信息或频率信息获取与该目标时钟同步的时钟,即实现了第一网元41和第二网元42的时钟同步。
其中,第一计时器和第二计时器处于时间对齐的状态为在相同时间内第一计时器和第二计时器的时间增量相同。其中,在相同时间内第一计时器和第二计时器的时间增量相同包括第一计时器的时间和第二计时器的时间相同的情形。
本申请中的时钟同步是在第一网元的第一计时器和第二网元的第二计时器在相同时间内的时间增量相同,因此,第一网元根据需要传输至第二网元的目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿的出现时间获取到的该目标时钟的周期信息或频率信息可以被第二网元用来获取与该时钟同步的时钟。在第一网元需要传输至第二网元的时钟具有多个时,由于第一网元传输至第二网元的是需要同步的时钟的周期信息或频率信息,该周期信息或频率信息不需要多根光纤传输,即不需要像现有技术中那样通过设置多根光纤来承载多个业务以达到根据业务流同步多个时钟的目的,该周期信息或频率信息也不需要多个波长来传输,即不需要像现有技术中那样通过设置多个波长来承载多个业务以达到根据业务流同步多个时钟的目的,同时也不需要设置OTN设备;此外,无论第一网元和第二网元之间是点对点传输还是端到端传输,第一网元均能将需要同步的时钟的周期信息或频率信息传输至第二网元,即不受限于第一网元和第二网元之间是点对点传输还是端到端传输。
下面基于上述应用场景,采用具体的实施例对本申请实施例的时钟同步的方法进行说明。
图7为本申请实施例提供的时钟同步的方法的交互图,参见图7,本实施例的方法包括:
步骤S101、第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,时间对齐的状态为在相同时间内第一计时器和第二计时器的时间增量相同。
步骤S102、第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态。
具体地,第一网元可为图5或图6中的第一网元41,第二网元可为图5或图6中的第二网元42。
由于步骤S101“第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态”,步骤S102“第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态”是需要配合进行的,因此,本实施例中将步骤S101和步骤S102一起进行说明。
具体地,在相同时间内第一计时器和第二计时器的时间增量相同包括如下两种情形:
第一种情形:第一计时器的时间和第二计时器的时间相同。
第二种情形:第一计时器的时间和第二计时器的时间不相同,但是在相同时间内第一计时器和第二计时器的时间增量相同。
第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态可通过如下但不限于如下几种方式实现:
第一种方式,第一网元内安装有全球定位系统(Global Positioning System,简称GPS)接收器,第一网元内的第一计时器与该第一网元内安装的GPS接收器进行时间对齐,即第一网元进行第一计时器与该第一网元内安装的GPS接收器的时间对齐,即第一网元控制第一计时器在相同时间内与该第一网元内安装的GPS接收器的时间增量相同。
第二网元内安装有GPS接收器,第二网元内的第二计时器与该第二网元内安装的GPS接收器进行时间对齐,即第二网元进行第二计时器与该第二网元内安装的GPS接收器的时间对齐,即第二网元控制第二计时器在相同时间内与该第二网元内安装的GPS接收器的时间增量相同。
即第一网元通过控制第一计时器在相同时间内与该第一网元内安装的GPS接收器的时间增量相同实现第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的目的,第二网元通过控制第二计时器在相同时间内与该第二网元内安装的GPS接收器的时间增量相同实现第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态的目的,最终实现了第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态。
由于第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,因此,第一种方式中的第二网元的第二计时器与第一网元的第一计时器进行时间对齐并不是一个只进行一次的过程,而是周期性的进行的过程。
第二种方式,基于图3中所示的1588协议第一网元的第一计时器和第二网元的第二 计时器进行时间对齐。
同样参见图3:
a、第一网元向第二网元发同步(Sync)报文,并记录发包时间t 1。t 1可以随同步报文送给第二网元。
b.第二网元记录同步报文的到达时间t 2
c.第二网元向第一网元发延迟请求报文(Delay_req)报文,并记录发包时间t 3
d.第一网元记录延迟请求报文的到达时间t 4,并将t 4放延迟请求响应报文(Delay_resp)回送给第二网元。
通过a~d,第二网元获取到t 1~t 4四个时间。记第一网元和第二网元之间的时间偏差为offset,网络延时(网络传输带来的延时)为delay,网络中传输的两端的链路延时相等。
e、第二网元可以通过t 1,t 2,t 3,t 4,得到第一网元和第二网元之间的时间偏差offset和传输延时delay:
t 2-t 1=offset+delay
t 4-t 3=delay–offset
Figure PCTCN2019075194-appb-000002
Figure PCTCN2019075194-appb-000003
f、第二网元根据第一网元和第二网元之间的时间偏差offset和传输延时delay修正第二网元的计时器,以实现第一网元的第一计时器和第二网元的第二计时器的时间对齐。
第一网元通过执行a、d实现第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的目的,第二网元通过执行b、c、d、e、f实现第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态的目的,最终实现了第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态。
由于第一网元控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,第二网元控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,因此,第二种方式中的第二网元的第二计时器与第一网元的第一计时器进行时间对齐并不是一个只进行一次的过程,而是周期性的进行的过程。
第三种方式,基于图3中所示的1588协议进行第一网元的第一计时时钟与第二网元的第二计时时钟的时钟同步,其中,第一计时时钟为控制第一计时器计时的时钟,第二计时时钟为控制第二计时器计时的时钟。
可以理解的是,第一网元的第一计时时钟与第二网元的第二计时时钟的时钟同步后,第一计时器和第二计时器的在相同时间内的时间增量相同,即第一计时器和第二计时器处于时间对齐的状态。
第四种方式,基于图3中所示的1588协议进行第一网元的第一计时时钟与第二网元的第二计时时钟的时钟同步,接着采用第一种方式或者第二种方式使得第一计时器和第二计时器的时间相同。
在第四种方式下,第一网元和第二网元之间实现了时间同步。
步骤S103、在该时间对齐的状态下,第一网元根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取目标时钟的周期信息或频率信息。其中, 目标时钟为需要从第一网元传输至第二网元的任一时钟。
具体地,对于任意一个需要从第一网元传输至第二网元的时钟,第一网元根据该时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取该时钟的周期信息或频率信息。
本实施例中以一个需要从第一网元传输至第二网元的时钟为例来说明第一网元获取需要从第一网元传输至第二网元的时钟的周期信息或频率信息的过程,为了阐述的方便,本实施例中将该一个需要从第一网元传输至第二网元的时钟称为目标时钟。
首先,对本实施例中的“目标时钟对应的相邻的两个上升沿”进行说明。
在一种实施方式中,目标时钟没有进行分频,此时,目标时钟对应的相邻的两个上升沿即为目标时钟本身的相邻的两个上升沿。即当目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿时,第一上升沿和第二上升沿为目标时钟本身的两个相邻的上升沿。
在另一种实施方式中,目标时钟进行了分频,此时,目标时钟对应的相邻的两个上升沿即为目标时钟分频后的时钟的相邻的两个上升沿。即当目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿时,第一上升沿和第二上升沿为目标时钟分频后的时钟的两个相邻上升沿。
其次,对本实施例中的“目标时钟对应的相邻的两个下降沿”进行说明。
在一种实施方式中,目标时钟没有进行分频,此时,目标时钟对应的相邻的两个下降沿即为目标时钟本身的相邻的两个下降沿。即当目标时钟对应的相邻的两个下降沿为第一下降沿和第二下降沿时,第一下降沿和第二下降沿为目标时钟本身的两个相邻的下降沿。
在另一种实施方式中,目标时钟进行了分频,此时,目标时钟对应的相邻的两个下降沿即为目标时钟分频后的时钟的相邻的两个下降沿。即当目标时钟对应的相邻的两个下降沿为第一下降沿和第二下降沿时,第一下降沿和第二下降沿为目标时钟分频后的时钟的两个相邻下降沿。
接着,对本实施例中的“第一网元根据目标时钟对应的相邻的两个上升沿出现的时间,获取目标时钟的周期信息或频率信息”进行说明。
第一网元根据目标时钟对应的相邻的两个上升沿出现的时间,获取目标时钟的周期信息或频率信息,包括如下但不限于如下的三种方式:
在如下的三种方式中,目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;目标时钟对应的相邻的两个上升沿的出现时间包括:第一上升沿出现的第一时间和第二上升沿出现的第二时间。
第一种方式:目标时钟的周期信息包括:第一上升沿出现的第一时间和第二上升沿出现的第二时间。
该方式中,获取的目标时钟的周期信息为第一上升沿出现的第一时间和所述第二上升沿出现的第二时间,没有进行其余的计算,获取目标时钟的周期信息的效率高。
第二种方式:根据目标时钟对应的相邻的两个上升沿的出现时间,获取目标时钟的周期信息,包括:
获取第一上升沿出现的第一时间和第二上升沿出现的第二时间的差值的绝对值,得到目标时钟对应的时钟周期;
相应地,目标时钟的周期信息包括目标时钟对应的时钟周期。
在目标时钟没有进行分频的情况下,目标时钟对应的时钟周期即为目标时钟本身的时钟周期。
在目标时钟进行了分频的情况下,目标时钟对应的时钟周期即为目标时钟分频后的时钟的周期。此时,目标时钟的周期信息中还可包括:目标时钟的分频系数。比如,频率为1000MHz的目标时钟,进行了1000分频,则目标时钟分频后的时钟的频率为1KHz,目标时钟的分频系数为1000。
该方式中,获取的目标时钟的周期信息为根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算得到的目标时钟对应的时钟周期,使得第二网元无需自行根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算获取目标时钟对应的时钟周期,提高了第二网元获取与目标时钟同步的时钟的效率。同时,由于在目标时钟的周期信息为目标时钟对应的时钟周期时,将目标时钟对应的时钟周期这一个信息发送至第二网元时的信令开销比将所述第一时间和所述第二时间这两个信息发送至第二网元时的信令开销要少。
第三种方式:根据目标时钟对应的相邻的两个上升沿,获取目标时钟的周期信息,包括:
获取第一上升沿出现的第一时间和第二上升沿出现的第二时间的差值的绝对值,得到目标时钟对应的时钟周期;
根据目标时钟对应的时钟周期的倒数,得到目标时钟对应的时钟频率;
相应地,目标时钟的频率信息包括目标时钟对应的时钟频率。
在目标时钟没有进行分频的情况下,目标时钟对应的时钟频率即为目标时钟本身的时钟频率。
在目标时钟进行了分频的情况下,目标时钟对应的时钟频率即为目标时钟分频后的时钟的频率。此时,目标时钟的频率信息中还可包括:目标时钟的分频系数。
该方式中,获取的目标时钟的周期信息为根据第一上升沿出现的第一时间和所述第二上升沿出现的第二时间计算得到的目标时钟对应的时钟频率,使得第二网元无需自行根据第一上升沿出现的第一时间和第二上升沿出现的第二时间计算获取目标时钟对应的时钟频率,提高了第二网元获取与目标时钟同步的时钟的效率。同时,由于在目标时钟的周期信息为目标时钟对应的时钟频率时,将目标时钟对应的时钟频率这一个信息发送至第二网元时的信令开销比将所述第一时间和所述第二时间这两个信息发送至第二网元时的信令开销要少。
对于本实施例中的“第一网元根据目标时钟对应的相邻的两个下降沿的出现时间,获取目标时钟的周期信息或频率信息”的具体实现参照“第一网元根据目标时钟对应的相邻的两个上升沿的出现时间,获取目标时钟的周期信息或频率信息”,此处不再赘述。
步骤S104、第一网元将该目标时钟的周期信息或频率信息发送至第二网元。
具体地,第一网元将步骤S104中得到的目标时钟的周期信息或频率信息发送至第二网元。
第一网元可目标时钟的周期信息发送至第二网元,如上所述:目标时钟的周期信息可为如下的任意一种:(1)第一上升沿出现的第一时间和第二上升沿出现的第二时间;(2)目标时钟对应的时钟周期,具体参见步骤S103中的阐述;(3)第一下降沿出现的第一时 间和第二下降沿出现的第二时间,第一下降沿和第二下降沿为目标时钟对应的相邻的两个下降沿;(4)目标时钟对应的时钟周期和分频系数。
或者,第一网元还可目标时钟的频率信息发送至第二网元,如上所述:目标时钟的周期信息可为如下的任意一种:(1)目标时钟对应的时钟频率,具体参见步骤S103中的阐述;(2)目标时钟对应的时钟频率和分频系数。
在一种方式中,第一网元可通过报文将目标时钟的周期信息或频率信息发送至第二网元。比如第一网元可通过普通格式的以太报文将目标时钟的周期信息或频率信息发送至第二网元。
在另一种方式中,第一网元可通过用于传输网络开销的域段将目标时钟的周期信息或频率信息发送至第二网元。
进一步地,第一网元还会将目标时钟本身的频率信息发送至第二网元,以使第二网元将目标时钟本身的频率信息发送至第二网元的下游网元。其中,第一网元可通过控制信息报文等方式将目标时钟本身的频率信息发送至第二网元。
此外,在目标时钟进行了分频的情况下,目标时钟的分频系数还可携带在传送目标时钟本身的频率信息的控制信息报文中发送至第二网元。
步骤S105、第二网元根据该目标时钟的周期信息或频率信息,获取与该目标时钟同步的时钟。
具体地,根据目标时钟的周期信息或频率信息,获取与目标时钟同步的时钟,包括:
a1、根据目标时钟的周期信息或频率信息,获取目标时钟对应的时钟周期或者时钟频率。
具体地,若第二网元从第一网元接收到的为目标时钟的周期信息,且目标时钟的周期信息为目标时钟对应的时钟周期,则直接获取到目标时钟对应的时钟周期。
若第二网元从第一网元接收到的为目标时钟的周期信息,且目标时钟的周期信息包括的是第一上升沿出现的第一时间和第二上升沿出现的第二时间,则第二网元首先根据目标时钟的周期信息,获取目标时钟的对应的时钟周期或者时钟频率。其中,第二网元根据目标时钟的周期信息获取目标时钟的对应的时钟周期包括:获取第一时间和第二时间的差值的绝对值,得到目标时钟的对应的时钟周期。第二网元根据目标时钟的周期信息获取目标时钟的对应的时钟频率:获取第一时间和第二时间的差值的绝对值,得到目标时钟的对应的时钟周期;获取目标时钟的对应的时钟周期的倒数,得到目标时钟的对应的时钟频率。
若第二网元从第一网元接收到的为目标时钟的频率信息,则直接获取到目标时钟对应的时钟频率。
a2、根据目标时钟对应的时钟周期或者时钟频率,获取与目标时钟同步的时钟。
具体地,可通过锁相环电路,获取与目标时钟同步的时钟:锁相环电路会根据目标时钟对应的时钟周期或者时钟频率,输出一时钟,该时钟的频率与目标时钟的频率相同,即第二网元获取到了与目标时钟同步的时钟。
其中,锁相环电路的基本工作原理可参见现有技术,本实施例中不再赘述。
可以理解的是,若第一网元需要传输至第二网元的时钟具有多个,则第二网元可通过多个锁相环电路获取各与第一网元的时钟同步的时钟。
通过上述步骤S101~步骤S105,完成了第一网元和第二网元之间的时钟同步。
本实施例中的时钟同步是在第一网元的第一计时器和第二网元的第二计时器在相同时间内的时间增量相同的前提下进行的,因此,第一网元根据需要传输至第二网元的目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息可以直接被第二网元用来获取与该时钟同步的时钟,即在时钟同步时,第一网元只需根据目标时钟对应的相邻的两个上升沿出现的时间或者相邻的两个下降沿出现的时间获取到的该目标时钟的周期信息或频率信息,并将该目标时钟的周期信息或频率信息发送至第二网元,以使第二网元根据该目标时钟的周期信息或频率信息进行时钟同步即可,方法简单易实现。
同时,在第一网元需要传输至第二网元的时钟具有多个时,由于第一网元传输至第二网元的是需要同步的时钟的周期信息或频率信息,该周期信息或频率信息不需要多根光纤传输,即不需要向现有技术中那样通过设置多根光纤来承载多个业务以达到根据业务流同步多个时钟的目的,该周期信息或频率信息也不需要多个波长来传输,即不需要向现有技术中那样通过设置多个波长来承载多个业务以达到根据业务流同步多个时钟的目的,同时也不需要设置OTN设备。即本方案中的时钟同步方法占用的物理资源也较少。
进一步地,根据上述各步骤的阐述可知,本实施例中,若第一网元的第一计时器和第二网元的第二计时器在时间对齐时存在一定的静态偏差,该静态偏差可以在计算目标时钟对应的周期时两个时间相减而被抵消掉。而对于第一网元的第一计时器和第二网元的第二计时器在时间对齐时存在的动态抖动,可以通过提升第一网元的打时间戳精度和第二网元的低通滤抖消除,保证了本实施例中第一网元和第二网元之间的时钟同步的精度。
由于本实施例在第一网元和第二网元之间的时钟同步过程中,第一网元向第二网元发送的是目标时钟的周期信息或频率信息,只要带宽足够大,第一网元向第二网元之间可同步的时钟的个数没有上限。且本实施例在第一网元和第二网元之间的时钟同步过程不受第一网元和第二网元之间通信的网络类型的影响,只要需要传输的目标时钟的周期信息或频率信息能够传输至第二网元即可,即不受限于第一网元和第二网元之间是点对点传输还是端到端传输。
上文描述了本申请实施例提供的时钟同步方法,下文将描述本申请实施例提供的时钟同步的装置和设备。
图8为本申请实施例提供的时钟同步的装置的示意性框图一,本实施例的时钟同步的装置800包括:
控制模块801,用于控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
获取模块802,还用于在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
发送模块803,用于将所述目标时钟的周期信息或频率信息发送至所述第二网元。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述获取模块802具体用于:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
所述获取模块802具体用于:
获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
可选地,作为一个实施例,所述发送模块803具体用于:
通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本实施例的装置,可以用于执行图7所示的实施例中第一网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图9为本申请实施例提供的时钟同步的装置的示意性框图二,本实施例的时钟同步的装置900包括:
控制模块901,用于控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
接收模块902,用于从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
获取模块903,用于根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
可选地,作为一个实施例,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
可选地,作为一个实施例,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
可选地,作为一个实施例,所述获取模块903具体用于:
根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本实施例的装置,可以用于执行图7所示的实施例中第二网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图10为本申请实施例提供的通信设备的示意性框图一,参见图10,本实施例的通信设备包括处理器1001和存储器1002,所述存储器1002中存储有指令,所述处理器1001调用所述指令,控制执行如下操作:
控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或 相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
将所述目标时钟的周期信息或频率信息发送至所述第二网元。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述处理器1001在用于控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息的操作时,具体用于控制执行如下操作:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
具体地,所述处理器1001在控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息的操作时,具体用于控制处理器1001执行如下操作:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;所述处理器1001在控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的频率信息的操作时,具体用于控制执行如下操作:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
具体地,所述处理器1001在控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的频率信息的操作时,具体用于控制处理器1001执行如下操作:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本实施例的通信设备,可以对应图7所示的实施例中的第一网元,用于执行图7所示的实施例中第一网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图11为本申请实施例提供的通信设备的示意性框图二,参见图11,本实施例的通信设备在图10所示的通信设备的基础上,还包括收发器1003。
可选地,作为一个实施例,所述处理器1001在用于控制执行控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的操作时,具体用于控制处理器1001和收发器1003执行控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的操作。
可选地,作为另一个实施例,所述处理器1001在用于控制执行控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的操作时,具体用于控制处理器1001执行控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态的操作。
可选地,作为一个实施例,所述处理器1001在用于控制执行将所述目标时钟的周期信息或频率信息发送至所述第二网元的操作时,具体用于控制收发器1003执行将所述目标时钟的周期信息或频率信息发送至所述第二网元的操作。
可选地,作为一个实施例,所述处理器1001在用于控制将所述目标时钟的周期信息或频率信息发送至所述第二网元的操作时,具体用于控制执行如下操作:通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
具体地,所述处理器1001具体用于控制收发器1003执行如下操作:通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
本实施例的通信设备,可以对应图7所示的实施例中的第一网元,用于执行图7所示的实施例中第一网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图12为本申请实施例提供的通信设备的示意性框图三,参见图12,本实施例的通信设备包括处理器1201和存储器1202,所述存储器1202中存储有指令,所述处理器1201调用所述指令,控制执行如下操作:
控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
可选地,作为一个实施例,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
可选地,作为一个实施例,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
可选地,作为一个实施例,所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
本实施例的通信设备,可以对应图7所示的实施例中的第二网元,用于执行图7所示的实施例中第二网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
图13为本申请实施例提供的通信设备的示意性框图四,参见图13,本实施例的通信设备在图12所示的通信设备的基础上,还包括:收发器1203和锁相环电路1204;
所述处理器1201在用于控制执行从所述第一网元接收目标时钟的周期信息或频率信息的操作时,具体用于控制收发器1204执行从所述第一网元接收目标时钟的周期信息或频率信息的操作。
所述处理器1201在用于控制执行根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟的操作时,具体用于控制执行如下操作:根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
具体地,所述处理器1201具体用于控制处理器1201执行如下操作:根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率,以及具体用于控制锁相环电路1204执行如下操作:根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
本实施例的通信设备,可以对应图7所示的实施例中的第二网元,用于执行图7所示的实施例中第二网元对应的技术方案,其实现原理和技术效果类似,此处不再赘述。
本申请实施例还提供一种计算机可读存储介质,包括程序或指令,当所述程序或指令在计算机上运行时,上述方法实施例中第二网元对应的方法被执行。
本申请实施例还提供一种计算机可读存储介质,包括程序或指令,当所述程序或指令在计算机上运行时,上述方法实施例中第二网元对应的方法现被执行。
应理解,本申请实施例中提及的处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)集成在处理器中。
应注意,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
还应理解,本文中涉及的第一、第二、第三、第四以及各种数字编号仅为描述方便进行的区分,并不用来限制本申请的范围。
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实 现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (30)

  1. 一种时钟同步的方法,其特征在于,包括:
    控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  2. 根据权利要求1所述的方法,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
  3. 根据权利要求1所述的方法,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息,包括:
    获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
  4. 根据权利要求1所述的方法,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述根据目标时钟对应的相邻的两个上升沿,获取所述目标时钟的周期信息,包括:
    获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
    相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
  5. 根据权利要求1~4任一项所述的方法,其特征在于,所述目标时钟对应的相邻的两个上升沿为所述目标时钟分频后的时钟的相邻的两个上升沿;或者,
    所述目标时钟对应的相邻的两个下降沿为所述目标时钟分频后的时钟的相邻的两个下降沿;
    相应地,所述目标时钟的周期信息或频率信息还包括所述目标时钟的分频系数,目标时钟对应的时钟周期为所述目标时钟分频后的时钟的周期,目标时钟对应的时钟频率为所述目标时钟分频后的时钟的频率。
  6. 根据权利要求1~4任一项所述的方法,其特征在于,
    所述目标时钟对应的相邻的两个上升沿为所述目标时钟的相邻的两个上升沿;或者,
    所述目标时钟对应的相邻的两个下降沿为所述目标时钟的相邻的两个下降沿;
    相应地,目标时钟对应的时钟周期为所述目标时钟的时钟周期,目标时钟对应的时钟频率为所述目标时钟的时钟频率。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,所述将所述目标时钟的周期信息或频率信息发送至所述第二网元,包括:
    通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  8. 一种时钟同步方法,其特征在于,包括:
    控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
  9. 根据权利要求8所述的方法,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  10. 根据权利要求8所述的方法,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  11. 根据权利要求8~10任一项所述的方法,其特征在于,所述根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟,包括:
    根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
    根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
  12. 一种时钟同步的装置,其特征在于,包括:
    控制模块,用于控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    获取模块,还用于在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    发送模块,用于将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  13. 根据权利要求12所述的装置,其特征在于,所述目标时钟对应的相邻的两个 上升沿为第一上升沿和第二上升沿;
    所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
  14. 根据权利要求12所述的装置,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述获取模块具体用于:获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
  15. 根据权利要求12所述的装置,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述获取模块具体用于:
    获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
    相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
  16. 根据权利要求12~15任一项所述的装置,其特征在于,所述发送模块具体用于:
    通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  17. 一种时钟同步装置,其特征在于,包括:
    控制模块,用于控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    接收模块,用于从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    获取模块,用于根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
  18. 根据权利要求17所述的装置,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  19. 根据权利要求17所述的装置,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  20. 根据权利要求17~19任一项所述的装置,其特征在于,所述获取模块具体用 于:
    根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
    根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
  21. 一种通信设备,包括处理器和存储器,其特征在于,所述存储器中存储有指令,所述处理器调用所述指令,控制执行如下操作:
    控制第一网元的第一计时器与第二网元的第二计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    在所述时间对齐的状态下,根据目标时钟对应的相邻的两个上升沿的出现时间或相邻的两个下降沿的出现时间,获取所述目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息用于所述第二网元获取与所述目标时钟同步的时钟,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  22. 根据权利要求21所述的通信设备,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述目标时钟的周期信息包括:所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间。
  23. 根据权利要求21所述的通信设备,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述处理器在用于控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的周期信息的操作时,具体用于控制执行如下操作:
    获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    相应地,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期。
  24. 根据权利要求21所述的通信设备,其特征在于,所述目标时钟对应的相邻的两个上升沿为第一上升沿和第二上升沿;
    所述处理器在用于控制执行根据目标时钟对应的相邻的两个上升沿出现的时间,获取所述目标时钟的频率信息的操作时,具体用于控制执行如下操作:
    获取所述第一上升沿出现的第一时间和所述第二上升沿出现的第二时间的差值的绝对值,得到所述目标时钟对应的时钟周期;
    根据所述目标时钟对应的时钟周期的倒数,得到所述目标时钟对应的时钟频率;
    相应地,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率。
  25. 根据权利要求21~24任一项所述的通信设备,其特征在于,所述处理器在用于控制将所述目标时钟的周期信息或频率信息发送至所述第二网元的操作时,具体用于控制执行如下操作:
    通过报文或者用于传输网络开销的域段将所述目标时钟的周期信息或频率信息发送至所述第二网元。
  26. 一种通信设备,包括处理器和存储器,其特征在于,所述存储器中存储有指 令,所述处理器调用所述指令,控制执行如下操作:
    控制第二网元的第二计时器与第一网元的第一计时器处于时间对齐的状态,所述时间对齐的状态为在相同时间内所述第一计时器和所述第二计时器的时间增量相同;
    从所述第一网元接收目标时钟的周期信息或频率信息,所述目标时钟的周期信息或频率信息是所述第一网元在所述时间对齐的状态下根据目标时钟对应的相邻的两个上升沿的出现时间或者相邻的两个下降沿的出现时间获取到的,所述目标时钟为需要从所述第一网元传输至所述第二网元的任一时钟;
    根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟。
  27. 根据权利要求26所述的通信设备,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的周期信息包括第一时间和第二时间,或者,所述目标时钟的周期信息包括所述目标时钟对应的时钟周期,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  28. 根据权利要求26所述的通信设备,其特征在于,当所述目标时钟对应的相邻的两个上升沿的出现时间分别为第一时间和第二时间时,所述目标时钟的频率信息包括所述目标时钟对应的时钟频率,所述目标时钟对应的时钟频率为所述目标时钟对应的时钟周期的倒数,所述目标时钟对应的时钟周期为所述第一时间和所述第二时间的差值的绝对值。
  29. 根据权利要求26~28任一项所述的通信设备,其特征在于,
    所述处理器在用于控制执行根据所述目标时钟的周期信息或频率信息,获取与所述目标时钟同步的时钟的操作时,具体用于控制执行如下操作:
    根据所述目标时钟的周期信息或频率信息,获取所述目标时钟对应的时钟周期或者时钟频率;
    根据所述目标时钟对应的时钟周期或者时钟频率,获取与所述目标时钟同步的时钟。
  30. 一种计算机可读存储介质,包括程序或指令,其特征在于,当所述程序或指令在计算机上运行时,权利要求1~7任一所述的方法或者权利要求8~11任一所述的方法被执行。
PCT/CN2019/075194 2019-02-15 2019-02-15 时钟同步的方法和装置 WO2020164100A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/075194 WO2020164100A1 (zh) 2019-02-15 2019-02-15 时钟同步的方法和装置
CN201980092010.3A CN113424466B (zh) 2019-02-15 2019-02-15 时钟同步的方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/075194 WO2020164100A1 (zh) 2019-02-15 2019-02-15 时钟同步的方法和装置

Publications (1)

Publication Number Publication Date
WO2020164100A1 true WO2020164100A1 (zh) 2020-08-20

Family

ID=72044125

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/075194 WO2020164100A1 (zh) 2019-02-15 2019-02-15 时钟同步的方法和装置

Country Status (2)

Country Link
CN (1) CN113424466B (zh)
WO (1) WO2020164100A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112054939A (zh) * 2020-08-31 2020-12-08 中国科学院空间应用工程与技术中心 一种高精度时钟同步的精度测试方法和装置
CN114924615A (zh) * 2022-04-22 2022-08-19 龙芯中科技术股份有限公司 内存时钟调节方法、装置、电子设备及存储介质
CN115243358A (zh) * 2022-07-08 2022-10-25 深圳泽惠通通讯技术有限公司 一种链路延时测量方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110022934A1 (en) * 2009-07-24 2011-01-27 Electronics And Telecommunications Research Institute System and apparatus for synchronization between heterogeneous periodic clock domains, circuit for detecting synchronization failure and data receiving method
US20110103511A1 (en) * 2009-10-29 2011-05-05 Oki Semiconductor Co., Ltd. Transmission apparatus, signal sending apparatus, and signal receiving apparatus, and transmission method, signal sending method, and signal receiving method
CN102082653A (zh) * 2009-11-26 2011-06-01 中兴通讯股份有限公司 一种时钟同步的方法、系统及装置
CN103346873A (zh) * 2013-06-27 2013-10-09 华为技术有限公司 一种时间同步的方法和设备
CN107070577A (zh) * 2017-03-28 2017-08-18 深圳怡化电脑股份有限公司 一种设备时钟的同步方法及其设备
CN107547161A (zh) * 2017-07-03 2018-01-05 新华三技术有限公司 一种时钟同步方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7298807B2 (en) * 2003-02-11 2007-11-20 Rambus Inc. Circuit, apparatus and method for adjusting a duty-cycle of a clock signal in response to incoming serial data
JP4502696B2 (ja) * 2004-04-21 2010-07-14 Necエンジニアリング株式会社 クロック同期化装置
US8284881B2 (en) * 2005-11-03 2012-10-09 Nxp B.V. Data interface and method of seeking synchronization
CN205540397U (zh) * 2016-04-15 2016-08-31 北京智芯微电子科技有限公司 一种低功耗实时时钟

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110022934A1 (en) * 2009-07-24 2011-01-27 Electronics And Telecommunications Research Institute System and apparatus for synchronization between heterogeneous periodic clock domains, circuit for detecting synchronization failure and data receiving method
US20110103511A1 (en) * 2009-10-29 2011-05-05 Oki Semiconductor Co., Ltd. Transmission apparatus, signal sending apparatus, and signal receiving apparatus, and transmission method, signal sending method, and signal receiving method
CN102082653A (zh) * 2009-11-26 2011-06-01 中兴通讯股份有限公司 一种时钟同步的方法、系统及装置
CN103346873A (zh) * 2013-06-27 2013-10-09 华为技术有限公司 一种时间同步的方法和设备
CN107070577A (zh) * 2017-03-28 2017-08-18 深圳怡化电脑股份有限公司 一种设备时钟的同步方法及其设备
CN107547161A (zh) * 2017-07-03 2018-01-05 新华三技术有限公司 一种时钟同步方法和装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112054939A (zh) * 2020-08-31 2020-12-08 中国科学院空间应用工程与技术中心 一种高精度时钟同步的精度测试方法和装置
CN114924615A (zh) * 2022-04-22 2022-08-19 龙芯中科技术股份有限公司 内存时钟调节方法、装置、电子设备及存储介质
CN114924615B (zh) * 2022-04-22 2024-02-20 龙芯中科技术股份有限公司 内存时钟调节方法、装置、电子设备及存储介质
CN115243358A (zh) * 2022-07-08 2022-10-25 深圳泽惠通通讯技术有限公司 一种链路延时测量方法及系统
CN115243358B (zh) * 2022-07-08 2023-04-07 深圳泽惠通通讯技术有限公司 一种链路延时测量方法及系统

Also Published As

Publication number Publication date
CN113424466B (zh) 2023-01-13
CN113424466A (zh) 2021-09-21

Similar Documents

Publication Publication Date Title
US11223439B1 (en) Maintaining a time of day in a physical layer circuit including compensating for drift away from a grandmaster time
JP5811794B2 (ja) 通信装置
US9178637B2 (en) Method and devices for synchronization using linear programming
KR101749202B1 (ko) 타임스탬프를 생성하는 방법, 장치, 그리고 시스템
US8370675B2 (en) Precise clock synchronization
JP5548305B2 (ja) パケット交換通信ネットワークにおけるパケットの累積滞留時間の更新
WO2020135857A1 (zh) 时间同步方法、系统、设备及存储介质
JP5518191B2 (ja) 光伝送網が時刻同期プロトコルをキャリングする方法及びシステム
WO2020164100A1 (zh) 时钟同步的方法和装置
WO2015196685A1 (zh) 时钟同步方法及装置
EP2572462A1 (en) Optimizing timing packet transport
US20220007321A1 (en) Network Entities and Methods for a Wireless Network System for Determining Time Information
CN105027489B (zh) 精确时钟协议同步方法和节点
JP2012222833A (ja) 揺らぎの蓄積を克服して大きなネットワーク上で精密なクロック分配を達成するシステムおよび方法
CN110572230A (zh) 一种用于实现时间同步的修正方法及装置
CN103259640A (zh) 一种同步时间的方法和设备
EP4010777A1 (en) Systems for timestamping events on edge devices
WO2008098450A1 (fr) Procédé, système et dispositif pour la mise en oeuvre de synchronisation temporelle dans un réseau de communications
WO2021077289A1 (zh) 一种同步方法及设备
WO2019169820A1 (zh) 高精度时间同步方法
EP3080933B1 (en) Method and devices for synchronization using linear programming
CN114244466B (zh) RapidIO网络系统的分布式时间同步的方法及系统
TWI421667B (zh) 時鐘同步之方法及應用該方法之網路系統
WO2016177240A1 (zh) 一种实现频率同步的方法和装置
Kim et al. Time synchronization method of IEEE 802.1 AS through automatic optimal sync message period adjustment for in-car network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19915344

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19915344

Country of ref document: EP

Kind code of ref document: A1