WO2021097769A1 - 一种时钟同步方法及装置 - Google Patents

一种时钟同步方法及装置 Download PDF

Info

Publication number
WO2021097769A1
WO2021097769A1 PCT/CN2019/120022 CN2019120022W WO2021097769A1 WO 2021097769 A1 WO2021097769 A1 WO 2021097769A1 CN 2019120022 W CN2019120022 W CN 2019120022W WO 2021097769 A1 WO2021097769 A1 WO 2021097769A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
data
message
delay
transmission
Prior art date
Application number
PCT/CN2019/120022
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 CN201980102220.6A priority Critical patent/CN114731205A/zh
Priority to PCT/CN2019/120022 priority patent/WO2021097769A1/zh
Publication of WO2021097769A1 publication Critical patent/WO2021097769A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements

Definitions

  • the present invention relates to the field of wireless communication technology, in particular to a clock synchronization method and device.
  • clock synchronization is required between the sender and receiver of the data.
  • the clock synchronization between devices is mainly based on the precision clock synchronization protocol standard (IEEE1588 protocol) of the network measurement and control system.
  • a synchronization (sync) message carrying data is sent to the data receiver, and the data receiver records the reception time T2 when the sync message is received.
  • the data sender sends a follow_up message carrying the real time T1 of the data transmission to the data receiver, and the data receiver obtains the T1 in the follow_up message.
  • the data receiver after receiving the Sync message, sends a delay request (Delay_req) message to the data sender, and records the sending time T3 for sending the Delay_req message.
  • Delay_req delay request
  • the data sender After receiving the Delay_Req message, the data sender records the accurate reception time T4 of the Delay_Req message, and then sends a delay response (Delay_Resp) message carrying the T4 to the data receiver.
  • the data receiver obtains the T4 in the Delay_Resp message. Therefore, the data receiver determines the time difference between the data sender and the data receiver and the path delay of the data transmission process based on the IEEE1588 protocol according to four time points T1, T2, T3, and T4.
  • the data receiver realizes clock synchronization between the data sender and the data receiver according to the determined time difference and the path delay.
  • the embodiments of the present application provide a clock synchronization method and device, which are used to solve the problem of insufficient accuracy of clock synchronization when data format processing exists in the prior art.
  • an embodiment of the present application provides a method for clock synchronization, which is used in a network environment composed of a first device, a conversion device, and a second device.
  • the conversion device is used to connect the first device of the first device to the network environment.
  • the second data is obtained, and the second data is sent to the second device, including:
  • the first device sends the first data, stamps the first data with a time stamp, determines the data position of the data corresponding to the time stamp in the first data, and sends the time stamp corresponding
  • the first time of the data of the data determines the transmission delay of the data of the data location during the format conversion process according to the data location; the first device sends the first device to the second device Message, the first message is used to indicate a second time, and the second time is the time after the first time is compensated according to the transmission delay; the first device receives the A second message sent by the second device; the first device sends a third message to the second device, and the third message includes the third time, so that the second device is based on the second time , The third time and the fourth time of sending the second message are synchronized with the clock between the first device.
  • the first device determines the transmission delay generated in the process of data format conversion of the transmission data and the first time of sending the data with the time stamp recorded in the first data, and then according to the transmission
  • the delay and the first time indicate the second time used by the second device for clock synchronization, and the second time is the time after the first time is compensated according to the transmission delay, so that The second device performs clock synchronization according to the compensated transmission time, which effectively solves the delay jitter generated in the process of data format conversion of the transmission data, the impact on clock synchronization, and improves the accuracy of time synchronization.
  • the first message includes the first time and the transmission delay, so that the second device compensates for the first time according to the transmission delay to obtain The second time; or the first message includes the second time.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data remains unchanged.
  • the embodiments of the present application provide a method of clock synchronization, which is used in a network environment composed of a first device, a conversion device, and a second device.
  • the conversion device is used to connect the first device of the first device to the network environment.
  • the second data is obtained, and the second data is sent to the second device, including:
  • the second device receives the second data sent by the conversion device; the second device receives the first message sent by the first device, the first message is used to indicate a second time; the second time is based on the transmission delay When the first time is compensated for, the transmission delay is generated during the format conversion process of the time-stamped data in the first data, and the first time is for the first device to send the The sending time of the data corresponding to the timestamp; the second device sends a second message to the first device at the fourth time; the second device receives the third message sent by the first device, and the third device The message includes the third time when the first device received the second message; the second device communicates with the first device according to the second time, the third time, and the fourth time. Clock synchronization between.
  • the second device receives the first message sent by the first device indicating the second time, and the second time is compensation for the first time according to the transmission delay Therefore, the second device performs clock synchronization according to the compensated transmission time, which effectively solves the delay jitter generated in the process of data format conversion of transmission data, and the impact on clock synchronization, which improves the time synchronization Accuracy.
  • the method before the second device performs clock synchronization with the first device according to the second time, the third time, and the fourth time, the method further includes: The second device determines the second time according to the transmission delay and the first time included in the first message.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data remains unchanged.
  • the embodiments of the present application provide a method of clock synchronization, which is used in a network environment composed of a first device, a conversion device, and a second device.
  • the conversion device is used to connect the first device of the first device to the network environment.
  • the second data is obtained, and the second data is sent to the second device, including:
  • the second device receives the second data sent by the conversion device; the second device determines the transmission delay of the time-stamped data in the second data during the format conversion process; the second device receives the first data A first message sent by a device, where the first message includes the first time; the second device sends a second message to the first device at the fourth time; the second device receives the first device A third message sent, the third message contains the third time when the first device receives the second message; the second device is based on the first time, the transmission delay, and the first The third time and the fourth time are synchronized with the clock between the first device.
  • the second device determines the transmission delay generated during the data format conversion of the data, and then compensates the first time received from the first device according to the transmission delay to obtain The second time, thereby performing clock synchronization according to the second time, effectively solves the impact of the data format processing of the transmitted data on the clock synchronization, and improves the accuracy of time synchronization.
  • the second device compensates the first time according to the transmission delay to obtain the second time; the second device obtains the second time according to the second time and the third time , The fourth time is synchronized with the clock between the first device.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data remains unchanged.
  • an embodiment of the present application provides a communication device, which has the function of implementing the devices in the first aspect to the third aspect in the foregoing embodiment.
  • This function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes one or more units or modules corresponding to the above-mentioned functions.
  • the communication device may be the first device in the above first aspect, or a component that can be used in the first device, such as a chip or a chip system or a circuit, and the communication device may Including: transceiver and processor.
  • the processor may be configured to support the communication device to perform corresponding functions of the first device described above, and the transceiver is used to support communication between the communication device and other devices (for example, the second device).
  • the communication device may further include a memory, and the memory may be coupled with the processor, which stores the necessary program instructions and data of the communication device.
  • the transceiver may be an independent receiver, an independent transmitter, a transceiver with integrated transceiver functions, or an interface circuit.
  • the communication device may be the second device in the above second aspect or the third aspect, or a component that can be used in the second device, such as a chip or a chip system or circuit
  • the communication device may include a transceiver and a processor.
  • the processor may be configured to support the communication device to perform corresponding functions of the second device described above, and the transceiver is used to support communication between the communication device and other devices (for example, the first device).
  • the communication device may further include a memory, and the memory may be coupled with the processor, which stores the necessary program instructions and data of the communication device.
  • the transceiver may be an independent receiver, an independent transmitter, a transceiver with integrated transceiver functions, or an interface circuit.
  • an embodiment of the present application provides a communication device for implementing the first aspect or any one of the methods in the first aspect.
  • the communication device when the communication device is the first device, it may include: a processing unit and a communication unit:
  • the communication unit is configured to send the first data
  • the processing unit is configured to stamp the first data with a time stamp, determine the data position of the data corresponding to the time stamp in the first data, and send the first data corresponding to the time stamp. Time; according to the data location, determine the transmission delay of the data at the data location during the format conversion process;
  • the communication unit is configured to send a first message to the second device, the first message is used to indicate a second time, and the second time is to compensate for the first time according to the transmission delay Time later; at the third time, receiving the second message sent by the second device; sending a third message to the second device, the third message containing the third time, so that the second device Perform clock synchronization with the first device according to the second time, the third time, and the fourth time when the second message is sent.
  • an embodiment of the present application provides a communication device for implementing the second aspect or any one of the methods in the second aspect.
  • the communication device when it is a second device, it may include: a processing unit and a communication unit:
  • the communication unit is configured to receive second data sent by the conversion device; receive a first message sent by the first device, where the first message is used to indicate a second time; the second time is based on the transmission delay The time after compensation for the first time, the transmission delay is generated during the format conversion process of the time stamped data in the first data, and the first time is the time sent by the first device Stamp the corresponding data sending time; send a second message to the first device at the fourth time; receive a third message sent by the first device, the third message including the first device received the The third time of the second message;
  • the processing unit is configured to perform clock synchronization with the first device according to the second time, the third time, and the fourth time.
  • an embodiment of the present application provides a communication device for implementing the third aspect or any one of the methods in the third aspect.
  • the communication device when it is a second device, it may include: a processing unit and a communication unit:
  • the communication unit is configured to receive the second data sent by the conversion device
  • the processing unit is configured to determine the transmission delay of the time stamped data in the second data during the format conversion process
  • the communication unit is configured to receive a first message sent by the first device, where the first message includes the first time; send a second message to the first device at a fourth time; receive the first message A third message sent by a device, where the third message includes the third time when the first device received the second message; according to the first time, the transmission delay, the third time, and The fourth time is synchronized with the clock between the first device.
  • an embodiment of the present application provides a communication system.
  • the communication system includes a first device and a second device.
  • the first device may be used to execute any one of the above-mentioned first aspects; or execute any one of the above-mentioned methods of the first aspect;
  • the second device is used to execute any one of the foregoing second aspect or the third aspect; or is used to implement any one of the foregoing first aspect or the third aspect.
  • the present application provides a chip system including a processor.
  • it may further include a memory, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the communication device installed with the chip system executes any one of the first aspect to the third aspect; or Perform any one of the methods from the first aspect to the third aspect described above.
  • an embodiment of the present application provides a computer storage medium with instructions stored in the computer storage medium, which when run on a communication device, causes the communication device to execute any one of the first to third aspects; or Perform any one of the methods from the first aspect to the third aspect described above.
  • an embodiment of the present application provides a computer program product containing instructions, which when run on a communication device, causes the communication device to execute any one of the first to third aspects; or to execute the first Any one of the aspects to the third aspect.
  • FIG. 1 is a schematic diagram of message transmission between a sending device and a receiving device based on the existing IEEE1588;
  • Figure 2 is a schematic diagram of a time stamp marking method in the existing data transmission process
  • FIG. 3 is a schematic diagram of a system architecture provided by an embodiment of the application.
  • FIG. 4 is a schematic flowchart corresponding to a time synchronization method provided by an embodiment of the application
  • FIG. 5 is a schematic diagram of performing FEC encoding to determine transmission delay according to an embodiment of the application
  • FIG. 6 is a schematic diagram of compensation for sending time T1 according to an embodiment of the application.
  • FIG. 7 is a schematic flowchart corresponding to another clock synchronization method provided by an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of a first type of first device provided by an embodiment of this application.
  • FIG. 9 is a schematic structural diagram of a second type of first device provided by an embodiment of this application.
  • FIG. 10 is a schematic structural diagram of a first type of second device provided by an embodiment of this application.
  • FIG. 11 is a schematic structural diagram of a second type of second device provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a third type of second device provided by an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of a fourth type of second device provided by an embodiment of this application.
  • the data sender performs data transmission
  • the FEC encoding technology is generally used to convert the data format of the transmitted data.
  • the data format conversion of the transmission data will produce relatively large delay jitter, where the delay jitter generated by the data format conversion is referred to as transmission delay in the embodiment of the present application.
  • the sending device uses the transmission time of the data at position A as the The transmission time of the transmitted data.
  • Case 1 The data transmitted by the first device to the second device does not require data format conversion.
  • the first device directly sends the data to be transmitted to all the second devices, the first device sends a sync message carrying the transmission data to the second device, and timestamps the transmission data. , And determine the data position of the data corresponding to the time stamp in the transmission data and the first time when the data corresponding to the time stamp is sent.
  • the second device records that the time when the sync message is received is 1:10 (that is, time T2).
  • the first device determines that the time stamp in the follow_up message is 1:00 according to the sending time 1:00 That is, after determining the sending time of the location A data, the first device generates a time stamp according to the sending time, and carries the time stamp in the follow_up message.
  • the first device sends the follow_up message to the second device.
  • the second device receives the follow_up message, and obtains the timestamp 1:00 (that is, time T1) in the follow_up message.
  • the second device can obtain the sum of the time difference Offset between the first device and the second device and the network transmission delay Delay according to the following formula 1 and the known T1 and T2.
  • the "time stamp in the transmission data" mentioned in the embodiment of the application actually means that the first device generates a voucher document (ie, time stamp) after determining the sending time of the data at the location A ,
  • the sending time of the data at the location A can be known through the timestamp.
  • the first device may record the credential document (that is, the timestamp) in the follow_up message, and send the follow_up message to the second device, so that the first device The second device acquires the sending time of the data of the location A.
  • time stamping the transmission data is not a limitation of the embodiment of the present application. In the process of communication and transmission, time stamping is often used to determine or prove the generation time of certain events, so those skilled in the art can understand that “the first device is in the transmission "Time stamped in the data” means.
  • Case 2 The data transmitted by the first device to the second device requires data format conversion.
  • the first device sends a sync message carrying the transmission data to the second device through a conversion device (for example, the conversion device is a CDR/Retimer), where the transmission data is in the conversion device Data format conversion is carried out in the process.
  • a conversion device for example, the conversion device is a CDR/Retimer
  • the first device determines the transmission time of the transmission data (that is, the data of the location A), and assuming that the transmission time of the transmission data is 1:00, the first device according to the transmission time 1: 00, make sure that the timestamp in the follow_up message is 1:00. Then, the first device sends the follow_up message to the second device. The second device receives the follow_up message, and obtains the timestamp 1:00 (that is, time T1) in the follow_up message.
  • the data format conversion of the transmission data by the conversion device will cause a transmission delay. It is assumed that the transmission delay generated by the conversion device for the data format conversion of the transmission data is 5 minutes. Therefore, the second device records that the time when the sync message is received is 1:15 (that is, time T2).
  • the second device can obtain the sum of the time difference Offset between the first device and the second device and the network transmission delay Delay according to the above formula 1 and the known T1 and T2.
  • case 2 the sum of the Offset and the Delay determined in case 2 is not the actual Offset during data transmission between the first device and the second device.
  • the sum of the delay and the delay therefore, based on the Offset and Delay obtained in case 2, the second device performs clock synchronization with the first device, which will cause a relatively large error and cannot achieve accurate clock synchronization.
  • the prior art cannot accurately achieve clock synchronization between the first device and the second device when the transmitted data needs to be processed in the data format, thereby reducing the data between the first device and the second device. Transmission efficiency.
  • the delay jitter generated by FEC encoding can be compensated according to Table 1 similar to the following.
  • the delay time generated by the FEC encoding provided in the prior art is the maximum delay time that can be generated. Assuming that the FEC (528, 541) in Table 1 is selected as an example, it can be known that when the port is 25, the maximum possible transmission delay is 5.6 ns.
  • the time stamp is determined based on the data at a certain position in the transmitted data, and the transmission delay caused by the data format conversion of the data at this position is not necessarily 5.6ns, and now There are technologies that cannot compensate for the data at a specific location during the clock synchronization process, and there is still a problem that the clock synchronization error is large and accurate clock synchronization cannot be achieved.
  • the embodiments of the present application provide a method for clock synchronization.
  • the technical solutions of the embodiments of the present application can be applied to various communication systems, such as: long term evolution (LTE) system, global interconnection microwave Access (worldwide interoperability for microwave access, WiMAX) communication systems, future 5th Generation (5G) systems, such as new radio access technology (NR), and future communication systems, such as 6G system, etc.
  • LTE long term evolution
  • WiMAX global interconnection microwave Access
  • 5G future 5th Generation
  • NR new radio access technology
  • future communication systems such as 6G system, etc.
  • the 5G system also known as the New Radio system
  • Delay and compensate the transmission delay to the sending time of the first device to send data to the second device, for example, sending time T1.
  • the transmission time T1 used for clock synchronization is the compensated time, which has eliminated the data format conversion of the transmission data.
  • the transmission delay effectively solves the impact of the data format conversion process of the transmission data on the clock synchronization, and improves the accuracy of time synchronization.
  • time synchronization in the embodiment of the present application may also be referred to as clock synchronization.
  • FIG. 3 is a schematic diagram of a system architecture to which an embodiment of this application is applicable.
  • the system architecture includes one or more first devices 301, such as gNB, eNodeB or WLAN access point, one or more second devices 302, and one or more conversion devices 303 (such as CDR/ Retimer), and the core network 304.
  • first devices 301 such as gNB, eNodeB or WLAN access point
  • second devices 302 such as gNB, eNodeB or WLAN access point
  • conversion devices 303 such as CDR/ Retimer
  • the first device 301 may include: a base transceiver station (Base Transceiver Station), a wireless transceiver, a basic service set (Basic Service Set, BSS), and an extended service set (Extended Service Set, ESS), NodeB, eNodeB, gNB, etc.
  • Base Transceiver Station Base Transceiver Station
  • BSS Basic Service Set
  • ESS Extended Service Set
  • NodeB NodeB
  • eNodeB gNodeB
  • the system architecture may include several different types of first devices 301, such as macro base stations, micro base stations, and so on.
  • the first device 301 may apply different wireless technologies, such as a cell wireless access technology or a WLAN wireless access technology.
  • the second device 302 can be a device with wireless transceiver function, which can be deployed on land, including indoor or outdoor, handheld or vehicle-mounted; it can also be deployed on the water (such as ships, etc.); it can also be deployed in the air (such as airplanes). , Balloons and satellites etc.).
  • the terminal equipment may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with wireless transceiver function, virtual reality (VR) terminal equipment, augmented reality (AR) terminal equipment, industrial control ( Wireless terminal equipment in industrial control, wireless terminal equipment in self-driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid, transportation safety (transportation) Wireless terminal equipment in safety), wireless terminal equipment in a smart city, and wireless terminal equipment in a smart home (smart home).
  • VR virtual reality
  • AR augmented reality
  • industrial control Wireless terminal equipment in industrial control, wireless terminal equipment in self-driving, wireless terminal equipment in remote medical, wireless terminal equipment in smart grid, transportation safety (transportation) Wireless terminal equipment in safety), wireless terminal equipment in a smart city, and wireless terminal equipment in a smart home (smart home).
  • the core network equipment 304 may be a mobility management entity (MME) in the LTE system, or a mobility management function (access and mobility management function, AMF) network element and session management function (session management function) in a 5G communication system. function, SMF) network element, which is not specifically limited.
  • MME mobility management entity
  • AMF access and mobility management function
  • SMF session management function
  • system architecture shown in FIG. 3 is mainly used as an example for introduction, but it is not limited to this.
  • the communication systems to which the above system architecture is applicable include but are not limited to: wideband code division multiple access (WCDMA), evolved universal terrestrial radio access network (E-UTRAN) Systems, long term evolution (LTE) systems, future 5th Generation (5G) systems, such as new radio access technology (NR), and future communication systems, such as 6G System and so on.
  • WCDMA wideband code division multiple access
  • E-UTRAN evolved universal terrestrial radio access network
  • LTE long term evolution
  • 5G future 5th Generation
  • NR new radio access technology
  • 6G System 6G System and so on.
  • FEC is a coding technology, an error control method, and a method to increase the credibility of data communication. It mainly means that the signal is pre-encoded according to a certain algorithm before being sent to the transmission channel, and the redundant code with the characteristics of the signal itself is added, and the received signal is decoded according to the corresponding algorithm at the receiving end, so as to find out in the transmission process Technology to generate error codes and correct them.
  • the precision clock synchronization protocol standard for network measurement and control systems (IEEE 1588 Precision Clock Synchronization Protocol), referred to as Precision Timing Protocol (PTP), is the main principle is to periodically communicate with all nodes in the network through a synchronization signal.
  • the clock is calibrated and synchronized, so that the Ethernet-based distributed system can achieve precise synchronization, which has the characteristics of easy configuration, fast convergence, and low consumption of network bandwidth and resources.
  • the IEEE 1588 clock synchronization technology described in the embodiments of this application can be applied to any multicast network.
  • a message is a data unit exchanged and transmitted in the network, that is, a data block to be sent by a station at one time.
  • the message contains the complete data information to be sent, its length is very inconsistent, and its length is unlimited and variable.
  • the messages mainly include sync synchronization messages, follow_up follow messages, delay_req delay request messages, delay_resp delay response messages, and so on.
  • the sync message is periodically sent from the master clock, and contains a time stamp used to accurately describe the expected sending time of the data packet sent by the master clock, where the expected sending time is not the actual sending time.
  • the follow_up message is sent from the master clock after determining the actual sending time of the sync synchronization message, and contains the actual sending time T1 for accurately describing the sync synchronization message sent by the master clock.
  • the slave clock may determine the time difference between the master clock and the slave clock (T2) according to the receiving time T2 of the sync synchronization message and the true sending time T1 in the follow_up message. -T1).
  • the calculated time difference at this time includes the delay caused by network transmission, so the Delay_Req message is used to define the network transmission delay.
  • the Delay_Req message is sent by the slave clock after the slave clock receives the Sync message.
  • the slave clock of the sender records the accurate sending time T3 of the Delay_Req message
  • the master clock of the receiver records the accurate reception time T4 of the Delay_Req message.
  • the master clock After receiving the Delay_Req message, the master clock records the accurate reception time T4 of the Delay_Req message, and then carries the T4 in the Delay_Resp message sent to the slave clock.
  • the T4 is notified to the slave clock, so that the slave clock calculates the network delay and clock error.
  • Reed-solomon codes a forward error correction channel coding
  • RS Reed-solomon codes
  • Retimer (Retimer) chip is mainly used to reconstruct the signal through the internal clock when the signal passes through the Retimer, so that the signal transmission energy is increased, and then the transmission is continued, which can reduce the jitter of the signal.
  • a timestamp is a complete verifiable data that can indicate that a piece of data has existed at a specific point in time. It mainly provides a piece of electronic evidence for the user to prove the generation time of some data of the user.
  • the time stamp is a credential document formed after encryption, which includes three parts: the abstract of the document to be time stamped; the date and time when the certification unit receives the document; and the digital signature of the certification unit.
  • the term "at least one" in the embodiments of the present application refers to one or more, and “multiple” refers to two or more than two.
  • “And/or” describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A , B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an "or” relationship.
  • the following at least one item (item) or similar expressions refer to any combination of these items, including any combination of single item (item) or plural items (item).
  • at least one item (a) of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple .
  • the main method when performing clock synchronization in the embodiment of the present application, is to compensate the transmission delay generated during the data format conversion of the data to the transmission time, and then perform clock synchronization according to the compensated transmission time. According to the different execution equipment for compensation, it can be divided into multiple situations, which will be introduced separately below.
  • the transmission time of the data sent by the first device to the second device is denoted as T1
  • the receiving time for the second device to receive the data is T2
  • the transmission delay generated by the data format conversion of the data is ⁇ t
  • the data without data format processing is referred to as the first data for short
  • the data format is performed on the first data.
  • the data obtained after processing is referred to as the second data for short.
  • the first device compensates the transmission time T1 according to the transmission delay ⁇ t generated during the data format conversion process of the transmission data.
  • the steps of clock synchronization in this application include:
  • the first device sends the first data to the conversion device, and records the sending time T1 for sending the first data.
  • the sending time T1 is specifically the time when the first device sends the data of position A in the first data .
  • the first device may carry the first data in a sync packet, that is, the first device sends a sync packet that carries the first data to the conversion device.
  • the conversion device performs data format conversion on the first data to generate second data.
  • the conversion device sends the second data to the second device.
  • the second device receives the second data, and records a time T2 when the second data is received.
  • the receiving time T2 is specifically the data at position A in the second data received by the second device time.
  • the first device determines, according to the first data and the second data, a delay jitter ⁇ t generated during a data format conversion process.
  • the first device may determine the ⁇ t according to the data transmission rate of the first data and the data transmission rate of the second data.
  • the first device may determine the data transmission rate of the first data according to the first data to be sent, and the first device may determine the transmission of the second data according to the data conversion rule of the conversion device rate.
  • the first device in the embodiment of the present application may determine the transmission delay ⁇ t according to the transmission rate of the first data and the transmission rate of the second data.
  • the ⁇ t determined by the first device is the data transmission time of position A in the first data and the second The difference in the sending time of the position A data in the data.
  • FEC technology is selected to implement the data format conversion of the first data for detailed introduction. It should be noted that other methods that can change the data format are applicable to the embodiments of this application. .
  • the first data format is RS(528,514), the data transmission rate based on 100GE port is 4*25.78125Gbps; the second data format is RS(544,514), the data transmission rate based on 100GE port is 4*26.5625 Gbps; and the transmission start bit of the first data and the second data are the same, for example, the first data start bit and the second data start bit are both bit0, then the first data The delay jitter between the start bit and the second data start bit is zero.
  • the delay jitter generated by the data format conversion of the 3000th bit of the transmission data can be determined.
  • Y (Gbps) represents the data transmission rate of the first data
  • Z (Gbps) represents the data transmission rate of the second data
  • X represents the bit used as a time stamp reference
  • A represents the 0 ⁇ X bit corresponding
  • A represents data with a length of 1 bit
  • A represents data with a length of 2 bits
  • A represents data with a length of 3001 bits
  • ⁇ t represents data with a length of 3001 bits.
  • Delay jitter caused by data format conversion of a data.
  • any method of determining the transmission delay generated by the transmission data format conversion applicable to the embodiment of this application belongs to the protection scope of this application. .
  • the first device also determines the direction of the ⁇ t, that is, the positive or negative of the ⁇ t, so as to determine whether the delay is increased or decreased after the data format processing is performed according to the direction of the ⁇ t.
  • S405 The first device compensates the T1 according to ⁇ t to obtain the second time T1'.
  • the transmission delay ⁇ t determined by the first device is increased In 5 ns, the first device sends a sync packet to the second device through the conversion device at 1:00 (that is, the T1). The second device receives the sync message at 1:15 (that is, the T2).
  • the first device determines that the generated transmission delay ⁇ t is reduced by 2ns, and the first device is at 1: 02 (that is, the T1) sends a sync message to the second device through the conversion device.
  • the second device receives the sync message at 1:00 (that is, the T2).
  • the first device sends a first message (for example, a follow_up message) to the second device, where the first message is used to indicate the second time T1'.
  • a first message for example, a follow_up message
  • the foregoing step S404 may be omitted in the embodiment of the present application, that is, the first device does not need to compensate the T1 according to the ⁇ t to obtain the second time T1'.
  • the first device may directly carry the T1 and the ⁇ t in the first message and send it to the second device, so that after the second device obtains the first message, the The T1 and the ⁇ t in the first message are determined by themselves.
  • S407 The second device receives the first message, and obtains the T1' in the first message.
  • the second device obtains the first message, and then according to the T1 and the ⁇ t in the first message The ⁇ t determines T1' by itself.
  • the second device sends a second message (for example, a Delay_Req message) to the first device, and records the sending time T3 of the second message.
  • a second message for example, a Delay_Req message
  • S409 The first device receives the second message, and records the time T4 when the second message is received.
  • the first device sends a third message (for example, a delay_resp message) to the second device, where the third message includes the T4.
  • a third message for example, a delay_resp message
  • S411 The second device receives the third message, and obtains the T4 in the third message.
  • S412 The second device performs clock synchronization with the first device according to the T1', T2, T3, and T4.
  • the first device and the second device implement time synchronization through the IEEE1588 protocol in the embodiment of the present application, it is necessary to determine the time difference Offset and the path transmission delay between the first device and the second device. Time Delay, so that the second device realizes time synchronization with the first device according to the calculated time difference Offset and path transmission delay Delay.
  • the second device performs calculation according to the following formula 3 and formula 4:
  • T2 in the formula 3 represents the time when the second device receives the transmission data sent by the first device
  • T1 represents the time when the first device actually sends the transmission data
  • offset represents the time between the first device and the first device.
  • the time difference between the devices during the communication between the two devices, and the Delayms represents the network path transmission delay when the first device transmits data to the second device.
  • T3 represents the time when the second device sends the delay request message to the first device
  • T4 represents the time when the first device receives the delay request message
  • -offset represents the second device and the first device.
  • the time difference between the devices during the communication and transmission of the devices, and the Delaysm represents the network path transmission delay when the second device transmits data to the first device.
  • the transmission time of the transmission data calculated by the second device into the formula 3 should be the compensated time, that is, T1' .
  • the transmission delay ⁇ t will also occur during the actual data transmission process. Because the embodiment of this application compensates for the T1 according to the ⁇ t in advance, therefore, the embodiment of this application will subsequently perform clock synchronization. , Then the interference of the ⁇ t to the clock synchronization can be reduced.
  • the Offset contains ⁇ t, see the following formula 6:
  • Offset [(T2-T1+ ⁇ t)-(T4-T3)-(Delayms+ ⁇ t-Delaysm)]/2
  • the alignment mark (AM) in the data is the same as that of the second device.
  • the relative position of the data in the data remains unchanged, that is, the first device transparently transmits the data that needs to be transmitted to the second device.
  • the network path transmission delay mainly includes the path delay d and the transmission delay ⁇ t generated during the data format conversion process.
  • the first device converts the transmission data
  • the path delay d is also fixed. Therefore, during the data transmission process, that is, only the fixed path delay d of the path transmission needs to be determined, the accuracy of the first device clock synchronization by the second device can be effectively guaranteed.
  • Compensation execution device 2 The second device compensates the transmission time T1 according to the transmission delay ⁇ t generated during the data format conversion process of the data.
  • the steps of clock synchronization in this application include:
  • the first device sends the first data to the conversion device, and records the time T1 when the first data is sent.
  • the conversion device performs data format processing on the first data to generate second data.
  • the conversion device sends the second data to the second device.
  • the second device receives the second data, and records a time T2 when the second data is received.
  • the second device determines the transmission delay generated during the format conversion process of the data of the second data recording time stamp.
  • the second device in the embodiment of the present application may determine the first data according to the data format conversion rule of the conversion device and the second data, and then determine the first data according to the The first data and the second data determine the transmission delay ⁇ t.
  • the first device also determines the direction of the ⁇ t, that is, the positive or negative of the ⁇ t, so as to determine whether the delay is increased or decreased after the data format processing is performed according to the direction of the ⁇ t.
  • the first device sends a first message (for example, a follow_up message) to the second device, where the first message is used to indicate the T1.
  • a first message for example, a follow_up message
  • S706 The second device receives the first message, and obtains the T1 in the first message.
  • the second device compensates the T1 according to the ⁇ t, and determines a compensated T1'.
  • the second device sends a second message (for example, a Delay_Req message) to the first device, and records the sending time T3 of the second message.
  • a second message for example, a Delay_Req message
  • the first device receives the second message, and records a time T4 when the second message is received.
  • the first device sends a third message (for example, a delay_resp message) to the second device, where the third message includes the T4.
  • a third message for example, a delay_resp message
  • the second device receives the third message, and obtains the T4 in the third message.
  • S712 The second device performs clock synchronization with the first device according to the T1', T2, T3, and T4.
  • step S412 For the specific clock synchronization method, refer to the above step S412, which will not be repeated here.
  • the above-mentioned realization devices include hardware structures and/or software modules corresponding to the respective functions.
  • the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.
  • a first device for clock synchronization provided for this application, the first device includes a processor 800, a memory 801, and a communication interface 802.
  • the processor 800 is responsible for managing the bus architecture and general processing, and the memory 801 can store data used by the processor 800 when performing operations.
  • the transceiver communication interface 802 is used to receive and send data under the control of the processor 800 for data communication with the memory 801.
  • the processor 800 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the processor 800 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • the memory 701 may 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 various media that can store program codes.
  • the processor 800, the memory 801, and the communication interface 802 are connected to each other.
  • the processor 800, the memory 801, and the communication interface 802 may be connected to each other through a bus 803; the bus 803 may be a peripheral component interconnect (PCI) bus or an extended industry Standard structure (extended industry standard architecture, EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used in FIG. 8, but it does not mean that there is only one bus or one type of bus.
  • the processor 800 is configured to read a program in the memory 801 and execute:
  • Send the first data stamp the first data with a timestamp, determine the data position of the data corresponding to the timestamp in the first data, and send the first data corresponding to the timestamp Time; according to the data position, determine the transmission delay of the data of the data position in the format conversion process; send a first message to the second device, the first message is used to indicate the second time, so The second time is the time after the first time is compensated according to the transmission delay; the second message sent by the second device is received at the third time; the third message is sent to the second device, The third message includes the third time, so that the second device communicates with the first device according to the second time, the third time, and the fourth time when the second message is sent. Clock synchronization between.
  • the first message includes the first time and the transmission delay, so that the second device compensates for the first time according to the transmission delay to obtain The second time; or the first message includes the second time.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data does not change.
  • the present invention provides a first device for clock synchronization.
  • the device includes a processing unit 900 and a communication unit 901:
  • the communication unit 901 is configured to send the first data
  • the processing unit 900 is configured to stamp the first data with a time stamp, determine the data position of the data corresponding to the time stamp in the first data, and send the first data corresponding to the time stamp. One time; according to the data location, determine the transmission delay of the data at the data location during the format conversion process;
  • the communication unit 901 is configured to send a first message to the second device, where the first message is used to indicate a second time, and the second time is to perform a calculation on the first time according to the transmission delay. Time after compensation; receive the second message sent by the second device at the third time; send a third message to the second device, the third message contains the third time, so that the second The device performs clock synchronization with the first device according to the second time, the third time, and the fourth time when the second message is sent.
  • an embodiment of the present application also provides a second device for clock synchronization.
  • the device includes a processor 1000, a memory 1001, and a communication interface 1002.
  • the processor 1000 is responsible for managing the bus architecture and general processing, and the memory 1001 can store data used by the processor 1000 when performing operations.
  • the transceiver communication interface 1002 is used to receive and send data under the control of the processor 1000 for data communication with the memory 1001.
  • the processor 1000 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the processor 1000 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (generic array logic, GAL), or any combination thereof.
  • the memory 1001 may 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 various media that can store program codes.
  • the processor 1000, the memory 1001, and the communication interface 1002 are connected to each other.
  • the processor 1000, the memory 1001, and the communication interface 1002 may be connected to each other through a bus 1003; the bus 1003 may be a peripheral component interconnect (PCI) bus or an extended industry Standard structure (extended industry standard architecture, EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of representation, only one thick line is used to represent in FIG. 10, but it does not mean that there is only one bus or one type of bus.
  • the processor 1000 is configured to read a program in the memory 1001 and execute:
  • Receive the second data sent by the conversion device receive the first message sent by the first device, the first message is used to indicate the second time; the second time is after the first time is compensated according to the transmission delay
  • the transmission delay is generated during the format conversion process of the time-stamped data in the first data, and the first time is the transmission time for the first device to send the data corresponding to the time-stamp Send a second message to the first device at the fourth time; the second device receives a third message sent by the first device, and the third message contains that the first device receives the second message
  • the third time of the message; the clock synchronization with the first device is performed according to the second time, the third time, and the fourth time.
  • the processor 1000 is further configured to:
  • the second device determines the second time according to the transmission delay and the first time included in the first message.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data remains unchanged.
  • the present invention provides a second device for clock synchronization.
  • the device includes: a processing unit 1100 and a communication unit 1101:
  • the communication unit 1101 is configured to receive second data sent by the conversion device; receive a first message sent by the first device, where the first message is used to indicate a second time; the second time is based on the transmission delay When the first time is compensated for, the transmission delay is generated during the format conversion process of the time-stamped data in the first data, and the first time is for the first device to send the The sending time of the data corresponding to the timestamp; sending a second message to the first device at the fourth time; receiving a third message sent by the first device, the third message including the first device received The third time of the second message;
  • the processing unit 1100 is configured to perform clock synchronization with the first device according to the second time, the third time, and the fourth time.
  • an embodiment of the present application also provides another clock-synchronized second device.
  • the device includes a processor 1200, a memory 1201, and a communication interface 1202.
  • the processor 1200 is responsible for managing the bus architecture and general processing, and the memory 1201 can store data used by the processor 1200 when performing operations.
  • the transceiver communication interface 1202 is used for receiving and sending data under the control of the processor 1200 for data communication with the memory 1201.
  • the processor 1200 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the processor 1200 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
  • the memory 1201 may 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 various media that can store program codes.
  • the processor 1200, the memory 1201, and the communication interface 1202 are connected to each other.
  • the processor 1200, the memory 1201, and the communication interface 1202 may be connected to each other through a bus 1203; the bus 1203 may be a peripheral component interconnect (PCI) bus or an extended industry Standard structure (extended industry standard architecture, EISA) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and so on. For ease of presentation, only one thick line is used to represent in FIG. 12, but it does not mean that there is only one bus or one type of bus.
  • the processor 1200 is configured to read a program in the memory 1201 and execute:
  • Receive the second data sent by the conversion device determine the transmission delay of the time-stamped data in the second data during the format conversion process; receive the first message sent by the first device, the first message containing The first time; send a second message to the first device at the fourth time; receive a third message sent by the first device, the third message including the first device received the second message The third time of the message; perform clock synchronization with the first device according to the first time, the transmission delay, the third time, and the fourth time.
  • the processor 1200 is further configured to:
  • the second device compensates for the first time according to the transmission delay to obtain a second time; the second device performs a comparison with the second time, the third time, and the fourth time
  • the clocks between the first devices are synchronized.
  • the first message is a follow_up message; the second message is a delay request Delay_req message; and the third message is a delay response Delay_Resp message.
  • the relative position of the alignment mark in the second data and the data in the second data remains unchanged.
  • another first device for clock synchronization includes: a processing unit 1300 and a communication unit 1301:
  • the communication unit 1301 is configured to receive the second data sent by the conversion device
  • the processing unit 1300 is configured to determine the transmission delay of the time stamped data in the second data during the format conversion process
  • the communication unit 1301 is configured to receive a first message sent by the first device, where the first message includes the first time; send a second message to the first device at a fourth time; receive the A third message sent by the first device, where the third message includes the third time when the first device received the second message; according to the first time, the transmission delay, and the third time Synchronize with the clock between the first device and the fourth time.
  • various aspects of the clock synchronization method provided in the embodiments of the present invention may also be implemented in the form of a program product, which includes program code.
  • program code runs on a computer device
  • the program code is used to make the computer device execute the steps in the clock synchronization method according to various exemplary embodiments of the present invention described in this specification.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. Modifications of the readable storage medium.
  • Examples (non-exhaustive list) in one implementation of the embodiments of the present application include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only Memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • RAM random access memory
  • ROM read-only Memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device magnetic storage device, or any suitable combination of the above.
  • the program product for clock synchronization may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may run on a server device.
  • CD-ROM portable compact disk read-only memory
  • the program product of the present invention is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an information transmission, device, or device.
  • the readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with a periodic network action system, apparatus, or device.
  • the program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
  • the program code used to perform the operations of the present invention can be written in any combination of one or more programming languages.
  • the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural styles. Programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
  • the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device.
  • LAN local area network
  • WAN wide area network
  • the embodiment of the present application also provides a computing device readable storage medium for the clock synchronization method, that is, the content is not lost after a power failure.
  • the storage medium stores a software program, including program code.
  • the program code runs on a computing device, the software program can implement any of the above embodiments of the present application when it is read and executed by one or more processors.
  • the scheme of clock synchronization is not limited to, the clock synchronization method, that is, the content is not lost after a power failure.
  • this application can also be implemented by hardware and/or software (including firmware, resident software, microcode, etc.).
  • this application may take the form of a computer program product on a computer-usable or computer-readable storage medium, which has a computer-usable or computer-readable program code implemented in the medium to be used or used by the instruction execution system. Used in conjunction with the instruction execution system.
  • a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or transmit a program for use by an instruction execution system, apparatus, or device, or in combination with an instruction execution system, Device or equipment use.

Landscapes

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

Abstract

一种时钟同步方法及装置,用以解决时间同步不准确的问题。该方法包括:第一设备发送第一数据,在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的位置,以及发送所述时间戳对应的数据的第一时间;确定所述位置的数据在格式转换过程中产生的传输延时;向所述第二设备发送第一消息,所述第一消息指示对所述第一时间补偿后的时间;在第三时间接收所述第二设备发送的第二消息;向所述第二设备发送包含所述第三时间的第三消息,以使所述第二设备进行时钟同步。该方法通过确定的传输延时预先进行补偿,有效解决了传输数据进行数据格式转换对时钟同步带来的影响,提高了时间同步的精确性。

Description

一种时钟同步方法及装置 技术领域
本发明涉及无线通信技术领域,特别涉及一种时钟同步方法及装置。
背景技术
为了提高数据的传输效率,数据的发送方和接收方之间需要进行数据时钟同步。目前主要基于网络测量和控制***的精密时钟同步协议标准(IEEE1588协议)进行设备之间时钟同步。
如图1所示,数据发送方与数据接收方具体的时钟同步过程如下:
所述数据发送方向所述数据接收方进行数据传输时,向所述数据接收方发送携带数据的同步(sync)报文,所述数据接收方记录接收到所述sync报文的接收时间T2。然后,所述数据发送方向所述数据接收方发送携带数据发送的真实时间T1的跟随(follow_up)报文,所述数据接收方获取所述follow_up报文中的所述T1。其中,所述数据接收方在接收到所述Sync报文后,向所述数据发送方发送延迟请求(Delay_req)报文,并记录下发送所述Delay_req报文的发送时间T3。所述数据发送方在接收到所述Delay_Req报文后,记录所述Delay_Req报文准确的接收时间T4,然后向所述数据接收方发送携带所述T4的延迟响应(Delay_Resp)报文,所述数据接收方获取所述Delay_Resp报文中的所述T4。从而,所述数据接收方基于IEEE1588协议,根据四个时间点T1、T2、T3和T4,确定所述数据发送方与所述数据接收方的时间差以及数据传输过程的路径延时。所述数据接收方根据确定的所述时间差以及所述路径延时实现所述数据发送方与所述数据接收方间的时钟同步。
但是,在通信业务中,所述数据发送方进行数据传输时,经常需要对传输数据的数据格式进行处理。例如,当所述数据发送方与所述数据接收方采用时钟数据恢复(Clock data recovery,CDR)***进行数据传输时,一般采用前向纠错编码技术(Forward error correction,FEC)对传输数据进行数据格式处理。而所述传输数据的数据格式变化会产生较大的延时抖动。
目前现有技术无法针对数据进行数据格式变化时,实现所述数据发送方与所述数据接收方之间的精确时钟同步,进而降低了所述数据发送方与所述数据接收方之间的数据传输效率。
发明内容
本申请实施例提供一种时钟同步方法及装置,用于解决现有技术中存在数据格式处理时,时钟同步不够精准的问题。
第一方面,本申请实施例提供一种时钟同步的方法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,包括:
所述第一设备发送所述第一数据,在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的数据位置,以及发送所述时间戳对应的数据的第一时间; 所述第一设备根据所述数据位置,确定所述数据位置的数据在格式转换过程中产生的传输延时;所述第一设备向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;所述第一设备在第三时间接收所述第二设备发送的第二消息;所述第一设备向所述第二设备发送第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
基于该方案,在通信传输过程中,第一设备确定传输数据进行数据格式转换过程中产生的传输延时以及发送所述第一数据中记录时间戳的数据的第一时间,然后根据所述传输延时和所述第一时间指示所述第二设备用于进行时钟同步的第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间,从而使所述第二设备根据补偿后的发送时间进行时钟同步,有效解决了传输数据进行数据格式转换过程中产生的延时抖动,对时钟同步带来的影响,提高了时间同步的精确性。
在一种可能的实现方式中,所述第一消息包含所述第一时间和所述传输延时,以使所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;或所述第一消息包含所述第二时间。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方式中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
第二方面,本申请实施例提供一种时钟同步的法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,包括:
第二设备接收转换设备发送的第二数据;所述第二设备接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;所述第二设备在第四时间向所述第一设备发送第二消息;所述第二设备接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;所述第二设备根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
基于该方案,在通信传输过程中,所述第二设备接收所述第一设备发送的指示第二时间的第一消息,所述第二时间为根据传输延时对所述第一时间进行补偿后的时间,从而所述第二设备根据补偿后的发送时间进行时钟同步,有效解决了传输数据进行数据格式转换过程中产生的延时抖动,对时钟同步带来的影响,提高了时间同步的精确性。
在一种可能的实现方式中,所述第二设备根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步之前,还包括:所述第二设备根据所述第一消息中包含的所述传输延时和所述第一时间,确定所述第二时间。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方式中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
第三方面,本申请实施例提供一种时钟同步的法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,包括:
第二设备接收转换设备发送的第二数据;所述第二设备确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;所述第二设备接收所述第一设备发送的第一消息,所述第一消息包含所述第一时间;所述第二设备在第四时间向所述第一设备发送第二消息;所述第二设备接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;所述第二设备根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
基于该方案,在通信传输过程中,第二设备确定数据进行数据格式转换过程中产生的传输延时,然后根据所述传输延时对接收到的来自第一设备的第一时间进行补偿,得到第二时间,从而根据所述第二时间进行时钟同步,有效解决了传输数据进行数据格式处理对时钟同步带来的影响,提高了时间同步的精确性。
在一种可能的实现方式中所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;所述第二设备根据所述第二时间、所述第三时间、所述第四时间进行与所述第一设备之间的时钟同步。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方式中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
第四方面,本申请实施例提供一种通信装置,该通信装置具有实现上述实施例中的第一方面至第三方面中的设备的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的单元或模块。
在一种可能的实现方式中,该通信装置可以是上述第一方面中的所述第一设备,或者是可用于所述第一设备的部件,例如芯片或芯片***或者电路,该通信装置可以包括:收发器和处理器。该处理器可被配置为支持该通信装置执行以上所述第一设备的相应功能,该收发器用于支持该通信装置与其他设备(例如第二设备)等之间的通信。可选地,该通信装置还可以包括存储器,该存储器可以与处理器耦合,其保存该通信装置必要的程序指令和数据。其中,收发器可以为独立的接收器、独立的发射器、集成收发功能的收发器、或者是接口电路。
另一种可能的实现方式中,该通信装置可以是上述第二方面或者第三方面中的所述第二设备,或者是可用于所述第二设备的部件,例如芯片或芯片***或者电路,该通信装置可以包括:收发器和处理器。该处理器可被配置为支持该通信装置执行以上所述第二设备的相应功能,该收发器用于支持该通信装置与其他设备(例如第一设备)等之间的通信。可选地,该通信装置还可以包括存储器,该存储器可以与处理器耦合,其保存该通信装置必要的程序指令和数据。其中,收发器可以为独立的接收器、独立的发射器、集成收发功能的收发器、或者是接口电路。
第五方面,本申请实施例提供一种通信装置,用于实现上述第一方面或第一方面中的任意一种方法。
在一种可能的实施方式中,该通信装置为第一设备时,可以包括:处理单元和通信单 元:
所述通信单元,用于发送所述第一数据;
所述处理单元,用于在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的数据位置,以及发送所述时间戳对应的数据的第一时间;根据所述数据位置,确定所述数据位置的数据在格式转换过程中发生产生的传输延时;
所述通信单元,用于向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;在第三时间接收所述第二设备发送的第二消息;向所述第二设备发送第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
第六方面,本申请实施例提供一种通信装置,用于实现上述第二方面或第二方面中的任意一种方法。
在一种可能的实施方式中,该通信装置为第二设备时,可以包括:处理单元和通信单元:
所述通信单元,用于接收转换设备发送的第二数据;接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;
所述处理单元,用于根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
第七方面,本申请实施例提供一种通信装置,用于实现上述第三方面或第三方面中的任意一种方法。
在一种可能的实施方式中,该通信装置为第二设备时,可以包括:处理单元和通信单元:
所述通信单元,用于接收转换设备发送的第二数据;
所述处理单元,用于确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;
所述通信单元,用于接收所述第一设备发送的第一消息,所述第一消息包含所述第一时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
第八方面,本申请实施例提供一种通信***,该通信***包括第一设备和第二设备。其中,所述第一设备可以用于执行上述第一方面中任意一面;或者执行上述第一方面中的任意一种方法;
所述第二设备用于执行上述第二方面或第三方面中任意一面;或者用于执行上述第一方面或第三方面中的任意一种方法。
第九方面,本申请提供了一种芯片***,包括处理器。可选地,还可包括存储器,存储器用于存储计算机程序,处理器用于从存储器中调用并运行计算机程序,使得安装有芯片***的通信装置执行上述第一方面至第三面中任意一面;或者执行上述第一方面至第三方面中的任意一种方法。
第十方面,本申请实施例提供一种计算机存储介质,计算机存储介质中存储有指令,当其在通信装置上运行时,使得该通信装置执行上述第一方面至第三方面中任意一面;或执行上述第一方面至第三方面中的任意一种方法。
第十一方面,本申请实施例提供一种包含指令的计算机程序产品,当其在通信装置上运行时,使得该通信装置执行上述第一方面至第三方面中任意一面;或执行上述第一方面至第三方面中的任意一种方法。
附图说明
图1为现有基于IEEE1588发送设备与接收设备之间报文传送示意图;
图2为现有进行数据传输过程中时间戳标记方式示意图;
图3为本申请实施例提供的一种***架构示意图;
图4为本申请实施例提供的一种时间同步方法对应的流程示意图;
图5为本申请实施例提供的进行FEC编码确定传输延时示意图;
图6为本申请实施例提供的对发送时间T1补偿示意图;
图7为本申请实施例提供的另一种时钟同步方法对应的流程示意图;
图8为本申请实施例提供的第一种第一设备的结构示意图;
图9为本申请实施例提供的第二种第一设备的结构示意图;
图10为本申请实施例提供的第一种第二设备的结构示意图;
图11为本申请实施例提供的第二种第二设备的结构示意图;
图12为本申请实施例提供的第三种第二设备的结构示意图;
图13为本申请实施例提供的第四种第二设备的结构示意图。
具体实施方式
下面结合说明书附图对本申请进行具体说明。
在通信业务中,所述数据发送方进行数据传输时,为了提高数据传输效率,降低误码率,经常需要对传输数据的数据格式进行转换。例如,当所述数据发送方与所述数据接收方采用CDR/Retimer***进行数据传输时,一般采用FEC编码技术对传输数据进行数据格式转换。而所述传输数据的数据格式转换会产生较大的延时抖动,其中,本申请实施例中将数据格式转换产生的延时抖动称为传输延时。
例如,如图2所示,假设数据传输过程中,以所述传输数据中的位置A的数据作为时间戳的基准,即所述发送设备将所述位置A的数据的发送时间,作为所述传输数据的发送时间。
情况1:第一设备向第二设备传输的数据不需要进行数据格式转换。
例如第一设备将所述需要传输的数据直接发送给所第二设备,则所述第一设备将携带所述传输数据的sync报文发送给第二设备,在所述传输数据中打上时间戳,并确定所述时 间戳对应的数据在所述传输数据中的数据位置以及发送所述时间戳对应的数据的第一时间。所述第二设备记录接收到所述sync报文的时间为1:10(即时间T2)。
假设,所述第一设备确定所述位置A数据的发送时间为1:00,则所述第一设备根据所述发送时间1:00,确定打入follow_up报文中的时间戳为1:00,即所述第一设备确定所述位置A数据的发送时间后,根据所述发送时间生成时间戳,将所述时间戳携带在所述follow_up报文中。所述第一设备向所述第二设备发送所述follow_up报文。所述第二设备接收所述follow_up报文,获取所述follow_up报文中的时间戳1:00(即时间T1)。
由此,所述第二设备根据下述公式1以及知晓的所述T1和所述T2,可以得出所述第一设备与第二设备的时间差Offset与网络传输延时Delay之和。
T2-T1=offset+Delay  公式1
其中,将所述T1为1:00,所述T2为1:10代入上述公式1可以确定所述Offset与所述Delay之和为10。
其中,本申请实施例中所述的“在所述传输数据中打上时间戳”,其实是指第一设备在确定所述位置A的数据的发送时间后,生成一个凭证文档(即时间戳),通过所述时间戳可以知道所述位置A的数据的发送时间。进一步的,所述第一设备可以将所述凭证文档(即所述时间戳)记录在所述follow_up报文中,并将所述follow_up报文发送给所述第二设备,从而使所述第二设备获取所述位置A的数据的发送时间。
需要说明的是,上述对“在所述传输数据中打上时间戳”的解释,并不作为本申请实施例的限定。因在通信传输过程中,经常通过打时间戳的方式来确定或证明某些事件的产生时间,所以本领域技术人员可以理解本申请实施例中所述的“所述第一设备在所述传输数据中打上时间戳”的含义。
情况2:所述第一设备向所述第二设备传输的数据需要进行数据格式转换。
例如所述第一设备将携带所述传输数据的sync报文通过转换设备(例如,所述转换设备为CDR/Retimer)发送给所述第二设备,其中,所述传输数据在所述转换设备中进行数据格式转换。
所述第一设备确定所述传输数据(即所述位置A的数据)的发送时间,假设,所述传输数据的发送时间为1:00,则所述第一设备根据所述发送时间1:00,确定打入follow_up报文中的时间戳为1:00。然后,所述第一设备向所述第二设备发送所述follow_up报文。所述第二设备接收所述follow_up报文,获取所述follow_up报文中的时间戳1:00(即时间T1)。
但是,所述传输数据在所述转换设备进行数据格式转换会产生传输延时,假设,所述转换设备对所述传输数据进行数据格式转换产生的传输延时为5分钟。因此,所述第二设备记录接收到所述sync报文的时间为1:15(即时间T2)。
由此,所述第二设备根据上述公式1以及知晓的所述T1和所述T2,可以得出所述第一设备与第二设备的时间差Offset与网络传输延时Delay之和。
其中,将所述T1为1:00,所述T2为1:15代入上述公式1可以确定所述Offset与所述Delay之和为15。
明显的,通过上述情况1以及情况2的介绍,可以知道,在情况2中确定的所述Offset与所述Delay之和,并不是真实的第一设备与第二设备进行数据传输过程中的Offset与Delay之和,因此,所述第二设备基于情况2中得到的Offset与Delay,进行与第一设备的 时钟同步会产生较大的误差,无法实现精确的时钟同步。
因此,现有技术在传输的数据需要进行数据格式处理时,无法精确的实现第一设备与第二设备间的时钟同步,进而降低了所述第一设备与所述第二设备之间的数据传输效率。
另一方面,当通过编码技术进行数据格式转换时,可以根据类似下述表1对FEC编码产生的延迟抖动进行补偿。但是,目前现有技术中提供的FEC编码产生的延迟时间为可能产生的最大的延迟时间。假设,选取所述表1中FEC(528,541)为例,可知当端口为25时,可能产生的传输延时最大值为5.6ns。而在每次数据传输过程中,是以传输数据中的某个位置的数据作为基准确定时间戳的,而该位置的数据进行数据格式转换产生的传输延时不一定为5.6ns,并且,现有技术无法在时钟同步过程中,针对具***置的数据进行补偿,依旧存在时钟同步误差较大,无法实现精确的时钟同步的问题。
FEC算法 端口 校验bit 不确定性的传输延时(ns)
(528,514) 25 140 5.6
(528,514) 100 140 1.4
(544,514) 50 300 6
(544,514) 100 300 3
(544,514) 200 300 1.5
(544,514) 400 300 0.75
表1 FEC编码产生的不确定性的传输延时
其中,为解决上述问题,本申请实施例提供一种时钟同步的方法,本申请实施例的技术方案可以应用于各种通信***,例如:长期演进(long term evolution,LTE)***,全球互联微波接入(worldwide interoperability for microwave access,WiMAX)通信***,未来的第五代(5th Generation,5G)***,如新一代无线接入技术(new radio access technology,NR),及未来的通信***,如6G***等。
以5G***(也可以称为New Radio***)为例,具体来说,为了精确解决数据格式转换过程所产生的传输延时的问题,本申请实施例中确定传输数据进行数据格式转换产生的传输延时,并将所述传输延时补偿到第一设备向第二设备发送数据的发送时间中,例如发送时间T1。通过该方法,所述第二设备在进行与第一设备之间的时钟同步时,用于进行时钟同步的发送时间T1为补偿后的时间,已经消除了所述传输数据进行数据格式转换产生的传输延时,从而有效解决了传输数据进行数据格式转换过程对时钟同步带来的影响,提高了时间同步的精确性。
需要说明的是,本申请实施例中的时间同步也可以称为时钟同步。
图3为本申请实施例适用的一种***架构示意图。如图3所示,该***架构中包括一个或多个第一设备301,例如gNB、eNodeB或者WLAN接入点,一个或多个第二设备302,一个或多个转换设备303(例如CDR/Retimer),以及核心网304。
本申请实施例中,第一设备301可以包括:基站收发台(Base Transceiver Station),无线收发器,一个基本服务集(Basic Service Set,BSS),一个扩展服务集(Extended Service Set,ESS),NodeB,eNodeB,gNB等等。
其中,该***架构中可以包括几种不同类型的第一设备301,例如宏基站(macro base  station)、微基站(micro base station)等。第一设备301可以应用不同的无线技术,例如小区无线接入技术,或者WLAN无线接入技术。
第二设备302可以是一种具有无线收发功能的设备,可以部署在陆地上,包括室内或室外、手持或车载;也可以部署在水面上(如轮船等);还可以部署在空中(例如飞机、气球和卫星上等)。所述终端设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端设备、无人驾驶(self driving)中的无线终端设备、远程医疗(remote medical)中的无线终端设备、智能电网(smart grid)中的无线终端设备、运输安全(transportation safety)中的无线终端设备、智慧城市(smart city)中的无线终端设备、智慧家庭(smart home)中的无线终端设备等。
核心网设备304可以为LTE***中的移动性管理实体(mobility management entity,MME),或者5G通信***中的移动性管理功能(access and mobility management function,AMF)网元和会话管理功能(session management function,SMF)网元,具体不做限定。
本申请实施例中主要以图3所示意的***架构为例进行介绍,但并不限于此。
上述***架构适用的通信***包括但不限于:宽带码分多址移动通信***(wideband code division multiple access,WCDMA),演进的全球陆地无线接入网络(evolved universal terrestrial radio access network,E-UTRAN)***,长期演进(long term evolution,LTE)***,未来的第五代(5th Generation,5G)***,如新一代无线接入技术(new radio access technology,NR),及未来的通信***,如6G***等。
以下再对本申请实施例中涉及的部分用语进行解释说明,以便于理解。
1)FEC,是一种编码技术,是一种差错控制方式,增加数据通讯可信度的方法。主要指信号在被送入传输信道之前预先按一定的算法进行编码处理,加入带有信号本身特征的冗码,在接收端按照相应算法对接收到的信号进行解码,从而找出在传输过程中产生的错误码并将其纠正的技术。
2)网络测量和控制***的精密时钟同步协议标准(IEEE 1588 Precision Clock Synchronization Protocol),简称精确时间协议(Precision Timing Protocol,PTP),主要原理是通过一个同步信号周期性的对网络中所有节点的时钟进行校正同步,从而可以使基于以太网的分布式***达到精确同步,具有容易配置、快速收敛以及对网络带宽和资源消耗少等特点。其中,本申请实施例中所述IEEE 1588时钟同步技术可以应用于任何组播网络中。
3)报文,是网络中交换与传输的数据单元,即站点一次性要发送的数据块。报文包含了将要发送的完整的数据信息,其长短很不一致,长度不限且可变。
其中,在IEEE1588时间同步***中,报文主要包括sync同步报文、follow_up跟随报文、delay_req延迟请求报文、delay_resp延迟响应报文等。所述sync同步报文是从主时钟周期性发出的,包含了用于精确描述所述主时钟发出数据包的预计发出时间的时间戳,其中,所述预计发出时间并不是真实发出时间。
所述follow_up跟随报文,是从所述主时钟在确定所述sync同步报文真实发出时间后发出的,包含了用于精确描述所述主时钟发出所述sync同步报文真实发出时间T1。所述从时钟可根据接收到所述sync同步报文的接收时间T2以及所述follow_up跟随报文中的所述真实发出时间T1,确定所述主时钟与所述从时钟之间的时间差(T2-T1)。
但是此时计算出的时差包含了网络传输造成的延时,所以使用Delay_Req报文来定义网络的传输延时。
所述Delay_Req报文是在所述从时钟接收到所述Sync报文后由从时钟发出,与所述Sync报文一样,发送方所述从时钟记录所述Delay_Req报文准确的发送时间T3,接收方所述主时钟记录所述Delay_Req报文准确的接收时间T4。所述主时钟在接收到所述Delay_Req报文后,记录所述Delay_Req报文准确的接收时间T4,然后将所述T4携带在发送给从时钟的Delay_Resp报文中,通过所述Delay_Resp报文将所述T4通知给所述从时钟,从而使所述从时钟计算出网络延时和时钟误差。
4)里所码(Reed-solomon codes,RS),是一种前向纠错的信道编码,对由校正过采样数据所产生的多项式有效。当接收器正确的收到足够的点后,它就可以恢复原来的多项式,即使接收到的多项式上有很多点被噪声干扰失真,也可以通过实现恢复。
5)重定时(Retimer)芯片,主要用于信号在经过Retimer的时候,通过内部的时钟重构信号,使其信号传输能量增加,然后再继续传输,可以减轻信号的抖动。
6)时间戳,是一份能够表示一份数据在一个特定时间点已经存在的完整的可验证的数据,主要为用户提供一份电子证据,以证明用户的某些数据的产生时间。
一般情况下,时间戳为一个经加密后形成的凭证文档,它包括三个部分:需加时间戳的文件的摘要;认证单位收到文件的日期和时间;认证单位的数字签名。
另外,本申请实施例中的术语“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中,A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。以下至少一项(个)下或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。
此外,本申请实施例和权利要求书及附图中的术语“包括”和“具有”不是排他的。例如,包括了一系列步骤或模块的过程、方法、***、产品或设备,不限定于已列出的步骤或模块,还可以包括没有列出的步骤或模块。
通过本申请实施例中上述应用场景的介绍,下面针对传输数据需要进行数据格式转换的情况,对基于IEEE1588协议进行时钟同步的过程进行具体介绍。
其中,本申请实施例进行时钟同步时,主要方式在于将所述数据进行数据格式转换过程中产生的传输延时补偿到发送时间中,进而根据补偿后的发送时间进行时钟同步。而根据进行补偿的执行设备的不同,可分为多种情况,下面分别进行介绍。
其中,假设本申请实施例中以所述传输数据中位置A的数据作为基准,且为方便后续进行介绍,将所述第一设备向所述第二设备发送数据的发送时间表示为T1,所述第二设备接收到所述数据的接收时间为T2,所述数据进行数据格式转换产生的传输延时为Δt,未进行数据格式处理的数据简称为第一数据,对第一数据进行数据格式处理后得到的数据简称为第二数据。
进行补偿的执行设备1:第一设备根据所述传输数据进行数据格式转换过程产生的传输延时Δt对发送时间T1进行补偿。
如图4所示,当所述进行补偿的执行设备为第一设备时,本申请进行时钟同步的步骤包括:
S400,第一设备将第一数据发送给转换设备,并记录发送所述第一数据的发送时间T1。
其中,因本申请实施例中以所述传输数据中位置A的数据作为基准,则可以理解,所述发送时间T1具体为所述第一设备发送所述第一数据中位置A的数据的时间。
可选的,所述第一设备可以通过sync报文携带所述第一数据,即所述第一设备将携带所述第一数据的sync报文发送给所述转换设备。
S401,所述转换设备对所述第一数据进行数据格式转换,生成第二数据。
S402,所述转换设备将所述第二数据发送给第二设备。
S403,所述第二设备接收所述第二数据,并记录接收到所述第二数据的时间T2。
其中,因本申请实施例中以所述传输数据中位置A的数据作为基准,则可以理解,所述接收时间T2具体为所述第二设备接收到的所述第二数据中位置A的数据的时间。
S404,所述第一设备根据所述第一数据与所述第二数据确定进行数据格式转换过程产生的延时抖动Δt。
进一步的,所述第一设备可以根据所述第一数据的数据传输速率与所述第二数据的数据传输速率确定所述Δt。
所述第一设备可以根据待发送的所述第一数据确定所述第一数据的数据传输速率,所述第一设备可以根据所述转换设备进行数据转换的规则确定所述第二数据的传输速率。
可选的,本申请实施例中所述第一设备可以根据所述第一数据的传输速率与所述第二数据的传输速率确定所述传输延时Δt。
其中,因为本申请实施例中以所述传输数据中位置A的数据作为基准,则所述第一设备确定的所述Δt,为所述第一数据中位置A数据发送时间与所述第二数据中位置A数据的发送时间之差。
示例性的,本申请实施例中选取通过FEC技术实现对所述第一数据进行数据格式转换来进行详细介绍,需要说明的是,其他可以对数据格式进行更改的方式都可适用本申请实施例。
如图5所示,假设,在数据传输过程中,第一设备与第二设备进行数据传输时,以传输数据的第3000比特位为基准进行时钟同步。所述第一数据格式为RS(528,514),基于100GE端口时的数据传输速率为4*25.78125Gbps;所述第二数据格式为RS(544,514),基于100GE端口时的数据传输速率为4*26.5625Gbps;且所述第一数据与所述第二数据的发送起始比特位相同,例如第一数据起始比特位与所述第二数据起始比特位都为bit0,则所述第一数据起始比特位与第二数据起始比特位的延时抖动为0。
其中,根据下述公式2可以确定所述传输数据的第3000比特位进行数据格式转换产生的延时抖动。
Δt(bitX)=(A)/Y(Gbps)-(A)/Z(Gbps)  公式2
上述公式2中Y(Gbps)表示第一数据的数据传输速率、Z(Gbps)表示第二数据的数据传输速率、X表示用于作为时间戳基准的比特位、A表示0~X比特位对应的比特数,例如比特位为bit0时,A表示1比特长度的数据;比特位为bit1时,A表示2比特长度的 数据;比特位为bit3000时,A表示3001比特长度的数据;Δt表示第一数据进行数据格式转换产生的延时抖动。
因此,基于上述公式2,可以得到Δt(bit3000)=(3001)/4/25.78125Gbps-(3001)/4/26.5625Gbps=0.855ps。
需要说明的是,除上述确定传输数据进行数据格式转换过程中产生的传输延时的方法外,任何适用本申请实施例的确定传输数据格式转换产生的传输延时的方法都属于本申请保护范围。
进一步的,所述第一设备还确定所述Δt的方向,即所述Δt的正负,从而根据所述Δt的方向确定进行数据格式处理后是增加了延时,还是减少了延时。
S405,所述第一设备根据Δt对所述T1进行补偿,得到所述第二时间T1'。
其中,若所述Δt方向为右,即所述Δt为正值,则表示所述Δt为在所述第一数据发送的基础上增加的传输延时,则所述T1'=T1+△t;若所述Δt方向为左,即所述Δt为负值,则表示所述Δt为在所述第一数据发送的基础上减少的传输延时,则所述T1'=T1-△t。
示例性的,如图6所示,当所述第一设备向所述第二设备发送的传输数据需要进行数据格式转换时,假设所述第一设备确定的所述传输延时△t为增加5ns,第一设备在1:00(即所述T1)通过所述转换设备向所述第二设备发送sync报文。所述第二设备在1:15(即所述T2)接收到所述sync报文。
其中,所述第一设备根据所述Δt对所述T1进行补偿,得到所述T1',即所述T1'=1:00+0:05=1:05。
同理,当所述第一设备向所述第二设备发送的传输数据需要进行数据格式转换时,假设所述第一设备确定产生的传输延时△t为减少2ns,第一设备在1:02(即所述T1)通过所述转换设备向所述第二设备发送sync报文。所述第二设备在1:00(即所述T2)接收到所述sync报文。
其中,所述第一设备根据所述Δt对所述T1进行补偿,得到所述T1',即所述T1'=1:02-0:02=1:00。
S406,所述第一设备向所述第二设备发送第一消息(例如follow_up报文),其中,所述第一消息用于指示所述第二时间T1'。
可选的,本申请实施例中可以省略上述步骤S404,即所述第一设备无需根据所述Δt对所述T1进行补偿,得到所述第二时间T1'。所述第一设备可以直接将所述T1与所述Δt携带在所述第一消息中发送给所述第二设备,从而使所述第二设备获取到所述第一消息后,根据所述第一消息中的所述T1与所述Δt,自行确定T1'。
S407,所述第二设备接收所述第一消息,获取所述第一消息中的所述T1'。
可选的,若所述第一消息中携带的信息为所述T1与所述Δt,则所述第二设备获取到所述第一消息后,根据所述第一消息中的所述T1与所述Δt,自行确定T1'。
S408,所述第二设备向所述第一设备发送第二消息(例如Delay_Req报文),并记录所述第二消息的发送时间T3。
S409,所述第一设备接收所述第二消息,并记录接收到所述第二消息的时间T4。
S410,所述第一设备向所述第二设备发送第三消息(例如delay_resp报文),所述第三消息中包含所述T4。
S411,所述第二设备接收所述第三消息,并获取所述第三消息中的所述T4。
S412,所述第二设备根据所述T1'、T2、T3、T4进行与所述第一设备之间的时钟同步。
示例性的,本申请实施例中所述第一设备与所述第二设备通过所述IEEE1588协议实现时间同步时,需要确定所述第一设备与所述第二设备的时间差Offset以及路径传输延时Delay,从而使得所述第二设备根据计算得到的时间差Offset以及路径传输延时Delay,实现与所述第一设备之间的时间同步。
其中,所述第二设备根据下述公式3和公式4进行计算:
T2-T1=offset+Delayms  公式3
T4-T3=-offset+Delaysm  公式4
其中,所述公式3中的T2表示第二设备接收到第一设备发送的传输数据的时间、T1表示所述第一设备实际发送所述传输数据的时间、offset表示所述第一设备与第二设备进行通信过程中设备之间的时间差、所述Delayms表示第一设备向第二设备传输数据时的网络路径传输延时。
所述公式4中的T3表示第二设备向第一设备发送延迟请求报文的时间、T4表示所述第一设备接收到所述延迟请求报文的时间、-offset表示第二设备与第一设备进行通信传输过程中设备之间的时间差、所述Delaysm表示第二设备向第一设备传输数据时的网络路径传输延时。
因为进行发送的传输数据进行了数据格式转换,因此,还存在所述△t,则所述第二设备代入所述公式3进行计算的传输数据的发送时间应为补偿后的时间,即T1'。
所述第二设备将所述T1'、T2、T3、T4代入所述公式3和所述公式4后,可以得到公式5。
Offset=[(T2-T1')-(T4-T3)-(Delayms-Delaysm)]/2  公式5
其中,在实际的数据传输过程中还会产生传输延时△t,因本申请实施例中事先根据所述△t对所述T1进行了补偿,因此,本申请实施例后续在进行时钟同步时,则可以降低所述△t对所述时钟同步的干扰。
例如,现有进行输出传输时Offset中包含△t,参见下述公式6:
Offset=[(T2-T1)-(T4-T3)-(Delayms+△t-Delaysm)]/2  公式6
而本申请得到的Offset,参见下述公式7:
Offset=[(T2-T1')-(T4-T3)-(Delayms+△t-Delaysm)]/2  公式7
进一步的,因为所述T1'=T1+△t,则根据上述公式7可知,本申请得到的Offset为:
Offset=[(T2-T1+△t)-(T4-T3)-(Delayms+△t-Delaysm)]/2
=[(T2-T1)-(T4-T3)-(Delayms-Delaysm)]/2
由此,本申请实施例通过对所述发送时间T1进行补偿,可以保障没有其他精度损失的前提下,使所述第二设备精准的进行时钟同步。
进一步的,本申请实施例中,所述第一设备在向所述第二设备传输数据时,进行传输的数据,在传输过程中,所述数据中的对齐标记(AM)与所述第二数据中的数据相对位置不变,即所述第一设备将需要传输的数据透传给所述第二设备。
其中,当传输的数据进行数据格式转换时,所述网络路径传输延时主要包括路径延时d和数据格式转换过程中产生的传输延时△t,当所述第一设备将所述传输数据透传给所述第二设备时,使得数据在FEC codeword的相对位置是固定不变,因此路径延时d也是固 定的。从而在所述数据在传输过程中,即仅需要确定所述路径传输的固定的路径延迟d,就可以有效保证所述第二设备进行第一设备时钟同步的精度。
需要说明的是,本申请实施例中图4所示的交互流程中,并不限制某些步骤的先后顺序,例如S404可以先于S402执行。
进行补偿的执行设备2:第二设备根据所述数据进行数据格式转换过程产生的传输延时Δt对发送时间T1进行补偿。
如图7所示,当所述进行补偿的执行设备为第二设备时,本申请进行时钟同步的步骤包括:
S700,第一设备将第一数据发送给转换设备,并记录发送所述第一数据的时间T1。
S701,所述转换设备对所述第一数据进行数据格式处理,生成第二数据。
S702,所述转换设备将所述第二数据发送给第二设备。
S703,所述第二设备接收所述第二数据,并记录接收到所述第二数据的时间T2。
S704,所述第二设备确定所述第二数据记录时间戳的数据在格式转换过程中产生的传输延时。
可选的,本申请实施例中所述第二设备子获取所述第二数据后,可根据所述转换设备的数据格式转换规则以及所述第二数据确定所述第一数据,然后根据所述第一数据与所述第二数据确定所述传输延时Δt。
其中,具体确定所述传输延时Δt的方式参见上述S404,在此不进行赘述。
进一步的,所述第一设备还确定所述Δt的方向,即所述Δt的正负,从而根据所述Δt的方向确定进行数据格式处理后是增加了延时,还是减少了延时。
S705,所述第一设备向所述第二设备发送第一消息(例如follow_up报文),其中,所述第一消息用于指示所述T1。
S706,所述第二设备接收所述第一消息,获取所述第一消息中的所述T1。
S707,所述第二设备根据所述Δt对所述T1进行补偿,确定补偿后的T1'。
S708,所述第二设备向所述第一设备发送第二消息(例如Delay_Req报文),并记录所述第二消息的发送时间T3。
S709,所述第一设备接收所述第二消息,并记录接收到所述第二消息的时间T4。
S710,所述第一设备向所述第二设备发送第三消息(例如delay_resp报文),所述第三消息中包含所述T4。
S711,所述第二设备接收所述第三消息,并获取所述第三消息中的所述T4。
S712,所述第二设备根据所述T1'、T2、T3、T4进行与所述第一设备之间的时钟同步。
具体时钟同步方式详见上述步骤S412,在此不进行赘述。
需要说明的是,本申请实施例中图7所示的交互流程中,并不限制某些步骤的先后顺序,例如S704可以先于S702执行。
通过上述对本申请方案的介绍,可以理解的是,上述实现各设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执 行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
基于以上实施例,如图8所示,为本申请提供的一种进行时钟同步的第一设备,所述第一设备包括处理器800、存储器801和通信接口802。
处理器800负责管理总线架构和通常的处理,存储器801可以存储处理器800在执行操作时所使用的数据。收发机通信接口802用于在处理器800的控制下接收和发送数据与存储器801进行数据通信。
所述处理器800可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述处理器800还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。存储器701可以包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
所述处理器800、所述存储器801以及所述通信接口802之间相互连接。可选的,所述处理器800、所述存储器801以及所述通信接口802可以通过总线803相互连接;所述总线803可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
具体地,所述处理器800,用于读取存储器801中的程序并执行:
发送所述第一数据,在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的数据位置,以及发送所述时间戳对应的数据的第一时间;根据所述数据位置,确定所述数据位置的数据在格式转换过程中产生的传输延时;向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;在第三时间接收所述第二设备发送的第二消息;向所述第二设备发送第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
在一种可能的实现方法中,所述第一消息包含所述第一时间和所述传输延时,以使所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;或所述第一消息包含所述第二时间。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方法中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
如图9所示,本发明提供一种时钟同步的第一设备,该设备包括:处理单元900和通信单元901:
所述通信单元901,用于发送所述第一数据;
所述处理单元900,用于在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的数据位置,以及发送所述时间戳对应的数据的第一时间;根据所述数据位置,确定所述数据位置的数据在格式转换过程中发生产生的传输延时;
所述通信单元901,用于向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;在第三时间接收所述第二设备发送的第二消息;向所述第二设备发送第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
如图10所示,本申请实施例还提供了一种时钟同步的第二设备,该设备包括处理器1000、存储器1001和通信接口1002。
处理器1000负责管理总线架构和通常的处理,存储器1001可以存储处理器1000在执行操作时所使用的数据。收发机通信接口1002用于在处理器1000的控制下接收和发送数据与存储器1001进行数据通信。
所述处理器1000可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述处理器1000还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。存储器1001可以包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
所述处理器1000、所述存储器1001以及所述通信接口1002之间相互连接。可选的,所述处理器1000、所述存储器1001以及所述通信接口1002可以通过总线1003相互连接;所述总线1003可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
具体地,处理器1000,用于读取存储器1001中的程序并执行:
接收转换设备发送的第二数据;接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;在第四时间向所述第一设备发送第二消息;所述第二设备接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
在一种可能的实现方式中,所述处理器1000还用于:
所述第二设备根据所述第一消息中包含的所述传输延时和所述第一时间,确定所述第 二时间。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方式中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
如图11所示,本发明提供一种时钟同步的第二设备,该设备包括:处理单元1100和通信单元1101:
所述通信单元1101,用于接收转换设备发送的第二数据;接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;
所述处理单元1100,用于根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
如图12所示,本申请实施例还提供了另一种时钟同步的第二设备,该设备包括处理器1200、存储器1201和通信接口1202。
处理器1200负责管理总线架构和通常的处理,存储器1201可以存储处理器1200在执行操作时所使用的数据。收发机通信接口1202用于在处理器1200的控制下接收和发送数据与存储器1201进行数据通信。
所述处理器1200可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述处理器1200还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。存储器1201可以包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
所述处理器1200、所述存储器1201以及所述通信接口1202之间相互连接。可选的,所述处理器1200、所述存储器1201以及所述通信接口1202可以通过总线1203相互连接;所述总线1203可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
具体地,处理器1200,用于读取存储器1201中的程序并执行:
接收转换设备发送的第二数据;确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;接收所述第一设备发送的第一消息,所述第一消息包含所述第一时 间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
在一种可能的实现方式中,所述处理器1200还用于:
所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;所述第二设备根据所述第二时间、所述第三时间、所述第四时间进行与所述第一设备之间的时钟同步。
在一种可能的实现方式中,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
在一种可能的实现方式中,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
如图13所示,本发明提供的另一种时钟同步的第一设备,该设备包括:处理单元1300和通信单元1301:
所述通信单元1301,用于接收转换设备发送的第二数据;
所述处理单元1300,用于确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;
所述通信单元1301,用于接收所述第一设备发送的第一消息,所述第一消息包含所述第一时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
在一些可能的实施方式中,本发明实施例提供的时钟同步的方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序代码在计算机设备上运行时,所述程序代码用于使所述计算机设备执行本说明书中描述的根据本发明各种示例性实施方式的时钟同步的方法中的步骤。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的***、装置或器件,或者任意以上的组合。可读存储介质的更本申请实施例一种实现方式中例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
根据本发明的实施方式的用于时钟同步的程序产品,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在服务器设备上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被信息传输、装置或者器件使用或者与其结合使用。
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介 质,该可读介质可以发送、传播或者传输用于由周期网络动作***、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、RF等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算设备,或者,可以连接到外部计算设备。
本申请实施例针对时钟同步的方法还提供一种计算设备可读存储介质,即断电后内容不丢失。该存储介质中存储软件程序,包括程序代码,当所述程序代码在计算设备上运行时,该软件程序在被一个或多个处理器读取并执行时可实现本申请实施例上面任何一种时钟同步的方案。
以上参照示出根据本申请实施例的方法、装置(***)和/或计算机程序产品的框图和/或流程图描述本申请。应理解,可以通过计算机程序指令来实现框图和/或流程图示图的一个块以及框图和/或流程图示图的块的组合。可以将这些计算机程序指令提供给通用计算机、专用计算机的处理器和/或其它可编程数据处理装置,以产生机器,使得经由计算机处理器和/或其它可编程数据处理装置执行的指令创建用于实现框图和/或流程图块中所指定的功能/动作的方法。
相应地,还可以用硬件和/或软件(包括固件、驻留软件、微码等)来实施本申请。更进一步地,本申请可以采取计算机可使用或计算机可读存储介质上的计算机程序产品的形式,其具有在介质中实现的计算机可使用或计算机可读程序代码,以由指令执行***来使用或结合指令执行***而使用。在本申请上下文中,计算机可使用或计算机可读介质可以是任意介质,其可以包含、存储、通信、传输、或传送程序,以由指令执行***、装置或设备使用,或结合指令执行***、装置或设备使用。
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包括这些改动和变型在内。

Claims (20)

  1. 一种时钟同步的方法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,其特征在于,该方法包括:
    所述第一设备发送所述第一数据,在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的数据位置,以及发送所述时间戳对应的数据的第一时间;
    所述第一设备根据所述数据位置,确定所述数据位置的数据在格式转换过程中产生的传输延时;
    所述第一设备向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;
    所述第一设备在第三时间接收所述第二设备发送的第二消息;
    所述第一设备向所述第二设备发第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
  2. 根据权利要求1所述的方法,其特征在于,所述第一消息用于指示第二时间,包括:
    所述第一消息包含所述第一时间和所述传输延时,以使所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;或
    所述第一消息包含所述第二时间。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
  4. 根据权利要求1~3任一项所述的方法,其特征在于,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
  5. 一种时钟同步的方法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,其特征在于,该方法包括:
    第二设备接收转换设备发送的第二数据;
    所述第二设备接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;
    所述第二设备在第四时间向所述第一设备发送第二消息;
    所述第二设备接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;
    所述第二设备根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
  6. 根据权利要求5所述的方法,其特征在于,所述第二设备根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步之前,还包括:
    所述第二设备根据所述第一消息中包含的所述传输延时和所述第一时间,确定所述第 二时间。
  7. 根据权利要求5或6所述的方法,其特征在于,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
  8. 根据权利要求5~7任一项所述的方法,其特征在于,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
  9. 一种时钟同步的方法,用于由第一设备,转换设备和第二设备组成的网络环境中,所述转换设备用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备,其特征在于,该方法包括:
    第二设备接收转换设备发送的第二数据;
    所述第二设备确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;
    所述第二设备接收所述第一设备发送的第一消息,所述第一消息包含所述第一时间;
    所述第二设备在第四时间向所述第一设备发送第二消息;
    所述第二设备接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;
    所述第二设备根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
  10. 根据权利要求9所述的方法,其特征在于,所述第二设备根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步,包括:
    所述第二设备根据所述传输延时对所述第一时间进行补偿,得到第二时间;
    所述第二设备根据所述第二时间、所述第三时间、所述第四时间进行与所述第一设备之间的时钟同步。
  11. 根据权利要求9或10所述的方法,其特征在于,所述第一消息为跟随follow_up报文;所述第二消息为延迟请求Delay_req报文;所述第三消息为延迟响应Delay_Resp报文。
  12. 根据权利要求9~11任一项所述的方法,其特征在于,所述第二数据在传输过程中,所述第二数据中的对齐标记与所述第二数据中的数据相对位置不变。
  13. 一种通信装置,其特征在于,包括:处理单元和通信单元;
    所述通信单元,用于发送所述第一数据;
    所述处理单元,用于在所述第一数据中打上时间戳,并确定所述时间戳对应的数据在所述第一数据中的位置,以及发送所述时间戳对应的数据的第一时间;根据所述数据位置,确定所述数据位置的数据在格式转换过程中产生的传输延时;
    所述通信单元,用于向所述第二设备发送第一消息,所述第一消息用于指示第二时间,所述第二时间为根据所述传输延时对所述第一时间进行补偿后的时间;在第三时间接收所述第二设备发送的第二消息;向所述第二设备发送第三消息,所述第三消息包含所述第三时间,以使所述第二设备根据所述第二时间、所述第三时间和发送所述第二消息的第四时间进行与所述第一设备之间的时钟同步。
  14. 一种通信装置,其特征在于,包括:处理单元和通信单元;
    所述通信单元,用于接收转换设备发送的第二数据;接收所述第一设备发送的第一消息,所述第一消息用于指示第二时间;所述第二时间为根据传输延时对第一时间进行补偿 后的时间,所述传输延时是所述第一数据中打上时间戳的数据在格式转换过程中产生的,所述第一时间为所述第一设备发送所述时间戳对应的数据的发送时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;
    所述处理单元,用于根据所述第二时间、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
  15. 一种通信装置,其特征在于,包括:处理单元和通信单元;
    所述通信单元,用于接收转换设备发送的第二数据;
    所述处理单元,用于确定所述第二数据中打上时间戳的数据在格式转换过程中产生的传输延时;
    所述通信单元,用于接收所述第一设备发送的第一消息,所述第一消息包含所述第一时间;在第四时间向所述第一设备发送第二消息;接收所述第一设备发送的第三消息,所述第三消息包含所述第一设备接收到所述第二消息的第三时间;根据所述第一时间、所述传输延时、所述第三时间和所述第四时间进行与所述第一设备之间的时钟同步。
  16. 一种通信装置,其特征在于,包括:一个或多个处理器;存储器;一个或多个程序;其中所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述通信装置执行如权利要求1~4中任一所述的方法步骤。
  17. 一种通信装置,其特征在于,包括:一个或多个处理器;存储器;一个或多个程序;其中所述一个或多个程序被存储在所述存储器中,所述一个或多个程序包括指令,当所述指令被所述处理器执行时,使得所述通信装置执行如权利要求5~12中任一所述的方法步骤。
  18. 一种时钟同步的***,其特征在于,包括:第一设备、第二设备以及转换设备;
    所述第一设备,用于执行如权利要求1~4中任一所述的方法步骤;
    所述第二设备,用于执行如权利要求5~12中任一所述的方法步骤;
    所述转换设备,用于将所述第一设备的第一数据进行格式转换后得到第二数据,并将所述第二数据发送给所述第二设备。
  19. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在第一设备上运行时,使得所述第一设备执行如权利要求1~4中任一所述的方法步骤。
  20. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在第二设备上运行时,使得所述第二设备执行如权利要求5~12中任一所述的方法步骤。
PCT/CN2019/120022 2019-11-21 2019-11-21 一种时钟同步方法及装置 WO2021097769A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980102220.6A CN114731205A (zh) 2019-11-21 2019-11-21 一种时钟同步方法及装置
PCT/CN2019/120022 WO2021097769A1 (zh) 2019-11-21 2019-11-21 一种时钟同步方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/120022 WO2021097769A1 (zh) 2019-11-21 2019-11-21 一种时钟同步方法及装置

Publications (1)

Publication Number Publication Date
WO2021097769A1 true WO2021097769A1 (zh) 2021-05-27

Family

ID=75980340

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/120022 WO2021097769A1 (zh) 2019-11-21 2019-11-21 一种时钟同步方法及装置

Country Status (2)

Country Link
CN (1) CN114731205A (zh)
WO (1) WO2021097769A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024067483A1 (zh) * 2022-09-28 2024-04-04 中兴通讯股份有限公司 时间基准位置的传递方法、报文位置确定方法、通信设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100040090A1 (en) * 2008-08-14 2010-02-18 Electronics and Telectcommunicatios Research Institte Synchronization method for allowing fixed time delay and bridge employing the same
CN103051383A (zh) * 2012-11-30 2013-04-17 华为技术有限公司 处理信息的方法和设备
CN108667543A (zh) * 2017-03-29 2018-10-16 华为技术有限公司 一种时钟处理方法、接入网设备和终端设备
CN108737000A (zh) * 2017-04-24 2018-11-02 上海诺基亚贝尔股份有限公司 用于时钟同步的方法和设备
CN109547146A (zh) * 2019-01-14 2019-03-29 北京邮电大学 一种基于超宽带无线通信的无线时钟同步方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100040090A1 (en) * 2008-08-14 2010-02-18 Electronics and Telectcommunicatios Research Institte Synchronization method for allowing fixed time delay and bridge employing the same
CN103051383A (zh) * 2012-11-30 2013-04-17 华为技术有限公司 处理信息的方法和设备
CN108667543A (zh) * 2017-03-29 2018-10-16 华为技术有限公司 一种时钟处理方法、接入网设备和终端设备
CN108737000A (zh) * 2017-04-24 2018-11-02 上海诺基亚贝尔股份有限公司 用于时钟同步的方法和设备
CN109547146A (zh) * 2019-01-14 2019-03-29 北京邮电大学 一种基于超宽带无线通信的无线时钟同步方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024067483A1 (zh) * 2022-09-28 2024-04-04 中兴通讯股份有限公司 时间基准位置的传递方法、报文位置确定方法、通信设备

Also Published As

Publication number Publication date
CN114731205A (zh) 2022-07-08

Similar Documents

Publication Publication Date Title
JP5912086B2 (ja) 通信システムでの通信階層とサブ階層との相互作用を介した通信システムの正確なクロック同期化のための方法及びシステム
WO2018113397A1 (zh) 确定终端与基站时钟时间偏差的方法与装置
WO2020063393A1 (zh) 一种时间同步的方法和装置
JP5518191B2 (ja) 光伝送網が時刻同期プロトコルをキャリングする方法及びシステム
US11469843B2 (en) Synchronization method and apparatus
CN102244603B (zh) 传输承载时间的报文的方法、设备及***
WO2020063535A1 (zh) 一种参考时间确定方法及装置
WO2021063397A1 (zh) 一种参考信号配置的确定方法及装置
WO2021057756A1 (zh) 延时测量方法、***和存储介质
WO2022027666A1 (zh) 一种时间同步方法及装置
CN113574813B (zh) 用于确定时间信息的无线网络***的网络实体和方法
WO2019024032A1 (zh) 数据传输方法、相关设备及通信***
WO2021097769A1 (zh) 一种时钟同步方法及装置
JP2013531447A (ja) Cpriリンクのエラー・コード・モニター方法、システム及び装置
WO2013155944A1 (zh) 一种时钟传输方法、边界时钟及透传时钟
WO2018177320A1 (zh) 一种时钟处理方法、接入网设备和终端设备
KR20200019058A (ko) 무선 통신 시스템에서 무선 통신망을 이용한 동기화를 위한 장치 및 방법
WO2021147044A1 (zh) 一种时间敏感网络时间同步方法及装置
WO2023000926A1 (zh) 时钟同步方法及通信装置
CN111884751A (zh) 一种基于ptp的智能电网时间同步方法和装置
WO2023125033A1 (zh) 获取(或提供)时钟同步信息的方法以及通信装置
WO2019149210A1 (zh) 一种数据压缩方法、解压缩方法、发送端及接收端
WO2022174672A1 (zh) 时延测量方法、装置、设备和计算机可读存储介质
Schüngel et al. Single message distribution of timing information for time synchronization in converged wired and wireless networks
WO2022028716A1 (en) Ue based time synchronization in 5gs with gm clock on the ue side

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: 19953560

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: 19953560

Country of ref document: EP

Kind code of ref document: A1