Time synchronization method, apparatus and system, device, storage medium, and vehicle

By encapsulating the time synchronization messages sent by the Ethernet switch with the Passive Optical Network Protocol (POP), the time synchronization problem between heterogeneous networks in the vehicle network is solved, and high-precision time synchronization of all nodes in the vehicle under the same clock source is achieved.

WO2025252226A1PCT designated stage Publication Date: 2025-12-11BEIJING CO WHEELS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/099710
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-07
Filing Date
2025-06-06
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

In vehicle network environments, time synchronization cannot be directly achieved between heterogeneous networks (such as Ethernet and passive optical networks), and existing technologies cannot effectively solve this problem.

Method used

Time synchronization messages sent via Ethernet switches are encapsulated in a passive optical network (PON) environment and modified using PON protocols to achieve time synchronization between Ethernet and PON nodes.

Benefits of technology

It achieves high-precision time synchronization of all Ethernet nodes and passive optical network nodes on the vehicle under the same clock source, solving the time alignment problem between heterogeneous networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025099710_11122025_PF_FP_ABST
    Figure CN2025099710_11122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a time synchronization method, apparatus and system, a device, a storage medium, and a vehicle. The method comprises: receiving a first time synchronization packet sent by an Ethernet switch; encapsulating the first time synchronization packet to obtain a third time synchronization packet; and sending the third time synchronization packet to a second electronic control unit in a passive optical network environment.
Need to check novelty before this filing date? Find Prior Art

Description

Time synchronization method, device, system, apparatus, storage medium and vehicle

[0001] Cross-reference to Related Applications

[0002] The present application is based on and claims priority to Chinese Patent Application No. 202410734992.4, filed on June 7, 2024, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD

[0003] The present application belongs to the field of communication technology, and particularly relates to a time synchronization method, device, system, apparatus, storage medium and vehicle. BACKGROUND

[0004] In a vehicle environment, time synchronization between multiple electronic control units (ECU) is crucial. Currently, the network environment of a vehicle is usually an Ethernet environment, and the use of IEEE 1588 or 802.1AS standards can effectively achieve time synchronization between multiple electronic control units.

[0005] With the development of vehicle technology, the network environment of a vehicle can exist heterogeneous networks. Among them, the heterogeneous networks can include Ethernet and passive optical network (PON). Therefore, it is crucial to achieve time synchronization for heterogeneous networks. SUMMARY

[0006] Embodiments of the present application provide a time synchronization method, device, system, apparatus, storage medium and vehicle, which can achieve time synchronization of all Ethernet nodes and passive optical network nodes on a vehicle under the same clock source.

[0007] In a first aspect, embodiments of the present application provide a time synchronization method, which comprises:

[0008] receiving a first time synchronization message sent by an Ethernet switch;

[0009] encapsulating the first time synchronization message to obtain a third time synchronization message;

[0010] sending the third time synchronization message to a second electronic control unit in a passive optical network environment.

[0011] In a possible implementation, the method comprises:

[0012] receive a first time synchronization message sent by an Ethernet switch, the first time synchronization message being a message obtained by the Ethernet switch correcting a time domain of a second time synchronization message sent by a first electronic control unit, the first electronic control unit being an electronic control unit receiving a time service time from a clock source in an Ethernet environment, and the second time synchronization message being a message obtained by the first electronic control unit encapsulating the time service time using a general precise time protocol;

[0013] encapsulate the first time synchronization message using a passive optical network protocol to obtain a third time synchronization message;

[0014] send the third time synchronization message to a second electronic control unit in a passive optical network environment, so that the second electronic control unit performs time synchronization with a third electronic control unit based on the third time synchronization message, the third electronic control unit being an electronic control unit that is in both the Ethernet environment and the passive optical network environment and that has completed time synchronization with the first electronic control unit.

[0015] In a possible implementation, the first time synchronization message includes a first actual time at which the Ethernet switch sends the first time synchronization message, and before the sending of the third time synchronization message to the second electronic control unit in the passive optical network environment, the method includes:

[0016] obtaining an encapsulation duration for encapsulating the first time synchronization message;

[0017] correcting the third time synchronization message using the encapsulation duration to obtain a fourth time synchronization message;

[0018] The sending of the third time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the third time synchronization message, includes:

[0019] sending the fourth time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the fourth time synchronization message.

[0020] In a possible implementation, before the encapsulation of the first time synchronization message using the passive optical network protocol, the method includes:

[0021] obtaining a first link delay of the first time synchronization message from the Ethernet switch to the third electronic control unit;

[0022] The first time synchronization message is modified by using the first link delay to obtain a fifth time synchronization message;

[0023] The first time synchronization message is encapsulated by using the passive optical network protocol to obtain a third time synchronization message, and the method comprises the following steps:

[0024] The fifth time synchronization message is encapsulated by using the passive optical network protocol to obtain the third time synchronization message.

[0025] In a second aspect, the embodiments of the present application provide a time synchronization method, which comprises the following steps:

[0026] A third time synchronization message sent by a third electronic control unit is received, the third electronic control unit being an electronic control unit simultaneously in the Ethernet environment and the passive optical network environment; the third time synchronization message is analyzed to obtain a second actual time when the third electronic control unit sends the third time synchronization message;

[0027] A second link delay of the third time synchronization message from the third electronic control unit to a second electronic control unit is obtained;

[0028] A sum of the second actual time and the second link delay is determined as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0029] In a possible implementation, the method comprises the following steps: a third time synchronization message sent by a third electronic control unit is received, the third time synchronization message being a message obtained by the third electronic control unit encapsulating a first time synchronization message sent by an Ethernet switch by using a passive optical network protocol, the first time synchronization message being a message obtained by the Ethernet switch modifying a time domain of a second time synchronization message sent by a first electronic control unit, the first electronic control unit being an electronic control unit in an Ethernet environment receiving a time of day from a clock source, the second time synchronization message being a message obtained by the first electronic control unit encapsulating the time of day by using a general precise time protocol;

[0030] The third time synchronization message is analyzed to obtain a second actual time when the third electronic control unit sends the third time synchronization message;

[0031] A second link delay of the third time synchronization message from the third electronic control unit to a second electronic control unit is obtained;

[0032] A sum of the second actual time and the second link delay is determined as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0033] In a possible implementation, the parsing of the third time synchronization message comprises:

[0034] In a case where a fourth time synchronization message is received, the fourth time synchronization message is parsed to obtain a second actual time when the third electronic control unit sends the fourth time synchronization message, the fourth time synchronization message being a message obtained by correcting the third time synchronization message by using an encapsulation duration of the first time synchronization message.

[0035] In a possible implementation, the parsing of the fourth time synchronization message comprises:

[0036] The fourth time synchronization message is parsed by using the passive optical network protocol to obtain a sixth time synchronization message;

[0037] The sixth time synchronization message is parsed by using the general precise time protocol to obtain the second actual time.

[0038] In a possible implementation, the obtaining of the second link delay of the third time message from the third electronic control unit to a second electronic control unit comprises:

[0039] Before sending a link delay measurement message to the third electronic control unit, a first time stamp is recorded;

[0040] In a case where the link delay measurement message returned by the third electronic control unit is received, a second time stamp is recorded;

[0041] The second link delay of the third time message from the third electronic control unit to a second electronic control unit is calculated according to the first time stamp and the second time stamp.

[0042] In a third aspect, an embodiment of the present application provides a time synchronization device, which comprises:

[0043] A first receiving module configured to receive a first time synchronization message sent by an Ethernet switch;

[0044] The encapsulation module is configured to encapsulate the first time synchronization message using a passive optical network protocol to obtain a third time synchronization message.

[0045] The sending module is configured to send the third time synchronization message to a second electronic control unit in a passive optical network environment.

[0046] In a possible implementation, the first receiving module is further configured to receive a first time synchronization message sent by an Ethernet switch, the first time synchronization message being a message obtained by correcting a time domain of a second time synchronization message sent by a first electronic control unit by the Ethernet switch, the first electronic control unit being an electronic control unit that receives a time service time from a clock source in an Ethernet environment, and the second time synchronization message being a message obtained by encapsulating the time service time by the first electronic control unit using a general precise time protocol;

[0047] The encapsulation module is further configured to encapsulate the first time synchronization message using a passive optical network protocol to obtain a third time synchronization message.

[0048] The sending module is further configured to send the third time synchronization message to a second electronic control unit in a passive optical network environment, so that the second electronic control unit performs time synchronization with a third electronic control unit based on the third time synchronization message, the third electronic control unit being an electronic control unit that is in both the Ethernet environment and the passive optical network environment and that has completed time synchronization with the first electronic control unit.

[0049] In a fourth aspect, an embodiment of the present application provides a time synchronization device, which comprises:

[0050] The second receiving module is configured to receive a third time synchronization message sent by a third electronic control unit, the third electronic control unit being an electronic control unit that is in both the Ethernet environment and the passive optical network environment.

[0051] The analysis module is configured to analyze the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message.

[0052] The first obtaining module is configured to obtain a second link delay of the third time synchronization message from the third electronic control unit to a second electronic control unit.

[0053] The determination module is configured to determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0054] In a possible implementation, the second receiving module is further configured to receive a third time synchronization message sent by the third electronic control unit, the third time synchronization message being a message obtained by encapsulating a first time synchronization message sent by an Ethernet switch using a passive optical network protocol, the first time synchronization message being a message obtained by correcting a time field of a second time synchronization message sent by a first electronic control unit, the first electronic control unit being an electronic control unit in an Ethernet environment that receives a time service time from a time source, and the second time synchronization message being a message obtained by encapsulating the time service time using a general precise time protocol.

[0055] In a fifth aspect, an embodiment of the present application provides a time synchronization system, which comprises:

[0056] a second electronic control unit, the second electronic control unit being in a passive optical network environment;

[0057] a third electronic control unit, the third electronic control unit being in both an Ethernet environment and the passive optical network environment, and the third electronic control unit being connected with at least one second electronic control unit;

[0058] an Ethernet switch, the Ethernet switch being connected with at least one third electronic control unit;

[0059] The Ethernet switch is configured to send a first time synchronization message to the third electronic control unit.

[0060] The third electronic control unit is configured to encapsulate the first time synchronization message to obtain a third time synchronization message, and send the third time synchronization message to the second electronic control unit.

[0061] The second electronic control unit is configured to analyze the third time synchronization message, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0062] In a possible implementation, the system further comprises:

[0063] a first electronic control unit, the first electronic control unit being in the Ethernet environment, and the first electronic control unit being connected with at least one Ethernet switch;

[0064] The first electronic control unit is configured to send a second time synchronization message to the Ethernet switch, and the Ethernet switch is further configured to correct a time field of the second time synchronization message to obtain the first time synchronization message.

[0065] In a possible implementation, the first electronic control unit is further configured to: receive a time service time from a clock source; and encapsulate the time service time using a general precise time protocol to obtain the second time synchronization message.

[0066] In a possible implementation, the second electronic control unit is further configured to: parse the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message; and,

[0067] obtain a second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit; and,

[0068] determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0069] In a sixth aspect, an embodiment of the present application provides an electronic device, which comprises: a processor and a memory storing computer program instructions;

[0070] The processor implements the method in any possible implementation method of the first aspect and / or the second aspect when executing the computer program instructions.

[0071] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the method in any possible implementation method of the first aspect and / or the second aspect.

[0072] In an eighth aspect, an embodiment of the present application provides a vehicle, which comprises at least one of:

[0073] The time synchronization device in any one of the embodiments of the third aspect;

[0074] The time synchronization device in any one of the embodiments of the fourth aspect;

[0075] The time synchronization system in any one of the embodiments of the fifth aspect;

[0076] The electronic device in any one of the embodiments of the sixth aspect;

[0077] The computer readable storage medium in any one of the embodiments of the seventh aspect.

[0078] In the technical solution of the embodiment of the present application, in the case of receiving the first time synchronization message sent by the Ethernet switch, the first time synchronization message is encapsulated using the passive optical network protocol to obtain a third time synchronization message, and the third time synchronization message is sent to the second electronic control unit in the passive optical network environment, so as to ensure time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, time synchronization is performed in the passive optical network environment based on the first time synchronization message sent by the Ethernet switch, so as to realize time synchronization of all Ethernet nodes and passive optical network nodes on the whole vehicle under the same clock source.

[0079] The first electronic control unit and the Ethernet switch in the time synchronization method, device, system, equipment, storage medium and vehicle of the embodiment of the present application are in an Ethernet environment, and the second electronic control unit is in a passive optical network environment. Therefore, the equipment in communication with the Ethernet switch and the second electronic control unit can be a third electronic control unit in both the Ethernet environment and the passive optical network environment. Since the first electronic control unit is an electronic control unit receiving a time service time from a clock source, the first electronic control unit can be a master node in the Ethernet environment. After the Ethernet switch receives the second time synchronization message sent by the first electronic control unit, the time domain of the second time synchronization message is corrected to obtain the first time synchronization message and send the first time synchronization message to multiple slave nodes (including the third electronic control unit) in the Ethernet environment, so as to ensure time synchronization of multiple Ethernet nodes in the Ethernet environment under the same clock source. In the case of receiving the first time synchronization message, the third electronic control unit encapsulates the first time synchronization message using the passive optical network protocol to obtain a third time synchronization message, and sends the third time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit can perform time synchronization with the third electronic control unit based on the third time synchronization message, and further ensure time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, time synchronization is performed in the Ethernet environment and the passive optical network environment respectively through the third electronic control unit as a bridge, so as to realize time synchronization of all Ethernet nodes and passive optical network nodes on the whole vehicle under the same clock source. BRIEF DESCRIPTION OF DRAWINGS

[0080] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings based on these drawings without creative labor.

[0081] FIG. 1 is a schematic diagram of a vehicle networking structure provided by the embodiment of the present application;

[0082] FIG. 2 is a schematic diagram of time synchronization according to an embodiment of the present application;

[0083] FIG. 3 is a schematic diagram of a time synchronization method applied to a third electronic control unit according to an embodiment of the present application;

[0084] FIG. 4 is a schematic diagram of an Ethernet time synchronization link according to an embodiment of the present application;

[0085] FIG. 5 is a schematic diagram of a time synchronization method applied to a second electronic control unit according to an embodiment of the present application;

[0086] FIG. 6 is a schematic diagram of a passive optical network time synchronization link according to an embodiment of the present application;

[0087] FIG. 7 is a schematic diagram of a time synchronization device applied to a third electronic control unit according to an embodiment of the present application;

[0088] FIG. 8 is a schematic diagram of a time synchronization device applied to a second electronic control unit according to an embodiment of the present application;

[0089] FIG. 9 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0090] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the solutions of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0091] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other different manners from those described herein; obviously, the embodiments described in the specification are only some embodiments of the present application, rather than all the embodiments.

[0092] It should be noted that, in this document, relational terms such as “first” and “second”, and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms “comprises”, “comprising”, “includes”, “including” or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element preceded by “comprises a...” does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the stated elements.

[0093] As described in the section of background, in a vehicle Ethernet network, time synchronization between multiple electronic control units (ECUs) can be effectively implemented using IEEE 1588 or 802.1AS standards. The IEEE 1588 or 802.1AS standards can be based on an Ethernet encapsulated data format for time synchronization. The Ethernet encapsulated data format can be, for example, a data format encapsulated using a generalized Precision Time Protocol (gPTP).

[0094] In addition, in a Passive Optical Network (PON) environment, time synchronization between multiple passive optical nodes can be implemented using a PON protocol. The PON protocol can include an Optical Network Unit Management and Control Interface (OMCI) protocol. The OMCI protocol is a protocol for information interaction between an Optical Line Terminal (OLT) and an Optical Network Unit (ONU).

[0095] With the development of vehicle technology, a network environment (e.g., a vehicle optical communication network) of a vehicle can include a heterogeneous network. The heterogeneous network can include an Ethernet network and a PON network. In a vehicle scenario where an Ethernet network and a PON network are included at the same time, time alignment cannot be directly implemented because the protocols for time synchronization between the Ethernet network and the PON network are different. Therefore, how to implement a time synchronization mechanism based on a gPTP protocol of the IEEE 802.1AS standard and a PON protocol of the PON network is a technical problem to be solved by the present application.

[0096] To solve the technical problems in the prior art, embodiments of the present application provide a time synchronization method, device, equipment, storage medium, and vehicle. The time synchronization method can be applied to a scenario of time synchronization of multiple ECUs in a vehicle network environment. The vehicle network environment can include an Ethernet network structure and a PON network structure at the same time. The Ethernet network structure can be a communication network structure composed of multiple ECU nodes and an Ethernet switch. The PON network structure can be a network structure composed of a splitter, an ECU as an OLT, and multiple ECUs as ONUs. The ECU as the OLT can be directly connected to the switch.

[0097] A schematic diagram of the vehicle networking structure provided by the embodiments of the present application can be shown in FIG. 1. As shown in FIG. 1, the ECU1, ECU2, ECU3 and the Ethernet switch can be in an Ethernet environment. The ECU4 can be in both the Ethernet environment and the passive optical network environment. When the ECU4 is in the Ethernet environment, it can serve as an Ethernet slave node. When the ECU4 is in the passive optical network environment, it can serve as an OLT. In addition, the passive optical network environment can further include an optical splitter and the ECU5, ECU6, ECU7 serving as ONU.

[0098] In an example, the ECU in the vehicle networking structure which is in both the Ethernet environment and the passive optical network environment is not limited to the ECU4, that is, the vehicle networking structure can include at least one ECU in both the Ethernet environment and the passive optical network environment, wherein any one of the ECUs in both the Ethernet environment and the passive optical network environment can serve as an OLT in the passive optical network environment. In order to avoid redundancy, in the technical solutions described later in the present application, only the embodiment in which the ECU4 serves as an OLT is described.

[0099] A schematic diagram of a time synchronization method based on the vehicle networking structure shown in FIG. 1 can be shown in FIG. 2. As shown in FIG. 2, the ECU3 can be a master node receiving time from a clock source, and the ECU3 can be provided with a high-precision real-time clock (RTC). In addition, the clock source can be any one of a global navigation satellite system (GNSS), a global positioning system (GPS) and a network time protocol (NTP).

[0100] As an example, in the Ethernet, an ECU (such as the ECU3) provided with a high-precision RTC can be first selected as a master node (Grant master, GM), and then the clock source can periodically time the GM (i.e. the ECU3). The selection of the clock source can be: first selecting the GNSS as the clock source, if the GNSS is abnormal, selecting the GPS as the clock source, and if the GNSS and the GPS are both abnormal, selecting the NTP as the clock source. After receiving the timing time, the ECU3 can write the timing time (i.e. the real-world time) into the RTC. If the GNS, GPS and NTP are all abnormal or have no signal, the current time of the RTC can be used as the clock source time for subsequent time synchronization.

[0101] In addition, as shown in FIG. 2, in the Ethernet, the ECUs (including the ECU 1, the ECU 2, and the ECU 4) except the ECU 3 can be slave nodes. In the PON network, the ECU 4 can be an OLT node, and the other ECUs (including the ECU 5, the ECU 6, and the ECU 7) can be ONU nodes. As an example, after the ECU 3 receives the time-of-day, the ECU 3 can perform time synchronization on the remaining Ethernet slave nodes (including the ECU 4) based on the Ethernet protocol. After determining the synchronization time of the ECU 4 and the ECU 3, the ONU nodes in the PON network can be time-synchronized based on the PON protocol, so as to achieve high-precision time synchronization of all Ethernet nodes and PON network nodes on the vehicle based on the same clock source.

[0102] In addition, in the case where the ECU 4 is provided with an RTC, the ECU 4 can simultaneously serve as a master node in the Ethernet and an OLT node in the PON network.

[0103] The time synchronization method provided by the embodiment of the present application will be described below.

[0104] FIG. 3 shows a flowchart of a time synchronization method provided by an embodiment of the present application. As shown in FIG. 3, the time synchronization method provided by the embodiment of the present application includes the following steps:

[0105] S310, receiving a first time synchronization message sent by an Ethernet switch.

[0106] S320, encapsulating the first time synchronization message to obtain a third time synchronization message.

[0107] S330, sending the third time synchronization message to a second electronic control unit in a passive optical network environment.

[0108] In the time synchronization method of the embodiment of the present application, in the case where the first time synchronization message sent by the Ethernet switch is received, the first time synchronization message is encapsulated using the passive optical network protocol to obtain the third time synchronization message, and the third time synchronization message is sent to the second electronic control unit in the passive optical network environment, so as to ensure time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, by performing time synchronization in the passive optical network environment based on the first time synchronization message sent by the Ethernet switch, time synchronization of all Ethernet nodes and passive optical network nodes on the vehicle under the same clock source can be achieved.

[0109] Here, the vehicle networking structure of the embodiment of the application includes at least one second electronic control unit in a passive optical network environment, and the number of the second electronic control units is not specifically limited in the embodiment of the application. Correspondingly, S330 can specifically include: sending the third time synchronization message to the at least one second electronic control unit in the passive optical network environment.

[0110] In some embodiments, the time synchronization method can be executed by a third electronic control unit (such as ECU4 shown in FIG. 2). The third electronic control unit can be in both an Ethernet environment and a passive optical network environment.

[0111] Here, ECU4 shown in FIG. 2 is only an example of the third electronic control unit. In the embodiment, the third electronic control unit can be any electronic control unit that is in both the Ethernet environment and the passive optical network environment and directly connected to the Ethernet switch, that is, the vehicle networking structure includes at least one third electronic control unit.

[0112] Correspondingly, the vehicle networking structure includes at least one Ethernet switch, and the number of the Ethernet switches is not specifically limited in the embodiment of the application.

[0113] In some embodiments, the first time synchronization message is a message obtained by correcting the time domain of the second time synchronization message sent by the first electronic control unit to the Ethernet switch.

[0114] In some embodiments, the first electronic control unit is an electronic control unit that receives a time service time from a clock source in the Ethernet environment.

[0115] In some embodiments, the second time synchronization message is a message obtained by encapsulating the time service time by the first electronic control unit using a general precise time protocol.

[0116] Based on this, in some embodiments, S310 can specifically include: receiving the first time synchronization message sent by the Ethernet switch, the first time synchronization message being a message obtained by correcting the time domain of the second time synchronization message sent by the first electronic control unit to the Ethernet switch, the first electronic control unit being an electronic control unit that receives a time service time from a clock source in the Ethernet environment, and the second time synchronization message being a message obtained by encapsulating the time service time by the first electronic control unit using a general precise time protocol.

[0117] S320 can specifically include: encapsulating the first time synchronization message using a passive optical network protocol to obtain the third time synchronization message.

[0118] S330 can specifically include: sending a third time synchronization message to a second electronic control unit in the passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the third time synchronization message, the third electronic control unit being in both the Ethernet environment and the passive optical network environment and being the electronic control unit that has completed time synchronization with the first electronic control unit.

[0119] Here, the first electronic control unit can be the ECU 3 shown in FIG. 2; if the Ethernet environment includes multiple ECUs provided with RTCs, any one of the ECUs provided with RTCs in the Ethernet environment can serve as the first electronic control unit, that is, the vehicle networking structure includes at least one first electronic control unit.

[0120] Here, the time synchronization method described above can be executed by any one of the third electronic control units.

[0121] The time synchronization method of the embodiment of the application is executed by the third electronic control unit, the first electronic control unit and the Ethernet switch in the time synchronization method are in the Ethernet environment, and the second electronic control unit is in the passive optical network environment, so the device that communicates with the Ethernet switch and the second electronic control unit can be the third electronic control unit that is in both the Ethernet environment and the passive optical network environment. Since the first electronic control unit is the electronic control unit that receives the time service time from the clock source, the first electronic control unit can be the master node in the Ethernet environment, and after receiving the second time synchronization message sent by the first electronic control unit, the Ethernet switch corrects the time field of the second time synchronization message to obtain the first time synchronization message and sends the first time synchronization message to multiple slave nodes (including the third electronic control unit) in the Ethernet environment, which can ensure time synchronization of multiple Ethernet nodes in the Ethernet environment under the same clock source. By using the passive optical network protocol to encapsulate the first time synchronization message to obtain the third time synchronization message and sending the third time synchronization message to the second electronic control unit in the passive optical network environment, the second electronic control unit can perform time synchronization with the third electronic control unit based on the third time synchronization message, which can further ensure time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, by taking the third electronic control unit as a bridge to perform time synchronization in the Ethernet environment and the passive optical network environment respectively, time synchronization of all Ethernet nodes and passive optical network nodes on the vehicle under the same clock source can be achieved. The specific implementation of each step is described below.

[0122] In some embodiments, in S310, the first electronic control unit may, for example, be the ECU 3 as shown in FIG. 2. In addition, the general precise time protocol (for example, the gPTP protocol) can include a sync packet. The sync packet can be a time synchronization packet. The packet format of the sync packet can be [ethernet_header | gptp_header | orgin_timestamp]. Wherein, orgin_timestamp = timestamp_seconds + timestamp_nanoseconds, that is, the orgin_timestamp can be composed of seconds and nanoseconds. If the timing time received by the first electronic control unit is denoted as t0, the first electronic control unit can encapsulate t0 using the above packet format to obtain a second time synchronization packet: [ethernet_header | gptp_header | t0], and send the second time synchronization packet to an Ethernet switch (switch).

[0123] After receiving the second time synchronization message, the Ethernet switch can correct the time field of the second time synchronization message to obtain the first time synchronization message, and send the first time synchronization message to the plurality of Ethernet slave nodes (including the third electronic control unit). Specifically, the Ethernet switch can correct the time field of the second time synchronization message by first parsing the second time synchronization message to obtain the actual time t0 of the first electronic control unit when the second time synchronization message is sent, then obtaining the link propagation delay t1 of the second time synchronization message from the first electronic control unit to the Ethernet switch, and the residence time t2 of the second time synchronization message in the Ethernet switch, and then modifying the Field field (orgin_timestamp) in [ethernet_header | gptp_header | t0] to t0+t1+t2, obtaining [ethernet_header | gptp_header | t0+t1+t2], that is, the first time synchronization message. In the first time synchronization message, t0+t1+t2 can be the first actual time of the Ethernet switch when the first time synchronization message is sent. More specifically, the gPTP protocol can also include a peer_pdelayRequest message. The first electronic control unit can also send the peer_pdelayRequest message to the Ethernet switch, and the Ethernet switch can use the peer_pdelayRequest message to calculate the link propagation delay t1 of the first time synchronization message from the first electronic control unit to the Ethernet switch. In addition, the residence time t2 of the second time synchronization message in the Ethernet switch can be the time length between the time when the Ethernet switch receives the second time synchronization message and the time when the Ethernet switch sends the first time synchronization message to the plurality of Ethernet slave nodes.

[0124] In addition, the Ethernet slave node can obtain the link propagation delay t3 of the first time synchronization message from the Ethernet switch to itself, and in the case of receiving the first time synchronization message, the sum of the first actual time t0+t1+t2 carried in the first time synchronization message and t3 can be determined as the actual time t4 of the slave node. Wherein, the way for the slave node to obtain the link propagation delay can be the same as the way for the Ethernet switch to obtain the link propagation delay, which will not be described in detail here. The t3 corresponding to different slave nodes can be the same or different. At this point, the Ethernet all nodes can complete time synchronization.

[0125] As an example, the Ethernet time synchronization link can be as shown in FIG. 4.

[0126] In some embodiments, in S320, the message header of the passive optical network protocol can be OCMI_header, and thus the third time synchronization message format can be [OCMI_header | ethernet_header | gptp_header | orgin_timestamp]. After receiving the first time synchronization message, the third electronic control unit can perform OMCI (ONU Management Control Interface) message encapsulation on the first time synchronization message, i.e., add an OCMI_header message header to the first time synchronization message to obtain the third time synchronization message. If the third electronic control unit directly encapsulates the first time synchronization message after receiving the first time synchronization message, the third time synchronization message can be [OCMI_header | ethernet_header | gptp_header | t0+t1+t2]. If the third electronic control unit receives the first time synchronization message, first obtains the link propagation delay t3 of the first time synchronization message, and then calculates the actual time t4=t0+t1+t2+t3 of itself, the third time synchronization message can be [OCMI_header | ethernet_header | gptp_header | t4].

[0127] Based on this, in order to improve the accuracy of subsequent time synchronization of the passive optical network node, in some embodiments, before the above S320, the following steps can also be included:

[0128] Obtaining a first link delay during transmission of the first time synchronization message.

[0129] Using the first link delay to modify the first time synchronization message to obtain a fifth time synchronization message.

[0130] In some embodiments, obtaining the first link delay during transmission of the first time synchronization message can specifically include:

[0131] Obtaining a first link delay of the first time synchronization message from the Ethernet switch to the third electronic control unit.

[0132] Based on this, the above S320 can specifically include:

[0133] Encapsulating the fifth time synchronization message to obtain the third time synchronization message. In some embodiments, the above S320 can specifically include:

[0134] Encapsulating the fifth time synchronization message using the passive optical network protocol to obtain the third time synchronization message.

[0135] Here, the first link delay can be t3. The third electronic control unit can obtain the first link delay in the manner described above, which will not be described in detail here. Since the first actual time can be t0+t1+t2, the first link delay can be t3, the first time synchronization message can be [ethernet_header|gptp_header|t0+t1+t2], t4=t0+t1+t2+t3, therefore, the fifth time synchronization message can be [ethernet_header|gptp_header|t4], and the third time synchronization message can be [OCMI_header|ethernet_header|gptp_header|t4].

[0136] In this way, since the first link delay of the first time synchronization message from the Ethernet switch to the third electronic control unit is included in the fifth time synchronization message, by encapsulating the fifth time synchronization message using the passive optical network protocol to obtain the third time synchronization message, the accuracy of the time in the third time synchronization message can be ensured, and the precision of subsequent time synchronization of the passive optical network nodes (including the second electronic control unit) can be improved.

[0137] In some embodiments, in S330, the third electronic control unit can have completed time synchronization with the first electronic control unit. In addition, the second electronic control unit can be one or multiple. The multiple second electronic control units can include ECU5, ECU6, and ECU7. The third electronic control unit can perform time synchronization with the multiple second electronic devices in a periodic broadcast manner. The third electronic control unit as the OLT can be an active logical component PON MAC, and the part from the OLT to the ONU (second electronic control unit) can be a passive communication component. In addition, the period of the periodic broadcast can be the same as the gPTP sync message period of the Ethernet. That is, after receiving the sync Ethernet message, the third electronic control unit can immediately perform encapsulation processing thereon, and broadcast and send the third time synchronization message after the encapsulation processing to the second electronic control unit.

[0138] After receiving the third time synchronization message, the second electronic control unit can first analyze the third time synchronization message to determine the second actual time when the third electronic control unit sends the third time synchronization message, and then obtain the second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit, and determine the sum of the second actual time and the second link delay as the third actual time of the second electronic control unit, so as to complete time synchronization with the third electronic control unit.

[0139] In addition, since the encapsulation of the first time synchronization message has an encapsulation duration, in order to further improve the accuracy of subsequent time synchronization of the passive optical network node, in some embodiments, before the above S330, the method further includes:

[0140] obtaining an encapsulation duration of the encapsulation of the first time synchronization message;

[0141] correcting the third time synchronization message by using the encapsulation duration to obtain a fourth time synchronization message.

[0142] Based on this, the above S330 can specifically include:

[0143] sending the fourth time synchronization message to a second electronic control unit in a passive optical network environment.

[0144] In some embodiments, the above S330 can specifically include:

[0145] sending the fourth time synchronization message to a second electronic control unit in a passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the fourth time synchronization message.

[0146] Here, the encapsulation duration can be denoted as Δt. After receiving the third time synchronization message, the third electronic control unit can perform local compensation calculation before broadcasting the fourth time synchronization message to the second electronic control unit to obtain Δt. The fourth time synchronization message can be [OCMI_header|ethernet_header|gptp_header|t4+Δt].

[0147] As an example, if the third electronic control unit is ECU4, ECU4 can perform local compensation calculation on the sync message before OMCI broadcast to obtain Δt. The calculation method of Δt can be as follows: Δt = ECU4 current system time - t4, that is, the time consumed by the sync message after PON encapsulation processing.

[0148] In this way, by sending the fourth time synchronization message carrying the encapsulation time to the second electronic control unit in the passive optical network environment, the accuracy of the time in the fourth time synchronization message can be ensured, and the accuracy of subsequent time synchronization of the passive optical network node (including the second electronic control unit) can be further improved.

[0149] FIG. 5 shows a flowchart of a time synchronization method according to an embodiment of the present application. As shown in FIG. 5, the time synchronization method according to an embodiment of the present application includes steps S510 to S540. Specifically:

[0150] S510, receiving a third time synchronization message sent by a third electronic control unit, the third electronic control unit being an electronic control unit which is simultaneously in the Ethernet environment and the passive optical network environment.

[0151] In some embodiments, the time synchronization method can be performed by the aforementioned second electronic control unit (e.g., ECU5, ECU6 or ECU7 as shown in FIG. 2). The second electronic control unit can be in the passive optical network environment.

[0152] Based on this, S510 can specifically include: receiving a third time synchronization message sent by a third electronic control unit, the third time synchronization message being a message obtained by encapsulating, by the third electronic control unit, a first time synchronization message sent by an Ethernet switch using a passive optical network protocol, the first time synchronization message being a message obtained by correcting, by the Ethernet switch, a time domain of a second time synchronization message sent by a first electronic control unit, the first electronic control unit being an electronic control unit which receives a time-of-day from a clock source in the Ethernet environment, and the second time synchronization message being a message obtained by encapsulating, by the first electronic control unit, the time-of-day using a general precise time protocol.

[0153] S520, analyzing the third time synchronization message to obtain a second actual time at which the third electronic control unit sends the third time synchronization message.

[0154] The third time synchronization message can carry the second actual time at which the third electronic control unit sends the third time synchronization message. If the third time synchronization message is [OCMI_header | ethernet_header | gptp_header | t0+t1+t2], the second actual time can be t0+t1+t2. If the third time synchronization message is [OCMI_header | ethernet_header | gptp_header | t4], the second actual time can be t4.

[0155] As an example, analyzing the third time synchronization message can include: first performing message analysis on the third time synchronization message using the passive optical network protocol to obtain an intermediate time synchronization message, and then performing time analysis on the intermediate time synchronization message using the general precise time protocol to obtain the second actual time.

[0156] For example, if the third time synchronization message is [OCMI_header | ethernet_header | gptp_header | t4], the intermediate time synchronization message can be [ethernet_header | gptp_header | t4], and the second actual time can be t4.

[0157] Based on this, in order to ensure the accuracy of time synchronization, in some embodiments, S520 can specifically include:

[0158] In the case of receiving the fourth time synchronization message, the fourth time synchronization message is parsed to obtain the second actual time when the third electronic control unit sends the fourth time synchronization message. The fourth time synchronization message is a message obtained by the third electronic control unit correcting the third time synchronization message using the encapsulation duration of the first time synchronization message.

[0159] Here, if the time synchronization message received by the second electronic device is the fourth time synchronization message, the fourth time synchronization message can be parsed to obtain the second actual time.

[0160] In some embodiments, the fourth time synchronization message is parsed to obtain the second actual time when the third electronic control unit sends the fourth time synchronization message, which can specifically include:

[0161] The fourth time synchronization message is parsed using a passive optical network protocol to obtain a sixth time synchronization message;

[0162] The sixth time synchronization message is time parsed using a general precise time protocol to obtain the second actual time.

[0163] Here, the fourth time synchronization message can be an OCMI message, and parsing the fourth time synchronization message using a passive optical network protocol can determine the sync message from the OCMI message. That is, the sixth time synchronization message can be a sync message. As described above, the fourth time synchronization message can be [OCMI_header|ethernet_header|gptp_header|t4+Δt], and the sixth time synchronization message obtained after message parsing can be [ethernet_header|gptp_header|t4+Δt].

[0164] In addition, time parsing the sixth time synchronization message using a general precise time protocol can be to obtain the data of the time field part from the sync message to obtain the second actual time t4+Δt.

[0165] In this way, by parsing the fourth time synchronization message carrying the second actual time to obtain the second actual time including the encapsulation duration, the accuracy of the second actual time can be ensured, and the accuracy of time synchronization can be ensured.

[0166] S530, obtaining a second link delay of the third time synchronization message transmitted from the third electronic control unit to the second electronic control unit.

[0167] Here, the second electronic control unit can actively request the third electronic control unit to perform the measurement of the link delay, and obtain the second link delay. The second link delays corresponding to different second electronic control units can be different.

[0168] In some embodiments, the above S530 can specifically include:

[0169] Before sending the link delay measurement packet to the third electronic control unit, record the first time stamp;

[0170] In the case where the link delay measurement packet returned by the third electronic control unit is received, record the second time stamp;

[0171] According to the first time stamp and the second time stamp, determine the second link delay of the third time packet from the third electronic control unit to the second electronic control unit.

[0172] Here, the link delay measurement packet can be a packet specially used for measuring the link delay. That is, in the process of measuring the link delay, attention can be paid to the transmission process of the link delay measurement packet, and the content of the link delay measurement packet does not need to be paid attention to. In addition, the first time stamp can be denoted as t1', and the second time stamp can be denoted as t2'.

[0173] As an example, after receiving the link delay measurement packet sent by the third electronic control unit, the third electronic control unit can immediately return the link delay measurement packet. The second electronic control unit can record the time stamp t1' when the link delay measurement packet is sent and the time stamp t2' when the link delay measurement packet is received, and calculate the second link delay t5=(t2'-t1') / 2.

[0174] S540, determine the sum of the second actual time and the second link delay as the third actual time of the second electronic control unit, so that the second electronic control unit completes the time synchronization with the third electronic control unit.

[0175] If the second actual time is t4+Δt, and the second link delay is t5, then the third actual time of the second electronic control unit locally can be t6=t4+Δt+t5. After determining the third actual time, the time synchronization between the second electronic control unit and the third electronic control unit can be completed.

[0176] In the time synchronization method of the embodiments of the present application, the third time synchronization message sent by the third electronic control unit is received, the third time synchronization message is parsed, the second actual time is obtained, the second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit is acquired, and the sum of the second actual time and the second link delay is determined as the third actual time of the second electronic control unit. The second electronic control unit can perform time synchronization with the third electronic control unit based on the third time synchronization message, and the time synchronization of the multiple passive optical nodes in the passive optical network environment under the same clock source can be ensured. In this way, the time synchronization of all Ethernet nodes and passive optical network nodes on the whole vehicle under the same clock source can be realized by taking the third electronic control unit as a bridge to perform time synchronization in the Ethernet environment and the passive optical network environment respectively.

[0177] The time synchronization method of the embodiment of the application is executed by the second electronic control unit, the first electronic control unit and the Ethernet switch in the time synchronization method are in an Ethernet environment, and the second electronic control unit is in a passive optical network environment, so the device in communication with the Ethernet switch and the second electronic control unit can be a third electronic control unit in both the Ethernet environment and the passive optical network environment. Since the first electronic control unit is an electronic control unit receiving a time service time from a clock source, the first electronic control unit can be a master node in the Ethernet environment, and after receiving the second time synchronization message sent by the first electronic control unit, the time domain of the second time synchronization message is corrected through the Ethernet switch to obtain the first time synchronization message and send the first time synchronization message to a plurality of slave nodes (including the third electronic control unit) in the Ethernet environment, so that the plurality of Ethernet nodes in the Ethernet environment can be time-synchronized under the same clock source. Since the third time synchronization message is a message obtained by encapsulating the first time synchronization message sent by the Ethernet switch by the third electronic control unit using a passive optical network protocol, the time synchronization between the plurality of nodes in the Ethernet environment and the passive optical network environment can be realized through the third time synchronization message. Specifically, the second actual time is obtained by receiving the third time synchronization message sent by the third electronic control unit through the second electronic control unit, analyzing the third time synchronization message, obtaining the second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit, and determining the sum of the second actual time and the second link delay as the third actual time of the second electronic control unit, so that the second electronic control unit can be time-synchronized with the third electronic control unit based on the third time synchronization message, and the time synchronization of the plurality of passive optical nodes in the passive optical network environment under the same clock source can be ensured. In this way, the time synchronization of all Ethernet nodes and passive optical network nodes on the whole vehicle under the same clock source can be realized by time-synchronizing the Ethernet environment and the passive optical network environment through the third electronic control unit as a bridge.

[0178] In order to better describe the whole scheme, based on the above embodiments, some specific examples are given.

[0179] For example, based on the time synchronization between a plurality of nodes in the Ethernet, a schematic diagram of a passive optical network time synchronization link can be as shown in FIG. 6. The ECU4 can be provided with an RTC.

[0180] Therefore, according to the embodiment of the application, for the heterogeneous networking of the Ethernet and the PON network, a whole vehicle time synchronization mechanism under a heterogeneous communication mechanism, i.e., the time synchronization mechanism of gPTP over PON OMCI, is realized by combining the characteristics of the gPTP protocol and the characteristics of the PON network, so that the time synchronization of all Ethernet nodes and passive optical network nodes on the whole vehicle under the same clock source can be ensured.

[0181] Based on the time synchronization method provided in the above embodiments, the application also provides a specific implementation of a time synchronization device. Please refer to the following embodiments.

[0182] As shown in FIG. 7, the time synchronization device 700 applied to the third electronic control unit provided in the embodiments of the application includes the following modules:

[0183] The first receiving module 710 is configured to receive the first time synchronization message sent by the Ethernet switch.

[0184] The packaging module 720 is configured to package the first time synchronization message to obtain a third time synchronization message.

[0185] The sending module 730 is configured to send the third time synchronization message to the second electronic control unit in the passive optical network environment. The above time synchronization device 700 is described in detail as follows:

[0186] In some embodiments, the first receiving module 710 is further configured to receive the first time synchronization message sent by the Ethernet switch, and the first time synchronization message is a message obtained by the Ethernet switch correcting the time domain of the second time synchronization message sent to the first electronic control unit, the first electronic control unit is an electronic control unit receiving a time service time from a clock source in the Ethernet environment, and the second time synchronization message is a message obtained by the first electronic control unit packaging the time service time using the general precise time protocol.

[0187] The packaging module 720 is further configured to package the first time synchronization message using the passive optical network protocol to obtain the third time synchronization message.

[0188] The sending module 730 is further configured to send the third time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the third time synchronization message, and the third electronic control unit is an electronic control unit that is in both the Ethernet environment and the passive optical network environment and completes time synchronization with the first electronic control unit.

[0189] In some embodiments, the first time synchronization message includes a first actual time when the Ethernet switch sends the first time synchronization message. Based on this, the time synchronization device 700 can further include:

[0190] The second obtaining module is configured to obtain a packaging duration of the first time synchronization message before sending the third time synchronization message to the second electronic control unit in the passive optical network environment.

[0191] The first correction module is configured to correct the third time synchronization message by using the packaging time length, to obtain a fourth time synchronization message. Based on this, the sending module 730 can specifically include:

[0192] The sending sub-module is configured to send the fourth time synchronization message to the second electronic control unit in the passive optical network environment.

[0193] Here, the sending sub-module is further configured to send the fourth time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit performs time synchronization with the third electronic control unit based on the fourth time synchronization message.

[0194] In some embodiments, the time synchronization device 700 can further include a third acquisition module configured to acquire a first link delay in the transmission of the first time synchronization message before the first time synchronization message is packaged.

[0195] The second correction module is configured to correct the first time synchronization message by using the first link delay, to obtain a fifth time synchronization message.

[0196] Here, the third acquisition module is further configured to acquire the first link delay of the first time synchronization message from the Ethernet switch to the third electronic control unit before the first time synchronization message is packaged using the passive optical network protocol.

[0197] Based on this, the packaging module 720 can specifically include:

[0198] The packaging sub-module is configured to package the fifth time synchronization message to obtain the third time synchronization message.

[0199] The packaging sub-module is further configured to package the fifth time synchronization message using the passive optical network protocol to obtain the third time synchronization message.

[0200] The first electronic control unit and the Ethernet switch in the time synchronization device are in an Ethernet environment, and the second electronic control unit is in a passive optical network environment. Therefore, the device in communication with the Ethernet switch and the second electronic control unit can be a third electronic control unit in both the Ethernet environment and the passive optical network environment. Since the first electronic control unit is an electronic control unit receiving a time service time from a clock source, the first electronic control unit can be a master node in the Ethernet environment. After receiving a second time synchronization message sent by the first electronic control unit, the Ethernet switch corrects a time field of the second time synchronization message to obtain a first time synchronization message and sends the first time synchronization message to multiple slave nodes (including the third electronic control unit) in the Ethernet environment, thereby ensuring time synchronization of multiple Ethernet nodes in the Ethernet environment under the same clock source. When receiving the first time synchronization message, the third electronic control unit encapsulates the first time synchronization message using a passive optical network protocol to obtain a third time synchronization message and sends the third time synchronization message to the second electronic control unit in the passive optical network environment, so that the second electronic control unit can synchronize time with the third electronic control unit based on the third time synchronization message, thereby ensuring time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, time synchronization of all Ethernet nodes and passive optical nodes on the whole vehicle under the same clock source can be achieved by using the third electronic control unit as a bridge to synchronize time in the Ethernet environment and the passive optical network environment.

[0201] As shown in FIG. 8, the time synchronization device 800 applied to the third electronic control unit provided by the embodiment of the present application includes the following modules:

[0202] The second receiving module 810 is configured to receive a third time synchronization message sent by the third electronic control unit, and the third electronic control unit is an electronic control unit in both the Ethernet environment and the passive optical network environment;

[0203] The analysis module 820 is configured to analyze the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message;

[0204] The first obtaining module 830 is configured to obtain a second link delay of the third time synchronization message transmitted from the third electronic control unit to the second electronic control unit;

[0205] The determination module 840 is configured to determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so as to complete time synchronization of the second electronic control unit with the third electronic control unit.

[0206] The time synchronization device 800 is described in detail as follows.

[0207] In some embodiments, the second receiving module 810 is further configured to receive a third time synchronization message sent by the third electronic control unit, the third time synchronization message being a message obtained by encapsulating a first time synchronization message sent by an Ethernet switch using a passive optical network protocol by the third electronic control unit, the first time synchronization message being a message obtained by correcting a time field of a second time synchronization message sent by a first electronic control unit by the Ethernet switch, the first electronic control unit being an electronic control unit receiving a time service time from a clock source in an Ethernet environment, and the second time synchronization message being a message obtained by encapsulating the time service time using a general precise time protocol by the first electronic control unit.

[0208] In some embodiments, the analyzing module 820 can specifically include:

[0209] The analyzing submodule is configured to, in a case where the fourth time synchronization message is received, analyze the fourth time synchronization message to obtain the second actual time when the third electronic control unit sends the fourth time synchronization message, the fourth time synchronization message being a message obtained by correcting the third time synchronization message by the third electronic control unit using an encapsulation duration of the first time synchronization message.

[0210] In some embodiments, the analyzing submodule can specifically include:

[0211] The first analyzing unit is configured to analyze the fourth time synchronization message using a passive optical network protocol to obtain a sixth time synchronization message.

[0212] The second analyzing unit is configured to analyze the sixth time synchronization message using a general precise time protocol to obtain the second actual time.

[0213] In some embodiments, the first analyzing unit is further configured to analyze the third time synchronization message using a passive optical network protocol to obtain an intermediate time synchronization message.

[0214] The second analyzing unit is further configured to analyze the intermediate time synchronization message using a general precise time protocol to obtain the second actual time.

[0215] In some embodiments, the first obtaining module 830 can specifically include:

[0216] The first recording submodule is configured to record the first time stamp before sending the link delay measurement message to the third electronic control unit.

[0217] a second recording submodule configured to record a second time stamp in a case where the third electronic control unit returns a link delay measurement message;

[0218] a calculating submodule configured to calculate a second link delay of the third time message from the third electronic control unit to the second electronic control unit according to the first time stamp and the second time stamp.

[0219] The first electronic control unit and the Ethernet switch in the time synchronization device are in an Ethernet environment, and the second electronic control unit is in a passive optical network environment. Therefore, the device in communication with the Ethernet switch and the second electronic control unit can be a third electronic control unit in both the Ethernet environment and the passive optical network environment. Since the first electronic control unit is an electronic control unit receiving a time service from a clock source, the first electronic control unit can be a master node in the Ethernet environment. After receiving the second time synchronization message sent by the first electronic control unit, the Ethernet switch corrects the time field of the second time synchronization message to obtain the first time synchronization message and sends the first time synchronization message to multiple slave nodes (including the third electronic control unit) in the Ethernet environment, which can ensure time synchronization of multiple Ethernet nodes in the Ethernet environment under the same clock source. Since the third time synchronization message is a message obtained by encapsulating the first time synchronization message sent by the Ethernet switch by the third electronic control unit using a passive optical network protocol, the third time synchronization message can be used to realize time synchronization between multiple nodes in the Ethernet environment and the passive optical network environment. Specifically, the second electronic control unit receives the third time synchronization message sent by the third electronic control unit, analyzes the third time synchronization message to obtain a second actual time, acquires a second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit, and determines the sum of the second actual time and the second link delay as a third actual time of the second electronic control unit. This enables the second electronic control unit to synchronize time with the third electronic control unit based on the third time synchronization message, and further ensures time synchronization of multiple passive optical nodes in the passive optical network environment under the same clock source. In this way, time synchronization of all Ethernet nodes and passive optical nodes on the vehicle under the same clock source can be realized by using the third electronic control unit as a bridge to synchronize time in the Ethernet environment and the passive optical network environment.

[0220] Based on the time synchronization method provided in the above embodiment, the present embodiment further provides a specific implementation of a time synchronization system.

[0221] The time synchronization system comprises a second electronic control unit, a third electronic control unit and an Ethernet switch. The second electronic control unit is in a passive optical network environment; the third electronic control unit is in both an Ethernet environment and a passive optical network environment, and is connected with at least one second electronic control unit; and the Ethernet switch is connected with at least one third electronic control unit.

[0222] The Ethernet switch is configured to send a first time synchronization message to the third electronic control unit; the third electronic control unit is configured to encapsulate the first time synchronization message to obtain a third time synchronization message, and send the third time synchronization message to the second electronic control unit; and the second electronic control unit is configured to analyze the third time synchronization message, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0223] In some embodiments, the system further comprises a first electronic control unit. The first electronic control unit is in an Ethernet environment, and is connected with at least one Ethernet switch.

[0224] The first electronic control unit is configured to send a second time synchronization message to the Ethernet switch; and the Ethernet switch is further configured to correct a time field of the second time synchronization message to obtain the first time synchronization message.

[0225] In some embodiments, the first electronic control unit is further configured to receive a time service time from a clock source, and encapsulate the time service time by using a general precise time protocol to obtain the second time synchronization message.

[0226] In some embodiments, the second electronic control unit is further configured to analyze the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message, obtain a second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit, and determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

[0227] In some embodiments, the third electronic control unit is further configured to obtain a first link delay of the first time synchronization message from the Ethernet switch to the third electronic control unit, and correct the first time synchronization message by using the first link delay to obtain a fifth time synchronization message.

[0228] In some embodiments, the third electronic control unit is further configured to encapsulate the fifth time synchronization message by the third electronic control unit to obtain the third time synchronization message.

[0229] In some embodiments, the first time synchronization message includes a first actual time when the Ethernet switch sends the first time synchronization message, and the third electronic control unit is further configured to determine its own actual time based on the first link delay and the first actual time, so as to synchronize the time of the third electronic control unit with the first electronic control unit.

[0230] In some embodiments, the third electronic control unit is further configured to obtain an encapsulation duration of encapsulating the first time synchronization message, and correct the third time synchronization message by using the encapsulation duration to obtain a fourth time synchronization message, and send the fourth time synchronization message to the second electronic control unit in the passive optical network environment.

[0231] In some embodiments, the second electronic control unit is further configured to, in a case where the fourth time synchronization message is received, parse the fourth time synchronization message to obtain a second actual time when the third electronic control unit sends the fourth time synchronization message.

[0232] In some embodiments, the second electronic control unit is further configured to parse the fourth time synchronization message by using the passive optical network protocol to obtain a sixth time synchronization message, and parse the sixth time synchronization message by using the general precise time protocol to obtain the second actual time.

[0233] In some embodiments, the second electronic control unit is further configured to parse the third time synchronization message by using the passive optical network protocol to obtain an intermediate time synchronization message, and parse the intermediate time synchronization message by using the general precise time protocol to obtain the second actual time.

[0234] In some embodiments, the second electronic control unit is further configured to record a first time stamp before sending the link delay measurement message to the third electronic control unit, and record a second time stamp in a case where the link delay measurement message returned by the third electronic control unit is received, and calculate the second link delay of the third time message from the third electronic control unit to the second electronic control unit according to the first time stamp and the second time stamp.

[0235] In an example, the time synchronization system can include the vehicle networking structure shown in FIG. 2, wherein the first electronic control unit can include the ECU3 shown in FIG. 2, the second electronic control unit can include the ECU5, the ECU6 and the ECU7 shown in FIG. 2, and the third electronic control unit can include the ECU4 shown in FIG. 2.

[0236] Based on the time synchronization method provided in the above embodiments, the present application further provides a specific implementation of an electronic device. FIG. 9 shows a schematic diagram of an electronic device 900 provided by an embodiment of the present application.

[0237] The electronic device 900 can include a processor 910 and a memory 920 storing computer program instructions.

[0238] In particular, the processor 910 described above can include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits that embody the embodiments of the present application.

[0239] The memory 920 can include a mass storage for data or instructions. By way of example and not limitation, the memory 920 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc, a magneto-optical disc, magnetic tape, or a Universal Serial Bus (USB) drive or a combination of two or more of these. The memory 920 can be removable and / or non-removable (or fixed) as appropriate. The memory 920 can be internal or external to the electronic device 900 as appropriate. In a particular embodiment, the memory 920 is a non-volatile solid-state memory.

[0240] The memory can include read-only memory (ROM), random-access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software that, when executed (by one or more processors), is operable to perform operations described with reference to the method according to the first aspect of the present application.

[0241] The processor 910 implements any one of the time synchronization methods described above by reading and executing the computer program instructions stored in the memory 920.

[0242] In one example, the electronic device 900 can further include a communication interface 930 and a bus 940. As shown in FIG. 9, the processor 910, the memory 920, and the communication interface 930 are connected through the bus 940 and complete communication therebetween.

[0243] The communication interface 930 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.

[0244] Bus 940 includes a hardware, software, or both, that couples electronic devices to each other. By way of example, and not limitation, the bus can include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 940 can include one or more buses. Although the example embodiments described and illustrated herein relate to a particular bus, the application contemplates any suitable bus or interconnect.

[0245] By way of example, the electronic device 900 can be a mobile phone, a tablet computer, a notebook computer, a palm computer, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc.

[0246] The electronic device can execute the time synchronization method in the embodiments of the application, thereby implementing the time synchronization method and apparatus described in combination with FIG. 1 to FIG. 8.

[0247] In addition, in combination with the time synchronization method in the above embodiments, the embodiments of the application can provide a computer readable storage medium to implement. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to implement any one of the time synchronization methods in the above embodiments.

[0248] In addition, the embodiments of the application also provide a vehicle, which can include at least one of the following:

[0249] The time synchronization apparatus in any one of the embodiments of the third aspect;

[0250] The time synchronization apparatus in any one of the embodiments of the fourth aspect;

[0251] The time synchronization system in any one of the embodiments of the fifth aspect;

[0252] The electronic device in any one of the embodiments of the sixth aspect;

[0253] The computer readable storage medium in any one of the embodiments of the seventh aspect. Details are not repeated here.

[0254] It is to be understood that the application is not limited to particular configurations and processes described herein and shown in the drawings. The detailed description is not to be taken as limiting the application. In the above embodiments, several specific steps are described and illustrated in order to provide a thorough understanding of the application. However, the application can be practiced with fewer or additional steps, and in a different order. The application is not limited to the described and illustrated embodiments.

[0255] The functions of the elements shown in the structural block diagrams described above can be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be implemented in, for example, an electronic circuit, a dedicated ASIC, appropriate firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transfer information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranet, or the like.

[0256] It is also to be understood that the example embodiments described herein are based on a series of steps or apparatuses to describe some methods or systems. However, the application is not limited to the order of the steps described above, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.

[0257] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing devices to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing devices to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks.

[0258] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and the corresponding processes in the foregoing method embodiments can be referred to, which will not be described herein again. It should be understood that the protection scope of the present application is not limited in this way, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered in the protection scope of the present application.

Claims

1. A time synchronization method, comprising: receiving a first time synchronization message sent by an Ethernet switch; encapsulating the first time synchronization message to obtain a third time synchronization message; sending the third time synchronization message to a second electronic control unit in a passive optical network environment.

2. The method of claim 1, wherein, Before the sending of the third time synchronization message to the second electronic control unit in the passive optical network environment, the method comprises: obtaining an encapsulation duration for the encapsulation of the first time synchronization message; correcting the third time synchronization message by using the encapsulation duration to obtain a fourth time synchronization message; the sending of the third time synchronization message to the second electronic control unit in the passive optical network environment comprises: sending the fourth time synchronization message to the second electronic control unit in the passive optical network environment.

3. The method of claim 1 or 2, wherein, Before the encapsulation of the first time synchronization message, the method comprises: obtaining a first link delay when the first time synchronization message is transmitted; correcting the first time synchronization message by using the first link delay to obtain a fifth time synchronization message; the encapsulation of the first time synchronization message to obtain the third time synchronization message comprises: encapsulating the fifth time synchronization message to obtain the third time synchronization message.

4. The method of any one of claims 1-3, wherein, The first time synchronization message is a message obtained by correcting a time domain of a second time synchronization message sent by the Ethernet switch to a first electronic control unit.

5. The method of claim 4, wherein, The first electronic control unit is an electronic control unit that receives a time service time from a clock source in an Ethernet environment; or, the second time synchronization message is a message obtained by encapsulating the time service time by using a general precise time protocol by the first electronic control unit. 6.A time synchronization method, comprising: receiving a third time synchronization message sent by a third electronic control unit, the third electronic control unit being an electronic control unit in both the Ethernet environment and the passive optical network environment; analyzing the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message; obtaining a second link delay of the third time synchronization message when transmitted from the third electronic control unit to a second electronic control unit; determining a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

7. The method of claim 6, wherein, The analyzing of the third time synchronization message to obtain the second actual time when the third electronic control unit sends the third time synchronization message comprises: in a case where a fourth time synchronization message is received, analyzing the fourth time synchronization message to obtain the second actual time when the third electronic control unit sends the fourth time synchronization message, the fourth time synchronization message being a message obtained by correcting the third time synchronization message by using an encapsulation duration of the first time synchronization message by the third electronic control unit.

8. The method of claim 7, wherein, The analyzing of the fourth time synchronization message comprises: The fourth time synchronization message is analyzed by using the PON protocol to obtain a sixth time synchronization message; The sixth time synchronization message is analyzed by using the IEEE 1588 protocol to obtain the second actual time.

9. The method of any one of claims 5-8, wherein, The analyzing of the third time synchronization message comprises: The third time synchronization message is analyzed by using the PON protocol to obtain an intermediate time synchronization message; The intermediate time synchronization message is analyzed by using the IEEE 1588 protocol to obtain the second actual time.

10. The method of any one of claims 5-9, wherein, The obtaining of the second link delay of the third time message from the third electronic control unit to the second electronic control unit comprises: A first time stamp is recorded before a link delay measurement message is sent to the third electronic control unit; A second time stamp is recorded when the link delay measurement message returned by the third electronic control unit is received; The second link delay of the third time message from the third electronic control unit to the second electronic control unit is calculated according to the first time stamp and the second time stamp.

11. The method of any one of claims 6-10, wherein, The third time synchronization message is a message obtained by encapsulating a first time synchronization message sent by an Ethernet switch by the third electronic control unit.

12. A time synchronization device, the device comprising: a first receiving module configured to receive a first time synchronization message sent by an Ethernet switch; an encapsulating module configured to encapsulate the first time synchronization message to obtain a third time synchronization message; a sending module configured to send the third time synchronization message to a second electronic control unit in a PON environment.

13. A time synchronization device, the device comprising: a second receiving module configured to receive a third time synchronization message sent by a third electronic control unit, the third electronic control unit being an electronic control unit in both an Ethernet environment and a PON environment; an analyzing module configured to analyze the third time synchronization message to obtain a second actual time when the third time synchronization message is sent by the third electronic control unit; a first obtaining module configured to obtain a second link delay of the third time synchronization message from the third electronic control unit to a second electronic control unit; a determining module configured to determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

14. A time synchronization system, comprising: a second electronic control unit in a PON environment; a third electronic control unit, the third electronic control unit being in both an Ethernet environment and a passive optical network environment, the third electronic control unit being connected with at least one of the second electronic control units; an Ethernet switch, the Ethernet switch being connected with at least one of the third electronic control units; wherein the Ethernet switch is configured to send a first time synchronization message to the third electronic control unit; the third electronic control unit is configured to encapsulate the first time synchronization message to obtain a third time synchronization message, and send the third time synchronization message to the second electronic control unit; the second electronic control unit is configured to analyze the third time synchronization message, so that the second electronic control unit completes time synchronization with the third electronic control unit.

15. The system of claim 14, wherein, The system further comprises: a first electronic control unit, the first electronic control unit being in an Ethernet environment, the first electronic control unit being connected with at least one of the Ethernet switches; wherein the first electronic control unit is configured to send a second time synchronization message to the Ethernet switch, and the Ethernet switch is further configured to correct a time field of the second time synchronization message to obtain the first time synchronization message.

16. The system of claim 15, wherein, The first electronic control unit is further configured to receive a time service time from a clock source, and encapsulate the time service time using a general precise time protocol to obtain the second time synchronization message.

17. The system of any of claims 14-16, wherein, The second electronic control unit is further configured to analyze the third time synchronization message to obtain a second actual time when the third electronic control unit sends the third time synchronization message; and obtain a second link delay of the third time synchronization message from the third electronic control unit to the second electronic control unit; and determine a sum of the second actual time and the second link delay as a third actual time of the second electronic control unit, so that the second electronic control unit completes time synchronization with the third electronic control unit.

18. An electronic device, comprising: a processor and a memory having stored computer program instructions; The processor executes the computer program instructions to implement the time synchronization method of any one of claims 1-11.

19. A computer readable storage medium having stored computer program instructions, the computer program instructions being executed by a processor to implement the time synchronization method of any one of claims 1-11.

20. A vehicle comprising at least one of: The time synchronization device of claim 12; The time synchronization device of claim 13; The time synchronization system of any one of claims 14-17; The electronic device of claim 18; The computer readable storage medium of claim 19.

Citation Information

Patent Citations

  • Method and device for time synchronization in passive optical network and passive optical network

    CN101707505A

  • Time synchronization in passive optical networks

    CN117157915A

  • Time synchronization method and device for electronic control unit in vehicle

    CN117202339A

  • Method, system and optical network device for synchronizing time of a passive optical network

    US20110052206A1