Vehicle clock synchronization method, device, vehicle and storage medium

By monitoring the target ECU and switching its operating mode to generate clock synchronization information, the problem of unstable ECU clock synchronization in the vehicle is solved, and clock synchronization is achieved when the master clock node is abnormal, thus improving the synchronization stability of the vehicle ECU.

CN118523863BActive Publication Date: 2025-10-31CHERY AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410573676.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2025-10-31
Estimated Expiration
2044-05-10

AI Technical Summary

Technical Problem

In vehicles, as the number of ECUs increases, existing technology struggles to guarantee precise clock synchronization between different ECUs, especially when global time nodes are abnormal, which may lead to clock synchronization failure.

Method used

By monitoring the clock synchronization information of the master clock node in the target ECU, if no information is received, the system switches to proxy mode, generates and sends second clock synchronization information, thereby achieving clock synchronization with the next-level ECU and ensuring the stability of the clock synchronization process.

Benefits of technology

When the master clock node malfunctions, the target ECU can proactively send clock synchronization information to ensure clock synchronization between subsequent ECUs, thereby improving the stability and reliability of vehicle ECU clock synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118523863B_ABST
    Figure CN118523863B_ABST
Patent Text Reader

Abstract

This application discloses a vehicle clock synchronization method, apparatus, vehicle, and storage medium, belonging to the field of vehicle technology. The method includes: when the vehicle is powered on, a target ECU monitors first clock synchronization information sent by a first ECU through a higher-level ECU; after not receiving the first clock synchronization information from the higher-level ECU, the target ECU switches its current operating mode to a proxy mode; in proxy mode, the target ECU, acting as a master clock node, sends second clock synchronization information to the next-level ECU, the second clock synchronization information being used for clock synchronization between the next-level ECU and the target ECU. This application, by having the target ECU act as the master clock node to send the second clock synchronization information, enables the next-level ECU to achieve clock synchronization based on the second clock synchronization information, improving the stability of the vehicle's ECU clock synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to a method, apparatus, vehicle, and storage medium for synchronizing a vehicle's clock. Background Technology

[0002] With the rapid development of vehicle technology, the number of ECUs (Electronic Control Units) in vehicles is increasing. As the number of ECUs in vehicles increases, especially real-time ECUs (such as environmental perception modules and safety control modules), the requirements for the accuracy of time information of each ECU inside the vehicle are becoming increasingly stringent, that is, the precise synchronization of clocks between different ECUs must be ensured.

[0003] In related technologies, the vehicle is also equipped with a global time node, which periodically sends clock synchronization messages to each ECU. After receiving the clock synchronization message, each ECU needs to correct its local clock time base according to the clock synchronization message, thereby realizing the synchronization of the local clock of each ECU with the clock of the global time node.

[0004] In the above method, it is necessary to ensure that the global time node always maintains a high degree of stability; otherwise, the clocks between different ECUs may not be able to achieve accurate synchronization. Summary of the Invention

[0005] This application provides a method, apparatus, vehicle, and storage medium for vehicle clock synchronization, which can achieve precise clock synchronization between different ECUs. The technical solution is as follows:

[0006] On one hand, a clock synchronization method for a vehicle is provided, the vehicle including a plurality of cascaded electronic control units (ECUs), wherein the first ECU of the cascaded ECUs serves as the initial master clock node, and the other ECUs of the cascaded ECUs serve as the initial slave clock nodes; the method includes:

[0007] When the vehicle is powered on, the target ECU monitors the first clock synchronization information sent by the first ECU through the next-level ECU. The first clock synchronization information is used to synchronize the clock between the target ECU and the first ECU. The target ECU is any ECU other than the first ECU among the cascaded multiple ECUs.

[0008] After failing to receive the first clock synchronization information sent by the upper-level ECU, the target ECU switches its current operating mode to proxy mode;

[0009] In the proxy mode, the target ECU acts as the master clock node and sends second clock synchronization information to the next-level ECU. The second clock synchronization information is used for clock synchronization between the next-level ECU and the target ECU.

[0010] Optionally, the step of switching the target ECU to proxy mode after not receiving the first clock synchronization information sent by the upper-level ECU includes:

[0011] The timer begins after the vehicle is powered on.

[0012] If the target ECU does not receive the first clock synchronization information sent by the upper-level ECU within the first duration after the start of the timing, the target ECU will switch the current working mode to the first agent mode.

[0013] In the first proxy mode, the target ECU generates the second clock synchronization information based on the local clock and the first clock frequency ratio, wherein the first clock frequency ratio is used to indicate the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU.

[0014] Optionally, the step of switching the target ECU to proxy mode after not receiving the first clock synchronization information sent by the upper-level ECU includes:

[0015] The timer begins after the vehicle is powered on.

[0016] If the first clock synchronization information sent by the upper-level ECU is received within the first duration after the timing starts, the timing will restart upon receiving the first clock synchronization information sent by the upper-level ECU.

[0017] If the target ECU does not receive the first clock synchronization information sent by the upper-level ECU within the second duration after the restart of the timing, the target ECU will switch the current working mode to the second agent mode, and the second duration is longer than the first duration.

[0018] In the second proxy mode, the target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, and the timing result of the local clock. The second clock frequency ratio is used to indicate the ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU.

[0019] Optionally, the target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, and the timing result of the local clock, including:

[0020] The target ECU determines a third clock frequency ratio based on the most recently received first clock synchronization information and the second clock frequency ratio. The third clock frequency ratio is used to indicate the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU.

[0021] The target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the timing result of the local clock, and the third clock frequency ratio.

[0022] Optionally, after the target ECU switches its current operating mode to proxy mode, the method further includes:

[0023] Upon receiving the first clock synchronization information sent by the first ECU through the previous-level ECU, the target ECU switches its current operating mode to normal operating mode.

[0024] In the normal operating mode, the target ECU corrects the first clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, the target transmission delay parameter, and the first clock frequency ratio, and sends the corrected first clock synchronization information to the next-level ECU. The target transmission delay parameter is used to indicate the information transmission delay between the target ECU and the previous-level ECU, and the second clock frequency ratio is used to indicate the ratio between the local clock frequency of the previous-level ECU and the local clock frequency of the target ECU.

[0025] Optionally, the target ECU stores initial transmission delay parameters; the method further includes:

[0026] If the target ECU does not measure the actual transmission delay parameter, the initial transmission delay parameter is determined as the target transmission delay parameter, and the actual transmission delay parameter is used to indicate the actual information transmission delay between the target ECU and the upstream ECU;

[0027] If the target ECU measures the actual transmission delay parameter, the actual transmission delay parameter is determined as the target transmission delay parameter. If the difference between the actual transmission delay parameter and the initial transmission delay parameter is greater than the target difference, the initial transmission delay parameter is updated to the actual transmission delay parameter.

[0028] Optionally, the target ECU stores an initial clock frequency ratio; the method further includes:

[0029] If the target ECU does not measure the actual clock frequency ratio, the initial clock frequency ratio is determined as the second clock frequency ratio, and the actual clock frequency ratio is used to indicate the actual ratio between the local clock frequency of the upstream ECU and the local clock frequency of the target ECU.

[0030] When the target ECU measures the actual clock frequency ratio, the actual clock frequency ratio is determined as the second clock frequency ratio, and when the vehicle is detected to be powered off, the most recently measured actual clock frequency ratio is updated to the initial clock frequency ratio.

[0031] On the other hand, a clock synchronization device for a vehicle is provided, the vehicle including a plurality of cascaded electronic control units (ECUs), wherein the first ECU of the cascaded ECUs serves as an initial master clock node, and the other ECUs of the cascaded ECUs serve as initial slave clock nodes; the device is applied to a target ECU of the vehicle, the target ECU being any ECU of the cascaded ECUs other than the first ECU, and the device includes:

[0032] The information monitoring module is used to monitor the first clock synchronization information sent by the first ECU through the upper-level ECU when the vehicle is powered on. The first clock synchronization information is used for clock synchronization between the target ECU and the first ECU.

[0033] The mode switching module is used to switch the target ECU to the proxy mode after it has not received the first clock synchronization information sent by the upper-level ECU.

[0034] The clock synchronization module is used to send second clock synchronization information to the next-level ECU in the agent mode. The second clock synchronization information is used for clock synchronization between the next-level ECU and the target ECU.

[0035] Optionally, the mode switching module is used to start timing after the vehicle is powered on; if the first clock synchronization information sent by the upper-level ECU is not received within the first duration after the timing starts, the current working mode is switched to the first agent mode.

[0036] A clock synchronization module is used to generate second clock synchronization information based on a local clock and a first clock frequency ratio in the first agent mode. The first clock frequency ratio is used to indicate the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU.

[0037] Optionally, the mode switching module is configured to start timing after the vehicle is powered on; if the first clock synchronization information sent by the upper-level ECU is received within a first duration after the timing starts, the timing is restarted upon receiving the first clock synchronization information sent by the upper-level ECU; if the first clock synchronization information sent by the upper-level ECU is not received within a second duration after the timing is restarted, the current working mode is switched to a second proxy mode, where the second duration is longer than the first duration.

[0038] The clock synchronization module is used to generate the second clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, and the timing result of the local clock in the second agent mode. The second clock frequency ratio is used to indicate the ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU.

[0039] Optionally, the clock synchronization module is configured to determine a third clock frequency ratio based on the most recently received first clock synchronization information and the second clock frequency ratio, wherein the third clock frequency ratio is used to indicate the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU; and to generate the second clock synchronization information based on the most recently received first clock synchronization information, the timing result of the local clock, and the third clock frequency ratio.

[0040] Optionally, the mode switching module is used to switch the current working mode to the normal working mode when the first clock synchronization information sent by the first ECU through the upper-level ECU is received again.

[0041] The clock synchronization module is used in the normal operating mode to correct the first clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, the target transmission delay parameter, and the first clock frequency ratio, and to send the corrected first clock synchronization information to the next-level ECU. The target transmission delay parameter is used to indicate the information transmission delay between the target ECU and the previous-level ECU, and the second clock frequency ratio is used to indicate the ratio between the local clock frequency of the previous-level ECU and the local clock frequency of the target ECU.

[0042] Optionally, the device further includes a storage module that stores initial transmission delay parameters;

[0043] The clock synchronization module is used to determine the initial transmission delay parameter as the target transmission delay parameter when the actual transmission delay parameter is not measured, wherein the actual transmission delay parameter indicates the actual information transmission delay between the target ECU and the upstream ECU; and when the actual transmission delay parameter is measured, the actual transmission delay parameter is determined as the target transmission delay parameter.

[0044] The storage module is configured to update the initial transmission delay parameter to the actual transmission delay parameter when the difference between the actual transmission delay parameter and the initial transmission delay parameter is greater than a target difference.

[0045] Optionally, the device further includes a storage module that stores an initial clock frequency ratio;

[0046] The clock synchronization module is used to determine the initial clock frequency ratio as the second clock frequency ratio when the actual clock frequency ratio is not measured, wherein the actual clock frequency ratio is used to indicate the actual ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU; and to determine the actual clock frequency ratio as the second clock frequency ratio when the actual clock frequency ratio is measured.

[0047] The storage module is used to update the most recently measured actual clock frequency ratio to the initial clock frequency ratio when the vehicle is detected to be powered off.

[0048] On the other hand, a vehicle is provided, the vehicle including a memory and a processor, the memory for storing a computer program, and the processor for executing the computer program stored in the memory to implement the steps of the clock synchronization method of the vehicle described above.

[0049] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of the vehicle clock synchronization method described above.

[0050] On the other hand, a computer program product containing instructions is provided that, when the instructions are run on a computer, causes the computer to perform the steps of the vehicle clock synchronization method described above.

[0051] The technical solution provided in this application can bring at least the following beneficial effects:

[0052] After the vehicle is powered on, the target ECU determines whether the master clock node is functioning correctly by monitoring the first clock synchronization information sent by the previous-level ECU. If the master clock node malfunctions, meaning the target ECU cannot receive the first clock synchronization information, the target ECU switches to proxy mode, acting as the master clock node to send the second clock synchronization information to the next-level ECU, thus achieving clock synchronization between the next-level ECU and the target ECU. In this way, if the initial master clock node malfunctions during clock synchronization, the target ECU can proactively send the second clock synchronization information, enabling the next-level ECU to synchronize based on this second clock synchronization information, ensuring clock synchronization between subsequent ECUs. This prevents clock synchronization failures between all cascaded ECUs due to an initial master clock node malfunction, thereby improving the stability of the vehicle's ECU clock synchronization. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0055] Figure 2 This is a schematic diagram of another implementation environment provided in the embodiments of this application;

[0056] Figure 3 This is a schematic diagram of another implementation environment provided in the embodiments of this application;

[0057] Figure 4 This is a flowchart of a vehicle clock synchronization method provided in an embodiment of this application;

[0058] Figure 5 This is a flowchart of another vehicle clock synchronization method provided in an embodiment of this application;

[0059] Figure 6 This is a flowchart of another vehicle clock synchronization method provided in an embodiment of this application;

[0060] Figure 7 This is a schematic diagram of the structure of a vehicle clock synchronization device provided in an embodiment of this application;

[0061] Figure 8 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0063] Before providing a detailed explanation of the vehicle clock synchronization method provided in the embodiments of this application, the implementation environment involved in the embodiments of this application will be introduced first.

[0064] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating an implementation environment according to an exemplary embodiment. The implementation environment includes multiple cascaded ECUs, which can communicate with each other. This communication connection can be wired or wireless, and this embodiment does not limit the specific type of connection.

[0065] It should be noted that an ECU can be understood as a functional module of a vehicle, combined with... Figure 1 For example, ECU1 can be the vehicle's TBOX (Telematics BOX, information communication module). ECU2 is connected to TBOX. ECU2 can be the vehicle's ZCU (Zone Controller ECU) module. ECU3 is connected to ZCU. ECU3 can be the vehicle's ADCC (Autonomous Driving Computing Center) module. ECU4 is connected to ADCC. ECU4 can be the vehicle's FCM (Front Camera Module), FLLM (Front Lidar Module), FLM (Front Left Lidar Module), or FRLM (Front Right Lidar Module), etc.

[0066] Furthermore, multiple parallel ECUs can be connected to a single ECU, such as the ADCC mentioned above. That is, ECU4 can simultaneously connect to FCM, FLLM, FLM, and FRLM modules to achieve adaptive cruise control functionality through the integration of multiple modules. In this scenario, the cascaded multiple ECUs can... Figure 2 As shown.

[0067] It should be noted that, Figure 2This description only illustrates one possible implementation of multiple ECUs cascaded in four levels, with multiple ECUs 4 running in parallel under ECU 3. In some embodiments, the implementation environment of this application may also include multiple ECUs cascading in five-level or six-level cascading, and multiple ECUs can be connected in parallel under ECU 1, ECU 2, etc. These will not be listed here.

[0068] In some embodiments, such as Figure 3 As shown, the ECU includes a local clock 301 and a processor 302, which can communicate with each other. This communication connection can be wired or wireless, and this embodiment does not limit it.

[0069] The local clock 301 is used to provide time information.

[0070] The local clock 301 can be a clock module such as RTC (Real-Time Clock).

[0071] Optionally, in order to improve the accuracy of the time information provided by the local clock, the local clock 301 can be a clock that supports power-off time storage. In this way, even when the vehicle is powered off, the local clock 301 can continue to keep time to ensure the accuracy of the local clock.

[0072] The processor 302 is used to generate first clock synchronization information or second clock synchronization information based on the time information provided by the local clock 301, and send the first clock synchronization information and the second clock synchronization information to the next level ECU.

[0073] Alternatively, the processor 302 is used to receive the first clock synchronization information or the second clock synchronization information, and correct the local clock 301 based on the first clock synchronization information or the second clock synchronization information.

[0074] For example, for any ECU, if that ECU is the initial master clock node, such as that ECU is... Figure 1 If ECU1 is in the middle, then any ECU needs to send the first clock synchronization information to the next level ECU.

[0075] If any ECU is the initial slave clock node, that is, if any ECU is not the first ECU, such as if any ECU is Figure 1 ECU2, ECU3, or ECU4, upon receiving the first clock synchronization information from the higher-level ECU, needs to correct its local clock based on the first clock synchronization information. Furthermore, since multiple ECUs are cascaded, if any ECU is connected to a lower-level ECU (i.e., if any ECU is not...), Figure 1If ECU4 is involved, then any ECU needs to forward the first clock synchronization information to the next-level ECU so that the next-level ECU can correct its local clock based on the first clock synchronization information.

[0076] If any ECU is the initial slave clock node and has not received the first clock synchronization information sent by the previous ECU, the ECU needs to switch its current working mode to proxy mode, act as the master clock node to generate the second clock synchronization information, and send the second clock synchronization information to the next level ECU.

[0077] In this process, the next-level ECU maintains normal operation mode as long as it can receive the first clock synchronization information or the second clock synchronization information. That is, it corrects the local clock based on the first clock synchronization information or the second clock synchronization information and forwards the first clock synchronization information and the second clock synchronization information to the subsequent cascaded ECUs.

[0078] The execution entity of the vehicle clock synchronization method provided in this application embodiment is the aforementioned processor 202. The processor can be a general-purpose CPU (Central Processing Unit), an NP (Network Processor), a microprocessor, or one or more integrated circuits used to implement the solution of this application, such as an ASIC (Application-Specific Integrated Circuit), a PLD (Programmable Logic Device), or a combination thereof. The aforementioned PLD can be a CPLD (Complex Programmable Logic Device), an FPGA (Field-Programmable Gate Array), a GAL (Generic Array Logic), or any combination thereof.

[0079] Those skilled in the art should understand that the above-described ECU, local clock 201, and processor 202 are merely examples. Other existing or future ECUs, clocks, or processors that are applicable to the embodiments of this application should also be included within the scope of protection of the embodiments of this application, and are hereby incorporated by reference.

[0080] It should be noted that the application scenarios and implementation environments described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios and the evolution of implementation environments, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0081] The vehicle clock synchronization method provided in the embodiments of this application will now be explained in detail.

[0082] Figure 4 This is a flowchart illustrating a vehicle clock synchronization method provided in an embodiment of this application. The vehicle includes multiple cascaded Electronic Control Units (ECUs). The first ECU in the cascaded array serves as the initial master clock node, and the other ECUs in the cascaded array serve as the initial slave clock nodes. Please refer to [link / reference]. Figure 4 The method includes the following steps.

[0083] Step 401: When the vehicle is powered on, the target ECU monitors the first clock synchronization information sent by the first ECU through the previous level ECU. The first clock synchronization information is used to synchronize the clock between the target ECU and the first ECU. The target ECU is any ECU other than the first ECU among the cascaded ECUs.

[0084] It should be noted that the vehicle clock synchronization method of this application embodiment can be applied to scenarios such as PTP (Precision Time Protocol) and gPTP (Generalized Precision Time Protocol). In this scenario, the nodes requiring clock synchronization include a master clock node and slave clock nodes. The master clock node provides a precise time reference, and the slave clock nodes need to synchronize their clocks based on the time reference provided by the master clock node. That is, the slave clock node needs to use the clock of the master clock node as a clock reference to correct the frequency of its local clock, and the slave clock node needs to use the time of the master clock node as a time reference to correct the time of its local clock, thereby achieving clock synchronization between the master clock node and the slave clock node.

[0085] The master clock node can periodically send clock synchronization information, enabling slave clock nodes to synchronize with the master clock node based on this information. The sending period of this clock synchronization information can be determined based on actual usage requirements, such as 125ms.

[0086] For example, the master clock node sends a first clock synchronization message every 125ms. This first clock synchronization message includes a timestamp of the sending time. When the slave clock node receives the first clock synchronization message, it determines the time when it receives the first clock synchronization message under the master clock node's clock, based on the timestamp and the network delay between the slave clock node and the parent clock node. Based on the determined time and the time recorded by its local clock, the slave clock node adjusts its local clock to keep its local clock time consistent with that of the master clock node. Furthermore, it uses a certain algorithm to determine the frequency difference between the slave clock node's clock frequency and the master clock node's clock frequency, and adjusts its local clock frequency based on this frequency difference to keep the slave clock node's local clock frequency as consistent as possible with that of the master clock node, thereby achieving clock synchronization between nodes, that is, ensuring that the time information provided by different clocks is the same.

[0087] It should be noted that when the master clock node and slave clock nodes synchronize their clocks, the synchronization period of all participating slave clock nodes must be consistent with the period at which the master clock node sends the first clock synchronization information. For example, if the master clock node sends the first clock synchronization information every 125ms, the slave clock nodes will also synchronize their local clocks with the master clock node every 125ms. Furthermore, this synchronization period should generally not be changed after power-on; for example, it is advisable to prevent participating nodes from sending Signaling messages that could alter the time synchronization period.

[0088] In some embodiments, the first clock synchronization information may include a Sync message and a Follow up message, and the process of realizing clock synchronization based on the first clock synchronization information may include the following steps.

[0089] For the initial master clock node M1 (i.e. the first cascaded ECU): a Sync message is generated and sent to the next level ECU at time T1, followed by a Follow up message. The Follow up message includes the time T1 when the Sync message leaves M1, which is the time recorded by the local clock of the master clock node M1.

[0090] The Follow-up message may include a PreciseOriginTimestamp field and a Correction field. The PreciseOriginTimestamp field indicates the departure time T1 of the Sync message, and the Correction field indicates the correction to that departure time T1. For example, since the PreciseOriginTimestamp precision is in nanoseconds, the Correction field is 2. -16 Therefore, M1 can fill the fractional part of T1 that is less than ns in the Correction field.

[0091] For the initial first slave clock node S1 (i.e., the ECU directly connected to the master clock node M1): receive the Sync message and record the time t1 when the Sync message is received, where t1 is the time recorded by the local clock of S1; receive the Follow up message; and realize clock synchronization between S1 and M1 based on the Sync message and the Follow up message.

[0092] Specifically, S1 can determine the time T1 when M1 sends the Sync message based on the Follow-up message, and then determine the time T2 of M1's local clock when the Sync message is received based on the target transmission delay parameter Pdelay1 between S1 and M1, where T2 = T1 + Pdelay1. The time error Δt = (t1 - T2) between S1 and M1 can then be obtained, and the time of S1's local clock can be corrected based on this time error.

[0093] In addition, considering that the local clock frequency of the slave clock node may differ from that of the master clock node, and that the target transmission delay parameter is usually determined based on the local clock of S1, S1 can also determine the ratio RateRatio1 between the local clock frequency of M1 and the local clock frequency of S1, and based on RateRatio1, correct the local clock frequency of S1 and the target transmission delay parameter.

[0094] For example, S1 can periodically measure the ratio RateRatio1 between the local clock frequency of M1 and the local clock frequency of S1, combined with... Figure 5 The measurement process for RateRatio1 can include the following steps.

[0095] (1) M1 sends a Sync message to S1 at time a1, and S1 records the time a2 when it receives the Sync message.

[0096] (2) M1 then sends a Follow up message, sending the time a1 of the last time the Sync message was sent to S1.

[0097] (3) M1 sends a Sync message to S1 at time a3, and S1 records the time a4 when it receives the Sync message.

[0098] (4) M1 then sends a Follow up message, sending the time a3 of the last Sync message sent to S1.

[0099] Thus, S1 locally stores the time a1 when M1 sends the Sync message, the time a2 when the Sync message is received, the time a3 when M1 sends the Sync message again, and the time a4 when the Sync message is received again. Based on Figure 5 It can be seen that the time interval for M1 to send Sync messages is (a3-a1), and the time interval for S1 to receive Sync messages is (a4-a2). Given that the transmission delay between M1 and S1 is the same, the time lengths described by (a3-a1) and (a4-a2) are the same. Since a1 and a3 are the times recorded by M1's local clock, and a2 and a4 are the times recorded by S1's local clock, we can obtain the ratio between M1's local clock frequency and S1's local clock frequency: RateRatio1 = (a3-a1) / (a4-a2).

[0100] Additionally, in some embodiments, the target ECU (i.e., the initial slave clock node) may store an initial clock frequency ratio. In this scenario, if the target ECU does not measure the actual clock frequency ratio, the initial clock frequency ratio is determined as a second clock frequency ratio. The actual clock frequency ratio indicates the actual ratio between the local clock frequency of the upstream ECU and the local clock frequency of the target ECU, while the second clock frequency ratio indicates the ratio between the local clock frequency of the upstream ECU and the local clock frequency of the target ECU. If the target ECU measures the actual clock frequency ratio, the actual clock frequency ratio is determined as the second clock frequency ratio.

[0101] Furthermore, the target ECU can update the most recently measured actual clock frequency ratio to the initial clock frequency ratio when the vehicle is powered off. It should be noted that, considering the actual clock frequency ratio mainly depends on the hardware characteristics of the local clock of each node, it generally does not fluctuate significantly. Therefore, in this embodiment, the initial clock frequency ratio can be updated only before the vehicle is powered off.

[0102] In some embodiments, the method for updating the initial clock frequency ratio can also be flexibly varied. For example, the target ECU can update the stored initial clock frequency ratio based on all actual clock frequency ratios measured after the current power-on, before each vehicle power-off. For instance, the target ECU can update the stored initial clock frequency ratio based on all actual clock frequency ratios of the vehicle after the current power-on, before each vehicle power-off.

[0103] For example, the vehicle may include a storage module to store the initial clock frequency ratio. This storage module can be integrated into the target ECU, such as having one storage module in each ECU; or it can be located outside the target ECU, such as having a memory in the vehicle to which each ECU is connected. This application does not limit the specific implementation of this method. In another embodiment, the initial clock frequency ratio can also be stored in the cloud, and the target ECU can communicate with the cloud to read and update the initial clock frequency ratio.

[0104] Since measuring the actual clock frequency ratio also requires a certain amount of time, in this embodiment, by storing an initial clock frequency ratio, when a second clock frequency ratio needs to be determined but the actual clock frequency ratio has not yet been measured, the stored initial clock frequency ratio can be used as the second clock frequency ratio. Then, based on this second clock frequency ratio, the first clock synchronization information can be corrected or the second clock synchronization information can be generated, and the first or second clock synchronization information can be sent to the next-level ECU. In this way, when it is necessary to correct the first clock synchronization information or generate the second clock synchronization information, it is not necessary to wait for the actual clock frequency ratio measurement to be completed; the correction of the first clock synchronization information or the generation of the second clock synchronization information can be achieved based on the stored initial clock frequency ratio. This shortens the transmission time of the first and second clock synchronization information when the actual clock frequency ratio has not been measured, thereby improving clock synchronization efficiency.

[0105] It should be noted that this initial clock frequency ratio is only used in scenarios where the first clock synchronization information needs to be corrected or the second clock synchronization information needs to be generated, and the actual clock frequency ratio has not yet been measured. This scenario is typically the first clock synchronization performed after the vehicle is powered on. In subsequent clock synchronization processes, if an actual clock frequency ratio has already been measured, the target ECU needs to correct the first clock synchronization information or generate the second clock synchronization information based on the most recently measured actual clock frequency ratio.

[0106] In addition, besides needing to synchronize its local clock with M1's local clock based on the first clock information, S1 also needs to forward the first clock synchronization information so that subsequent cascaded slave clock nodes can synchronize their local clocks with M1's local clock based on the first clock synchronization information.

[0107] In some embodiments, when S1 forwards the first clock synchronization information, S1 can forward the Sync message; at the same time, it updates the Follow up message and sends the updated Follow up message to the next-level slave clock node S2, thereby realizing the forwarding of the first clock synchronization information.

[0108] Optionally, when forwarding Sync messages, S1 can also generate new Sync messages based on the received Snc messages, such as generating Sync messages with different sequence numbers, and send the regenerated Sync messages to the next level slave clock node.

[0109] When S1 updates the Follow-up message, the PreciseOriginTimestamp field remains unchanged, still representing the time T1 when the Sync message leaves the master clock node M1. However, the Correction field needs to be recalculated, and the Correction field can be updated using the following formula.

[0110] New Correction=Old Correction+Pdelay i +residence_time i Formula 1

[0111] Here, New Correction refers to the updated value of the Correction field; Old Correction refers to the value of the Correction field carried in the Follow-up message sent by the previous clock node, which in this case is the value of the Correction field in the Follow-up message sent by the master clock node; Pdelay i This refers to the target transmission delay parameter corresponding to the i-th slave clock node, which is Pdelay1 mentioned above; residence_time i This refers to the dwell time of the Sync message on the i-th slave clock node. Here, it is the dwell time of the Sync message on slave clock node S1, which is the processing delay from when S1 receives the Sync message to when it sends the Sync message.

[0112] In some embodiments, S1 can periodically measure the actual transmission delay parameter between itself and M1, and use the measured actual transmission delay parameter as the target transmission delay parameter. Combined with Figure 6 The method for measuring the actual transmission delay parameter may, for example, include the following steps.

[0113] (1) S1 sends a Pdelay_Req message to request the measurement of transmission delay and records the sending time b1 of the Pdelay_Req message.

[0114] (2) M1 receives the Pdelay_Req message and records the reception time b2 of the Pdelay_Req message.

[0115] (3) M1 sends a Pdelay_Resp message, sends b2 to the requester, and records the sending time b3 of the Pdelay_Resp message.

[0116] (4) S1 records the time b4 when the Pdelay_Resp message is received.

[0117] (5) M1 then sends a Pdelay_Resp_Follow_Up message to send the b3 time to S1.

[0118] based on Figure 6 When the transmission delay is symmetrical, that is, when the transmission time from S1 to M1 is the same as the transmission time from M1 to S1, the actual transmission delay parameter Pdelay = ((b2-b1)+(b4-b3)) / 2 = ((b2-b1)+(b4-b3)) / 2.

[0119] Additionally, in some embodiments, the target ECU (i.e., the initial slave clock node) may also store an initial transmission delay parameter. In this scenario, if the target ECU does not measure the actual transmission delay parameter, the initial transmission delay parameter is determined as the target transmission delay parameter, and the actual transmission delay parameter is used to indicate the actual information transmission delay between the target ECU and the upstream ECU; if the target ECU measures the actual transmission delay parameter, the actual transmission delay parameter is determined as the target transmission delay parameter.

[0120] Furthermore, the target ECU can update the initial transmission delay parameters to the actual transmission delay parameters if the difference between the actual and initial transmission delay parameters exceeds a target difference. This avoids frequent updates to the initial transmission delay parameters during clock synchronization and ensures timely updates to the stored initial transmission delay parameters even when there is a significant difference between them, thus guaranteeing the accuracy of the initial transmission delay parameters.

[0121] In some embodiments, the method for updating the initial transmission delay parameters can be flexibly varied. For example, the target ECU can update the stored initial transmission delay parameters based on all actual transmission delay parameters measured after the current power-on, before each vehicle power-off. For instance, the target ECU can update the stored initial transmission delay parameters based on the average value of all actual transmission delay parameters measured after the current power-on.

[0122] For example, the vehicle may include a storage module to store initial transmission delay parameters. This storage module can be integrated into the target ECU, such as having one storage module in each ECU; alternatively, it can be located outside the target ECU, such as having a memory in the vehicle to which each ECU is connected. This embodiment of the application does not limit this approach. In another embodiment, the initial transmission delay parameters can also be stored in a cloud platform, and the target ECU can communicate with the cloud platform to read and update the initial transmission delay parameters.

[0123] The target ECU can periodically measure the actual transmission delay parameter. The method for measuring the actual transmission delay parameter can be found in the description of the actual transmission delay parameter between S1 and M1 above, which will not be repeated here.

[0124] Optionally, a Pdelay_Req message can be sent through the upstream ECU, and a Pdelay_Resp message and a Pdelay_Resp_Follow_Up message can be sent through the target ECU. After determining the actual transmission delay parameter, the upstream ECU sends the actual propagation delay parameter to the target ECU.

[0125] In some embodiments, the target difference can be determined based on actual usage requirements, such as based on experimental data statistics or expert experience. For example, the target difference can be 100 ns, meaning that when the difference between the measured actual transmission delay parameter and the stored initial transmission delay parameter is greater than 100 ns, the initial transmission delay parameter is updated to the measured actual transmission delay parameter.

[0126] It should be noted that, considering the significant fluctuations in actual transmission delay parameters when a vehicle is first powered on due to network instability, some embodiments allow the target ECU to measure the actual transmission delay parameters only after the network has stabilized, and not when the network is unstable. Network stability can be determined by functional modules such as the vehicle's network monitoring module. For example, the vehicle's network monitoring module can send a stabilization command to the target ECU after the network stabilizes, and the target ECU will then measure the actual transmission delay parameters upon receiving the stabilization command.

[0127] Because measuring the actual transmission delay parameter requires sending a message and receiving a response, this measurement takes time. In some scenarios, if the target ECU receives the first clock synchronization information but hasn't measured the actual transmission delay parameter, it needs to measure it first. Only after obtaining the measured parameter can it correct the first clock synchronization information and send it to the next-level ECU. This means that after receiving the first clock synchronization information, the target ECU cannot process it immediately. Instead, it must wait for the actual transmission delay parameter measurement to complete before processing the information, such as synchronizing with the first ECU based on the first clock synchronization information, correcting the information, and forwarding it. In other words, the target ECU needs a certain measurement time to synchronize with the first ECU upon receiving the first clock synchronization information, resulting in poor clock synchronization efficiency.

[0128] Based on this, in this embodiment, by storing initial transmission delay parameters, when it is necessary to correct the first clock synchronization information but the actual transmission delay parameter has not yet been measured, the stored initial transmission delay parameters can be determined as the target transmission delay parameter. Then, the first clock synchronization information is corrected based on the target transmission delay parameter, and the corrected first clock synchronization information is sent to the next-level ECU. In this way, when it is necessary to correct the first clock synchronization information but the actual transmission delay parameter has not been measured, the correction of the first clock synchronization information can be achieved based on the stored initial transmission delay parameters without waiting for the measurement of the actual transmission delay parameter. This shortens the time required to send the first clock synchronization information when the actual transmission delay parameter has not been measured, thereby improving clock synchronization efficiency.

[0129] It should be noted that this initial transmission delay parameter is only used in scenarios where clock synchronization information correction is required and the actual transmission delay parameter has not yet been measured. This scenario is typically the first clock synchronization performed after the vehicle is powered on. In subsequent clock synchronization processes, if the actual transmission delay parameter has already been measured, the target ECU needs to correct the clock synchronization information based on the most recently measured actual transmission delay parameter.

[0130] It should be noted that when S1 updates the Follow-up message, the Pdelay1 and residence_time1 used are determined based on the local clock of S1. Therefore, when determining Pdelay1 and residence_time1 and calculating the New Correction based on Pdelay1 and residence_time1, it is also necessary to combine the ratio of the local clock frequency of M1 to the local clock frequency of S1 to correct Pdelay1 and residence_time1. This corrects Pdelay1 and residence_time1 under the local clock reference of S1 to Pdelay1' and residence_time1' under the local clock reference of M1, so that the subsequent cascaded slave clock nodes can determine the time reference of M1 based on the Follow-up message, thereby improving the accuracy of clock synchronization.

[0131] For example, S1 can modify the above Pdelay1 based on RateRatio1 to obtain the modified Pdelay1'. The specific modification method can be determined according to the actual usage requirements, such as letting Pdelay1' = Pdelay1 * RateRatio1, thereby realizing the modification of Pdelay1.

[0132] It should be noted that subsequent slave clock nodes Si can synchronize their clocks based on the first clock synchronization information sent by the previous slave clock node Si-1, update the first clock synchronization information, and send the updated first clock synchronization information to slave clock node Si+1. The clock synchronization process and the update process of the first clock synchronization information can be referred to the clock synchronization process and the first clock information update process of S1 above, and will not be repeated here. Where i is a positive integer greater than or equal to 2.

[0133] Optionally, the Follow-up message of the first clock synchronization information may also include a RateRatio field, which indicates the ratio between the local clock frequency of the master clock node and the local clock frequency of the current clock node, so that the next slave clock node Si can determine the ratio between the local clock frequency of Si and the local clock frequency of the master clock node based on the ratio, and then correct Pdelay2 and residence_time2.

[0134] Furthermore, after determining the ratio between the local clock frequency of the master clock node and the local clock frequency of Si+1, the next slave clock node Si+1 also needs to update the RateRatio field so that subsequent slave clock nodes can determine the ratio between the local clock frequency of the master clock node and the local clock frequency of the current clock node based on the RateRatio field.

[0135] It should be noted that when the slave clock nodes include multiple cascaded ECUs, since the master clock node cannot directly connect to all slave clock nodes, the initial clock synchronization information sent by the master clock node needs to be forwarded through multiple layers before it can be received by each slave clock node. Combined with... Figure 1 Since ECU1 cannot directly connect to ECU4, the first clock synchronization information sent by ECU1 needs to be forwarded through ECU2 and ECU3 before it can be received by ECU4. In other words, the first clock synchronization information received by ECU4 is sent by ECU1 through ECU3.

[0136] Optionally, in order to ensure the accuracy of the first clock synchronization information, it is necessary to ensure that the time information provided by the master clock node is high-precision time information. Therefore, the initial master clock node can be the vehicle's TBOX module, which can provide GNSS (global navigation satellite system) information, thereby providing a high-precision time reference for other slave clock nodes.

[0137] Furthermore, since the first clock synchronization information includes a Sync message and a Follow up message, the target ECU needs both messages to achieve clock synchronization with the first ECU. Therefore, in this embodiment, receiving the first clock synchronization information sent by the upper-level ECU means receiving both the Sync message and the Follow up message sent by the upper-level ECU. If the target ECU does not receive either the Sync message or the Follow up message, it is considered that it has not received the first clock synchronization information.

[0138] Step 402: After failing to receive the first clock synchronization information from the previous ECU, the target ECU switches its current operating mode to proxy mode.

[0139] In the proxy mode, the target ECU acts as the master clock node and sends the second clock synchronization information to the next-level ECU. The second clock synchronization information is used for clock synchronization between the next-level ECU and the target ECU.

[0140] When the vehicle is powered on, the target ECU will first work as the initial slave clock node. That is, when the vehicle is powered on, the target ECU's default working mode is normal working mode. Only after not receiving the first clock synchronization information sent by the upper-level ECU will the target ECU switch the current working mode from normal working mode to proxy mode.

[0141] In some embodiments, the target ECU can set the task processing priority for switching operating modes to the highest priority, so that it can switch operating modes as soon as possible after not receiving the first clock synchronization information, thereby achieving clock synchronization with subsequent cascaded ECUs as quickly as possible and improving the real-time performance of clock synchronization.

[0142] If the target ECU does not receive the first clock synchronization information sent by the previous ECU, it indicates that the current target ECU cannot achieve clock synchronization with the first ECU based on the first clock synchronization information. Furthermore, because the target ECU did not receive the first clock synchronization information, it cannot forward this information to subsequent cascaded ECUs, causing these cascaded ECUs to also be unable to achieve local clock synchronization based on the first clock synchronization information. In combination with... Figure 1 In other words, if ECU2 does not receive the first clock synchronization information sent by ECU1, ECU2, ECU3, and ECU4 will all be unable to achieve clock synchronization with ECU1 based on the first clock synchronization information.

[0143] Therefore, in order to avoid the increasing error between the clock of the target ECU and the clock of the next-level ECU due to the continuous failure to receive the first clock synchronization information, the target ECU needs to act as the master clock node and send the second clock synchronization information to the next-level ECU when it cannot receive the first clock synchronization information sent by the previous-level ECU. This will enable the next-level ECU to achieve clock synchronization with the target ECU based on the second clock synchronization information.

[0144] Optionally, in proxy mode, the transmission period for the target ECU to send the second clock synchronization information can be the same as the transmission period for the first ECU to send the first clock synchronization information. For example, in normal operating mode, the transmission period for the first ECU to send the first clock synchronization information is 125ms; in proxy mode, the transmission period for the target ECU to send the second clock synchronization information can also be 125ms.

[0145] In some scenarios, the transmission period of the target ECU sending the second clock synchronization information may differ from the transmission period of the first ECU sending the first clock synchronization information. For example, in normal operating mode, the transmission period of the first ECU sending the first clock synchronization information is 125ms; while in proxy mode, the transmission period of the target ECU sending the second clock synchronization information can be less than 125ms, such as 120ms or 110ms, to improve the synchronization between the target ECU's local clock and the local clock of subsequent cascaded ECUs by increasing the frequency of sending the second clock synchronization information when the target ECU cannot receive the first clock synchronization information.

[0146] Optionally, when the target ECU sends the second clock synchronization information to the next-level ECU, it can also send an indication message to the next-level ECU. This indication message indicates that the current target ECU cannot receive the first clock synchronization information sent by the next-level ECU. Upon receiving this indication message, the next-level ECU can resend the first clock synchronization information to the target ECU, or send a test message to the target ECU to check whether the transmission channel between them can transmit information normally. If the transmission channel fails, an alarm message will be sent to indicate a failure in information transmission between them. Alternatively, the target ECU can also be connected to the vehicle's alarm module. After failing to receive the first clock synchronization information sent by the next-level ECU, the target ECU can send an alarm message through the alarm module to indicate that the vehicle's clock synchronization is abnormal.

[0147] In some embodiments, the target ECU may start timing after the vehicle is powered on; if the target ECU does not receive the first clock synchronization information sent by the upper-level ECU within the first duration after the timing starts, the target ECU will switch the current working mode to the first agent mode.

[0148] In the first proxy mode, the target ECU generates second clock synchronization information based on the local clock and the first clock frequency ratio. The first clock frequency ratio is used to indicate the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU.

[0149] If the target ECU does not receive the first clock synchronization information from the higher-level ECU within the first period after the vehicle is powered on, meaning it has never received the first clock synchronization information since power-on, then the target ECU cannot determine the clock reference of the first ECU based on the first clock synchronization information. Specifically, the target ECU cannot use the first ECU's time as a time reference or its clock frequency as a clock frequency reference to synchronize with the first ECU, nor can it synchronize the clocks of subsequent ECUs based on the first clock synchronization information. Therefore, the target ECU can use its local clock time as a time reference and its local clock frequency as a frequency reference to generate second clock synchronization information, enabling the next-level ECU to synchronize with the target ECU based on this second clock synchronization information.

[0150] Using the local clock time as the time reference means that the target ECU generates a Sync message based on the local clock time. Using the local clock frequency as the frequency reference means that the target ECU uses the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU, i.e., the first clock frequency ratio, as the ratio between the local clock frequency of the master clock node and the local clock frequency of the slave clock node. The first clock frequency ratio is filled into the RateRatio field in the Follow up message, and the value of the RateRatio field is 1.

[0151] In addition, since the Sync message is generated by the target ECU, the target transmission delay parameter Pdelay in the Follow up message sent by the target ECU is 0, and the residence time of the Sync message in the target ECU is also 0.

[0152] For example, the second clock synchronization information generated by the target ECU may include a Sync message and a Follow up message. The Follow up message contains three fields (20), (0), and (1). The first field (20) is used to carry the time T when the target ECU sends the Sync message. PreciseOriginTimestamp The second field (0) is used to carry the delay between the transmission of the Sync message from the master clock and the transmission of the current clock, i.e., the Pdelay mentioned above. i +residence_time i The third field (1) is used to carry the ratio of the clock frequency of the master clock node to the clock frequency of the current node. Since the target ECU is the master clock in the first agent mode, the value of this field is 1.

[0153] The target ECU can be Figure 1In ECU2, ECU2 sends the second clock synchronization information to the next-level ECU3. After receiving the second clock synchronization information, ECU3 waits for a period of 5 before sending the Sync message to the next-level ECU4. Furthermore, ECU3 determines the target transmission delay parameter between itself and the previous-level ECU2 to be 2, and determines the ratio between the local clock frequency of the previous-level ECU2 and the local clock frequency of ECU3 to be 1.01. Therefore, the Follow up message sent by the next-level ECU contains three fields: (20), (2*1*1.01+5*1*1.01), and (1*1.01). The first field (20) refers to the time when the master clock node sends the Sync message, which is 20; 1 refers to the ratio between the local clock frequency of the master clock node determined by the previous level ECU1 and the local clock frequency of the previous level ECU1; (1*1.01) is the ratio between the local clock frequency of the master clock node and the local clock frequency of ECU3 determined by ECU2 based on the ratio between the clock frequency of the master clock node and the clock frequency of the previous level ECU, and the ratio between the local clock frequency of the previous level ECU2 and the local clock frequency of ECU3, which is 1.01; 2*1*1.01 refers to the target transmission delay parameter under the clock reference of the master clock node; 5*1*1.01 refers to the dwell time under the clock reference of the master clock node; (2*1*1.01+5*1*1.01) refers to the total time taken from the master clock node to the current clock node to send the Sync message under the clock reference of the master clock node.

[0154] In some embodiments, the first duration can be determined based on actual usage requirements, such as experimental data and technical experience. For example, the first duration can be 500ms.

[0155] It should be noted that, considering the time required for the higher-level ECU to send the first clock synchronization information, and that this information is transmitted to the target ECU via a layer-by-layer forwarding process, even if the first ECU sends the first clock synchronization information normally, the time required for the target ECU to receive the first clock synchronization information will increase as the target ECU's depth increases—that is, as the number of forwards required for the target ECU to receive the first clock synchronization information increases. Therefore, in some embodiments, the corresponding first duration will vary for target ECUs at different depths. For example, in conjunction with... Figure 1 The first duration for ECU2 can be 500ms, and the first duration for ECU3 can be 700ms, etc.

[0156] In other embodiments, the target ECU may also start timing after the vehicle is powered on; if it receives the first clock synchronization information sent by the upper-level ECU within the first duration after the timing starts, it may restart timing upon receiving the first clock synchronization information sent by the upper-level ECU; if it does not receive the first clock synchronization information sent by the upper-level ECU within the second duration after the timing restarts, the target ECU may switch the current working mode to the second proxy mode, the second duration being longer than the first duration.

[0157] In the second proxy mode, the target ECU generates second clock synchronization information based on the most recently received first clock synchronization information, second clock frequency ratio, and local clock timing results. The second clock frequency ratio is used to indicate the ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU.

[0158] It should be noted that if the first clock synchronization information sent by the higher-level ECU is received within the first duration after the vehicle is powered on, it indicates that the first ECU is able to send the first clock synchronization information normally after power-on, and that the first clock synchronization information can be received by the target ECU. At this time, due to network fluctuations or other reasons, the target ECU may temporarily be unable to receive subsequent first clock synchronization information, but this inability to receive due to such reasons is only occasional. In order to avoid misjudgment due to the temporary absence of the first clock synchronization information when the target ECU can receive the first clock synchronization information normally, if the first clock synchronization information sent by the higher-level ECU is received within the first duration after the start of the timing, a second duration is used to determine whether the target ECU needs to switch to the second proxy mode.

[0159] In other words, the first duration is only used for the target ECU to initially determine whether it can normally receive the first clock synchronization information after the vehicle is powered on. If the target ECU receives the first clock synchronization information within the first duration after the vehicle is powered on, it needs to use the second duration to determine whether it can normally receive the first clock synchronization information. In other words, if the target ECU receives the first clock synchronization information within the first duration after the vehicle is powered on, it needs to continuously use the second duration to determine whether it can normally receive the first clock synchronization information. That is, after the target ECU receives the first clock synchronization information within the second duration, it needs to restart the timing and determine whether it can receive the first clock synchronization information again within the second duration.

[0160] Thus, in this embodiment, after receiving the first clock synchronization information sent by the upper-level ECU, a second duration longer than the first duration is used to determine whether the first clock synchronization information was sent normally. Occasional loss of the first clock synchronization information is attributed to normal fluctuations in normal operating mode. Only when the first clock synchronization information is not received for several consecutive times (i.e., the time without receiving the first clock synchronization information is greater than or equal to the second duration) is it considered that the first clock synchronization information cannot be received, and the operating mode is switched to the second proxy mode to generate and send the second clock synchronization information. This avoids a decrease in vehicle clock synchronization efficiency and an increase in power consumption of the target ECU due to frequent switching of operating modes by the target ECU under conditions such as network fluctuations.

[0161] In other words, the target ECU starts timing after receiving the first clock synchronization information from the higher-level ECU. Even if it doesn't receive a second first clock synchronization information from the higher-level ECU within the first time period, the target ECU remains in normal operating mode and continues timing until it still doesn't receive the first clock synchronization information within the second time period. Only then will the target ECU switch to the second proxy mode. In other words, if the timing result is greater than or equal to the first time period but less than the second time period, the target ECU remains in normal operating mode until the timing result is greater than or equal to the second time period, at which point the target ECU will switch to the second proxy mode.

[0162] If the target ECU fails to receive the first clock synchronization information from the previous ECU within a second time interval after receiving the first clock synchronization information from the previous ECU, it can assume that it is no longer able to receive the first clock synchronization information from the previous ECU, indicating that the first ECU has malfunctioned. In this case, to achieve clock synchronization with the next-level ECU, the target ECU can switch its current operating mode to the second proxy mode.

[0163] This second duration can also be determined based on actual usage requirements, such as experimental data and technical experience. For example, the second duration could be 2 seconds.

[0164] Furthermore, based on the aforementioned description of the first duration, in some embodiments, the corresponding second duration may vary for target ECUs at different depths. For example, in conjunction with... Figure 1 The second duration corresponding to ECU2 can be 2s, and the second duration corresponding to ECU3 can be 3s, etc.

[0165] In some embodiments, the target ECU determines a third clock frequency ratio based on the most recently received first clock synchronization information and the second clock frequency ratio. The third clock frequency ratio is used to indicate the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU. The target ECU generates second clock synchronization information based on the most recently received first clock synchronization information, the timing result of the local clock, and the third clock frequency ratio.

[0166] The local clock timing result refers to the timing result of the target ECU from the moment it most recently received the first clock synchronization information until the current moment. In other words, it is the total duration between the moment the target ECU most recently received the first clock synchronization information and the current moment of the target ECU. Based on this duration and the most recently received first clock synchronization information, the target ECU can determine the local clock time of the first ECU corresponding to the current moment.

[0167] It should be noted that in the second proxy mode, although the target ECU can no longer receive the first clock synchronization information, it has already received the first clock synchronization information after power-on. Therefore, in this scenario, the target ECU can determine the time reference of the first ECU based on the historically received first clock synchronization information; that is, the target ECU can determine the time reference and clock frequency reference of the first ECU. Furthermore, considering that the accuracy of the first ECU's time is usually greater than the accuracy of the target ECU's local clock, in the second proxy mode, the target ECU can use the frequency of the first ECU's clock as the frequency reference and the time of the first ECU as the time reference, and then generate the second clock synchronization information based on this frequency reference and time reference to improve the accuracy of the second clock synchronization information.

[0168] For example, the target ECU can determine the time of the first ECU corresponding to the current moment based on the time recorded in the most recently received first clock synchronization information and the timing result recorded by the local clock since the most recently received first clock synchronization information, and then generate second clock synchronization information based on the time of the first ECU corresponding to the current moment.

[0169] Furthermore, considering the difference between the clock frequency of the target ECU and the clock frequency of the first ECU, and given that the first clock synchronization information sent by the upper-level ECU typically includes the ratio between the local clock frequency of the first ECU and the local clock frequency of the upper-level ECU, and that the target ECU can determine this ratio, the target ECU can determine the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU based on the ratio between the local clock frequency of the upper-level ECU and the target ECU, as well as the ratio between the local clock frequency of the first ECU sent by the upper-level ECU and the local clock frequency of the upper-level ECU. This determines the third clock frequency ratio. The timing result of the local clock is then corrected based on this third clock frequency ratio. For example, the target ECU can determine the theoretical timing result corresponding to the timing result at the local clock frequency of the first ECU based on this third clock frequency ratio and the timing result.

[0170] In this way, the target ECU can determine the time of the first ECU at the current moment based on the time recorded in the first clock synchronization information and the obtained theoretical timing results, and generate Sync based on the time of the first ECU at the current moment.

[0171] Similarly, as described above, after generating the Sync message, the target ECU can generate a Follow-up message. This Follow-up message records the exact time the Sync message left the target ECU, thus correcting the timestamp in the Sync message. For details on how the Follow-up message is generated, please refer to the description of the Follow-up message generation by the master clock node M1 above; it will not be repeated here.

[0172] In other embodiments, the target ECU may not modify the Sync message, that is, it may still forward the Sync message in the most recently received first clock synchronization information, and update the Follow up message based on the timing result of the local clock, that is, update the Correction field in the Follow up message based on the timing result.

[0173] For example, if the second duration corresponding to the target ECU is 2 seconds, and the target ECU restarts timing upon receiving the first clock synchronization information sent by the previous-level ECU, and does not receive the first clock synchronization information sent by the previous ECU within 2 seconds after the restart, then the target ECU can use the Sync message in the most recently received first clock synchronization information as the Sync message in the second clock synchronization information, update the Follow up message in the first clock synchronization information, and use the updated Follow up message as the Follow up message in the second clock synchronization information, thereby obtaining the second clock synchronization information. The update method for the Follow up message can be referred to the relevant description of updating the Follow up message in S1 above, and will not be repeated here.

[0174] In some embodiments, after the target ECU switches its current operating mode to proxy mode, it switches back to normal operating mode upon receiving the first clock synchronization information sent by the first ECU through the higher-level ECU.

[0175] In normal operating mode, the target ECU corrects the first clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, the target transmission delay parameter, and the first clock frequency ratio, and sends the corrected first clock synchronization information to the next-level ECU. The target transmission delay parameter is used to indicate the information transmission delay between the target ECU and the previous-level ECU, and the second clock frequency ratio is used to indicate the ratio between the local clock frequency of the previous-level ECU and the local clock frequency of the target ECU.

[0176] It is understandable that when the first clock synchronization information sent by the first ECU through the previous level ECU is received again, it means that the current target ECU can receive the first clock synchronization information normally. Since the first clock synchronization information is highly accurate, the target ECU needs to switch to normal working mode, realize clock synchronization with the first ECU based on the first clock synchronization information, correct the first clock synchronization information, and send the corrected first clock synchronization information to the next level ECU.

[0177] It should be noted that when the target ECU receives the first clock synchronization information again in proxy mode, it needs to immediately correct the first clock synchronization information and send the corrected first clock synchronization information to the next level ECU. This is to prioritize ensuring that ECUs other than the first ECU are clock synchronized with the first ECU. The method for correcting the first clock synchronization information in normal operating mode can refer to the above-described process for clock synchronization based on the first clock synchronization information, and will not be repeated here.

[0178] In some embodiments, when the target ECU is the last ECU in a cascade, since there is no next-level ECU in the cascade, the target ECU does not need to switch its current operating mode to proxy mode, even if it has not received the first clock synchronization information sent by the previous-level ECU, thus eliminating the need to generate the second clock synchronization information.

[0179] Optionally, considering the above descriptions of the first and second proxy modes, and taking into account that the target ECU still needs to ensure relatively accurate time information even if it does not receive the first clock synchronization information, when the target ECU is the last cascaded ECU, if the target ECU does not receive the first clock synchronization information within the first period after the vehicle is powered on, since the clock reference of the first ECU cannot be determined, the target ECU can directly determine the time information based on its local clock. If the target ECU receives the first clock synchronization information within the first period after the vehicle is powered on but does not receive it within the second period, the target ECU can determine the clock reference of the first ECU based on the historically received first clock synchronization information, and then determine the time information based on the clock reference of the first ECU. The process of determining the clock reference of the first ECU based on the historically received first clock synchronization information can be referred to the relevant description in the second proxy mode section above, and will not be repeated here.

[0180] In this embodiment, after the vehicle is powered on, the target ECU determines whether the initial master clock node is normal by monitoring whether it sends first clock synchronization information within a first duration. If the target ECU does not receive the first clock synchronization information within the first duration, it considers the initial master clock node to be abnormal. The target ECU then switches its current operating mode to the first proxy mode and sends second clock synchronization information so that subsequent cascaded ECUs can synchronize their clocks with the target ECU based on this second clock synchronization information. Furthermore, considering that even if the target ECU receives the first clock synchronization information within the first duration after the vehicle is powered on, it may still fail to receive it during subsequent clock synchronization processes due to equipment failure or other reasons, the target ECU, upon receiving the first clock synchronization information sent by the previous-level ECU within the first duration, determines whether it can receive the first clock synchronization information through a second duration, thereby achieving continuous monitoring of whether the first clock synchronization information can be received. This ensures that if the first clock synchronization information cannot be received, the target ECU can promptly achieve clock synchronization with subsequent cascaded ECUs through the second clock synchronization information, thus preventing the failure of the initial master clock node to achieve clock synchronization between all subsequent cascaded ECUs. This improves the stability of the vehicle's ECU clock synchronization.

[0181] Furthermore, considering that during clock synchronization based on clock synchronization information, if the target ECU has not yet measured the actual transmission delay parameter or the actual clock frequency ratio, it needs to wait for the actual transmission delay parameter and the actual clock frequency ratio to be measured before clock synchronization can be performed. In this embodiment, the target ECU stores initial transmission delay parameters and initial clock frequency ratios so that when clock synchronization is required but the actual transmission delay parameter or the actual clock frequency ratio has not yet been measured, clock synchronization can be achieved based on the stored initial transmission delay parameters and initial clock frequency ratios, thereby shortening the time required for clock synchronization and improving the efficiency of clock synchronization.

[0182] Figure 7 This is a schematic diagram of a vehicle clock synchronization device provided in an embodiment of this application. The vehicle includes multiple cascaded Electronic Control Units (ECUs). The first ECU in the cascaded ECUs serves as the initial master clock node, and the other ECUs in the cascaded ECUs serve as the initial slave clock nodes. The device is applied to a target ECU of the vehicle, which is any ECU in the cascaded ECUs except for the first ECU. The device includes: an information monitoring module 701, a mode conversion module 702, a clock synchronization module 703, and a storage module 704.

[0183] The information monitoring module 701 is used to monitor the first clock synchronization information sent by the first ECU through the previous level ECU when the vehicle is powered on. The first clock synchronization information is used to synchronize the clock between the target ECU and the first ECU.

[0184] The mode switching module 702 is used to switch the target ECU to the proxy mode after it has not received the first clock synchronization information sent by the upper-level ECU.

[0185] The clock synchronization module 703 is used to send second clock synchronization information to the next-level ECU in agent mode. The second clock synchronization information is used for clock synchronization between the next-level ECU and the target ECU.

[0186] Optionally, the mode conversion module 702 is used to start timing after the vehicle is powered on; if no first clock synchronization information is received from the upper-level ECU within the first duration after the timing starts, the current working mode is switched to the first agent mode.

[0187] The clock synchronization module 703 is used in the first agent mode to generate second clock synchronization information based on the local clock and the first clock frequency ratio, wherein the first clock frequency ratio is used to indicate the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU.

[0188] Optionally, the mode switching module 702 is used to start timing after the vehicle is powered on; if the first clock synchronization information sent by the upper-level ECU is received within the first duration after the timing starts, the timing is restarted when the first clock synchronization information sent by the upper-level ECU is received; if the first clock synchronization information sent by the upper-level ECU is not received within the second duration after the timing restarts, the current working mode is switched to the second agent mode, and the second duration is longer than the first duration.

[0189] The clock synchronization module 703 is used in the second agent mode to generate second clock synchronization information based on the most recently received first clock synchronization information, second clock frequency ratio and local clock timing result. The second clock frequency ratio is used to indicate the ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU.

[0190] Optionally, the clock synchronization module 703 is used to determine a third clock frequency ratio based on the most recently received first clock synchronization information and the second clock frequency ratio, wherein the third clock frequency ratio is used to indicate the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU; and to generate second clock synchronization information based on the most recently received first clock synchronization information, the timing result of the local clock and the third clock frequency ratio.

[0191] Optionally, the mode switching module 702 is used to switch the current operating mode to the normal operating mode when the first clock synchronization information sent by the first ECU through the previous level ECU is received again.

[0192] The clock synchronization module 703 is used to correct the first clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, the target transmission delay parameter, and the first clock frequency ratio in normal operating mode, and then send the corrected first clock synchronization information to the next-level ECU. The target transmission delay parameter is used to indicate the information transmission delay between the target ECU and the previous-level ECU, and the second clock frequency ratio is used to indicate the ratio between the local clock frequency of the previous-level ECU and the local clock frequency of the target ECU.

[0193] Optionally, the storage module 704 stores initial transmission delay parameters.

[0194] The clock synchronization module 703 is used to determine the initial transmission delay parameter as the target transmission delay parameter when the actual transmission delay parameter is not measured. The actual transmission delay parameter is used to indicate the actual information transmission delay between the target ECU and the previous level ECU. When the actual transmission delay parameter is measured, the actual transmission delay parameter is determined as the target transmission delay parameter.

[0195] The storage module 704 is used to update the initial transmission delay parameter to the actual transmission delay parameter when the difference between the actual transmission delay parameter and the initial transmission delay parameter is greater than the target difference.

[0196] Optionally, the storage module 704 stores the initial clock frequency ratio.

[0197] The clock synchronization module 703 is used to determine the initial clock frequency ratio as the second clock frequency ratio when the actual clock frequency ratio is not measured. The actual clock frequency ratio is used to indicate the actual ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU. When the actual clock frequency ratio is measured, the actual clock frequency ratio is determined as the second clock frequency ratio.

[0198] The storage module 704 is used to update the most recently measured actual clock frequency ratio to the initial clock frequency ratio when the vehicle is detected to be powered off.

[0199] In this embodiment, after the vehicle is powered on, the target ECU determines whether the initial master clock node is normal by monitoring whether it sends first clock synchronization information within a first duration. If the target ECU does not receive the first clock synchronization information within the first duration, it considers the initial master clock node to be abnormal. The target ECU then switches its current operating mode to the first proxy mode and sends second clock synchronization information so that subsequent cascaded ECUs can synchronize their clocks with the target ECU based on this second clock synchronization information. Furthermore, considering that even if the target ECU receives the first clock synchronization information within the first duration after the vehicle is powered on, it may still fail to receive it during subsequent clock synchronization processes due to equipment failure or other reasons, the target ECU, upon receiving the first clock synchronization information sent by the previous-level ECU within the first duration, determines whether it can receive the first clock synchronization information through a second duration, thereby achieving continuous monitoring of whether the first clock synchronization information can be received. This ensures that if the first clock synchronization information cannot be received, the target ECU can promptly achieve clock synchronization with subsequent cascaded ECUs through the second clock synchronization information, thus preventing the failure of the initial master clock node to achieve clock synchronization between all subsequent cascaded ECUs. This improves the stability of the vehicle's ECU clock synchronization.

[0200] Furthermore, considering that during clock synchronization based on clock synchronization information, if the target ECU has not yet measured the actual transmission delay parameter or the actual clock frequency ratio, it needs to wait for the actual transmission delay parameter and the actual clock frequency ratio to be measured before clock synchronization can be performed. In this embodiment, the target ECU stores initial transmission delay parameters and initial clock frequency ratios so that when clock synchronization is required but the actual transmission delay parameter or the actual clock frequency ratio has not yet been measured, clock synchronization can be achieved based on the stored initial transmission delay parameters and initial clock frequency ratios, thereby shortening the time required for clock synchronization and improving the efficiency of clock synchronization.

[0201] It should be noted that the vehicle clock synchronization device provided in the above embodiments is only illustrated by the division of the above functional modules when realizing vehicle clock synchronization. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the vehicle clock synchronization device and the vehicle clock synchronization method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0202] Figure 8 This is a structural block diagram of a vehicle 800 provided in an embodiment of this application. Typically, the vehicle 800 includes a processor 801 and a memory 802.

[0203] Processor 801 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0204] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 are used to store at least one instruction, which is executed by the processor 801 to implement the vehicle clock synchronization method provided in the method embodiments of this application.

[0205] In some embodiments, the vehicle 800 may also optionally include a peripheral device interface 803 and at least one peripheral device. The processor 801, memory 802, and peripheral device interface 803 can be connected via a bus or signal line. The peripheral device can be connected to the peripheral device interface 803 via a bus, signal line, or circuit board. Specifically, the peripheral device includes a radio frequency circuit 804.

[0206] Peripheral device interface 803 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 801 and memory 802. In some embodiments, processor 801, memory 802 and peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 801, memory 802 and peripheral device interface 803 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0207] The radio frequency (RF) circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 804 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 804 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 804 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application embodiment.

[0208] In some embodiments, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of the vehicle clock synchronization method described above. For example, the computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0209] It is worth noting that the computer-readable storage medium mentioned in the embodiments of this application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.

[0210] It should be understood that all or part of the steps of the above embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-described computer-readable storage medium.

[0211] That is, in some embodiments, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the steps of the vehicle clock synchronization method described above.

[0212] It should be understood that "at least one" as mentioned herein refers to one or more, and "multiple" refers to two or more. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In addition, in order to clearly describe the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and the terms "first," "second," etc., are not necessarily different.

[0213] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0214] The above descriptions are embodiments provided in this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for synchronizing a vehicle's clock, characterized in that, The vehicle includes multiple cascaded electronic control units (ECUs), with the first ECU in the cascaded array serving as the initial master clock node, and the other ECUs in the cascaded array serving as initial slave clock nodes; the method includes: When the vehicle is powered on, the target ECU monitors the first clock synchronization information sent by the first ECU through the next-level ECU. The first clock synchronization information is used to synchronize the clock between the target ECU and the first ECU. The target ECU is any ECU other than the first ECU among the cascaded multiple ECUs. After failing to receive the first clock synchronization information sent by the upper-level ECU, the target ECU switches its current operating mode to proxy mode. In proxy mode, the target ECU acts as the master clock node and sends the second clock synchronization information to the lower-level ECU. The second clock synchronization information is used for clock synchronization between the lower-level ECU and the target ECU. The step of the target ECU switching its current operating mode to proxy mode after not receiving the first clock synchronization information sent by the upper-level ECU includes: The timer begins after the vehicle is powered on. If the first clock synchronization information sent by the upper-level ECU is not received within the first duration after the start of the timing, the target ECU switches the current working mode to the first proxy mode; in the first proxy mode, the target ECU generates the second clock synchronization information based on the local clock and the first clock frequency ratio, wherein the first clock frequency ratio is used to indicate the ratio between the local clock frequency of the current master clock node and the local clock frequency of the target ECU. If the first clock synchronization information sent by the upper-level ECU is received within the first duration after the timing starts, the timing will restart upon receiving the first clock synchronization information sent by the upper-level ECU. If the first clock synchronization information sent by the upper-level ECU is not received within the second duration after the restart of the timing, the target ECU switches the current working mode to the second proxy mode, where the second duration is longer than the first duration. In the second proxy mode, the target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, and the timing result of the local clock. The second clock frequency ratio is used to indicate the ratio between the local clock frequency of the upper-level ECU and the local clock frequency of the target ECU.

2. The method as described in claim 1, characterized in that, The target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, and the timing result of the local clock, including: The target ECU determines a third clock frequency ratio based on the most recently received first clock synchronization information and the second clock frequency ratio. The third clock frequency ratio is used to indicate the ratio between the local clock frequency of the first ECU and the local clock frequency of the target ECU. The target ECU generates the second clock synchronization information based on the most recently received first clock synchronization information, the timing result of the local clock, and the third clock frequency ratio.

3. The method as described in claim 1, characterized in that, After the target ECU switches its current operating mode to proxy mode, the method further includes: Upon receiving the first clock synchronization information sent by the first ECU through the previous-level ECU, the target ECU switches its current operating mode to normal operating mode. In the normal operating mode, the target ECU corrects the first clock synchronization information based on the most recently received first clock synchronization information, the second clock frequency ratio, the target transmission delay parameter, and the first clock frequency ratio, and sends the corrected first clock synchronization information to the next-level ECU. The target transmission delay parameter is used to indicate the information transmission delay between the target ECU and the previous-level ECU, and the second clock frequency ratio is used to indicate the ratio between the local clock frequency of the previous-level ECU and the local clock frequency of the target ECU.

4. The method as described in claim 3, characterized in that, The target ECU stores initial transmission delay parameters; the method further includes: If the target ECU does not measure the actual transmission delay parameter, the initial transmission delay parameter is determined as the target transmission delay parameter, and the actual transmission delay parameter is used to indicate the actual information transmission delay between the target ECU and the upstream ECU; If the target ECU measures the actual transmission delay parameter, the actual transmission delay parameter is determined as the target transmission delay parameter. If the difference between the actual transmission delay parameter and the initial transmission delay parameter is greater than the target difference, the initial transmission delay parameter is updated to the actual transmission delay parameter.

5. The method as described in claim 1 or 3, characterized in that, The target ECU stores an initial clock frequency ratio; the method further includes: If the target ECU does not measure the actual clock frequency ratio, the initial clock frequency ratio is determined as the second clock frequency ratio, and the actual clock frequency ratio is used to indicate the actual ratio between the local clock frequency of the upstream ECU and the local clock frequency of the target ECU. When the target ECU measures the actual clock frequency ratio, the actual clock frequency ratio is determined as the second clock frequency ratio, and when the vehicle is detected to be powered off, the most recently measured actual clock frequency ratio is updated to the initial clock frequency ratio.

6. A clock synchronization device for a vehicle, characterized in that, The apparatus is used to perform the steps of the method as described in any one of claims 1-5.

7. A vehicle, characterized in that, The vehicle includes a memory and a processor, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory to perform the steps of the method described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Whole vehicle system time synchronization control method and device and storage medium

    CN109194434A

  • Self-adaptive master clock competition method and system for multistage clock synchronization network

    CN111431652A