Vehicle-mounted high-precision time synchronization implementation method and system
By designating the sensor with the highest time accuracy as the Master and the other sensors as Slaves in the ADAS system, adding hard-wired connections, and synchronizing the time through IO control levels, the problem of sensor time asynchrony was solved, achieving higher-precision time synchronization and ensuring accurate judgment by the control module.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN KOTEI INFORMATICS
- Filing Date
- 2023-03-28
- Publication Date
- 2026-05-12
AI Technical Summary
In automotive ADAS systems, time asynchrony of sensors can lead to incorrect judgments by the control module, and existing methods of time synchronization via CAN have unexpected deviations.
In an ADAS system, among multiple sensors, the sensor with the highest time accuracy is designated as the Master, and the other sensors are designated as Slaves. By adding hardwired connections, the Master notifies the Slave of the synchronization start time through IO control levels and calculates the absolute time of the Slave based on the timestamp sent by the Master, thus achieving high-precision time synchronization.
This improved the time synchronization accuracy between sensors, reduced time deviations caused by CAN communication, and ensured accurate judgment by the control module.
Smart Images

Figure CN116488760B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive ADAS, and more specifically, to a method and system for achieving high-precision time synchronization in vehicles. Background Technology
[0002] In today's context of connectivity and intelligence, cars are becoming increasingly intelligent, enhancing safety in numerous situations by detecting the vehicle's surroundings and proactively avoiding dangerous behaviors. To achieve this, cars are equipped with a multitude of sensors, including cameras and radar, increasing their perception capabilities and enabling them to observe changes in their surroundings in real time. Based on these changes, they can make appropriate controls. For example, on highways, mid-range cameras and lidar can detect lane markings, nearby obstacles, and distant obstacles, allowing for proactive lane changes and braking to prevent accidents.
[0003] A typical safety system is the ADAS system, which uses sensors such as cameras and radar. The radar and cameras (with independent processors) send the collected data to the control module, which then fuses and analyzes this data to ultimately provide the most appropriate control for the vehicle. However, because a car is a moving object and its surrounding environment changes rapidly, if the information reported by the radar and the camera is out of sync, the control module may make incorrect judgments.
[0004] To solve this time synchronization problem, the most common method used in vehicle systems is to synchronize time via CAN.
[0005] The principle is as follows: an ECU (Master) with high time accuracy sends two frames of messages to the CAN bus through the CAN message cycle, and the synchronized ECU (Slave) uses the content of these two frames of messages to synchronize the time.
[0006] The current solution ignores the CAN transmission time. However, in reality, there are many factors between when the CAN message is sent from the Master's time module and when it is received by the Slave, including the transmission time of the CAN data inside the Master, the CAN bus's time, and the transmission time of the CAN data on the hardware. This can lead to unexpected deviations in the synchronization time. Summary of the Invention
[0007] This invention addresses the technical problems existing in the prior art by providing a method and system for achieving high-precision time synchronization in vehicles.
[0008] According to a first aspect of the present invention, a method for achieving high-precision time synchronization in a vehicle is provided, comprising:
[0009] For multiple different sensors in an ADAS system, the sensor with the highest time accuracy is designated as the Master, and the other sensors are designated as Slaves.
[0010] Add a hardwire between the Master and Slave;
[0011] The Master controls the hardline level via I / O to notify the Slave to start the synchronization time. Based on the timestamp of the synchronization frame sent by the Master, the absolute time of the Master sending the follow frame is calculated.
[0012] Time synchronization between the Slave and the Master is achieved based on the absolute time when the Master sends the follow-up frame.
[0013] Based on the above technical solution, the present invention can also be improved as follows.
[0014] Optionally, the Master controls the hardline level via I / O to notify the Slave to start the synchronization time. Based on the timestamp of the synchronization frame sent by the Master, the absolute time for the Master to send the follow-up frame is calculated, including:
[0015] The Master sends synchronization frames at predetermined intervals, sends the timestamp of time t0 at time t1, and sends the first hard-wired I / O level.
[0016] When the Slave receives the first hardwired IO level, it receives the synchronization level at time t2 via an interrupt and records the timestamp t2.
[0017] After receiving the synchronization frame at time t3, the Slave parses the timestamp t0;
[0018] After a fixed interval, the Master sends a follow-up frame, which includes the transmission time Δt0 of the CAN message synchronization frame during transmission and the second hard-wired IO level.
[0019] When Salve receives the second hardwired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp t4'.
[0020] After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
[0021] Optionally, one of the first hard-wired I / O level and the second hard-wired level is high and the other is low.
[0022] Optionally, after receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame, including:
[0023] The absolute time for the Master to send follow-up frames is t0 + Δt0 + t4' - t2.
[0024] Optionally, the step of achieving time synchronization between the Slave and the Master based on the absolute time of the Master sending follow-up frames includes:
[0025] The Slave's system time is adjusted based on the absolute time when the Master sends the follow-up frame.
[0026] According to a second aspect of the present invention, a vehicle-mounted high-precision time synchronization system is provided, comprising:
[0027] This includes Master and Slave. In an ADAS system with multiple different sensors, the sensor with the highest time accuracy is designated as Master, and the other sensors are designated as Slave. Hardwires are added between Master and Slave.
[0028] The Master is used to control the hardline level via I / O and notify the Slave to start the synchronization time.
[0029] The Slave is used to calculate the absolute time when the Master sends the follow-up frame based on the timestamp of the synchronization frame sent by the Master; and to achieve time synchronization between the Slave and the Master based on the absolute time when the Master sends the follow-up frame.
[0030] Optionally, the Master sends synchronization frames at a predetermined period, sends the timestamp of time t0 at time t1, and sends the first hard-wired I / O level;
[0031] When the Slave receives the first hardwired IO level, it receives the synchronization level at time t2 via an interrupt and records the timestamp t2.
[0032] After receiving the synchronization frame at time t3, the Slave parses the timestamp t0;
[0033] After a fixed interval, the Master sends a follow-up frame, which includes the transmission time Δt0 of the CAN message synchronization frame during transmission and the second hard-wired IO level.
[0034] When Salve receives the second hardwired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp t4'.
[0035] After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
[0036] Optionally, the step of achieving time synchronization between the Slave and the Master based on the absolute time of the Master sending follow-up frames includes:
[0037] The Slave's system time is adjusted based on the absolute time when the Master sends the follow-up frame.
[0038] According to a third aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the processor is configured to execute a computer management program stored in the memory to implement a method for implementing high-precision time synchronization in a vehicle.
[0039] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer management class program is stored, wherein when the computer management class program is executed by a processor, the steps of a method for implementing high-precision time synchronization in a vehicle are implemented.
[0040] This invention provides a method and system for achieving high-precision time synchronization in vehicles. By adding hardwires between sensors that are out of sync, the Master controls the level of the signal via I / O to notify the Slave to start the synchronization. Compared with the traditional method of time synchronization via CAN, the synchronization accuracy is higher. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the traditional vehicle-mounted time synchronization method.
[0042] Figure 2 A flowchart of a vehicle-mounted high-precision time synchronization method provided by the present invention;
[0043] Figure 3 This is a schematic diagram illustrating time synchronization between the Master and Slave in an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a vehicle-mounted high-precision time synchronization system provided by the present invention;
[0045] Figure 5 A schematic diagram of a possible hardware structure of an electronic device provided by the present invention;
[0046] Figure 6 This is a schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. In addition, the technical features of the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined with each other to form feasible technical solutions. Such combinations are not constrained by the order of steps and / or structural composition patterns, but must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0048] Figure 1 This is a flowchart illustrating a traditional in-vehicle time synchronization method. The steps for CAN time synchronization in an in-vehicle system include:
[0049] Step 1: The Master sends synchronization frames every 1 second. Figure 1 The timestamp of time t0 is sent at time t1;
[0050] Step 2: After receiving the synchronization frame at time t2, the Slave records the timestamp of time t2;
[0051] Step 3: The Master sends a follow-up frame after a fixed interval (100ms). The follow-up frame includes the time Δt0, which is... Figure 1 The time interval is (t1-t0).
[0052] Step 4: After receiving the follow-up frame at time t3, the Salve calculates the absolute time when the Master sent the follow-up frame. The calculation formula is as follows: t0 + Δt0 + t3 – t2).
[0053] The traditional approach uses the time difference of (t3-t2) to replace the FixT time, assuming that the two are equal. In practice, when CAN messages are not congested and flow smoothly, the calculated absolute time error is not large. However, if CAN messages are congested, the difference between (t3-t2) and FixT becomes larger, and the absolute time calculated using the original method has a significant error.
[0054] Based on this, the present invention provides a method for achieving high-precision time synchronization in vehicles, see [link to relevant documentation]. Figure 2 The time synchronization method includes:
[0055] S1. For multiple different sensors in the ADAS system, the sensor with the highest time accuracy is designated as the Master, and the other sensors are designated as Slaves. S2. A hardwire is added between the Master and Slaves. S3. The Master controls the level of the hardwire through IO to notify the Slave to start the synchronization time. Based on the timestamp of the synchronization frame sent by the Master, the absolute time of the Master sending the follow frame is calculated. S4. Based on the absolute time of the Master sending the follow frame, time synchronization between the Slave and the Master is achieved.
[0056] Understandably, different sensors are installed on the vehicle to sense the environmental information around the vehicle. When different sensors report the sensed information to the control module, the timing of the different sensors is inconsistent. Therefore, it is necessary to synchronize the timing of the different sensors.
[0057] Specifically, a hardwire is added between the Master and Slave; its working principle can be found in [link to documentation]. Figure 3 It mainly includes the following steps:
[0058] The Master controls the hardline level via I / O to notify the Slave to start the synchronization time. Based on the timestamp of the synchronization frame sent by the Master, the absolute time of the Master sending the follow-up frame is calculated, including:
[0059] The Master sends synchronization frames at predetermined intervals, sends the timestamp of time t0 at time t1, and sends the first hard-wired I / O level.
[0060] When the Slave receives the first hardwired IO level, it receives the synchronization level at time t2 via an interrupt and records the timestamp t2.
[0061] After receiving the synchronization frame at time t3, the Slave parses the timestamp t0;
[0062] After a fixed interval, the Master sends a follow-up frame, which includes the transmission time Δt0 of the CAN message synchronization frame during transmission and the second hard-wired IO level.
[0063] When Salve receives the second hardwired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp t4'.
[0064] After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
[0065] In this context, the first hard-wired I / O level and the second hard-wired I / O level each have a different level, one being high and the other low. After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame, including: Absolute time when the Master sent the follow-up frame = t0 + Δt0 + t4' - t2. Once the absolute time when the Master sent the follow-up frame is calculated, the Slave adjusts its own reporting time based on this absolute time.
[0066] Understandable, see Figure 3 and Figure 4 , Figure 4 In this architecture, a hardwire is added between the Master and Slave. The Master can send high and low level pulse signals to the Slave via the hardwire I / O. When sending synchronization or follow frames to the Slave, it uses CAN messages. When sending CAN message synchronization and follow frames, the Slave records a timestamp by pulling the hardwire high or low. Because data transmission on the hardwire is fast and congestion is avoided, the transmission time from the Master sending pulse signals via the hardwire (the Master sending pulses to the Slave by pulling the hardwire high or low) is the same. Therefore, the difference between the two timestamps recorded by the Slave is essentially equal to the time between the Master sending the synchronization and follow frames. Using the difference between the two timestamps recorded by the Slave to replace the time between the Master sending the synchronization and follow frames is highly accurate. Compared to traditional time synchronization via CAN, it is more precise. Because hardware I / O control is simple and the transmission speed is fast, it can efficiently synchronize the exact time points, solving the time deviations caused by software and hardware issues in CAN communication.
[0067] See Figure 4 This invention provides an in-vehicle high-precision time synchronization system, including a Master and a Slave. For multiple different sensors in an ADAS system, the sensor with the highest time accuracy is designated as the Master, and the other sensors as Slaves. A hardwire is added between the Master and the Slave. The Master controls the level of the hardwire via I / O to notify the Slave to begin synchronization. The Slave calculates the absolute time when the Master sends a follow-up frame based on the timestamp of the synchronization frame sent by the Master, and achieves time synchronization between the Slave and the Master based on the absolute time of the follow-up frame sent by the Master.
[0068] The Master sends synchronization frames at predetermined intervals, sending a timestamp of time t0 at time t1 and sending the first hard-wired I / O level. When the Slave receives the first hard-wired I / O level, it receives the synchronization level at time t2 via an interrupt and records the timestamp of time t2. After receiving the synchronization frame at time t3, the Slave parses the timestamp of time t0. The Master sends follow-up frames at fixed intervals, the follow-up frames including the transmission time Δt0 of the CAN message synchronization frame during transmission, and sends the second hard-wired I / O level. When the Slave receives the second hard-wired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp of time t4'. After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
[0069] The method of achieving time synchronization between Slave and Master based on the absolute time of Master sending follow-up frames includes: adjusting the Slave's system time based on the absolute time of Master sending follow-up frames.
[0070] It is understood that the vehicle-mounted high-precision time synchronization system provided by the present invention corresponds to the vehicle-mounted high-precision time synchronization method provided in the foregoing embodiments. The relevant technical features of the vehicle-mounted high-precision time synchronization system can be referred to the relevant technical features of the vehicle-mounted high-precision time synchronization method, and will not be repeated here.
[0071] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating an embodiment of the electronic device provided in this invention. For example... Figure 5 As shown, an embodiment of the present invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 511, it implements the steps of a vehicle-mounted high-precision time synchronization method.
[0072] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. (See diagram below.) Figure 6 As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 511 is stored. When the computer program 511 is executed by a processor, it implements the steps of the following vehicle-mounted high-precision time synchronization method.
[0073] This invention provides a method and system for achieving high-precision time synchronization in vehicles. By adding hardwires between sensors that are not in sync with time, the Master controls the level of the signal via I / O to notify the Slave to start the synchronization. Compared with the traditional method of time synchronization via CAN, this method achieves higher synchronization accuracy.
[0074] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0075] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0076] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0077] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0078] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.
[0079] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0080] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for achieving high-precision time synchronization in a vehicle, characterized in that, include: For multiple different sensors in an ADAS system, the sensor with the highest time accuracy is designated as the Master, and the other sensors are designated as Slaves. Add a hardwire between the Master and Slave; The Master controls the hardline level via I / O to notify the Slave to start the synchronization time. Based on the timestamp of the synchronization frame sent by the Master, the absolute time of the Master sending the follow frame is calculated. Time synchronization between the Slave and the Master is achieved based on the absolute time when the Master sends the follow-up frame; The Master controls the hardline level via I / O to notify the Slave to start the synchronization process. Based on the timestamp of the synchronization frame sent by the Master, the absolute time of the Master sending the follow-up frame is calculated, including: The Master sends synchronization frames at predetermined intervals, sends the timestamp of time t0 at time t1, and sends the first hard-wired I / O level. When the Slave receives the first hardwired IO level, it receives the synchronization level at time t2 via an interrupt and records the timestamp t2. After receiving the synchronization frame at time t3, the Slave parses the timestamp t0; After a fixed interval, the Master sends a follow-up frame, which includes the transmission time Δt0 of the CAN message synchronization frame during transmission and the second hard-wired IO level. When Salve receives the second hardwired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp t4'. After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
2. The time synchronization method according to claim 1, characterized in that, The first hard-wired I / O level and the second hard-wired I / O level, one of which is high and the other is low.
3. The time synchronization method according to claim 2, characterized in that, After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame, including: The absolute time for the Master to send follow-up frames is t0 + Δt0 + t4' - t2.
4. The time synchronization method according to claim 1, characterized in that, The method of achieving time synchronization between the Slave and Master based on the absolute time of the Master sending follow-up frames includes: The Slave's system time is adjusted based on the absolute time when the Master sends the follow-up frame.
5. A vehicle-mounted high-precision time synchronization system, characterized in that, This includes Master and Slave. In an ADAS system with multiple different sensors, the sensor with the highest time accuracy is designated as Master, and the other sensors are designated as Slave. Hardwires are added between Master and Slave. The Master is used to control the hard-wired level via I / O to notify the Slave to start the synchronization time. Slave is used to calculate the absolute time when the Master sends the follow-up frame based on the timestamp of the synchronization frame sent by the Master; and to realize time synchronization between Slave and Master based on the absolute time when the Master sends the follow-up frame. The Master sends synchronization frames at a predetermined period, sends the timestamp of time t0 at time t1, and sends the first hard-wired I / O level. When the Slave receives the first hardwired IO level, it receives the synchronization level at time t2 via an interrupt and records the timestamp t2. After receiving the synchronization frame at time t3, the Slave parses the timestamp t0; After a fixed interval, the Master sends a follow-up frame, which includes the transmission time Δt0 of the CAN message synchronization frame during transmission and the second hard-wired IO level. When Salve receives the second hardwired I / O level, it receives the synchronization level at time t4' via an interrupt and records the timestamp t4'. After receiving the follow-up frame at time t4, the Slave calculates the absolute time when the Master sent the follow-up frame.
6. The time synchronization system according to claim 5, characterized in that, The method of achieving time synchronization between the Slave and Master based on the absolute time of the Master sending follow-up frames includes: The Slave's system time is adjusted based on the absolute time when the Master sends the follow-up frame.
7. An electronic device, characterized in that, The system includes a memory and a processor, wherein the processor is used to execute computer management programs stored in the memory to implement the steps of the vehicle-mounted high-precision time synchronization implementation method as described in any one of claims 1-4.
8. A computer-readable storage medium, characterized in that, It stores a computer management program, which, when executed by a processor, implements the steps of the vehicle-mounted high-precision time synchronization method as described in any one of claims 1-4.