Abstract:
In the field of communications, a method and a device for time synchronization are disclosed according to the embodiments of the present invention. The method includes: selecting, by a slave device, a port of a single-fiber bi-directional line as a synchronization port of a 1588 clock protocol; specifying a work mode of the synchronization port; exchanging a 1588 clock synchronization packet with a master device through the synchronization port according to the work mode; acquiring transmission time information and restore a system clock according to the 1588 clock synchronization packet; and adjusting the system clock according to the work mode and the transmission time information. The device includes: a line processing module, a clock recovery module and a clock adjustment module. Through the method and the device, zero-error time synchronization is implemented, and reliability of clock transmission is high; measurement of a line length or GPS measurement is not required, deployment of a synchronization clock is simple, a rubidium clock does not need to be additionally configured, and complexity of planning, deployment, maintenance and implementation is low; and in the case of unfixed path delay, the time synchronization can also be implemented.