主权项 |
1. A time synchronization method for synchronizing a first playing device and a second playing device of an area network, the area network comprising a base station, the first playing device having a first system clock, the second playing device having a second system clock, the time synchronization method comprising steps of:
(A) transmitting a packet from the first playing device to the base station; (B) transmitting the packet from the base station to the first playing device and the second playing device; (C) after the packet is received by the second playing device, obtaining an update time by adding an error value to a system time of the second system clock or subtracting the error value from the system time of the second system clock, wherein the error value is a time difference between a time point of transmitting the packet from the first playing device to the base station and a time point of receiving the packet from the base station by the second playing device; (D) judging whether plural first difference values are all smaller than a first predetermined value, wherein if the plural first difference values are all smaller than the first predetermined value, a step (E) is performed, wherein each of the first difference values is a time difference between a time point of transmitting the same packet of plural consecutive packets from the first playing device to the base station and a time point of receiving the packet by the second playing device, wherein a system time of the first system clock is used by the first playing device, and the update time is used by the second playing device; (E) calculating plural second difference values, and judging whether the plural second difference values are all smaller than a second predetermined value, wherein if one of the plural second difference values is smaller than the second predetermined value, a step (F) is performed, wherein each of the second difference values is a time difference between time points of receiving the same packet from the base station by the first playing device and the second playing device, wherein the system time of the first system clock is used by the first playing device, and the update time is used by the second playing device; and (F) obtaining a synchronization time by adding the second difference value to the update time or subtracting the second difference value from the update time, so that the system time of the first system clock and the synchronization time are synchronized with each other. |