Method, computing device and storage medium for synchronizing time in multiple time domains

By calculating the propagation delay and offset values ​​between the master and slave nodes and using the Precision Time Protocol (PTP) to achieve time synchronization in multiple time domains, the problem of hardware dependence in the existing technology is solved and a flexible and stable synchronization solution is provided.

CN116266773BActive Publication Date: 2025-09-16HYUNDAI AUTOEVER
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211595010.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-12-16
Filing Date
2022-12-13
Publication Date
2025-09-16
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

The existing Precision Time Protocol (PTP) standard fails to effectively support time synchronization in multiple time domains, resulting in the need to add additional hardware to the network to achieve synchronization, increasing costs and resource consumption.

Method used

By calculating the propagation delay and offset values ​​at the Precision Time Protocol (PTP) layer between the master and slave nodes, software functions are used to achieve time synchronization in multiple time domains. This includes synchronizing the hardware clock of the slave node to the reference time of the master node, and transmitting time and offset values ​​through data packets to calculate the time in each time domain.

Benefits of technology

It achieves time synchronization in multiple time domains without adding hardware, reduces costs and improves the flexibility and stability of synchronization. It is suitable for the in-vehicle network of autonomous driving platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116266773B_ABST
    Figure CN116266773B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, a computing device and a storage medium for synchronizing time in multiple time domains, and the method includes the following steps: the precise time protocol layer of the slave node calculates and stores a propagation delay value; the master node time protocol layer transmits the reference time pointed to by the hardware clock of the master node to the slave node time protocol layer; the slave node time protocol layer synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; the master node time protocol layer transmits the time value of the first time domain calculated by adding the offset value of the first time domain in multiple time domains to the slave node time protocol layer; the slave node time protocol layer calculates the offset value of the first time domain using the time value of the first time domain and the stored propagation delay value; and the slave node time protocol layer applies the calculated offset value of the first time domain to the reference time pointed to by the hardware clock of the slave node and thereby obtains the time of the first time domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for synchronizing the time of multiple time domains and a device for implementing the method, and in particular to a method for synchronizing the time of multiple time domains between multiple nodes constituting a network and a device for implementing the method. Background Art

[0002] The Network Time Protocol (NTP) is a network protocol used to synchronize clocks between computer systems over packet-switched and variable-delay data networks.

[0003] The Precision Time Protocol (PTP) is a protocol that uses a master-slave hierarchy to synchronize the clocks of network devices. It can provide a higher level of clock accuracy than the Network Time Protocol (NTP) by using hardware timestamps, synchronizing clocks to an accuracy of less than 1 microsecond.

[0004] The Precision Time Protocol (PTP) uses a master and slave hierarchy similar to the Network Time Protocol (NTP). The most accurate clock available is called the master clock, and the slave devices use the master's signal to synchronize their own clocks.

[0005] The Precision Time Protocol (PTP) defined in the existing 802.1AS-2011 (generalized Precision Time Protocol, gPTP) standard does not include specifications related to multi-time domain synchronization.

[0006] In the existing Precision Time Protocol (PTP), when the entire network belongs to a single time domain, if nodes in the network require multiple time zones, physical network reconstruction by adding separate hardware devices is required to achieve time synchronization. Therefore, using PTP to synchronize time across multiple time domains results in significant cost and resource consumption.

[0007] Therefore, a method is needed to synchronize the time of multiple time domains in an established network without adding separate hardware but only through software functions. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to provide a method for synchronizing the time of multiple time domains between a master node and a slave node using the Precision Time Protocol (PTP) and a device for implementing the method.

[0009] Another technical problem to be solved by the present invention is to provide a method for synchronizing time in multiple time domains and a device for implementing the method, which can provide a new Precision Time Protocol (PTP) standard that adds multiple time domain synchronization-related specifications that are not included in the existing 802.1AS-2011 (generalized Precision Time Protocol, gPTP) standard.

[0010] Another technical problem that the present invention aims to solve is to provide a method for synchronizing time in multiple time domains and a device for implementing the method, which can stably and flexibly build an in-vehicle network that supports multiple time domains when implementing an autonomous driving platform.

[0011] The technical problems of the present invention are not limited to the technical problems mentioned in the above content, and those skilled in the art in the art of the present disclosure will be able to further clearly understand other technical problems not mentioned through the following description.

[0012] In order to solve the technical problem, a method for synchronizing the time of multiple time domains between a master node and a slave node according to one embodiment of the present invention includes: a step in which the Precision Time Protocol (PTP) layer of the slave node calculates and stores the propagation delay value generated when sending and receiving messages with the master node; a step in which the Precision Time Protocol (PTP) layer of the master node transmits the reference time pointed to by the hardware clock of the master node to the Precision Time Protocol (PTP) layer of the slave node; a step in which the Precision Time Protocol (PTP) layer of the slave node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; a step in which the Precision Time Protocol (PTP) layer of the master node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; The present invention relates to a step in which the Precision Time Protocol (PTP) layer of the slave node adds the reference time to the offset value (θ1) of the first time domain in the multiple time domains to transmit the time value of the first time domain calculated by adding the reference time to the offset value (θ1) of the first time domain in the multiple time domains; the Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ1) of the first time domain by using the time value of the first time domain and the stored propagation delay value; and the Precision Time Protocol (PTP) layer of the slave node applies the calculated offset value (θ1) of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain.

[0013] As an embodiment, it may also include: a step in which the Precision Time Protocol (PTP) layer of the master node transmits the time value of the second time domain calculated by adding the reference time to the offset value (θ2) of the second time domain in the multiple time domains to the Precision Time Protocol (PTP) layer of the slave node; and a step in which the Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ2) of the second time domain using the time value of the second time domain and the stored propagation delay value.

[0014] As one embodiment, the step of calculating, by the Precision Time Protocol (PTP) layer of the slave node, the propagation delay value generated when sending and receiving messages with the master node and storing it may include: the step of transmitting, by the Precision Time Protocol (PTP) layer of the slave node, a Pdelay_Req signal including information related to a reference time T1 to the master node; the step of obtaining information related to a reference time T2 at which the Precision Time Protocol (PTP) layer of the master node receives the Pdelay_Req signal and information related to a reference time T3 at which a Pdelay_Resp signal corresponding to the Pdelay_Req signal is transmitted to the Precision Time Protocol (PTP) layer of the slave node; the step of obtaining, by the Precision Time Protocol (PTP) layer of the slave node, information related to a reference time T4 at which the Pdelay_Rest signal is received from the master node; and the step of calculating the propagation delay value using a difference between the reference times T1 and T4 and a difference between T2 and T3.

[0015] As one embodiment, the step of transmitting the time value of the first time domain to the Precision Time Protocol (PTP) layer of the slave node may include: the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain to the Precision Time Protocol (PTP) layer of the slave node through a Sync packet and a Follow_up packet.

[0016] As an embodiment, the time domain fields of the Sync packet and the Follow_up packet may be set to numbers corresponding to the first time domain.

[0017] As an embodiment, it may also include: the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain applicable to the changed offset value (θ1) to the Precision Time Protocol (PTP) layer of the slave node through the Sync data packet and the Follow_up data packet when the offset value (θ1) of the first time domain changes; and the Precision Time Protocol (PTP) layer of the slave node calculates the changed offset value of the first time domain using the transmitted time value of the first time domain and the stored propagation delay value.

[0018] As one embodiment, the Precision Time Protocol (PTP) layer can provide an interface for setting and obtaining the time values ​​of the various time domains and for setting and obtaining the offset values ​​of the various time domains to an application layer equivalent to an upper layer of the Precision Time Protocol (PTP) layer.

[0019] As an embodiment, the method may further include: when the application layer of the master node calls the setTime(1,T) function, the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain, i.e., T, to the Precision Time Protocol (PTP) layer of the slave node; and when the application layer of the slave node calls the getTime(1) function, the method returns the time of the first time domain obtained in the Precision Time Protocol (PTP) layer of the slave node.

[0020] As an embodiment, the present invention may further include: when the Precision Time Protocol (PTP) layer of the master node calls the setOffset(1,θ1) function, setting the offset value of the first time domain to θ1; and when the Precision Time Protocol (PTP) layer of the slave node calls the getOffset(1) function, returning θ1 calculated using the time value of the first time domain and the stored propagation delay value as the offset value of the first time domain.

[0021] As an embodiment, the master node and the slave node may be an electronic control unit (ECU) or a network switch, respectively.

[0022] In order to solve the above technical problems, a computer-readable nonvolatile storage medium according to one embodiment of the present invention may store a computer program for causing a computer to execute the above method.

[0023] To solve the technical problem, a computing device for synchronizing time in multiple time domains between a master node and slave nodes, according to one embodiment of the present invention, includes: one or more processors; a communication interface for communicating with an external device; a memory for loading a computer program executed by the processor; and a storage device for storing the computer program; the computer program including instructions for performing the following actions: an action of calculating, by a Precision Time Protocol (PTP) layer of the slave node, a propagation delay value generated when sending and receiving messages with the master node and storing the propagation delay value; an action of transmitting, by the Precision Time Protocol (PTP) layer of the master node, a reference time pointed to by the hardware clock of the master node to the Precision Time Protocol (PTP) layer of the slave node; The Precision Time Protocol (PTP) layer of the slave node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain calculated by adding the offset value (θ1) of the first time domain in the multiple time domains to the reference time to the Precision Time Protocol (PTP) layer of the slave node; the Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ1) of the first time domain using the time value of the first time domain and the stored propagation delay value; and the Precision Time Protocol (PTP) layer of the slave node applies the calculated offset value (θ1) of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 FIG. 1 is a diagram illustrating a system configuration for synchronizing multiple time domains based on the Precision Time Protocol (PTP) according to an embodiment of the present invention.

[0025] Figure 2 This is an example illustrating the configuration of an in-vehicle network device to which one embodiment of the present invention is applied.

[0026] Figure 3 The present invention is applied to a flowchart illustrating a method for synchronizing time in multiple time domains between a master node and a slave node according to an embodiment of the present invention.

[0027] Figure 4 This is an example of calculating the propagation delay value generated when transmitting a message between a master node and a slave node, applicable to several embodiments of the present invention.

[0028] Figure 5This is an example of synchronizing the hardware clock of a slave node to the reference time pointed to by the hardware clock of the master node, applicable to several embodiments of the present invention.

[0029] Figure 6 This is an example of calculating the offset value of each time domain and obtaining the time of each time domain using the offset value, which is applicable to several embodiments of the present invention.

[0030] Figure 7 FIG. 1 is a diagram illustrating a system configuration for synchronizing multiple time domains using an offset clock layer based on the Precision Time Protocol (PTP) according to another embodiment of the present invention.

[0031] Figure 8 This is an example illustrating the configuration of an in-vehicle network device according to another embodiment of the present invention.

[0032] Figure 9 This is a flowchart illustrating a method for synchronizing time in multiple time domains between a master node and slave nodes according to another embodiment of the present invention.

[0033] Figure 10 is a hardware diagram of an exemplary computing device that can implement methods applicable to several embodiments of the present invention. DETAILED DESCRIPTION

[0034] Next, the preferred embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. The advantages and features of the present disclosure and their methods of achieving them will be further clarified by referring to the subsequent embodiments described in detail in conjunction with the accompanying drawings. However, the technical ideas of the present disclosure are not limited to the following embodiments, but can be implemented in a variety of different forms. The following embodiments are only intended to more completely disclose the technical ideas of the present disclosure and to more completely introduce the scope of the present disclosure to persons with general knowledge in the technical field to which the present disclosure belongs. The technical ideas of the present disclosure should only be limited by the scope of the claims.

[0035] It should be noted that in the process of assigning reference numbers to the constituent elements in the various drawings, the same number is assigned to the same constituent element as much as possible even if it is marked on different drawings. In addition, in the process of describing the present disclosure, if it is determined that the detailed description of the relevant well-known structure or function may make the gist of the present disclosure unclear, the relevant detailed description will be omitted.

[0036] Unless otherwise specified, all terms (including technical and scientific terms) used in this specification have the same meaning as that commonly understood by persons with general knowledge in the technical field to which this disclosure belongs. In addition, unless otherwise clearly specified, commonly used terms that have been defined in dictionaries should not be interpreted as overly idealized or exaggerated meanings. The terms used in this specification are only used to illustrate the embodiments and are not intended to limit the present disclosure. In this specification, unless otherwise specified, singular statements also include plural meanings.

[0037] In addition, in the process of describing the constituent elements of the present disclosure, terms such as first, second, A, B, (a) and (b) may be used. The terms mentioned above are only used to distinguish the constituent elements from other constituent elements, and the nature, order or sequence of the corresponding constituent elements are not limited by the terms. When it is recorded that a certain constituent element is "connected", "combined" or "connected" with other constituent elements, the constituent element can be directly connected or chained with the other constituent elements, but it should be understood that there can be other constituent elements "connected", "combined" or "connected" between each constituent element.

[0038] Next, several embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0039] Figure 1 This is a diagram of a system structure for synchronizing multiple time domains based on the Precision Time Protocol (PTP) according to an embodiment of the present invention. Figure 1 The system of the present invention includes a network device based on the Precision Time Protocol (PTP), namely a master node 11 and a slave node 12.

[0040] The master node 11 and the slave node 12 include a configuration of a Precision Time Protocol (PTP) layer for synchronizing respective times in a plurality of time domains based on the Precision Time Protocol (PTP).

[0041] The Precision Time Protocol (PTP) layer 120 of the slave node 12 calculates the propagation delay value generated when sending and receiving messages with the master node 11, and uses the propagation delay value to synchronize the hardware clock of the slave node 12 to the reference time pointed to by the hardware clock of the master node 11.

[0042] Furthermore, the Precision Time Protocol (PTP) layer 120 of the slave node 12 calculates the offset values ​​of each time domain using the time values ​​of each time domain transmitted from the Precision Time Protocol (PTP) layer 110 of the master node 11 and the pre-calculated propagation delay value. At this point, the slave node 12 can obtain the time of each time domain by applying the offset values ​​of each time domain to the hardware clock of the slave node 12.

[0043] Thus, by utilizing the configuration of the master node and the slave node based on the Precision Time Protocol (PTP) as described above, the time in multiple time domains can be synchronized.

[0044] Figure 2 This is an example diagram illustrating the configuration of an in-vehicle network device to which one embodiment of the present invention is applied. Figure 2 The in-vehicle network device includes multiple electronic control units (ECU_1, ECU_2, ECU_3, and ECU_4) 21, 22, 23, and 24, and a network switch 25 for transmitting and receiving data between the multiple electronic control units. The multiple electronic control units 21, 22, 23, and 24 and the network switch 25 can each be configured as a master node or a slave node.

[0045] The plurality of electronic control units 21, 22, 23, 24 include application layers 210, 220, 230, 240 and precision time protocol (PTP) layers 211, 221, 231, 241, and the network switch 25 includes a precision time protocol (PTP) layer 251. The precision time protocol (PTP) layers 211, 221, 231, 241 can provide an interface including a function call function for setting and obtaining time values ​​of respective time domains and for setting and obtaining offset values ​​to the application layers 210, 220, 230, 240, which are upper layers.

[0046] Each Precision Time Protocol (PTP) layer 211, 221, 231, 241 can synchronize the reference time 213, 223, 233, 243 pointed to by the hardware clock between the master node and the slave node, and control the setting and acquisition of the offset values ​​212, 222, 232, 242 of multiple time domains, thereby synchronizing the time of multiple time domains between the master node and the slave node.

[0047] By configuring the in-vehicle network device of the present invention as described above, an in-vehicle network supporting multiple time domains can be stably and flexibly constructed among multiple electronic control units (ECUs) and network switches.

[0048] Figure 3 This is a flowchart for explaining a method for synchronizing time in multiple time domains between a master node and slave nodes according to one embodiment of the present invention. Figure 3 The actions shown in the figure can be performed by Figure 2 The composition of the execution.

[0049] See Figure 3First, in action S31, the precision time protocol (PTP) layer of the slave node calculates the propagation delay value generated when sending and receiving messages with the master node and stores it.

[0050] For example, Figure 4 As shown, when the master node GM_p is the electronic control unit 1 (ECU1) and the slave node S_p is a switch, the propagation delay value d can be calculated and stored by the precision time protocol (PTP) layer of the slave node S_p.

[0051] Specifically, the Precision Time Protocol (PTP) layer of the slave node S_p may transmit a Pdelay_Req signal including information related to the reference time T1 pointed to by the hardware clock to the master node GM_p.

[0052] At this time, the Precision Time Protocol (PTP) layer of the slave node S_p can obtain information related to the reference time T2 at which the Precision Time Protocol (PTP) layer of the master node GM_p received the Pdelay_Req signal, and information related to the reference time T3 at which the Pdelay_Resp signal corresponding to the Pdelay_Req signal was transmitted to the Precision Time Protocol (PTP) layer of the slave node S_p. In addition, the Precision Time Protocol (PTP) layer of the slave node S_p can obtain information related to the reference time T4 at which the Pdelay_Resp signal was received from the master node GM_p.

[0053] In this way, the Precision Time Protocol (PTP) layer of the slave node S_p can use the difference between the reference time T1 and T4 and the difference between T2 and T3 to calculate the propagation delay value d and store it, so that the stored propagation delay value d can be used when calculating the respective offset values ​​of multiple time domains in the subsequent calculation.

[0054] Next, in action S32, the Precision Time Protocol (PTP) layer of the master node transmits the reference time pointed to by the hardware clock of the master node to the Precision Time Protocol (PTP) layer of the slave node, and in action S33, the Precision Time Protocol (PTP) layer of the slave node synchronizes the hardware clock of the slave node to the reference time pointed to by the transmitted hardware clock of the master node.

[0055] For example, Figure 5As shown, when the master node GM_p is an electronic control unit 1 (ECU1) and the slave node S_p is a switch (Switch), the precision time protocol (PTP) layer of the master node GM_p can transmit the reference time pointed to by the hardware clock of the master node GM_p to the precision time protocol (PTP) layer of the slave node S_p, and the precision time protocol (PTP) layer of the slave node S_p can synchronize the hardware clock of the slave node S_p to the reference time pointed to by the transmitted hardware clock of the master node GM_p.

[0056] Specifically, after the Precision Time Protocol (PTP) layer of the master node GM_p transmits the Sync packet to the slave node S_p at the reference time T1 pointed to by the hardware clock, the Follow_up packet including information related to the reference time T1 may be transmitted to the slave node S_p.

[0057] At this time, the Precision Time Protocol (PTP) layer of the slave node S_p can use the reference time T2 of the Sync packet received from the master node GM_p and the reference time T1 value of the master node GM_p contained in the transmitted Follow_up packet and the previously described Figure 4 The time difference α between the master node GM_p and the slave node S_p is calculated using the propagation delay value d pre-calculated and stored in the example.

[0058] Thereby, the Precision Time Protocol (PTP) layer of the slave node S_p can perform pre-correction of applying the calculated time difference α to the hardware clock of the slave node S_p, thereby synchronizing the hardware clock of the slave node S_p to the reference time pointed to by the hardware clock of the master node GM_p.

[0059] Next, in action S34, the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain calculated by adding the offset value (θ1) of the first time domain in multiple time domains to the reference time to the Precision Time Protocol (PTP) layer of the slave node, and in action S35, the Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ1) of the first time domain using the time value of the first time domain and the stored propagation delay value.

[0060] Finally, in action S36 , the Precision Time Protocol (PTP) layer of the slave node applies the calculated offset value ( θ1 ) of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain.

[0061] At this time, an additional action may be performed in which the Precision Time Protocol (PTP) layer of the master node calculates the time value of the second time domain by adding the offset value (θ2) of the second time domain to the reference time and transmits it to the Precision Time Protocol (PTP) of the slave node. The Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ2) of the second time domain using the time value of the second time domain and the stored propagation delay value, and then applies the offset value to the reference time to obtain the time of the second time domain. Similarly, an action may be performed in which the offset values ​​of each of the multiple time domains other than the first time domain and the second time domain are calculated, and the time of each time domain is calculated by applying the offset values.

[0062] For example, Figure 6 As shown, in the case where the master node GM_p is the electronic control unit 1 (ECU1) and the slave node S_p is the switch (Switch), the precision time protocol (PTP) layer of the master node GM_p can transmit the time values ​​of each time domain calculated by adding the reference time to the respective offset values ​​of the multiple time domains to the precision time protocol (PTP) layer of the slave node S_p, and the precision time protocol (PTP) layer of the slave node S_p uses the time values ​​of each time domain and the previously described Figure 4 The propagation delay value d calculated and stored in the example is used to calculate the offset value of each time domain.

[0063] Specifically, after the Precision Time Protocol (PTP) layer of the master node GM_p transmits the Sync data packet to the slave node S_p at the reference time T1 pointed to by the hardware clock, the Follow_up data packet including the time value (T1+θ1) of the nth time domain calculated by adding the offset value (θn) of the nth time domain in multiple time domains to the reference time T1 can be transmitted to the slave node S_p.

[0064] At this time, the Precision Time Protocol (PTP) layer of the slave node S_p can use the reference time T2 of the Sync packet received from the master node GM_p and the time value (T1+θn) of the nth time domain contained in the transmitted Follow_up packet and the previously described Figure 4 The propagation delay value d pre-calculated and stored in the example is used to calculate the offset value (θn) of the nth time domain.

[0065] Thereby, the Precision Time Protocol (PTP) layer of the slave node S_p can perform post-correction by calculating the respective offset values ​​(θn) of multiple time domains and applying them to the reference time pointed to by the hardware clock, thereby obtaining the time value of the nth time domain on the slave node S_p.

[0066] As one embodiment, the Precision Time Protocol (PTP) layer may provide an interface for setting and obtaining time values ​​of each time domain and for setting and obtaining offset values ​​of each time domain to an application layer equivalent to an upper layer of the Precision Time Protocol (PTP) layer.

[0067] For example, when the setTime(1,T) function is called at the application layer of the master node, the Precision Time Protocol (PTP) layer of the master node transmits the time value of the first time domain, i.e., T, to the Precision Time Protocol (PTP) layer of the slave node, and when the getTime(1) function is called at the application layer of the slave node, the time of the first time domain obtained in the Precision Time Protocol (PTP) layer of the slave node is returned.

[0068] In addition, when the setOffset(1,θ1) function is called at the Precision Time Protocol (PTP) layer of the master node, the offset value (θ1) of the first time domain can be set, and when the getOffset(1) function is called at the Precision Time Protocol (PTP) layer of the slave node, the offset value (θ1) of the first time domain calculated using the time value of the first time domain and the stored propagation delay value is returned.

[0069] By applying the above-described method according to an embodiment of the present invention, the Precision Time Protocol (PTP) can be used to synchronize multiple time domains between a master node and slave nodes. Furthermore, a new Precision Time Protocol (PTP) standard can be provided that incorporates specifications related to multiple time domain synchronization that are not included in the existing 802.1AS-2011 (generalized Precision Time Protocol, gPTP) standard.

[0070] Figure 7 This is a diagram of a system structure for synchronizing multiple time domains using an offset clock layer based on the Precision Time Protocol (PTP) according to another embodiment of the present invention. Figure 7 The system of the present invention includes a network device based on the Precision Time Protocol (PTP), namely a master node 11 and a slave node 12.

[0071] The master node 11 and the slave node 12 are composed of a Precision Time Protocol (PTP) layer for synchronizing the times of multiple time domains based on the Precision Time Protocol (PTP), and an offset value clock layer equivalent to an upper layer of the Precision Time Protocol (PTP) layer. That is, Figure 7 The composition in the above description Figure 1 Compared with the composition in , it also includes the composition of the offset value clock layer.

[0072] The Precision Time Protocol (PTP) layer 110 of the master node 11 transmits the reference time pointed to by the hardware clock to the Precision Time Protocol (PTP) layer 120 of the slave node 12, whereby the Precision Time Protocol (PTP) layer 120 of the slave node 12 can synchronize the hardware clock of the slave node 12 to the reference time pointed to by the hardware clock of the master node 11.

[0073] The master node 11 and the slave node 12 do not need to calculate the offset values ​​of each time domain by using data packet communication between the Precision Time Protocol (PTP) layers, but can obtain the offset values ​​by sending and receiving offset values ​​between the offset value clock layers.

[0074] Specifically, the offset value clock layer 111 of the master node 11 transmits the offset value of each time domain to the offset value clock layer 121 of the slave node 12. At this point, the Precision Time Protocol (PTP) layer 120 of the slave node 12 can apply the offset value of each time domain transmitted to the offset value clock layer 121 of the slave node 12 to the reference time pointed to by the hardware clock of the slave node 12, thereby obtaining the time of each time domain.

[0075] In this way, by utilizing the configuration of a master node and a slave node based on the Precision Time Protocol (PTP) with an offset value clock layer added as described above, the times in multiple time domains can be synchronized.

[0076] Figure 8 This is an example diagram illustrating the configuration of an in-vehicle network device according to another embodiment of the present invention. Figure 8 The in-vehicle network device includes multiple electronic control units (ECU_1, ECU_2, ECU_3, and ECU_4) 71, 72, 73, and 74, and a network switch 75 for transmitting and receiving data between the multiple electronic control units. The multiple electronic control units 71, 72, 73, and 74 and the network switch 75 can each be set as a master node or a slave node.

[0077] The plurality of electronic control units 71, 72, 73, and 74 include application layers 710, 720, 730, and 740, offset value clock layers 711, 721, 731, and 741, and precision time protocol (PTP) layers 712, 722, 732, and 742, and the network switch 75 includes a precision time protocol (PTP) layer 752. The offset value clock layers 711, 721, 731, and 741 can provide the application layers 710, 720, 730, and 740, which are upper-level layers, with an interface including a function call function for setting and obtaining time values ​​for each time domain, for setting and obtaining offset values, and for setting and obtaining clock modes for each time domain.

[0078] Each Precision Time Protocol (PTP) layer 712 , 722 , 732 , 742 , and 752 may synchronize a reference time t pointed to by hardware clocks between the master node and the slave node.

[0079] Each offset value clock layer 711, 721, 731, and 741 can control the setting and acquisition of offset values ​​(θ1, θ2, ..., θn) for multiple time domains between the master node and the slave node, thereby controlling the setting and acquisition of the clock mode for each time domain associated with the master node and the slave node. In this case, the offset value clock layers 711, 721, 731, and 741 can set the clock mode for each time domain to master mode or slave mode. The setting of the clock mode for each time domain can be independently set regardless of whether the Precision Time Protocol (PTP) layers 712, 722, 732, and 742 are in master / slave mode.

[0080] For example, in the first electronic control unit (ECU_1), which corresponds to the master node, the Precision Time Protocol (PTP) layer 712 may set the Ethernet port GM_P as the master. In this case, although the clock mode of the first time domain of the offset clock layer 711 may be set to the same master mode as the Ethernet port GM_P, the clock mode of the nth time domain may be set to a slave mode different from that of the Ethernet port GM_P.

[0081] Furthermore, in the fourth electronic control unit (ECU_4), which corresponds to a slave node, the Precision Time Protocol (PTP) layer 742 can set the Ethernet port S_P to a slave. In this case, while the clock mode of the first time domain of the offset clock layer 741 can be set to the same slave mode as the Ethernet port S_P, the clock mode of the nth time domain can be set to a master mode different from that of the Ethernet port S_P.

[0082] That is, when synchronizing the time of multiple time domains using the Precision Time Protocol (PTP) layer and the offset value clock layer, the master / slave role of the Precision Time Protocol (PTP) layer and the master / slave role of each time domain in the offset value clock layer can be performed independently.

[0083] Figure 9 This is a flowchart for explaining a method for synchronizing time in multiple time domains between a master node and slave nodes according to another embodiment of the present invention. Figure 9 The actions shown in the figure can be performed by Figure 8 The composition of the execution.

[0084] See Figure 9First, in action S81, the Precision Time Protocol (PTP) layer of the master node transmits the reference time pointed to by the hardware clock of the master node to the Precision Time Protocol (PTP) layer of the slave node, and in action S82, the Precision Time Protocol (PTP) layer of the slave node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node.

[0085] Next, in action S82 , the offset value clock layer of the master node transmits the offset value ( θ1 ) of the first time domain among the multiple time domains to the offset value clock layer of the slave node.

[0086] Finally, in action S83, the offset value (θ1) of the first time domain transmitted to the offset value clock layer of the slave node by the Precision Time Protocol (PTP) layer of the slave node is applied to the reference time pointed to by the hardware clock of the slave node and the time of the first time domain is obtained thereby.

[0087] At this point, the master node's offset value clock layer may additionally transmit the offset value (θ2) of the second time domain to the slave node's offset value clock layer, and the slave node's Precision Time Protocol (PTP) layer may apply the transmitted offset value (θ2) of the second time domain to the reference time indicated by the slave node's hardware clock to thereby obtain the time in the second time domain. Similarly, the time of each time domain may be calculated by applying the offset values ​​of the other time domains in the plurality of time domains other than the first and second time domains.

[0088] As one embodiment, the clock mode of each time domain in the offset value clock layer can be set to master mode or slave mode. In this case, if the clock mode of the first time domain is set to master mode in the offset value clock layer of the master node, the clock mode of the first time domain can be set to slave mode in the offset value clock layer of the slave node. Furthermore, if the clock mode of the nth time domain is set to master mode in the offset value clock layer of the slave node, the clock mode of the nth time domain can be set to slave mode in the offset value clock layer of the master node.

[0089] That is, the master / slave relationship between the Precision Time Protocol (PTP) layer and the offset clock layer does not need to be consistent, but can be set independently of each other.

[0090] As one embodiment, the offset value clock layer can provide the application layer, which is an upper layer equivalent to the offset value clock layer, with an interface for setting and obtaining the time value of each time domain, for setting and obtaining the offset value of each time domain, and for setting and obtaining the clock mode of each time domain.

[0091] For example, when the application layer of the master node calls the setTime(1,T) function, the Precision Time Protocol (PTP) layer of the master node may transmit the time value of the first time domain to the Precision Time Protocol (PTP) layer of the slave node. At this time, when the application layer of the slave node calls the getTime(1) function, the time of the first time domain obtained by the Precision Time Protocol (PTP) layer of the slave node may be returned.

[0092] In addition, when the setOffset(1,θ1) function is called in the offset value clock layer of the master node, the offset value (θ1) of the first time domain can be transmitted to the offset value clock layer of the slave node, and when the getOffset(1) function is called in the offset value clock layer of the slave node, the transmitted offset value (θ1) of the first time domain can be returned.

[0093] In addition, when the setMode(1) function is called in the offset clock layer of the master node, the clock mode of the first time domain can be set to master mode, and the clock mode of the first time domain of the slave node can be set to slave mode. In this case, when the getMode(1) function is called in the offset clock layer, the set clock mode of the first time domain can be returned.

[0094] In addition, the function calls for setting the time value of each time domain and for setting the offset value of each time domain can be executed only when the clock mode of each time domain of the offset value clock layer is the master mode.

[0095] Figure 10 FIG is a hardware configuration diagram of an exemplary computing device that can implement methods applicable to several embodiments of the present invention. Figure 10 As shown, the computing device 100 may include one or more processors 101, a bus 107, a network interface 102, a memory 103 for loading a computer program 105 executed by the processor 101, and a storage device 104 for storing the computer program 105. Figure 10 Only the components related to the embodiments of the present invention are shown in the figure. Therefore, a person skilled in the art should understand that except Figure 10 In addition to the components shown in the figure, other common components may be included.

[0096] For example, the computing device 100 may be a part of an electronic device installed in a car.

[0097] The processor 101 is used to control the overall operation of each component of the computing device 100. For example, the processor 101 may be an electronic control unit (ECU) installed in a car.

[0098] In addition, the processor 101 may also include at least one of a central processing unit (CPU), a microprocessor unit (MCU), a microcontroller unit (MCU), a graphics processing unit (GPU), or any other processor known in the technical field of the present invention. In addition, the processor 101 may execute operations related to at least one application or program for running the methods / actions applicable to various embodiments of the present invention. The computing device 100 may be equipped with more than one processor.

[0099] Memory 103 is used to store various data, instructions, and / or information. Memory 103 can load one or more programs 105 from storage device 104 to execute methods / actions applicable to various embodiments of the present invention. For example, when computer program 105 is loaded into memory 103, logic (or modules) can be implemented on memory 103. An example of memory 103 is random access memory (RAM), but is not limited thereto.

[0100] The bus 107 is used to provide communication between the components of the computing device 100. The bus 107 can be implemented in various forms such as an address bus, a data bus, and a control bus.

[0101] The network interface 102 is used to support wired and wireless Internet communications of the computing device 100. The network interface 102 can support not only Internet communications but also multiple communication modes. To this end, the network interface 102 can include a communication module known in the technical field of the present invention.

[0102] The storage device 104 is used to non-temporarily store one or more computer programs 105. The storage device 104 may include a non-volatile memory such as a flash memory, a hard disk, a removable hard disk, or any other computer-readable storage medium known in the art.

[0103] The computer program 105 may include one or more instructions for implementing methods / actions applicable to various embodiments of the present invention. When the computer program 105 is loaded into the memory 103, the processor 101 may execute the methods / actions applicable to various embodiments of the present invention by executing the one or more instructions.

[0104] As an embodiment, the computer program 105 may include instructions for performing the following actions: an action in which the Precision Time Protocol (PTP) layer of the slave node calculates and stores a propagation delay value generated when sending and receiving messages with the master node; an action in which the Precision Time Protocol (PTP) layer of the master node transmits a reference time pointed to by the hardware clock of the master node to the Precision Time Protocol (PTP) layer of the slave node; an action in which the Precision Time Protocol (PTP) layer of the slave node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; an action in which the Precision Time Protocol (PTP) layer of the master node synchronizes the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node; The Precision Time Protocol (PTP) layer transmits the time value of the first time domain calculated by adding the reference time to the offset value (θ1) of the first time domain among the multiple time domains to the Precision Time Protocol (PTP) layer of the slave node; the Precision Time Protocol (PTP) layer of the slave node calculates the offset value (θ1) of the first time domain using the time value of the first time domain and the stored propagation delay value; and the Precision Time Protocol (PTP) layer of the slave node applies the calculated offset value (θ1) of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain.

[0105] In the above, see Figures 1 to 10 The various embodiments of the present invention and the effects of the embodiments have been described. The effects of applying the technical concept of the present invention are not limited to the effects described above, and those skilled in the art will be able to further clearly understand other effects not described through the following description.

[0106] The technical concept of the present invention described above can be implemented as a computer-readable code on a computer-readable medium. For example, the computer-readable storage medium can be a removable storage medium (such as a CD, DVD, Blu-ray disc, USB storage device, and mobile hard disk) or a fixed storage medium (such as ROM, RAM, and a computer built-in hard disk). The computer program stored on the computer-readable storage medium can be transmitted to other computing devices via a network such as the Internet and installed on the other computing devices, thereby being used on the other computing devices.

[0107] While all process elements constituting the embodiments of the present invention have been described above as being combined into one or a combination of actions, the technical concept of the present invention is not limited to the aforementioned embodiments. Specifically, within the scope of the present invention, the aforementioned components may be selectively combined into one or more to perform an action.

[0108] While the actions are illustrated in the accompanying drawings in a specific order, it should not be understood that the desired results can only be achieved if the actions are performed sequentially or all of the illustrated actions are performed in the specific order or sequence illustrated. In certain circumstances, multitasking and parallel processing may be more advantageous. In particular, with respect to the embodiments described above, the separation of the various components should not be understood as necessarily separating them as described, but rather it should be understood that the described program components and systems can generally be integrated into a single software product or packaged into multiple software products.

[0109] In the above content, the embodiments of the present invention are described with reference to the accompanying drawings. However, persons with general knowledge in the technical field to which the present invention belongs should understand that the present invention can also be implemented in other specific forms without changing its technical concept or essential features. Therefore, the embodiments described in the above content should be understood in all aspects as illustrative purposes only and not limiting. The scope of protection of the present invention should be interpreted by the appended claims, and all technical concepts within the scope of the equivalents thereof should be interpreted as being included within the scope of the claims of the technical concept defined by the present invention.

Claims

1. A method for synchronizing time in multiple time domains, A method for synchronizing time in multiple time domains between a master node and slave nodes includes: The steps of calculating, by the precision time protocol layer of the slave node, a propagation delay value generated when sending and receiving messages with the master node and storing the propagation delay value; The step of transmitting, by the precision time protocol layer of the master node, the reference time pointed to by the hardware clock of the master node to the precision time protocol layer of the slave node; The step of synchronizing the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node by the precision time protocol layer of the slave node; The precision time protocol layer of the master node transmits a time value of a first time domain among the multiple time domains, calculated by adding the reference time to an offset value θ1 of the first time domain, to the precision time protocol layer of the slave node; The precision time protocol layer of the slave node calculates the offset value θ1 of the first time domain by using the time value of the first time domain and the stored propagation delay value; as well as, The precision time protocol layer of the slave node applies the calculated offset value θ1 of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain.

2. The method for synchronizing time in multiple time domains according to claim 1, further comprising: The precision time protocol layer of the master node transmits a time value of a second time domain among the multiple time domains, calculated by adding the reference time to an offset value θ2 of the second time domain, to the precision time protocol layer of the slave node; as well as, The precision time protocol layer of the slave node calculates the offset value θ2 of the second time domain by using the time value of the second time domain and the stored propagation delay value.

3. The method for synchronizing time in multiple time domains according to claim 1, The step of calculating, by the precision time protocol layer of the slave node, a propagation delay value generated when sending and receiving messages with the master node and storing the propagation delay value comprises: The step of transmitting, by the precision time protocol layer of the slave node, a Pdelay_Req signal including information related to the reference time T1 to the master node; Acquiring information related to a reference time T2 at which the precision time protocol layer of the master node receives the Pdelay_Req signal and information related to a reference time T3 at which the precision time protocol layer of the slave node transmits a Pdelay_Resp signal corresponding to the Pdelay_Req signal; The step of acquiring, by the precision time protocol layer of the slave node, information related to the reference time T4 at which the Pdelay_Rest signal is received from the master node; as well as, The step of calculating the propagation delay value by using the difference between the reference times T1 and T4 and the difference between T2 and T3.

4. The method for synchronizing time in multiple time domains according to claim 1, The step of transmitting the time value of the first time domain to the precision time protocol layer of the slave node comprises: The step of transmitting the time value of the first time domain to the precision time protocol layer of the slave node through a Sync data packet and a Follow_up data packet by the precision time protocol layer of the master node.

5. The method for synchronizing time in multiple time domains according to claim 4, The time domain fields of the Sync packet and the Follow_up packet are set to numbers corresponding to the first time domain.

6. The method for synchronizing time in multiple time domains according to claim 1, further comprising: When the offset value θ1 of the first time domain changes, the precision time protocol layer of the master node transmits the time value of the first time domain that applies the changed offset value θ1 to the precision time protocol layer of the slave node through a Sync packet and a Follow_up packet; as well as, The step of calculating, by the precision time protocol layer of the slave node, the offset value of the modified first time domain using the time value of the first time domain and the stored propagation delay value.

7. The method for synchronizing time in multiple time domains according to claim 1, The precision time protocol layer provides an interface for setting and acquiring time values ​​of respective time domains and for setting and acquiring offset values ​​of respective time domains to an application layer corresponding to an upper layer of the precision time protocol layer.

8. The method for synchronizing time in multiple time domains according to claim 7, further comprising: When the application layer of the master node calls the setTime(1,T) function, the precision time protocol layer of the master node transmits the time value T of the first time domain to the precision time protocol layer of the slave node; as well as, When the getTime(1) function is called at the application layer of the slave node, the time in the first time domain obtained in the precision time protocol layer of the slave node is returned.

9. The method for synchronizing time in multiple time domains according to claim 7, further comprising: When the setOffset(1,θ1) function is called at the precision time protocol layer of the master node, the offset value of the first time domain is set to θ1; as well as, When the precision time protocol layer of the slave node calls the getOffset(1) function, the step of returning θ1 calculated using the time value of the first time domain and the stored propagation delay value as the offset value of the first time domain. 10 . The method for synchronizing time in multiple time domains according to claim 1 , wherein the master node and the slave node are an electronic control unit and a network switch, respectively.

11. A computer-readable non-volatile storage medium, A computer program for causing a computer to execute the method according to any one of claims 1 to 10 is stored.

12. A computing device, A computing device for synchronizing time in multiple time domains between a master node and slave nodes, comprising: More than one processor; a communication interface for communicating with an external device; a memory for loading a computer program for execution by the processor; and a storage device for storing the computer program; The computer program includes instructions for performing the following actions: An action of calculating, by the precision time protocol layer of the slave node, a propagation delay value generated when sending and receiving messages with the master node and storing the propagation delay value; The precision time protocol layer of the master node transmits the reference time pointed to by the hardware clock of the master node to the precision time protocol layer of the slave node; An action of synchronizing the hardware clock of the slave node to the reference time pointed to by the hardware clock of the master node by the precision time protocol layer of the slave node; An action of transmitting, by the precision time protocol layer of the master node, a time value of a first time domain among the multiple time domains calculated by adding the reference time to the offset value θ1 of the first time domain, to the precision time protocol layer of the slave node; An action of calculating, by the precision time protocol layer of the slave node, an offset value θ1 of the first time domain using the time value of the first time domain and a stored propagation delay value; and The precision time protocol layer of the slave node applies the calculated offset value θ1 of the first time domain to the reference time pointed to by the hardware clock of the slave node to thereby obtain the time of the first time domain.

Citation Information

Patent Citations

  • Clock synchronization device and method

    CN102104476A

  • Method and apparatus for synchronization of communication node using multiple domains in automotive network

    CN110650175A