Time synchronization method and time synchronization device
A time synchronization method is provided for a time synchronization device, wherein the time synchronization device runs a plurality of precision time protocol (PTP) instances to connect to a plurality of time synchronization domains respectively. The time synchronization method includes determining whether a frequency of a local PTP clock of the time synchronization device is changed; and updating a frequency of a local clock of the time synchronization device with the frequency of the local PTP clock in response to the frequency of the local PTP clock being changed.
1 . A time synchronization method for a time synchronization device, wherein the time synchronization device runs a plurality of precision time protocol (PTP) instances to connect to a plurality of time synchronization domains respectively, and the time synchronization method comprises:
determining whether a frequency of a local PTP clock of the time synchronization device is changed; and
updating a frequency of a local clock of the time synchronization device with the frequency of the local PTP clock in response to the frequency of the local PTP clock being changed;
wherein the plurality of PTP instances send PTP messages according to the updated local clock.
2 . The time synchronization method of claim 1 , wherein one of the plurality of PTP instances is connected to a time synchronization domain operating with a generalized precision time protocol (gPTP).
3 . The time synchronization method of claim 2 , wherein the one of the plurality of PTP instances computes a rate ratio according to the updated frequency of the local clock.
4 . The time synchronization method of claim 2 , further comprising sending a PTP message with a timestamp of the updated local clock.
5 . The time synchronization method of claim 1 , wherein the plurality of time synchronization domains use a plurality of PTP profiles, and the plurality of PTP profiles are different.
6 . A time synchronization device, configured to run a plurality of precision time protocol (PTP) instances to connect to a plurality of time synchronization domains respectively, comprising:
a processing unit, configured to execute a program code; and
a storage unit, coupled to the processing unit, configured to store the program code to instruct the processing unit to execute a time synchronization method, wherein the time synchronization method comprises:
determining whether a frequency of a local PTP clock of the time synchronization device is changed; and
updating a frequency of a local clock of the time synchronization device with the frequency of the local PTP clock in response to the frequency of the local PTP clock being changed;
wherein the plurality of PTP instances send PTP messages according to the updated local clock.
7 . The time synchronization device of claim 6 , wherein one of the plurality of PTP instances is connected to a time synchronization domain operating with a generalized precision time protocol (gPTP).
8 . The time synchronization device of claim 7 , wherein the one of the plurality of PTP instances computes a rate ratio according to the updated frequency of the local clock.
9 . The time synchronization device of claim 7 , wherein the time synchronization method further comprises sending a PTP message with a timestamp of the updated local clock.
10 . The time synchronization device of claim 6 , wherein the plurality of time synchronization domains use a plurality of PTP profiles, and the plurality of PTP profiles are different.