Vehicle time synchronization method, device and system
By obtaining external reference time, correcting the vehicle system time and synchronizing the high-precision vehicle system time to the internal module, the consistency and accuracy problems between the vehicle system time and the external and internal module time are solved, and the good effect of vehicle communication and cooperation is achieved.
Patent Information
- Application Number
- CN202510262759.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-10
AI Technical Summary
The vehicle system time needs to be aligned with the external network time, and the time of each module inside the vehicle needs to be consistent and high precision to ensure the communication and collaboration between the vehicle and the external and internal modules.
By obtaining external reference time, the vehicle system time is corrected, and it is synchronized with external time, and the low-precision external time is converted into high-precision vehicle system time, and synchronized to various modules inside the vehicle.
The synchronization of the vehicle system time and external time is realized, and while meeting the synchronization requirements, it meets the high-precision requirements of the time of each module in the vehicle, thereby ensuring good communication and cooperation between the vehicle and the external and internal modules.
Smart Images

Figure CN120128294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicles, and in particular, to a time synchronization method, device and system for a vehicle. Background Art
[0002] Generally, communication and cooperation are required between vehicles and between vehicles and other platforms, such as V2X (Vehicle to Everything); in addition, communication and cooperation are also required between multiple modules inside the vehicle. To ensure good cooperation effects, the system time of the vehicle needs to be aligned with the time of the external network, and the time used between each module inside the vehicle needs to be consistent. In addition, to facilitate troubleshooting and analysis of problems during vehicle production and use, it is also necessary to ensure that the vehicle system time meets the accuracy requirements. Therefore, it is necessary to ensure the internal and external consistency of the vehicle system time and ensure that the vehicle system time meets certain accuracy requirements. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a time synchronization method, device and system for a vehicle. By obtaining the external reference time, the vehicle system time is corrected so that the vehicle system time is synchronized with the external time. In addition, by converting the low-precision external time into a high-precision vehicle system time and synchronizing the high-precision vehicle system time to each module inside the vehicle, the time of each module inside the vehicle not only meets the synchronization requirements but also meets the accuracy requirements, thus ensuring good communication and cooperation effects between the vehicle and the outside and between each module inside the vehicle.
[0004] To achieve the above object, according to one aspect of the embodiments of the present invention, a time synchronization method for a vehicle is provided.
[0005] A time synchronization method for a vehicle according to an embodiment of the present invention includes: obtaining a reference time with a first accuracy;
[0006] According to the reference time, correcting the system time with a second accuracy of the in-vehicle system local to obtain a corrected time with the second accuracy, where the second accuracy is higher than the first accuracy;
[0007] Synchronizing the corrected time to each module of the vehicle.
[0008] Optionally, the method further includes:
[0009] Real-time obtaining the first time zone information of the area where the vehicle is located, and determining the second time zone information currently corresponding to the system time of the in-vehicle system local;
[0010] In response to the inconsistency between the second time zone information and the first time zone information, update the corrected time according to the time difference between the first time zone and the second time zone.
[0011] Optionally, the correction of the system time of the second precision in the in-vehicle system includes:
[0012] Replace the part corresponding to the first precision in the system time of the in-vehicle system local with the reference time to obtain the corrected time of the second precision.
[0013] Optionally, the time synchronization method of the vehicle is completed through the interaction between the host and the virtual machine of the vehicle-mounted controller, where
[0014] The step of obtaining the reference time of the first precision is executed by the host;
[0015] The step of correcting the system time of the second precision in the in-vehicle system local according to the reference time to obtain the corrected time of the second precision is executed by the virtual machine;
[0016] The step of synchronizing the corrected time to each module of the vehicle is executed by the host.
[0017] Optionally, the virtual machine synchronizes the corrected time to the host in real time based on the software-synchronized gPTP protocol.
[0018] Optionally, the host obtains the reference time of the first precision based on the Ethernet interface and the target transport protocol; the target transport protocol includes any one of the TCP protocol, the UDP protocol, the SOMEIP protocol, and the CAN bus protocol.
[0019] To achieve the above object, according to another aspect of the embodiments of the present invention, a vehicle time synchronization device is provided.
[0020] A vehicle time synchronization device according to an embodiment of the present invention includes:
[0021] A time acquisition module, configured to acquire a reference time of the first precision;
[0022] A time correction module, configured to correct the system time of the second precision in the in-vehicle system local according to the reference time to obtain the corrected time of the second precision, where the second precision is higher than the first precision;
[0023] A time synchronization module, configured to synchronize the corrected time to each module of the vehicle.
[0024] To achieve the above object, according to another aspect of the embodiments of the present invention, a vehicle time synchronization system is provided.
[0025] A time synchronization system for a vehicle according to an embodiment of the present invention includes: a host and a virtual machine of a vehicle-mounted controller, wherein,
[0026] The host is configured to obtain a reference time with a first precision;
[0027] The virtual machine is configured to correct the system time with a second precision in the in-vehicle system according to the reference time to obtain a corrected time with the second precision, and the second precision is higher than the first precision;
[0028] The host is further configured to synchronize the corrected time to each module of the vehicle.
[0029] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an electronic device for time synchronization of a vehicle.
[0030] An electronic device for time synchronization of a vehicle according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the above one or more programs are executed by the above one or more processors, the above one or more processors implement a time synchronization method for a vehicle according to an embodiment of the present invention.
[0031] To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium.
[0032] A computer-readable storage medium according to an embodiment of the present invention has a computer program stored thereon, and when the above program is executed by a processor, a time synchronization method for a vehicle according to an embodiment of the present invention is implemented.
[0033] One of the above embodiments of the invention has the following advantages or beneficial effects: By obtaining the external reference time, the vehicle system time is corrected so that the vehicle system time is synchronized with the external time. In addition, by converting the low-precision external time into a high-precision vehicle system time and synchronizing the high-precision vehicle system time to each module inside the vehicle, the time of each module inside the vehicle not only meets the synchronization requirement but also meets the precision requirement, thus ensuring good communication and cooperation effects between the vehicle and the outside and between each module inside the vehicle.
[0034] The further effects of the above non-conventional optional manner will be described in conjunction with specific embodiments below. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:
[0036] Figure 1It is a schematic flowchart of a time synchronization method for a vehicle according to an embodiment of the present invention;
[0037] Figure 2 It is a specific flowchart of another time synchronization method for a vehicle according to an embodiment of the present invention;
[0038] Figure 3 It is a schematic diagram of the main modules of a time synchronization device for a vehicle according to an embodiment of the present invention;
[0039] Figure 4 It is a schematic diagram of the main modules of a time synchronization system for a vehicle according to an embodiment of the present invention;
[0040] Figure 5 It is a schematic diagram of a deployment scheme of a time synchronization system for a vehicle according to an embodiment of the present invention;
[0041] Figure 6 It is a schematic diagram of a deployment scheme of another time synchronization system for a vehicle according to an embodiment of the present invention;
[0042] Figure 7 It is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0043] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners
[0044] The following makes an explanation of the exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included therein to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.
[0045] It should be noted that, without conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0046] Figure 1 It is a schematic diagram of the main steps of a time synchronization method for a vehicle according to an embodiment of the present invention.
[0047] As Figure 1 shown, the time synchronization method for a vehicle according to the embodiment of the present invention mainly includes steps S101 - S103:
[0048] Step S101, obtain a reference time with a first precision. The clock in the in-vehicle system may have time deviations due to hardware characteristics or temperature changes, resulting in the in-vehicle system time being out of sync with the time of mobile phones, Internet servers, or other devices, thereby causing data transmission problems or certain functions to fail, such as navigation or positioning functions, vehicle networking functions, autonomous driving functions, and lane keeping functions, etc. Additionally, among the various modules inside the vehicle, there will also be phenomena of time out-of-sync due to various reasons, such as hardware clock errors, software processing delays, external interference, system failures, etc. Therefore, the time of each vehicle module also needs to be synchronized regularly.
[0049] Furthermore, the various modules inside the vehicle usually have relatively high requirements for time precision. For example, the time precision of the anti-lock braking system is at the millisecond level, and the time precision of lidar is at the microsecond level, etc. Therefore, the time of each module inside the vehicle needs to meet the requirements of high precision while also meeting the requirements of synchronization. Among them, the first precision is at the minute level or the second level, and the format of the reference time can be year / month / day / hour / minute, or year / month / day / hour / minute / second. For example, 23:56 on November 30, 2024, or 23:56:07 on November 30, 2024.
[0050] Step S102, correct the system time with a second precision in the in-vehicle system local according to the reference time to obtain a corrected time with the second precision, where the second precision is higher than the first precision. The system time precision in the in-vehicle system local is relatively high. For example, 23:53:07.123 milliseconds on November 30, 2024, or 23:54:07.123456 microseconds on November 30, 2024. According to the reference time, correct the vehicle system time to obtain a corrected time with the second precision. For example, 23:56:07.123 milliseconds on November 30, 2024, or 23:56:07.123456 microseconds on November 30, 2024. The time precision of the corrected time is at the millisecond or nanosecond level, higher than the minute-level precision or second-level precision of the reference time, and the time precision after correction can meet the time precision requirements of each module inside the vehicle.
[0051] In an alternative embodiment of the present invention, the correction of the system time with the second precision in the in-vehicle system includes: replacing the part corresponding to the first precision in the system time of the in-vehicle system with the reference time to obtain the corrected time with the second precision. When correcting the system time according to the reference time, only the part corresponding to the first precision in the system time, such as 23:53 on November 30, 2024, or 23:54:07 on November 30, 2024, needs to be replaced with the reference time 23:56 on November 30, 2024, or 23:56:07 on November 30, 2024, and the time information after the minute or second level in the system time, such as 07 seconds 123 milliseconds, or 123456 microseconds, is retained, that is, the corrected time with the second precision, such as 23:56:07:123 on November 30, 2024, or 23:56:07:123456 on November 30, 2024, is obtained.
[0052] Step S103: Synchronize the corrected time to each module of the vehicle. To make the time of each module of the vehicle consistent, the corrected time, such as 23:56:07:123 on November 30, 2024, or 23:56:07:123456 on November 30, 2024, is synchronized to each module.
[0053] In an alternative embodiment of the present invention, the method further includes: obtaining in real time the first time zone information of the area where the vehicle is located, and determining the second time zone information corresponding to the current system time of the in-vehicle system locally; in response to the inconsistency between the second time zone information and the first time zone information, updating the corrected time according to the time difference between the first time zone and the second time zone. The regional span of vehicle travel may be relatively large. For example, the vehicle travels from the Beijing area of China to the Xinjiang area of China, or crosses the border to reach other countries or regions. At this time, there will be a deviation between the time zone information of the vehicle system time and the time zone information of the area where the vehicle is currently located. Therefore, it is necessary to correct the system time of the vehicle according to the time zone information of the area where the vehicle is currently located. For example, the current vehicle system time is 23:56:07.123 milliseconds on November 30, 2024, or 23:56:07.123456 microseconds on November 30, 2024. The time difference between the current first time zone where the vehicle is located and the second time zone corresponding to the in-vehicle system is two hours. According to this time difference, the in-vehicle system time is updated. The updated in-vehicle system time can be 21:56:07.123 milliseconds on November 30, 2024, or 21:56:07.123456 microseconds on November 30, 2024; the updated in-vehicle system time may also be 01:56:07.123 milliseconds on December 1, 2024, or 01:56:07.123456 microseconds on December 1, 2024.
[0054] The above time synchronization method can be completed jointly by the host and the virtual machine of the vehicle-mounted controller. In an alternative embodiment of the present invention, the time synchronization method of the vehicle is completed through the interaction between the host and the virtual machine of the vehicle-mounted controller. Among them, the step of obtaining the reference time of the first precision is executed by the host; the step of correcting the system time of the second precision locally in the in-vehicle system according to the reference time to obtain the corrected time of the second precision is executed by the virtual machine; the step of synchronizing the corrected time to each module of the vehicle is executed by the host. Among them, the host is used to obtain the external reference time of low precision and send this reference time to the virtual machine. The virtual machine uses this reference time to replace the part corresponding to the first precision in the in-vehicle system time. While ensuring the synchronization of the in-vehicle system time with the external time, the second precision of the in-vehicle system time is also retained. Therefore, a corrected time of higher precision is obtained. The virtual machine sends the corrected time of higher precision to the host, and the host provides this corrected time to each module of the vehicle so that the time among the internal modules of the vehicle is consistent, which is convenient for troubleshooting and analysis based on the communication data and event record data of each module.
[0055] Among them, the corrected time belongs to high-precision time information. To send high-precision time information, a transmission protocol matching the high-precision time information needs to be used, such as the gPTP protocol. Therefore, in an alternative embodiment of the present invention, the virtual machine synchronizes the corrected time to the host in real time based on the software-synchronized gPTP protocol.
[0056] The reference time accuracy is at the minute or second level, which belongs to low-precision time information. Using the low-precision reference time to correct the vehicle system time requires lower hardware costs. Therefore, using the low-precision reference time for vehicle system time correction can save hardware costs and data transmission costs. In an alternative embodiment of the present invention, the host obtains the reference time of the first accuracy based on the Ethernet interface and the target transmission protocol; the target transmission protocol includes any one of the TCP protocol, UDP protocol, SOMEIP protocol, and CAN bus protocol. The in-vehicle controller host receives the reference time of the first accuracy based on the Ethernet interface and any one of the TCP protocol, UDP protocol, SOMEIP protocol, and CAN bus protocol. Since there is no need to upgrade the hardware of the host and there is no need to purchase a high-precision data transmission protocol, the time synchronization cost of the vehicle in this embodiment is relatively low.
[0057] The time synchronization method of the vehicle will be described in detail below through a specific embodiment.
[0058] As Figure 2 shown, the time synchronization method of the vehicle in this embodiment mainly includes the following main steps S201-S204:
[0059] Step S201, obtain the reference time of the first accuracy.
[0060] For example, 23:56 on November 30, 2024, or 23:56:07 on November 30, 2024.
[0061] Step S202, replace the part corresponding to the first accuracy in the local system time of the in-vehicle system with the reference time to obtain the corrected time of the second accuracy, and the second accuracy is higher than the first accuracy.
[0062] Among them, the corrected time of the second accuracy, for example, 23:56:07.123 milliseconds on November 30, 2024, or 23:56:07.123456 microseconds on November 30, 2024.
[0063] Step S203, obtain the first time zone information of the area where the vehicle is located in real time, and determine the second time zone information currently corresponding to the local system time of the in-vehicle system.
[0064] Step S204, in response to the inconsistency between the second time zone information and the first time zone information, update the corrected time according to the time difference between the first time zone and the second time zone.
[0065] For example, the current vehicle system time is 23:56:07.123 milliseconds on November 30, 2024, or 23:56:07.123456 microseconds on November 30, 2024. The time difference between the first time zone where the vehicle is currently located and the second time zone corresponding to the in-vehicle system is two hours. According to this time difference, the in-vehicle system time is updated. The updated in-vehicle system time can be 21:56:07.123 milliseconds on November 30, 2024, or 21:56:07.123456 microseconds on November 30, 2024; the updated in-vehicle system time may also be 01:56:07.123 milliseconds on December 1, 2024, or 01:56:07.123456 microseconds on December 1, 2024.
[0066] The vehicle time synchronization method according to the embodiments of the present invention corrects the vehicle system time through the obtained external reference time, so that the vehicle system time is synchronized with the external time. In addition, by converting the low-precision external time into a high-precision vehicle system time and synchronizing the high-precision vehicle system time to each module inside the vehicle, the time of each module inside the vehicle not only meets the synchronization requirement but also meets the precision requirement, thereby ensuring good communication and cooperation effects between the vehicle and the outside and among the internal modules of the vehicle.
[0067] Figure 3 It is a schematic diagram of the main modules of the vehicle time synchronization device according to the embodiments of the present invention.
[0068] As Figure 3 shown, the vehicle time synchronization device 300 according to the embodiments of the present invention includes:
[0069] A time acquisition module 301, configured to acquire a reference time with a first precision;
[0070] A time correction module 302, configured to correct the system time with a second precision of the in-vehicle system locally according to the reference time to obtain a corrected time with a second precision, where the second precision is higher than the first precision;
[0071] A time synchronization module 303, configured to synchronize the corrected time to each module of the vehicle.
[0072] In an alternative embodiment of the present invention, the time acquisition module 301 is further configured to acquire the first time zone information of the area where the vehicle is located in real time; the time correction module 302 is further configured to determine the second time zone information corresponding to the current system time of the in-vehicle system locally; in response to the inconsistency between the second time zone information and the first time zone information, update the corrected time according to the time difference between the first time zone and the second time zone.
[0073] In an alternative embodiment of the present invention, the time correction module 302 is further configured to replace the part corresponding to the first accuracy in the system time of the in-vehicle system locally with the reference time to obtain the corrected time with the second accuracy.
[0074] The time synchronization device of the vehicle according to the embodiment of the present invention corrects the vehicle system time through the acquired external reference time, so that the vehicle system time is synchronized with the external time. In addition, by converting the external time with low accuracy into the vehicle system time with high accuracy and synchronizing the vehicle system time with high accuracy to each module inside the vehicle, the time of each module inside the vehicle meets the accuracy requirement while meeting the synchronization requirement, thereby ensuring good communication and cooperation effects between the vehicle and the outside and between each module inside the vehicle.
[0075] Figure 4 It is a schematic diagram of the main modules of the time synchronization system of the vehicle according to the embodiment of the present invention.
[0076] As Figure 4 shown, the time synchronization system 400 of the vehicle according to the embodiment of the present invention includes: a host 401 and a virtual machine 402 of the vehicle-mounted controller, wherein the host 401 is configured to acquire the reference time with the first accuracy; the virtual machine 402 is configured to correct the system time with the second accuracy of the in-vehicle system locally according to the reference time to obtain the corrected time with the second accuracy, and the second accuracy is higher than the first accuracy; the host 401 is further configured to synchronize the corrected time to each module of the vehicle.
[0077] Among them, the corrected time belongs to high-precision time information, and a transmission protocol matching the high-precision time information, such as the gPTP protocol, is required to send the high-precision time information. Therefore, in an alternative embodiment of the present invention, the virtual machine 402 synchronizes the corrected time to the host 401 in real time based on the software-synchronized gPTP protocol.
[0078] The reference time accuracy is at the minute or second level, which belongs to low-precision time information. Using the low-precision reference time to correct the vehicle system time requires a lower hardware cost. Therefore, using the low-precision reference time for vehicle system time correction can save hardware costs and data transmission costs. In an alternative embodiment of the present invention, the host 401 obtains the reference time of the first precision based on the Ethernet interface and the target transmission protocol; the target transmission protocol includes any one of the TCP protocol, UDP protocol, SOMEIP protocol, and CAN bus protocol. The in-vehicle controller host receives the reference time of the first precision based on the Ethernet interface and any one of the TCP protocol, UDP protocol, SOMEIP protocol, and CAN bus protocol. Since there is no need to upgrade the hardware of the host and there is no need to purchase a high-precision data transmission protocol, the time synchronization cost of the vehicle in this embodiment is relatively low.
[0079] In an alternative embodiment of the present invention, the virtual machine 402 is further configured to obtain the first time zone information of the area where the vehicle is located in real time; determine the second time zone information currently corresponding to the system time of the in-vehicle system; in response to the inconsistency between the second time zone information and the first time zone information, update the corrected time according to the time difference between the first time zone and the second time zone.
[0080] In an alternative embodiment of the present invention, the virtual machine 402 is further configured to replace the part corresponding to the first precision in the system time of the in-vehicle system with the reference time to obtain the corrected time of the second precision.
[0081] The deployment solution of the vehicle time synchronization system will be further exemplarily described below with a specific embodiment. The deployment solution of the vehicle time synchronization system in this embodiment is as Figure 5 shown. Among them, the time receiving module of the host of the in-vehicle controller is used to receive the reference time and send the reference time to the time correction module in the virtual machine of the in-vehicle controller. The time correction module sets the corrected time to the system clock and synchronizes the corrected time to the time management module in the host. The time management module provides the corrected time to each module inside the vehicle. The time correction module of the virtual machine is further configured to obtain external time zone information, update the corrected time according to the external time zone information, set the updated corrected time as the system clock, and synchronize the updated corrected time to the time management module of the host. The time management module provides the updated corrected time to each module inside the vehicle.
[0082] The deployment solution of the vehicle time synchronization system will be further exemplarily described below with another specific embodiment. The deployment solution of the vehicle time synchronization system in this embodiment is as Figure 6As shown in the figure. Among them, the time receiving module of the host of the vehicle-mounted controller is used to receive the reference time and send the reference time to the time correction module 2 in the virtual machine 2 of the vehicle-mounted controller. The time correction module 2 sets the corrected time to the system clock 2 and synchronizes the corrected time to the time management module in the host. The time management module provides the corrected time to each module inside the vehicle; the time correction module 2 also synchronizes the corrected time to the system clock 1 of the virtual machine 1. The time correction module 1 of the virtual machine 1 is further used to obtain external time zone information, update the system time of the system clock 1 according to the external time zone information, and synchronize the updated time to the system clock 2. The virtual machine 2 synchronizes the updated time to the time management module of the host, and the time management module provides the updated time to each module inside the vehicle.
[0083] In the time synchronization system of the vehicle according to the embodiment of the present invention, the vehicle system time is corrected by the obtained external reference time, so that the vehicle system time is synchronized with the external time. In addition, by converting the low-precision external time into the high-precision vehicle system time and synchronizing the high-precision vehicle system time to each module inside the vehicle, the time of each module inside the vehicle not only meets the synchronization requirement but also meets the precision requirement, thus ensuring good communication and cooperation effects between the vehicle and the outside and between each module inside the vehicle.
[0084] Figure 7 An exemplary system architecture 700 is shown that can apply the time synchronization method or the time synchronization device of the vehicle according to the embodiment of the present invention.
[0085] As Figure 7 shown, the system architecture 700 may include a vehicle-mounted controller host 701, a network 702, and a vehicle-mounted controller virtual machine 703. The network 702 is used to provide a medium for a communication link between the vehicle-mounted controller host 701 and the vehicle-mounted controller virtual machine 703. The network 702 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0086] The user can use the vehicle-mounted controller host 701 to interact with the vehicle-mounted controller virtual machine 703 through the network 702 to receive or send data, etc. The vehicle-mounted controller host 701 is used to obtain the reference time with the first precision from the outside and send the reference time to the vehicle-mounted controller virtual machine 703. The vehicle-mounted controller virtual machine 703 corrects the system time of the vehicle according to the reference time to obtain the corrected time with the second precision and sends the corrected time to the vehicle-mounted controller host 701.
[0087] It should be noted that the time synchronization method of the vehicle provided by the embodiment of the present invention can be completed by the interaction between the vehicle-mounted controller host 701 and the vehicle-mounted controller virtual machine 703.
[0088] It should be understood that Figure 7 the number of in-vehicle controller hosts, networks, and in-vehicle controller virtual machines in is merely illustrative. According to the implementation requirements, there can be any number of in-vehicle controller hosts, networks, and in-vehicle controller virtual machines.
[0089] Reference is made below to Figure 8 , which shows a schematic structural diagram of a computer system 800 of an electronic device suitable for implementing the embodiments of the present invention. Figure 8 The in-vehicle controller virtual machine shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.
[0090] As Figure 8 shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the computer system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0091] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as required. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as required so that a computer program read from it can be installed into the storage section 808 as required.
[0092] Specifically, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above functions defined in the system of the present invention are executed.
[0093] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.
[0094] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0095] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a time acquisition module, a time correction module, and a time synchronization module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the time synchronization module can also be described as "a module that synchronizes the corrected time to each module of the vehicle".
[0096] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; it can also exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: acquiring a reference time with a first accuracy; correcting the system time with a second accuracy of the in-vehicle system according to the reference time to obtain a corrected time with the second accuracy, where the second accuracy is higher than the first accuracy; and synchronizing the corrected time to each module of the vehicle.
[0097] According to the technical solution of the embodiments of the present invention, by acquiring the external reference time, the vehicle system time is corrected to synchronize the vehicle system time with the external time. In addition, by converting the external time with low accuracy into the vehicle system time with high accuracy and synchronizing the vehicle system time with high accuracy to each module inside the vehicle, the time of each module inside the vehicle meets both the synchronization requirement and the accuracy requirement while ensuring good communication and cooperation effects between the vehicle and the outside and among the modules inside the vehicle.
[0098] The above specific implementation manners do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A vehicle time synchronization method, characterized in that: include: Get the reference time of the first precision; According to the reference time, correcting the local system time of the vehicle system with a second precision to obtain a corrected time with a second precision, wherein the second precision is higher than the first precision; The corrected time is synchronized to each module of the vehicle.
2. The method according to claim 1, characterized in that Also includes: Acquire the first time zone information of the area where the vehicle is located in real time, and determine the second time zone information corresponding to the local system time of the vehicle system; In response to the second time zone information being inconsistent with the first time zone information, the corrected time is updated according to a time difference between the first time zone and the second time zone.
3. The method according to claim 1, characterized in that The correcting of the local second-precision system time of the vehicle system includes: The part of the local system time of the vehicle system corresponding to the first precision is replaced by the reference time to obtain a corrected time of the second precision.
4. The method according to claim 1, characterized in that: The vehicle time synchronization method is completed through the interaction between the host and the virtual machine of the vehicle controller, wherein: The step of obtaining the reference time of the first precision is performed by the host; The step of correcting the local system time of the vehicle system with a second precision according to the reference time to obtain the corrected time with a second precision is performed by the virtual machine; The step of synchronizing the corrected time to each module of the vehicle is performed by the host.
5. The method according to claim 4, characterized in that The virtual machine synchronizes the corrected time to the host in real time based on the software-synchronized gPTP protocol.
6. The method according to claim 4, characterized in that The host obtains the reference time of the first precision based on the Ethernet interface and the target transmission protocol; the target transmission protocol includes any one of the TCP protocol, the UDP protocol, the SOMEIP protocol and the CAN bus protocol.
7. A time synchronization device for a vehicle, characterized in that: include: A time acquisition module, used to acquire a reference time of a first precision; A time correction module, used for correcting the local system time of the vehicle system with a second precision according to the reference time to obtain a corrected time with a second precision, wherein the second precision is higher than the first precision; A time synchronization module is used to synchronize the corrected time to various modules of the vehicle.
8. A vehicle time synchronization system, characterized in that: include: The host and virtual machine of the vehicle controller, where The host is used to obtain a reference time with a first precision; The virtual machine is used to correct the local system time of the vehicle system with a second precision according to the reference time to obtain a corrected time with a second precision, where the second precision is higher than the first precision; The host is also used to synchronize the corrected time to each module of the vehicle.
9. An electronic device for time synchronization of a vehicle, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to claims 1 to 6 is implemented.