Time synchronization method and device and computer readable storage medium
The vehicle system time is updated through real-time clock, the time to be synchronized is determined, and the time synchronization is processed, which solves the problem of poor time synchronization stability in the prior art, and improves the stability and resource utilization efficiency of time synchronization.
Patent Information
- Application Number
- CN202411542773.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-10-28
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the time sent by the communication controller is used as the management time, resulting in poor stability of time synchronization, and the management time jumps in real time with the time sent by the communication controller.
The local time and management time of the current time are updated by real-time clock, and the local time to be synchronized and management time to be synchronized are determined, and the vehicle system is time-synchronized.
Ensure the continuity of local time, avoid the continuous jump of management time following the received reference time, improve the stability of time synchronization and the accuracy of management time, and reduce the resource consumption of the entire vehicle system.
Smart Images

Figure CN119420444A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of vehicle technology, and in particular to a time synchronization method, device, and computer-readable storage medium. Background Art
[0002] With the rapid development of information technology and autonomous driving technology, the importance of time synchronization in assisted driving systems has become increasingly prominent. In autonomous vehicles, time synchronization is the basis for ensuring the coordinated work of multiple sensors and actuators, and is crucial to improving the safety, reliability and efficiency of the system. In the existing time synchronization method, the time sent by the communication controller is usually used as the management time during the time synchronization process. The management time jumps in real time with the time sent by the communication controller, resulting in poor stability of time synchronization. Summary of the invention
[0003] In view of the above problems, an embodiment of the present invention provides a time synchronization method, device and computer-readable storage medium, which are used to solve the technical problem existing in the prior art that the time sent by the communication controller is used as the management time, and the management time jumps in real time with the time sent by the communication controller, resulting in poor stability of time synchronization.
[0004] According to one aspect of an embodiment of the present invention, a time synchronization method is provided, the method comprising:
[0005] After the vehicle is powered on, the reference time is received, and the system time is assigned to the reference time to obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with external actuators;
[0006] The local time at the current moment is updated by a real-time clock, and the local time updated in real time is determined as the local time to be synchronized;
[0007] Acquire multiple reference times within a preset time period after the current moment, and update the management time of the current moment according to the real-time clock, compare each management time updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized according to the comparison result;
[0008] The whole vehicle system is time synchronized using the local time to be synchronized and the management time to be synchronized.
[0009] According to another aspect of an embodiment of the present invention, there is provided a time synchronization device, comprising:
[0010] A time assignment module is used to assign the system time to the reference time after the vehicle is powered on, and obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with the external actuator;
[0011] A module for determining the local time to be synchronized, used for updating the local time at the current moment by using a real-time clock, and determining the local time updated in real time as the local time to be synchronized;
[0012] The management time to be synchronized is determined by a module for obtaining multiple reference times within a preset time period after the current moment, and updating the management time of the current moment according to the real-time clock, comparing each management time updated in real time with the reference time of the corresponding moment, and determining the management time to be synchronized according to the comparison result;
[0013] The time synchronization processing module is used to perform time synchronization processing on the entire vehicle system using the local time to be synchronized and the management time to be synchronized.
[0014] In an optional manner, the module for determining the management time to be synchronized is further used for:
[0015] Compare the management time of each moment updated in real time with the reference time of the corresponding moment;
[0016] When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time at the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized;
[0017] When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
[0018] In an optional manner, the time synchronization device further includes a reference time acquisition module, which is used to:
[0019] After the vehicle is powered on, the reference time is acquired using the communication controller.
[0020] In an optional manner, the reference time is one of cloud platform time, satellite time, network time and last power-off time, and the using the communication controller to obtain the reference time includes:
[0021] Use the communication controller to obtain the cloud platform time through the cloud;
[0022] Or use the communication controller to receive signals through the antenna to obtain satellite time;
[0023] Or use the communication controller to obtain network time through the NTP protocol;
[0024] Or use the communication controller to obtain the last power-off record time through the local real-time clock.
[0025] In an optional manner, the time assignment module is further used to:
[0026] If no reference time is received after the vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle.
[0027] In an optional manner, the module for determining the local time to be synchronized is further used for:
[0028] Clear the real-time clock.
[0029] In an optional manner, the time synchronization device further includes a data fusion module, which is used to:
[0030] The data time uploaded by each sensor is compared, and the sensor data with a data time error within a preset time range is determined to be the same state data, and the same state data is fused.
[0031] According to another aspect of an embodiment of the present invention, a time synchronization device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;
[0032] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations such as the above-mentioned time synchronization method.
[0033] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium. When the executable instruction is executed on a time synchronization device / apparatus, the time synchronization device / apparatus performs operations such as the above-mentioned time synchronization method.
[0034] The embodiment of the present invention updates the local time of the current moment through a real-time clock, and determines the local time updated in real time as the local time to be synchronized, thereby ensuring the continuity of the local time; the management time of the current moment is updated according to the real-time clock, and the management time of each moment updated in real time is compared with the reference time of the corresponding moment, and then the management time to be synchronized is determined according to the comparison result, so that the management time will not continue to jump with the received reference time, while ensuring the accuracy of the management time, the stability of time synchronization is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0035] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0037] Figure 1 A schematic diagram of a time synchronization method according to an embodiment of the present invention is shown;
[0038] Figure 2 A schematic diagram showing the structure of a time synchronization system provided by an embodiment of the present invention is shown;
[0039] Figure 3 A schematic diagram showing the structure of a time synchronization device provided by an embodiment of the present invention is shown;
[0040] Figure 4 A schematic diagram of a time synchronization device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0041] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0042] Figure 1 FIG. 1 is a flow chart of a time synchronization method provided by an embodiment of the present invention, and the method is executed by a time synchronization device. Figure 1 As shown, the method comprises the following steps:
[0043] Step 110: after the vehicle is powered on, the reference time is received, and the system time is assigned to the reference time to obtain the local time and the management time of the current moment; wherein the system time includes the local time and the management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with the external actuator;
[0044] In an embodiment of the present invention, the time synchronization device may be a vehicle-side intelligent driving controller, and the intelligent driving controller receives the reference time through the SOC module. The reference time is obtained through the vehicle-side communication controller after the vehicle is powered on, and the reference time can be obtained from a time source outside the vehicle, wherein the communication controller may be a T-BOX. After obtaining the reference time, the communication controller may send it to the bus in the form of a CAN FD message, and send the message to the SOC module through the gateway.
[0045] In an optional manner, the message includes a reference time, a time source synchronization mode and time synchronization verification information, wherein the time source synchronization mode is used to determine the subsequent time synchronization mode, and the time synchronization verification information can be used to verify whether the reference time in the current message is valid. If it is valid, the message can be set to 1, and if it is invalid, it can be set to 0. The SOC module determines whether the time is valid based on the message value.
[0046] In an embodiment of the present invention, if the reference time can be received within a preset time period after the vehicle is powered on, the system time is assigned as the reference time. The value of the preset time period can be set according to actual needs, for example, the preset time period can be 15S, 20S or 25S after the vehicle is powered on. For example, within 20S after the vehicle is powered on, the message information of the communication controller is received, and when the reference time in the message information is verified to be valid, the local time and the management time are both assigned as the received reference time.
[0047] In an optional manner, two time functions may be set in the vehicle system, including a local time function and a management time function, and the local time and management time may be assigned for the first time by assigning values to the time functions.
[0048] Step 120: updating the local time at the current moment by using a real-time clock, and determining the local time updated in real time as the local time to be synchronized;
[0049] In the embodiment of the present invention, the real-time clock may be an RTC clock in the SOC module. After the local time is assigned for the first time, the local time updated in real time is determined as the local time to be synchronized based on the timing of the real-time clock and the first assignment.
[0050] In the embodiment of the present invention, the local time is usually used to fuse the perception information collected by each sensor. In the timing process, based on the first assignment of the local time, the time of the first assignment is timed with a real-time clock, and an accurate local time to be synchronized can be obtained. After the first assignment, it does not respond to other timing requests, that is, it no longer performs time jumps, so as to ensure the continuity of the system time to be synchronized, and can effectively improve the accuracy of data fusion based on the local time.
[0051] Step 130: obtaining multiple reference times within a preset time period after the current moment, and updating the management time of the current moment according to the real-time clock, comparing each management time updated in real time with the reference time of the corresponding moment, and determining the management time to be synchronized according to the comparison result;
[0052] In an embodiment of the present invention, the management time of each moment updated in real time is compared with the reference time of the corresponding moment, and then the management time to be synchronized is determined based on the comparison result, so that the management time does not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of the management time is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0053] Step 140: Perform time synchronization processing on the entire vehicle system using the local time to be synchronized and the management time to be synchronized.
[0054] In an embodiment of the present invention, the intelligent driving controller can perform time synchronization by controlling the SOC module, and the system time to be synchronized includes the local time to be synchronized and the management time to be synchronized, wherein the time synchronization processing of the local time can be to synchronize the system time to be synchronized to each sensor of the whole vehicle system, such as MCU, camera, Lidar, Radar, INS, USS and other sensors, including:
[0055] Synchronize the local time of the MCU through the switch hard-wire connection;
[0056] The camera is synchronized with the local time through the LVDS protocol, and a unified exposure command is sent during the synchronization process. The deserializer sends it to each camera at the same time at a fixed frequency, so that the uploaded data of the camera includes the exposure duration and the exposure triggering time, etc., so that the exposure intermediate time can be calculated based on the exposure duration and the triggering time for the data fusion of each sensor;
[0057] Through the gPTP synchronization protocol, Ethernet performs local time synchronization, and the message uploaded by Lidar to the SOC module contains point cloud time information;
[0058] The local time of Radar and INS is synchronized through the CAN Tsync protocol or CAN FD. The messages uploaded by Radar and INS to the MCU contain the time information of the point cloud and the time information of the positioning.
[0059] When the USS uploads the data packet to the SOC module through a message, the message is marked with the local time of the SOC module at that time, that is, the local time of the USS data packet, so as to achieve time synchronization of the USS.
[0060] Management time is used when the vehicle system interacts with the outside world. The management time to be synchronized is recorded in the vehicle system and used when interacting with the outside world. For example, when taking a DTC snapshot, the management time needs to be recorded; when interacting with other ECUs, the message sent needs to carry the management time; when OTA and data are uploaded to the cloud, the information uploaded to the cloud needs to carry the management time.
[0061] The embodiment of the present invention compares the real-time updated management time at each moment with the reference time of the corresponding moment, and then determines the management time to be synchronized based on the comparison result, so that the management time will not continue to jump with the received reference time, thereby improving the stability of time synchronization.
[0062] In an optional manner, step 130: comparing each moment management time updated in real time with the reference time of the corresponding moment, and then determining the management time to be synchronized according to the comparison result, includes:
[0063] Step 131: Compare the real-time updated management time at each moment with the reference time at the corresponding moment;
[0064] Step 132: When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time of the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
[0065] In the embodiment of the present invention, during the timing process, the SOC module continuously receives the current reference time sent by the communication controller through the gateway, and compares the current moment management time obtained by timing with the corresponding current moment reference time. When the current moment reference time is later than the current moment management time, and the difference is greater than the preset value, for example, the reference time is 6.2610:15 and the management time is 6.26 10:14, the management time is reassigned with the current moment reference data, and based on the reassigned management time, the timing is re-set, and each moment management time updated in real time is used as the management time to be synchronized. Among them, the preset value can be set according to the actual situation, and the preset value can be 80ms, 100ms or 120ms, etc.
[0066] Step 133: When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each moment management updated in real time is used as the management time to be synchronized.
[0067] In an embodiment of the present invention, when the current moment management time obtained by timing is later than the corresponding current moment reference time preset value, the current moment reference time is assigned as the current moment management time, and the value is reassigned and timed so that the management time does not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of the management time is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0068] In an optional manner, the time synchronization method further includes:
[0069] After the vehicle is powered on, the reference time is acquired using the communication controller.
[0070] In the embodiment of the present invention, by obtaining the reference time through the communication controller, the time error caused by the drift or setting error of the internal clock of the vehicle can be reduced, thereby effectively improving the reliability and accuracy of time synchronization.
[0071] In an optional manner, the reference time is one of cloud platform time, satellite time, network time and last power-off time, and the using the communication controller to obtain the reference time includes:
[0072] Use the communication controller to obtain the cloud platform time through the cloud;
[0073] Or use the communication controller to receive signals through the antenna to obtain satellite time;
[0074] Or use the communication controller to obtain network time through the NTP protocol;
[0075] Or use the communication controller to obtain the last power-off record time through the local real-time clock.
[0076] In an embodiment of the present invention, the priority of obtaining the reference time is, from high to low, cloud platform time, satellite time, network time and last power-off record time. If any reference time cannot be obtained, a fault report is performed.
[0077] The embodiments of the present invention obtain reference time in multiple ways to ensure that the reference time used for time synchronization can be obtained, thereby effectively improving the reliability of time synchronization.
[0078] In an optional manner, step 110: after the vehicle is powered on, the reference time is received, the system time is assigned to the reference time, and the local time at the current moment and the management time at the current moment are obtained, and further includes:
[0079] When the vehicle is powered on and no reference time is received, the system time is first assigned to the management time of the power-off moment in the last ignition cycle.
[0080] In an embodiment of the present invention, when the reference time is not received when the whole vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle, so as to avoid time interruption caused by not receiving the reference time or not receiving the valid reference time within a power-on cycle, thereby ensuring the continuity and integrity of the system time, and avoiding automatic resetting to the default value or factory value when the reference time is not received or the valid reference time is not received within a power-on cycle, effectively preventing time rollback, and ensuring the requirements of various application scenarios, such as diary records and event timestamps.
[0081] In an optional manner, before step 120: updating the local time at the current moment by using a real-time clock and determining the real-time updated local time as the local time to be synchronized, the method further includes:
[0082] Clear the real-time clock.
[0083] In an embodiment of the present invention, the real-time clock of the SOC module can be cleared after receiving the reference time and before using the real-time clock to time the system time after the first assignment, including: after receiving the first frame of valid reference time message information, the real-time clock of the SOC module is cleared to reduce the timing error and improve the accuracy of subsequent timing, so that the system time to be synchronized can be accurately obtained.
[0084] In an optional manner, the system time is the local time. After step 140: performing time synchronization processing on the entire vehicle system with the local time to be synchronized and the management time to be synchronized, the following steps are included:
[0085] Step 150: Compare the data time uploaded by each sensor, determine the sensor data with data time error within a preset time range as the same state data, and perform fusion processing on the same state data.
[0086] In the embodiment of the present invention, the preset time range may be set according to actual needs, such as 0-8ms, 0-10ms or 0-12ms.
[0087] The embodiment of the present invention determines the same state data by comparing the time of each sensor data, thereby ensuring that the sensor data is collected at a similar or identical time point, and can meet the usage requirements of applications that require precise timestamps for decision-making and control of the assisted driving system.
[0088] In an alternative approach, Figure 2 A time synchronization system provided by an embodiment of the present invention is shown, in which the vehicle-side SOC receives reference data from a communication controller, and after determining a local time to be synchronized and a management time to be synchronized, synchronizes the local time to be synchronized to various sensors of the vehicle, including INS, Radar, USS, Deserializer, Lidar, Camera, etc., records the management time to be synchronized, and uses the management time to be synchronized as the current management time when interacting with other ECUs.
[0089] The implementation of the embodiments of the present invention has the following beneficial effects:
[0090] The embodiment of the present invention compares the management time of each moment updated in real time with the reference time of the corresponding moment, and then determines the management time to be synchronized based on the comparison result, so that the management time will not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of time synchronization is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0091] Furthermore, the embodiment of the present invention uses the time obtained after the first assignment and timing as the local time to be synchronized, thereby ensuring the continuity of the local time; when the current management time obtained by timing is later than the preset value of the current reference time, the current reference time is assigned as the current management time, and the time is reassigned and timed, further ensuring that the management time will not continue to jump with the received reference time, thereby further improving the stability of time synchronization.
[0092] Figure 3 FIG. 2 shows a schematic diagram of the structure of an embodiment of a time synchronization device of the present invention. Figure 3 As shown, the device 300 includes: a time assignment module 310 , a local time determination module 320 to be synchronized, a management time determination module 330 to be synchronized, and a time synchronization processing module 340 .
[0093] The time assignment module 310 is used to assign the system time to the reference time after the vehicle is powered on, and obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with the external actuator;
[0094] The module 320 for determining the local time to be synchronized is used to update the local time at the current moment by using a real-time clock, and determine the local time updated in real time as the local time to be synchronized;
[0095] The management time to be synchronized determination module 330 is used to obtain multiple reference times within a preset time period after the current moment, and to update the management time of the current moment according to the real-time clock, and to compare the management time of each moment updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized according to the comparison result;
[0096] The time synchronization processing module 340 is used to perform time synchronization processing on the entire vehicle system using the local time to be synchronized and the management time to be synchronized.
[0097] In an optional manner, the to-be-synchronized management time determination module 330 is further configured to:
[0098] Compare the management time of each moment updated in real time with the reference time of the corresponding moment;
[0099] When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time at the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized;
[0100] When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
[0101] In an optional manner, the time synchronization device further includes a reference time acquisition module, which is used to:
[0102] After the vehicle is powered on, the reference time is acquired using the communication controller.
[0103] In an optional manner, the reference time is one of cloud platform time, satellite time, network time and last power-off time, and the using the communication controller to obtain the reference time includes:
[0104] Use the communication controller to obtain the cloud platform time through the cloud;
[0105] Or use the communication controller to receive signals through the antenna to obtain satellite time;
[0106] Or use the communication controller to obtain network time through the NTP protocol;
[0107] Or use the communication controller to obtain the last power-off record time through the local real-time clock.
[0108] In an optional manner, the time assignment module 310 is further configured to:
[0109] If no reference time is received after the vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle.
[0110] In an optional manner, the module 320 for determining the local time to be synchronized is further used for:
[0111] Clear the real-time clock.
[0112] In an optional manner, the time synchronization device further includes a data fusion module, which is used to:
[0113] The data time uploaded by each sensor is compared, and the sensor data with a data time error within a preset time range is determined to be the same state data, and the same state data is fused.
[0114] The embodiment of the present invention compares the management time of each moment updated in real time with the reference time of the corresponding moment, and then determines the management time to be synchronized based on the comparison result, so that the management time will not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of the management time is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0115] Furthermore, the embodiment of the present invention uses the time obtained after the first assignment and timing as the local time to be synchronized, thereby ensuring the continuity of the local time; when the current management time obtained by timing is later than the preset value of the current reference time, the current reference time is assigned as the current management time, and the time is reassigned and timed, further ensuring that the management time will not continue to jump with the received reference time, thereby further improving the stability of time synchronization.
[0116] Figure 4 The schematic diagram of the structure of an embodiment of the time synchronization device of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the time synchronization device.
[0117] like Figure 4 As shown, the time synchronization device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0118] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the method for time synchronization.
[0119] Specifically, the program 410 may include program code including computer executable instructions.
[0120] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the time synchronization device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0121] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0122] Program 410 may be specifically called by processor 402 to enable the time synchronization device to perform the following operations:
[0123] After the vehicle is powered on, the reference time is received, and the system time is assigned to the reference time to obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with external actuators;
[0124] The local time at the current moment is updated by a real-time clock, and the local time updated in real time is determined as the local time to be synchronized;
[0125] Acquire multiple reference times within a preset time period after the current moment, and update the management time of the current moment according to the real-time clock, compare each management time updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized according to the comparison result;
[0126] The whole vehicle system is time synchronized using the local time to be synchronized and the management time to be synchronized.
[0127] In an optional manner, the program 410 may be specifically called by the processor 402 to enable the time synchronization device to perform the following operations:
[0128] Compare the management time of each moment updated in real time with the reference time of the corresponding moment;
[0129] When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time at the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized;
[0130] When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
[0131] In an optional manner, the program 410 is called by the processor 402 to enable the time synchronization device to perform the following operations:
[0132] After the vehicle is powered on, the reference time is acquired using the communication controller.
[0133] In an optional manner, the program 410 is called by the processor 402 to enable the time synchronization device to perform the following operations:
[0134] Use the communication controller to obtain the cloud platform time through the cloud;
[0135] Or use the communication controller to receive signals through the antenna to obtain satellite time;
[0136] Or use the communication controller to obtain network time through the NTP protocol;
[0137] Or use the communication controller to obtain the last power-off record time through the local real-time clock.
[0138] In an optional manner, the program 410 is called by the processor 402 to enable the time synchronization device to perform the following operations:
[0139] If no reference time is received after the vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle.
[0140] In an optional manner, the program 410 is called by the processor 402 to enable the time synchronization device to perform the following operations:
[0141] Clear the real-time clock.
[0142] In an optional manner, the program 410 is called by the processor 402 to enable the time synchronization device to perform the following operations:
[0143] The data time uploaded by each sensor is compared, and the sensor data with a data time error within a preset time range is determined to be the same state data, and the same state data is fused.
[0144] The embodiment of the present invention compares the management time of each moment updated in real time with the reference time of the corresponding moment, and then determines the management time to be synchronized based on the comparison result, so that the management time will not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of the management time is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0145] Furthermore, the embodiment of the present invention uses the time obtained after the first assignment and timing as the local time to be synchronized, thereby ensuring the continuity of the local time; when the current management time obtained by timing is later than the preset value of the current reference time, the current reference time is assigned as the current management time, and the time is reassigned and timed, further ensuring that the management time will not continue to jump with the received reference time, thereby further improving the stability of time synchronization.
[0146] An embodiment of the present invention provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on a time synchronization device / apparatus, the time synchronization device / apparatus executes the time synchronization method in any of the above method embodiments.
[0147] The executable instructions may be specifically used to enable the time synchronization device / apparatus to perform the following operations:
[0148] After the vehicle is powered on, the reference time is received, and the system time is assigned to the reference time to obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with external actuators;
[0149] The local time at the current moment is updated by a real-time clock, and the local time updated in real time is determined as the local time to be synchronized;
[0150] Acquire multiple reference times within a preset time period after the current moment, and update the management time of the current moment according to the real-time clock, compare each management time updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized according to the comparison result;
[0151] The whole vehicle system is time synchronized using the local time to be synchronized and the management time to be synchronized.
[0152] The executable instructions may be specifically used to enable the time synchronization device / apparatus to perform the following operations:
[0153] Compare the management time of each moment updated in real time with the reference time of the corresponding moment;
[0154] When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time at the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized;
[0155] When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
[0156] In an optional manner, the executable instruction enables the time synchronization device / apparatus to perform the following operations:
[0157] After the vehicle is powered on, the reference time is acquired using the communication controller.
[0158] In an optional manner, the executable instruction enables the time synchronization device / apparatus to perform the following operations:
[0159] Use the communication controller to obtain the cloud platform time through the cloud;
[0160] Or use the communication controller to receive signals through the antenna to obtain satellite time;
[0161] Or use the communication controller to obtain network time through the NTP protocol;
[0162] Or use the communication controller to obtain the last power-off record time through the local real-time clock.
[0163] In an optional manner, the executable instruction enables the time synchronization device / apparatus to perform the following operations:
[0164] If no reference time is received after the vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle.
[0165] In an optional manner, the executable instruction enables the time synchronization device / apparatus to perform the following operations:
[0166] Clear the real-time clock.
[0167] In an optional manner, the executable instruction enables the time synchronization device / apparatus to perform the following operations:
[0168] The data time uploaded by each sensor is compared, and the sensor data with a data time error within a preset time range is determined to be the same state data, and the same state data is fused.
[0169] The embodiment of the present invention compares the management time of each moment updated in real time with the reference time of the corresponding moment, and then determines the management time to be synchronized based on the comparison result, so that the management time will not continue to jump with the received reference time. While ensuring the accuracy of the management time, the stability of time synchronization is improved, and reducing time jumps can reduce the resource consumption of the entire vehicle system.
[0170] Furthermore, the embodiment of the present invention uses the time obtained after the first assignment and timing as the local time to be synchronized, thereby ensuring the continuity of the local time; when the current management time obtained by timing is later than the preset value of the current reference time, the current reference time is assigned as the current management time, and the time is reassigned and timed, further ensuring that the management time will not continue to jump with the received reference time, thereby further improving the stability of time synchronization.
[0171] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0172] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.
[0173] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0174] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A time synchronization method, characterized in that: include: After the vehicle is powered on, the reference time is received, and the system time is assigned to the reference time to obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with external actuators; The local time at the current moment is updated by a real-time clock, and the local time updated in real time is determined as the local time to be synchronized; Acquire multiple reference times within a preset time period after the current moment, and update the management time of the current moment according to the real-time clock, compare each management time updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized according to the comparison result; The whole vehicle system is time synchronized using the local time to be synchronized and the management time to be synchronized.
2. The time synchronization method according to claim 1, characterized in that: Compare the management time of each moment updated in real time with the reference time of the corresponding moment, and then determine the management time to be synchronized based on the comparison result, including: Compare the management time of each moment updated in real time with the reference time of the corresponding moment; When the management time at the current moment is later than the preset value of the reference time at the corresponding moment, the reference time at the corresponding moment is determined as the management time at the current moment, and the management time at the current moment is updated in real time through the real-time clock, and each management time updated in real time is used as the management time to be synchronized; When the management time at the current moment is not later than the preset value of the reference time at the corresponding moment, the management time at the current moment is updated in real time by the real-time clock, and each management time updated in real time is used as the management time to be synchronized.
3. The time synchronization method according to claim 1, characterized in that: Also includes: After the vehicle is powered on, the reference time is acquired using the communication controller.
4. The time synchronization method according to claim 3, characterized in that: The reference time is one of cloud platform time, satellite time, network time and last power-off time, and obtaining the reference time by using the communication controller includes: Use the communication controller to obtain the cloud platform time through the cloud; Or use the communication controller to receive signals through the antenna to obtain satellite time; Or use the communication controller to obtain network time through the NTP protocol; Or use the communication controller to obtain the last power-off record time through the local real-time clock.
5. The time synchronization method according to claim 1, characterized in that: Also includes: If no reference time is received after the vehicle is powered on, the system time is first assigned to the management time of the power-off moment in the previous ignition cycle.
6. The time synchronization method according to claim 1, characterized in that: The method of updating the local time at the current moment by using the real-time clock and determining the real-time updated local time as the local time to be synchronized further includes: Clear the real-time clock.
7. The time synchronization method according to any one of claims 1 to 6, characterized in that: After the whole vehicle system is synchronized with the local time to be synchronized and the management time to be synchronized, the following steps are included: The data time uploaded by each sensor is compared, and the sensor data with a data time error within a preset time range is determined to be the same state data, and the same state data is fused.
8. A time synchronization device, characterized in that: The device comprises: A time assignment module is used to assign the system time to the reference time after the vehicle is powered on, and obtain the local time and management time of the current moment; wherein the system time includes the local time and management time, the local time is used to synchronize the time of the vehicle's internal system, and the management time is the time used for the vehicle to interact with the external actuator; A module for determining the local time to be synchronized, used for updating the local time at the current moment by using a real-time clock, and determining the local time updated in real time as the local time to be synchronized; The management time to be synchronized is determined by a module for obtaining multiple reference times within a preset time period after the current moment, and updating the management time of the current moment according to the real-time clock, comparing each management time updated in real time with the reference time of the corresponding moment, and determining the management time to be synchronized according to the comparison result; The time synchronization processing module is used to perform time synchronization processing on the entire vehicle system using the local time to be synchronized and the management time to be synchronized.
9. A time synchronization device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the time synchronization method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the time synchronization device / apparatus, the time synchronization device / apparatus performs the operation of the time synchronization method according to any one of claims 1 to 7.
