WO2012055360A1 - Method for time synchronization and device and system thereof - Google Patents

Method for time synchronization and device and system thereof Download PDF

Info

Publication number
WO2012055360A1
WO2012055360A1 PCT/CN2011/081373 CN2011081373W WO2012055360A1 WO 2012055360 A1 WO2012055360 A1 WO 2012055360A1 CN 2011081373 W CN2011081373 W CN 2011081373W WO 2012055360 A1 WO2012055360 A1 WO 2012055360A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
synchronization message
time synchronization
clock device
message
Prior art date
Application number
PCT/CN2011/081373
Other languages
French (fr)
Chinese (zh)
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 华为技术有限公司
Publication of WO2012055360A1 publication Critical patent/WO2012055360A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others

Definitions

  • the present invention relates to the field of communications, and in particular, to a time synchronization method and related devices and systems. Background technique
  • Time synchronization means that the absolute time between different systems is the same.
  • each system has an internal time, that is, a local clock, which is managed by the clock device of the system, due to the locality of each system.
  • the clocks are all running independently, so the local clocks of the various systems are not necessarily the same.
  • time synchronization technology is a technology that controls the time deviation between different systems within a certain range.
  • IEEE-1588 defines the Precision Time Protocol (PTP). Time synchronization of other clock devices in the wired network with other clock devices based on the IEEE-1588 standard.
  • PTP Precision Time Protocol
  • Embodiments of the present invention provide a time synchronization method and related device and system, which are used to improve a main Time synchronization accuracy from the clock device.
  • the embodiment of the present invention provides the following technical solutions:
  • a time synchronization method including:
  • the master clock device sends the first time synchronization message to the slave clock device, and acquires the time when the first time synchronization message is sent through the radio frequency.
  • the master clock device sends a second time synchronization message to the slave clock device, and carries the time stamp of the above 1 ⁇ in the second time synchronization message;
  • the master clock device receives the third time synchronization message sent by the slave clock device, and acquires the time ⁇ 4 when the air interface physical layer receives the third time synchronization message;
  • the master clock device sends a fourth time synchronization message to the slave clock device, and carries the time stamp of the ⁇ 4 in the fourth time synchronization message, so that the slave clock device calculates the slave clock device according to the foregoing 1 ⁇ and ⁇ 4 And a clock offset of the master clock device, and correcting the local clock of the slave clock device according to the calculated clock offset.
  • a time synchronization method including:
  • the slave clock device calculates a clock offset of the slave clock device and the master clock device according to the above 1 ⁇ , ⁇ 2 , ⁇ 3 and ⁇ 4 ;
  • the slave clock device corrects the local clock of the slave clock device based on the calculated clock offset.
  • a master clock device including: a transceiver module, configured to send a first time synchronization message to the slave clock device;
  • An acquiring module configured to acquire a time when the transceiver module sends the first time synchronization message by using a radio frequency
  • the transceiver module is further configured to send the second time synchronization message to the slave clock device, and carry the time stamp of the above 1 ⁇ in the second time synchronization message;
  • the transceiver module is further configured to receive a third time synchronization message sent by the slave clock device.
  • the obtaining module is further configured to acquire, when the transceiver module sends the third synchronization message, the time ⁇ 4 at which the air interface physical layer receives the third time synchronization message;
  • the transceiver module is further configured to send a fourth time synchronization message to the slave clock device, and carry the time stamp of the ⁇ 4 in the fourth time synchronization message; so that the slave clock device calculates the foregoing according to the foregoing 1 and ⁇ 4
  • the clock offset of the slave clock device from the clock device and the master clock device is corrected, and the local clock of the slave clock device is corrected according to the calculated clock offset.
  • a slave clock device including:
  • a transceiver module configured to receive a first time synchronization message sent by the master clock device, and an acquiring module, configured to acquire, according to the first time synchronization message received by the transceiver module, a time ⁇ 2 when the air interface physical layer receives the first time synchronization message ;
  • the transceiver module is further configured to receive a second time synchronization message sent by the primary clock device, where the second time synchronization message carries a time stamp of 1 ⁇ ;
  • the acquiring module is configured to receive, by using the second synchronization message, the timestamp carried in the second time synchronization message, where the first time is a time when the primary clock device sends the first time synchronization message by using a radio frequency. ;
  • the transceiver module is further configured to send a third time synchronization message to the master clock device; the acquiring module is further configured to: when the transceiver module sends the third time synchronization message, acquire the time ⁇ 3 sent by the third synchronization message by using the radio frequency;
  • the transceiver module is further configured to receive a fourth time synchronization message sent by the master clock device, and obtain a timestamp of ⁇ 4 carried in the fourth time synchronization message, where the ⁇ 4 is the air interface physics of the master clock device. a time when the third time synchronization message is received on the layer; the processing module is configured to calculate the slave according to 1 ⁇ , ⁇ 2 , ⁇ 3 and ⁇ 4 acquired by the acquiring module The clock offset of the clock device from the above-mentioned master clock device;
  • a correction module configured to correct the local clock of the slave clock device according to the clock offset calculated by the processing module.
  • a time synchronization system including:
  • a master clock device configured to send a first time synchronization message to the slave clock device, and obtain a second time synchronization message sent to the slave clock device by using the time when the first time synchronization message is sent by using the radio frequency, and in the second time synchronization message Carrying the timestamp of the above 1 ⁇ ; receiving the third time synchronization message sent by the slave clock device, and acquiring the time ⁇ 4 when the air interface physical layer receives the third time synchronization message; sending the fourth time to the slave clock device Synchronizing the message, and carrying the time stamp of the above ⁇ 4 in the fourth time synchronization message;
  • the slave clock device is configured to receive the first time synchronization message sent by the master clock device, and obtain the time ⁇ 2 when the air interface physical layer receives the first time synchronization message, and receive the second time synchronization message sent by the master clock device. And obtaining the timestamp of the time 1 ⁇ carried in the second time synchronization message, where 1 ⁇ is the time when the primary clock device sends the first time synchronization message by using the radio frequency; and sending the third time synchronization message to the primary clock device.
  • ⁇ 4 is a time when the master clock device receives the third time synchronization message on the air interface physical layer; and calculates a clock offset between the slave clock device and the master clock device according to the above ⁇ , ⁇ 2 , ⁇ 3 and ⁇ 4 Correction of the local clock of the above slave clock device based on the calculated clock offset.
  • the embodiments of the present invention have the following advantages:
  • the master-slave clock device acquires the time when the time synchronization message is sent by the radio frequency (RF, Rad io Frequency) and the time when the physical layer of the air interface receives the time synchronization message, as the time of sending and receiving the time synchronization message, thereby
  • the influence of the delay and jitter of the processing such as physical layer modulation and demodulation on the accuracy of acquiring the time of sending and receiving the time synchronization message can be eliminated, and the accuracy of the time of sending and receiving the time synchronization message is improved, and the acquisition is utilized.
  • the higher accuracy of the time synchronization message transmission and reception time information, the time synchronization of the master-slave clock device can improve the time synchronization accuracy of the master-slave clock device.
  • DRAWINGS 1 is a schematic flow chart of a time synchronization method in the prior art
  • FIG. 2 is a schematic flowchart of another embodiment of a time synchronization method according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another embodiment of a time synchronization method according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a time-frequency structure of a 0.5 millisecond time slot in an LTE system according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a manner of acquiring a time for sending or receiving a time synchronization message by using scheduling information or time-frequency resource information according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of another manner of obtaining, by using scheduling information or time-frequency resource information, a time for transmitting or receiving a time synchronization message according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of another manner of obtaining, by using scheduling information or time-frequency resource information, a time for transmitting or receiving a time synchronization message according to an embodiment of the present disclosure
  • FIG. 5-a is a schematic flow chart of another embodiment of a time synchronization method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a hardware recording manner according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of another hardware recording manner according to an embodiment of the present disclosure.
  • FIG. 5-d is a schematic diagram of another hardware recording manner according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a master clock device according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a slave clock device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a time synchronization system according to an embodiment of the present invention. detailed description
  • Embodiments of the present invention provide a time synchronization method and related device and system for improving time synchronization accuracy of a master-slave clock device.
  • the basic principle of realizing time synchronization between devices is to set a system default in the communication system. It is a master clock device, and other devices are slave clock devices.
  • a time synchronization message carrying a time stamp (including a time synchronization message, a PTP message following a message, and a delayed response message) is transmitted between the master clock device and the slave clock device, and the time information described by the clock device through the time stamp.
  • the specific process of time synchronization between the master and slave clock devices can be:
  • the master clock device sends time synchronization to the slave clock device, and measures the exact time when the Sync message leaves the application layer.
  • the master clock device sends a follow message to the Follow_up message after sending the Sync message, and carries the timestamp in the Follow_up message;
  • the master clock device to the slave clock device transmits a response packet delay Delay_Resp, 4 and carry the time stamp t Delay_Resp message, acquires a time stamp of t 4 the slave clock device by receiving the packet Delay_Resp;
  • the slave clock device calculates the clock offset from the master clock device according to the above t l t 2 , t 3 and t 4 , and corrects the local clock according to the result of the final calculation, thereby implementing the master-slave clock device. Time synchronization.
  • the time synchronization message sent by the application layer of the sender needs to be processed by the physical layer after being modulated, and then transmitted through the RF through the physical layer air interface.
  • the receiving end (slave device or master clock device) receives the time synchronization message from the physical layer air interface, it also needs to go to the application layer after the physical layer undergoes demodulation and the like.
  • the processing and demodulation of the physical layer will bring a certain delay and jitter to the transmission of the time synchronization cancellation.
  • the delay and jitter are related to the speed of the baseband processing, and The difference in the downlink mechanism may lead to the asymmetry of the uplink and downlink processing delay.
  • the sending end usually takes the time when the time synchronization message leaves its application layer as the sending time of the time synchronization message, and the receiving end usually takes the time synchronization message to reach the application layer.
  • the delay of the time synchronization message transmission or reception and the asymmetry of the jitter caused by the adjustment and demodulation processing of the physical layer of the master-slave clock device will greatly affect the main Time synchronization accuracy from the clock device.
  • the time synchronization method in the embodiment of the present invention may include: the primary clock device sends a first time synchronization message to the slave clock device, and acquires a time when the first time synchronization message is sent by the RF.
  • the master clock device sends the message to the slave clock device. a time synchronization message, and carrying a timestamp of 1 ⁇ in the second time synchronization message;
  • the master clock device receives the third time synchronization message sent by the slave clock device, and acquires the third time synchronization received by the air interface physical layer
  • the master clock device sends a fourth time synchronization message to the slave clock device, and carries a time stamp of ⁇ 4 in the fourth time synchronization message.
  • the master clock device sends a first time synchronization message to the slave clock device.
  • the default primary clock device When time synchronization is required, the default primary clock device periodically sends a unique first time synchronization message in the form of multicast according to a preset interval (default is 2 seconds), such as a time synchronization message.
  • a preset interval default is 2 seconds
  • Sync all in the default primary clock device network segment, and the slave clock device with the same domain as the primary clock device can receive the above first time synchronization message.
  • the embodiment of the present invention only describes the interaction between a slave clock device and the master clock device. It can be understood that the interaction process between the other slave clock device and the master clock device may refer to the embodiment of the present invention. description.
  • the master clock device acquires a time when the first time synchronization message is sent through the RF.
  • the first time synchronization message sent by the master clock device needs to be processed by the physical layer, such as modulation and demodulation, and then transmitted through the RF. Therefore, the physical layer modulation and demodulation process may bring a certain time to the first time synchronization message.
  • the delay and jitter therefore, the master clock device can realize the processing of the physical layer modulation and demodulation by acquiring the time when the first time synchronization message is sent through the RF.
  • the compensation of the delay increases the accuracy of obtaining the transmission timing of the first time synchronization message.
  • the master clock device may obtain the time 1 ⁇ sent by the first time synchronization message according to the scheduling information of the first time synchronization message (the scheduling information is usually generated by the medium access control layer). Specifically, the master clock device may obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message through the RF, and calculate, according to the local clock and the time slot, send any one of the symbols in the time slot.
  • the scheduling information is usually generated by the medium access control layer.
  • the master clock device may obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message through the RF, and calculate, according to the local clock and the time slot, send any one of the symbols in the time slot.
  • the end time of transmitting the last symbol in the time slot can be calculated according to the local clock and the time slot, and The time when the first time synchronization message is sent by the radio frequency, or the start time of transmitting the last symbol in the time slot is calculated according to the local clock and the time slot, and is used as the time when the first time synchronization message is sent through the radio frequency or The time at which the first symbol in the time slot is transmitted is calculated according to the local clock and the time slot, and the time when the first time synchronization message is sent as a first time synchronization message is not limited herein.
  • the time 1 ⁇ sent by the first time synchronization message through the RF may also be obtained by means of hardware (such as a radio device or other hardware device).
  • hardware such as a radio device or other hardware device.
  • the transmitting end and the receiving end can be executed according to a unified hardware recording mechanism, thereby ensuring time synchronization precision of the master-slave time device. For example, in the interaction process of the time synchronization message between the master and slave clock devices, if the master clock device (or the slave clock device) acting as the transmitting end records the time synchronization message through the hardware, the end time of the last symbol in the time slot sent by the RF is recorded.
  • the slave clock device (or the master clock device) as the receiving end receives the time synchronization by the hardware physical layer of the air interface when receiving the time synchronization message.
  • the start time of the first symbol in the time slot of the message is recorded as the time when the air interface physical layer receives the time synchronization message; if the master clock device (or the slave clock device) serving as the transmitting end passes hardware (such as a radio frequency device) Or other hardware device) sends a time synchronization message via RF
  • the start time of the last symbol in the slot is recorded as the time synchronization cancellation, the packet, the time sent by the RF, and correspondingly, the slave clock device (or master clock device) as the receiving end receives the time synchronization message.
  • the start time of the second symbol in the time slot of the time synchronization message received by the physical layer of the air interface is recorded by the hardware, and is received as the air interface physical layer.
  • the time of the time synchronization message if the master clock device (or the slave clock device) as the transmitting end records the time synchronization message through the hardware, the start time of the first symbol in the time slot sent by the RF is recorded as the time
  • the corresponding slave clock device (or master clock device) receives the time synchronization message, and receives the air interface physical layer in the time slot of the time synchronization message through hardware.
  • the start time of the first symbol is recorded as the time when the air interface physical layer receives the time synchronization message, and so on.
  • the mechanism for recording the time of sending and receiving the time synchronization message by using the hardware may set the master and slave clock devices before performing the time synchronization operation, which is not limited herein.
  • the master clock device sends a second time synchronization message to the slave clock device, and carries a timestamp of 1 ⁇ in the second time synchronization message.
  • the master clock device After transmitting the first time synchronization message, the master clock device sends a second time synchronization message carrying a time stamp of 1 ⁇ to the slave clock device, such as a follow message Follow_up, so that the slave clock device knows that the master clock device passes
  • the clock device can obtain the time when the air interface physical layer receives the second time synchronization message when receiving the second time synchronization message.
  • the master clock device receives the third time synchronization message sent by the slave clock device, and acquires a time T 4 when the air interface physical layer receives the third time synchronization message.
  • the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and slave clock devices.
  • the slave clock device sends the third time synchronization message to the master clock device irregularly, such as may be delayed.
  • the request message Delay_Req the default value of the interval time may be a random value between 4 and 60 seconds.
  • the slave clock device may acquire the time T sent by the third time synchronization message through the RF. 3 .
  • the time ⁇ 4 at which the air interface physical layer receives the third time synchronization message is obtained to implement compensation for the processing delay of the physical layer modulation and demodulation.
  • the master clock device when receiving the third time synchronization message, may be configured according to scheduling information of the third time synchronization message (the scheduling information may be generated by the master clock device or by the slave clock device, for example, if the master clock device For the macro base station, the slave clock device is a micro base station or a user equipment, etc., the scheduling information may be generated by the master clock device, and vice versa, may be generated by the slave clock device. And obtaining a time T 4 when the air interface physical layer receives the third time synchronization message. Specifically, the master clock device may obtain, according to the scheduling information of the third time synchronization message, the corresponding time slot of the air interface physical layer to receive the third time synchronization message.
  • a start or end time of the physical layer received by the air interface physical layer as the time ⁇ 4 of receiving the third time synchronization message by the air interface physical layer.
  • the start time of the first symbol in the time slot received by the physical layer of the air interface can be calculated according to the local clock and the time slot, and the time ⁇ 4 of the third time synchronization message is received as the air interface physical layer.
  • the start time of the second symbol in the time slot received by the physical layer of the air interface is calculated according to the local clock and the time slot, and is received as the time ⁇ 4 of the third time synchronization message by the physical layer of the air interface. This is not a limitation.
  • the master clock device may also acquire the time when the air interface physical layer receives the third time synchronization message by using hardware recording.
  • the master clock time synchronization device sends a fourth message to the slave clock device, and to carry a timestamp ⁇ 4 in the fourth time synchronization message.
  • the master clock device may send a fourth time synchronization message carrying the timestamp of ⁇ 4 to the slave clock device, such as a delayed response message. Resp, so that the slave clock device knows the time T 4 at which the master clock device receives the third time synchronization message at the air interface physical layer.
  • the master clock is received from the device may be extended clock device sends a message (e.g., packets may follow Fol low_up) after the fourth time from the transmitting apparatus to carry a timestamp clock synchronization message to T 4, as can be delayed
  • the slave clock device learns the time T 4 at which the master clock device receives the third time synchronization message at the air interface physical layer.
  • the foregoing extended message is a message extended from the clock device by extending the 1588v2 protocol, and is sent to the primary clock device after the third time synchronization message is sent, and may carry the slave clock device in the added message.
  • the slave clock device may also not send the above extended message to the master clock device.
  • a time synchronization message interaction process is completed between the master and slave clock devices, and the slave clock device can be based on the clock.
  • the four time information obtained during the synchronization message interaction process is calculated correspondingly, and the local clock can be corrected according to the calculation result, and the slave clock device can also perform the time synchronization message interaction process between the master and slave clock devices.
  • the plurality of calculation results obtained by the calculation are averaged, and the local clock is corrected according to the average value, thereby realizing time synchronization between the master and slave clock devices.
  • time synchronization method described in this embodiment can be applied to various communication systems, such as a Long Term Evolution (LTE) communication system, a Universal Mobile Telecommunications System (UMTS), and a broadband.
  • LTE Long Term Evolution
  • UMTS Universal Mobile Telecommunications System
  • WCDMA Wideband Code Division Multiple Access
  • WIMAX Worldwide Interoperability for Microwave Access
  • GSM Global System for Mobile
  • the master clock device and the slave clock device may be base stations or other devices having wireless links.
  • the master clock device obtains the time when the first time synchronization message is sent by the RF and the time when the air interface physical layer receives the third time synchronization message, and passes the timestamps of the two times respectively through the second time.
  • the synchronization message and the fourth time synchronization message are sent to the slave clock device, so that the slave clock device can know that the master clock device sends the first time synchronization message through the RF and the third time synchronization message is received at the air interface physical layer, which is correspondingly improved.
  • the clock device subsequently calculates the accuracy of the clock offset from the master clock device, and uses a more accurate calculation result to correct the local clock of the slave clock device, thereby improving the time synchronization accuracy of the master-slave clock device.
  • the time synchronization method in the embodiment of the present invention will be described below from the perspective of a clock device.
  • Another embodiment of the time synchronization method in the embodiment of the present invention includes: receiving a first time synchronization message sent by the master clock device from the clock device, and acquiring a time T 2 at which the air interface physical layer receives the first time synchronization message; a second time synchronization message sent by the master clock device, and acquiring a timestamp of the time 1 ⁇ carried in the second time synchronization message, where the time 1@ the primary clock device sends the first time synchronization message through the RF Sending a third time synchronization message to the master clock device, and acquiring the time ⁇ 3 sent by the third time synchronization message through the RF;
  • the clock device receives the fourth time synchronization message sent by the master clock device, and acquires a timestamp of the time ⁇ 4 carried in the fourth time synchronization message, where the ⁇ 4 is received by the master clock device on the physical layer of the air interface.
  • the time of the third time synchronization message; the clock offset from the master clock device is calculated according to the above
  • the specific steps may include:
  • the default primary clock device When time synchronization is required, the default primary clock device periodically sends a unique first time synchronization message in the form of multicast according to a preset interval (default is 2 seconds), such as a time synchronization message.
  • a preset interval default is 2 seconds
  • Sync all in the default primary clock device network segment, and the slave clock device with the same domain as the primary clock device can receive the above first time synchronization message.
  • the time T 2 at which the air interface physical layer receives the first time synchronization message is obtained, so as to implement compensation for the processing delay of the physical layer modulation and demodulation.
  • the scheduling information of the first time synchronization message may be generated according to the scheduling information of the first time synchronization device (the scheduling information may be generated by the master clock device, or may be generated by the slave clock device, for example, if the master clock device is a macro base station, from the clock device is a micro base station or a user equipment, the scheduling information by the master clock device generates, on the contrary, by the slave clock device generates), obtaining air interface physical layer receiving the first time synchronization message time ⁇ 2 Specifically, the slave clock device may obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot in which the air interface physical layer receives the first time synchronization message, and calculate, according to the local clock and the time slot, the physical layer of the air interface receives the foregoing time.
  • the start or end time of any one of the slots is received as the time ⁇ 2 of the first time synchronization message as the air interface physical layer.
  • the physical layer reception of the air interface can be calculated according to the local clock and the time slot.
  • the time of receiving the first time synchronization message ⁇ 2 or calculate the starting time of the air interface physical layer receives the slot of the second symbol and said slots according to the local clock, which is received as a physical layer air interface
  • the time ⁇ 2 of the first time synchronization message is not limited herein.
  • the apparatus when the apparatus is received from the clock synchronization message to said first time, may acquire the physical layer air interface receiving the first time synchronization message by time T 2 records the hardware embodiment.
  • the hardware such as a radio frequency device or other hardware device
  • the transmitting end and the receiving end can be executed according to a unified hardware recording mechanism.
  • the master-slave clock device Assuring the time synchronization accuracy of the master-slave time device, for example, when the master-slave clock device performs the time synchronization message interaction, if the master clock device (or the slave clock device) acting as the sender transmits the time synchronization message through the RF through the hardware The end time of the last symbol in the slot is recorded as the time when the time synchronization message is sent by the RF, and accordingly, the slave clock device (or the master clock device) as the receiving end passes the time synchronization message when receiving the time synchronization message.
  • the hardware records the start time of the first symbol in the time slot in which the air interface physical layer receives the time synchronization message, and records the time when the air interface physical layer receives the time synchronization message; if it is the master clock device of the transmitting end ( Or from the clock device) through the hardware to send time synchronization messages through the RF
  • the start time of the last symbol in the outgoing time slot is recorded as the time when the time synchronization message is sent by the RF, and accordingly, the slave clock device (or master clock device) as the receiving end receives the In the time synchronization message, the start time of the second symbol in the time slot in which the air interface physical layer receives the time synchronization message is recorded by the hardware, and is recorded as the time when the air interface physical layer receives the time synchronization message;
  • the master clock device (or the slave clock device) as the transmitting end records the time synchronization message through the hardware at the start time of the first symbol in the time slot sent by the RF as the time when the time synchronization message is
  • the mechanism for recording the time of the transmission and the reception of the time synchronization by the hardware may set the master-slave clock device before the time synchronization operation is performed, which is not limited herein.
  • the slave device receives the second time synchronization message sent by the master clock device, such as the following message Follow_up, and obtains the time stamp of 1 ⁇ carried in the second time synchronization message, so that Perform subsequent calculations.
  • 1 ⁇ is the time when the above-mentioned master clock device sends the first time synchronization message through the RF.
  • the slave clock device sends a third time synchronization message to the master clock device.
  • the third slave clock device acquiring the time synchronization message sent by the RF time T 3;
  • the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device.
  • the slave clock device sends the third time synchronization message to the master clock device irregularly, such as delay.
  • the request message Delay_Req has an interval value default value of a random value between 4 and 60 seconds.
  • the modulation and demodulation processing of the physical layer may bring a certain time to the transmission of the third time synchronization message. Delay and jitter. Therefore, the time delay of processing the physical layer modulation and demodulation can be compensated by the clock device by acquiring the time when the third time synchronization message is sent through the RF, thereby improving the transmission time of acquiring the third time synchronization message. The accuracy.
  • the slave clock device may perform scheduling information according to the third time synchronization message (the scheduling information may be generated by the master clock device or may be generated by the slave clock device, for example, if the master clock device is a macro base station, the slave clock device is a micro base station or a user equipment, the scheduling information generated by the master clock device, and vice versa, may be generated from the clock device), the third time acquisition time synchronization message sent by RF T 3, in particular, from the clock apparatus according to And scheduling information of the third time synchronization message, acquiring a corresponding time slot sent by the third time synchronization message through the RF, calculating, according to the local clock and the time slot, a start or end time of sending any one of the time slots, and As the time ⁇ 3 sent by the third time synchronization message through the RF, for example, the end time of transmitting the last symbol in the time slot may be calculated according to the local clock and the time slot, and used as the third time synchronization message.
  • the scheduling information may be generated by the master clock device
  • the time the RF emission ⁇ 3 by the time the RF emission ⁇ 3, or calculated according to the local clock and said transmission time slot the Starting time of the last symbol of the slot, by the time the RF emission as a third time synchronization message ⁇ 3, or from the local clock and the calculated according to the above-described first symbol transmission time slot the slot At the beginning time, it is used as the time ⁇ 3 sent by the third time synchronization message through the RF, which is not limited herein.
  • the time ⁇ 3 sent by the third time synchronization message through the RF may also be obtained by means of hardware recording. Refer to step 301 for the specific manner of hardware recording. The description in the description will not be repeated here.
  • the slave clock device may send a new message to the master clock device, such as a follow-up report, by extending the 1588 ⁇ 2 protocol after acquiring the third time synchronization message through the time T 3 sent by the RF.
  • Wen Fol low_up, and carry timestamp T 3 in the new message to the master device can know the above-described clock time synchronization message sent from the third apparatus through the RF clock time ⁇ 3.
  • the slave clock device may not send the above-mentioned new message to the master clock device, which is not limited herein.
  • a fourth clock device by receiving the time synchronization message transmitted by the master clock device, for example, may be a Delay_Resp delay response packet, acquires a time stamp of the synchronization message carried in a fourth time T 4 of the, for the subsequent calculations.
  • ⁇ 4 is the time when the master clock device receives the third time synchronization message at the air interface physical layer.
  • the slave clock device calculates a clock offset from the master clock device according to the obtained ⁇ 2 , ⁇ 3, and ⁇ 4 ;
  • the message average delay Delay between the master clock device and the master clock device can be calculated according to the following formula, and the clock offset from the master clock device can be calculated accordingly. Offset:
  • T 2 T! + Delay + Offset
  • T 4 T 3 + Delay-Offset
  • Delay ( T 2 - 1 ⁇ +1> T 3 ) 12;
  • the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the values of the multiple Off sets obtained by the calculation are averaged.
  • the slave clock device corrects its local clock according to the calculated result
  • the slave clock device may correct the local clock according to the clock offset Off set, or may perform the clock skew according to the calculation after the time synchronization message interaction process between the master and slave clock devices.
  • the average of the shift Off set is corrected for its local clock to achieve time synchronization with the master clock device.
  • the time synchronization method described in this embodiment can be applied to various communication systems, such as UMTS, WCDMA, WIMAX, GSM, and LTE communication systems.
  • the master clock device and the slave clock device can be base stations or other devices with wireless links.
  • the time of the first time synchronization message sent by the master clock device carried in the two time synchronization messages and the time when the master clock device receives the third time synchronization message at the physical layer of the air interface is obtained.
  • the stamping device can make the slave clock device more accurately calculate the clock offset from the master clock device according to the obtained four time information, and correspondingly improve the accuracy of the slave clock device to correct the local clock according to the calculation result. , thereby improving the time synchronization accuracy of the master-slave clock device.
  • the following is an example of the time when the master-slave clock device obtains the time for transmitting or receiving the time synchronization message through the scheduling information or the time-frequency resource information, as shown in FIG. 4-a.
  • Another embodiment of the time synchronization method in the embodiment of the present invention may specifically include:
  • the master clock device sends a time synchronization message Sync to the slave clock device.
  • the default primary clock device When time synchronization is required, the default primary clock device periodically sends a unique Sync packet in multicast according to the preset interval (default is 2 seconds), and all are in the default primary clock device network. Within the segment, and the same slave clock device as the master clock device can receive the Sync message.
  • the master clock device obtains the time when the Sync message is sent through the RF according to the scheduling information of the Sync message.
  • the master clock device can obtain the corresponding time slot sent by the Sync message through the RF according to the scheduling information of the Sync message, and calculate the last symbol in the time slot according to the local clock and the time slot. At the end time, it is used as the Sync message at the time 1 ⁇ sent by the RF, or the start time of the last symbol in the time slot is calculated according to the local clock and the above time slot, and is used as the Sync message through the RF.
  • the time of time 1 ⁇ is sent, or, according to the local clock and the above time slot, the starting time of transmitting the first symbol in the time slot is calculated, and The time T ⁇ sent by the Sync message through the RF, or the start or end time of sending other symbols in the time slot according to the local clock and the above time slot, and sent as a Sync message through the RF.
  • Time 1 ⁇ not limited here.
  • the above time slot may be a time slot corresponding to one radio frame or subframe.
  • the slave clock device obtains the time slot of the physical layer receiving the Sync according to the scheduling information of the Sync message, and calculates the first one of the time slots received by the physical layer of the air interface according to the local clock and the time slot.
  • the start time of the symbol is received as the time T 2 of the Sync message as the air interface physical layer, or the start of the second symbol in the time slot received by the physical layer of the air interface is calculated according to the local clock and the time slot.
  • it is received as the time T 2 of the Sync message as the air interface physical layer, or the start or end time of the other symbols in the time slot received by the physical layer of the air interface may be calculated according to the local clock and the time slot.
  • the time T 2 at which the Sync message is received as the air interface physical layer is not limited herein.
  • the time slot may be a time slot corresponding to one radio frame or a subframe.
  • the master clock device passes the timestamp of T ⁇ to the slave clock device by following the message Fo 11 ow-up;
  • the master clock device After transmitting the Sync message, the master clock device sends a Fol low_up message carrying the time stamp of 1 ⁇ to the slave clock device, so that the slave clock device knows the time 1 ⁇ at which the master clock device sends the Sync message through the RF.
  • the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device.
  • the slave clock device sends the De l ay-Req ⁇ message to the master clock device irregularly.
  • the interval defaults to a random value between 4 and 60 seconds.
  • the slave clock device obtains, according to the scheduling information of the Delay-Req packet, the time slot sent by the Delay-Red 4 message through the RF, and calculates and sends the time slot according to the local clock and the time slot.
  • the end of the last symbol use it as De lay-Red
  • the time ⁇ 3 is sent, or the start time of transmitting the last symbol in the time slot is calculated according to the local clock and the time slot, and is used as the time T 3 sent by the Delay-Req message through the RF, or Calculating, according to the local clock and the foregoing time slot, the starting time of transmitting the first symbol in the time slot, and using it as the time when the Delay-Req message is sent by the RF ⁇ 3 , or according to the local clock and the foregoing
  • the time slot is used to calculate the start or end time of the other symbols in the time slot, and is used as the time T 3 sent by the Delay-Req message through the RF, which is not limited herein.
  • the master clock device receives the Delay-Req packet sent by the slave clock device, and obtains a time T 4 when the air interface physical layer receives the De lay-Req ⁇ message according to the scheduling information of the Delay-Red message. ;
  • the master clock device obtains the time slot of the Delay-Req packet received by the physical layer of the air interface according to the scheduling information of the Delay-Req packet, and calculates the physical layer of the air interface according to the local clock and the time slot.
  • the start time of the first symbol in the time slot is received as the air interface physical layer at time T 4 of the Delay-Req message, or the physical layer of the air interface is received according to the local clock and the time slot.
  • the start time of the second symbol in the time slot is received as the air interface physical layer at time T 4 of the Delay-Red frame, or the physical layer reception of the air interface may be calculated according to the local clock and the time slot.
  • the time T 4 of the Delay-Req message is received as the air interface physical layer at the start or end time of the other symbols in the time slot, which is not limited herein.
  • the slave clock device passes the timestamp of 1 ⁇ to the master clock device by following the message Fol low_up;
  • Slave clock device after transmitting the message De lay-Red, by extending-1588v2, to the new master clock device sends timestamp carrying Fol low_u T P of packet 3, so that the master clock device can be known from the above-described clock
  • the device sends the time T 3 of the above Delay-Red message through the RF.
  • the master clock device After receiving the Fol low_up message sent by the slave clock device, the master clock device sends a De 1 ay-Re s ⁇ message carrying the time stamp of T 4 to the slave clock device, so that the slave clock device learns the master clock device.
  • the time T 4 of the above Delay-Red message is received at the air interface physical layer.
  • the slave clock device calculates a clock offset from the master clock device according to the obtained ⁇ , ⁇ 2 , ⁇ , and ⁇ 4 ; After acquiring the ⁇ 2 , ⁇ 3 and ⁇ 4 from the clock device, the average delay of the message between the master clock device and the master clock device can be calculated according to the following formula, and the clock offset from the master clock device can be calculated accordingly. Offset:
  • T 2 T! + Delay + Offset
  • T 4 T 3 + Delay-Offset
  • Delay ( T 2 - 1 ⁇ +1> T 3 ) 12;
  • the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the multiple Of f sets obtained by calculation are averaged.
  • the slave clock device corrects its local clock according to the calculated result
  • the slave clock device can correct the local clock according to the clock offset Off set, or after calculating the time synchronization message interaction process between the master and slave clock devices.
  • the average of the offset Off set is corrected for its local clock to achieve time synchronization with the master clock device.
  • a sub-frame defined in the LTE system includes two time slots, each of which is 0. 5, for example, in the LTE system, by using the scheduling information to obtain the time of sending or receiving the time synchronization message.
  • the time slot of milliseconds includes 6 or 7 Orthogonal Frequency Division Multiplexing (OFDM) symbols, as shown in Figure 4b, and Figure 4-b shows the LTE system.
  • OFDM Orthogonal Frequency Division Multiplexing
  • the data to be transmitted after the baseband processing is carried by the 0F picture symbol, at the beginning of each symbol (such as ⁇ , t 2 , t 3 , t 4 , t 5 , t 6 and t 7 in Figure 4_b ) Transmitted by RF, correspondingly, the receiving end correspondingly receives the above-mentioned 0F drawing symbol.
  • the present invention provides three optional ways to obtain the time synchronization message transmission or reception time through the scheduling information, and the three methods provided may be better.
  • the symmetry of the time that the guaranteed time synchronization message is transmitted back and forth between the master and slave clock devices ensures the time synchronization accuracy of the master-slave time device.
  • a manner of obtaining a time for transmitting or receiving a time synchronization message by using scheduling information is provided in the embodiment of the present invention.
  • the specific implementation manner is as follows:
  • the transmission time is the same.
  • a step message such as a Sync message or a De 1 ay.Req message
  • the time slot of the subframe that carries the time synchronization message sent by the RF may be obtained according to the scheduling information of the time synchronization message, according to the local clock and the foregoing
  • the time slot calculates the end time ⁇ and ⁇ of the last symbol in the time slot, and uses ⁇ and as the time when the time synchronization message is sent through the RF, correspondingly as the clock device of the receiving end (such as the slave clock device or the master clock)
  • the device when receiving the time synchronization message, obtains a time slot of the subframe in which the air interface physical layer receives the time synchronization message according to the scheduling information of the time synchronization message, and calculates the physical layer of the air interface according to the local clock and the time slot.
  • the time synchronization message is The delays delay and de lay' in the transmission line are symmetrical, and because the acquisition is the end time of the last symbol in the time slot of the time synchronization message sent by RF and the physical interface of the air interface Receiving the start time of the first symbol in the time slot of the time synchronization message, so that the time of the transmission or reception of the subframe by the master-slave clock device due to the unsynchronization of the frequency between the master and slave clock devices can be eliminated, so With this acquisition method, the sending time and receiving time of the time synchronization message can be obtained more accurately.
  • FIG. 4-d Another manner for obtaining a time for transmitting or receiving a time synchronization message by using scheduling information is also provided in the embodiment of the present invention. For details, refer to FIG. 4-d.
  • the specific manner is as follows:
  • the scheduling information of the time synchronization message may be obtained through the RF.
  • the transmitted time slot of the subframe carrying the time synchronization message calculates the starting times t a2 and t of the last symbol in the time slot according to the local clock and the time slot. 2 , will t a2 and t.
  • the clock device as the receiving end when receiving the time synchronization message, obtains according to the scheduling information of the time synchronization message.
  • the air interface physical layer receives the time slot of the subframe that carries the time synchronization message, and calculates, according to the local clock and the time slot, the start times t b2 and t d2 of the second symbol in the time slot received by the air interface physical layer, t b2 and t d2 are the moments when the air interface physical layer receives the time synchronization message.
  • the delays of the time synchronization message during transmission are desymmetrical and de lay', and t a2 and t d2 Symmetric, t b2 and t. 2 symmetry, the acquisition time and the receiving time of the time synchronization message can also be accurately recorded by this acquisition method.
  • Another embodiment of the present invention further provides that the sending or receiving time is the same through scheduling information.
  • the way to step the message please refer to Figure 4-e in the following way:
  • the scheduling information of the time synchronization message may be obtained through the RF.
  • the transmitted time slot of the subframe carrying the time synchronization message calculates the starting times t a3 and t of the first symbol in the time slot according to the local clock and the time slot. 3 , will t a3 and t.
  • the clock device as the receiving end (such as the slave clock device or the master clock device), when receiving the time synchronization message, obtains according to the scheduling information of the time synchronization message.
  • the air interface physical layer receives the time slot of the subframe that carries the time synchronization message, and calculates, according to the local clock and the time slot, the start times t b3 and t d3 of the first symbol in the time slot received by the air interface physical layer, t b3 and t d3 are the moments when the air interface physical layer receives the time synchronization message.
  • the delays of the time synchronization message during transmission are desymmetrical and de yy', so In the same way, the sending time and the receiving time of the time synchronization message can be obtained more accurately.
  • the time when the time synchronization message is obtained by the scheduling information and the time when the air interface physical layer receives the time synchronization message the compensation for the processing delay of the physical layer modulation and demodulation is realized, thereby eliminating The effect of obtaining the accuracy of the transmission and reception time of the time synchronization message due to the delay and jitter of the processing such as the physical layer modulation and demodulation, and improving the accuracy of the time of transmitting and receiving the time synchronization message.
  • the obtained transmission and reception time information of the higher-precision time synchronization message is time-synchronized by the master-slave clock device, and the time synchronization accuracy of the master-slave clock device can be improved accordingly.
  • time synchronization method described in the embodiment of the present invention is described in detail by taking the time when the master-slave clock device acquires the time synchronization message at the physical layer of the air interface by means of hardware recording. description.
  • another embodiment of the time synchronization method in the embodiment of the present invention may specifically include:
  • the master clock device sends a time synchronization message Sync to the slave clock device;
  • the default primary clock device When time synchronization is required, the default primary clock device periodically sends a unique Sync packet in multicast according to the preset interval (default is 2 seconds), and all are in the default primary clock device network. Within the segment, and the same slave clock device as the master clock device Received a Sync message.
  • the master clock device records the time when the Sync message is sent through the RF through the hardware 1 ⁇ ;
  • the Sync message can be recorded by the hardware (such as a radio device or other hardware device) through the end time of the last symbol in the time slot sent by the RF, and sent as a Sync message through the RF.
  • the Sync message is recorded by the start time of the last symbol in the time slot sent by the RF, and is recorded as the Sync message by the start time of the symbol, as Sync.
  • the time when the text is sent by the RF, or the Sync/ ⁇ text can be recorded by the hardware through the start or end time of other symbols in the time slot sent by the RF, as the time when the Sync message is sent through the RF.
  • the time slot may be a time slot corresponding to one radio frame or subframe.
  • the clock device may record the start time of the first symbol in the time slot of the Sync message received by the physical layer of the air interface, as the time when the physical layer of the air interface receives the Sync message.
  • the start time of the second symbol in the slot of the Sync packet received by the physical layer of the air interface is recorded by the hardware, as the time when the physical layer of the air interface receives the Sync message, or the physical layer of the air interface may be used by hardware.
  • the start or end time of the other symbol in the slot in which the Sync packet is received is recorded as the time at which the Sync packet is received by the physical layer of the air interface, which is not limited herein.
  • the master clock device passes the timestamp of T ⁇ to the slave clock device by following the message Fo 1 1 ow-up;
  • the master clock device After transmitting the Sync message, the master clock device sends a Fo l low_up message carrying the time stamp of 1 ⁇ to the slave clock device, so that the slave clock device knows the time 1 when the master clock device sends the Sync message through the RF. .
  • the slave clock device sends a delay request message De 1 ay - Re d to the master clock device at time 1 3 ; in order to improve the correction precision, the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device. At this time, the slave clock device sends the De l ay-Req ⁇ message to the master clock device irregularly.
  • the interval time defaults to a random value between 4 and 60 seconds.
  • the slave device records the time T 3 sent by the Delay-Red message through the hardware through the hardware.
  • the Delay-Req message is sent from the clock device, the De l ay-Req message can be sent through the hardware.
  • the end time of the last symbol in the time slot sent by the RF is recorded as the time when the Delay-Req message is sent by RF, or by the hardware to send the Delay-Red message to the time slot sent by the RF.
  • the start time of the last symbol is recorded as the time when the release is made by the Delay-Req ⁇ text, or the first of the time slots issued by the RF by Delay-Req ⁇ t ⁇ by the hardware.
  • the start time of the symbol is recorded as the time when the Delay-Rec ⁇ message is sent by the RF, or the start of other symbols in the time slot issued by the RF by Delay-Red can also be transmitted by hardware. Recorded at the end time or as the time when the Delay-Req message is sent by RF, it is not limited here.
  • the master clock device can record the start time of the first symbol in the time slot of the physical layer receiving the Delay-Req ⁇ message through the hardware, and receive it as the air interface physical layer.
  • the start time of the second symbol in the time slot of the physical layer receiving the De 1 ay-Req ⁇ text is recorded by the hardware, and the De is received as the physical layer of the air interface.
  • the time of the lay-red packet, or the hardware starts to record the start or end time of other symbols in the time slot of the Delay-Red ⁇ physical layer, and receive the De lay-Req as the air interface physical layer.
  • the time of the message is not limited here.
  • the slave clock device passes the timestamp of 1 ⁇ to the master clock device by following the message Fol low_up;
  • Slave clock device after transmitting the message De lay-Red, by extending-1588v2, to the new master clock device sends timestamp carrying Fol low_u T P of packet 3, so that the master clock device can be known from the above-described clock
  • the device sends the time T 3 of the above Delay-Red message through the RF.
  • the master clock device After receiving the Fol low_up message sent by the slave clock device, the master clock device sends a De 1 ay-Re s ⁇ message carrying the time stamp of T 4 to the slave clock device, so that the slave clock device learns the master clock device.
  • the time T 4 of the above Delay-Red message is received at the air interface physical layer.
  • the slave clock device calculates a clock offset from the master clock device according to the foregoing ⁇ , ⁇ 2 , ⁇ , and ⁇ 4 ;
  • the average delay of the message between the slave clock and the master clock device can be calculated according to the following formula, and the master clock is calculated accordingly.
  • Backup clock offset Offset
  • T 2 T! + Delay + Offset
  • T 4 T 3 + Delay-Offset
  • Delay ( T 2 - 1 ⁇ +1> T 3 ) 12;
  • the slave clock device corrects its local clock according to the calculated result.
  • the slave clock device can correct its local clock according to the clock offset Off set, thereby achieving time synchronization with the master clock device.
  • the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the values of the multiple Off sets obtained by the calculation are averaged.
  • the steps of implementing the time synchronization method of the present invention by other hardware recording mechanisms may refer to the time synchronization method described in the foregoing embodiments, and the specific hardware recording mechanism may set the master-slave clock device when performing the time synchronization operation. This will not be repeated here.
  • the LTE system has a 0. 5ms time slot in the LTE system.
  • the following is a description of the hardware recording mechanism in the hardware recording mode, where the LTE system uses a hardware recording method to obtain a time of sending or receiving a time synchronization message.
  • a time-frequency structure can be as shown in the time-frequency structure shown in Figure 4-b.
  • three optional hardware recording mechanisms are provided in the embodiment of the present invention.
  • the time synchronization message can be better guaranteed in the master-slave The symmetry of the time of transmission between clock devices, thus ensuring the time synchronization accuracy of the master-slave time device.
  • a hardware recording mechanism provided by the present invention can be referred to as FIG. 5-b, and the specific implementation manner is as follows:
  • a clock device of the transmitting end such as a master clock device or a slave clock device
  • a time synchronization message such as a Sync message or When De 1 ay.Req message
  • the time synchronization message is transmitted by hardware through the end times t a4 and t of the last symbol in the time slot issued by the RF. 4 is recorded as the time when the time synchronization message is sent by the RF, and correspondingly, the clock device (such as the slave clock device or the master clock device) as the receiving end receives the time synchronization message through the hardware, and receives the physical layer of the air interface through the hardware.
  • the start times t b4 and t d4 of the first symbol in the time slot of the time synchronization message are recorded as the time when the air interface physical layer receives the time synchronization message.
  • the time synchronization message is The delays delay and de lay' in the transmission line are symmetrical, and because of the hardware Recording is the end time of the last symbol in the time slot of the time synchronization message sent by the RF and the start time of the first symbol in the time slot of the time slot receiving the time synchronization message of the air interface physical layer, so the master slave clock device is eliminated.
  • the time when the master-slave clock device transmits or receives the subframe is not synchronized due to the unsynchronized frequency, and therefore, the hardware recording method can more accurately record the transmission timing and the reception timing of the time synchronization message.
  • FIG. 5-c Another hardware recording mechanism provided by the present invention can be referred to FIG. 5-c in the following manner:
  • a clock device of the transmitting end such as a master clock device or a slave clock device
  • a time synchronization message (such as a Sync message or a De lay) is sent.
  • -Req message the time synchronization message is passed by hardware through the start time ⁇ 5 and t of the last symbol in the time slot issued by the RF.
  • the hardware recording method can also accurately record the sending time and receiving time of the time synchronization message.
  • FIG. 5-d Another hardware recording mechanism provided by the present invention can be referred to FIG. 5-d in the following manner:
  • a clock device of the transmitting end such as a master clock device or a slave clock device
  • a time synchronization message (such as a Sync message or De 1) is sent.
  • the time synchronization message is transmitted by hardware through the start times t a6 and t of the first symbol in the time slot issued by the RF.
  • time synchronization message recorded as the time of the time synchronization message through the RF emission, corresponding, as a clock device receiving end (e.g., the slave clock device, or master clock device), upon receiving the time synchronization message, by a hardware empty physical layer receiving opening
  • the time instants t b6 and t d6 of the first symbol in the time slot of the time synchronization message are recorded as the time at which the air interface physical layer receives the time synchronization message.
  • the time synchronization message is The delays delay and de lay' in the transmission process are symmetrical, and the hardware recording method can also accurately record the sending time and receiving time of the time synchronization message.
  • a master clock device includes:
  • the transceiver module 601 is configured to send a first time synchronization message to the slave clock device, and obtain a time when the first time synchronization message is sent by using the RF
  • the obtaining module 602 is configured to acquire a time when the transceiver module 601 sends the first time synchronization message by using the radio frequency.
  • the obtaining module 602 is specifically configured to obtain, according to the scheduling information of the first time synchronization message, a time when the first time synchronization message is sent by using the RF or a time when the first time synchronization message is sent by the hardware through the RF. ⁇ .
  • the obtaining module 602 can include:
  • the obtaining module 1 is configured to obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message by using a radio frequency;
  • the processing module 1 is configured to calculate, according to the time slot acquired by the local clock and the acquiring module, the end time of sending the last symbol in the time slot, as the time when the first time synchronization message is sent by using the radio frequency, or according to the local time.
  • the time slot obtained by the clock and the acquiring module calculates the starting time of transmitting the last symbol in the time slot, and uses it as the time when the first time synchronization message is sent by using the radio frequency or acquired according to the local clock and the acquiring module 1.
  • the time slot calculates the start time of transmitting the first symbol in the above time slot, and uses it as the time 1 ⁇ that the first time synchronization message is sent through the radio frequency.
  • the transceiver module 601 is further configured to send a second time synchronization message to the slave clock device, and carry a timestamp of the T i in the second time synchronization message;
  • the transceiver module 601 is further configured to receive the third time synchronization message sent by the slave clock device, and the acquiring module 602 is further configured to acquire, according to the third time synchronization message received by the transceiver module 601, the air interface physical layer to receive the third time synchronization message.
  • Time T 4 is further configured to acquire, according to the third time synchronization message received by the transceiver module 601, the air interface physical layer to receive the third time synchronization message.
  • the obtaining module 602 is specifically configured to synchronize according to the foregoing third time. Scheduling information message, acquires the air interface physical layer receives the third time synchronization message a time ⁇ 4; or a hardware recording time ⁇ 4 by the air interface physical layer receives the third time synchronization messages.
  • the obtaining module 602 includes:
  • the obtaining module 2 is configured to obtain, according to the scheduling information of the third time synchronization message, a corresponding time slot in which the air interface physical layer receives the third time synchronization message;
  • the processing module 2 is configured to calculate, according to the time slot acquired by the local clock and the acquiring module 2, the start time of the first symbol in the time slot received by the physical layer of the air interface, and receive the same as the primary clock device in the physical layer of the air interface.
  • the device receives the time ⁇ 4 of the third time synchronization message at the air interface physical layer.
  • Transceiver module 601 is further configured to the clock synchronization message from a sending device a fourth time, and carry timestamp Î ⁇ 4 in the fourth time synchronization message; to calculate according to the clock apparatus ⁇ 1 and 4 from the slave clock Î ⁇ The clock offset of the device from the master clock device, and correcting the local clock of the slave clock device according to the calculated clock offset.
  • the transceiver module 601 is further configured to receive the new message sent by the slave clock device by using the extended 1588 ⁇ 2 protocol, such as the following message F1 1 ow.up, and the obtaining module 602 may also be used to obtain The timestamp of ⁇ 3 carried in the above new message.
  • the extended 1588 ⁇ 2 protocol such as the following message F1 1 ow.up
  • the first time synchronization message is, for example, a time synchronization message Sync or other message
  • the second time synchronization message is, for example, a follow-up message Fo 1 1 ow_ up or other message
  • the third time synchronization message is, for example, Deferred request message De lay-Req or other message
  • the fourth time synchronization message is, for example, a delayed response message De lay-Re sp or other message.
  • the master clock device in this embodiment may be used as the master clock device in the foregoing method embodiment, and may be used to implement all the technical solutions in the foregoing method embodiments, and the functions of the respective function modules may be according to the foregoing method embodiments.
  • the functions of the respective function modules may be according to the foregoing method embodiments.
  • the master clock device obtains, by the obtaining module 602, the time when the first time synchronization message is sent by the RF and the time when the air interface physical layer receives the third time synchronization message. And sending, by the transceiver module 601, the timestamps of the two moments to the slave clock device through the second time synchronization message and the fourth time synchronization message, respectively, so that the slave clock device can know that the master clock device sends the first time through the RF. Synchronization message and the moment when the third time synchronization message is received at the physical layer of the air interface, correspondingly improve the accuracy of the clock device to calculate the clock offset from the master clock device, and use the more accurate calculation result to the slave clock device. The local clock is corrected to improve the time synchronization accuracy of the master and slave clock devices.
  • a slave clock device includes:
  • the transceiver module 701 is configured to receive the first time synchronization message sent by the master clock device, and the acquiring module 702 is configured to obtain, according to the first time synchronization message received by the transceiver module 701, the air interface physical layer to receive the first time synchronization message.
  • Time T 2 is configured to obtain, according to the first time synchronization message received by the transceiver module 701, the air interface physical layer to receive the first time synchronization message.
  • the obtaining module 702 is specifically configured to obtain, according to the scheduling information of the first time synchronization message, a time ⁇ 2 when the physical interface of the air interface receives the first time synchronization message; or receive the first physical layer through the hardware recording interface. The time of the synchronization message at a time ⁇ 2 .
  • the obtaining module 702 can include:
  • a first acquiring module configured to acquire, according to the scheduling information of the first time synchronization message, a corresponding time slot of the first physical synchronization message received by the physical layer of the air interface;
  • a first processing module configured to calculate, according to the local clock and the time slot acquired by the first acquiring module, a start time of the first symbol in the time slot received by the physical layer of the air interface, and use the same as the slave clock device in the air interface physical
  • the layer receives the time ⁇ 2 of the first time synchronization message, or calculates the starting time of the second symbol in the time slot received by the physical layer of the air interface according to the local clock and the time slot acquired by the first acquiring module, It is the time ⁇ 2 at which the slave clock device receives the first time synchronization message at the air interface physical layer.
  • the transceiver module 701 is further configured to receive the second time synchronization message sent by the master clock device.
  • the acquiring module 702 is further configured to obtain, by using the second time synchronization message received by the transceiver module 701, the 1 ⁇ a timestamp, where the above 1 ⁇ is a time when the master clock device sends the first time synchronization message by using the RF;
  • the transceiver module 701 is further configured to: after receiving the second time synchronization message, to the master clock The device sends a third time synchronization message;
  • Obtaining module 702 is further configured in accordance with a third time synchronization messages sent by the transceiver module 701, the third acquisition time synchronization message through radio frequency emitted T 3;
  • the obtaining module 702 is specifically configured to obtain, according to the scheduling information of the third time synchronization message, a time ⁇ 3 sent by the third time synchronization message by using the RF, or send a third time synchronization message through the hardware to send the RF through the RF.
  • the moment ⁇ 3 is specifically configured to obtain, according to the scheduling information of the third time synchronization message, a time ⁇ 3 sent by the third time synchronization message by using the RF, or send a third time synchronization message through the hardware to send the RF through the RF.
  • the obtaining module 702 can include:
  • a second acquiring module configured to obtain, according to the scheduling information of the third time synchronization message, a corresponding time slot sent by the third time synchronization message by using a radio frequency
  • a second processing module configured to calculate, according to the local clock and the time slot acquired by the second processing module, an end time of transmitting the last symbol in the time slot, as a time when the third time synchronization message is sent by using the radio frequency ⁇ 3 Or calculating, according to the local clock and the time slot acquired by the second processing module, the start time of transmitting the last symbol in the time slot, as the time ⁇ 3 sent by the third time synchronization message through the radio frequency, or Calculating, according to the local clock and the time slot acquired by the second processing module, the starting time of transmitting the first symbol in the time slot as the time ⁇ 3 sent by the third time synchronization message through the radio frequency.
  • the transceiver module 701 may be further configured to: after the extension of the 1588 ⁇ 2 protocol, send a new message to the master clock device, such as a follow message Follow_up, where the new message carries the slave clock device.
  • the master clock device such as a follow message Follow_up
  • the transceiver module 701 is further configured to receive a fourth time synchronization message sent by the master clock device, where the acquiring module 702 is further configured to acquire a timestamp of the time ⁇ 4 carried in the fourth time synchronization message, where the ⁇ 4 is the foregoing The time at which the master clock device receives the third time synchronization message on the physical layer of the air interface;
  • the processing module 703 is configured to calculate a clock offset from the master clock device according to the foregoing ⁇ 2 , ⁇ 3, and ⁇ 4 ;
  • Delay ( T 2 - 1 ⁇ +1> T 3 ) 12;
  • the correction module 704 is configured to correct the local clock according to the result calculated by the processing module 703.
  • the correction module 704 can correct the local clock according to the clock offset Offset, or after the time synchronization message interaction process between the master and slave clock devices, the processing module 703
  • the values of the plurality of clock offsets Off se t obtained by performing the multiple operations are averaged, and the local clock is corrected based on the average value to achieve time synchronization with the master clock device.
  • the first time synchronization message is, for example, a time synchronization message Sync or other message
  • the second time synchronization message is, for example, a follow-up message Fo 1 1 ow_ up or other message
  • the third time synchronization message is, for example, Deferred request message De lay-Req or other message
  • the fourth time synchronization message is, for example, a delayed response message De lay-Re sp or other message.
  • slave clock device in this embodiment may be used as the slave clock device in the foregoing method embodiment, and may be used to implement all the technical solutions in the foregoing method embodiments, and the functions of the function modules may be according to the foregoing method embodiments.
  • the functions of the function modules may be according to the foregoing method embodiments.
  • the obtaining, by the acquiring device 702, the clock device obtains the time T 2 of the first time synchronization message received by the physical layer of the air interface, and acquires the time L sent by the third synchronization message by using the radio to obtain the second time synchronization message.
  • the clock offset improves the accuracy of the correction of the local clock by the correction module 704 according to the calculation result of the processing module 703, thereby improving the time synchronization accuracy of the master-slave clock device.
  • the embodiment of the present invention further provides a time synchronization system for implementing the time synchronization method described above. A time synchronization system provided by the implementation of the present invention is described below.
  • a time synchronization system includes: Master clock device 801 and slave clock device 802.
  • the master clock device 801 is configured to send the first time synchronization message to the slave clock device 802, and acquire the time 1 ⁇ sent by the first time synchronization message through the RF; send the second time synchronization message to the slave clock device 802, and The second time synchronization message carries a timestamp of 1 ⁇ ; receives the third time synchronization message sent by the slave clock device 802, and acquires the time T 4 at which the air interface physical layer receives the third time synchronization message; to the slave clock device 802 A fourth time synchronization message is sent, and a timestamp of ⁇ 4 is carried in the fourth time synchronization message.
  • the slave clock device 802 is configured to receive the first time synchronization message sent by the master clock device 801, and acquire the time ⁇ 2 when the air interface physical layer receives the first time synchronization message; receive the second time synchronization sent by the master clock device 801. a message, and acquiring a timestamp of the time 1 ⁇ carried in the second time synchronization message, where the above 1 ⁇ is the time when the primary clock device 801 sends the first time synchronization message by using the RF; and sends the first time to the master clock device 801.
  • the structure of the master clock device 801 in this embodiment may be a master clock device as shown in FIG. 6.
  • the structure of the slave clock device 802 in this embodiment can be a slave clock device as shown in FIG.
  • the master clock device 801 of the embodiment may be the master clock device in the foregoing method embodiment
  • the slave clock device 802 may be the slave clock device in the foregoing method embodiment, which may be used to implement the foregoing method embodiment.
  • the functions of the various functional modules may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, refer to the related description in the foregoing embodiments, and details are not described herein again.
  • the time synchronization system acquires the time when the time synchronization message is sent by the RF and the time when the physical layer of the air interface receives the time synchronization message, as the time of sending and receiving the time synchronization message, thereby eliminating the physical physics.
  • the transmission and reception time information of the synchronization message is time-synchronized by the master-slave clock device, and the time synchronization accuracy of the master-slave clock device can be improved accordingly.
  • the medium can be a read only memory, a magnetic disk or a compact disk or the like.

Abstract

A method for time synchronization and device and system thereof in the embodiment of the present invention are provided. Wherein, the method for time synchronization includes the following steps: a master clock device transmits a first time synchronization message to a slave clock device, and obtains a time T1 at which the first time synchronization message is transmitted through a radio frequency; the master clock device transmits a second time synchronization message which carries a time stamp of T1 to the slave clock device; the master clock device receives a third time synchronization message transmitted from the slave clock device, and obtains a time T4 at which the third synchronization message is received by an air interface physical layer; the master clock device transmits a forth time synchronization message which carries a time stamp of T4 to the slave clock device, so that the slave clock device calculates the clock offset between the slave clock device and the master clock device according to T1 and T4, and modifies the local clock of the slave clock device according to the calculated clock offset. The embodiment of the present invention is in favor of improving the time synchronization precision of the master and the slave clock devices.

Description

时间同步方法和相关 i殳备及系统 本申请要求于 2010 年 10 月 27 日提交中国专利局、 申请号为 201010527699.9、发明名称为"时间同步方法和相关设备及系统"的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。  Time synchronization method and related equipment and system This application claims priority to Chinese patent application filed on October 27, 2010, the Chinese Patent Office, Application No. 201010527699.9, entitled "Time Synchronization Method and Related Equipment and System" The entire contents of which are incorporated herein by reference.
技术领域 Technical field
本发明涉及通信领域, 尤其涉及一种时间同步方法和相关设备及系统。 背景技术  The present invention relates to the field of communications, and in particular, to a time synchronization method and related devices and systems. Background technique
目前, 随着通信网络核心网网络协议( IP, Internet Protocol )化改造的 逐步完成, 无线接入网的 IP化将成为整个移动网络向全 IP ( ALL-IP )网络 演进的关键。 而在实现无线接入网 IP化的过程中, 时间同步问题是需要重 点研究并解决的问题。 时间同步指的是不同系统之间的绝对时间是相同的, 如在通信系统中, 每个系统都有内部时间, 即本地时钟, 其由该系统的时 钟设备所管理, 由于每个系统的本地时钟都是独立运行的, 所以各个系统 的本地时钟不一定是相同的, 而在分布式的网络环境之中, 如果没有一个 统一、 准确的时间标准, 那么系统将很难正常的协调各子系统的运行, 时 间同步技术就是将各个不同系统之间的时间偏差控制在特定范围之内的技 术。  At present, with the gradual completion of the transformation of the core network protocol (IP, Internet Protocol) of the communication network, the IP of the wireless access network will become the key to the evolution of the entire mobile network to an all-IP (ALL-IP) network. In the process of realizing the IP access of the wireless access network, the time synchronization problem is a problem that needs to be studied and solved. Time synchronization means that the absolute time between different systems is the same. For example, in a communication system, each system has an internal time, that is, a local clock, which is managed by the clock device of the system, due to the locality of each system. The clocks are all running independently, so the local clocks of the various systems are not necessarily the same. In a distributed network environment, if there is no uniform and accurate time standard, the system will be difficult to coordinate the subsystems normally. Operation, time synchronization technology is a technology that controls the time deviation between different systems within a certain range.
为实现网络设备间的时间同步, 网络中引入了美国电气和电子工程师 十办会 ( IEEE, Institute of Electrical and Electronics Engineers ) -1588标准, IEEE-1588定义了精确时间协议( PTP , Precision Time Protocol ) , 以其基于 IEEE-1588 标准实现有线网络中时钟最精确的设备与其它时钟设备的时间 同步。  In order to achieve time synchronization between network devices, the IEEE, Institute of Electrical and Electronics Engineers -1588 standard was introduced in the network. IEEE-1588 defines the Precision Time Protocol (PTP). Time synchronization of other clock devices in the wired network with other clock devices based on the IEEE-1588 standard.
实践发现, 现有有线网络中主从时钟设备时间同步机制在应用到无线 网络中时, 主从时钟设备之间的时间同步精度通常较低。 发明内容  It has been found that when the time synchronization mechanism of the master-slave clock device in the existing wired network is applied to the wireless network, the time synchronization accuracy between the master and slave clock devices is usually low. Summary of the invention
本发明实施例提供一种时间同步方法和相关设备及系统, 用于提高主 从时钟设备的时间同步精度。 Embodiments of the present invention provide a time synchronization method and related device and system, which are used to improve a main Time synchronization accuracy from the clock device.
为解决上述技术问题, 本发明实施例提供以下技术方案:  To solve the above technical problem, the embodiment of the present invention provides the following technical solutions:
一种时间同步方法, 包括:  A time synchronization method, including:
主时钟设备向从时钟设备发送第一时间同步消息, 并获取上述第一时 间同步消息通过射频发出的时刻  The master clock device sends the first time synchronization message to the slave clock device, and acquires the time when the first time synchronization message is sent through the radio frequency.
主时钟设备向上述从时钟设备发送第二时间同步消息, 并在上述第二 时间同步消息中携带上述 1\的时间戳;  The master clock device sends a second time synchronization message to the slave clock device, and carries the time stamp of the above 1\ in the second time synchronization message;
主时钟设备接收由上述从时钟设备发送的第三时间同步消息, 并获取 空口物理层接收到上述第三时间同步消息的时刻 τ4; The master clock device receives the third time synchronization message sent by the slave clock device, and acquires the time τ 4 when the air interface physical layer receives the third time synchronization message;
主时钟设备向上述从时钟设备发送第四时间同步消息, 并在上述第四 时间同步消息中携带上述 Τ4的时间戳, 以便于上述从时钟设备根据上述 1\ 和 τ4计算上述从时钟设备与上述主时钟设备的时钟偏移量, 并根据计算的 上述时钟偏移量, 对上述从时钟设备的本地时钟进行修正。 The master clock device sends a fourth time synchronization message to the slave clock device, and carries the time stamp of the Τ 4 in the fourth time synchronization message, so that the slave clock device calculates the slave clock device according to the foregoing 1\ and τ 4 And a clock offset of the master clock device, and correcting the local clock of the slave clock device according to the calculated clock offset.
一种时间同步方法, 包括:  A time synchronization method, including:
从时钟设备接收由主时钟设备发送的第一时间同步消息, 并获取空口 物理层接收到上述第一时间同步消息的时刻 τ2; Receiving, by the clock device, the first time synchronization message sent by the master clock device, and acquiring the time τ 2 at which the air interface physical layer receives the first time synchronization message;
从时钟设备接收由上述主时钟设备发送的第二时间同步消息, 并获取 上述第二时间同步消息中携带1\的时间戳, 其中, 上述 1\为上述主时钟设 备通过射频发出上述第一时间同步消息的时刻;  Receiving, by the clock device, the second time synchronization message sent by the master clock device, and acquiring the timestamp of the first time synchronization message carrying the 1\, wherein the first clock is sent by the master clock device by using the radio frequency. The moment of synchronizing the message;
从时钟设备向上述主时钟设备发送第三时间同步消息, 并获取上述第 三时间同步消息通过射频发出的时刻 τ3; Transmitting, by the clock device, the third time synchronization message to the master clock device, and acquiring the time τ 3 sent by the third time synchronization message through the radio frequency;
从时钟设备接收由上述主时钟设备发送的第四时间同步消息, 并获取 上述第四时间同步消息中携带的 τ4的时间戳, 其中, 上述 τ4为上述主时钟 设备在空口物理层上接收到上述第三时间同步消息的时刻; Receiving, by the clock device, a fourth time synchronization message sent by the master clock device, and acquiring a timestamp of τ 4 carried in the fourth time synchronization message, where the τ 4 is received by the master clock device on the physical layer of the air interface The time to the third time synchronization message described above;
从时钟设备根据上述 1\、 τ2、 τ3和 τ4计算上述从时钟设备与上述主时 钟设备的时钟偏移量; The slave clock device calculates a clock offset of the slave clock device and the master clock device according to the above 1\, τ 2 , τ 3 and τ 4 ;
从时钟设备根据计算的上述时钟偏移量, 对上述从时钟设备的本地时 钟进行修正。  The slave clock device corrects the local clock of the slave clock device based on the calculated clock offset.
一种主时钟设备, 包括: 收发模块, 用于向从时钟设备发送第一时间同步消息; A master clock device, including: a transceiver module, configured to send a first time synchronization message to the slave clock device;
获取模块, 用于获取上述收发模块通过射频发出上述第一时间同步消 息的时刻  An acquiring module, configured to acquire a time when the transceiver module sends the first time synchronization message by using a radio frequency
上述收发模块还用于向上述从时钟设备发送第二时间同步消息, 并在 上述第二时间同步消息中携带上述 1\的时间戳;  The transceiver module is further configured to send the second time synchronization message to the slave clock device, and carry the time stamp of the above 1\ in the second time synchronization message;
上述收发模块还用于接收由上述从时钟设备发送的第三时间同步消 息;  The transceiver module is further configured to receive a third time synchronization message sent by the slave clock device.
上述获取模块还用于在上述收发模块发送第三同步消息时获取空口物 理层接收上述第三时间同步消息的时刻 τ4; The obtaining module is further configured to acquire, when the transceiver module sends the third synchronization message, the time τ 4 at which the air interface physical layer receives the third time synchronization message;
上述收发模块还用于向上述从时钟设备发送第四时间同步消息, 并在 上述第四时间同步消息中携带上述 τ4的时间戳; 以便于上述从时钟设备根 据上述 1\和 τ4计算上述从时钟设备与上述主时钟设备的时钟偏移量, 并根 据计算的上述时钟偏移量, 对上述从时钟设备的本地时钟进行修正。 The transceiver module is further configured to send a fourth time synchronization message to the slave clock device, and carry the time stamp of the τ 4 in the fourth time synchronization message; so that the slave clock device calculates the foregoing according to the foregoing 1 and τ 4 The clock offset of the slave clock device from the clock device and the master clock device is corrected, and the local clock of the slave clock device is corrected according to the calculated clock offset.
一种从时钟设备, 包括:  A slave clock device, including:
收发模块, 用于接收由主时钟设备发送的第一时间同步消息; 获取模块, 用于根据上述收发模块接收的第一时间同步消息获取空口 物理层接收到上述第一时间同步消息的时刻 τ2; a transceiver module, configured to receive a first time synchronization message sent by the master clock device, and an acquiring module, configured to acquire, according to the first time synchronization message received by the transceiver module, a time τ 2 when the air interface physical layer receives the first time synchronization message ;
上述收发模块还用于接收由上述主时钟设备发送的第二时间同步消 息, 上述第二时间同步消息携带 1\的时间戳;  The transceiver module is further configured to receive a second time synchronization message sent by the primary clock device, where the second time synchronization message carries a time stamp of 1\;
上述获取模块用于从上述收发模块接收上述第二同步消息中获取上述 第二时间同步消息中携带 的时间戳, 其中, 上述 1\为上述主时钟设备通 过射频发出上述第一时间同步消息的时刻;  The acquiring module is configured to receive, by using the second synchronization message, the timestamp carried in the second time synchronization message, where the first time is a time when the primary clock device sends the first time synchronization message by using a radio frequency. ;
上述收发模块还用于向上述主时钟设备发送第三时间同步消息; 上述获取模块还用于在上述收发模块发送第三时间同步消息时获取上 述第三同步消息通过射频发出的时刻 τ3; The transceiver module is further configured to send a third time synchronization message to the master clock device; the acquiring module is further configured to: when the transceiver module sends the third time synchronization message, acquire the time τ 3 sent by the third synchronization message by using the radio frequency;
上述收发模块还用于接收由上述主时钟设备发送的第四时间同步消 息, 并获取上述第四时间同步消息中携带的 τ4的时间戳, 其中, 上述 τ4 为上述主时钟设备在空口物理层上接收到上述第三时间同步消息的时刻; 处理模块, 用于根据上述获取模块获取的 1\、 τ2、 τ3和 τ4计算上述从 时钟设备与上述主时钟设备的时钟偏移量; The transceiver module is further configured to receive a fourth time synchronization message sent by the master clock device, and obtain a timestamp of τ 4 carried in the fourth time synchronization message, where the τ 4 is the air interface physics of the master clock device. a time when the third time synchronization message is received on the layer; the processing module is configured to calculate the slave according to 1\, τ 2 , τ 3 and τ 4 acquired by the acquiring module The clock offset of the clock device from the above-mentioned master clock device;
修正模块, 用于根据上述处理模块计算的上述时钟偏移量, 对上述从 时钟设备的本地时钟进行修正。  And a correction module, configured to correct the local clock of the slave clock device according to the clock offset calculated by the processing module.
一种时间同步系统, 包括:  A time synchronization system, including:
主时钟设备, 用于向从时钟设备发送第一时间同步消息, 并获取上述 第一时间同步消息通过射频发出的时刻 向上述从时钟设备发送第二时 间同步消息, 并在上述第二时间同步消息中携上述 1\的时间戳; 接收由上 述从时钟设备发送的第三时间同步消息, 并获取空口物理层接收到上述第 三时间同步消息的时刻 τ4; 向上述从时钟设备发送第四时间同步消息, 并 在上述第四时间同步消息中携带上述 τ4的时间戳; a master clock device, configured to send a first time synchronization message to the slave clock device, and obtain a second time synchronization message sent to the slave clock device by using the time when the first time synchronization message is sent by using the radio frequency, and in the second time synchronization message Carrying the timestamp of the above 1\; receiving the third time synchronization message sent by the slave clock device, and acquiring the time τ 4 when the air interface physical layer receives the third time synchronization message; sending the fourth time to the slave clock device Synchronizing the message, and carrying the time stamp of the above τ 4 in the fourth time synchronization message;
从时钟设备, 用于接收上述主时钟设备发送的第一时间同步消息, 并 获取空口物理层接收到上述第一时间同步消息的时刻 τ2; 接收由上述主时 钟设备发送的第二时间同步消息, 并获取上述第二时间同步消息中携带的 时刻 1\的时间戳, 上述 1\为上述主时钟设备通过射频发出上述第一时间同 步消息的时刻; 向上述主时钟设备发送第三时间同步消息, 并获取上述第 三时间同步消息通过射频发出的时刻 τ3; 接收由上述主时钟设备发送的第 四时间同步消息, 并获取上述第四时间同步消息中携带的时刻 τ4的时间戳, 上述 τ4为上述主时钟设备在空口物理层上接收到上述第三时间同步消息的 时刻; 根据上述 τ\、 τ2、 τ3和 τ4计算上述从时钟设备与主时钟设备的时钟偏 移量; 根据计算的时钟偏移量, 对上述从时钟设备的本地时钟进行修正。 The slave clock device is configured to receive the first time synchronization message sent by the master clock device, and obtain the time τ 2 when the air interface physical layer receives the first time synchronization message, and receive the second time synchronization message sent by the master clock device. And obtaining the timestamp of the time 1\ carried in the second time synchronization message, where 1\ is the time when the primary clock device sends the first time synchronization message by using the radio frequency; and sending the third time synchronization message to the primary clock device. And acquiring the time τ 3 sent by the third time synchronization message by using the radio frequency; receiving the fourth time synchronization message sent by the master clock device, and acquiring the time stamp of the time τ 4 carried in the fourth time synchronization message, τ 4 is a time when the master clock device receives the third time synchronization message on the air interface physical layer; and calculates a clock offset between the slave clock device and the master clock device according to the above τ\, τ 2 , τ 3 and τ 4 Correction of the local clock of the above slave clock device based on the calculated clock offset.
从以上技术方案可以看出, 本发明实施例具有以下优点:  As can be seen from the above technical solutions, the embodiments of the present invention have the following advantages:
本发明实施例中,主从时钟设备获取时间同步消息通过射频( RF, Rad io Frequency ) 发出的时刻以及获取空口物理层接收到时间同步消息的时刻, 作为时间同步消息的发送和接收时刻, 从而, 可剔除因物理层调制解调等 处理的时延和抖动而对获取时间同步消息的发送和接收时刻的精确度的影 响, 提高获取时间同步消息的发送和接收时刻的精确度, 利用该获取的更 高精确度的时间同步消息的发送和接收时刻信息, 进行主从时钟设备的时 间同步, 能够相应提高主从时钟设备的时间同步精度。  In the embodiment of the present invention, the master-slave clock device acquires the time when the time synchronization message is sent by the radio frequency (RF, Rad io Frequency) and the time when the physical layer of the air interface receives the time synchronization message, as the time of sending and receiving the time synchronization message, thereby The influence of the delay and jitter of the processing such as physical layer modulation and demodulation on the accuracy of acquiring the time of sending and receiving the time synchronization message can be eliminated, and the accuracy of the time of sending and receiving the time synchronization message is improved, and the acquisition is utilized. The higher accuracy of the time synchronization message transmission and reception time information, the time synchronization of the master-slave clock device, can improve the time synchronization accuracy of the master-slave clock device.
附图说明 图 1为现有技术的一种时间同步方法的流程示意图; DRAWINGS 1 is a schematic flow chart of a time synchronization method in the prior art;
图 2为本发明实施例提供的时间同步方法的一个实施例流程示意图; 图 3为本发明实施例提供的时间同步方法的另一个实施例流程示意图; 图 4-a 为本发明实施例提供的时间同步方法的另一个实施例流程示意 图;  FIG. 2 is a schematic flowchart of another embodiment of a time synchronization method according to an embodiment of the present invention; FIG. 3 is a schematic flowchart of another embodiment of a time synchronization method according to an embodiment of the present invention; FIG. A schematic flow diagram of another embodiment of a time synchronization method;
图 4-b为本发明实施例提供的 LTE系统中一个 0. 5毫秒时隙的一种时 频结构示意图;  FIG. 4 is a schematic diagram of a time-frequency structure of a 0.5 millisecond time slot in an LTE system according to an embodiment of the present disclosure;
图 4-c 为本发明实施例提供的一种通过调度信息或时频资源信息获取 发送或接收时间同步消息的时刻的方式示意图;  FIG. 4 is a schematic diagram of a manner of acquiring a time for sending or receiving a time synchronization message by using scheduling information or time-frequency resource information according to an embodiment of the present disclosure;
图 4-d为本发明实施例提供的另一种通过调度信息或时频资源信息获 取发送或接收时间同步消息的时刻的方式示意图;  FIG. 4 is a schematic diagram of another manner of obtaining, by using scheduling information or time-frequency resource information, a time for transmitting or receiving a time synchronization message according to an embodiment of the present disclosure;
图 4-e 为本发明实施例提供的另一种通过调度信息或时频资源信息获 取发送或接收时间同步消息的时刻的方式示意图;  FIG. 4 is a schematic diagram of another manner of obtaining, by using scheduling information or time-frequency resource information, a time for transmitting or receiving a time synchronization message according to an embodiment of the present disclosure;
图 5-a 为本发明实施例提供的时间同步方法的另一个实施例流程示意 图;  FIG. 5-a is a schematic flow chart of another embodiment of a time synchronization method according to an embodiment of the present invention;
图 5-b为本发明实施例提供的一种硬件记录方式示意图;  FIG. 5 is a schematic diagram of a hardware recording manner according to an embodiment of the present disclosure;
图 5-c为本发明实施例提供的另一种硬件记录方式示意图;  FIG. 5 is a schematic diagram of another hardware recording manner according to an embodiment of the present disclosure;
图 5-d为本发明实施例提供的另一种硬件记录方式示意图;  FIG. 5-d is a schematic diagram of another hardware recording manner according to an embodiment of the present disclosure;
图 6为本发明实施例提供的一种主时钟设备结构示意图;  FIG. 6 is a schematic structural diagram of a master clock device according to an embodiment of the present disclosure;
图 7为本发明实施例提供的一种从时钟设备结构示意图;  FIG. 7 is a schematic structural diagram of a slave clock device according to an embodiment of the present disclosure;
图 8为本发明实施例提供的一种时间同步系统结构示意图。 具体实施方式  FIG. 8 is a schematic structural diagram of a time synchronization system according to an embodiment of the present invention. detailed description
本发明实施例提供了一种时间同步方法和相关设备及系统, 用于提高 主从时钟设备的时间同步精度。  Embodiments of the present invention provide a time synchronization method and related device and system for improving time synchronization accuracy of a master-slave clock device.
为了使本技术领域的人员更好地理解本发明方案, 下面将结合本发明 实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分的实施例, 而不是全部的实施 例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动 前提下所获得的所有其他实施例, 都应当属于本发明保护的范围。  The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is an embodiment of the invention, but not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
实现设备间时间同步的基本原理是, 在通信系统中默认一个系统的设 备为主时钟设备, 其它设备为从时钟设备。 主从时钟设备和从时钟设备间 传递携带时间戳的时间同步消息 (包括时间同步 4艮文、 跟随 4艮文和延迟响 应报文等 PTP消息),从时钟设备通过该时间戳描述的时间信息, 计算主从 时钟设备和从时钟设备之间的时钟偏移量, 并根据计算的结果对从时钟设 备的本地时钟进行修正, 从而实现了从时钟设备与主时钟设备的时间同步。 The basic principle of realizing time synchronization between devices is to set a system default in the communication system. It is a master clock device, and other devices are slave clock devices. A time synchronization message carrying a time stamp (including a time synchronization message, a PTP message following a message, and a delayed response message) is transmitted between the master clock device and the slave clock device, and the time information described by the clock device through the time stamp. Calculating the clock offset between the master clock device and the slave clock device, and correcting the local clock of the slave clock device according to the calculation result, thereby realizing time synchronization between the slave clock device and the master clock device.
参照图 1 , 现有的有线网络中, 主从时钟设备实现时间同步的具体过程 可以 ¾口下:  Referring to Figure 1, in the existing wired network, the specific process of time synchronization between the master and slave clock devices can be:
XI、 主时钟设备向从时钟设备发送时间同步 4艮文 Sync , 并测量该 Sync 报文离开应用层的准确时刻  XI, the master clock device sends time synchronization to the slave clock device, and measures the exact time when the Sync message leaves the application layer.
X2、 从时钟设备测量接收到的 Sync报文到达其应用层的准确时刻 t2;X2, measuring the accurate time t 2 of the received Sync message from the clock device to its application layer;
X3、 主时钟设备在发送 Sync报文之后发送跟随报文 Follow_up , 并在 该 Follow_up报文中携带 的时间戳; X3. The master clock device sends a follow message to the Follow_up message after sending the Sync message, and carries the timestamp in the Follow_up message;
X4、 从时钟设备通过接收该 Follow_up报文获取 t!的时间戳; 从时钟 设备向主时钟设备发送延迟请求报文 Delay_Req , 并测量该 Delay_Req报 文离开其应用层的准确时刻 t3; ! X4, obtaining t Follow_up by receiving the packets from the time stamp clock device; transmitting a clock from the master clock device to device Delay_Req delay request message, and measuring the exact moment Delay_Req packet leaves the application layer. 3 t;
X5、 主时钟设备接收到该 Delay_Req 4艮文时, 测量该 Delay_Req消息 到达其应用层的准确时刻 t4; X5, when the master clock device receives the Delay_Req 4 message, measuring the exact time t 4 that the Delay_Req message reaches its application layer;
X6、 主时钟设备向该从时钟设备发送延迟响应报文 Delay_Resp , 并在 该 Delay_Resp报文中携带 t4的时间戳, 从时钟设备通过接收该 Delay_Resp 报文获取 t4的时间戳; X6, the master clock device to the slave clock device transmits a response packet delay Delay_Resp, 4 and carry the time stamp t Delay_Resp message, acquires a time stamp of t 4 the slave clock device by receiving the packet Delay_Resp;
X7、 从时钟设备根据上述 tl t2 , t3和 t4 , 计算其与主时钟设备的时钟 偏移量, 并根据最后计算的结果对其本地时钟进行修正, 进而实现主从时 钟设备的时间同步。 X7, the slave clock device calculates the clock offset from the master clock device according to the above t l t 2 , t 3 and t 4 , and corrects the local clock according to the result of the final calculation, thereby implementing the master-slave clock device. Time synchronization.
发明人研究和实践发现, 由于发送端 (主时钟设备或从时钟设备) 的 应用层发出的时间同步消息需要在物理层经过调制等处理后, 再从物理层 空口通过 RF发送出去, 同样的, 接收端 (从时钟设备或主时钟设备)在物 理层空口接收到的时间同步消息时, 也需要在物理层经过解调等处理之后 才到达应用层。 而物理层的调制解调等处理会对时间同步消, 的传输带来 一定的时延和抖动, 该时延和抖动与基带处理的速度有关, 并且, 由于上 下行机制的差异, 可能会导致上下行处理时延的不对称性。 而现有主从时 钟设备时间同步机制中, 发送端通常是以时间同步消息离开其应用层的时 间作为该时间同步消息的发送时刻, 而接收端通常是以时间同步消息到达 其应用层的时间作为该时间同步消息的接收时刻的, 这样, 主从时钟设备 的物理层的调整解调处理带来的时间同步消息发送或接收的时延和抖动的 不对称性, 将较大的影响到主从时钟设备时间同步精度。 The inventor's research and practice have found that the time synchronization message sent by the application layer of the sender (primary clock device or slave clock device) needs to be processed by the physical layer after being modulated, and then transmitted through the RF through the physical layer air interface. Similarly, When the receiving end (slave device or master clock device) receives the time synchronization message from the physical layer air interface, it also needs to go to the application layer after the physical layer undergoes demodulation and the like. The processing and demodulation of the physical layer will bring a certain delay and jitter to the transmission of the time synchronization cancellation. The delay and jitter are related to the speed of the baseband processing, and The difference in the downlink mechanism may lead to the asymmetry of the uplink and downlink processing delay. In the existing master-slave clock device time synchronization mechanism, the sending end usually takes the time when the time synchronization message leaves its application layer as the sending time of the time synchronization message, and the receiving end usually takes the time synchronization message to reach the application layer. As the receiving moment of the time synchronization message, the delay of the time synchronization message transmission or reception and the asymmetry of the jitter caused by the adjustment and demodulation processing of the physical layer of the master-slave clock device will greatly affect the main Time synchronization accuracy from the clock device.
下面以主时钟设备的角度, 对本发明实施例中的时间同步方法进行描 述。  The time synchronization method in the embodiment of the present invention will be described below from the perspective of the master clock device.
本发明实施例中的时间同步方法可以包括: 主时钟设备向从时钟设备 发送第一时间同步消息, 并获取该第一时间同步消息通过 RF发出的时刻 Ύΰ 主时钟设备向上述从时钟设备发送第二时间同步消息, 并在该第二时 间同步消息中携带 1\的时间戳; 主时钟设备接收由上述从时钟设备发送的 第三时间同步消息, 并获取空口物理层接收到该第三时间同步消息的时刻 τ4; 主时钟设备向上述从时钟设备发送第四时间同步消息, 并在该第四时 间同步消息中携带 τ4的时间戳。 The time synchronization method in the embodiment of the present invention may include: the primary clock device sends a first time synchronization message to the slave clock device, and acquires a time when the first time synchronization message is sent by the RF. The master clock device sends the message to the slave clock device. a time synchronization message, and carrying a timestamp of 1\ in the second time synchronization message; the master clock device receives the third time synchronization message sent by the slave clock device, and acquires the third time synchronization received by the air interface physical layer The time τ 4 of the message; the master clock device sends a fourth time synchronization message to the slave clock device, and carries a time stamp of τ 4 in the fourth time synchronization message.
请参阅图 2, 具体步骤可以包括:  Please refer to Figure 2, the specific steps may include:
201、 主时钟设备向从时钟设备发送第一时间同步消息;  201. The master clock device sends a first time synchronization message to the slave clock device.
当需要进行时间同步时, 系统默认的主时钟设备按照预置的间隔时间 (缺省为 2秒)周期性地以多播的形式发送唯一的第一时间同步消息, 如 可以是时间同步报文 Sync, 则所有处在默认主时钟设备网段内, 并且与主 时钟设备所在域相同的从时钟设备都能接收到上述的第一时间同步消息。  When time synchronization is required, the default primary clock device periodically sends a unique first time synchronization message in the form of multicast according to a preset interval (default is 2 seconds), such as a time synchronization message. Sync, all in the default primary clock device network segment, and the slave clock device with the same domain as the primary clock device can receive the above first time synchronization message.
需要说明的是, 为了便于描述, 本发明实施例只对一个从时钟设备与 主时钟设备的交互进行描述, 可以理解, 其他从时钟设备与主时钟设备的 交互过程可以参照本发明实施例中的描述。  It should be noted that, for convenience of description, the embodiment of the present invention only describes the interaction between a slave clock device and the master clock device. It can be understood that the interaction process between the other slave clock device and the master clock device may refer to the embodiment of the present invention. description.
202、 主时钟设备获取第一时间同步消息通过 RF发出的时刻  202. The master clock device acquires a time when the first time synchronization message is sent through the RF.
由于主时钟设备发送的第一时间同步消息需要经过物理层的调制解调 等处理之后, 才通过 RF发送出去, 故物理层的调制解调处理可能会对第一 时间同步消息的发送带来一定的时延和抖动, 因此, 主时钟设备通过获取 第一时间同步消息通过 RF发出的时刻,可以实现对物理层调制解调的处理 时延的补偿, 从而提高获取第一时间同步消息的发送时刻的精确度。 The first time synchronization message sent by the master clock device needs to be processed by the physical layer, such as modulation and demodulation, and then transmitted through the RF. Therefore, the physical layer modulation and demodulation process may bring a certain time to the first time synchronization message. The delay and jitter, therefore, the master clock device can realize the processing of the physical layer modulation and demodulation by acquiring the time when the first time synchronization message is sent through the RF. The compensation of the delay increases the accuracy of obtaining the transmission timing of the first time synchronization message.
其中, 在一种应用场景下, 主时钟设备可以根据第一时间同步消息的 调度信息(调度信息通常由介质访问控制层生成), 获取第一时间同步消息 通过 RF发出的时刻 1\。 具体的, 主时钟设备可根据第一时间同步消息的 调度信息, 获取第一时间同步消息通过 RF发出的对应时隙,根据本地时钟 和上述时隙计算出发送该时隙中的任意一个符号的起始或结束时刻, 将其 作为上述第一时间同步消息通过射频发出的时刻 举例来说, 可根据本 地时钟和上述时隙计算出发送该时隙中的最后一个符号的结束时刻, 将其 作为第一时间同步消息通过射频发出的时刻 或者, 根据本地时钟和上 述时隙计算出发送该时隙中的最后一个符号的起始时刻, 将其作为第一时 间同步消息通过射频发出的时刻 或者, 根据本地时钟和上述时隙计算 出发送该时隙中的第一个符号的起始时刻, 将其作为第一时间同步消息通 过射频发出的时刻 此处不作限定。  In an application scenario, the master clock device may obtain the time 1\ sent by the first time synchronization message according to the scheduling information of the first time synchronization message (the scheduling information is usually generated by the medium access control layer). Specifically, the master clock device may obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message through the RF, and calculate, according to the local clock and the time slot, send any one of the symbols in the time slot. At the start or end time, as the time when the first time synchronization message is sent by the radio frequency, for example, the end time of transmitting the last symbol in the time slot can be calculated according to the local clock and the time slot, and The time when the first time synchronization message is sent by the radio frequency, or the start time of transmitting the last symbol in the time slot is calculated according to the local clock and the time slot, and is used as the time when the first time synchronization message is sent through the radio frequency or The time at which the first symbol in the time slot is transmitted is calculated according to the local clock and the time slot, and the time when the first time synchronization message is sent as a first time synchronization message is not limited herein.
在另一种应用场景下, 也可以通过硬件(如射频装置或其他硬件装置) 记录的方式来获取第一时间同步消息通过 RF发出的时刻 1\。 需要说明的 是, 通过硬件记录的方式获取时间同步消息在空口物理层的发送和接收时 刻, 发送端与接收端可按照统一的硬件记录机制来执行, 从而保证主从时 间设备的时间同步精度, 例如, 在主从时钟设备进行时间同步消息的交互 过程中, 若作为发送端的主时钟设备(或从时钟设备)通过硬件将时间同 步消息通过 RF发出的时隙中的最后一个符号的结束时刻记录下来,作为该 时间同步消息通过 RF发出的时刻,则相应的,作为接收端的从时钟设备(或 主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口物理层接收到 该时间同步消息的时隙中的第一个符号的起始时刻记录下来, 作为空口物 理层接收到该时间同步报文的时刻; 若作为发送端的主时钟设备(或从时 钟设备)通过硬件(如射频装置或其他硬件装置)将时间同步消息通过 RF 发出的时隙中的最后一个符号的起始时刻记录下来, 作为该时间同步消 ,包、 通过 RF发出的时刻, 相应的, 作为接收端的从时钟设备(或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口物理层接收到的该时间同步 消息的时隙中的第二个符号的起始时刻记录下来, 作为空口物理层接收到 该时间同步报文的时刻; 若作为发送端的主时钟设备(或从时钟设备), 通 过硬件将时间同步消息通过 RF发出的时隙中的第一个符号的起始时刻记 录下来, 作为该时间同步消息通过 RF发出的时刻, 则相应的, 作为接收端 的从时钟设备(或主时钟设备), 在接收到该时间同步消息时, 通过硬件将 空口物理层接收到该时间同步消息的时隙中的第一个符号的起始时刻记录 下来, 作为空口物理层接收到该时间同步报文的时刻, 以此类推。 具体的, 通过硬件记录时间同步报文的发送和接收时刻的机制可以在执行时间同步 操作之前对主从时钟设备进行设定, 此处不作限定。 In another application scenario, the time 1\ sent by the first time synchronization message through the RF may also be obtained by means of hardware (such as a radio device or other hardware device). It should be noted that, when the time synchronization message is obtained by means of hardware recording, the transmitting end and the receiving end can be executed according to a unified hardware recording mechanism, thereby ensuring time synchronization precision of the master-slave time device. For example, in the interaction process of the time synchronization message between the master and slave clock devices, if the master clock device (or the slave clock device) acting as the transmitting end records the time synchronization message through the hardware, the end time of the last symbol in the time slot sent by the RF is recorded. As a time when the time synchronization message is sent by the RF, correspondingly, the slave clock device (or the master clock device) as the receiving end receives the time synchronization by the hardware physical layer of the air interface when receiving the time synchronization message. The start time of the first symbol in the time slot of the message is recorded as the time when the air interface physical layer receives the time synchronization message; if the master clock device (or the slave clock device) serving as the transmitting end passes hardware (such as a radio frequency device) Or other hardware device) sends a time synchronization message via RF The start time of the last symbol in the slot is recorded as the time synchronization cancellation, the packet, the time sent by the RF, and correspondingly, the slave clock device (or master clock device) as the receiving end receives the time synchronization message. At the time, the start time of the second symbol in the time slot of the time synchronization message received by the physical layer of the air interface is recorded by the hardware, and is received as the air interface physical layer. The time of the time synchronization message; if the master clock device (or the slave clock device) as the transmitting end records the time synchronization message through the hardware, the start time of the first symbol in the time slot sent by the RF is recorded as the time When the synchronization message is sent by the RF, the corresponding slave clock device (or master clock device) receives the time synchronization message, and receives the air interface physical layer in the time slot of the time synchronization message through hardware. The start time of the first symbol is recorded as the time when the air interface physical layer receives the time synchronization message, and so on. Specifically, the mechanism for recording the time of sending and receiving the time synchronization message by using the hardware may set the master and slave clock devices before performing the time synchronization operation, which is not limited herein.
203、 主时钟设备向该从时钟设备发送第二时间同步消息, 并在该第二 时间同步消息中携带 1\的时间戳;  203. The master clock device sends a second time synchronization message to the slave clock device, and carries a timestamp of 1\ in the second time synchronization message.
主时钟设备在发送上述第一时间同步消息之后, 向上述从时钟设备发 送携带 1\的时间戳的第二时间同步消息, 如可以是跟随报文 Follow_up, 以便该从时钟设备获知主时钟设备通过 RF发出上述第一时间同步消息的 时刻 从时钟设备在接收到第二时间同步消息时, 可获取其空口物理层 接收到该第二时间同步消息的时刻。  After transmitting the first time synchronization message, the master clock device sends a second time synchronization message carrying a time stamp of 1\ to the slave clock device, such as a follow message Follow_up, so that the slave clock device knows that the master clock device passes When the RF sends the first time synchronization message, the clock device can obtain the time when the air interface physical layer receives the second time synchronization message when receiving the second time synchronization message.
204、 主时钟设备接收由该从时钟设备发送的第三时间同步消息, 并获 取空口物理层接收到该第三时间同步消息的时刻 T4; 204. The master clock device receives the third time synchronization message sent by the slave clock device, and acquires a time T 4 when the air interface physical layer receives the third time synchronization message.
为了提高修正精度, 时间同步过程需要对主从时钟设备间的时间同步 消息的传输延迟进行测量, 此时, 从时钟设备会向主时钟设备不定期的发 送第三时间同步消息, 如可以是延迟请求报文 Delay_Req, 其间隔时间缺省 值可为 4到 60秒之间的随机值, 在发送该第三时间同步消息时, 从时钟设 备可获取该第三时间同步消息通过 RF发出的时刻 T3In order to improve the correction accuracy, the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and slave clock devices. At this time, the slave clock device sends the third time synchronization message to the master clock device irregularly, such as may be delayed. The request message Delay_Req, the default value of the interval time may be a random value between 4 and 60 seconds. When the third time synchronization message is sent, the slave clock device may acquire the time T sent by the third time synchronization message through the RF. 3 .
当主时钟设备接收到该第三时间同步消息时, 获取其空口物理层接收 到该第三时间同步消息的时刻 Τ4, 以实现对物理层调制解调的处理时延的 补偿。 When the primary clock device receives the third time synchronization message, the time Τ 4 at which the air interface physical layer receives the third time synchronization message is obtained to implement compensation for the processing delay of the physical layer modulation and demodulation.
在一种应用场景下, 主时钟设备接收第三时间同步消息时, 可以根据 第三时间同步消息的调度信息 (该调度信息可由主时钟设备生成, 也可由 从时钟设备生成, 例如若主时钟设备为宏基站, 从时钟设备为微基站或用 户设备等, 则该调度信息可由主时钟设备生成, 反之, 可由从时钟设备生 成), 获取空口物理层接收到第三时间同步消息的时刻 T4, 具体的, 主时钟 设备可根据第三时间同步消息的调度信息, 获取空口物理层接收第三时间 同步消息的对应时隙, 根据本地时钟和上述时隙计算出空口物理层接收到 该时隙中的任意一个符号的起始或结束时刻作为空口物理层接收到第三时 间同步消息的时刻 τ4。 举例来说, 可根据本地时钟和上述时隙计算出空口 物理层接收到该时隙中的第一个符号的起始时刻, 将其作为空口物理层接 收到第三时间同步消息的时刻 τ4, 或者, 将根据本地时钟和上述时隙计算 出空口物理层接收到该时隙中的第二个符号的起始时刻, 将其作为空口物 理层接收到第三时间同步消息的时刻 τ4, 此处不作限定。 In an application scenario, when receiving the third time synchronization message, the master clock device may be configured according to scheduling information of the third time synchronization message (the scheduling information may be generated by the master clock device or by the slave clock device, for example, if the master clock device For the macro base station, the slave clock device is a micro base station or a user equipment, etc., the scheduling information may be generated by the master clock device, and vice versa, may be generated by the slave clock device. And obtaining a time T 4 when the air interface physical layer receives the third time synchronization message. Specifically, the master clock device may obtain, according to the scheduling information of the third time synchronization message, the corresponding time slot of the air interface physical layer to receive the third time synchronization message. And calculating, according to the local clock and the foregoing time slot, a start or end time of the physical layer received by the air interface physical layer as the time τ 4 of receiving the third time synchronization message by the air interface physical layer. For example, the start time of the first symbol in the time slot received by the physical layer of the air interface can be calculated according to the local clock and the time slot, and the time τ 4 of the third time synchronization message is received as the air interface physical layer. Or, the start time of the second symbol in the time slot received by the physical layer of the air interface is calculated according to the local clock and the time slot, and is received as the time τ 4 of the third time synchronization message by the physical layer of the air interface. This is not a limitation.
在一种应用场景下, 主时钟设备在接收到第三时间同步消息时, 也可 通过硬件记录的方式获取空口物理层接收到该第三时间同步消息的时刻 In an application scenario, when the primary clock device receives the third time synchronization message, the master clock device may also acquire the time when the air interface physical layer receives the third time synchronization message by using hardware recording.
Τ4。 硬件记录的具体方式可参照步骤 202中的描述, 此处不再赘述。 Τ 4 . For the specific manner of the hardware record, refer to the description in step 202, and details are not described herein again.
205、 主时钟设备向该从时钟设备发送第四时间同步消息, 并在该第四 时间同步消息中携带 Τ4的时间戳。 205, the master clock time synchronization device sends a fourth message to the slave clock device, and to carry a timestamp Τ 4 in the fourth time synchronization message.
在一种应用场景下, 主时钟设备可在接收到第三时间同步消息之后, 向上述从时钟设备发送携带 τ4的时间戳的第四时间同步消息, 如可以是延 迟响应报文 De lay-Resp , 以便该从时钟设备获知主时钟设备在空口物理层 接收到第三时间同步消息的时刻 T4。 或者, 主时钟设备可在接收到从时钟 设备发送的扩展消息(如可以是跟随报文 Fol low_up )之后, 向从时钟设备 发送携带 T4的时间戳的第四时间同步消息, 如可以是延迟响应 4艮文 De lay-Resp , 以便该从时钟设备获知主时钟设备在空口物理层接收到第三 时间同步消息的时刻 T4In an application scenario, after receiving the third time synchronization message, the master clock device may send a fourth time synchronization message carrying the timestamp of τ 4 to the slave clock device, such as a delayed response message. Resp, so that the slave clock device knows the time T 4 at which the master clock device receives the third time synchronization message at the air interface physical layer. Alternatively, the master clock is received from the device may be extended clock device sends a message (e.g., packets may follow Fol low_up) after the fourth time from the transmitting apparatus to carry a timestamp clock synchronization message to T 4, as can be delayed In response to the message De lay-Resp, the slave clock device learns the time T 4 at which the master clock device receives the third time synchronization message at the air interface physical layer.
需要说明的是, 上述的扩展消息是从时钟设备通过扩展 1588v2协议之 后扩展的消息, 并在发出第三时间同步消息之后向主时钟设备发送, 并可 在该新增消息中携带从时钟设备通过 RF发出第三时间同步消息的时刻的时 间戳, 以便主时钟设备可以获知该时刻。 当然, 从时钟设备也可以不向主 时钟设备发送上述的扩展消息。  It should be noted that the foregoing extended message is a message extended from the clock device by extending the 1588v2 protocol, and is sent to the primary clock device after the third time synchronization message is sent, and may carry the slave clock device in the added message. The timestamp of the moment when the RF sends the third time synchronization message, so that the master clock device can know the time. Of course, the slave clock device may also not send the above extended message to the master clock device.
可以理解, 当从时钟设备接收到第四时间同步消息时, 主从时钟设备 之间即完成了一次时间同步消息交互过程, 从时钟设备可根据在上述时钟 同步消息交互过程中获取到的四个时刻信息进行相应的计算, 并可根据计 算的结果对其本地时钟进行修正, 从时钟设备也可以在经过多次主从时钟 设备间的时间同步消息交互过程之后, 对通过计算得出的多个计算结果取 平均值, 根据该平均值对其本地时钟进行修正, 从而实现主从时钟设备间 的时间同步。 It can be understood that when the fourth time synchronization message is received from the clock device, a time synchronization message interaction process is completed between the master and slave clock devices, and the slave clock device can be based on the clock. The four time information obtained during the synchronization message interaction process is calculated correspondingly, and the local clock can be corrected according to the calculation result, and the slave clock device can also perform the time synchronization message interaction process between the master and slave clock devices. After that, the plurality of calculation results obtained by the calculation are averaged, and the local clock is corrected according to the average value, thereby realizing time synchronization between the master and slave clock devices.
可以理解, 本实施例描述的上述时间同步方法可应用于多种通信系统 之中, 如长期演进 ( LTE, Long Term Evolution )通信系统、 演进通用移 动通信系统 ( UMTS, Universal Mobile Telecommunications System )、 宽 带码分多址接入 ( WCDMA, Wideband Code Division Multiple Access ), 全球互联微波接入 ( WIMAX, Worldwide Interoperability for Microwave Access ) , 全球移动通信系统 ( GSM , Global System for Mobile co匪 un ication)等。 其中, 主时钟设备和从时钟设备可以是基站, 或是其 它具有无线链路的设备。  It can be understood that the foregoing time synchronization method described in this embodiment can be applied to various communication systems, such as a Long Term Evolution (LTE) communication system, a Universal Mobile Telecommunications System (UMTS), and a broadband. WCDMA (Wideband Code Division Multiple Access), Worldwide Interoperability for Microwave Access (WIMAX), Global System for Mobile (GSM), etc. The master clock device and the slave clock device may be base stations or other devices having wireless links.
由上可见, 本实施例主时钟设备通过获取第一时间同步消息通过 RF发 出的时刻以及空口物理层接收到第三时间同步消息的时刻, 并把这两个时 刻的时间戳分别通过第二时间同步消息和第四时间同步消息发送给从时钟 设备, 使得该从时钟设备可以获知主时钟设备通过 RF发出第一时间同步消 息以及在空口物理层接收到第三时间同步消息的时刻, 相应提高了从时钟 设备后续计算其与主时钟设备的时钟偏移量的准确性, 利用更准确的计算 结果来对从时钟设备的本地时钟进行修正, 提高了主从时钟设备的时间同 步精度。  It can be seen that, in the embodiment, the master clock device obtains the time when the first time synchronization message is sent by the RF and the time when the air interface physical layer receives the third time synchronization message, and passes the timestamps of the two times respectively through the second time. The synchronization message and the fourth time synchronization message are sent to the slave clock device, so that the slave clock device can know that the master clock device sends the first time synchronization message through the RF and the third time synchronization message is received at the air interface physical layer, which is correspondingly improved. The clock device subsequently calculates the accuracy of the clock offset from the master clock device, and uses a more accurate calculation result to correct the local clock of the slave clock device, thereby improving the time synchronization accuracy of the master-slave clock device.
下面以从时钟设备的角度, 对本发明实施例中的时间同步方法进行描 述。  The time synchronization method in the embodiment of the present invention will be described below from the perspective of a clock device.
本发明实施例中的时间同步方法另一个实施例包括: 从时钟设备接收 由主时钟设备发送的第一时间同步消息, 并获取空口物理层接收到该第一 时间同步消息的时刻 T2; 接收由主时钟设备发送的第二时间同步消息, 并 获取上述第二时间同步消息中携带的时刻 1\的时间戳, 其中, 上述 1\为主 时钟设备通过 RF发出上述第一时间同步消息的时刻;向主时钟设备发送第 三时间同步消息, 并获取该第三时间同步消息通过 RF发出的时刻 Τ3; 从 时钟设备接收由主时钟设备发送的第四时间同步消息, 并获取上述第四时 间同步消息中携带的时刻 τ4的时间戳, 其中, 上述 τ4为主时钟设备在空口 物理层上接收到上述第三时间同步消息的时刻; 根据上述 τ2, τ3和 τ4 计算其与主时钟设备的时钟偏移量; 根据计算的结果对其本地时钟进行修 正。 Another embodiment of the time synchronization method in the embodiment of the present invention includes: receiving a first time synchronization message sent by the master clock device from the clock device, and acquiring a time T 2 at which the air interface physical layer receives the first time synchronization message; a second time synchronization message sent by the master clock device, and acquiring a timestamp of the time 1\ carried in the second time synchronization message, where the time 1@ the primary clock device sends the first time synchronization message through the RF Sending a third time synchronization message to the master clock device, and acquiring the time Τ 3 sent by the third time synchronization message through the RF; The clock device receives the fourth time synchronization message sent by the master clock device, and acquires a timestamp of the time τ 4 carried in the fourth time synchronization message, where the τ 4 is received by the master clock device on the physical layer of the air interface. The time of the third time synchronization message; the clock offset from the master clock device is calculated according to the above τ 2 , τ 3 and τ 4 ; and the local clock is corrected according to the result of the calculation.
请参阅图 3 , 具体步骤可以包括:  Please refer to Figure 3, the specific steps may include:
301、 从时钟设备接收由主时钟设备发送的第一时间同步消息, 并获取 空口物理层接收到该第一时间同步消息的时刻 Τ2; 301: Receive a first time synchronization message sent by the master clock device from the clock device, and obtain a time Τ 2 when the air interface physical layer receives the first time synchronization message;
当需要进行时间同步时, 系统默认的主时钟设备按照预置的间隔时间 (缺省为 2秒)周期性地以多播的形式发送唯一的第一时间同步消息, 如 可以是时间同步报文 Sync, 则所有处在默认主时钟设备网段内, 并且与主 时钟设备所在域相同的从时钟设备都能接收到上述的第一时间同步消息。  When time synchronization is required, the default primary clock device periodically sends a unique first time synchronization message in the form of multicast according to a preset interval (default is 2 seconds), such as a time synchronization message. Sync, all in the default primary clock device network segment, and the slave clock device with the same domain as the primary clock device can receive the above first time synchronization message.
从时钟设备接收到上述第一时间同步消息时, 获取空口物理层接收到 该第一时间同步消息的时刻 T2, 以实现对物理层调制解调的处理时延的补 偿。 When the first time synchronization message is received from the clock device, the time T 2 at which the air interface physical layer receives the first time synchronization message is obtained, so as to implement compensation for the processing delay of the physical layer modulation and demodulation.
在一种应用场景下, 从时钟设备接收到第一时间同步消息时, 可以根 据第一时间同步消息的调度信息 (该调度信息可由主时钟设备生成, 也可 由从时钟设备生成, 例如若主时钟设备为宏基站, 从时钟设备为微基站或 用户设备等, 则该调度信息可由主时钟设备生成, 反之, 可由从时钟设备 生成), 获取空口物理层接收到第一时间同步消息的时刻 Τ2, 具体的, 从时 钟设备可根据第一时间同步消息的调度信息, 获取空口物理层接收到第一 时间同步消息的对应时隙, 根据本地时钟和上述时隙计算出空口物理层接 收到上述时隙中的任意一个符号的起始或结束时刻, 将其作为空口物理层 接收到上述第一时间同步消息的时刻 Τ2, 举例来说, 可根据本地时钟和上 述时隙计算出空口物理层接收到上述时隙中的第一个符号的起始时刻, 将 其作为空口物理层接收到第一时间同步消息的时刻 Τ2, 或者, 根据本地时 钟和上述时隙计算出空口物理层接收到上述时隙中的第二个符号的起始时 刻, 将其作为空口物理层接收到第一时间同步消息的时刻 Τ2, 此处不作限 定。 在另一种应用场景下, 从时钟设备接收到上述第一时间同步消息时, 也可以通过硬件记录的方式获取空口物理层接收到该第一时间同步消息的 时刻 T2。 需要说明的是, 通过硬件(如射频装置或其他硬件装置)记录的 方式获取时间同步报文在空口物理层的发送和接收时刻, 发送端与接收端 可按照统一的硬件记录机制来执行, 从而保证主从时间设备的时间同步精 度, 例如, 在主从时钟设备进行时间同步消息的交互过程中, 若作为发送 端的主时钟设备 (或从时钟设备 )通过硬件将时间同步消息通过 RF发出的 时隙中的最后一个符号的结束时刻记录下来, 作为该时间同步消息通过 RF 发出的时刻, 则相应的, 作为接收端的从时钟设备(或主时钟设备), 在接 收到该时间同步消息时, 通过硬件将空口物理层接收该时间同步消息的时 隙中的第一个符号的起始时刻记录下来, 作为空口物理层接收到该时间同 步报文的时刻记录下来; 若作为发送端的主时钟设备(或从时钟设备)通 过硬件将时间同步消息通过 RF发出的时隙中的最后一个符号的起始时刻 记录下来, 作为该时间同步消息通过 RF发出的时刻记录下来, 则相应的, 作为接收端的从时钟设备(或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口物理层接收该时间同步消息的时隙中的第二个符号的起始 时刻记录下来, 作为空口物理层接收到该时间同步 4艮文的时刻记录下来; 若作为发送端的主时钟设备(或从时钟设备)通过硬件将时间同步消息通 过 RF发出的时隙中的第一个符号的起始时刻记录下来,作为该时间同步消 息通过 RF发出的时刻,相应的,作为接收端的从时钟设备(或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口物理层接收该时间同步消息 的时隙中的第一个符号的起始时刻记录下来, 作为空口物理层接收到该时 间同步 4艮文的时刻, 以此类推。 具体的, 通过硬件记录时间同步 4艮文的发 送和接收时刻的机制可以在执行时间同步操作之前对主从时钟设备进行设 定, 此处不作限定。 In an application scenario, when receiving the first time synchronization message from the clock device, the scheduling information of the first time synchronization message may be generated according to the scheduling information of the first time synchronization device (the scheduling information may be generated by the master clock device, or may be generated by the slave clock device, for example, if the master clock device is a macro base station, from the clock device is a micro base station or a user equipment, the scheduling information by the master clock device generates, on the contrary, by the slave clock device generates), obtaining air interface physical layer receiving the first time synchronization message time Τ 2 Specifically, the slave clock device may obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot in which the air interface physical layer receives the first time synchronization message, and calculate, according to the local clock and the time slot, the physical layer of the air interface receives the foregoing time. The start or end time of any one of the slots is received as the time Τ 2 of the first time synchronization message as the air interface physical layer. For example, the physical layer reception of the air interface can be calculated according to the local clock and the time slot. To the beginning of the first symbol in the above time slot, as the physical layer of the air interface The time of receiving the first time synchronization message Τ 2, or calculate the starting time of the air interface physical layer receives the slot of the second symbol and said slots according to the local clock, which is received as a physical layer air interface The time Τ 2 of the first time synchronization message is not limited herein. In another application scenario, when the apparatus is received from the clock synchronization message to said first time, may acquire the physical layer air interface receiving the first time synchronization message by time T 2 records the hardware embodiment. It should be noted that, when the time synchronization message is sent by the hardware (such as a radio frequency device or other hardware device), the transmitting end and the receiving end can be executed according to a unified hardware recording mechanism. Assuring the time synchronization accuracy of the master-slave time device, for example, when the master-slave clock device performs the time synchronization message interaction, if the master clock device (or the slave clock device) acting as the sender transmits the time synchronization message through the RF through the hardware The end time of the last symbol in the slot is recorded as the time when the time synchronization message is sent by the RF, and accordingly, the slave clock device (or the master clock device) as the receiving end passes the time synchronization message when receiving the time synchronization message. The hardware records the start time of the first symbol in the time slot in which the air interface physical layer receives the time synchronization message, and records the time when the air interface physical layer receives the time synchronization message; if it is the master clock device of the transmitting end ( Or from the clock device) through the hardware to send time synchronization messages through the RF The start time of the last symbol in the outgoing time slot is recorded as the time when the time synchronization message is sent by the RF, and accordingly, the slave clock device (or master clock device) as the receiving end receives the In the time synchronization message, the start time of the second symbol in the time slot in which the air interface physical layer receives the time synchronization message is recorded by the hardware, and is recorded as the time when the air interface physical layer receives the time synchronization message; The master clock device (or the slave clock device) as the transmitting end records the time synchronization message through the hardware at the start time of the first symbol in the time slot sent by the RF as the time when the time synchronization message is sent through the RF, correspondingly The slave clock device (or the master clock device), as the receiving end, records the start time of the first symbol in the time slot of the time slot physical layer receiving the time synchronization message by hardware when receiving the time synchronization message. As the time when the air interface physical layer receives the time synchronization, and so on. Specifically, the mechanism for recording the time of the transmission and the reception of the time synchronization by the hardware may set the master-slave clock device before the time synchronization operation is performed, which is not limited herein.
302、 从时钟设备接收由主时钟设备发送的第二时间同步消息, 并获取 该第二时间同步消息中携带的时刻 1 的时间戳;  The receiving, by the clock device, the second time synchronization message sent by the master clock device, and acquiring the timestamp of the time 1 carried in the second time synchronization message;
从时钟设备通过接收由主时钟设备发送的第二时间同步消息如可以是 跟随报文 Follow_up, 获取第二时间同步消息中携带的 1\的时间戳, 以便 进行后续的计算。其中, 1\为上述主时钟设备通过 RF发出上述第一时间同 步消息的时刻。 The slave device receives the second time synchronization message sent by the master clock device, such as the following message Follow_up, and obtains the time stamp of 1\ carried in the second time synchronization message, so that Perform subsequent calculations. Where 1\ is the time when the above-mentioned master clock device sends the first time synchronization message through the RF.
303、 从时钟设备向主时钟设备发送第三时间同步消息;  303. The slave clock device sends a third time synchronization message to the master clock device.
304、 从时钟设备获取第三时间同步消息通过 RF发出的时刻 T3; 304, the third slave clock device acquiring the time synchronization message sent by the RF time T 3;
为了提高修正精度, 时间同步过程需要对主从设备间的时间同步报文 的传输延迟进行测量, 此时, 从时钟设备会向主时钟设备不定期的发送第 三时间同步消息, 如可以是延迟请求报文 Delay_Req , 其间隔时间缺省值为 4到 60秒之间的随机值。  In order to improve the accuracy of the correction, the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device. At this time, the slave clock device sends the third time synchronization message to the master clock device irregularly, such as delay. The request message Delay_Req has an interval value default value of a random value between 4 and 60 seconds.
由于从时钟设备发送的第三时间同步消息需要经过物理层的调制解调 等处理之后, 才通过 RF发送出去, 故物理层的调制解调处理可能会对第三 时间同步消息的发送带来一定的时延和抖动, 因此, 从时钟设备通过获取 第三时间同步消息通过 RF发出的时刻,可实现对物理层调制解调的处理时 延的补偿, 从而提高获取第三时间同步消息的发送时刻的精确度。  Since the third time synchronization message sent from the clock device needs to be processed by the physical layer, such as modulation and demodulation, and then transmitted through the RF, the modulation and demodulation processing of the physical layer may bring a certain time to the transmission of the third time synchronization message. Delay and jitter. Therefore, the time delay of processing the physical layer modulation and demodulation can be compensated by the clock device by acquiring the time when the third time synchronization message is sent through the RF, thereby improving the transmission time of acquiring the third time synchronization message. The accuracy.
其中, 在一种应用场景下, 从时钟设备可以根据第三时间同步消息的 调度信息 (该调度信息可由主时钟设备生成, 也可由从时钟设备生成, 例 如若主时钟设备为宏基站, 从时钟设备为微基站或用户设备等, 则该调度 信息可由主时钟设备生成, 反之, 可由从时钟设备生成), 获取第三时间同 步消息通过 RF发出的时刻 T3, 具体的, 从时钟设备可以根据第三时间同 步消息的调度信息, 获取第三时间同步消息通过 RF发出的对应时隙, 根据 本地时钟和上述时隙计算出发送该时隙中的任意一个符号的起始或结束时 刻, 将其作为该第三时间同步消息通过 RF发出的时刻 Τ3, 举例来说, 可 根据本地时钟和上述时隙计算出发送该时隙中的最后一个符号的结束时 刻, 将其作为第三时间同步消息通过 RF发出的时刻 Τ3, 或者, 根据本地 时钟和上述时隙计算出发送该时隙中的最后一个符号的起始时刻, 将其作 为第三时间同步消息通过 RF发出的时刻 Τ3, 或者, 根据本地时钟和上述 时隙计算出发送该时隙中的第一个符号的起始时刻, 将其作为第三时间同 步消息通过 RF发出的时刻 Τ3, 此处不作限定。 In an application scenario, the slave clock device may perform scheduling information according to the third time synchronization message (the scheduling information may be generated by the master clock device or may be generated by the slave clock device, for example, if the master clock device is a macro base station, the slave clock device is a micro base station or a user equipment, the scheduling information generated by the master clock device, and vice versa, may be generated from the clock device), the third time acquisition time synchronization message sent by RF T 3, in particular, from the clock apparatus according to And scheduling information of the third time synchronization message, acquiring a corresponding time slot sent by the third time synchronization message through the RF, calculating, according to the local clock and the time slot, a start or end time of sending any one of the time slots, and As the time Τ 3 sent by the third time synchronization message through the RF, for example, the end time of transmitting the last symbol in the time slot may be calculated according to the local clock and the time slot, and used as the third time synchronization message. by the time the RF emission Τ 3, or calculated according to the local clock and said transmission time slot the Starting time of the last symbol of the slot, by the time the RF emission as a third time synchronization message Τ 3, or from the local clock and the calculated according to the above-described first symbol transmission time slot the slot At the beginning time, it is used as the time Τ 3 sent by the third time synchronization message through the RF, which is not limited herein.
在另一种应用场景下, 也可以通过硬件记录的方式来获取第三时间同 步消息通过 RF发出的时刻 Τ3。 通过硬件记录的具体方式可参照步骤 301 中的描述, 此处不再赘述。 In another application scenario, the time Τ 3 sent by the third time synchronization message through the RF may also be obtained by means of hardware recording. Refer to step 301 for the specific manner of hardware recording. The description in the description will not be repeated here.
需要说明的是, 在一种应用场景下, 从时钟设备可以在获取第三时间 同步消息通过 RF发出的时刻 T3之后, 通过扩展 1588ν2协议, 向主时钟设 备发送新增消息如可以是跟随报文 Fol low_up , 并在该新增消息中携带 T3 的时间戳, 以便主时钟设备可以获知上述从时钟设备通过 RF发出第三时间 同步消息的时刻 Τ3。 当然, 从时钟设备也可以不向主时钟设备发送上述的 新增消息, 此处不作限定。 It should be noted that, in an application scenario, the slave clock device may send a new message to the master clock device, such as a follow-up report, by extending the 1588 ν2 protocol after acquiring the third time synchronization message through the time T 3 sent by the RF. Wen Fol low_up, and carry timestamp T 3 in the new message to the master device can know the above-described clock time synchronization message sent from the third apparatus through the RF clock time Τ 3. Of course, the slave clock device may not send the above-mentioned new message to the master clock device, which is not limited herein.
305、 从时钟设备接收由主时钟设备发送的第四时间同步消息, 并获取 该第四时间同步消息中携带的时刻 Τ4的时间戳 305. Receive, by the clock device, a fourth time synchronization message sent by the primary clock device, and obtain a timestamp of the time Τ 4 carried in the fourth time synchronization message.
从时钟设备通过接收由主时钟设备发送的第四时间同步消息, 例如可 以是延迟响应报文 Delay_Resp, 获取该第四时间同步消息中携带的 T4的时 间戳, 以便进行后续的计算。 其中, Τ4为上述主时钟设备在空口物理层接 收到上述第三时间同步消息的时刻。 A fourth clock device by receiving the time synchronization message transmitted by the master clock device, for example, may be a Delay_Resp delay response packet, acquires a time stamp of the synchronization message carried in a fourth time T 4 of the, for the subsequent calculations. Where Τ 4 is the time when the master clock device receives the third time synchronization message at the air interface physical layer.
306、 从时钟设备根据获取到的上述 Τ2, Τ3和 Τ4计算其与主时钟 设备的时钟偏移量; 306. The slave clock device calculates a clock offset from the master clock device according to the obtained Τ 2 , Τ 3, and Τ 4 ;
从时钟设备获取到上述 Τ2, Τ3和 Τ4后, 可以根据下述公式计算其 与主时钟设备之间的消息平均延迟 Delay,并相应的计算出其与主时钟设备 的时钟偏移量 Offset: After obtaining the above Τ 2 , Τ 3 and Τ 4 from the clock device, the message average delay Delay between the master clock device and the master clock device can be calculated according to the following formula, and the clock offset from the master clock device can be calculated accordingly. Offset:
T2= T!+Delay+Offset; T4= T3+Delay-Offset。 T 2 = T! + Delay + Offset; T 4 = T 3 + Delay-Offset.
上述两条公式可以变成:  The above two formulas can become:
Delay = ( T2- 1\+1> T3 ) 12; Delay = ( T 2 - 1\+1> T 3 ) 12;
Offset= T2- TV Delay, 即 Offset= ( T2- T T4+ T3 ) /2。 Offset= T 2 - TV Delay, ie Offset= ( T 2 - TT 4 + T 3 ) /2.
需要说明的是, 从时钟设备可以经过多次主从时钟设备间的时间同步 消息交互过程之后, 对通过计算得出的多个 Off set的值取平均值。  It should be noted that, after the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the values of the multiple Off sets obtained by the calculation are averaged.
307、 从时钟设备根据计算的结果对其本地时钟进行修正;  307. The slave clock device corrects its local clock according to the calculated result;
根据步骤 306计算的结果, 从时钟设备可以根据时钟偏移量 Off set对 其本地时钟进行修正, 也可以在经过多次主从时钟设备间的时间同步消息 交互过程之后, 根据计算得到的时钟偏移量 Off set的平均值对其本地时钟 进行修正, 从而达到与主时钟设备的时间同步。 需要说明的是, 本实施例所描述的时间同步方法可应用于多种通信系 统之中, 例如 UMTS , WCDMA, WIMAX , GSM, 和 LTE通信系统等。 主时钟设 备和从时钟设备可以是基站, 或是其它具有无线链路的设备。 According to the result of the calculation in step 306, the slave clock device may correct the local clock according to the clock offset Off set, or may perform the clock skew according to the calculation after the time synchronization message interaction process between the master and slave clock devices. The average of the shift Off set is corrected for its local clock to achieve time synchronization with the master clock device. It should be noted that the time synchronization method described in this embodiment can be applied to various communication systems, such as UMTS, WCDMA, WIMAX, GSM, and LTE communication systems. The master clock device and the slave clock device can be base stations or other devices with wireless links.
由上可见, 本实施例中, 从时钟设备通过获取空口物理层接收到第一 时间同步消息的时刻以及获取第三时间同步消息通过 RF发出的时刻, 并在 接收到第二时间同步消息和第四时间同步消息时, 获取上述两种时间同步 报文中分别携带的主时钟设备通过 RF发出第一时间同步消息的时刻和主时 钟设备在空口物理层接收到第三时间同步消息的时刻的时间戳, 使得该从 时钟设备可以根据获取到的上述四个时刻信息更加准确地计算出其与主时 钟设备的时钟偏移量, 相应提高了从时钟设备根据计算结果对本地时钟进 行修正的精确度, 从而提高了主从时钟设备的时间同步精度。 为便于更好地理解本发明的技术方案, 下面以主从时钟设备通过调度 信息或时频资源信息来获取发送或接收时间同步消息的时刻为例, 以一具 请参阅图 4-a , 本发明实施例中的时间同步方法的另一个实施例, 具体 可以包括:  It can be seen that, in this embodiment, the time when the first time synchronization message is received by the clock device by acquiring the physical layer of the air interface, and the time when the third time synchronization message is sent by the RF, and the second time synchronization message is received. The time of the first time synchronization message sent by the master clock device carried in the two time synchronization messages and the time when the master clock device receives the third time synchronization message at the physical layer of the air interface is obtained. The stamping device can make the slave clock device more accurately calculate the clock offset from the master clock device according to the obtained four time information, and correspondingly improve the accuracy of the slave clock device to correct the local clock according to the calculation result. , thereby improving the time synchronization accuracy of the master-slave clock device. In order to facilitate a better understanding of the technical solution of the present invention, the following is an example of the time when the master-slave clock device obtains the time for transmitting or receiving the time synchronization message through the scheduling information or the time-frequency resource information, as shown in FIG. 4-a. Another embodiment of the time synchronization method in the embodiment of the present invention may specifically include:
401、 主时钟设备向从时钟设备发送时间同步报文 Sync;  401. The master clock device sends a time synchronization message Sync to the slave clock device.
当需要进行时间同步时, 系统默认的主时钟设备按照预置的间隔时间 (缺省为 2秒)周期性地以多播的形式发送唯一的 Sync报文, 则所有处在 默认主时钟设备网段内, 并且与主时钟设备所在域相同的从时钟设备都能 接收到 Sync报文。  When time synchronization is required, the default primary clock device periodically sends a unique Sync packet in multicast according to the preset interval (default is 2 seconds), and all are in the default primary clock device network. Within the segment, and the same slave clock device as the master clock device can receive the Sync message.
402、 主时钟设备根据 Sync报文的调度信息, 获取 Sync报文通过 RF 发出的时刻 1\;  402. The master clock device obtains the time when the Sync message is sent through the RF according to the scheduling information of the Sync message.
在一种应用场景下, 主时钟设备可以根据 Sync报文的调度信息, 获取 Sync报文通过 RF发出的对应时隙,根据本地时钟和上述时隙计算出发送该 时隙中的最后一个符号的结束时刻, 将其作为 Sync报文通过 RF发出的时 刻 1\ , 或者, 根据本地时钟和上述时隙计算出发送该时隙中的最后一个符 号的起始时刻, 将其作为 Sync报文通过 RF发出的时刻 1\ , 或者, 根据本 地时钟和上述时隙计算出发送该时隙中的第一个符号的起始时刻, 将其作 为 Sync报文通过 RF发出的时刻 T\ , 或者, 也可以根据本地时钟和上述时 隙计算出发送该时隙中的其它符号的起始或结束时刻, 将其作为 Sync报文 通过 RF发出的时刻 1\ , 此处不作限定。 In an application scenario, the master clock device can obtain the corresponding time slot sent by the Sync message through the RF according to the scheduling information of the Sync message, and calculate the last symbol in the time slot according to the local clock and the time slot. At the end time, it is used as the Sync message at the time 1\ sent by the RF, or the start time of the last symbol in the time slot is calculated according to the local clock and the above time slot, and is used as the Sync message through the RF. The time of time 1\ is sent, or, according to the local clock and the above time slot, the starting time of transmitting the first symbol in the time slot is calculated, and The time T\ sent by the Sync message through the RF, or the start or end time of sending other symbols in the time slot according to the local clock and the above time slot, and sent as a Sync message through the RF. Time 1\ , not limited here.
上述时隙可以是对应一个无线帧或者子帧的时隙。  The above time slot may be a time slot corresponding to one radio frame or subframe.
403、 从时钟设备接收 Sync报文, 并根据 Sync报文的调度信息, 获取 Sync报文在空口物理层接收到 Sync报文的时刻 T2; 403. Receive a Sync message from the clock device, and obtain a time T 2 when the Sync message receives the Sync message at the physical layer of the air interface according to the scheduling information of the Sync message.
在一种应用场景下, 从时钟设备根据 Sync报文的调度信息, 获取空口 物理层接收 Sync的时隙, 根据本地时钟和上述时隙计算出空口物理层接收 到该时隙中的第一个符号的起始时刻, 将其作为空口物理层接收到 Sync报 文的时刻 T2, 或者, 根据本地时钟和上述时隙计算出空口物理层接收到该 时隙中的第二个符号的起始时刻, 将其作为空口物理层接收到 Sync报文的 时刻 T2, 或者, 也可以根据本地时钟和上述时隙计算出空口物理层接收到 该时隙中的其它符号的起始或结束时刻, 将其作为空口物理层接收到 Sync 报文的时刻 T2 , 此处不作限定。 其中, 上述时隙可以是对应一个无线帧或 者子帧的时隙。 In an application scenario, the slave clock device obtains the time slot of the physical layer receiving the Sync according to the scheduling information of the Sync message, and calculates the first one of the time slots received by the physical layer of the air interface according to the local clock and the time slot. The start time of the symbol is received as the time T 2 of the Sync message as the air interface physical layer, or the start of the second symbol in the time slot received by the physical layer of the air interface is calculated according to the local clock and the time slot. At the moment, it is received as the time T 2 of the Sync message as the air interface physical layer, or the start or end time of the other symbols in the time slot received by the physical layer of the air interface may be calculated according to the local clock and the time slot. The time T 2 at which the Sync message is received as the air interface physical layer is not limited herein. The time slot may be a time slot corresponding to one radio frame or a subframe.
404、主时钟设备通过跟随报文 Fo 11 ow-up把 T\的时间戳传递给从时钟 设备;  404. The master clock device passes the timestamp of T\ to the slave clock device by following the message Fo 11 ow-up;
主时钟设备在发送上述 Sync报文之后, 向上述从时钟设备发送携带 1\ 的时间戳的 Fol low_up报文, 以便该从时钟设备获知主时钟设备通过 RF发 出上述 Sync报文的时刻 1\。  After transmitting the Sync message, the master clock device sends a Fol low_up message carrying the time stamp of 1\ to the slave clock device, so that the slave clock device knows the time 1\ at which the master clock device sends the Sync message through the RF.
405、 从时钟设备向主时钟设备发送延迟请求报文 De lay-Req;  405. Send a delay request message from the clock device to the master clock device. De lay-Req;
为了提高修正精度, 时间同步过程需要对主从设备间的时间同步报文 的传输延迟进行测量, 此时, 从时钟设备会向主时钟设备不定期的发送 De l ay-Req ^艮文, 其间隔时间缺省值为 4到 60秒之间的随机值。  In order to improve the correction accuracy, the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device. At this time, the slave clock device sends the De l ay-Req^ message to the master clock device irregularly. The interval defaults to a random value between 4 and 60 seconds.
406、 从时钟设备根据 De lay-Req报文的调度信息, 获取 De lay—Req报 文通过 RF发出的时刻 T3; 406, according to scheduling information from the clock apparatus De lay-Req message, acquire the time De lay-Req message sent by RF T 3;
在一种应用场景下, 从时钟设备根据 De lay-Req报文的调度信息, 获 取 De lay-Red 4艮文通过 RF发出的时隙, 根据本地时钟和上述时隙计算出发 送该时隙中的最后一个符号的结束时刻, 将其作为 De lay-Red ^艮文通过 RF 发出的时刻 τ3 , 或者, 根据本地时钟和上述时隙计算出发送该时隙中的最 后一个符号的起始时刻, 将其作为 De lay-Req报文通过 RF发出的时刻 T3, 或者, 根据本地时钟和上述时隙计算出发送该时隙中的第一个符号的起始 时刻, 将其作为 De lay-Req报文通过 RF发出的时刻 Τ3, 或者, 也可以根据 本地时钟和上述时隙计算出发送该时隙中的其它符号的起始或结束时刻, 将其作为 De lay-Req报文通过 RF发出的时刻 T3, 此处不作限定。 In an application scenario, the slave clock device obtains, according to the scheduling information of the Delay-Req packet, the time slot sent by the Delay-Red 4 message through the RF, and calculates and sends the time slot according to the local clock and the time slot. The end of the last symbol, use it as De lay-Red The time τ 3 is sent, or the start time of transmitting the last symbol in the time slot is calculated according to the local clock and the time slot, and is used as the time T 3 sent by the Delay-Req message through the RF, or Calculating, according to the local clock and the foregoing time slot, the starting time of transmitting the first symbol in the time slot, and using it as the time when the Delay-Req message is sent by the RF Τ 3 , or according to the local clock and the foregoing The time slot is used to calculate the start or end time of the other symbols in the time slot, and is used as the time T 3 sent by the Delay-Req message through the RF, which is not limited herein.
407、 主时钟设备接收由该从时钟设备发送的 De lay-Req报文, 并根据 De lay-Red ^艮文的调度信息,获取空口物理层接收到 De lay-Req ^艮文的时刻 T4; 407. The master clock device receives the Delay-Req packet sent by the slave clock device, and obtains a time T 4 when the air interface physical layer receives the De lay-Req^ message according to the scheduling information of the Delay-Red message. ;
在一种应用场景下, 主时钟设备根据 De lay-Req报文的调度信息, 获 取空口物理层接收 De lay-Req报文的时隙, 根据本地时钟和上述时隙计算 出空口物理层接收到该时隙中的第一个符号的起始时刻, 将其作为空口物 理层接收到 De lay-Req报文的时刻 T4, 或者, 根据本地时钟和上述时隙计 算出空口物理层接收到该时隙中的第二个符号的起始时刻, 将其作为空口 物理层接收到 De lay-Red ^艮文的时刻 T4 , 或者, 也可以根据本地时钟和上 述时隙计算出空口物理层接收到该时隙中的其它符号的起始或结束时刻, 将其作为空口物理层接收到 De lay-Req报文的时刻 T4, 此处不作限定。 In an application scenario, the master clock device obtains the time slot of the Delay-Req packet received by the physical layer of the air interface according to the scheduling information of the Delay-Req packet, and calculates the physical layer of the air interface according to the local clock and the time slot. The start time of the first symbol in the time slot is received as the air interface physical layer at time T 4 of the Delay-Req message, or the physical layer of the air interface is received according to the local clock and the time slot. The start time of the second symbol in the time slot is received as the air interface physical layer at time T 4 of the Delay-Red frame, or the physical layer reception of the air interface may be calculated according to the local clock and the time slot. The time T 4 of the Delay-Req message is received as the air interface physical layer at the start or end time of the other symbols in the time slot, which is not limited herein.
408、从时钟设备通过跟随报文 Fol low_up把 1^的时间戳传递给主时钟 设备;  408. The slave clock device passes the timestamp of 1^ to the master clock device by following the message Fol low_up;
从时钟设备在发送上述 De lay-Red报文之后, 通过扩展 1588v2协议, 向主时钟设备发送新增的携带 T3的时间戳的 Fol low_uP报文, 以便该主时 钟设备可以获知上述从时钟设备通过 RF发出上述 De lay-Red报文的时刻 T3Slave clock device after transmitting the message De lay-Red, by extending-1588v2, to the new master clock device sends timestamp carrying Fol low_u T P of packet 3, so that the master clock device can be known from the above-described clock The device sends the time T 3 of the above Delay-Red message through the RF.
409、 主时钟设备通过延迟响应报文 De lay-Resp把 T4的时间戳传递给 从时钟设备; 409, by delaying the response to the master clock device De lay-Resp message to the time stamp T is transmitted to the slave clock device 4;
主时钟设备在接收到上述从时钟设备发送的 Fol low_up报文之后, 向 上述从时钟设备发送携带 T4的时间戳的 De 1 ay-Re s ρ报文,以便该从时钟设 备获知主时钟设备在空口物理层接收到上述 De lay-Red报文的时刻 T4After receiving the Fol low_up message sent by the slave clock device, the master clock device sends a De 1 ay-Re s ρ message carrying the time stamp of T 4 to the slave clock device, so that the slave clock device learns the master clock device. The time T 4 of the above Delay-Red message is received at the air interface physical layer.
410、 从时钟设备根据获取到的 Τ\ , Τ2, ^和 Τ4计算其与主时钟设备的 时钟偏移量; 从时钟设备在获取到 τ2, τ3和 τ4后, 可以根据下述公式计算其与 主时钟设备之间的报文平均延迟 Delay,并相应计算出其与主时钟设备的时 钟偏移量 Offset: 410. The slave clock device calculates a clock offset from the master clock device according to the obtained Τ\ , Τ 2 , ^ , and Τ 4 ; After acquiring the τ 2 , τ 3 and τ 4 from the clock device, the average delay of the message between the master clock device and the master clock device can be calculated according to the following formula, and the clock offset from the master clock device can be calculated accordingly. Offset:
T2= T!+Delay+Offset; T4= T3+Delay-Offset。 T 2 = T! + Delay + Offset; T 4 = T 3 + Delay-Offset.
上述两条公式可以变成:  The above two formulas can become:
Delay = ( T2- 1\+1> T3 ) 12; Delay = ( T 2 - 1\+1> T 3 ) 12;
0ff set= T2- Τ - De lay, 即 Off set= ( T2_ T -T4+ T3 ) /2。 0ff set= T 2 - Τ - De lay, ie Off set= ( T 2 _ T -T 4 + T 3 ) /2.
需要说明的是, 从时钟设备可以经过多次主从时钟设备间的时间同步 消息交互过程之后, 对通过计算得出的多个 Of f set取平均值。  It should be noted that, after the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the multiple Of f sets obtained by calculation are averaged.
411、 从时钟设备根据计算的结果对其本地时钟进行修正;  411. The slave clock device corrects its local clock according to the calculated result;
根据步骤 410计算的结果, 从时钟设备可以根据时钟偏移量 Off set对 其本地时钟进行修正, 也可以在经过多次主从时钟设备间的时间同步报文 交互过程之后, 根据计算得到的时钟偏移量 Off set的平均值对其本地时钟 进行修正, 从而达到与主时钟设备的时间同步。  According to the result of the calculation in step 410, the slave clock device can correct the local clock according to the clock offset Off set, or after calculating the time synchronization message interaction process between the master and slave clock devices. The average of the offset Off set is corrected for its local clock to achieve time synchronization with the master clock device.
为便于理解, 下面以在 LTE 系统下通过调度信息来获取发送或接收时 间同步报文的时刻的方式为例进行说明, LTE系统中定义的一个子帧包含两 个时隙, 每个 0. 5 毫秒的时隙包括 6 或 7 个正交频分多路复用 ( 0F画, Or thogona l Frequency Divi s ion Mul t i plexing )符号, 如图 4_b所示, 图 4-b示出了 LTE系统中一个 0. 5毫秒时隙的一种时频结构。  For example, a sub-frame defined in the LTE system includes two time slots, each of which is 0. 5, for example, in the LTE system, by using the scheduling information to obtain the time of sending or receiving the time synchronization message. The time slot of milliseconds includes 6 or 7 Orthogonal Frequency Division Multiplexing (OFDM) symbols, as shown in Figure 4b, and Figure 4-b shows the LTE system. A time-frequency structure of a 0.5 millisecond time slot.
经过基带处理后的待发送数据由 0F画符号承载发送, 在每个符号对应 的起始时刻 (如图 4_b中的 ^ , t2 , t3 , t4, t5 , t6 和 t7 )通过 RF发 送出去, 相应的, 接收端对应接收上述 0F画符号。 The data to be transmitted after the baseband processing is carried by the 0F picture symbol, at the beginning of each symbol (such as ^, t 2 , t 3 , t 4 , t 5 , t 6 and t 7 in Figure 4_b ) Transmitted by RF, correspondingly, the receiving end correspondingly receives the above-mentioned 0F drawing symbol.
为了保证主从时钟设备的时间同步精度, 本发明实施例中举例提供了 三种可选的通过调度信息来获取时间同步消息发送或接收时刻的方式, 通 过提供的这三种方式, 可以较好的保证时间同步消息在主从时钟设备间来 回传输的时间的对称性, 从而保证主从时间设备的时间同步精度。  In order to ensure the time synchronization accuracy of the master-slave clock device, the present invention provides three optional ways to obtain the time synchronization message transmission or reception time through the scheduling information, and the three methods provided may be better. The symmetry of the time that the guaranteed time synchronization message is transmitted back and forth between the master and slave clock devices ensures the time synchronization accuracy of the master-slave time device.
本发明实施例提供的一种通过调度信息来获取发送或接收时间同步消 息的时刻的方式, 可参阅图 4-c,其具体实现方式如下:  A manner of obtaining a time for transmitting or receiving a time synchronization message by using scheduling information is provided in the embodiment of the present invention. For example, as shown in Figure 4-c, the specific implementation manner is as follows:
作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息 (如 Sync报文或 De 1 ay.Req报文 )时, 可根据该时间同步消息的调 度信息, 获取通过 RF发送的承载该时间同步消息的子帧的时隙, 根据本地 时钟和上述时隙计算出该时隙中的最后一个符号的结束时刻 ^和^,并将 ^和 作为该时间同步消息通过 RF发出的时刻, 相应的, 作为接收端的 时钟设备(如从时钟设备或主时钟设备), 在接收到该时间同步消息时, 根 据该时间同步消息的调度信息, 获取空口物理层接收承载该时间同步消息 的子帧的时隙, 根据本地时钟和上述时隙计算出空口物理层接收到该时隙 中的第一个符号的起始时刻 ^和 tdl , 并将 ^和 tdl作为空口物理层接收到 该时间同步消息的时刻, 由图 4-c可见, 时间同步消息在传输线路中的延 时 de lay和 de lay'是对称,且因为获取的是通过 RF发送时间同步消息的时 隙中的最后一个符号的结束时刻和空口物理层接收时间同步消息的时隙中 的第一个符号的起始时刻, 故可剔除因主从时钟设备间频率的不同步而导 致的主从时钟设备发送或接收子帧的时间的不同步, 因此, 通过此获取方 式可更为精确的获取到时间同步消息的发送时刻和接收时刻。 As the clock device of the sender (such as the master clock device or the slave clock device), the transmission time is the same. When a step message (such as a Sync message or a De 1 ay.Req message), the time slot of the subframe that carries the time synchronization message sent by the RF may be obtained according to the scheduling information of the time synchronization message, according to the local clock and the foregoing The time slot calculates the end time ^ and ^ of the last symbol in the time slot, and uses ^ and as the time when the time synchronization message is sent through the RF, correspondingly as the clock device of the receiving end (such as the slave clock device or the master clock) The device, when receiving the time synchronization message, obtains a time slot of the subframe in which the air interface physical layer receives the time synchronization message according to the scheduling information of the time synchronization message, and calculates the physical layer of the air interface according to the local clock and the time slot. Receiving the start time ^ and t dl of the first symbol in the time slot, and taking ^ and t dl as the time when the air interface physical layer receives the time synchronization message, as can be seen from Figure 4-c, the time synchronization message is The delays delay and de lay' in the transmission line are symmetrical, and because the acquisition is the end time of the last symbol in the time slot of the time synchronization message sent by RF and the physical interface of the air interface Receiving the start time of the first symbol in the time slot of the time synchronization message, so that the time of the transmission or reception of the subframe by the master-slave clock device due to the unsynchronization of the frequency between the master and slave clock devices can be eliminated, so With this acquisition method, the sending time and receiving time of the time synchronization message can be obtained more accurately.
本发明实施例还提供的另一种通过调度信息来获取发送或接收时间同 步消息的时刻的方式, 可参阅图 4-d, 具体方式如下:  Another manner for obtaining a time for transmitting or receiving a time synchronization message by using scheduling information is also provided in the embodiment of the present invention. For details, refer to FIG. 4-d. The specific manner is as follows:
作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息 (如 Sync报文或 De 1 ay.Req报文 )时, 可根据该时间同步消息的调 度信息, 获取通过 RF发送的承载该时间同步消息的子帧的时隙, 根据本地 时钟和上述时隙计算出该时隙中的最后一个符号的起始时刻 ta2和 t。2,将 ta2 和 t。2作为该时间同步消息通过 RF发出的时刻,相应的,作为接收端的时钟 设备(如从时钟设备或主时钟设备), 在接收到该时间同步消息时, 根据该 时间同步消息的调度信息, 获取空口物理层接收承载该时间同步消息的子 帧的时隙, 根据本地时钟和上述时隙计算出空口物理层接收到该时隙中的 第二个符号的起始时刻 tb2和 td2 , 将 tb2和 td2作为空口物理层接收到该时间 同步消息的时刻, 由图 4-d可见, 时间同步消息在传输过程中的延时 de lay 和 de lay'是对称, 且 ta2和 td2对称, tb2和 t。2对称, 通过此获取方式同样可 精确的记录时间同步消息的发送时刻和接收时刻。 As a clock device of the transmitting end (such as a master clock device or a slave clock device), when sending a time synchronization message (such as a Sync message or a De 1 ay.Req message), the scheduling information of the time synchronization message may be obtained through the RF. The transmitted time slot of the subframe carrying the time synchronization message calculates the starting times t a2 and t of the last symbol in the time slot according to the local clock and the time slot. 2 , will t a2 and t. 2, as the time when the time synchronization message is sent by the RF, correspondingly, the clock device as the receiving end (such as the slave clock device or the master clock device), when receiving the time synchronization message, obtains according to the scheduling information of the time synchronization message. The air interface physical layer receives the time slot of the subframe that carries the time synchronization message, and calculates, according to the local clock and the time slot, the start times t b2 and t d2 of the second symbol in the time slot received by the air interface physical layer, t b2 and t d2 are the moments when the air interface physical layer receives the time synchronization message. As can be seen from Figure 4-d, the delays of the time synchronization message during transmission are desymmetrical and de lay', and t a2 and t d2 Symmetric, t b2 and t. 2 symmetry, the acquisition time and the receiving time of the time synchronization message can also be accurately recorded by this acquisition method.
本发明实施例还提供的另一种通过调度信息来获取发送或接收时间同 步消息的时刻的方式, 可参阅图 4-e具体方式如下: Another embodiment of the present invention further provides that the sending or receiving time is the same through scheduling information. The way to step the message, please refer to Figure 4-e in the following way:
作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息 (如 Sync报文或 De 1 ay.Req报文 )时, 可根据该时间同步消息的调 度信息, 获取通过 RF发送的承载该时间同步消息的子帧的时隙, 根据本地 时钟和上述时隙计算出该时隙中的第一个符号的起始时刻 ta3和 t。3, 将 ta3 和 t。3作为该时间同步消息通过 RF发出的时刻,相应的,作为接收端的时钟 设备(如从时钟设备或主时钟设备), 在接收到该时间同步消息时, 根据该 时间同步消息的调度信息, 获取空口物理层接收承载该时间同步消息的子 帧的时隙, 根据本地时钟和上述时隙计算出空口物理层接收到该时隙中的 第一个符号的起始时刻 tb3和 td3 , 将 tb3和 td3作为空口物理层接收到该时间 同步消息的时刻, 由图 4-e可见, 时间同步消息在传输过程中的延时 de lay 和 de l ay'是对称, 因此, 通过此获取方式同样可较为精确的获取到时间同 步消息的发送时刻和接收时刻。 As a clock device of the transmitting end (such as a master clock device or a slave clock device), when sending a time synchronization message (such as a Sync message or a De 1 ay.Req message), the scheduling information of the time synchronization message may be obtained through the RF. The transmitted time slot of the subframe carrying the time synchronization message calculates the starting times t a3 and t of the first symbol in the time slot according to the local clock and the time slot. 3 , will t a3 and t. 3 as the time when the time synchronization message is sent by the RF, and correspondingly, the clock device as the receiving end (such as the slave clock device or the master clock device), when receiving the time synchronization message, obtains according to the scheduling information of the time synchronization message. The air interface physical layer receives the time slot of the subframe that carries the time synchronization message, and calculates, according to the local clock and the time slot, the start times t b3 and t d3 of the first symbol in the time slot received by the air interface physical layer, t b3 and t d3 are the moments when the air interface physical layer receives the time synchronization message. As can be seen from Figure 4-e, the delays of the time synchronization message during transmission are desymmetrical and de yy', so In the same way, the sending time and the receiving time of the time synchronization message can be obtained more accurately.
由上可见, 本实施例中, 通过调度信息获取时间同步消息通过 RF发出 的时刻和空口物理层接收到时间同步消息的时刻, 实现了对物理层调制解 调的处理时延的补偿, 从而剔除了因物理层调制解调等处理的时延和抖动 而对获取时间同步报文的发送和接收时刻的精确度的影响, 提高了获取时 间同步报文的发送和接收时刻的精确度, 利用该获取的更高精确度的时间 同步消息的发送和接收时刻信息进行主从时钟设备的时间同步, 能够相应 提高主从时钟设备的时间同步精度。 为便于更好地理解本发明的技术方案, 下面以在主从时钟设备通过硬 件记录的方式获取在空口物理层发送或接收时间同步消息的时刻为例对本 发明实施例描述的时间同步方法进行详细描述。  It can be seen that, in this embodiment, the time when the time synchronization message is obtained by the scheduling information and the time when the air interface physical layer receives the time synchronization message, the compensation for the processing delay of the physical layer modulation and demodulation is realized, thereby eliminating The effect of obtaining the accuracy of the transmission and reception time of the time synchronization message due to the delay and jitter of the processing such as the physical layer modulation and demodulation, and improving the accuracy of the time of transmitting and receiving the time synchronization message, The obtained transmission and reception time information of the higher-precision time synchronization message is time-synchronized by the master-slave clock device, and the time synchronization accuracy of the master-slave clock device can be improved accordingly. In order to facilitate a better understanding of the technical solution of the present invention, the time synchronization method described in the embodiment of the present invention is described in detail by taking the time when the master-slave clock device acquires the time synchronization message at the physical layer of the air interface by means of hardware recording. description.
请参阅图 5-a , 本发明实施例中的时间同步方法的另一个实施例, 具体 可以包括:  Referring to FIG. 5-a, another embodiment of the time synchronization method in the embodiment of the present invention may specifically include:
501、 主时钟设备向从时钟设备发送时间同步报文 Sync;  501, the master clock device sends a time synchronization message Sync to the slave clock device;
当需要进行时间同步时, 系统默认的主时钟设备按照预置的间隔时间 (缺省为 2秒)周期性地以多播的形式发送唯一的 Sync报文, 则所有处在 默认主时钟设备网段内, 并且与主时钟设备所在域相同的从时钟设备都能 接收到 Sync报文。 When time synchronization is required, the default primary clock device periodically sends a unique Sync packet in multicast according to the preset interval (default is 2 seconds), and all are in the default primary clock device network. Within the segment, and the same slave clock device as the master clock device Received a Sync message.
502、 主时钟设备通过硬件记录 Sync报文通过 RF发出的时刻 1\;  502. The master clock device records the time when the Sync message is sent through the RF through the hardware 1\;
主时钟设备发送 Sync报文时, 可通过硬件(如射频装置或其他硬件装 置)将 Sync报文通过 RF发出的时隙中的最后一个符号的结束时刻记录下 来, 作为 Sync ^艮文通过 RF发出的时刻, 或者, 通过硬件将 Sync ·^艮文通过 RF发出的时隙中的最后一个符号的起始时刻记录下来,作为 Sync报文通过 个符号的起始时刻记录下来, 作为 Sync ·^艮文通过 RF发出的时刻, 或者, 也可以通过硬件将 Sync ^艮文通过 RF发出的时隙中的其它符号的起始或结 束时刻记录下来, 作为 Sync ·^艮文通过 RF发出的时刻, 此处不作限定。 上 述时隙可以是对应一个无线帧或者子帧的时隙。  When the master clock device sends a Sync message, the Sync message can be recorded by the hardware (such as a radio device or other hardware device) through the end time of the last symbol in the time slot sent by the RF, and sent as a Sync message through the RF. At the moment, or by hardware, the Sync message is recorded by the start time of the last symbol in the time slot sent by the RF, and is recorded as the Sync message by the start time of the symbol, as Sync. The time when the text is sent by the RF, or the Sync/艮 text can be recorded by the hardware through the start or end time of other symbols in the time slot sent by the RF, as the time when the Sync message is sent through the RF. There is no limit. The time slot may be a time slot corresponding to one radio frame or subframe.
503、 从时钟设备在 12时刻接收 Sync报文, 并通过硬件记录空口物理 层接收到 Sync报文的时刻 T2; 503, receives the Sync device from the clock 12 at time packet, the physical layer air interface and receives the Sync message recording time T 2 by hardware;
从时钟设备在接收到 Sync报文时,可通过硬件将空口物理层接收 Sync 报文的时隙中的第一个符号的起始时刻记录下来, 作为空口物理层接收到 Sync报文的时刻, 或者, 通过硬件将空口物理层接收 Sync报文的时隙中的 第二个符号的起始时刻记录下来,作为空口物理层接收到 Sync报文的时刻, 或者, 也可以通过硬件将空口物理层接收 Sync报文的时隙中的其它符号的 起始或结束时刻记录下来, 作为空口物理层接收到 Sync报文的时刻, 此处 不作限定。  When receiving the Sync message from the clock device, the clock device may record the start time of the first symbol in the time slot of the Sync message received by the physical layer of the air interface, as the time when the physical layer of the air interface receives the Sync message. Alternatively, the start time of the second symbol in the slot of the Sync packet received by the physical layer of the air interface is recorded by the hardware, as the time when the physical layer of the air interface receives the Sync message, or the physical layer of the air interface may be used by hardware. The start or end time of the other symbol in the slot in which the Sync packet is received is recorded as the time at which the Sync packet is received by the physical layer of the air interface, which is not limited herein.
504、主时钟设备通过跟随报文 Fo 1 1 ow-up把 T\的时间戳传递给从时钟 设备;  504. The master clock device passes the timestamp of T\ to the slave clock device by following the message Fo 1 1 ow-up;
主时钟设备在发送上述 Sync报文之后, 向上述从时钟设备发送携带 1\ 的时间戳的 Fo l low_up报文, 以便该从时钟设备获知主时钟设备通过 RF发 出上述 Sync报文的时刻 1\。  After transmitting the Sync message, the master clock device sends a Fo l low_up message carrying the time stamp of 1\ to the slave clock device, so that the slave clock device knows the time 1 when the master clock device sends the Sync message through the RF. .
505、从时钟设备在 13时刻向主时钟设备发送延迟请求报文 De 1 ay - Re d; 为了提高修正精度, 时间同步过程需要对主从设备间的时间同步报文 的传输延迟进行测量, 此时, 从时钟设备会向主时钟设备不定期的发送 De l ay-Req ^艮文, 其间隔时间缺省值为 4到 60秒之间的随机值。 505. The slave clock device sends a delay request message De 1 ay - Re d to the master clock device at time 1 3 ; in order to improve the correction precision, the time synchronization process needs to measure the transmission delay of the time synchronization message between the master and the slave device. At this time, the slave clock device sends the De l ay-Req^ message to the master clock device irregularly. The interval time defaults to a random value between 4 and 60 seconds.
506、 从时钟设备通过硬件记录 De lay-Red 艮文通过 RF发出的时刻 T3; 从时钟设备发送 De lay-Req报文时, 可通过硬件将 De l ay-Req报文通 过 RF发出的时隙中的最后一个符号的结束时刻记录下来, 作为 De lay-Req 艮文通过 RF发出的时刻, 或者, 通过硬件将 De lay-Red ·^艮文通过 RF发出 的时隙中的最后一个符号的起始时刻记录下来, 作为 De lay-Req ·^艮文通过 RF发出的时刻, 或者, 通过硬件将 De lay-Req ^t艮文通过 RF发出的时隙中的 第一个符号的起始时刻记录下来,作为 De lay-Rec^艮文通过 RF发出的时刻, 或者, 也可以通过硬件将 De lay-Red ·^艮文通过 RF发出的时隙中的其它符号 的起始或结束时刻记录下来, 作为 De lay-Req报文通过 RF发出的时刻, 此 处不作限定。 506. The slave device records the time T 3 sent by the Delay-Red message through the hardware through the hardware. When the Delay-Req message is sent from the clock device, the De l ay-Req message can be sent through the hardware. The end time of the last symbol in the time slot sent by the RF is recorded as the time when the Delay-Req message is sent by RF, or by the hardware to send the Delay-Red message to the time slot sent by the RF. The start time of the last symbol is recorded as the time when the release is made by the Delay-Req ·^艮 text, or the first of the time slots issued by the RF by Delay-Req ^t艮 by the hardware. The start time of the symbol is recorded as the time when the Delay-Rec^ message is sent by the RF, or the start of other symbols in the time slot issued by the RF by Delay-Red can also be transmitted by hardware. Recorded at the end time or as the time when the Delay-Req message is sent by RF, it is not limited here.
507、主时钟设备在 t4时刻接收由该从时钟设备发送的 De lay-Req报文, 并通过硬件记录空口物理层接收到 De l ay-Req ^艮文的时刻 T4; 507, received by the master clock device De lay-Req message transmitted from the clock device at the time t 4, and through the air interface physical layer hardware record received De l ay-Req ^ Gen packet time T 4;
主时钟设备在接收到 De lay-Req报文时, 可通过硬件将空口物理层接 收 De lay-Req ^艮文的时隙中的第一个符号的起始时刻记录下来, 作为空口 物理层接收到 De lay-Req报文的时刻, 或者, 通过硬件将空口物理层接收 De 1 ay-Req ^艮文的时隙中的第二个符号的起始时刻记录下来,作为空口物理 层接收到 De lay-Red 报文的时刻, 或者, 通过硬件将空口物理层接收 De lay-Red ^艮文的时隙中的其它符号的起始或结束时刻记录下来,作为空口 物理层接收到 De lay-Req报文的时刻, 此处不作限定。  When receiving the Delay-Req message, the master clock device can record the start time of the first symbol in the time slot of the physical layer receiving the Delay-Req^ message through the hardware, and receive it as the air interface physical layer. At the time of the Delay-Req message, or by the hardware, the start time of the second symbol in the time slot of the physical layer receiving the De 1 ay-Req 艮 text is recorded by the hardware, and the De is received as the physical layer of the air interface. The time of the lay-red packet, or the hardware starts to record the start or end time of other symbols in the time slot of the Delay-Red 物理 physical layer, and receive the De lay-Req as the air interface physical layer. The time of the message is not limited here.
508、从时钟设备通过跟随报文 Fol low_up把 1^的时间戳传递给主时钟 设备;  508. The slave clock device passes the timestamp of 1^ to the master clock device by following the message Fol low_up;
从时钟设备在发送上述 De lay-Red报文之后, 通过扩展 1588v2协议, 向主时钟设备发送新增的携带 T3的时间戳的 Fol low_uP报文, 以便该主时 钟设备可以获知上述从时钟设备通过 RF发出上述 De lay-Red报文的时刻 T3Slave clock device after transmitting the message De lay-Red, by extending-1588v2, to the new master clock device sends timestamp carrying Fol low_u T P of packet 3, so that the master clock device can be known from the above-described clock The device sends the time T 3 of the above Delay-Red message through the RF.
509、 主时钟设备通过延迟响应报文 De lay-Resp把 T4的时间戳传递给 从时钟设备; 509, by delaying the response to the master clock device De lay-Resp message to the time stamp T is transmitted to the slave clock device 4;
主时钟设备在接收到上述从时钟设备发送的 Fol low_up报文之后, 向 上述从时钟设备发送携带 T4的时间戳的 De 1 ay-Re s ρ报文, 以便该从时钟设 备获知主时钟设备在空口物理层接收到上述 De lay-Red报文的时刻 T4After receiving the Fol low_up message sent by the slave clock device, the master clock device sends a De 1 ay-Re s ρ message carrying the time stamp of T 4 to the slave clock device, so that the slave clock device learns the master clock device. The time T 4 of the above Delay-Red message is received at the air interface physical layer.
510、 从时钟设备根据上述 Τ\ , Τ2, ^和 Τ4计算其与主时钟设备的时钟 偏移量; 510. The slave clock device calculates a clock offset from the master clock device according to the foregoing Τ\, Τ 2 , ^, and Τ 4 ;
从时钟设备在获取到上述 Τ2, Τ3和 Τ4之后, 可以根据下述公式计 算其与主时钟设备之间的报文平均延迟 Delay,并相应计算出其与主时钟设 备的时钟偏移量 Offset: After the clock device obtains the above Τ 2 , Τ 3 and Τ 4 , the average delay of the message between the slave clock and the master clock device can be calculated according to the following formula, and the master clock is calculated accordingly. Backup clock offset Offset:
T2= T!+Delay+Offset; T4= T3+Delay-Offset。 T 2 = T! + Delay + Offset; T 4 = T 3 + Delay-Offset.
上述两条公式可以变成:  The above two formulas can become:
Delay = ( T2- 1\+1> T3 ) 12; Delay = ( T 2 - 1\+1> T 3 ) 12;
0ff set= T2- Τ - De lay, 即 Off set= ( T2_ T -T4+ T3 ) /2。 0ff set= T 2 - Τ - De lay, ie Off set= ( T 2 _ T -T 4 + T 3 ) /2.
511、 从时钟设备根据计算的结果对其本地时钟进行修正;  511. The slave clock device corrects its local clock according to the calculated result.
根据步骤 510计算的结果, 从时钟设备可以根据时钟偏移量 Off set对 其本地时钟进行修正, 从而达到与主时钟设备的时间同步。  According to the result of the calculation in step 510, the slave clock device can correct its local clock according to the clock offset Off set, thereby achieving time synchronization with the master clock device.
需要说明的是, 从时钟设备可以经过多次主从时钟设备间的时间同步 消息交互过程之后, 对通过计算得出的多个 Off set的值取平均值。  It should be noted that, after the clock device can pass the time synchronization message interaction process between the master and slave clock devices, the values of the multiple Off sets obtained by the calculation are averaged.
可以理解, 通过其他的硬件记录机制实现本发明的时间同步方法的步 骤可参照上述实施例中描述的时间同步方法, 至于具体的硬件记录机制可 在执行时间同步操作时对主从时钟设备进行设定, 此处不再赘述。  It can be understood that the steps of implementing the time synchronization method of the present invention by other hardware recording mechanisms may refer to the time synchronization method described in the foregoing embodiments, and the specific hardware recording mechanism may set the master-slave clock device when performing the time synchronization operation. This will not be repeated here.
为便于理解, 下面以在 LTE 系统下通过硬件记录的方式获取发送或接 收时间同步消息的时刻为例, 对硬件记录方式中的硬件记录机制进行说明, 其中, LTE系统中一个 0. 5ms时隙的一种时频结构可如图 4-b中所示的时频 结构。  The LTE system has a 0. 5ms time slot in the LTE system. The following is a description of the hardware recording mechanism in the hardware recording mode, where the LTE system uses a hardware recording method to obtain a time of sending or receiving a time synchronization message. A time-frequency structure can be as shown in the time-frequency structure shown in Figure 4-b.
为了保证主从时间设备的时间同步精度, 本发明实施例中提供了三种 可选的硬件记录机制, 通过提供的这三种优选的硬件记录机制, 可以较好 的保证时间同步消息在主从时钟设备间来回传输的时间的对称性, 从而保 证主从时间设备的时间同步精度。  In order to ensure the time synchronization accuracy of the master-slave time device, three optional hardware recording mechanisms are provided in the embodiment of the present invention. By providing the three preferred hardware recording mechanisms, the time synchronization message can be better guaranteed in the master-slave The symmetry of the time of transmission between clock devices, thus ensuring the time synchronization accuracy of the master-slave time device.
本发明提供的一种硬件记录机制,可参阅图 5-b,其具体实现方式如下: 作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息 (如 Sync报文或 De 1 ay.Req报文 )时, 通过硬件将该时间同步消息 通过 RF发出的时隙中的最后一个符号的结束时刻 ta4和 t。4记录下来, 作为 该时间同步消息通过 RF发出的时刻, 相应的, 作为接收端的时钟设备(如 从时钟设备或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口 物理层接收该时间同步消息的时隙中的第一个符号的起始时刻 tb4和 td4记录 下来, 作为空口物理层接收到该时间同步报文的时刻, 由图 5-b可见, 时 间同步消息在传输线路中的延时 de lay和 de lay'是对称, 且因为通过硬件 记录的是时间同步消息通过 RF发出的时隙中的最后一个符号的结束时刻和 空口物理层接收时间同步消息的时隙中的第一个符号的起始时刻, 故剔除 了因主从时钟设备间频率的不同步而导致的主从时钟设备发送或接收子帧 的时间的不同步, 因此, 通过此硬件记录方式可更为精确的记录时间同步 消息的发送时刻和接收时刻。 A hardware recording mechanism provided by the present invention can be referred to as FIG. 5-b, and the specific implementation manner is as follows: As a clock device of the transmitting end (such as a master clock device or a slave clock device), a time synchronization message (such as a Sync message or When De 1 ay.Req message), the time synchronization message is transmitted by hardware through the end times t a4 and t of the last symbol in the time slot issued by the RF. 4 is recorded as the time when the time synchronization message is sent by the RF, and correspondingly, the clock device (such as the slave clock device or the master clock device) as the receiving end receives the time synchronization message through the hardware, and receives the physical layer of the air interface through the hardware. The start times t b4 and t d4 of the first symbol in the time slot of the time synchronization message are recorded as the time when the air interface physical layer receives the time synchronization message. As can be seen from FIG. 5-b, the time synchronization message is The delays delay and de lay' in the transmission line are symmetrical, and because of the hardware Recording is the end time of the last symbol in the time slot of the time synchronization message sent by the RF and the start time of the first symbol in the time slot of the time slot receiving the time synchronization message of the air interface physical layer, so the master slave clock device is eliminated. The time when the master-slave clock device transmits or receives the subframe is not synchronized due to the unsynchronized frequency, and therefore, the hardware recording method can more accurately record the transmission timing and the reception timing of the time synchronization message.
本发明提供的另一种硬件记录机制, 可参阅图 5-c,具体方式如下: 作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息(如 Sync消息或 De lay-Req消息 )时, 通过硬件将该时间同步消息 通过 RF发出的时隙中的最后一个符号的起始时刻 ^5和 t。5记录下来, 作为 该时间同步消息通过 RF发出的时刻, 相应的, 作为接收端的时钟设备(如 从时钟设备或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口 物理层接收该时间同步消息的时隙中的第二个符号的起始时刻 tb5和 td5记录 下来, 作为空口物理层接收到该时间同步报文的时刻, 由图 5-c可见, 时 间同步消息在传输过程中的延时 de lay和 de lay'是对称, 且 ^5和 td5对称, tb5和 t。5对称, 通过此硬件记录方式同样可精确的记录时间同步消息的发送 时刻和接收时刻。 Another hardware recording mechanism provided by the present invention can be referred to FIG. 5-c in the following manner: As a clock device of the transmitting end (such as a master clock device or a slave clock device), a time synchronization message (such as a Sync message or a De lay) is sent. -Req message), the time synchronization message is passed by hardware through the start time ^ 5 and t of the last symbol in the time slot issued by the RF. 5 recorded as the time of the time synchronization message through the RF emission, corresponding, as a clock device receiving end (e.g., the slave clock device, or master clock device), upon receiving the time synchronization message, by a hardware empty physical layer receiving opening The start times t b5 and t d5 of the second symbol in the time slot of the time synchronization message are recorded as the time at which the air interface physical layer receives the time synchronization message. As can be seen from FIG. 5-c, the time synchronization message is The delays delay and de lay' during transmission are symmetrical, and ^ 5 and t d5 are symmetric, t b5 and t. 5 symmetry, the hardware recording method can also accurately record the sending time and receiving time of the time synchronization message.
本发明提供的另一种硬件记录机制, 可参阅图 5-d, 具体方式如下: 作为发送端的时钟设备(如主时钟设备或从时钟设备), 在发送时间同 步消息(如 Sync消息或 De 1 ay.Req消息 )时, 通过硬件将该时间同步消息 通过 RF发出的时隙中的第一个符号的起始时刻 ta6和 t。6记录下来, 作为该 时间同步消息通过 RF发出的时刻, 相应的, 作为接收端的时钟设备(如从 时钟设备或主时钟设备), 在接收到该时间同步消息时, 通过硬件将空口物 理层接收到时间同步消息的时隙中的第一个符号的起始时刻 tb6和 td6记录下 来, 作为空口物理层接收到该时间同步报文的时刻, 由图 5-d可见, 时间 同步消息在传输过程中的延时 de lay和 de lay'是对称, 通过此硬件记录方 式同样可以较为精确的记录时间同步消息的发送时刻和接收时刻。 Another hardware recording mechanism provided by the present invention can be referred to FIG. 5-d in the following manner: As a clock device of the transmitting end (such as a master clock device or a slave clock device), a time synchronization message (such as a Sync message or De 1) is sent. When ay.Req message), the time synchronization message is transmitted by hardware through the start times t a6 and t of the first symbol in the time slot issued by the RF. 6 recorded as the time of the time synchronization message through the RF emission, corresponding, as a clock device receiving end (e.g., the slave clock device, or master clock device), upon receiving the time synchronization message, by a hardware empty physical layer receiving opening The time instants t b6 and t d6 of the first symbol in the time slot of the time synchronization message are recorded as the time at which the air interface physical layer receives the time synchronization message. As can be seen from FIG. 5-d, the time synchronization message is The delays delay and de lay' in the transmission process are symmetrical, and the hardware recording method can also accurately record the sending time and receiving time of the time synchronization message.
由上可见, 本实施例中, 通过硬件记录的方式获取主从时钟设备在空 口物理层发送和接收时间同步报文的时刻, 剔除了因物理层调制解调等处 理的时延和抖动而对获取时间同步 4艮文的发送和接收时刻的精确度的影 响, 提高了获取时间同步报文的发送和接收时刻的精确度, 利用该获取的 更高精确度的时间同步消息的发送和接收时刻信息进行主从时钟设备的时 间同步, 能够相应提高主从时钟设备的时间同步精度。 下面对基于本发明实施例的上述方法的主时钟设备进行描述, 如图 6 所示, 本发明实施例提供的一种主时钟设备, 包括: It can be seen that, in this embodiment, the time when the master-slave clock device transmits and receives the time synchronization message at the physical layer of the air interface is obtained by means of hardware recording, and the delay and jitter caused by the processing and demodulation of the physical layer are eliminated. Obtain the accuracy of the transmission and reception time of the time synchronization message The accuracy of obtaining the time of sending and receiving time synchronization messages is improved, and the time synchronization of the master and slave clock devices is performed by using the acquired higher precision time synchronization message transmission and reception time information, thereby improving the master-slave correspondingly Time synchronization accuracy of the clock device. The master clock device according to the foregoing method of the embodiment of the present invention is described below. As shown in FIG. 6, a master clock device according to an embodiment of the present invention includes:
收发模块 601 , 用于向从时钟设备发送第一时间同步消息, 并获取上述 第一时间同步消息通过 RF发出的时刻  The transceiver module 601 is configured to send a first time synchronization message to the slave clock device, and obtain a time when the first time synchronization message is sent by using the RF
获取模块 602,用于获取收发模块 601通过射频发出第一时间同步消息 的时刻  The obtaining module 602 is configured to acquire a time when the transceiver module 601 sends the first time synchronization message by using the radio frequency.
在一种应用场景下, 获取模块 602具体可用于根据上述第一时间同步 消息的调度信息, 获取第一时间同步消息通过 RF发出的时刻 或者通 过硬件记录第一时间同步消息通过 RF发出的时刻 1\。  In an application scenario, the obtaining module 602 is specifically configured to obtain, according to the scheduling information of the first time synchronization message, a time when the first time synchronization message is sent by using the RF or a time when the first time synchronization message is sent by the hardware through the RF. \.
在实际应用中, 获取模块 602可包括:  In an actual application, the obtaining module 602 can include:
获取模块一, 用于根据上述第一时间同步消息的调度信息, 获取上述 第一时间同步消息通过射频发出的对应时隙;  The obtaining module 1 is configured to obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message by using a radio frequency;
和,  with,
处理模块一, 用于根据本地时钟和获取模块一获取的时隙计算出发送 上述时隙中的最后一个符号的结束时刻, 将其作为上述第一时间同步消息 通过射频发出的时刻 或, 根据本地时钟和获取模块一获取的时隙计算 出发送上述时隙中的最后一个符号的起始时刻, 将其作为上述第一时间同 步消息通过射频发出的时刻 或者, 根据本地时钟和获取模块一获取的 时隙计算出发送上述时隙中的第一个符号的起始时刻, 将其作为上述第一 时间同步消息通过射频发出的时刻 1\。  The processing module 1 is configured to calculate, according to the time slot acquired by the local clock and the acquiring module, the end time of sending the last symbol in the time slot, as the time when the first time synchronization message is sent by using the radio frequency, or according to the local time. The time slot obtained by the clock and the acquiring module calculates the starting time of transmitting the last symbol in the time slot, and uses it as the time when the first time synchronization message is sent by using the radio frequency or acquired according to the local clock and the acquiring module 1. The time slot calculates the start time of transmitting the first symbol in the above time slot, and uses it as the time 1\ that the first time synchronization message is sent through the radio frequency.
收发模块 601还用于向从时钟设备发送第二时间同步消息, 并在上述 第二时间同步消息中携带 T i的时间戳;  The transceiver module 601 is further configured to send a second time synchronization message to the slave clock device, and carry a timestamp of the T i in the second time synchronization message;
收发模块 601还用于接收由上述从时钟设备发送的第三时间同步消息; 获取模块 602, 还用于根据收发模块 601接收的第三时间同步消息, 获 取空口物理层接收上述第三时间同步消息的时刻 T4; The transceiver module 601 is further configured to receive the third time synchronization message sent by the slave clock device, and the acquiring module 602 is further configured to acquire, according to the third time synchronization message received by the transceiver module 601, the air interface physical layer to receive the third time synchronization message. Time T 4 ;
在一种应用场景下, 获取模块 602具体可用于根据上述第三时间同步 消息的调度信息, 获取在空口物理层接收到上述第三时间同步消息的时刻 τ4;或者通过硬件记录空口物理层接收到上述第三时间同步消息的时刻 τ4In an application scenario, the obtaining module 602 is specifically configured to synchronize according to the foregoing third time. Scheduling information message, acquires the air interface physical layer receives the third time synchronization message a time τ 4; or a hardware recording time τ 4 by the air interface physical layer receives the third time synchronization messages.
在实际应用中, 获取模块 602包括:  In an actual application, the obtaining module 602 includes:
获取模块二, 用于根据上述第三时间同步消息的调度信息, 获取空口 物理层接收上述第三时间同步消息的对应时隙;  The obtaining module 2 is configured to obtain, according to the scheduling information of the third time synchronization message, a corresponding time slot in which the air interface physical layer receives the third time synchronization message;
和,  with,
处理模块二, 用于根据本地时钟和获取模块二获取的时隙计算出空口 物理层接收到上述时隙中的第一个符号的起始时刻, 将其作为上述主时钟 设备在空口物理层接收到上述第三时间同步消息的时刻 Τ4, 或者, 根据本 地时钟和获取模块二获取的计算出空口物理层接收到上述时隙中的第二个 符号的起始时刻, 将其作为上述主时钟设备在空口物理层接收到上述第三 时间同步消息的时刻 τ4The processing module 2 is configured to calculate, according to the time slot acquired by the local clock and the acquiring module 2, the start time of the first symbol in the time slot received by the physical layer of the air interface, and receive the same as the primary clock device in the physical layer of the air interface. The time Τ 4 to the third time synchronization message, or the calculation of the start time of the second symbol in the time slot received by the physical layer of the air interface according to the local clock and the acquisition module 2, as the master clock The device receives the time τ 4 of the third time synchronization message at the air interface physical layer.
收发模块 601还用于向上述从时钟设备发送第四时间同步消息, 并在 上述第四时间同步消息中携带 Τ4的时间戳; 以便于上述从时钟设备根据 Ί1 和 Τ4计算上述从时钟设备与上述主时钟设备的时钟偏移量, 并根据计算的 时钟偏移量, 对上述从时钟设备的本地时钟进行修正。 Transceiver module 601 is further configured to the clock synchronization message from a sending device a fourth time, and carry timestamp Τ 4 in the fourth time synchronization message; to calculate according to the clock apparatus Ί 1 and 4 from the slave clock Τ The clock offset of the device from the master clock device, and correcting the local clock of the slave clock device according to the calculated clock offset.
进一步的, 在一种应用场景下, 收发模块 601 还可用于接收上述从时 钟设备通过扩展 1588ν2协议发送的新增消息如可以是跟随报文 Fo 1 1 ow.up , 获取模块 602还可用于获取上述新增消息中携带的 Τ3的时间戳。 Further, in an application scenario, the transceiver module 601 is further configured to receive the new message sent by the slave clock device by using the extended 1588 ν2 protocol, such as the following message F1 1 ow.up, and the obtaining module 602 may also be used to obtain The timestamp of Τ 3 carried in the above new message.
在一种应用场景下, 第一时间同步消息例如是时间同步报文 Sync或其 它消息; 第二时间同步消息例如是跟随 4艮文 Fo 1 1 ow_ up或其它消息; 第三 时间同步消息例如是延迟请求报文 De lay-Req或其它消息; 第四时间同步 消息例如是延迟响应报文 De lay-Re sp或其它消息。  In an application scenario, the first time synchronization message is, for example, a time synchronization message Sync or other message; the second time synchronization message is, for example, a follow-up message Fo 1 1 ow_ up or other message; the third time synchronization message is, for example, Deferred request message De lay-Req or other message; The fourth time synchronization message is, for example, a delayed response message De lay-Re sp or other message.
需要说明的是, 本实施例的主时钟设备可如上述方法实施例中的主时 钟设备, 可以用于实现上述方法实施例中的全部技术方案, 其各个功能模 块的功能可以根据上述方法实施例中的方法具体实现, 其具体实现过程可 参照上述实施例中的相关描述, 此处不再赘述。  It should be noted that the master clock device in this embodiment may be used as the master clock device in the foregoing method embodiment, and may be used to implement all the technical solutions in the foregoing method embodiments, and the functions of the respective function modules may be according to the foregoing method embodiments. For a specific implementation of the method, reference may be made to the related description in the foregoing embodiments, and details are not described herein again.
由上可见, 本实施例中, 主时钟设备通过获取模块 602 获取第一时间 同步消息通过 RF 发出的时刻和空口物理层接收到第三时间同步消息的时 刻, 并通过收发模块 601 把上述两个时刻的时间戳分别通过第二时间同步 消息和第四时间同步消息发送给从时钟设备, 使得该从时钟设备可以获知 主时钟设备通过 RF发出第一时间同步消息以及在空口物理层接收到第三时 间同步消息的时刻, 相应提高了从时钟设备后续计算其与主时钟设备的时 钟偏移量的准确性, 利用更准确的计算结果来对从时钟设备的本地时钟进 行修正, 提高了主从时钟设备的时间同步精度。 It can be seen that, in this embodiment, the master clock device obtains, by the obtaining module 602, the time when the first time synchronization message is sent by the RF and the time when the air interface physical layer receives the third time synchronization message. And sending, by the transceiver module 601, the timestamps of the two moments to the slave clock device through the second time synchronization message and the fourth time synchronization message, respectively, so that the slave clock device can know that the master clock device sends the first time through the RF. Synchronization message and the moment when the third time synchronization message is received at the physical layer of the air interface, correspondingly improve the accuracy of the clock device to calculate the clock offset from the master clock device, and use the more accurate calculation result to the slave clock device. The local clock is corrected to improve the time synchronization accuracy of the master and slave clock devices.
所示, 本发明实施例提供的一种从时钟设备, 包括: As shown in the embodiment of the present invention, a slave clock device includes:
收发模块 701 , 用于接收由主时钟设备发送的第一时间同步消息; 获取模块 702 , 用于根据收发模块 701接收的第一时间同步消息, 获取 空口物理层接收到上述第一时间同步消息的时刻 T2; The transceiver module 701 is configured to receive the first time synchronization message sent by the master clock device, and the acquiring module 702 is configured to obtain, according to the first time synchronization message received by the transceiver module 701, the air interface physical layer to receive the first time synchronization message. Time T 2 ;
在一种应用场景下, 获取模块 702具体可用于根据上述第一时间同步 消息的调度信息, 获取空口物理层接收到第一时间同步消息的时刻 Τ2; 或 者通过硬件记录空口物理层接收到第一时间同步消息的时刻 Τ2In an application scenario, the obtaining module 702 is specifically configured to obtain, according to the scheduling information of the first time synchronization message, a time Τ 2 when the physical interface of the air interface receives the first time synchronization message; or receive the first physical layer through the hardware recording interface. The time of the synchronization message at a time Τ 2 .
其中, 在实际应用中, 获取模块 702可包括:  In an actual application, the obtaining module 702 can include:
第一获取模块, 用于根据上述第一时间同步消息的调度信息, 获取空 口物理层接收上述第一时间同步消息的对应时隙;  a first acquiring module, configured to acquire, according to the scheduling information of the first time synchronization message, a corresponding time slot of the first physical synchronization message received by the physical layer of the air interface;
和,  with,
第一处理模块, 用于根据本地时钟和第一获取模块获取的时隙计算出 空口物理层接收到上述时隙中的第一个符号的起始时刻, 将其作为上述从 时钟设备在空口物理层接收到上述第一时间同步消息的时刻 Τ2, 或者, 根 据本地时钟和第一获取模块获取的时隙计算出空口物理层接收到上述时隙 中的第二个符号的起始时刻, 将其作为上述从时钟设备在空口物理层接收 到上述第一时间同步消息的时刻 τ2a first processing module, configured to calculate, according to the local clock and the time slot acquired by the first acquiring module, a start time of the first symbol in the time slot received by the physical layer of the air interface, and use the same as the slave clock device in the air interface physical The layer receives the time Τ 2 of the first time synchronization message, or calculates the starting time of the second symbol in the time slot received by the physical layer of the air interface according to the local clock and the time slot acquired by the first acquiring module, It is the time τ 2 at which the slave clock device receives the first time synchronization message at the air interface physical layer.
收发模块 701还用于接收由上述主时钟设备发送的第二时间同步消息; 获取模块 702还用于从收发模块 701接收的第二时间同步消息中获取 该第二时间同步消息携带的 1\的时间戳, 其中, 上述 1\为上述主时钟设备 通过 RF发出上述第一时间同步消息的时刻;  The transceiver module 701 is further configured to receive the second time synchronization message sent by the master clock device. The acquiring module 702 is further configured to obtain, by using the second time synchronization message received by the transceiver module 701, the 1\ a timestamp, where the above 1\ is a time when the master clock device sends the first time synchronization message by using the RF;
收发模块 701还用于在接收到第二时间同步消息之后, 向上述主时钟 设备发送第三时间同步消息; The transceiver module 701 is further configured to: after receiving the second time synchronization message, to the master clock The device sends a third time synchronization message;
获取模块 702还用于根据收发模块 701发送的第三时间同步消息, 获 取上述第三同步消息通过射频发出的时刻 T3; Obtaining module 702 is further configured in accordance with a third time synchronization messages sent by the transceiver module 701, the third acquisition time synchronization message through radio frequency emitted T 3;
在一种应用场景下, 获取模块 702具体用于根据上述第三时间同步消 息的调度信息, 获取第三时间同步消息通过 RF发出的时刻 Τ3; 或者通过 硬件记录第三时间同步消息通过 RF发出的时刻 Τ3In an application scenario, the obtaining module 702 is specifically configured to obtain, according to the scheduling information of the third time synchronization message, a time Τ 3 sent by the third time synchronization message by using the RF, or send a third time synchronization message through the hardware to send the RF through the RF. The moment Τ 3 .
在实际应用中, 获取模块 702可包括:  In an actual application, the obtaining module 702 can include:
第二获取模块, 用于根据上述第三时间同步消息的调度信息, 获取上 述第三时间同步消息通过射频发出的对应时隙;  a second acquiring module, configured to obtain, according to the scheduling information of the third time synchronization message, a corresponding time slot sent by the third time synchronization message by using a radio frequency;
和,  with,
第二处理模块, 用于根据本地时钟和第二处理模块获取的时隙计算出 发送上述时隙中的最后一个符号的结束时刻, 将其作为上述第三时间同步 消息通过射频发出的时刻 Τ3, 或, 根据本地时钟和第二处理模块获取的时 隙计算出发送上述时隙中的最后一个符号的起始时刻, 将其作为上述第三 时间同步消息通过射频发出的时刻 τ3, 或者, 根据本地时钟和第二处理模 块获取的时隙计算出发送上述时隙中的第一个符号的起始时刻, 将其作为 上述第三时间同步消息通过射频发出的时刻 τ3a second processing module, configured to calculate, according to the local clock and the time slot acquired by the second processing module, an end time of transmitting the last symbol in the time slot, as a time when the third time synchronization message is sent by using the radio frequency Τ 3 Or calculating, according to the local clock and the time slot acquired by the second processing module, the start time of transmitting the last symbol in the time slot, as the time τ 3 sent by the third time synchronization message through the radio frequency, or Calculating, according to the local clock and the time slot acquired by the second processing module, the starting time of transmitting the first symbol in the time slot as the time τ 3 sent by the third time synchronization message through the radio frequency.
进一步的, 在一种应用场景下, 收发模块 701还可以用于扩展 1588ν2 协议之后向上述主时钟设备发送新增消息如可以是跟随报文 Follow_up , 其 中,上述新增消息携带上述从时钟设备通过 RF发出上述第三时间同步消息 的时刻 T3Further, in an application scenario, the transceiver module 701 may be further configured to: after the extension of the 1588 ν2 protocol, send a new message to the master clock device, such as a follow message Follow_up, where the new message carries the slave clock device. The time T 3 at which the RF issues the third time synchronization message described above.
收发模块 701还用于接收由上述主时钟设备发送的第四时间同步消息; 获取模块 702还用于获取上述第四时间同步消息中携带的时刻 Τ4的时 间戳, 其中, 上述 Τ4为上述主时钟设备在空口物理层上接收到上述第三时 间同步消息的时刻; The transceiver module 701 is further configured to receive a fourth time synchronization message sent by the master clock device, where the acquiring module 702 is further configured to acquire a timestamp of the time Τ 4 carried in the fourth time synchronization message, where the Τ 4 is the foregoing The time at which the master clock device receives the third time synchronization message on the physical layer of the air interface;
处理模块 703 , 用于根据上述 Τ2, Τ3和 Τ4, 计算其与上述主时钟 设备的时钟偏移量; The processing module 703 is configured to calculate a clock offset from the master clock device according to the foregoing Τ 2 , Τ 3, and Τ 4 ;
具体的, 计算模块 703 可用于根据下述公式计算其与主从设备之间的 消息平均延迟 Delay,并相应的计算出其与主时钟设备的时钟偏移量 Offset: T2= T!+Delay+Offset; T4= T3+Delay-Offset。 Specifically, the calculation module 703 can be configured to calculate a message average delay Delay between the master and the slave device according to the following formula, and calculate a clock offset Offset from the master clock device correspondingly: T 2 = T! + Delay + Offset; T 4 = T 3 + Delay-Offset.
上述两条公式可以变成:  The above two formulas can become:
Delay = ( T2- 1\+1> T3 ) 12; Delay = ( T 2 - 1\+1> T 3 ) 12;
Offset= T2- TV Delay, 即 Offset= ( T2- T T4+ T3 ) /2。 Offset= T 2 - TV Delay, ie Offset= ( T 2 - TT 4 + T 3 ) /2.
修正模块 704 ,用于根据处理模块 703计算的结果对其本地时钟进行修 正。  The correction module 704 is configured to correct the local clock according to the result calculated by the processing module 703.
根据处理模块 703 计算的结果, 修正模块 704 可以根据时钟偏移量 Off se t对其本地时钟进行修正, 也可以在经过多次主从时钟设备间的时间 同步消息交互过程之后, 对处理模块 703 进行多次运算得到的多个时钟偏 移量 Off se t的值取平均值, 根据该平均值对其本地时钟进行修正, 从而达 到与主时钟设备的时间同步。  According to the calculation result of the processing module 703, the correction module 704 can correct the local clock according to the clock offset Offset, or after the time synchronization message interaction process between the master and slave clock devices, the processing module 703 The values of the plurality of clock offsets Off se t obtained by performing the multiple operations are averaged, and the local clock is corrected based on the average value to achieve time synchronization with the master clock device.
在一种应用场景下, 第一时间同步消息例如是时间同步报文 Sync或其 它消息; 第二时间同步消息例如是跟随 4艮文 Fo 1 1 ow_ up或其它消息; 第三 时间同步消息例如是延迟请求报文 De lay-Req或其它消息; 第四时间同步 消息例如是延迟响应报文 De lay-Re sp或其它消息。  In an application scenario, the first time synchronization message is, for example, a time synchronization message Sync or other message; the second time synchronization message is, for example, a follow-up message Fo 1 1 ow_ up or other message; the third time synchronization message is, for example, Deferred request message De lay-Req or other message; The fourth time synchronization message is, for example, a delayed response message De lay-Re sp or other message.
需要说明的是, 本实施例的从时钟设备可如上述方法实施例中的从时 钟设备, 可以用于实现上述方法实施例中的全部技术方案, 其各个功能模 块的功能可以根据上述方法实施例中的方法具体实现, 其具体实现过程可 参照上述实施例中的相关描述, 此处不再赘述。  It should be noted that the slave clock device in this embodiment may be used as the slave clock device in the foregoing method embodiment, and may be used to implement all the technical solutions in the foregoing method embodiments, and the functions of the function modules may be according to the foregoing method embodiments. For a specific implementation of the method, reference may be made to the related description in the foregoing embodiments, and details are not described herein again.
由上可见, 本实施例中, 从时钟设备通过获取模块 702 获取空口物理 层接收到第一时间同步消息的时刻 T2 , 获取第三同步消息通过射频发出的 时刻 L, 获取第二时间同步消息中携带的 1\的时间戳以及第四时间同步消 息中携带的 Τ4的时间戳; 并根据获取到的 Τ\ , Τ2 , Τ3和 Τ4更加准确的计算出 其与主时钟设备的时钟偏移量,相应提高了修正模块 704根据处理模块 703 的计算结果对本地时钟进行修正的精确度, 从而提高了主从时钟设备的时 间同步精度。 本发明实施例还提供了实现上述时间同步方法的时间同步系统, 下面 对本发明实施提供的一种时间同步系统进行描述。 It can be seen that, in this embodiment, the obtaining, by the acquiring device 702, the clock device obtains the time T 2 of the first time synchronization message received by the physical layer of the air interface, and acquires the time L sent by the third synchronization message by using the radio to obtain the second time synchronization message. The timestamp of 1\ carried in the time and the timestamp of Τ 4 carried in the fourth time synchronization message; and more accurately calculating the 与\, Τ 2 , Τ 3 and Τ 4 according to the obtained master clock device The clock offset improves the accuracy of the correction of the local clock by the correction module 704 according to the calculation result of the processing module 703, thereby improving the time synchronization accuracy of the master-slave clock device. The embodiment of the present invention further provides a time synchronization system for implementing the time synchronization method described above. A time synchronization system provided by the implementation of the present invention is described below.
请参阅图 8 , 本发明实施例提供的一种时间同步系统, 包括: 主时钟设备 801和从时钟设备 802。 Referring to FIG. 8, a time synchronization system according to an embodiment of the present invention includes: Master clock device 801 and slave clock device 802.
其中, 主时钟设备 801用于向从时钟设备 802发送第一时间同步消息, 并获取第一时间同步消息通过 RF发出的时刻 1\; 向从时钟设备 802发送第 二时间同步消息, 并在该第二时间同步消息中携带 1\的时间戳; 接收由从 时钟设备 802发送的第三时间同步消息, 并获取空口物理层接收到该第三 时间同步消息的时刻 T4; 向从时钟设备 802发送第四时间同步消息, 并在 该第四时间同步消息中携带 Τ 4的时间戳。 The master clock device 801 is configured to send the first time synchronization message to the slave clock device 802, and acquire the time 1\ sent by the first time synchronization message through the RF; send the second time synchronization message to the slave clock device 802, and The second time synchronization message carries a timestamp of 1\; receives the third time synchronization message sent by the slave clock device 802, and acquires the time T 4 at which the air interface physical layer receives the third time synchronization message; to the slave clock device 802 A fourth time synchronization message is sent, and a timestamp of Τ 4 is carried in the fourth time synchronization message.
从时钟设备 802用于接收由主时钟设备 801发送的第一时间同步消息, 并获取空口物理层接收到该第一时间同步消息的时刻 Τ2; 接收由主时钟设 备 801发送的第二时间同步消息,, 并获取上述第二时间同步消息中携带的 时刻 1\的时间戳, 其中, 上述 1\为主时钟设备 801通过 RF发出上述第一时 间同步消息的时刻; 向主时钟设备 801 发送第三时间同步消息, 并获取第 三时间同步消息通过 RF发出的时刻 Τ3; 接收由主时钟设备 801发送的第四 时间同步消息, 并获取上述第四时间同步消息中携带的时刻 Τ4的时间戳, 其中, 上述 Τ4为主时钟设备 801在空口物理层上接收到上述第三时间同步 消息的时刻; 根据上述 Τ\ , Τ2, Τ3和 Τ4计算其与主时钟设备 801的时钟偏移 量; 根据计算的时钟偏移量对其本地时钟进行修正。 The slave clock device 802 is configured to receive the first time synchronization message sent by the master clock device 801, and acquire the time Τ 2 when the air interface physical layer receives the first time synchronization message; receive the second time synchronization sent by the master clock device 801. a message, and acquiring a timestamp of the time 1\ carried in the second time synchronization message, where the above 1\ is the time when the primary clock device 801 sends the first time synchronization message by using the RF; and sends the first time to the master clock device 801. And synchronizing the message, and acquiring the time Τ 3 sent by the third time synchronization message through the RF; receiving the fourth time synchronization message sent by the master clock device 801, and acquiring the time Τ 4 carried in the fourth time synchronization message stamp, wherein the master clock device 801 Τ 4 received at the air interface physical layer the third time to the time synchronization message; \, Τ 2, Τ 3 calculated Τ 4 and the master clock device 801 based on the clock Τ Offset; Corrects its local clock based on the calculated clock offset.
本实施例中的主时钟设备 801的结构可如图 6所示的主时钟设备。 本实施例中的从时钟设备 802的结构可如图 7所示的从时钟设备。 需要说明的是, 本实施例的主时钟设备 801 可如上述方法实施例中的 主时钟设备, 从时钟设备 802 可如上述方法实施例中的从时钟设备, 其可 以用于实现上述方法实施例中的全部技术方案, 其各个功能模块的功能可 以根据上述方法实施例中的方法具体实现, 其具体实现过程可参照上述实 施例中的相关描述, 此处不再赘述。  The structure of the master clock device 801 in this embodiment may be a master clock device as shown in FIG. 6. The structure of the slave clock device 802 in this embodiment can be a slave clock device as shown in FIG. It should be noted that the master clock device 801 of the embodiment may be the master clock device in the foregoing method embodiment, and the slave clock device 802 may be the slave clock device in the foregoing method embodiment, which may be used to implement the foregoing method embodiment. For the technical solutions of the present invention, the functions of the various functional modules may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, refer to the related description in the foregoing embodiments, and details are not described herein again.
由上可见, 本实施例中, 时间同步系统获取时间同步消息通过 RF发出 的时间以及获取空口物理层接收到时间同步消息的时刻, 作为时间同步消 息的发送和接收时刻, 从而, 可剔除因物理层调制解调等处理的时延和抖 动而对获取时间同步消息的发送和接收时刻的精确度的影响, 提高获取时 间同步消息的发送和接收时刻的精确度, 利用该获取的更高精确度的时间 同步消息的发送和接收时刻信息进行主从时钟设备的时间同步, 能够相应 提高主从时钟设备的时间同步精度。 It can be seen that, in this embodiment, the time synchronization system acquires the time when the time synchronization message is sent by the RF and the time when the physical layer of the air interface receives the time synchronization message, as the time of sending and receiving the time synchronization message, thereby eliminating the physical physics. The effect of delay and jitter of processing such as layer modulation and demodulation on obtaining the accuracy of the transmission and reception time of the time synchronization message, improving the accuracy of acquiring the transmission and reception time of the time synchronization message, and using the higher precision of the acquisition time The transmission and reception time information of the synchronization message is time-synchronized by the master-slave clock device, and the time synchronization accuracy of the master-slave clock device can be improved accordingly.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步 骤是可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计 算机可读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光 盘等。  A person skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium, the above mentioned storage. The medium can be a read only memory, a magnetic disk or a compact disk or the like.
以上对本发明所提供的一种时间同步方法和相关设备及系统进行了详 细介绍, 对于本领域的一般技术人员, 依据本发明实施例的思想, 在具体 实施方式及应用范围上均会有改变之处, 综上所述, 本说明书内容不应理 解为对本发明的限制。  A time synchronization method and related equipment and system provided by the present invention are described in detail above. For those skilled in the art, according to the idea of the embodiment of the present invention, the specific implementation manner and the application range may be changed. In the above, the contents of this specification are not to be construed as limiting the invention.

Claims

权利要求 Rights request
1、 一种时间同步方法, 其特征在于, 包括: A time synchronization method, comprising:
主时钟设备向从时钟设备发送第一时间同步消息, 并获取所述第一时 间同步消息通过射频发出的时刻  The master clock device sends a first time synchronization message to the slave clock device, and acquires a time when the first time synchronization message is sent through the radio frequency.
主时钟设备向所述从时钟设备发送第二时间同步消息, 并在所述第二 时间同步消息中携带所述 1\的时间戳;  The master clock device sends a second time synchronization message to the slave clock device, and carries the time stamp of the 1\ in the second time synchronization message;
主时钟设备接收由所述从时钟设备发送的第三时间同步消息, 并获取 空口物理层接收到所述第三时间同步消息的时刻 τ4; The master clock device receives the third time synchronization message sent by the slave clock device, and acquires the time τ 4 when the air interface physical layer receives the third time synchronization message;
主时钟设备向所述从时钟设备发送第四时间同步消息, 并在所述第四 时间同步消息中携带所述 Τ4的时间戳, 以便于所述从时钟设备根据所述 1\ 和 τ4计算所述从时钟设备与所述主时钟设备的时钟偏移量, 并根据计算的 所述时钟偏移量, 对所述从时钟设备的本地时钟进行修正。 Master clock device to the transmitting device from a fourth clock time synchronization message, and time stamp carries the Τ 4 in the fourth time synchronization message to the slave clock device according to claim 1 \ [tau] 4 and Calculating a clock offset of the slave clock device and the master clock device, and correcting a local clock of the slave clock device according to the calculated clock offset.
2、 根据权利要求 1所述的方法, 其特征在于,  2. The method of claim 1 wherein
所述获取所述第一时间同步消息通过射频发出的时刻 具体为: 根据所述第一时间同步消息的调度信息, 获取所述第一时间同步消息 通过射频发出的时刻  The obtaining the time when the first time synchronization message is sent by using the radio frequency is specifically: acquiring, according to the scheduling information of the first time synchronization message, the time that the first time synchronization message is sent by using the radio frequency
或者, 通过硬件记录所述第一时间同步消息通过射频发出的时刻 1\。 Alternatively, the time 1\ of the first time synchronization message sent by the radio frequency is recorded by hardware.
3、 根据权利要求 2所述的方法, 其特征在于, 3. The method of claim 2, wherein
所述根据所述第一时间同步消息的调度信息, 获取所述第一时间同步 消息通过射频发出的时刻 具体为:  And obtaining, according to the scheduling information of the first time synchronization message, a time when the first time synchronization message is sent by using a radio frequency, specifically:
根据所述第一时间同步消息的调度信息, 获取所述第一时间同步消息 通过射频发出的对应时隙;  Acquiring, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message by using a radio frequency;
根据本地时钟和所述时隙计算出发送所述时隙中的最后一个符号的结 束时刻, 将其作为所述第一时间同步消息通过射频发出的时刻 或, 根 据本地时钟和所述时隙计算出发送所述时隙中的最后一个符号的起始时 刻, 将其作为所述第一时间同步消息通过射频发出的时刻 或者, 根据 本地时钟和所述时隙计算出发送所述时隙中的第一个符号的起始时刻, 将 其作为所述第一时间同步消息通过射频发出的时刻 1\。 Calculating, according to the local clock and the time slot, an end time of transmitting the last symbol in the time slot, as a time when the first time synchronization message is sent by using a radio frequency, or calculating according to a local clock and the time slot. And sending a start time of the last symbol in the time slot as a time when the first time synchronization message is sent by using a radio frequency or calculating, according to the local clock and the time slot, sending the time slot The start time of the first symbol is used as the time 1\ of the first time synchronization message sent by the radio frequency.
4、 根据权利要求 1所述的方法, 其特征在于, 所述获取空口物理层接 收到所述第三时间同步消息的时刻 T4, 具体为: The method according to claim 1, wherein the acquiring the time T 4 when the air interface physical layer receives the third time synchronization message is specifically:
根据所述第三时间同步消息的调度信息, 获取在空口物理层接收到所 述第三时间同步消息的时刻 Τ4Obtaining, according to the scheduling information of the third time synchronization message, a time Τ 4 when the air interface physical layer receives the third time synchronization message;
或者, 通过硬件记录空口物理层接收到所述第三时间同步消息的时刻 τ4Alternatively, the time τ 4 of the third time synchronization message is received by the hardware recording air interface physical layer.
5、 根据权利要求 4所述的方法, 其特征在于,  5. The method of claim 4, wherein
所述根据所述第三时间同步消息的调度信息, 获取在空口物理层接收 到所述第三时间同步消息的时刻 Τ4, 具体为: Obtaining, according to the scheduling information of the third time synchronization message, a time Τ 4 when the third time synchronization message is received by the air interface physical layer, specifically:
根据所述第三时间同步消息的调度信息, 获取空口物理层接收所述第 三时间同步消息的对应时隙;  Obtaining, according to the scheduling information of the third time synchronization message, a corresponding time slot in which the air interface physical layer receives the third time synchronization message;
根据本地时钟和所述时隙计算出空口物理层接收到所述时隙中的第一 个符号的起始时刻, 将其作为所述主时钟设备在空口物理层接收到所述第 三时间同步消息的时刻 Τ4, 或者, 根据本地时钟和所述时隙计算出空口物 理层接收到所述时隙中的第二个符号的起始时刻, 将其作为所述主时钟设 备在空口物理层接收到所述第三时间同步消息的时刻 Τ4Calculating, according to the local clock and the time slot, a start time at which the air interface physical layer receives the first symbol in the time slot, and receiving, as the master clock device, the third time synchronization at the air interface physical layer. The time of the message Τ 4 , or calculating, according to the local clock and the time slot, the starting time of the second symbol in the time slot received by the physical layer of the air interface, which is used as the primary clock device in the physical layer of the air interface The time Τ 4 of receiving the third time synchronization message.
6、 根据权利要求 1至 5中任一项所述的方法, 其特征在于, 所述第一时间同步消息是时间同步 ·^艮文 Sync;  The method according to any one of claims 1 to 5, wherein the first time synchronization message is time synchronization.
所述第二时间同步消息是跟随报文 Follow_up;  The second time synchronization message is a follow message Follow_up;
所述第三时间同步消息是延迟请求报文 Delay_Req;  The third time synchronization message is a delay request message Delay_Req;
所述第四时间同步消息是延迟响应报文 Delay_Resp。  The fourth time synchronization message is a delayed response message Delay_Resp.
7、 一种时间同步方法, 其特征在于, 包括:  7. A time synchronization method, comprising:
从时钟设备接收由主时钟设备发送的第一时间同步消息, 并获取空口 物理层接收到所述第一时间同步消息的时刻 T2; Receiving, by the clock device, the first time synchronization message sent by the master clock device, and acquiring the time T 2 when the air interface physical layer receives the first time synchronization message;
从时钟设备接收由所述主时钟设备发送的第二时间同步消息, 并获取 所述第二时间同步消息中携带 1 的时间戳, 其中, 所述 1\为所述主时钟设 备通过射频发出所述第一时间同步消息的时刻;  Receiving, by the clock device, a second time synchronization message sent by the master clock device, and acquiring a timestamp carrying 1 in the second time synchronization message, where the 1\ is the primary clock device transmitting through the radio frequency The time of the first time synchronization message;
从时钟设备向所述主时钟设备发送第三时间同步消息, 并获取所述第 三时间同步消息通过射频发出的时刻 Τ3; 从时钟设备接收由所述主时钟设备发送的第四时间同步消息, 并获取 所述第四时间同步消息中携带的 τ4的时间戳, 其中, 所述 τ4为所述主时钟 设备在空口物理层上接收到所述第三时间同步消息的时刻; Transmitting, by the clock device, the third time synchronization message to the master clock device, and acquiring a time Τ 3 that the third time synchronization message is sent by using the radio frequency; Receiving, by the clock device, a fourth time synchronization message sent by the master clock device, and acquiring a timestamp of τ 4 carried in the fourth time synchronization message, where the τ 4 is the air interface of the master clock device a time at which the third time synchronization message is received on the physical layer;
从时钟设备根据所述 1\、 τ2、 τ3和 τ4计算所述从时钟设备与所述主时 钟设备的时钟偏移量; Calculating, by the clock device, a clock offset of the slave clock device and the master clock device according to the 1\, τ 2 , τ 3, and τ 4 ;
从时钟设备根据计算的所述时钟偏移量, 对所述从时钟设备的本地时 钟进行修正。  The slave clock device corrects the local clock of the slave clock device based on the calculated clock offset.
8、 根据权利要求 7所述的方法, 其特征在于, 所述获取空口物理层接 收到所述第一时间同步消息的时刻 Τ2, 具体为: The method according to claim 7, wherein the acquiring the time Τ 2 of the first time synchronization message by the physical layer of the air interface is specifically:
根据所述第一时间同步消息的调度信息, 获取空口物理层接收到所述 第一时间同步消息的时刻 Τ2; Obtaining, according to the scheduling information of the first time synchronization message, a time Τ 2 at which the air interface physical layer receives the first time synchronization message;
或者, 通过硬件记录空口物理层接收到所述第一时间同步消息的时刻 τ2Alternatively, the time τ 2 of the first time synchronization message is received by the hardware recording air interface physical layer.
9、 根据权利要求 8所述的方法, 其特征在于,  9. The method of claim 8 wherein:
所述根据所述第一时间同步消息的调度信息, 获取在空口物理层接收 到所述第一时间同步消息的时刻 Τ2, 具体为: And obtaining, according to the scheduling information of the first time synchronization message, a time Τ 2 that is received by the air interface physical layer, where the first time synchronization message is, specifically:
根据所述第一时间同步消息的调度信息, 获取空口物理层接收所述第 一时间同步消息的对应时隙, 根据本地时钟和所述时隙计算出空口物理层 接收到所述时隙中的第一个符号的起始时刻, 将其作为所述从时钟设备在 空口物理层接收到所述第一时间同步消息的时刻 Τ2, 或者, 根据本地时钟 和所述时隙计算出空口物理层接收到所述时隙中的第二个符号的起始时 刻, 将其作为所述从时钟设备在空口物理层接收到所述第一时间同步消息 的时刻 Τ2Obtaining, according to the scheduling information of the first time synchronization message, a corresponding time slot of the first physical synchronization message received by the air interface physical layer, and calculating, according to the local clock and the time slot, that the air interface physical layer receives the time slot The start time of the first symbol is used as the time Τ 2 of the slave clock device receiving the first time synchronization message at the air interface physical layer, or the air interface physical layer is calculated according to the local clock and the time slot. Receiving a start time of the second symbol in the time slot as a time Τ 2 when the slave clock device receives the first time synchronization message at the air interface physical layer.
10、 根据权利要求 7所述的方法, 其特征在于, 所述获取所述第三时 间同步消息通过射频发出的时刻 Τ3, 具体为: The method according to claim 7, wherein the acquiring the time Τ 3 sent by the third time synchronization message by using a radio frequency is specifically:
根据所述第三时间同步消息的调度信息, 获取所述第三时间同步消息 通过射频发出的时刻 Τ3; Obtaining, according to the scheduling information of the third time synchronization message, a time Τ 3 sent by the third time synchronization message by using a radio frequency;
或者, 通过硬件记录所述第三时间同步消息通过射频发出的时刻 Τ3Alternatively, the time Τ 3 sent by the radio frequency of the third time synchronization message is recorded by hardware.
11、 根据权利要求 10所述的方法, 其特征在于, 所述根据所述第三时间同步消息的调度信息, 获取所述第三时间同步 消息通过射频发出的时刻 T3, 具体为: 11. The method of claim 10, wherein Obtaining, according to the scheduling information of the third time synchronization message, the time T 3 sent by the third time synchronization message by using a radio frequency, specifically:
根据所述第三时间同步消息的调度信息, 获取所述第三时间同步消息 通过射频发出的对应时隙, 根据本地时钟和所述时隙计算出发送所述时隙 中的最后一个符号的结束时刻, 将其作为所述第三时间同步消息通过射频 发出的时刻 τ3, 或, 根据本地时钟和所述时隙计算出发送所述时隙中的最 后一个符号的起始时刻, 将其作为所述第三时间同步消息通过射频发出的 时刻 τ3, 或者, 根据本地时钟和所述时隙计算出发送所述时隙中的第一个 符号的起始时刻,将其作为所述第三时间同步消息通过射频发出的时刻 τ3Obtaining, according to the scheduling information of the third time synchronization message, a corresponding time slot sent by the third time synchronization message by using a radio frequency, and calculating, according to the local clock and the time slot, sending an end of the last symbol in the time slot. At the moment, as the time τ 3 of the third time synchronization message sent by the radio frequency, or calculating the starting time of transmitting the last symbol in the time slot according to the local clock and the time slot, The third time synchronization message passes the time τ 3 sent by the radio frequency, or calculates the starting time of transmitting the first symbol in the time slot according to the local clock and the time slot, and uses the third time as the third time synchronization message. The time synchronization message is sent through the radio frequency τ 3 .
12、 一种主时钟设备, 其特征在于, 包括:  12. A master clock device, comprising:
收发模块, 用于向从时钟设备发送第一时间同步消息;  a transceiver module, configured to send a first time synchronization message to the slave clock device;
获取模块, 用于获取所述收发模块通过射频发出所述第一时间同步消 息的时刻  An acquiring module, configured to acquire, when the transceiver module sends the first time synchronization message by using a radio frequency
所述收发模块还用于向所述从时钟设备发送第二时间同步消息, 并在 所述第二时间同步消息中携带所述 1\的时间戳;  The transceiver module is further configured to send a second time synchronization message to the slave clock device, and carry the time stamp of the 1\ in the second time synchronization message;
所述收发模块还用于接收由所述从时钟设备发送的第三时间同步消 息;  The transceiver module is further configured to receive a third time synchronization message sent by the slave clock device;
所述获取模块还用于根据所述收发模块接收的所述第三时间同步消 息, 获取空口物理层接收所述第三时间同步消息的时刻 τ4; The acquiring module is further configured to obtain, according to the third time synchronization message received by the transceiver module, a time τ 4 at which the air interface physical layer receives the third time synchronization message;
所述收发模块还用于向所述从时钟设备发送第四时间同步消息, 并在 所述第四时间同步消息中携带所述 τ4的时间戳; 以便于所述从时钟设备根 据所述 1\和 τ4计算所述从时钟设备与所述主时钟设备的时钟偏移量,并根 据计算的所述时钟偏移量, 对所述从时钟设备的本地时钟进行修正。 The transceiver module is further configured to send a fourth time synchronization message to the slave clock device, and carry a timestamp of the τ 4 in the fourth time synchronization message, so that the slave clock device is configured according to the \ and τ 4 calculate a clock offset of the slave clock device and the master clock device, and correct the local clock of the slave clock device according to the calculated clock offset.
13、 根据权利要求 12所述的主时钟设备, 其特征在于,  13. The master clock device according to claim 12, wherein:
所述获取模块具体用于根据所述第一时间同步消息的调度信息, 获取 所述第一时间同步消息通过射频发出的时刻 或者通过硬件记录所述第 一时间同步消息通过射频发出的时刻 1\。  The obtaining module is specifically configured to: acquire, according to the scheduling information of the first time synchronization message, a time when the first time synchronization message is sent by using a radio frequency or a time when the first time synchronization message is sent by using a hardware to send the radio through the radio frequency? .
14、 根据权利要求 13所述的主时钟设备, 其特征在于, 所述获取模块 包括: 获取模块一, 用于根据所述第一时间同步消息的调度信息, 获取所述 第一时间同步消息通过射频发出的对应时隙; The master clock device according to claim 13, wherein the acquiring module comprises: The obtaining module 1 is configured to obtain, according to the scheduling information of the first time synchronization message, a corresponding time slot sent by the first time synchronization message by using a radio frequency;
处理模块一, 用于根据本地时钟和所述获取模块一获取的时隙计算出 发送所述时隙中的最后一个符号的结束时刻, 将其作为所述第一时间同步 消息通过射频发出的时刻 1\, 或, 根据本地时钟和所述获取模块一获取的 时隙计算出发送所述时隙中的最后一个符号的起始时刻, 将其作为所述第 一时间同步消息通过射频发出的时刻 或者, 根据本地时钟和所述获取 模块一获取的时隙计算出发送所述时隙中的第一个符号的起始时刻, 将其 作为所述第一时间同步消息通过射频发出的时刻 1\。  The processing module 1 is configured to calculate, according to the local clock and the time slot acquired by the acquiring module, an end time of sending the last symbol in the time slot, and use the time as the time when the first time synchronization message is sent by using the radio frequency. 1 or, according to the local clock and the time slot acquired by the acquiring module, calculate a starting time of sending the last symbol in the time slot, and use it as the time when the first time synchronization message is sent through the radio frequency. Or calculating, according to the local clock and the time slot acquired by the acquiring module, the starting time of sending the first symbol in the time slot, and using it as the time 1 of the first time synchronization message sent by the radio frequency. .
15、 根据权利要求 12所述的主时钟设备, 其特征在于,  15. The master clock device of claim 12, wherein
所述获取模块具体用于根据所述第三时间同步消息的调度信息, 获取 在空口物理层接收到所述第三时间同步消息的时刻 T4; 或者通过硬件记录 空口物理层接收到所述第三时间同步消息的时刻 Τ4The acquiring module is specifically configured to: acquire, according to the scheduling information of the third time synchronization message, a time T 4 when the third time synchronization message is received by the air interface physical layer; or receive the foregoing by using a hardware recording air interface physical layer The time of the three-time synchronization message Τ 4 .
16、 根据权利要求 15所述的主时钟设备, 其特征在于, 所述获取模块 包括;  The master clock device according to claim 15, wherein the acquiring module comprises:
获取模块二, 用于根据所述第三时间同步消息的调度信息, 获取空口 物理层接收所述第三时间同步消息的对应时隙;  The obtaining module 2 is configured to obtain, according to the scheduling information of the third time synchronization message, a corresponding time slot of the air interface physical layer to receive the third time synchronization message;
处理模块二, 用于根据本地时钟和所述获取模块二获取的时隙计算出 空口物理层接收到所述时隙中的第一个符号的起始时刻, 将其作为所述主 时钟设备在空口物理层接收到所述第三时间同步消息的时刻 Τ4, 或者, 根 据本地时钟和所述获取模块二获取的计算出空口物理层接收到所述时隙中 的第二个符号的起始时刻, 将其作为所述主时钟设备在空口物理层接收到 所述第三时间同步消息的时刻 Τ4The processing module 2 is configured to calculate, according to the local clock and the time slot acquired by the acquiring module 2, a start time of the first symbol in the time slot received by the air interface physical layer, and use the same as the primary clock device. The time at which the air interface physical layer receives the third time synchronization message Τ 4 , or calculates the start of the second symbol in the time slot received by the physical layer of the air interface according to the local clock and the acquisition module 2 At the moment, it is used as the time Τ 4 when the master clock device receives the third time synchronization message at the air interface physical layer.
17、 一种从时钟设备, 其特征在于, 包括:  17. A slave clock device, comprising:
收发模块, 用于接收由主时钟设备发送的第一时间同步消息; 获取模块, 用于根据所述收发模块接收的第一时间同步消息, 获取空 口物理层接收到所述第一时间同步消息的时刻 Τ2; a transceiver module, configured to receive a first time synchronization message sent by the master clock device, and an acquiring module, configured to acquire, according to the first time synchronization message received by the transceiver module, the air interface physical layer to receive the first time synchronization message Time Τ 2 ;
所述收发模块还用于接收由所述主时钟设备发送的第二时间同步消 息, 所述第二时间同步消息携带 1\的时间戳; 所述获取模块还用于从所述收发模块接收的所述第二时间同步消息中 获取所述第二时间同步消息中携带 1\的时间戳, 其中, 所述 1\为所述主时 钟设备通过射频发出所述第一时间同步消息的时刻; The transceiver module is further configured to receive a second time synchronization message sent by the primary clock device, where the second time synchronization message carries a timestamp of 1\; The acquiring module is further configured to obtain, from the second time synchronization message received by the transceiver module, a timestamp of the first time synchronization message carrying 1\, where the 1\ is the primary clock device The time at which the first time synchronization message is sent by the radio frequency;
所述收发模块还用于向所述主时钟设备发送第三时间同步消息; 所述获取模块还用于根据所述收发模块发送的第三时间同步消息, 获 取所述第三同步消息通过射频发出的时刻 τ3; The transceiver module is further configured to send a third time synchronization message to the master clock device, where the acquiring module is further configured to: according to the third time synchronization message sent by the transceiver module, obtain the third synchronization message by using a radio frequency Time τ 3 ;
所述收发模块还用于接收由所述主时钟设备发送的第四时间同步消 息;  The transceiver module is further configured to receive a fourth time synchronization message sent by the master clock device;
所述获取模块还用于获取所述第四时间同步消息中携带的 τ4的时间 戳, 其中, 所述 τ4为所述主时钟设备在空口物理层上接收到所述第三时间 同步消息的时刻; The acquiring module is further configured to acquire a timestamp of τ 4 carried in the fourth time synchronization message, where the τ 4 is that the primary clock device receives the third time synchronization message on an air interface physical layer. Moment
处理模块, 用于根据所述获取模块获取的 1\、 τ2、 τ3和 τ4计算所述从 时钟设备与所述主时钟设备的时钟偏移量; a processing module, configured to calculate a clock offset between the slave clock device and the master clock device according to 1\, τ 2 , τ 3 , and τ 4 acquired by the acquiring module;
修正模块, 用于根据所述处理模块计算的所述时钟偏移量, 对所述从 时钟设备的本地时钟进行修正。  And a correction module, configured to modify a local clock of the slave clock device according to the clock offset calculated by the processing module.
18、 根据权利要求 17所述的从时钟设备, 其特征在于,  18. The slave clock device of claim 17, wherein
所述获取模块具体用于根据所述第一时间同步消息的调度信息, 获取 空口物理层接收到所述第一时间同步消息的时刻 Τ2; 或者, 通过硬件记录 空口物理层接收到所述第一时间同步消息的时刻 Τ2The acquiring module is specifically configured to: acquire, according to the scheduling information of the first time synchronization message, a time Τ 2 when the air interface physical layer receives the first time synchronization message; or receive the foregoing by using a hardware recording air interface physical layer The time of the synchronization message at a time Τ 2 .
19、 根据权利要求 18所述的从时钟设备, 其特征在于, 所述获取模块 包括:  The slave clock device according to claim 18, wherein the acquiring module comprises:
第一获取模块, 用于根据所述第一时间同步消息的调度信息, 获取空 口物理层接收所述第一时间同步消息的对应时隙;  a first acquiring module, configured to acquire, according to the scheduling information of the first time synchronization message, a corresponding time slot in which the air physical layer receives the first time synchronization message;
第一处理模块, 用于根据本地时钟和所述第一获取模块获取的时隙计 算出空口物理层接收到所述时隙中的第一个符号的起始时刻, 将其作为所 述从时钟设备在空口物理层接收到所述第一时间同步消息的时刻 Τ2,或者, 根据本地时钟和所述第一获取模块获取的时隙计算出空口物理层接收到所 述时隙中的第二个符号的起始时刻, 将其作为所述从时钟设备在空口物理 层接收到所述第一时间同步消息的时刻 Τ2a first processing module, configured to calculate, according to the local clock and the time slot acquired by the first acquiring module, a start time of the first symbol in the time slot received by the air interface physical layer, and use the same as the slave clock The device receives the first time synchronization message at the air interface physical layer, Τ 2 , or calculates, according to the local clock and the time slot acquired by the first acquiring module, that the air interface physical layer receives the second of the time slots. The start time of the symbols as the time Τ 2 at which the slave clock device receives the first time synchronization message at the air interface physical layer.
20、 根据权利要求 17所述的从时钟设备, 其特征在于, 20. The slave clock device of claim 17, wherein
所述获取模块具体用于根据所述第三时间同步消息的调度信息, 获取 所述第三时间同步消息通过射频发出的时刻 T3; 或者, 通过硬件记录所述 第三时间同步消息通过射频发出的时刻 Τ3The scheduling information obtaining module for time synchronization based on the third message, the third time acquisition time synchronization message sent by a radio frequency T 3; or emitted by the radio frequency hardware of the third recording time synchronization message The moment Τ 3 .
21、 根据权利要求 20所述的从时钟设备, 其特征在于, 所述的获取模 块包括:  The slave clock device according to claim 20, wherein the acquiring module comprises:
第二获取模块, 用于根据所述第三时间同步消息的调度信息, 获取所 述第三时间同步消息通过射频发出的对应时隙;  a second acquiring module, configured to acquire, according to the scheduling information of the third time synchronization message, a corresponding time slot sent by the third time synchronization message by using a radio frequency;
第二处理模块, 用于根据本地时钟和所述第二获取模块获取的时隙计 算出发送所述时隙中的最后一个符号的结束时刻, 将其作为所述第三时间 同步消息通过射频发出的时刻 Τ3, 或, 根据本地时钟和所述第二获取模块 获取的时隙计算出发送所述时隙中的最后一个符号的起始时刻, 将其作为 所述第三时间同步消息通过射频发出的时刻 Τ3, 或者, 根据本地时钟和所 述第二获取模块获取的时隙计算出发送所述时隙中的第一个符号的起始时 刻, 将其作为所述第三时间同步消息通过射频发出的时刻 Τ3a second processing module, configured to calculate, according to the local clock and the time slot acquired by the second acquiring module, an end time of sending the last symbol in the time slot, and send the third time synchronization message as a third time synchronization message by using a radio frequency Time Τ 3 , or calculating a start time of transmitting the last symbol in the time slot according to the local clock and the time slot acquired by the second acquiring module, and transmitting the same as the third time synchronization message Sending a time Τ 3 , or calculating a starting time of transmitting the first symbol in the time slot according to the local clock and the time slot acquired by the second acquiring module, as the third time synchronization message The time elapsed by the radio frequency Τ 3 .
22、 一种时间同步系统, 其特征在于, 包括:  22. A time synchronization system, comprising:
主时钟设备, 用于向从时钟设备发送第一时间同步消息, 并获取所述 第一时间同步消息通过射频发出的时刻 向所述从时钟设备发送第二时 间同步消息, 并在所述第二时间同步消息中携所述 1\的时间戳; 接收由所 述从时钟设备发送的第三时间同步消息, 并获取空口物理层接收到所述第 三时间同步消息的时刻 Τ4; 向所述从时钟设备发送第四时间同步消息, 并 在所述第四时间同步消息中携带所述 Τ4的时间戳; a master clock device, configured to send a first time synchronization message to the slave clock device, and obtain a second time synchronization message sent to the slave clock device by the time when the first time synchronization message is sent by using the radio frequency, and in the second The time synchronization message carries the timestamp of the 1\; receives the third time synchronization message sent by the slave clock device, and acquires the time Τ 4 when the air interface physical layer receives the third time synchronization message; transmitting a fourth message from the clock device time synchronization, and carries the stamp Τ 4 in the fourth time synchronization message;
从时钟设备, 用于接收所述主时钟设备发送的第一时间同步消息, 并 获取空口物理层接收到所述第一时间同步消息的时刻 Τ2; 接收由所述主时 钟设备发送的第二时间同步消息, 并获取所述第二时间同步消息中携带的 时刻 1\的时间戳,所述 1\为所述主时钟设备通过射频发出所述第一时间同 步消息的时刻; 向所述主时钟设备发送第三时间同步消息, 并获取所述第 三时间同步消息通过射频发出的时刻 Τ3; 接收由所述主时钟设备发送的第 四时间同步消息 ,并获取所述第四时间同步消息中携带的时刻 Τ4的时间戳 , 所述 T4为所述主时钟设备在空口物理层上接收到所述第三时间同步消息的 时刻; 根据所述 1\、 τ2、 τ3和 τ4计算所述从时钟设备与主时钟设备的时钟 偏移量; 根据计算的时钟偏移量, 对所述从时钟设备的本地时钟进行修正。 a slave clock device, configured to receive a first time synchronization message sent by the master clock device, and acquire a time Τ 2 when the air interface physical layer receives the first time synchronization message; receive a second message sent by the master clock device Time synchronization message, and acquiring a timestamp of time 1\ carried in the second time synchronization message, where 1\ is a time when the primary clock device sends the first time synchronization message by using a radio frequency; The clock device sends a third time synchronization message, and acquires a time Τ 3 sent by the third time synchronization message through the radio frequency; receives a fourth time synchronization message sent by the primary clock device, and acquires the fourth time synchronization message. The timestamp of the time Τ 4 carried in, T 4 at which the device receives the master clock on the air interface physical layer time synchronization message to the third time; according to the 1 \, τ 2, τ 3 and τ 4 of the computing device and the master clock from the clock The clock offset of the device; correcting the local clock of the slave clock device according to the calculated clock offset.
PCT/CN2011/081373 2010-10-27 2011-10-27 Method for time synchronization and device and system thereof WO2012055360A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010527699.9A CN102457371B (en) 2010-10-27 2010-10-27 Time synchronization method and related equipment and system
CN201010527699.9 2010-10-27

Publications (1)

Publication Number Publication Date
WO2012055360A1 true WO2012055360A1 (en) 2012-05-03

Family

ID=45993173

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/081373 WO2012055360A1 (en) 2010-10-27 2011-10-27 Method for time synchronization and device and system thereof

Country Status (2)

Country Link
CN (1) CN102457371B (en)
WO (1) WO2012055360A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945523A (en) * 2014-04-21 2014-07-23 中国联合网络通信集团有限公司 Method and system for achieving time synchronization

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103118029A (en) * 2013-02-18 2013-05-22 中兴通讯股份有限公司 Synchronized method and device of encrypted messages between each other
CN104581923B (en) * 2013-10-25 2018-08-28 上海无线通信研究中心 Pass through the method for transmission of radio links precise time information
CN108781162A (en) * 2015-12-31 2018-11-09 华为技术有限公司 A kind of network node, message transmitting method and network
CN106488550B (en) * 2016-12-20 2019-11-12 华为技术有限公司 Determine the method and apparatus of terminal Yu base station clock time deviation
CN106895953B (en) * 2017-01-25 2019-04-12 浙江大学 The method for synchronizing time of a variety of measuring instruments in dam break experiment
CN110324889B (en) * 2018-03-30 2021-02-09 华为技术有限公司 Clock synchronization method, communication device and communication equipment
CN109068384A (en) * 2018-08-23 2018-12-21 平安科技(深圳)有限公司 A kind of method for synchronizing time and system
CN110944379B (en) * 2018-09-25 2022-03-01 维沃移动通信有限公司 Method and apparatus for time alignment
CN111432465B (en) * 2019-01-09 2021-06-22 华为技术有限公司 Synchronization method and device
CN111147177B (en) * 2019-12-16 2022-04-05 国家电网有限公司大数据中心 Mobile network time service method and system for smart power grid
CN113132041B (en) * 2019-12-31 2022-03-04 中移(成都)信息通信科技有限公司 Data transmission delay calculation method and device
CN113260038A (en) * 2020-02-07 2021-08-13 维沃移动通信有限公司 Acquisition method of reference time information, information transceiving method and related equipment
CN113765839B (en) * 2020-06-03 2022-07-29 华为技术有限公司 Air interface time synchronization method and equipment
CN112838903B (en) * 2020-12-31 2022-08-26 广东大普通信技术股份有限公司 Clock synchronization method, equipment and storage medium
CN113381832B (en) * 2021-06-09 2022-11-15 北京紫玉伟业电子科技有限公司 Precise time synchronization method based on FPGA platform
CN117155499A (en) * 2022-05-24 2023-12-01 华为技术有限公司 Clock synchronization method, serial number generation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080075217A1 (en) * 2006-09-22 2008-03-27 Ilnicki Slawomir K Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols
CN101242230A (en) * 2007-02-05 2008-08-13 汤姆森许可贸易公司 Clock synchronization aid device and associated clock synchronization device
CN101800613A (en) * 2010-02-09 2010-08-11 瑞斯康达科技发展股份有限公司 Jitter eliminating method and device for packet switched network
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080075217A1 (en) * 2006-09-22 2008-03-27 Ilnicki Slawomir K Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols
CN101242230A (en) * 2007-02-05 2008-08-13 汤姆森许可贸易公司 Clock synchronization aid device and associated clock synchronization device
CN101800613A (en) * 2010-02-09 2010-08-11 瑞斯康达科技发展股份有限公司 Jitter eliminating method and device for packet switched network
CN101834712A (en) * 2010-04-19 2010-09-15 浙江大学 Method for realizing accurate time synchronization by utilizing IEEE1588 protocol

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103945523A (en) * 2014-04-21 2014-07-23 中国联合网络通信集团有限公司 Method and system for achieving time synchronization

Also Published As

Publication number Publication date
CN102457371B (en) 2014-07-30
CN102457371A (en) 2012-05-16

Similar Documents

Publication Publication Date Title
WO2012055360A1 (en) Method for time synchronization and device and system thereof
EP3550899B1 (en) Method and apparatus for determining clock time deviation between terminal and base station
US11470568B2 (en) Synchronizing TSN master clocks in wireless networks
CN110324889B (en) Clock synchronization method, communication device and communication equipment
US10237836B2 (en) Frequency and phase synchronization using full duplex radios over wireless mesh networks
US10129839B2 (en) Techniques for synchronizing timing of wireless streaming transmissions to multiple sink devices
US20190059066A1 (en) Time Synchronization Between Nodes Connected by a Wireless Network
CN112314017A (en) Time synchronized radio bearers for supporting Precision Timing Protocol (PTP) -based Time Sensitive Network (TSN) applications
CN111869138A (en) Method and first device for clock synchronization
JP2019518351A (en) Application of timing advance command in wireless communication device in extended coverage mode
US10129844B2 (en) Timing synchronization for small cells with limited backhaul
EP3180876B1 (en) Method and apparatus for synchronising a plurality of distributed devices with a network
WO2011076051A1 (en) Time synchronization method, device and system
CN110401505A (en) A kind of wireless network accurate time synchronization method
WO2020001367A1 (en) Time information correction method and device
US20210400610A1 (en) Time synchronization in integrated 5g wireless and time-sensitive networking systems
EP3553994A1 (en) Method for exchanging time synchronisation message, and network device
WO2012068844A1 (en) Method and system for synchronizing clock of master-slave clock devices
TW202029790A (en) Cellular vehicle-to-everything out of coverage synchronization
JP2007184687A (en) Propagation delay time measuring method, synchronization method, and wireless lan system
US20220039042A1 (en) Methods, second node and apparatus for determining clock asynchronization
WO2012068848A1 (en) Method and system for time synchronization
WO2017113404A1 (en) Network node, packet transmission method and network
Thi et al. IEEE 802.1 TSN time synchronization over Wi-Fi and 5G mobile networks
WO2010102565A1 (en) Method, apparatus and system for time synchronization

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

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

Country of ref document: EP

Kind code of ref document: A1