A time synchronization method, device and electronic equipment of a vehicle domain controller
By utilizing the time synchronization method of SoC and GNSS modules in the vehicle domain controller, the problem of unstable time synchronization was solved, high-precision time synchronization was achieved, and the processing power of autonomous driving algorithms and driving safety were improved.
Patent Information
- Application Number
- CN202311741019.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-12-15
AI Technical Summary
Existing technologies suffer from unstable time synchronization in vehicle domain controllers, causing local time jumps and affecting the processing of autonomous driving algorithms.
The SoC module sends time synchronization messages to the MCU module, and the GNSS module sends CAN messages and PPS second pulse signals to perform timestamp and absolute time correction processing to ensure time synchronization between the SoC and MCU modules, shield bus transmission delay, and achieve high-precision time synchronization.
It improves the time synchronization accuracy of various components in the vehicle domain controller, avoids data mistransmission and misinterpretation caused by time asynchrony, and enhances the processing power of autonomous driving algorithms and driving safety.
Smart Images

Figure CN120161746B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle domain controller time synchronization, and in particular to a vehicle domain controller time synchronization method, device and electronic equipment. BACKGROUND
[0002] There are usually two times on the automatic driving domain controller, local time and absolute time. The local time is mainly used for automatic driving algorithms after synchronization between SoC, MCU and sensors. The absolute time is synchronized with the satellite and is used for functions such as application logs and storage.
[0003] In order to provide the automatic driving domain controller with the time synchronization function of local time and absolute time, in the prior art, a time synchronization server is usually needed to be set to complete the time synchronization with GNSS and the time service of SoC and MCU, thereby realizing time synchronization, which may cause 1s jump of local time and affect the processing of automatic driving algorithms.
[0004] Therefore, the present application proposes an improved vehicle domain controller time synchronization method to solve the above problems in the prior art. SUMMARY
[0005] In order to solve the above problems in the prior art, the present application provides a vehicle domain controller time synchronization method, device and electronic equipment.
[0006] In one aspect, the present application provides a vehicle domain controller time synchronization method, wherein the vehicle domain controller includes a system on chip (SoC) module, a microcontroller (MCU) module and a GNSS module, the GNSS module is in communication connection with the MCU module, and the MCU module is in communication connection with the SoC module, characterized in that the method comprises:
[0007] The SoC module sends a time synchronization message to the MCU module, wherein the time synchronization message contains local time information of the SoC module, so that the local time of the SoC module and the local time of the MCU module are synchronized;
[0008] The GNSS module sends a Can message to the MCU module, wherein the Can message contains absolute time T0 of UTC time, the MCU module acquires the absolute time T0, and at the same time, acquires a local time stamp t0 of the MCU module in a state that the MCU module receives the Can message, and sends the absolute time T0 and the local time stamp t0 of the MCU module to the SoC module;
[0009] The GNSS module sends a pps second pulse signal to the MCU module, and in the state that the MCU module receives the pps second pulse signal, acquires a local timestamp t1 of the MCU module, and sends the local timestamp t1 of the MCU module to the SoC module;
[0010] Based on the current local timestamp t2 acquired by the SoC module, and the received absolute time T0, the local timestamp t0 of the MCU module and the local timestamp t1 of the MCU module, time correction processing is performed to obtain the current absolute time T2 of the SoC module.
[0011] Further, before the time correction processing based on the current local timestamp t2 of the SoC module acquired by the SoC module, and the received absolute time T0, the local timestamp t0 of the MCU module and the local timestamp t1 of the MCU module, to obtain the current absolute time T2 of the SoC module, the method further comprises:
[0012] determining whether the time difference between the local timestamp t1 of the MCU module and the local timestamp t0 of the MCU module satisfies a preset time difference value condition;
[0013] If yes, based on the current local timestamp t2 of the SoC module acquired by the SoC module, and the received absolute time T0 and the local timestamp t1 of the MCU module, time correction processing is performed to obtain the current absolute time T2 of the SoC module.
[0014] Further, in the case that the time difference between the local timestamp t1 of the MCU module and the local timestamp t0 of the MCU module satisfies the preset time difference value condition, the time correction processing based on the current local timestamp t2 of the SoC module acquired by the SoC module, and the received absolute time T0 and the local timestamp t1 of the MCU module, to obtain the current absolute time T2 of the SoC module, comprises:
[0015] calculating a first time difference value between the current local timestamp t2 of the SoC module and the local timestamp t1 of the MCU module;
[0016] The current absolute time T2 of the SoC module is the sum of the absolute time T0 and the first time difference value.
[0017] Further, the SoC module sends a time synchronization message to the MCU module, and the time synchronization message contains local time information of the SoC module, so that the local time of the SoC module and the local time of the MCU module are synchronized, comprising:
[0018] The MCU module acquires time deviation information between the MCU module and the SoC module in response to the received time synchronization message;
[0019] and performs time adjustment based on the time deviation information, so that the local time of the SoC module and the local time of the MCU module are synchronized.
[0020] Further, the judgment whether the time difference between the local timestamp t1 of the MCU module and the local timestamp t0 of the MCU module satisfies a preset time difference value condition;
[0021] If not, the absolute time T0 and the local timestamp t1 of the MCU module of the previous group are selected, the SoC module receives a group of absolute time T0 and local timestamp t1 of the MCU module data every second; the time difference value between the current local timestamp t2 of the SoC module and the local timestamp t1 of the MCU module of the previous group is calculated; and the current absolute time T2 of the SoC module is the sum of the absolute time T0 of the previous group and the time difference value.
[0022] On the other hand, the application provides a time synchronization device of a vehicle domain controller, the device comprising:
[0023] The device comprises:
[0024] A time synchronization unit for sending a time synchronization message from the SoC module to the MCU module, the time synchronization message containing local time information of the SoC module, so that the local time of the SoC module and the local time of the MCU module are synchronized;
[0025] A Can message sending processing unit for sending a Can message from the GNSS module to the MCU module, the Can message containing absolute time T0 of UTC time, the MCU module acquiring the absolute time T0, and simultaneously acquiring a local timestamp t0 of the MCU module in a state where the MCU module receives the Can message, and sending the absolute time T0 and the local timestamp t0 of the MCU module to the SoC module;
[0026] A pps second pulse signal sending processing unit for sending a pps second pulse signal from the GNSS module to the MCU module, and simultaneously acquiring a local timestamp t1 of the MCU module in a state where the MCU module receives the pps second pulse signal, and sending the local timestamp t1 of the MCU module to the SoC module;
[0027] a time correction processing unit configured to perform time correction processing based on a current local timestamp t2 of the SoC module, the absolute time T0 received, a local timestamp t0 of the MCU module, and a local timestamp t1 of the MCU module, to obtain a current absolute time T2 of the SoC module.
[0028] Further, the time correction processing unit is further configured to:
[0029] a determination unit configured to determine whether a time difference between the local timestamp t1 of the MCU module and the local timestamp t0 of the MCU module satisfies a preset time difference condition;
[0030] if yes, perform time correction processing based on the current local timestamp t2 of the SoC module, the absolute time T0 received, and the local timestamp t1 of the MCU module, to obtain the current absolute time T2 of the SoC module;
[0031] if no, select data of a previous set of absolute time T0 and local timestamp t1 of the MCU module, the SoC module receiving a set of absolute time T0 and local timestamp t1 of the MCU module every second; calculate a first time difference value between the current local timestamp t2 of the SoC module and the local timestamp t1 of the MCU module of the previous set; and the current absolute time T2 of the SoC module is a sum of the absolute time T0 of the previous set and the first time difference value.
[0032] Further, the time synchronization unit is configured to send a time synchronization packet to the MCU module, the time synchronization packet containing local time information of the SoC module, so that the local time of the SoC module and the local time of the MCU module are synchronized, and the time synchronization packet comprises:
[0033] the MCU module is configured to obtain time deviation information between the MCU module and the SoC module in response to receiving the time synchronization packet;
[0034] and perform time adjustment based on the time deviation information, so that the local time of the SoC module and the local time of the MCU module are synchronized.
[0035] In another aspect, the present application also provides an electronic device, which comprises a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the time synchronization method of the vehicle domain controller provided above.
[0036] In another aspect, the application also provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the time synchronization method of the vehicle domain controller provided above.
[0037] The time synchronization method of the vehicle domain controller provided by the application has the following beneficial effects:
[0038] In the application, the time synchronization message is first sent from the SoC module to the MCU module, so that the local time of the SoC module and the local time of the MCU module are synchronized, so that the local time of the MCU module is consistent with the master clock in the SoC module, and the operation of each component in the system can be based on a unified time standard, thereby improving the stability and efficiency of the system, avoiding the problem of serious data mis-transmission and mis-analysis caused by abnormal jump due to time asynchronization; then the GNSS module sends the Can message to the MCU module, the MCU module acquires the absolute time T0, and at the same time acquires the local time stamp t0 of the MCU module, and sends the absolute time T0 and the local time stamp t0 of the MCU module to the SoC module; the GNSS module sends the pps second pulse signal to the MCU module, and in the state that the MCU module receives the pps second pulse signal, acquires the local time stamp t1 of the MCU module, and then sends the local time stamp t1 of the MCU module to the SoC module; based on the current local time stamp t2 acquired by the SoC module, and the received absolute time T0, the local time stamp t0 of the MCU module and the local time stamp t1 of the MCU module, time correction processing is performed to obtain the current absolute time T2 of the SoC module, so that the local time of the SoC module and the MCU module which have been synchronized is used to shield the time delay of the message transmission on the Can and Eth buses through the self-owned communication protocol and the calculation of the UTC time and the time triggered by the pps, and finally the high-precision absolute time is obtained, and the precision level of the time synchronization of the local time and the absolute time is improved. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0040] Figure 1 The flowchart of the time synchronization method of the vehicle domain controller provided by the embodiments of the application;
[0041] Figure 2 A flow chart of a method for local time synchronization between a SoC module and an MCU module is provided in the embodiments of the present application.
[0042] Figure 3 A flow chart of a method for time synchronization of a vehicle domain controller is provided in the embodiments of the present application.
[0043] Figure 4 A flow chart of a method for time synchronization of a vehicle domain controller is provided in the embodiments of the present application.
[0044] Figure 5 A block diagram of a time synchronization device of a vehicle domain controller is provided in the embodiments of the present application.
[0045] Figure 6 A time synchronization device of a vehicle domain controller is also provided in the embodiments of the present application.
[0046] Figure 7 A principle diagram of a method for time synchronization of a vehicle domain controller is provided in the embodiments of the present application.
[0047] Figure 8 A block diagram of an electronic device for time synchronization of a vehicle domain controller is provided in the embodiments of the present application. DETAILED DESCRIPTION
[0048] In order to make the technical personnel in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0049] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or apparatus that includes a series of steps or units does not necessarily limit to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or apparatus.
[0050] The embodiments will be described in detail below with reference to the accompanying drawings, which are presented for the purpose of illustration and description only, and not intended to limit the application as recited in the claims.
[0051] The present specification provides method operation steps as the embodiments or flowcharts, but more or less operation steps can be included based on routine or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders of the steps, and does not represent the only execution order. In actual system or server product execution, the method order shown in the embodiments or the accompanying drawings can be executed in sequence or in parallel (for example, in a parallel processing or multi-threaded processing environment).
[0052] Before the embodiments of the present application are further described, the terms and names involved in the embodiments of the present application are explained, and the terms and names involved in the embodiments of the present application are applicable to the following explanations.
[0053] The automatic driving domain controller is a controller specially used for automatic driving function, which is part of the automotive electronic control technology, and it mainly consists of three parts: domain master processor, operating system and application software and algorithm. Platformization, high integration, high performance and good compatibility are its main design ideas. With the help of high-performance domain master processor, rich hardware interface resources and powerful software function characteristics, it can integrate the core functions that originally need multiple ECUs to realize, greatly improving the integration of system functions. At the same time, through the standardization of data interaction interface, it can reduce the development and manufacturing cost.
[0054] SoC is the abbreviation of System on Chip, which refers to a system-level chip, which is an integrated circuit product that contains a complete system and all embedded software. At the same time, SOC is a technology used to implement the entire process from determining system functions to software / hardware division and completing the design.
[0055] MCU is the abbreviation of Microcontroller Unit, which refers to a microcontroller unit, also known as a single-chip microcomputer or single-chip microprocessor. It can integrate central processing unit (CPU), memory, counter, USB, A / D conversion, UART, PLC, DMA, and even LCD drive circuit on a single chip to form a chip-level computer, which is widely used in various fields such as mobile phones, PC peripherals, remote controls, and even automotive electronics, industrial stepper motors, and robot arm control.
[0056] GNSS is the abbreviation of Global Navigation Satellite System, which refers to all satellite navigation systems, including global, regional and enhanced. These systems transmit real-time position and time information through satellite signals, and ground receiving equipment can calculate geographical position such as latitude and longitude according to these information, and then provide all-weather three-dimensional coordinates and speed and time information for users at any location on the earth's surface or near space.
[0057] UTC is the abbreviation of Coordinated Universal Time, which refers to coordinated universal time or world standard time, also known as international coordinated time. It is a time measurement system based on atomic time second length, which is as close as possible to the time of world time. In daily life, the time we use is usually local time, which is equal to the local time in the time zone we are in (or use), which is defined by the offset between world standard time (UTC). Therefore, UTC time is the time used all over the world, which is not affected by local time zone and time setting.
[0058] gPTP is the abbreviation of general precise time protocol, which is the full name of "general precise time protocol" defined by IEEE 802.1AS standard. Its main goal is to ensure the consistency of time between all devices in the local area network, with synchronization accuracy within ±0ns. This synchronization accuracy can reach nanosecond level (the maximum clock error between any node within 6 hops is not more than 1us), so it is widely used in fields with high real-time requirements such as vehicle-mounted and industrial control. Unlike other time synchronization protocols, gPTP achieves high-precision time synchronization through node constraints within the network. It can be seen that gPTP is an effective time synchronization protocol that can achieve high-precision time synchronization on different transmission media.
[0059] Timestamp is a sequence of numbers or characters representing the time at a certain moment, often used to record the time of data or information creation or change. In many programming languages, timestamps are often used to get system time. Timestamps can be divided into several types, including Unix timestamp, millisecond timestamp, etc. In this application, it refers to Unix timestamp, which is the number of seconds elapsed since January 1, 1970 (midnight UTC / GMT), without considering leap seconds.
[0060] An application scenario of an embodiment of the present application is that a system on chip (SoC) module, a micro controller unit (MCU) module and a GNSS module are included on a vehicle domain controller, the MCU module communicates with the SoC module through Eth, and the MCU module communicates with the GNSS module through a Can bus and IO. The MCU module periodically acquires signals and time information from the GNSS module. In the case of the above hardware limitation, the present application provides high-precision absolute time from the MCU module to the SoC module, while not affecting local time synchronization between the SoC module and the MCU module.
[0061] The following specific application is described with reference to the Figure 1 , Figure 1 is a flowchart of a time synchronization method of a vehicle domain controller provided by an embodiment of the present application. The present specification provides method operation steps as in the embodiments or flowcharts, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders of the steps, and does not represent the only execution order. In actual system or server product execution, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, the method is applied to a system on chip (SoC) module 1, a micro controller unit (MCU) module 2 and a GNSS module 3, the GNSS module 3 is in communication connection with the MCU module 2, the MCU module 2 is in communication connection with the SoC module 1, and the method can include S101-S109:
[0062] S101: The SoC module 1 sends a time synchronization message to the MCU module 2, the time synchronization message containing local time information of the SoC module 1, so that the local time of the SoC module 1 and the local time of the MCU module 2 are synchronized;
[0063] Specifically, the MCU module 2 and the SoC module 1 on the domain controller transmit information through a first Eth protocol stack 12 and a second Eth protocol stack 24.
[0064] It should be noted that the time synchronization message is a communication protocol in computer networks, mainly used for synchronizing the time of each device in the network. The most representative one is the NTP (Network Time Protocol) protocol, which belongs to the TCP / IP protocol suite. It is based on the user datagram protocol (UDP) and the port number is 123. The synchronization process of the protocol relies on coordinated universal time (UTC), which is the time standard universally adopted by the global Internet. In the NTP protocol, a device can act as an NTP server, and other devices act as clients, which communicate with the NTP server to obtain and calibrate their system time.
[0065] Specifically, the implementation of the NTP protocol mainly includes the following steps: first, the client sends a time request message to the NTP server; then, after receiving the request, the server replies with a message containing the current time information and error value; finally, the client adjusts its system time according to the received message information. In this way, the NTP protocol can achieve clock synchronization of various devices in the network, thereby ensuring that these devices can operate based on a unified time standard.
[0066] Specifically, the SoC module 1 includes a gPTP module 11, which periodically sends a time synchronization message through the first Eth protocol stack 12. The time synchronization message conforms to the IEEE Standard 802.1AS protocol and contains the local time information of the SoC module 1. The local time information of the SoC module 1 can be understood as the time information of the master clock in the SoC module 1, which generally includes elements such as year, month, day, hour, minute, and second. The main function of the gPTP module 11 is to achieve precise time synchronization between nodes in all local area networks, with an error of nanoseconds.
[0067] Specifically, the local time of the MCU module 2 usually refers to the time interval of the pulse signal generated by the clock oscillator inside the MCU module 2. This time interval is usually expressed in seconds (s). Due to the different working frequencies of this internal clock oscillator, different clock frequencies are generated.
[0068] In some embodiments, to improve system performance and reduce power consumption, the local time of the MCU with lower precision can be corrected by using methods such as the 1PPS signal of the GNSS module 3 receiver, thereby obtaining the local time of the MCU with high precision synchronized with the GNSS time.
[0069] Further, the gPTP module 11 in the SoC module 1 can send a time synchronization message carrying the time information of the master clock in the SoC module 1. After receiving these messages, the MCU module 2 adjusts its local time according to the time information in the messages, thereby making the local time of the MCU module 2 consistent with the master clock in the SoC module 1.
[0070] In the embodiments of the present application, the main purpose of synchronizing the local time of the SoC module 1 with the local time of the MCU module 2 is to ensure that the operations of various components in the system can be based on a unified time standard, thereby improving the stability and efficiency of the system, and thereby avoiding the problem of serious data miscommunication and misanalysis caused by abnormal jumps due to time asynchronization.
[0071] S103: The GNSS module 3 sends a Can message to the MCU module 2, the Can message containing an absolute time T0 of UTC time, the MCU module 2 acquires the absolute time T0, and at the same time, in the state of receiving the Can message by the MCU module 2, acquires a local timestamp t0 of the MCU module 2, and sends the absolute time T0 and the local timestamp t0 of the MCU module 2 to the SoC module 1;
[0072] Specifically, the UTC module 31 in the GNSS module 3 sends a Can message to the MCU module 2 through the Can protocol stack 22.
[0073] Specifically, the time management module 21 in the MCU module 2 requests a timestamp t0 to the time management module 21 in the state of receiving the Can message by the MCU module 2, so as to convert the time into a local time or a relative time with respect to other events.
[0074] Specifically, T0 is an absolute time in the UTC message, which is a global unified and accurate time standard, and t0 is a timestamp requested by the time management module 21 to the Can protocol stack 22, the relationship between T0 and t0 is that t0 is acquired based on T0, and the difference between them is usually represented as Δt=t0-T0, and the difference is caused by the deviation between the local time and the UTC time.
[0075] Specifically, the UTC time can be converted into the local time of the device through the Can protocol stack 22 in the present application, so as to realize accurate time management and data transmission.
[0076] Specifically, the MCU module 2 sends the absolute time T0 and the local time t0 to the SoC module 1 through the second Eth protocol stack 24, and the SoC module 1 further includes a time module 13, which can record the received absolute time T0 and local time t0.
[0077] It should be noted that the time module 13 in the SoC module 1 is mainly used to generate and manage clock signals to synchronize and coordinate various components in the SoC module 1, such as CPU, DRAM controller, serial port and GPIO, etc.
[0078] Specifically, as shown in Figure 2 S103 includes S201-S203:
[0079] S201: The MCU module 2 acquires time deviation information of the MCU module 2 and the SoC module 1 in response to the received time synchronization message;
[0080] S203: and based on the time deviation information, the local time of the SoC module 1 and the local time of the MCU module 2 are synchronized by time adjustment.
[0081] Further, the time offset information refers to the time difference between the master clock in the SoC module 1 and the slave clock of the MCU module 2, and the time difference is measured in nanoseconds.
[0082] For example, when the gPTP module 11 in the SoC module 1 sends a time synchronization message containing time information a1 to the MCU module 2 at a certain time a1, the MCU module 2 will calculate the time offset between the local time and the time information in the message after receiving the synchronization message, and adjust the local time to keep consistent with the local time of the SoC module 1.
[0083] S105: The GNSS module 3 sends a pps second pulse signal to the MCU module 2, and in the state that the MCU module 2 receives the pps second pulse signal, acquires the local timestamp t1 of the MCU module 2, and sends the local timestamp t1 of the MCU module 2 to the SoC module 1.
[0084] Specifically, the PPS module 32 is included in the GNSS module 3, and the PPS module 32 is mainly used to generate a signal of an accurate pps second pulse per second, and the signal of the pps second pulse is used as an accurate time reference. The signal has very high accuracy, which can reach the level of tens of nanoseconds.
[0085] Specifically, the IO module 23 is also included in the MCU module 2, the pps second pulse signal sent by the PPS module 32 is transmitted to the IO module 23 through the input interface of the IO module 23, and the IO module 23 of the MCU module 2 detects the pulse signal and requests the local timestamp of the MCU module 2 to the time management module 21 of the MCU module 2, which is recorded as t1.
[0086] It should be noted that generally, the pps second pulse is several milliseconds later than the UTC message, and since the transmission speed of the IO module 23 is much faster than the transmission speed of the Can protocol stack 22, the pps second pulse is used to represent the whole second time of the above-mentioned UTC time, that is, t1 and T0 represent the same time.
[0087] Specifically, the MCU module 2 sends the local timestamp t1 of the MCU module 2 to the SoC module 1 through the second Eth protocol stack 24, and records the local timestamp t1 of the MCU module 2 through the time module 13 in the SoC module 1.
[0088] S107: Based on the current local timestamp t2 obtained by the SoC module 1, and the absolute time T0 received, the local timestamp t0 of the MCU module 2 and the local timestamp t1 of the MCU module 2, time correction processing is performed to obtain the current absolute time T2 of the SoC module 1.
[0089] Specifically, before step S107, S106 is further included, as shown in Figure 3
[0090] S106: judging whether a time difference between the local timestamp t1 of the MCU module 2 and the local timestamp t0 of the MCU module 2 meets a preset time difference value condition;
[0091] Specifically, the preset time difference value condition refers to a period in which the PPS module 32 sends one pps second pulse.
[0092] Further, if the preset time difference value is met, a time correction process is performed based on the current local timestamp t2 of the SoC module 1 obtained by the SoC module 1, and the absolute time T0 received and the local timestamp t1 of the MCU module 2, to obtain the current absolute time T2 of the SoC module 1.
[0093] In another embodiment, if the preset time difference value is not met, the last group of absolute time T0 and the local timestamp t1 of the MCU module 2 are selected, and the SoC module 1 receives one group of absolute time T0 and the local timestamp t1 of the MCU module 2 per second;
[0094] Further, a first time difference value between the current local timestamp t2 of the SoC module 1 and the last group of local timestamp t1 of the MCU module 2 is calculated, and the current absolute time T2 of the SoC module 1 is the sum of the last group of absolute time T0 and the first time difference value.
[0095] Specifically, the SoC module 1 further includes an application module, which is a hardware and / or software component for executing specific functions in the SoC module 1.
[0096] In the SoC module 1, the purpose of the application module requesting the absolute time T2 from the time module 13 is mainly to synchronize and coordinate the work of various components in the SoC module 1, so as to realize efficient, low-power and high-performance system operation.
[0097] Specifically, while the application module requests the absolute time T2 from the time module 13, the time module 13 obtains the current local timestamp t2 of the SoC module 1.
[0098] Specifically, as shown in Figure 4 S107 includes S301-S302:
[0099] S301: calculating a first time difference value between the current local timestamp t2 of the SoC module 1 and the local timestamp t1 of the MCU module 2;
[0100] Specifically, the first time difference value is t2-t1.
[0101] S303: The current absolute time T2 of the SoC module 1 is the sum of the absolute time T0 and the first time difference value.
[0102] Specifically, as can be known from the above step S105, t1 and T0 represent the same time, so that the current absolute time T2 can be obtained by adding the time t2 and t1 elapsed in between on the basis of T0, that is, T2 = T0 + (t2-t1).
[0103] In summary, in the present application, the time synchronization message is first sent by the SoC module 1 to the MCU module 2, so that the local time of the SoC module 1 and the local time of the MCU module 2 are synchronized, so that the local time of the MCU module 2 is consistent with the master clock in the SoC module 1, and the operation of each component in the system can be based on a unified time standard, thereby improving the stability and efficiency of the system, avoiding the problem of serious data mis-transmission and mis-analysis caused by abnormal jump due to time asynchronization; then the GNSS module 3 sends the Can message to the MCU module 2, the MCU module 2 acquires the absolute time T0, and at the same time acquires the local time stamp t0 of the MCU module 2, and sends the absolute time T0 and the local time stamp t0 of the MCU module 2 to the SoC module 1; the GNSS module 3 sends the pps second pulse signal to the MCU module 2, controls the IO unit in the MCU module 2 to terminate, and in the state that the MCU module receives the pps second pulse signal, the MCU module 2 acquires the local time stamp t1 of the MCU module 2, and then sends the local time stamp t1 of the MCU module 2 to the SoC module 1; based on the current local time stamp t2 acquired by the SoC module 1, and the received absolute time T0, the local time stamp t0 of the MCU module 2 and the local time stamp t1 of the MCU module 2, time correction processing is performed to obtain the current absolute time T2 of the SoC module 1, so that through the own communication protocol and the calculation of the UTC time and the time triggered by the pps, the time delay of the message transmission on the Can and Eth bus is shielded, and finally the high-precision absolute time is obtained.
[0104] Based on the above technical solution, the problem of time synchronization in the automatic driving process is reduced, and the processing capability of the vehicle automatic driving algorithm is improved, and finally the driving safety and driving experience of the user are improved.
[0105] On the other hand, the present application also provides a time synchronization device of a vehicle domain controller, Figure 5 is a block diagram of a time synchronization device of a vehicle domain controller provided by the present application, as Figure 5 shown, the device comprises:
[0106] The time synchronization unit 401 is configured to send a time synchronization message to the MCU module 2 by the SoC module 1, and the time synchronization message contains local time information of the SoC module 1, so that the local time of the SoC module 1 is synchronized with the local time of the MCU module 2.
[0107] The Can message sending processing unit 402 is configured to send a Can message to the MCU module 2 by the GNSS module 3, and the Can message contains absolute time T0 of UTC time, the MCU module 2 acquires the absolute time T0, and at the same time, acquires a local time stamp t0 of the MCU module 2 in a state that the Can message is received by the MCU module 2, and sends the absolute time T0 and the local time stamp t0 of the MCU module 2 to the SoC module 1.
[0108] The pps second pulse signal sending processing unit 403 is configured to send a pps second pulse signal to the MCU module 2 by the GNSS module 3, and at the same time, acquires a local time stamp t1 of the MCU module 2 in a state that the pps second pulse signal is received by the MCU module 2, and sends the local time stamp t1 of the MCU module 2 to the SoC module 1.
[0109] The time correction processing unit 405 is configured to perform time correction processing based on the current local time stamp t2 of the SoC module 1 acquired by the SoC module 1, and the absolute time T0, the local time stamp t0 of the MCU module 2 and the local time stamp t1 of the MCU module 2 received, to obtain current absolute time T2 of the SoC module 1.
[0110] In some embodiments, the time synchronization unit 401 is further configured to:
[0111] The MCU module 2 acquires time deviation information between the MCU module 2 and the SoC module 1 in response to the received time synchronization message.
[0112] And based on the time deviation information, the local time of the SoC module 1 is adjusted to be synchronized with the local time of the MCU module 2.
[0113] In another embodiment, between the time correction processing unit 405 and the pps second pulse signal sending processing unit 403, there is further:
[0114] The judging unit 404 is configured to judge whether a time difference between the local time stamp t1 of the MCU module 2 and the local time stamp t0 of the MCU module 2 meets a preset time difference value condition.
[0115] If yes, the time correction processing is performed based on the current local time stamp t2 of the SoC module 1 acquired by the SoC module 1, and the absolute time T0 and the local time stamp t1 of the MCU module 2 received, to obtain current absolute time T2 of the SoC module 1.
[0116] If no, the T0 and t1 data of the last group are selected, and the SoC module 1 receives a group of T0 and t1 data per second; the time difference between the current local timestamp t2 of the SoC module 1 and the last local timestamp t1 of the MCU module 2 is calculated; and the current absolute time T2 of the SoC module 1 is the sum of the last absolute time T0 and the time difference.
[0117] The device and method embodiments in the present application are based on the same application concept.
[0118] In another aspect, the present application also provides another time synchronization device of a vehicle domain controller, Figure 6 is a constituent structure diagram of another time synchronization device of a vehicle domain controller provided by the present application, as Figure 6 shown, the device comprises an SoC module 1, an MCU module 2 and a GNSS module 3; the SoC module 1 is in communication with the MCU module 2; and the MCU module 2 is in communication with the GNSS module 3.
[0119] Further, the SoC module 1 comprises a gPTP module 11, a first Eth protocol stack 12 and a time module 13;
[0120] Further, the MCU module 2 comprises a time management module 21, a Can protocol stack 22, an IO module 23 and a second Eth protocol stack 24;
[0121] Further, the GNSS module 3 comprises a UTC module 31 and a PPS module 32;
[0122] Based on the constituent structure of the above-mentioned time synchronization device of a vehicle domain controller, the present application also provides a method principle diagram for time synchronization of a vehicle domain controller, as Figure 7 shown,
[0123] Specifically, the gPTP module 11 in the SoC module 1 can periodically send a time synchronization message (the time synchronization message conforms to the IEEE Standard 802.1AS protocol) through the Eth communication protocol 13, so as to synchronize the local time of the MCU module 2 with the local time of the SoC module 1; thereby ensuring that the operations of various components in the system can be based on a unified time standard, and further improving the stability and efficiency of the system.
[0124] Specifically, the MCU module 2 receives the Can message sent by the GNSS module 3 through the Can protocol stack 22, and the message stores the absolute time T0 of the UTC time; at the same time when the MCU module 2 receives the Can message, the MCU module 2 requests the local timestamp t0 of the MCU module 2 to the time management module 21, and then sends the local timestamp t0 of the MCU module 2 and the absolute time T0 to the time module 13 in the SoC module 1 through the second Eth protocol stack 24.
[0125] Specifically, the Can message sent by the UTC module 31 in the GNSS module 3 is transmitted to the MCU module 2 through the Can protocol stack 22; the pps second pulse signal sent by the PPS module 32 in the GNSS module 3 is transmitted to the IO module 23 through the input interface of the IO module 23, the IO module 23 of the MCU module 2 detects the pulse signal, and requests the local timestamp t1 to the time management module 21 of the MCU module 2, and then the MCU module 2 sends the local timestamp t1 of the MCU module 2 to the time module 13 through the second Eth protocol stack 24.
[0126] The device and method embodiments in the embodiments of the application are based on the same application concept.
[0127] In another aspect, the embodiments of the application also provide an electronic device, which includes a processor and a memory, the memory stores at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the time synchronization method of the vehicle domain controller provided by the above method embodiments.
[0128] The memory can be used to store software programs and modules, and the processor can execute various function applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by functions, etc.; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0129] The method embodiments provided by the embodiments of the application can be executed in a mobile terminal, a computer terminal, a server or similar computing device, etc. electronic equipment.
[0130] The method embodiments provided by the embodiments of the present application can be executed in an electronic device such as a mobile terminal, a computer terminal, a server or the like. Figure 8 is a hardware structure block diagram of an electronic device of a time synchronization method of a vehicle domain controller provided by the embodiments of the present application. As shown in the figure, Figure 8 the electronic device 900 can have a great difference due to different configurations or performances, and can include one or more central processing units (CPU) 910 (the processor 910 can include but is not limited to a microprocessor MCU or a programmable logic device FPGA and the like processing device), a memory 930 for storing data, one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be temporary storage or persistent storage. The program stored in the storage medium 920 can include one or more modules, each of which can include a series of instruction operations in the electronic device. Further, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the electronic device 900. The electronic device 900 can also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or one or more operating systems 921, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM and the like.
[0131] The input and output interface 940 can be used to receive or send data via a network. The above-mentioned specific examples of the network can include a wireless network provided by the communication provider of the electronic device 900. In one example, the input and output interface 940 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the input and output interface 940 can be a radio frequency (Radio Frequency, RF) module for communicating with the Internet in a wireless manner.
[0132] Those of ordinary skill in the art can understand that, Figure 8 the structure shown is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 900 can also include more or fewer components than those shown in Figure 8 or have a different configuration from Figure 8 shown.
[0133] The embodiment of the present application further provides a computer readable storage medium, the storage medium can be arranged in an electronic device to save at least one instruction or at least one program for implementing a time synchronization method of a vehicle domain controller in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the time synchronization method of the vehicle domain controller provided in the above method embodiment.
[0134] Optionally, in the embodiment, the storage medium can be located in at least one of a plurality of network servers of a computer network. Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various storage program codes.
[0135] According to an aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the various optional implementation manners.
[0136] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments. The above-mentioned embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in different order from the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or advantageous.
[0137] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. Especially, the device embodiments are described simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.
[0138] Those skilled in the art can understand that all or part of the above-mentioned steps of the embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disk.
[0139] The above description is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A time synchronization method for a vehicle domain controller, the vehicle domain controller comprising a SoC module (1), an MCU module (2), and a GNSS module (3), wherein the GNSS module (3) is communicatively connected to the MCU module (2), and the MCU module (2) is communicatively connected to the SoC module (1), characterized in that, The method includes: The SoC module (1) sends a time synchronization message to the MCU module (2). The time synchronization message contains the local time information of the SoC module (1), so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2). The GNSS module (3) sends a Can message to the MCU module (2). The Can message contains the absolute time T0 of UTC time. The MCU module (2) obtains the absolute time T0. At the same time, when the MCU module (2) receives the Can message, it obtains the local timestamp t0 of the MCU module (2) and sends the absolute time T0 and the local timestamp t0 of the MCU module (2) to the SoC module (1). The GNSS module (3) sends a pps second pulse signal to the MCU module (2). At the same time, when the MCU module (2) receives the pps second pulse signal, it obtains the local timestamp t1 of the MCU module (2) and sends the local timestamp t1 of the MCU module (2) to the SoC module (1). Based on the current local timestamp t2 obtained by the SoC module (1), and the received absolute time T0, the local timestamp t0 of the MCU module (2) and the local timestamp t1 of the MCU module (2), time correction processing is performed to obtain the current absolute time T2 of the SoC module (1).
2. The time synchronization method for a vehicle domain controller according to claim 1, characterized in that, Before performing time correction processing on the current local timestamp t2 of the SoC module (1) obtained based on the SoC module (1), and the received absolute time T0, the local timestamp t0 of the MCU module (2), and the local timestamp t1 of the MCU module (2) to obtain the current absolute time T2 of the SoC module (1), the method further includes: Determine whether the time difference between the local timestamp t1 of the MCU module (2) and the local timestamp t0 of the MCU module (2) meets the preset time difference condition; If so, time correction processing is performed based on the current local timestamp t2 of the SoC module (1) obtained by the SoC module (1), the received absolute time T0 and the local timestamp t1 of the MCU module (2) to obtain the current absolute time T2 of the SoC module (1).
3. The time synchronization method for a vehicle domain controller according to claim 2, characterized in that, Under the condition that the time difference between the local timestamp t1 and the local timestamp t0 of the MCU module (2) satisfies a preset time difference value, the time correction processing based on the current local timestamp t2 of the SoC module (1) obtained by the SoC module (1), the received absolute time T0 and the local timestamp t1 of the MCU module (2) to obtain the current absolute time T2 of the SoC module (1) includes: Calculate the first time difference between the current local timestamp t2 of the SoC module (1) and the local timestamp t1 of the MCU module (2); The current absolute time T2 of the SoC module (1) is the sum of the difference between the absolute time T0 and the first time.
4. The time synchronization method for a vehicle domain controller according to claim 1, characterized in that, The SoC module (1) sends a time synchronization message to the MCU module (2). The time synchronization message contains the local time information of the SoC module (1), so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2), including: In response to the received time synchronization message, the MCU module (2) obtains the time deviation information between the MCU module (2) and the SoC module (1); The time is adjusted based on the time deviation information so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2).
5. The time synchronization method for a vehicle domain controller according to claim 2, characterized in that, The determination is made as to whether the time difference between the local timestamp t1 and the local timestamp t0 of the MCU module (2) meets the preset time difference condition. If not, the data of the absolute time T0 of the previous set and the local timestamp t1 of the MCU module (2) are selected. The SoC module (1) receives a set of absolute time T0 and local timestamp t1 of the MCU module (2) every second. Calculate the first time difference between the current local timestamp t2 of the SoC module (1) and the local timestamp t1 of the previous MCU module (2); The current absolute time T2 of the SoC module (1) is the sum of the difference between the previous absolute time T0 and the first time.
6. A time synchronization device for a vehicle domain controller, characterized in that, The device includes: A time synchronization unit is used for the SoC module (1) to send a time synchronization message to the MCU module (2). The time synchronization message contains the local time information of the SoC module (1), so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2). Can message sending processing unit, used by GNSS module (3) to send Can message to MCU module (2), the Can message contains absolute time T0 of UTC time, MCU module (2) obtains the absolute time T0, and at the same time, when MCU module (2) receives the Can message, obtains the local timestamp t0 of MCU module (2), and sends the absolute time T0 and the local timestamp t0 of MCU module (2) to SoC module (1). The pps second pulse signal transmission and processing unit is used to send the pps second pulse signal to the MCU module (2) via the GNSS module (3), and at the same time, when the MCU module (2) receives the pps second pulse signal, it obtains the local timestamp t1 of the MCU module (2) and sends the local timestamp t1 of the MCU module (2) to the SoC module (1). The time correction processing unit is used to perform time correction processing based on the current local timestamp t2 obtained by the SoC module (1), the received absolute time T0, the local timestamp t0 of the MCU module (2) and the local timestamp t1 of the MCU module (2) to obtain the current absolute time T2 of the SoC module (1).
7. The time synchronization device for the vehicle domain controller according to claim 6, characterized in that, The process also includes the following steps before the time correction processing unit: The judgment unit is used to determine whether the time difference between the local timestamp t1 of the MCU module (2) and the local timestamp t0 of the MCU module (2) meets the preset time difference condition. If so, then based on the current local timestamp t2 of the SoC module (1) obtained by the SoC module (1), the received absolute time T0 and the local timestamp t1 of the MCU module (2), time correction processing is performed to obtain the current absolute time T2 of the SoC module (1); If not, the T0 and t1 data from the previous set are selected, and the SoC module (1) receives a set of T0 and t1 data per second; Calculate the time difference between the current local timestamp t2 of the SoC module (1) and the local timestamp t1 of the previous MCU module (2); The current absolute time T2 of the SoC module (1) is the sum of the absolute time T0 of the previous set and the time difference.
8. The time synchronization device for a vehicle domain controller according to claim 6, characterized in that, The time synchronization unit is used for the SoC module (1) to send a time synchronization message to the MCU module (2). The time synchronization message contains the local time information of the SoC module (1), so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2). It is also used for: In response to the received time synchronization message, the MCU module (2) obtains the time deviation information between the MCU module (2) and the SoC module (1); The time is adjusted based on the time deviation information so that the local time of the SoC module (1) is synchronized with the local time of the MCU module (2).
9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement a time synchronization method for a vehicle domain controller as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or instruction set is loaded and executed by a processor to implement a time synchronization method for a vehicle domain controller as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Vehicle-mounted ECU high-precision time synchronization method and device
CN112821974A
Method, device, equipment and storage medium for global navigation satellite system time synchronization
US20220397869A1