Time synchronization method and device for time synchronization domain
Patent Information
- Application Number
- JP2023115150
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-03-15
- Filing Date
- 2023-07-13
- Publication Date
- 2025-02-26
- Estimated Expiration
- 2043-07-13
Smart Images

Figure 0007635487000001 
Figure 0007635487000002 
Figure 0007635487000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a time synchronization method and device, and more particularly to a time synchronization method and device for automatically determining a master clock in a plurality of time synchronization domains and performing time synchronization. [Background technology]
[0002] Precision Time Protocol (PTP) is a basic standard for time synchronization defined by IEEE 1588, and realizes precise clock synchronization. However, with the change in the market, various different network applications have different needs, so the prior art has proposed many different PTP profiles for different applications, such as the Power Profile (IEEE Std C37.238) for power networks, the Telecom Profile (ITU-T G.8265.1) for telecommunication networks, and the generalized Precision Time Protocol (IEEE Std 802.1AS: gPTP) profile. Depending on the profile, applications in different domains can set different operation parameters, attributes, and preset values according to their needs, so that devices and networks using different profiles cannot communicate efficiently. In general, to ensure time synchronization, all devices or devices in the same environment must use corresponding profiles, and time alignment across domains is difficult.
[0003] In the prior art, multiple different types of PTP profiles can be matched by time gates, and different time synchronization domains or devices using different types of PTP profiles can be synchronized based on a designated master (Grandmaster, GM) clock. In this method, the master clock is an optimal clock in a specific domain that is artificially designated, and in this case, when the master clock fails, there may be a problem that there is no clock to replace the master clock, or the master clock is replaced by a clock that cannot meet the expected performance.
[0004] Therefore, an improvement to the conventional technology is required, and it is necessary to automatically determine an optimal clock to immediately replace the master clock and perform time synchronization when the master clock fails. Summary of the Invention [Problem to be solved by the invention]
[0005] Therefore, a main object of the present invention is to provide a method for selecting an optimal master clock from multiple time synchronization domains and performing time synchronization, in order to improve the drawbacks of the prior art. [Means for solving the problem]
[0006] An embodiment of the present invention discloses a time synchronization method for multiple time synchronization domains, which includes the steps of: constructing multiple corresponding Precision Time Protocol Instances (PTP Instances) for the multiple time synchronization domains, determining an all-domain optimal master clock, and the multiple Precision Time Protocol Instances synchronize times of the multiple time synchronization domains based on the all-domain optimal master clock.
[0007] An embodiment of the present invention also discloses a time synchronization device for use in multiple time synchronization domains. The time synchronization device includes a processing unit and a storage unit. The processing unit is for executing a program code. The storage unit is coupled to the processing unit, stores the program code, and instructs the processing unit to execute a time synchronization method. The time synchronization method includes the steps of: constructing multiple precision time protocol instances corresponding to the multiple time synchronization domains; determining a master clock based on multiple local optimal clocks corresponding to the multiple precision time protocol instances; and notifying the multiple precision time protocol instances to synchronize the times of the multiple time synchronization domains based on the master clock. [Brief description of the drawings]
[0008] [Figure 1] 1 is a schematic diagram of a time synchronization network system including multiple time synchronization domains according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a schematic diagram of a time synchronization process according to an embodiment of the present invention. [Diagram 3] 1 is a schematic diagram of a logical architecture of a time synchronization device according to an embodiment of the present invention; [Figure 4] FIG. 2 is a schematic diagram of a process according to an embodiment of the present invention. [Diagram 5] FIG. 5 is a schematic diagram of the logical architecture of a time synchronization device according to an embodiment of the present invention. [Figure 6] FIG. 2 is a schematic diagram of a process according to an embodiment of the present invention. [Figure 7] 1 is a schematic diagram of a logical architecture of a time synchronization device according to an embodiment of the present invention; [Figure 8] FIG. 2 is a schematic diagram of an update process according to an embodiment of the present invention. [Figure 9A] FIG. 2 is a schematic diagram of a master clock selection method according to an embodiment of the present invention; [Figure 9B] FIG. 2 is a schematic diagram of a master clock selection method according to an embodiment of the present invention; [Figure 10]FIG. 2 is a schematic diagram of a network device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] In the specification and the claims below, some terms are used to indicate specific components. Those skilled in the art will understand that the same components may be named differently by hardware manufacturers. In this specification and the claims below, components are not distinguished by their names, but by their functional differences. The term "including" referred to throughout this specification and the claims below is an open term and should be interpreted as "including, but not limited to."
[0010] Referring to FIG. 1, FIG. 1 is a schematic diagram of a time synchronization network system 1 according to an embodiment of the present invention. The time synchronization network system 1 includes time synchronization domains 12_1 to 12_4 and a time synchronization device 10. The time synchronization domains 12_1 to 12_4 are time synchronization domains that operate according to the standards of different types of Precision Time Protocol Profiles (PTP Profiles), and each time synchronization domain is a domain composed of a wired network, a wireless network, or both, and may be a domain composed of multiple devices and devices such as multiple network switches (including multiple clocks), or a domain composed of a single device (only one clock). The time synchronization device 10 may be a network device such as a gateway, switch, router, and bridge that operates in the time synchronization domain, but is not limited thereto, and is connected to each of the time synchronization domains 12_1 to 12_4 via multiple connection ports (not shown in FIG. 1). The time synchronization domains 12_1 to 12_4 are time-synchronized by the time synchronization device 10 based on a time synchronization method, whereby all devices and apparatuses in the time synchronization domains 12_1 to 12_4 are synchronized based on the time of the same master (GrandMaster, GM) clock. In the time synchronization network system 1, the number of the time synchronization domains 12_1 to 12_4 is four, but this is for the purpose of explanation, and the time synchronization device 10 of the embodiment of the present invention is not limited to this and can be applied to time synchronization between any number of time synchronization domains.
[0011] In addition, without the time synchronization device 10, the time synchronization domains 12_1 to 12_4 execute the time synchronization function based on different PTP profiles, and therefore time synchronization cannot be coordinated across domains. In this case, each time synchronization domain has an optimal clock (optimal clocks 14_1 to 14_4 in FIG. 1) as a master clock of the time synchronization domain, that is, each device belonging to the same time synchronization domain performs time synchronization based on the master clock of the domain to which it belongs. Here, the optimal clock means the most ideal clock (applied to a specific time synchronization domain) evaluated based on factors such as the time source, time accuracy, and oscillator stability, and may be an optimal clock (for a specific time synchronization domain) determined artificially. The time synchronization device 10 of the embodiment of the present invention executes an automated time synchronization method to coordinate the times of different time synchronization domains and synchronize all devices in the time synchronization network system 1 with the same master clock time. This time synchronization method can be summarized in process 2 shown in FIG. 2, which includes the following steps.
[0012] Step 200: Start.
[0013] Step 202: For multiple time synchronization domains, construct multiple corresponding Precision Time Protocol Instances (PTP Instances).
[0014] Step 204: Determine a number of local optimal clocks corresponding to the Precision Time Protocol instance.
[0015] Step 206: Determine a master clock based on a local optimal clock corresponding to the precision time protocol instance.
[0016] Step 208: Notify multiple precision time protocol instances to synchronize times of multiple time synchronization domains based on the master clock.
[0017] Step 210: End.
[0018] 3, which is a logical architecture diagram of the time synchronization device 10 according to the embodiment of the present invention. According to process 2, the time synchronization device 10 first constructs the corresponding precision time protocol instances 16_1-16_4 for each of the time synchronization domains 12_1-12_4 (step 202), and determines the optimal clocks 14_1-14_4 corresponding to the precision time protocol instances 16_1-16_4 (step 204). Next, the time synchronization device 10 determines a master clock based on the optimal clocks 14_1-14_4 (step 206), and this master clock becomes the basis for time synchronization of all devices in the time synchronization domains 12_1-12_4. Finally, the time synchronization device 10 notifies the precision time protocol instances 16_1-16_4 that the time of the time synchronization domains 12_1-12_4 is synchronized based on the master clock (step 208). This allows all devices in the time synchronization domains 12_1 to 12_4 to operate in the same time domain.
[0019] In detail, the precision time protocol instances 16_1 to 16_4 constructed by the time synchronization device 10 in step 202 use the same type of precision time protocol profile corresponding to the connected time synchronization domains 12_1 to 12_4, and therefore can exchange PTP messages with the connected time synchronization domains to serve as an exchange medium between the time synchronization device 10 and the time synchronization domains 12_1 to 12_4. In other words, the time synchronization domains 12_1 to 12_4 can operate according to various different types of precision time protocol profiles, including but not limited to Telecom Profile, Power Profile, gPTP, and the like, and the precision time protocol instances 16_1 to 16_4 operate according to the time protocol profile corresponding to the time synchronization domains 12_1 to 12_4 and operate as one of the nodes.
[0020] In step 204, each domain in the time synchronization domains 12_1 to 12_4 has its own local best-fit clock (14_1 to 14_4), and when each domain operates independently, the local best-fit clock 14_1 to 14_4 operates as a (local) master clock of each domain. The local best-fit clock 14_1 to 14_4 can be determined by a best-fit master clock algorithm (BMCA), and the precision time protocol instances 16_1 to 16_4 can obtain information on the local best-fit clock 14_1 to 14_4 of each domain by exchanging PTP messages with the corresponding time synchronization domains 12_1 to 12_4. As a result, the time synchronization device 10 can obtain the local best-fit clocks 14_1 to 14_4 for the time synchronization domains 12_1 to 12_4, and store the clock information 18_1 to 18_4 of the local best-fit clocks 14_1 to 14_4.
[0021] In step 206, the time synchronization device 10 determines a master clock based on the clock information 18_1-18_4 of the local optimal clocks 14_1-14_4, and the master clock is the basis for time synchronization of all devices in the time synchronization domains 12_1-12_4. In one embodiment, the time synchronization device 10 may further include all-domain master clock information for storing the clock information 18_0 of the master clock. In the initialization phase of the time synchronization network system 1, the time synchronization device 10 may first determine an optimal clock from among the local optimal clocks 14_1-14_4 by a master clock selection method, set it as the master clock of the time synchronization network system 1, and store the clock information in the clock information 18_0. In the operation phase of the time synchronization network system 1, the precision time protocol instances 16_1-16_4 may continuously monitor PTP messages, and the time synchronization device 10 may determine whether to update the master clock of the time synchronization network system 1 based on the master clock. For convenience of explanation, the original clock information of any one of the precision time protocol instances 16_x among the precision time protocol instances 16_1 to 16_4 is 18_x, and the local optimum clock corresponding to the time synchronization domain 12_x records 14_x. Also, the optimum clock already recorded in the clock information 18_0 is a local optimum clock 14_y among the local optimum clocks 14_1 to 14_4, and corresponds to the time synchronization domain 12_y. Here, x and y may be the same or different. When the precision time protocol instance 16_x receives a clock announce message from a new clock in the corresponding time synchronization domain 12_x, the clock announce message includes new clock information 18_x_new, and the time synchronization device 10 determines whether to update the master clock of the time synchronization network system 1 based on the new clock information 18_x_new in the clock announce message.The method by which the time synchronization device 10 determines whether to update the master clock of the time synchronization network system 1 can be summarized in an update process 4 shown in FIG. 4, which includes the following steps.
[0022] Step 400: Start.
[0023] Step 402: The new clock information 18_x_new is compared with the clock information 18_x.
[0024] Step 404: Determine whether the new clock corresponding to the new clock information 18_x_new is better (superior) than the local best clock 14_x corresponding to the clock information 18_x. If yes, execute step 406; if no, execute step 414.
[0025] Step 406: Update the clock information 18_x of the local optimal clock of the precision time protocol instance 16_x to the new clock information 18_x_new, and then execute step 408.
[0026] Step 408: Compare the updated clock information 18_x with the clock information 18_0 of the master clock, and then execute step 410.
[0027] Step 410: Determine whether the new clock corresponding to the updated clock information 18_x is better than the master clock. If yes, execute step 412; if no, execute step 414.
[0028] Step 412: The clock information 18_0 of the master clock is updated to the updated clock information 18_x.
[0029] Step 414: End.
[0030] In brief, when any one of the precision time protocol instances 16_x receives a clock announce message, the time synchronization device 10 should judge whether the new clock is better than the current master clock based on the clock information included in the clock announce message. First, the clock information 18_x_new of the new clock should be compared with the clock information 18_x of the local best clock corresponding to the precision time protocol instance 16_x (step 402), and from the comparison result, judge whether the new clock is better than the original best clock 14_x (step 404). If "yes", it means that the new clock is the best clock in the current time synchronization domain 12_x, so replace the original best clock with the new clock and update the clock information 18_x (step 406). If "no", end the process. Next, the clock information 18_x_new (updated clock information 18_x) of the new clock should be further compared with the clock information 18_0 of the master clock (step 408), and based on the comparison result, it is determined whether the new local optimal clock 14_x is better than the master clock (step 410). If "yes", it means that the new clock is the optimal clock in the current time synchronization network system 1, so the new clock replaces the master clock and updates the clock information 18_0 (step 412). If "no", the process is terminated.
[0031] In another embodiment, in step 206, the time synchronization device 10 has all-domain master clock information for storing the clock information 18_0 of the master clock, as in the above embodiment. However, in the initialization phase of the time synchronization network system 1, the time synchronization device 10 does not need to first determine an optimal clock from among the local optimal clocks 14_1 to 14_4 to set it as the master clock of the time synchronization network system 1, and may set the clock information 18_0 to null. In the operation phase of the time synchronization network system 1, the precision time protocol instances 16_1 to 16_4 may similarly continuously monitor PTP messages. When one precision time protocol instance 16_x among the precision time protocol instances 16_1 to 16_4 receives a clock announce message from a new clock in the corresponding time synchronization domain 12_x, the time synchronization device 10 determines whether to update the master clock of the time synchronization network system 1 based on the new clock information in the clock announce message. The method by which the time synchronization device 10 decides whether to update the master clock is the same as in the update process 4 described above, but in step 408, if the clock information 18_0 of the original master clock is set to null, step 412 can be executed as is and the clock information 18_0 of the master clock can be replaced with the clock information of the new clock.
[0032] Referring to FIG. 5, FIG. 5 is a logical architecture diagram of a time synchronization device 50 according to an embodiment of the present invention. The time synchronization device 50 can operate the time synchronization domains 12_1 to 12_4 in the same time domain, instead of the time synchronization device 10 in FIG. 3. In this embodiment, the time synchronization device 50 does not have "all-domain" master clock information for storing the master clock like the time synchronization device 10, but the time synchronization device 50 stores the clock information 18_0 of the master clock in the precision time protocol instances 16_1 to 16_4. That is, in addition to the clock information 18_1 to 18_4 of the local optimal clocks 14_1 to 14_4, the precision time protocol instances 16_1 to 16_4 also store the clock information 18_0 of the master clock. In the initialization stage of the time synchronization network system 1, the time synchronization device 50 can determine an optimal clock from among the local optimal clocks 14_1 to 14_4 by the master clock selection method and set it as the master clock of the time synchronization network system 1, and can also set the clock information 18_0 to a null value (NULL). In the operation stage of the time synchronization network system 1, in step 206, the precision time protocol instances 16_1 to 16_4 can continuously monitor PTP messages in the same manner, and the time synchronization device 50 determines whether to update the master clock of the time synchronization network system 1 based on this. As in the above example, the original clock information of any one of the precision time protocol instances 16_x among the precision time protocol instances 16_1 to 16_4 is set to 18_x, and the local optimal clock 14_x corresponding to the time synchronization domain 12_x is recorded. When a precision time protocol instance 16_x receives a clock announcement message from a new clock in the corresponding time synchronization domain 12_x, the clock announcement message includes new clock information 18_x_new, and the time synchronization device 50 can decide whether to update the master clock of the time synchronization network system 1 based on the new clock information 18_x_new in the clock announcement message.The method by which the time synchronization device 50 determines whether to update the master clock of the time synchronization network system 1 can be summarized in an update process 6 shown in FIG. 6, which includes the following steps.
[0033] Step 600: Start.
[0034] Step 602: The new clock information 18_x_new is compared with the clock information 18_x.
[0035] Step 604: Determine whether the new clock corresponding to the new clock information 18_x_new is better than the local best clock 14_x corresponding to the clock information 18_x. If yes, execute step 606; if no, execute step 612.
[0036] Step 606: Update the clock information 18_x of the local optimal clock of the precision time protocol instance 16_x to the new clock information 18_x_new, and then execute step 608.
[0037] Step 608: According to the master clock selection method, an optimum clock is determined from among the local optimum clocks 14_1 to 14_4 and set as the master clock, and then step 610 is executed.
[0038] Step 610: The clock information 18_0 of the master clock stored in the precision time protocol instances 16_1 to 16_4 is updated to the updated clock information 18_x.
[0039] Step 612: End.
[0040] In brief, when any one of the precision time protocol instances 16_x receives a clock announce message, the time synchronization device 50 needs to determine a new master clock based on the clock information included in the clock announce message. First, the clock information 18_x_new of the new clock needs to be compared with the clock information 18_x of the local best clock corresponding to the precision time protocol instance 16_x (step 602), and from the result of the comparison, it is determined whether the new clock is better than the original best clock 14_x (step 604). If "yes", it means that the new clock is the best clock in the current time synchronization domain 12_x, so the new clock replaces the original best clock and updates the clock information 18_x (step 606). If "no", the process is terminated. Next, a clock comparison is performed according to the master clock selection method, and the best clock is determined from the local best clocks 14_1 to 14_4 to be the new master clock (step 608). Finally, the clock information 18_0 of the precision time protocol instances 16_1 to 16_4 is updated to the new master clock information (step 610).
[0041] Meanwhile, referring to FIG. 7, FIG. 7 is a logical architecture diagram of a time synchronization device 70 according to an embodiment of the present invention. The time synchronization device 70 can operate the time synchronization domains 12_1 to 12_4 in the same time domain, instead of the time synchronization device 10 in FIG. 3 or the time synchronization device 50 in FIG. 5. In this embodiment, the time synchronization device 70 does not have clock information 18_1 to 18_4 for storing the local optimal clocks 14_1 to 14_4 as the time synchronization devices 10 and 50 do, and stores only all-domain master clock information for storing the clock information 18_0 of the master clock. In the initialization stage of the time synchronization network system 1, the time synchronization device 70 may set the clock information 18_0 to null, or may select the optimal one from the default parameter data set (default DS) of the precision time protocol instances 16_1 to 16_4 as the initial value of the clock information 18_0 by a master clock selection method. In the operation stage of the time synchronization network system 1, in step 206, the precision time protocol instances 16_1 to 16_4 can continuously monitor the PTP message in the same manner, and the time synchronization device 70 can determine whether to update the master clock of the time synchronization network system 1 based on the PTP message. As in the above example, when the precision time protocol instance 16_x receives a clock announce message from a new clock of the corresponding time synchronization domain 12_x, the clock announce message includes new clock information 18_x_new, and the time synchronization device 70 can determine whether to update the master clock of the time synchronization network system 1 based on the new clock information 18_x_new in the clock announce message. The method of the time synchronization device 70 to determine whether to update the master clock of the time synchronization network system 1 can be summarized in an update process 8 as shown in FIG. 8, and the update process 8 includes the following steps:
[0042] Step 800: Start.
[0043] Step 802: The new clock information 18_x_new is compared with the clock information 18_0.
[0044] Step 804: Determine whether the new clock corresponding to the new clock information 18_x_new is better than the master clock corresponding to the clock information 18_0. If yes, execute step 806; if no, execute step 808.
[0045] Step 806: The clock information 18_0 of the master clock is updated to the new clock information 18_x_new.
[0046] Step 808: End.
[0047] In brief, when any one of the precision time protocol instances 16_x receives a clock announce message, the time synchronization device 70 needs to decide whether to update the master clock based on the clock information included in the clock announce message. First, it needs to compare the clock information 18_x_new of the new clock with the clock information 18_0 corresponding to the master clock (step 802), and from the result of the comparison, it is determined whether the new clock is better than the original master clock (step 804). If "yes", it means that the new clock is the best clock in the current time synchronization network system 1, so replace the master clock with the new clock and update the clock information 18_0 (step 806). If "no", the process is terminated.
[0048] After determining or updating the clock information 18_0 of the master clock in step 206, the time synchronization device 10 needs to send a notification to all precision time protocol instances other than the precision time protocol instance 16_x in step 208. The precision time protocol instances 16_1 to 16_4 that receive the notification can synchronize the time of their corresponding time synchronization domains 12_1 to 12_4 based on the clock information of the new clock being notified. This allows all devices in the time synchronization network system 1, including devices in all connected time synchronization domains 12_1 to 12_4, to realize time synchronization of all devices by the master clock across domains.
[0049] Specifically, in step 206, the time synchronization device 10 determines the optimal clock as the master clock of the time synchronization network system 1 by the master clock selection method, and reference can be made to FIG. 9A and FIG. 9B. In particular, the time synchronization device 10 compares the local optimal clocks 14_1-14_4 based on the clock information 18_1-18_4 to select the optimal clock. In one embodiment, as shown in FIG. 9A, C1-C4 respectively represent attributes of the local optimal clocks 14_1-14_4 (e.g., those obtained by the information recorded in the clock information 18_1-18_4, which will be described in detail later). The time synchronization device 10 continues to compare any two attributes of the attributes C1-C4 until it can be determined that one of the attributes C1-C4 is superior to all other attributes. First, in the first round of comparison, the attribute C1 is compared with the attributes C2 to C4 of all other local optimal clocks, respectively. If the attribute C1 is superior to the attributes C2 to C4, the local optimal clock 14_1 corresponding to the attribute C1 is determined to be the optimal clock, and the process is terminated. In the opposite case, it is determined that the local optimal clock 14_1 is not the optimal clock, and the second round of comparison is continued. In the second round of comparison, the attribute C2 is compared with the attributes C1, C3, and C4 of all other local optimal clocks, respectively. If the attribute C2 is superior to the attributes C1, C3, and C4, the local optimal clock 14_2 corresponding to the attribute C2 is determined to be the optimal clock, and the process is terminated. In the opposite case, it is determined that the local optimal clock 14_2 is not the optimal clock, and the third round of comparison is continued. The comparisons from the third round onwards are performed by analogy from this until the optimal clock can be determined. The optimal clock determined by the above process becomes the master clock of the time synchronization network system 1, and serves as the basis for time synchronization of all devices in the time synchronization network system 1.
[0050] In another embodiment, as shown in FIG. 9B, C1 to C4 respectively represent the attributes of the local optimum clocks 14_1 to 14_4 as described above. In this embodiment, the time synchronization device 10 repeatedly compares any two of the attributes C1 to C4 without overlapping, until it can determine that any one of the attributes C1 to C4 is superior to all the other attributes. First, in the first round of comparison, the attribute C1 is compared with the attributes C to C4 of all the other local optimum clocks, and if the attribute C1 is superior to the attributes C2 to C4, the local optimum clock 14_1 corresponding to the attribute C1 is determined to be the optimum clock, and the process is terminated. In the opposite case, it is determined that the local optimum clock 14_1 is not the optimum clock, and the second comparison is continued. In the second round of comparison, the attribute C2 is compared with the attributes C3 and C4 of the other local optimum clocks that have not yet been compared, and if the attribute C2 is superior to the attributes C3 and C4, the local optimum clock 14_2 corresponding to the attribute C2 is determined to be the optimum clock, and the process is terminated. In the opposite case, it is determined that the optimal clock 14_2 is not the optimal clock, and the third round of comparison is continued. Finally, in the third round of comparison, the attribute C3 is compared with the attribute C4 of other local optimal clocks that have not yet been compared, and if the attribute C3 is superior to the attribute C4, the local optimal clock 14_3 corresponding to the attribute C3 is determined to be the optimal clock, and the process ends. In the opposite case, it can be determined that the local optimal clock 14_4 is the optimal clock. The optimal clock determined by the above process becomes the master clock of the time synchronization network system 1, and serves as the basis for time synchronization of all devices in the time synchronization network system 1.
[0051] Note that, although Figures 9A and 9B show a method that the time synchronization device 10 can adopt to determine the optimal clock, the present invention is not limited to this, and any method that can automatically select an optimal clock across domains as the master clock of the time synchronization network system 1 from the local optimal clocks 14_1 to 14_4 of the time synchronization domains 12_1 to 12_4 is applicable to the present invention.
[0052] Moreover, the clock information 18_0 to 18_4 includes, but is not limited to, a time properties parameter data set (timePropertiesDS), a parent parameter data set (parentDS), and a corresponding priority vector (Time-synchronization Spanning Tree Priority Vector) related to the master clock capability information. Therefore, the comparison of the clock attributes (C1 to C4) may be performed based on the priority vector in the corresponding clock information. Parameters included in the priority vector include rootSystemIdentity, stepsRemoved, sourcePortIdentity, and the portNumber of the receiving port, among which, rootSystemIdentity further includes parameters of priority1, clockClass, clockAccuracy, offsetScaledLogVariance, priority2, and clockIdentity. The relevant definitions of IEEE 802.1AS-2020 can be referred to for the names of the parameters, and those skilled in the art can understand the meanings indicated therein. The embodiment of the present invention compares the parameters of the priority vector in order, and the smaller the numerical value, the more preferable it is as a basis for comparison, but is not limited thereto.
[0053] Further, referring to FIG. 10, FIG. 10 is a schematic diagram of a network device 100 of an embodiment of the present invention. The network device 100 may be a network device such as a gateway, a switch, a router, and a bridge that operates in a time synchronization domain to realize the time synchronization devices 10, 50, and 70. As shown in FIG. 10, the network device 100 may include a processing unit 102 and a storage unit 104. The processing unit 102 may be a microprocessor or an Application Specific Integrated Circuit (ASIC). The storage unit 104 may be any data storage device for storing program code and reading and executing the program code 106 through the processing unit 102. 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 and an optical data storage device, a non-volatile storage unit, and the like.
[0054] The network device 100 represents elements necessary for implementing the embodiment of the present invention, and may be modified and adjusted differently by those skilled in the art, but is not limited thereto. For example, when implementing the time synchronization device 10 with the network device 100, the process 2 of the time synchronization method can be compiled into a program code and stored in the storage unit 104, and the time synchronization method can be executed by the processing unit 102. In addition, the storage unit 104 stores clock data 18_0 to 18_4 and data required for executing the time synchronization method, but is not limited thereto.
[0055] In the prior art, different time synchronization domains or devices using different types of PTP profiles synchronize time based on an artificially designated master clock, and when the master clock fails, there may be a problem that there is no clock to replace the master clock, or the master clock is replaced by a clock that does not meet the expected performance. In contrast, the present invention can automatically determine the master clock and perform time synchronization across domains, and even if the master clock fails, the present invention can automatically replace the master clock with another clock with optimal functions, thus greatly improving the reliability and operating efficiency of the system.
[0056] As described above, the present invention provides a time synchronization method and apparatus that automatically determines a master clock in multiple different time synchronization domains and performs time synchronization across domains, avoiding problems that may occur when the master clock fails, and improving the shortcomings of the prior art.
[0057] The above are merely preferred embodiments of the present invention, and all equivalent changes and modifications within the scope of the claims of the present invention belong to the scope of the present invention. [Explanation of symbols]
[0058] 1. Time Synchronization Network System 10 Time synchronizer 12_1~12_4 Time synchronization domain 14_1~14_4 Local Optimal Clock 16_1~16_4 Precision Time Protocol Instances 18_0~18_4 Clock information 2. Process 200~210 steps 4. Process 400~414 steps 50 Time synchronizer 6 Process 600~612 steps 70 Time synchronizer 800~808 steps C1~C4 Local Optimal Clock Attributes 100 Network Devices 102 Processing Unit 104 Storage Unit 106 Program Code
Claims
1. A time synchronization method for use in a plurality of time synchronization domains, comprising: constructing a plurality of corresponding Precision Time Protocol Instances (PTP Instances) for the plurality of time synchronization domains; determining an all-domain optimal master clock; and a step in which the plurality of precision time protocol instances synchronize times of the plurality of time synchronization domains based on the all-domain optimal master clock.
2. The step of determining an all-domain optimal master clock comprises: determining a plurality of local optimal clocks corresponding to the plurality of Precision Time Protocol instances; and determining the all-domain optimal master clock based on the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances.
3. 3. The method of claim 2, wherein the step of determining the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances comprises determining an optimal clock for each time synchronization domain of the plurality of time synchronization domains based on a Best Master Clock Algorithm (BMCA) to determine the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances.
4. 3. The time synchronization method according to claim 2, wherein the step of determining the all-domain optimal master clock based on the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances is a step of continuously comparing any two local optimal clocks among the plurality of local optimal clocks, and when one of the local optimal clocks is determined to be optimal, the local optimal clock is determined to be the all-domain optimal master clock.
5. 5. The time synchronization method of claim 4, wherein the step of continuously comparing any two local best clocks of the plurality of local best clocks includes not redundantly comparing any two local best clocks of the plurality of local best clocks.
6. 5. The time synchronization method according to claim 4, wherein the step of continuously comparing any two local optimal clocks among the plurality of local optimal clocks comprises continuously comparing priority vectors of any two local optimal clocks among the plurality of local optimal clocks.
7. When a precision time protocol instance of the plurality of precision time protocol instances receives an Announcement message of a first clock of a corresponding time synchronization domain, comparing said first clock with a local best fit clock corresponding to said Precision Time Protocol instance; if the first clock is better than the local best clock corresponding to the Precision Time Protocol instance, replacing the local best clock corresponding to the Precision Time Protocol instance with the first clock; comparing the local best clock updated to the first clock with the all-domain best master clock; if the local best clock updated to the first clock is better than the all-domain best master clock, replacing the all-domain best master clock with the local best clock updated to the first clock; and notifying the plurality of precision time protocol instances to synchronize the times of the plurality of time synchronization domains based on the updated all-domain optimal master clock.
8. When a precision time protocol instance of the plurality of precision time protocol instances receives an Announcement message of a first clock of a corresponding time synchronization domain, comparing said first clock with said all-domain optimal master clock; if the first clock is superior to the all-domain optimal master clock, replacing the all-domain optimal master clock with the first clock; and notifying the plurality of precision time protocol instances to synchronize the times of the plurality of time synchronization domains based on the updated all-domain optimal master clock.
9. The method of claim 1 , wherein the multiple time synchronization domains use different types of Precision Time Protocol Profiles (PTP Profiles).
10. A time synchronization device for use in a plurality of time synchronization domains, comprising: a processing unit for executing program code; a storage unit coupled to the processing unit for storing the program code and for instructing the processing unit to execute a time synchronization method; The time synchronization method includes: constructing a plurality of corresponding Precision Time Protocol Instances (PTP Instances) for the plurality of time synchronization domains; determining an all-domain optimal master clock; and a step in which the plurality of precision time protocol instances synchronize times of the plurality of time synchronization domains based on the all-domain optimal master clock.
11. The step of determining an all-domain optimal master clock comprises: determining a plurality of local optimal clocks corresponding to the plurality of Precision Time Protocol instances; and determining the all-domain optimal master clock based on the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances.
12. 12. The time synchronization device according to claim 11, wherein the step of determining the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances comprises determining an optimal clock for each time synchronization domain of the plurality of time synchronization domains based on a Best Master Clock Algorithm (BMCA) to determine the plurality of local optimal clocks corresponding to the plurality of precision time protocol instances.
13. 12. The time synchronization device of claim 11, wherein the step of determining the all-domain optimal master clock based on the multiple local optimal clocks corresponding to the multiple precision time protocol instances is a step of continuously comparing any two local optimal clocks among the multiple local optimal clocks, and when one of the local optimal clocks is determined to be optimal, the local optimal clock is determined to be the all-domain optimal master clock.
14. 14. The time synchronization device of claim 13, wherein the step of continuously comparing any two local optimum clocks among the plurality of local optimum clocks includes not redundantly comparing any two local optimum clocks among the plurality of local optimum clocks.
15. 14. The time synchronization device according to claim 13, wherein the step of continuously comparing any two local optimal clocks among the plurality of local optimal clocks comprises continuously comparing priority vectors of any two local optimal clocks among the plurality of local optimal clocks.
16. When a precision time protocol instance of the plurality of precision time protocol instances receives an Announcement message of a first clock of a corresponding time synchronization domain, comparing said first clock with a local best fit clock corresponding to said Precision Time Protocol instance; if the first clock is better than the local best clock corresponding to the Precision Time Protocol instance, replacing the local best clock corresponding to the Precision Time Protocol instance with the first clock; comparing the local best clock updated to the first clock with the all-domain best master clock; if the local best clock updated to the first clock is better than the all-domain best master clock, replacing the all-domain best master clock with the local best clock updated to the first clock; and notifying the plurality of precision time protocol instances to synchronize the times of the plurality of time synchronization domains based on the updated all-domain optimal master clock.
17. When a precision time protocol instance of the plurality of precision time protocol instances receives an Announcement message of a first clock of a corresponding time synchronization domain, comparing said first clock with said all-domain optimal master clock; if the first clock is superior to the all-domain optimal master clock, replacing the all-domain optimal master clock with the first clock; and notifying the plurality of precision time protocol instances that the times of the plurality of time synchronization domains are synchronized based on the updated all-domain optimal master clock.
18. The time synchronization device according to claim 10, wherein the plurality of time synchronization domains use different types of Precision Time Protocol Profiles (PTP Profiles).
Citation Information
Patent Citations
Cross domain synchronization in a communication network
US20200252150A1
Information processing equipment, information processing method, and computer program
WO2022044544A1