Time synchronization method and time synchronization device
The time synchronization method and device address the challenge of synchronizing time across multiple domains with different PTP profiles by acting as a virtual grandmaster clock, effectively overcoming verification mechanism issues and ensuring consistent time synchronization.
Patent Information
- Application Number
- JP2024053903
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-01
- Filing Date
- 2024-03-28
- Publication Date
- 2025-05-01
- Estimated Expiration
- 2044-03-28
AI Technical Summary
Existing time synchronization methods across multiple domains using different PTP profiles face challenges due to varying verification mechanisms, leading to inefficient time synchronization.
A time synchronization method and device that run multiple PTP instances, connect to multiple time synchronization domains over multiple ports, and act as a virtual grandmaster clock, ensuring seamless time synchronization by modifying clock attributes and handling different verification mechanisms.
The solution enables successful time synchronization across multiple domains with different PTP profiles, overcoming verification mechanism issues and ensuring consistent time synchronization without information errors.
Smart Images

Figure 2025069909000001_ABST
Abstract
Description
[Technical field]
[0001] [CROSS-REFERENCE TO RELATED APPLICATIONS] This application claims priority to U.S. Provisional Application No. 63 / 544,644, filed October 18, 2023, the contents of which are incorporated herein by reference.
[0002] [Technical field] The present invention relates to a method and a device for time synchronization, more particularly to a method and a device for time synchronization in multiple time synchronization network domains. [Background technology]
[0003] Precision Time Protocol (PTP) is a standard for time synchronization defined by IEEE 1588, which is used to achieve high-precision time synchronization across time-critical networks. As the market evolves, different network applications have unique requirements. To address this, many different PTP profiles have been proposed for different applications, such as the Power Profile (IEEE Std C37.238) for power networks, the Telecom Profile (ITU-T G.8265.1) for communication networks, and the Generalized Precision Time Protocol (gPTP, IEEE Std 802.1AS). PTP profiles allow applications in different fields to set specific operating parameters, attributes, and default values that meet their requirements. However, this can make it difficult for devices and networks using different PTP profiles to communicate effectively. Generally, to ensure time synchronization, apparatuses or devices in the same environment need to use the same PTP profile, making cross-domain time integration difficult.
[0004] The conventional technology integrates multiple types of PTP profiles by a time gateway, so that devices or different time synchronization domains using multiple different types of PTP profiles may synchronize time according to one grandmaster (GM) clock of those devices or time synchronization domains. Thus, multiple different types of PTP profiles are used to achieve time synchronization between multiple time synchronization domains.
[0005] However, when performing time synchronization, different profiles or machines may adopt different verification mechanisms. Thus, during time synchronization across network domains that use different types of PTP profiles, the time synchronization method may not work smoothly due to the different verification mechanisms. Summary of the Invention
[0006] Therefore, the present invention overcomes the shortcomings of the prior art by providing a method and device for successfully passing the verification mechanism when synchronizing time across multiple devices or network domains that use multiple different types of PTP profiles.
[0007] An embodiment of the present invention discloses a time synchronization method for a time synchronization device, which runs multiple Precision Time Protocol (PTP) instances to connect to multiple time synchronization domains through multiple ports, the time synchronization method includes the steps of obtaining a grandmaster (GM) clock from the multiple time synchronization domains, updating clock information of the grandmaster clock, determining whether each of the multiple ports is a time receiving port or a time transmitting port according to the grandmaster clock, modifying clock attributes of each of the multiple PTP instances according to whether the corresponding port is a time receiving port or a time transmitting port, and synchronizing timings of the multiple time synchronization domains according to the grandmaster clock by the multiple PTP instances.
[0008] An embodiment of the present invention further discloses a time synchronization device, configured to execute multiple PTP instances and connect to multiple time synchronization domains through multiple ports, including a processing unit and a storage unit. The processing unit is configured to execute a program code. The storage unit is coupled to the processing unit and configured to store the program code, which instructs the processing unit to execute a time synchronization method. The time synchronization method includes the steps of: obtaining a grandmaster clock from multiple time synchronization domains; updating clock information of the grandmaster clock; determining whether each of the multiple ports is a time receiving port or a time transmitting port according to the grandmaster clock; modifying clock attributes of each of the multiple PTP instances according to whether the corresponding port is a time receiving port or a time transmitting port; and synchronizing timing of the multiple time synchronization domains according to the grandmaster clock by the multiple PTP instances.
[0009] These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings. [Brief description of the drawings]
[0010] [Figure 1] FIG. 1 is a schematic diagram of a network system. [Diagram 2] FIG. 1 is a schematic diagram of a time synchronization network system according to an embodiment of the present invention. [Diagram 3]FIG. 1 is a schematic diagram of a time synchronization network system according to an embodiment of the present invention. [Figure 4] FIG. 2 is a schematic diagram of a time synchronization process according to an embodiment of the present invention. [Figure 5A] FIG. 1 is a schematic diagram of a time synchronization network system having a time synchronization device according to an embodiment of the present invention. [Figure 5B] FIG. 1 is a schematic diagram of a time synchronization network system having a time synchronization device according to an embodiment of the present invention. [Figure 6A] FIG. 1 is a schematic diagram of a time synchronization network system having two time synchronization devices according to an embodiment of the present invention. [Figure 6B] FIG. 1 is a schematic diagram of a time synchronization network system having two time synchronization devices according to an embodiment of the present invention. [Figure 7] FIG. 1 is a schematic diagram of a time synchronization network system for synchronizing time of time synchronization devices according to an embodiment of the present invention. [Figure 8] FIG. 2 is a schematic diagram of a network device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Certain terms are used throughout the detailed description and claims to refer to particular components. As one skilled in the art will appreciate, hardware manufacturers may refer to a component by several different names. This specification does not intend to distinguish between components that differ in name but not function. In the following description and claims, the words "include" and "comprise" are used in an open-ended manner and therefore should be interpreted to mean "including, but not limited to."
[0012] Referring to FIG. 1, FIG. 1 is a schematic diagram of a network system 1. The network system 1 includes time synchronization domains 12_1, ..., 12_3, each of which may be a network domain consisting of a wired network, a wireless network, or a combination of the wired network and the wireless network, may be a network domain consisting of a plurality of devices (including a plurality of clocks) and a network switch, etc., or may be a network domain consisting of only a single device (including only one clock). The time synchronization domains 12_1, ..., 12_3 are time synchronization domains that operate according to the specifications of a plurality of different types of Precision Time Protocol (PTP) Profiles A to C, respectively. The PTP Profiles A to C may be, but are not limited to, a Telecom Profile, a Power Profile, gPTP, etc.
[0013] It should be noted that since the time synchronization domains 12_1, ..., 12_3 operate time synchronization mechanisms according to different PTP profiles A to C, it is generally impossible to perform cross-domain integration for time synchronization. In this situation, each time synchronization domain may have an optimal clock (such as optimal clocks 14_1, ..., 14_3 in Fig. 1) that acts as a grandmaster (GM) clock of each time synchronization domain. In other words, multiple devices belonging to the same network domain perform time synchronization according to the grandmaster clock of the network domain to which the multiple devices belong. The optimal clock refers to the most ideal clock, which is evaluated based on factors such as time source, time accuracy, oscillator stability, etc. and is suitable for a certain time synchronization domain, and the optimal clock may also be a clock that a user determines to be most suitable for a certain time synchronization domain.In this situation, when a manufacturer intends to replace or add a new device in a network domain, the new device must be compatible with the PTP profile used by the network domain; when a device manufacturer develops its device, it needs to customize and tune different types of PTP profiles individually to make it applicable in different domains; and when the network domain needs to integrate with other specific time synchronization domains, the updates for all of those devices and network devices may be required to be compatible with the generalized Precision Time Protocol (gPTP) profile.
[0014] To address the above problems, the prior art integrates multiple types of PTP profiles by a time synchronization device, so that multiple different time synchronization domains or multiple different devices using multiple different types of PTP profiles may synchronize time according to the Grand Master (GM) clocks of those multiple different time synchronization domains or multiple different devices, thereby realizing time synchronization between domains.
[0015] Referring to FIG. 2, FIG. 2 is a schematic diagram of a time synchronization network system 2 according to an embodiment of the present invention. The time synchronization network system 2 includes time synchronization domains 12_1, ..., 12_3 and a time synchronization device 10. The time synchronization device 10 may be a network device, such as, but not limited to, a gateway, a switch, a router, or a bridge operating in a network. The time synchronization device 10 is connected to the time synchronization domains 12_1, ..., 12_3 via ports 16_1, ..., 16_3, respectively. In the time synchronization network system 2, the time synchronization domains 12_1, ..., 12_3 may synchronize time by the time synchronization device 10, so that all of the apparatuses and devices in those time synchronization domains 12_1, ..., 12_3 may be synchronized according to an optimal clock of one of the time synchronization domains 12_1, ..., 12_3. It should be noted that in the time synchronization network system 2, the number of time synchronization domains 12_1, ..., 12_3 is set to 3 for illustrative purposes. The time synchronization device 10 of an embodiment of the present invention may be applied to, but is not limited to, any number of time synchronization domains for synchronizing time.
[0016] As shown in Fig. 2, all of the devices and apparatuses in the time synchronization domains 12_1, ..., 12_3 may synchronize time with, but are not limited to, the optimal clock 14_1 of the time synchronization domain 12_1 using PTP Profile A (as the Grandmaster clock). For example, as shown in Fig. 3, all of the devices and apparatuses in the time synchronization domains 12_1, ..., 12_3 may also synchronize time with the optimal clock 14_2 of the time synchronization domain 12_2 using PTP Profile B or the optimal clock 14_3 of the time synchronization domain 12_3 using PTP Profile C (not shown). It should be noted that the Grandmaster clock of the time synchronization network system 2 may be manually specified or may be automatically determined by the time synchronization device 10 by comparing the capability information of each clock in the PTP Announce message received from each time synchronization domain 12_1, ..., 12_3. For example, the capability information of the clocks is, but is not limited to, parameters such as timePropertiesDS (Time Properties Parameter Data Set), parentDS (Parent Parameter Data Set), corresponding priority vector (Time-synchronization Spanning Tree Priority Vector), etc. In this embodiment, when the grandmaster clock 14_1 fails, the time synchronization device 10 may immediately determine a new grandmaster clock from the optimal clocks 14_2 and 14_3 or other clocks in the time synchronization domain 12_1 to maintain the time synchronization.
[0017] In this embodiment, the time synchronization device 10 builds PTP instances 18_1, ..., 18_3 for ports 16_1, ..., 16_3, respectively, to process time synchronization for the time synchronization domains 12_1, ..., 12_3. Each PTP instance of the PTP instances 18_1, ..., 18_3 must use the same type of PTP profile corresponding to the time synchronization domain connected by the corresponding port. For example, the PTP instance 18_1 for port 16_1 communicates with the time synchronization domain 12_1 using PTP profile A, the PTP instance 18_2 for port 16_2 communicates with the time synchronization domain 12_2 using PTP profile B, and the PTP instance 18_3 for port 16_3 communicates with the time synchronization domain 12_3 using PTP profile C. Therefore, each of the PTP instances 18_1, ..., 18_3 serves as a communication medium between the time synchronization device 10 and the time synchronization domains 12_1, ..., 12_3 according to the corresponding PTP profiles A to C, and the time synchronization device 10 can exchange PTP messages between the connected time synchronization domains 12_1, ..., 12_3. In other words, each of the PTP instances 18_1, ..., 18_3 operates according to the PTP profile used by the corresponding time synchronization domain, and runs as one node of the corresponding time synchronization domain.
[0018] As an example, consider the time synchronization network system 2 in Fig. 2. Specifically, all of the devices and apparatuses in the time synchronization network system 2 synchronize time with the grandmaster clock 14_1. Port 16_1 is a time receiving port for receiving clock information such as clock attributes and time, and has a portState set to be SlavePort (marked as S) according to the PTP specification, and ports 16_2 and 16_3 are time transmitting ports for transmitting clock information such as clock attributes and time, and have a portState set to be MasterPort (marked as M). The time synchronization device 10 receives PTP messages related to the grandmaster clock 14_1 via port 16_1, and processes the PTP messages using the PTP instance 18_1. After obtaining the clock information of the grandmaster clock 14_1 from the PTP instance 18_1, the time synchronization device 10 performs information conversion on the clock information according to PTP profiles B and C. Then, the PTP instances 18_2 and 18_3 send the clock information to the time synchronization domains 12_2 and 12_3 through the ports 16_2 and 16_3 according to PTP profiles B and C, respectively. Thus, the devices in the time synchronization domains 12_2 and 12_3 may receive the clock information of the grandmaster clock 14_1 to realize the time synchronization for the time synchronization network system 2.
[0019] In practice, devices produced by different manufacturers and using different types of PTP profiles may use different verification mechanisms when performing time synchronization. Due to the different verification mechanisms, PTP messages carrying clock information may be rejected, and thus the time synchronization may not be operated successfully. Therefore, the time synchronization device 10 in the above embodiment of the present invention operates as a virtual grandmaster clock according to the time synchronization method, so that all of the devices in the time synchronization network system 2 may regard the time synchronization device 10 as a grandmaster clock operating in the same time synchronization domain. The time synchronization method may be summarized as a time synchronization process 40 shown in FIG. 4. The time synchronization process 40 includes the following steps:
[0020] Step 400: Start.
[0021] Step 402: Obtain grandmaster clocks from multiple time synchronization domains.
[0022] Step 404: Update the clock information of the grandmaster clock.
[0023] Step 406: According to the grandmaster clock, determine whether each of the multiple ports is a time receiving port or a time sending port. If the port is a time sending port, proceed to step 408; if the port is not a time sending port, proceed to step 410.
[0024] Step 408: Update the clock attributes of the PTP instance corresponding to the port using the clock attributes of the grandmaster clock.
[0025] Step 410: Keep the original clock attributes of the PTP instance corresponding to that port.
[0026] Step 412: Perform time synchronization.
[0027] Step 414: Determine whether the connection to the Grandmaster Clock is broken. If "the connection to the Grandmaster Clock is broken", proceed to step 418, if "the connection to the Grandmaster Clock is not broken", proceed to step 416.
[0028] Step 416: Determine whether better clock information is received. If "better clock information is received", proceed to step 418; if "better clock information is not received", proceed to step 412.
[0029] Step 418: Reset the PTP instances corresponding to other ports.
[0030] According to the time synchronization process 40, the time synchronization device 10 first determines a new grandmaster clock from the time synchronization domains 12_1, ..., 12-3 of the time synchronization network system 2 (step 402), and then updates the clock information of the grandmaster clock, including the clock identity (ID) of the grandmaster clock (step 404). Next, the time synchronization device 10 checks each port of the ports 16_1, ..., 16_3 one by one to determine whether the port is a time receiving port or a time sending port (step 406). If the port is a time receiving port, the corresponding PTP instance may keep the original clock attributes (step 410), and if the port is a time sending port, the time synchronization device 10 may use the clock information of the grandmaster clock to update the clock attributes of the corresponding PTP instance (step 408). Finally, the time synchronization device 10 performs time synchronization (step 412) and keeps monitoring the connection of the grandmaster clock (step 414). If the connection to the grandmaster clock is disconnected, the time synchronization device 10 resets the PTP instance (step 418) and reselects a new grandmaster clock for the time synchronization network system 2 (step 402). During these processes, the PTP instances 18_1, ..., 18_3 continuously listen to the PTP messages.If one of the PTP instances receives a PTP Announce message with a new clock better than the corresponding optimal clock (step 416), the time synchronization device 10 may reset the other PTP instances (step 418) and reselect a new grandmaster clock for the time synchronization network system 2 (step 402). Thus, the time synchronization device 10 integrates the time of all of the devices in the time synchronization network system 2.
[0031] 2, the time synchronization device 10 determines in step 402 that the optimal clock 14_1 of the time synchronization domain 12_1 is the grandmaster clock, and then uses the clock information of the grandmaster clock 14_1 to update the clock information of the grandmaster clock 20 in step 404. Then, the time synchronization device 10 checks each port of the ports 16_1,...,16_3 one by one in step 406, and determines that the port 16_1 is a time receiving port, and the ports 16_2 and 16_3 are time sending ports. According to steps 408 and 410, the time synchronization device 10 uses the clock attributes of the grandmaster clock 14_1 to update the clock attributes of the PTP instances 18_2 and 18_3, and maintains the original clock attributes of the PTP instance 18_1. Finally, the PTP instances 18_1, ..., 18_3 synchronize the timing of the time synchronization domains 12_1, ..., 12_3 according to the grandmaster clock 14_1. It should be noted that if the grandmaster clock 14_1 is disconnected, the time synchronization device 10 may reset the information of the PTP instances 18_1, ..., 18_3 in step 418 and reselect a new grandmaster clock, such as the optimal clock 14_2 in Fig. 3, in step 402. In addition, if one of the PTP instances 18_1, ..., 18_3 receives a PTP Announce message with a clock better than the corresponding optimal clocks 14_1, ..., 14_3, the time synchronization device 10 may reset the other PTP instances in step 418 and may again reselect a new grandmaster clock.
[0032] According to the time synchronization process 40, in step 402, the time synchronization device 10 obtains a grandmaster clock from the time synchronization domains 12_1, ..., 12_3. Specifically, the time synchronization device 10 may select a grandmaster clock from the optimal clocks 14_1, ..., 14_3 by comparing priority vectors of the clocks, which are determined according to a best master clock algorithm (BMCA) or manually specified. The priority vectors of the clocks are included in the clock information and received by the PTP instances 18_1, ..., 18_3 via PTP messages. The time synchronization device 10 determines a best clock among the optimal clocks 14_1, ..., 14_3 to be the grandmaster clock.
[0033] In step 404, the time synchronization device 10 uses the clock information of the grandmaster clock 14_1 to update the clock information of the grandmaster clock 20. The clock information includes, but is not limited to, the capability information, time, and clock ID mentioned above. The time synchronization device 10 may perform information conversion on the clock information of the grandmaster clock 14_1 according to multiple different PTP profiles. For example, the clock information of the grandmaster clock 14_1 may be converted to comply with the format of PTP profiles B and C, and may be passed to the PTP instances 18_2 and 18_3, respectively.
[0034] In step 406, the time synchronization device 10 determines whether each of its multiple ports is a time receiving port or a time sending port according to the PTP message it receives. Specifically, the PTP standard supports two operation modes: one-step mode and two-step mode. In the one-step mode, the sending timestamp is updated in time and carried in the sync message on the fly, and the one-step mode is a hardware-based method that requires fewer messages. In the two-step mode, in addition to the sync message, an additional follow-up message containing the sending time of the preceding message is sent, and the two-step mode is a software-initiated method. In this embodiment, both the one-step mode and the two-step mode are applicable. In this embodiment, while operating in the one-step mode, it determines that the port that receives the PTP message Sync is a time receiving port, and if not, it determines that the port is a time sending port. On the other hand, while operating in 2-step mode, the port that receives the PTP message Sync or the PTP message Follow_Up is determined to be a time receiving port, and if not, the port is determined to be a time sending port. Thus, since the port 16_1 receives a synchronization message in 1-step mode from the time synchronization domain 12_1, or the port 16_1 receives a synchronization message or a Follow_Up message in 2-step mode from the time synchronization domain 12_1, the port 16_1 is a time receiving port, and the ports 16_2 and 16_3 are time sending ports.
[0035] In steps 408 and 410, the time synchronization device 10 modifies the clock attributes of each PTP instance of the PTP instances 18_1, ..., 18_3 according to whether the corresponding port is a time receiving port or a time sending port. The time synchronization device 10 uses the clock attributes of the grandmaster clock 14_1 to update the clock attributes, such as the clock ID, of the PTP instances 18_2 and 18_3 corresponding to the time sending ports 16_2 and 16_3, so that the PTP instances 18_2 and 18_3 may send PTP messages having clock attributes, such as the clock ID, of the grandmaster clock 14_1 via the time sending ports 16_2 and 16_3. In other words, the PTP messages sent by the PTP instances 18_2 and 18_3 are similar to the PTP messages sent by the grandmaster clock 14_1, and the time synchronization device 10 may be considered to be the grandmaster clock for multiple devices in the time synchronization domains 12_2 and 12_3. In addition, the corresponding port 16_1 may maintain the clock attributes of the PTP instance 18_1 since it is a time receiving port responsible for receiving the clock information of the grandmaster clock 14_1.
[0036] In step 412, the time synchronization device 10 performs time synchronization. Specifically, the PTP instances 18_2 and 18_3 corresponding to the time sending ports 16_2 and 16_3 may send PTP messages using clock information of the grandmaster clock 14_1 obtained from the PTP instance 18_1 corresponding to the time receiving port 16_1. The clock information is converted by the time synchronization device 10 according to PTP profiles B and C, respectively, and thus becomes available to the time synchronization domains 12_2 and 12_3.
[0037] As mentioned above, the time synchronization device 10 uses different PTP profiles to connect three time synchronization domains 12_1, ..., 12_3, and the time synchronization device 10 receives information from the grandmaster clock 14_1 of the time synchronization domain 12_1 and plays the role of the grandmaster clock in the time synchronization domains 12_2 and 12_3. The time synchronization device 10 may send a PTP message using the information of the grandmaster clock 14_1, such as the clock ID, as a virtual grandmaster clock for the time synchronization domains 12_2 and 12_3, so that the devices in the time synchronization domains 12_2 and 12_3 may consider the time synchronization device 10 to be the grandmaster clock 14_1 and synchronize time with the grandmaster clock 14_1. Furthermore, the time synchronization device 10 may further modify some of the specific fields in the PTP message to overcome various verification mechanisms for the grandmaster clocks designed by different manufacturers. For example, fields such as "correctionField" or "cumulativeRateRatio" in the PTP Sync message and the PTP Follow_Up message may be reset to 0, the "localStepsRemoved" field of the PTP Announce message may be assigned a value of 0, and the "pathTrace" array of the PTP Announce TLV may only maintain the clock ID of Grandmaster 14_1. Different fields in the PTP messages may need to be corrected according to, but not limited to, different validation mechanisms.Although the time synchronization device 10 achieves the effect of acting like a virtual grandmaster clock by modifying the contents of the PTP messages, it should be noted that there are some specific message fields, such as "sourcePortIdentity", "sequenceId", "twoStepFlag", and "logMessageInterval", that need to be used to communicate with connected devices and do not need to be modified. Thus, devices in the time synchronization domains 12_2 and 12_3 may synchronize their time with the grandmaster clock 14_1 according to the contents of the PTP messages they receive from the time synchronization device 10.
[0038] In steps 414 to 418, the time synchronization device 10 keeps monitoring the PTP messages from the time synchronization domains 12_1, ..., 12_3. During the time synchronization process 40, the grandmaster clock 14_1 may fail or a clock that is better than the grandmaster clock 14_1 may appear, and the time synchronization device 10 may reset the PTP instances and reselect a new grandmaster clock for the time synchronization network system 2 in these situations. In step 414, when losing connection with the grandmaster clock 14_1, the time synchronization device 10 may reset the PTP instances 18_1, ..., 18_3 and then start selecting a new grandmaster clock in step 402. In step 416, if one of the PTP instances 18_1, ..., 18_3 receives a PTP announcement message of a clock that is better than the corresponding best clock, the time synchronization device 10 may reset the other PTP instances and initiate selection of a new grandmaster clock in step 402. For example, if the PTP instance 18_3 receives a PTP announcement message of a clock that is better than the best clock 14_3, the time synchronization device 10 may reset the PTP instances 18_1 and 18_2 and reselect a grandmaster clock according to step 402.
[0039] Thus, the time synchronization device 10 acts as a virtual grandmaster clock, whereby multiple devices in the time synchronization domains 12_2 and 12_3 may consider the time synchronization device 10 to be the grandmaster clock 14_1 and may synchronize time with that grandmaster clock 14_1.
[0040] Referring to FIG. 5A, FIG. 5A is a schematic diagram of a time synchronization network system 5 according to an embodiment of the present invention. The time synchronization network system 5 includes time synchronization domains 12_1, ..., 12_2 and a time synchronization device 50. As shown in FIG. 5A, the time synchronization device 50 constructs PTP instances 58_1 and 58_2 connecting to the time synchronization domains 12_1 and 12_2 through ports 56_1 and 56_2 according to PTP Profiles A and B. The time synchronization device 50 receives time information of the grandmaster clock 14_1 through a time receiving port 56_1 (i.e., portState is set to be SlavePort marked as S) according to PTP Profile A. After converting the clock information, the time synchronization device 50 transmits the time information to the time synchronization domain 12_2 through a time sending port 56_2 (i.e., portState is set to be MasterPort marked as M) according to PTP Profile B.
[0041] For devices in the time synchronization domain 12_2, the time synchronization device 50 and the time synchronization domain 12_2 form a PTP domain B, as shown in Fig. 5B. The time synchronization device 50 operates as a virtual grandmaster clock and may be regarded as a grandmaster clock in the same domain to the time synchronization domain 12_2. Therefore, the devices in the time synchronization domain 12_2 may not detect that the grandmaster clock 14_1 actually comes from a heterogeneous domain using different PTP profile (the time synchronization domain 12_1). In other words, the time of the grandmaster clock 14_1 starts with transmission from the time synchronization domain 12_1 and arrives at the time synchronization domain 12_2 after the time synchronization device 50, as shown by the dashed line in Fig. 5A, while for the time synchronization domain 12_2, the received time is the time of the virtual grandmaster clock 50, as shown by the dashed line in Fig. 5B, thus avoiding the problem of time synchronization failure caused by the checking mechanism.
[0042] 5A and 5B, by utilizing a single time synchronization device 50 and referring to the time synchronization process 40, the time synchronization network system 5 achieves that all of the time synchronization domains connected to the time synchronization device 40 operate according to the time of the same grandmaster clock to synchronize the time. Those skilled in the art may make appropriate modifications according to the needs of the system, but are not limited thereto. For example, refer to FIG. 6A, which is a schematic diagram of a time synchronization network system 6 according to an embodiment of the present invention. In this embodiment, the time synchronization network system 6 performs time synchronization for the time synchronization domains 12_1, ..., 12_3 by two time synchronization devices 50 and 60.
[0043] As shown in Fig. 6A, the time synchronization device 60 constructs PTP instances 68_2 and 68_3 that connect to the time synchronization domains 12_2 and 12_3 through ports 66_2 and 66_3 according to PTP Profiles B and C. The time synchronization device 60 receives time information of the grandmaster clock 14_1 through a time receiving port 66_2 (marked as S) according to PTP Profile B. After converting the clock information, the time synchronization device 60 transmits the time information to the time synchronization domain 12_3 through a time sending port 66_3 (marked as M) according to PTP Profile C.
[0044] For the devices in the time synchronization domain 12_3, the time synchronization device 60 and the time synchronization domain 12_3 form a PTP domain C, as shown in FIG. 6A. The time synchronization device 60 may act as a virtual grandmaster clock and be considered to be a grandmaster clock in the same domain as the time synchronization domain 12_3. Therefore, the devices in the time synchronization domain 12_3 may not detect that the grandmaster clock 14_1 actually comes from a heterogeneous domain using different PTP profile (the time synchronization domain 12_1). Referring to FIG. 6B, FIG. 6B is another diagram of the time synchronization network system 6 in FIG. 6A. As shown by the dashed line in FIG. 6A, the time of the grandmaster clock 14_1 starts to be transmitted from the time synchronization domain 12_1 and arrives at time synchronization domain 12_3 after time synchronization device 50, time synchronization domain 12_2, and time synchronization device 60, while for time synchronization domain 12_3, the received time is the time of the virtual grandmaster clock 60, as shown by the dashed line in FIG. 6B.
[0045] In the above embodiment, the grandmaster clock is determined by the time synchronization device according to the BMCA, and whether each port of the time synchronization device is a time sending port or a time receiving port is determined based on whether it receives a PTP message (such as a PTP message Sync or a PTP message Follow_Up) related to the grandmaster clock. Meanwhile, in one embodiment, the time synchronization network system 2 may further include a management device, and the management device can determine the grandmaster clock. The management device may determine the grandmaster clock of the synchronization network system 2, and then determine that each port of the time synchronization device is a time sending port or a time receiving port and configure each port of the time synchronization device according to an external port configuration method defined in the PTP standard. In that embodiment, the time synchronization device may skip steps 402 and 406, and the time synchronization device may check each port to determine whether to modify the clock attribute corresponding to the port. If the port is a time receiving port, the corresponding PTP instance may keep the original clock attribute (step 410), and if the port is a time sending port, the time synchronization device 10 may use the clock information of the grandmaster clock to update the clock attribute of the corresponding PTP instance (step 408). Finally, as mentioned in step 412, perform time synchronization.
[0046] In the above embodiment, the grandmaster clock is a clock in the time synchronization domain 12_1, ..., 12_3, and the time synchronization device determines whether to modify the clock attributes of the PTP instances 18_1, ..., 18_3 according to whether the corresponding port is a time receiving port or a time sending port. In other embodiments, the clock of the time synchronization device may be the grandmaster clock, in other words, the time synchronization device may select the grandmaster clock from among the optimal clocks 14_1, ..., 14_3 and the clocks of the time synchronization device. In this situation, the grandmaster clock may not belong to any time synchronization domain connected to the time synchronization device, and may further perform the time synchronization according to the time synchronization process 40.
[0047] Referring to FIG. 7, FIG. 7 is a schematic diagram of a time synchronization network system 7 according to an embodiment of the present invention. The time synchronization network system 7 includes time synchronization domains 12_1, ..., 12_3 and a time synchronization device 70. As shown in FIG. 7, the time synchronization device 70 establishes PTP instances 78_1, ..., 78_3 connecting to the time synchronization domains 12_1, ..., 12_3 through ports 76_1, ..., 76_3 according to PTP profiles A to C, respectively. In this embodiment, the time synchronization network system 7 utilizes the clock 74 of the time synchronization device 70 as a grandmaster clock and synchronizes time for the time synchronization domains 12_1, ..., 12_3 according to the grandmaster clock. According to the time synchronization process 40, the time synchronization device 70 selects the clock 74 as the grandmaster clock in step 402, and then updates the clock information of the grandmaster clock in step 404. It should be noted that the grandmaster clock 74 does not belong to any of the time synchronization domains 12_1, ..., 12_3, and the time information of the grandmaster clock 74 needs to be transmitted to all of the time synchronization domains 12_1, ..., 12_3. Thus, in this embodiment, the time synchronization device 70 needs to determine that all of the ports 76_1, ..., 76_3 are time sending ports (marked as M). In addition, since the grandmaster clock 74 is located in the time synchronization device 70, the PTP instances 78_1, ..., 78_3 may send PTP messages using the original clock attributes without modification. In other words, the time synchronization device 70 may skip steps 406 to 410 of determining that all of the ports 76_1, ..., 76_3 are time sending ports, and proceed to step 412 to directly perform time synchronization.Similar to the above embodiment, in step 412, the time synchronization device 70 may perform information conversion on the clock information of the grandmaster clock 74 according to multiple different PTP profiles A to C, and then transmit the clock information to the time synchronization domains 12_1, ..., 12_3, respectively.
[0048] Further, referring to FIG. 8, FIG. 8 is a schematic diagram of a network device 8 according to an embodiment of the present invention. The network device 8 may be a network device, such as, but not limited to, a gateway, a switch, a router, and a bridge operating in a time synchronization domain, and is used to implement the time synchronization devices 10, 50, 60, and 70. As shown in FIG. 8, the network device 8 may include a processing unit 80 and a storage unit 82. The processing unit 80 may be a microprocessor or an application specific integrated circuit (ASIC). The storage unit 82 may be any type of data storage device that stores a program code 820, which is read and executed by the processing unit 80. For example, the storage unit 104 may be, but is not limited to, a read only memory (ROM), a flash memory, a random access memory (RAM), a hard disk, an optical data storage device, a non-volatile storage unit, etc.
[0049] The network device 8 is used to represent the necessary components required to implement the embodiments of the present invention, and those skilled in the art may make various modifications or adjustments according to the present invention, including but not limited to these. For example, when the network device 8 is applied to implement a time synchronization device, the time synchronization process 40 may be compiled into a program code 820, stored in the storage unit 82, and executed by the processing unit 80. Furthermore, the storage unit 82 may also be used to store, including but not limited to, the clock information 20 and data required to execute the time synchronization method.
[0050] In the current industrial automation field, all of the machines tend to be able to synchronize time with a grandmaster clock that is preset or expected by the manufacturer. Even in an environment using various PTP profiles, it is still desired that at the application level, all of the machines using different PTP profiles can be synchronized to the same grandmaster clock. Meanwhile, the internal working mechanisms of time synchronization for those different PTP profiles are not necessarily the same. In order to ensure that all of the machines can correctly select the designated grandmaster clock for time synchronization, various verification mechanisms are applied by the manufacturer, thus preventing time synchronization between domains. Therefore, the virtual grandmaster clock provided by the present invention aims to enable the time gateway to synchronize machines using different PTP profiles with a grandmaster clock, as well as synchronization within the same time synchronization domain using the same PTP profile. In other words, those devices can assume that they directly use the same PTP profile to synchronize time with the grandmaster clock in the same domain. Therefore, there will be no information errors caused by traversing different PTP profiles, and the validation process will not fail due to traversing multiple domains that use different PTP profiles. Thus, all of the machines can be synchronized with the same Grandmaster clock at the application level.
[0051] In summary, the present invention provides a method and device for time synchronization, in which a time synchronization device may act as a virtual grandmaster clock, whereby inter-domain time synchronization can overcome problems caused by various verification mechanisms.
[0052] Those skilled in the art will readily appreciate that numerous modifications and variations of the devices and methods may be made while retaining the teachings of the present invention, and therefore the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Claims
1. 1. A time synchronization method for use with a time synchronization device, the time synchronization device running multiple Precision Time Protocol (PTP) instances and connecting to multiple time synchronization domains through multiple ports, the time synchronization method comprising: obtaining a Grand Master (GM) clock from the plurality of time synchronization domains; updating clock information of the grandmaster clock; determining whether each of the plurality of ports is a time receiving port or a time sending port according to the grandmaster clock; modifying a clock attribute of each of the plurality of PTP instances according to whether a corresponding port is the time receiving port or the time sending port; and synchronizing, by the multiple PTP instances, timing of the multiple time synchronization domains according to the grandmaster clock. Time synchronization method.
2. The method of claim 1 , wherein the multiple time synchronization domains use different types of PTP profiles.
3. The time synchronization method of claim 2 , wherein each of the multiple PTP instances uses a same type of PTP profile corresponding to the time synchronization domain.
4. 2. The time synchronization method of claim 1, wherein the step of obtaining the grandmaster clock from the multiple time synchronization domains comprises selecting the grandmaster clock from an optimal clock of each of the multiple time synchronization domains, and the optimal clock of each of the multiple time synchronization domains is determined according to a best master clock algorithm (BMCA).
5. 5. The method of claim 4, wherein the grandmaster clock is selected by comparing priority vectors of the optimal clocks in each of the multiple time synchronization domains.
6. The method of claim 1 , wherein the clock attributes include at least a clock identification (ID).
7. determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock, 2. The method of claim 1, further comprising: determining that each of the plurality of ports is the time sending port when the clock of the time synchronization device is the grandmaster clock.
8. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, 8. The method of claim 7, further comprising maintaining original clock attributes of each of the plurality of PTP instances corresponding to the time sending port.
9. determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock, determining, when operating in one-step mode, that a first port of the plurality of ports is the time receiving port and that other ports of the plurality of ports are the time sending ports in response to a first port receiving a PTP Sync message associated with the grandmaster clock; and 2. The method of claim 1, comprising: determining that a first port of the plurality of ports is the time receiving port and determining that another port of the plurality of ports is the time sending port in response to a first port receiving a PTP Sync message and a PTP Follow_up message associated with the grand master clock when operating in a two-step mode.
10. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, updating the clock attributes of each of the plurality of PTP instances corresponding to the time sending port using the clock attributes of the grandmaster clock; and maintaining original clock attributes of each of the plurality of PTP instances corresponding to the time receiving port.
11. 2. The time synchronization method of claim 1, wherein the grandmaster clock is determined externally, and the determination in the step of determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock is performed according to an external port configuration method.
12. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, updating the clock attributes of each of the plurality of PTP instances corresponding to the time sending port using the clock attributes of the grandmaster clock; and maintaining original clock attributes of each of the plurality of PTP instances corresponding to the time receiving port.
13. The step of the multiple PTP instances synchronizing the timing of the multiple time synchronization domains according to the grand master clock comprises:
2. The time synchronization method of claim 1, further comprising the step of transmitting a PTP message having the clock attributes of the grandmaster clock to the corresponding time synchronization domain by each of the plurality of PTP instances corresponding to the time transmission port.
14. Among the PTP messages, correctionField in the PTP Sync message and PTP Follow_up message, cumulativeRateRatio in the PTP Sync message and PTP Follow_up message, localStepsRemoved in the PTP announcement message, and pathTrace in the PTP announcement message, The method of claim 13 , further comprising the step of modifying at least one of the fields:
15. 1. A time synchronization device configured to run a plurality of Precision Time Protocol (PTP) instances to connect to a plurality of time synchronization domains through a plurality of ports, the time synchronization device comprising: a processing unit configured to execute program code; a storage unit coupled to the processing unit and configured to store the program code, the program code instructing the processing unit to perform a time synchronization method; The time synchronization method includes: obtaining a Grand Master (GM) clock from the plurality of time synchronization domains; updating clock information of the grandmaster clock; determining whether each of the plurality of ports is a time receiving port or a time sending port according to the grandmaster clock; modifying a clock attribute of each of the plurality of PTP instances according to whether a corresponding port is the time receiving port or the time sending port; and synchronizing, by the multiple PTP instances, timing of the multiple time synchronization domains according to the grandmaster clock. Time synchronization device.
16. The time synchronization device of claim 15, wherein the multiple time synchronization domains use different types of PTP profiles.
17. The time synchronization device of claim 16, wherein each of the multiple PTP instances uses the same type of PTP profile corresponding to the time synchronization domain.
18. 16. The time synchronization device of claim 15, wherein the step of obtaining the grandmaster clock from the multiple time synchronization domains comprises selecting the grandmaster clock from an optimal clock of each of the multiple time synchronization domains, the optimal clock of each of the multiple time synchronization domains being determined according to a best master clock algorithm (BMCA).
19. 20. The time synchronization device of claim 18, wherein the grandmaster clock is selected by comparing priority vectors of the optimal clocks in each of the multiple time synchronization domains.
20. The time synchronization device of claim 15 , wherein the clock attributes include at least a clock identification (ID).
21. determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock, 16. The time synchronization device of claim 15, further comprising determining that each of said plurality of ports is said time sending port when a clock of said time synchronization device is said grandmaster clock.
22. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, The time synchronization device of claim 20, further comprising maintaining an original clock attribute of each of the plurality of PTP instances corresponding to the time sending port.
23. determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock, determining, when operating in one-step mode, that a first port of the plurality of ports is the time receiving port and that other ports of the plurality of ports are the time sending ports in response to a first port receiving a PTP Sync message associated with the grandmaster clock; and 16. The time synchronization device of claim 15, further comprising: determining that a first port of the plurality of ports is the time receiving port and determining that another port of the plurality of ports is the time sending port in response to a first port receiving a PTP Sync message and a PTP Follow_up message associated with the grand master clock when operating in a two-step mode.
24. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, updating the clock attributes of each of the plurality of PTP instances corresponding to the time sending port using the clock attributes of the grandmaster clock; and maintaining original clock attributes of each of the plurality of PTP instances corresponding to the time receiving port.
25. 16. The time synchronization device of claim 15, wherein the grandmaster clock is determined externally, and the determination in the step of determining whether each of the plurality of ports is the time receiving port or the time sending port according to the grandmaster clock is performed according to an external port configuration method.
26. The step of modifying the clock attribute of each of the plurality of PTP instances according to whether the corresponding port is the time receiving port or the time sending port, updating the clock attributes of each of the plurality of PTP instances corresponding to the time sending port using the clock attributes of the grandmaster clock; and maintaining original clock attributes of each of the plurality of PTP instances corresponding to the time receiving port.
27. The step of the multiple PTP instances synchronizing the timing of the multiple time synchronization domains according to the grand master clock comprises: The time synchronization device of claim 15, further comprising a step of transmitting a PTP message having the clock attributes of the grand master clock to the corresponding time synchronization domain by each of the plurality of PTP instances corresponding to the time transmission port.
28. The time synchronization method includes, among the PTP messages, correctionField in the PTP Sync message and PTP Follow_up message, cumulativeRateRatio in the PTP Sync message and PTP Follow_up message, localStepsRemoved in the PTP announcement message, and pathTrace in the PTP announcement message, 28. The time synchronization device of claim 27, further comprising the step of modifying at least one of the fields of:
Citation Information
Patent Citations
METHOD OF CREATING QoS FLOW FOR TIME SYNCHRONIZATION PROTOCOL IN WIRELESS COMMUNICATION NETWORK
US20220095153A1