Vehicle time synchronization method and device
The central gateway monitors and processes the clock information messages sent by the vehicle-mounted Internet of Things device, and obtains and broadcasts the second clock information messages, solving the time synchronization problem caused by the failure of the TSN protocol stack, and achieving the accuracy and stability of time synchronization in the event of failure.
Patent Information
- Application Number
- CN202311515979.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2043-11-14
AI Technical Summary
In the case where the TSN protocol stack fails, time synchronization between the vehicle domain controllers is difficult to ensure, which may lead to time jumps and affect the accuracy of time synchronization.
Through the time synchronization method performed by the central gateway, the controller LAN message with clock information and the first clock information sent by the on-board Internet of Things device are continuously monitored, and the second clock information message at the current time is obtained, and sent to multiple domain controllers to instruct them to perform time synchronization.
In the case where the TSN protocol stack fails, the central gateway serves as the vehicle backup time release source, and the vehicle time is broadcast redundantly, ensuring time synchronization between the vehicle domain controllers, avoiding time jumps, and improving the accuracy of time synchronization.
Smart Images

Figure CN117639991B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a vehicle time synchronization method and device thereof. Background Art
[0002] In the related art, the time manager (TM) node of the whole vehicle is the generalized precision time protocol stack (gPTP) protocol stack in the vehicle-mounted Internet of Things Telematics node. However, the generalized precision time (TSN) protocol stack runs in the operating system. The operating system may have threads suspended for unknown reasons, resulting in system crashes or restarts. At this time, the TSN protocol stack fails. How to ensure the time synchronization between the domain controllers of the vehicle in the event of a failure of the TSN protocol stack, avoid time jumps, and improve the accuracy of time synchronization has become one of the important research directions. Summary of the invention
[0003] The embodiments of the present application provide a vehicle time synchronization method and a device thereof.
[0004] The first embodiment of the present application provides a vehicle time synchronization method, which is executed by a central gateway and includes:
[0005] In the same time period, continuously monitor the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device;
[0006] Acquire a second clock information message at the current moment according to the monitored first clock information message or controller area network message;
[0007] The second clock information message is sent to the multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message.
[0008] The second aspect of the present application provides a vehicle time synchronization method, which is executed by a vehicle-mounted Internet of Things device, including:
[0009] Monitor the reference clock information sent by the global navigation satellite system;
[0010] In response to monitoring the reference clock information, acquiring a clock information message and / or a controller area network message based on the reference clock information, and sending the clock information message and / or the controller area network message to the central gateway;
[0011] In response to not monitoring the reference clock information, real-time clock information is acquired, and a controller area network message is acquired according to the real-time clock information and sent to the central gateway.
[0012] The third aspect of the present application provides a vehicle time synchronization device, including:
[0013] A monitoring module, used for continuously monitoring the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device within the same time period;
[0014] An acquisition module, used for acquiring a second clock information message at the current moment according to the monitored first clock information message or controller area network message;
[0015] The sending module is used to send the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message.
[0016] The fourth aspect of the present application provides a vehicle time synchronization device, including:
[0017] A monitoring module, used for monitoring reference clock information sent by the global navigation satellite system;
[0018] A first acquisition module, configured to acquire a clock information message and / or a controller area network message based on the reference clock information in response to monitoring the reference clock information, and send the clock information message and / or the controller area network message to the central gateway;
[0019] The second acquisition module is used to acquire the real-time clock information in response to the failure to monitor the reference clock information, and acquire the controller area network message according to the real-time clock information and send it to the central gateway.
[0020] The fifth aspect embodiment of the present application provides a vehicle, characterized in that the vehicle includes: a vehicle time synchronization device as described in the third aspect embodiment or a vehicle synchronization device as described in the fourth aspect embodiment.
[0021] A sixth aspect of the present application provides a chip, including:
[0022] A memory for storing program codes;
[0023] A processor is connected to the memory and is used to read the program code from the memory to execute the vehicle time synchronization method described in the first aspect embodiment or the vehicle time synchronization method described in the second aspect embodiment.
[0024] The seventh aspect embodiment of the present application provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the vehicle time synchronization method described in the first aspect embodiment or the vehicle time synchronization method described in the second aspect embodiment.
[0025] An eighth aspect embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the vehicle time synchronization method described in the first aspect embodiment or the vehicle time synchronization method described in the second aspect embodiment.
[0026] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0027] In an embodiment of the present application, a second clock information message at the current moment is obtained based on the first clock information message or the controller LAN message monitored, and the second clock information message is sent to multiple domain controllers. That is to say, the central gateway is used as the vehicle backup time publishing source to redundantly broadcast the vehicle time, which can ensure the time synchronization between the vehicle domain controllers in the event of a TSN protocol stack failure, avoid time jumps, and improve the accuracy of time synchronization.
[0028] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0030] Figure 1 is a flow chart showing a time synchronization method for a vehicle according to an exemplary embodiment;
[0031] Figure 2 is a structural diagram of a time synchronization system for a vehicle according to an exemplary embodiment;
[0032] Figure 3 is a flow chart showing a time synchronization method for a vehicle according to an exemplary embodiment;
[0033] Figure 4 is a schematic diagram of a vehicle time synchronization method according to an exemplary embodiment;
[0034] Figure 5 is a flow chart showing a time synchronization method for a vehicle according to an exemplary embodiment;
[0035] Figure 6is a structural diagram of a vehicle-mounted Internet of Things device according to an exemplary embodiment;
[0036] Figure 7 is a structural block diagram of a time synchronization device for a vehicle according to an exemplary embodiment;
[0037] Figure 8 is a structural block diagram of a time synchronization device for a vehicle according to an exemplary embodiment;
[0038] Fig. 9 is a block diagram of a chip architecture according to an exemplary embodiment;
[0039] Fig.10 It is a structural block diagram of a chip according to an exemplary embodiment. DETAILED DESCRIPTION
[0040] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present application. Instead, they are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0041] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0042] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at..." or "when..." or "in response to determination".
[0043] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0044] It should be noted that the vehicle time synchronization method provided in any embodiment of the present application can be executed alone, or in combination with possible implementation methods in other embodiments, or in combination with any technical solution in the relevant technology.
[0045] The following describes a vehicle time synchronization method and device according to an embodiment of the present application with reference to the accompanying drawings.
[0046] Figure 1 FIG. 1 is a flow chart showing a method for synchronizing a vehicle according to an exemplary embodiment. Figure 1 As shown, the method is executed by the central gateway and includes:
[0047] S101, within the same time period, continuously monitor the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device.
[0048] In the embodiment of the present application, the time period is calculated from the time when the vehicle is powered on, and the controller area network message and the first clock information message sent by the vehicle-mounted Internet of Things (Telematics) device are monitored.
[0049] Optionally, the time period is an ignition period; optionally, the time period is a time period when the entire vehicle is not fully powered or is powered off, which is not limited in this embodiment of the present application.
[0050] like Figure 2 As shown, optionally, in an embodiment of the present application, the central gateway monitors the controller area network CAN message sent by the vehicle-mounted Internet of Things device based on the controller area network, and monitors the first clock information gPTP message based on Ethernet.
[0051] The gPTP message is a data packet used to transmit clock information, and includes various message types, such as Sync, Announce, Follow_Up, Delay_Req, Delay_Resp, and Pdelay_Req, etc. In some implementations, after monitoring the first clock information message, the first clock information message is parsed to determine whether the message type of the first clock information message is missing. If the first clock information message lacks fields of certain message types, for example, the first clock information message only includes the field of the Sync message type, but does not include the field of the Follow_Up message type, then the first clock information message is determined to be invalid, and the first clock information message is filtered.
[0052] Considering that when plugging and unplugging a small battery, the on-board Internet of Things device may send a first clock information message or a controller local area network message carrying erroneous clock information at the initial startup stage, therefore, in an embodiment of the present application, a filtering mechanism is added to filter the first clock information message and / or the controller local area network message according to a preset time range.
[0053] In some embodiments, after monitoring the first clock information message, the first clock information message is parsed to determine whether the clock information of the first clock information message is within a preset first time range; if the first clock information message is not within the preset first time range, the first clock information message is determined to be invalid and the first clock information message is filtered.
[0054] In some implementations, after monitoring a controller LAN message, the controller LAN message is parsed to determine whether the clock information of the controller LAN message is within a preset second time range; if the controller LAN message is not within the preset second time range, the controller LAN message is determined to be invalid and the controller LAN message is filtered.
[0055] Optionally, the first time range and the second time range may be the same time range or different time ranges, which is not limited in the embodiment of the present application.
[0056] S102: Acquire a second clock information message at a current moment according to a monitored first clock information message or a controller area network message.
[0057] In the embodiment of the present application, the current moment is taken as the i-th moment for illustration, where i is an integer greater than 1.
[0058] In some embodiments, within the same time period, from the 1st moment to the current i-th moment, the central gateway does not monitor the first clock information message sent by the onboard Internet of Things device, and only monitors one or more frames of controller LAN messages sent by the onboard Internet of Things device. It is necessary to use the controller LAN message as a backup clock source, that is, to obtain the second clock information message at the current i-th moment based on the controller LAN message.
[0059] In some embodiments, within the same time period, from the 1st moment to the current i-th moment, the central gateway monitors one or more frames of first clock information messages sent by the onboard Internet of Things device, and monitors one or more frames of controller local area network messages sent by the onboard Internet of Things device. To avoid time jumping back and forth and subsequent asynchronous controller local area network messages, the first clock information message is used to obtain the second clock information message at the current i-th moment.
[0060] S103: Send the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message.
[0061] Optionally, in an embodiment of the present application, the central gateway sends the second clock information message to multiple domain controllers based on Ethernet, performs time synchronization on the domain controllers in the vehicle, and broadcasts the entire vehicle time. The second clock information message can instruct multiple domain controllers to perform time synchronization according to the clock information of the second clock information message.
[0062] After sending the second clock information message at the current i-th moment to multiple domain controllers, continue to obtain the second clock information message at the next moment, and continue to publish time to multiple domain controllers of the vehicle. For the process of obtaining the second clock information message at the next moment, refer to the relevant content in the above embodiment, which will not be repeated here.
[0063] In an embodiment of the present application, the second clock information message at the current i-th moment is obtained based on the first clock information message or the controller local area network message monitored, and the second clock information message is sent to multiple domain controllers. That is to say, the central gateway is used as the vehicle backup time publishing source to redundantly broadcast the vehicle time, which can ensure the time synchronization between the vehicle domain controllers in the event of a TSN protocol stack failure, avoid time jumps, and improve the accuracy of time synchronization.
[0064] Figure 3 FIG. 1 is a flow chart showing a method for synchronizing a vehicle according to an exemplary embodiment. Figure 3 As shown, the method is executed by the central gateway and includes:
[0065] S301, within the same time period, continuously monitor the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device.
[0066] For the introduction of step S301, please refer to the relevant content in the above embodiment, which will not be repeated here.
[0067] S302: In response to monitoring a first clock information message at the current moment, determining the first clock information message monitored at the current moment as a second clock information message.
[0068] If the central gateway receives the first clock information message, it directly synchronizes time according to the first clock information message, that is, each subsequent domain controller adopts gPTP timing.
[0069] S303: In response to not monitoring the first clock information message at the current moment, obtaining a second clock information message according to a historical clock information message or a controller area network message.
[0070] In the embodiment of the present application, the current moment is taken as the i-th moment for illustration, wherein the historical moments are the 1st moment to the i-1th moment in the current time period.
[0071] In an embodiment of the present application, the historical clock information message is the last frame of the first clock information message monitored at a historical moment in the current time period. For example, if a frame of the first clock information message is monitored at a historical moment in the current time period, then the first clock information message is the historical clock information message. If multiple frames of the first clock information message are monitored at a historical moment in the current time period, then the last frame of the first clock information message is used as the historical clock information message in an embodiment of the present application.
[0072] In response to the failure to monitor the first clock information message at the i-th moment, it is determined whether the historical clock information message is monitored in the current time period. If the historical clock information message has been monitored in the same time period, in order to avoid time jumps, the controller LAN message is not synchronized, and the second clock information message is obtained according to the clock information in the historical clock information message and the first timing information of the system clock. The first timing information of the system clock is the timing information obtained by the system clock after the historical clock information message is monitored. For example, the target clock information is obtained according to the sum of the clock information in the historical clock information message and the first timing information of the system clock, and the second clock information message is obtained according to the target clock information.
[0073] In some implementations, in response to not monitoring a historical clock information message, determining whether a controller area network message is monitored at the i-th moment; in response to monitoring a controller area network message at the i-th moment, acquiring a second clock information message based on the clock information in the controller area network message.
[0074] In some implementations, in response to not listening to the first clock information message or the controller area network message at the i-th moment, and not listening to the historical clock information message at the historical moment in the current time period, the second clock information message is acquired according to the historical controller area network message and the second timing information of the system clock. For example, the target clock information is acquired according to the sum of the clock information in the historical controller area network message and the second timing information of the system clock, and the second clock information message is acquired according to the target clock information.
[0075] The historical CAN message is the last frame of CAN message monitored at a historical moment in the current time period, and the second timing information is the timing information obtained by the system clock starting from monitoring the historical CAN message.
[0076] S304: Send the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message.
[0077] For the introduction of step S304, please refer to the relevant content in the above embodiment, which will not be repeated here.
[0078] In the embodiment of the present application, in response to monitoring the first clock information message at the i-th moment, the first clock information message monitored at the i-th moment is determined as the second clock information message, and in response to not monitoring the first clock information message at the i-th moment, the second clock information message is obtained according to the historical clock information message or the controller local area network message. The embodiment of the present application can avoid time jumps when the TSN protocol stack fails, and can ensure time synchronization between the domain controllers of the vehicle.
[0079] Figure 4 is a schematic diagram showing a time synchronization method for a vehicle according to an exemplary embodiment, such as Figure 4 As shown, in an embodiment of the present application, taking the current moment as the i-th moment as an example for explanation, within the same time period, the controller LAN message and the first clock information message with clock information sent by the vehicle-mounted Internet of Things device are continuously monitored, and in response to the first clock information message being monitored at the i-th moment, the first clock information message being monitored at the i-th moment is determined as the second clock information message; in response to the first clock information message not being monitored at the i-th moment, it is determined whether a historical clock information message is monitored within the current time period; in response to the historical clock information message being monitored, the second clock information message is obtained according to the clock information in the historical clock information message and the first timing information of the system clock; in response to the historical clock information message not being monitored, it is determined whether the controller LAN message is monitored at the i-th moment; in response to the controller LAN message being monitored at the i-th moment, the second clock information message is obtained according to the clock information in the controller LAN message. In response to not monitoring a controller area network message at the i-th moment, obtaining a second clock information message based on the clock information in the historical controller area network message and the second timing information of the system clock; sending the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization based on the clock information in the second clock information message.
[0080] To summarize, in some implementations, when the central gateway fails to monitor the first clock information message sent by the on-board Internet of Things device within the current time period, the central gateway uses the clock information of the controller local area network message to obtain the second clock information message, and performs time synchronization for each domain controller of the vehicle. After receiving the first clock information message, the vehicle domain controllers are synchronized according to the first clock information message; at this time, if the subsequent TSN protocol stack fails, the on-board Internet of Things device stops sending the first clock information message. At this time, since the central gateway has monitored historical clock information messages within the current time period, even if the first clock information message is disconnected, the CAN bus message can be omitted, and the system clock inside the central gateway can be used to continue timing based on the clock information of the historical clock information message, and the second clock information message is obtained for time synchronization.
[0081] The embodiment of the present application can avoid time jumps when the TSN protocol stack fails, ensure time synchronization between domain controllers of the vehicle, and improve the efficiency and accuracy of time synchronization. At the same time, other domain controllers have no additional workload and do not require additional software and hardware support.
[0082] Figure 5 FIG. 1 is a flow chart showing a method for synchronizing a vehicle according to an exemplary embodiment. Figure 5 As shown, the method is executed by a vehicle-mounted Internet of Things device, including:
[0083] S501, monitoring reference clock information sent by a global navigation satellite system.
[0084] Figure 6 is a structural diagram of a vehicle-mounted Internet of Things device according to an exemplary embodiment. Figure 6 As shown, the vehicle-mounted Internet of Things device (Telematics module) includes:
[0085] Navigation, audio and data NAD module, consisting of a microprocessor unit (MPU) and a global navigation satellite system (GNSS) module;
[0086] Microcontroller Unit (MCU);
[0087] The real-time clock RTC is mainly responsible for providing system timing function when the system is in sleep mode.
[0088] Among them, the Global Positioning System (GPS) sends UTC time (UTC is the abbreviation of Coordinated Universal Time, also known as World Standard Time) to the GNSS module through the antenna (Antenna), the GNSS module synchronizes the UTC time to the MPU through the 1PPS (1pps is the abbreviation of 1 Pulse Per Second, meaning second pulse) hard line, and the MPU synchronizes the UTC time to the MCU through the 1PPS hard line.
[0089] In the embodiment of the present application, UTC time is the reference clock information.
[0090] S502: In response to monitoring the reference clock information, obtain a clock information message and / or a controller area network message based on the reference clock information, and send the clock information message and / or the controller area network message to the central gateway.
[0091] After the MCU synchronizes the UTC time, it uses the UTC time to obtain the controller area network message and clock information message, and sends them to the central gateway to publish the vehicle time.
[0092] In the embodiment of the present application, the vehicle-mounted Internet of Things device sends a controller area network message to the central gateway based on the controller area network, and the vehicle-mounted Internet of Things device sends a first clock information message to the central gateway based on Ethernet. Optionally, the sending period can be 100ms.
[0093] S503, in response to not monitoring the reference clock information, obtaining real-time clock information, obtaining a controller area network message according to the real-time clock information, and sending the message to the central gateway.
[0094] In some embodiments, GNSS may be unavailable (not Ready) after the vehicle is powered on. That is, when the reference clock information is not monitored, the MCU's Timer Master uses the real-time clock information, that is, the RTC time to obtain the controller LAN message and send it to the central gateway to realize the release of the vehicle time based on the CAN bus.
[0095] In an embodiment of the present application, clock information messages and / or controller LAN messages are obtained and sent to the central gateway, so that the central gateway can be used as the backup time publishing source for the whole vehicle to redundantly broadcast the whole vehicle time. In the event of failure of the TSN protocol stack, time synchronization between the various domain controllers of the vehicle can be guaranteed, time jumps can be avoided, and the accuracy of time synchronization can be improved.
[0096] Figure 7 is a structural block diagram of a time synchronization device for a vehicle according to an exemplary embodiment. Figure 7 As shown, based on the same application concept, the embodiment of the present application further provides a vehicle time synchronization device 700, including:
[0097] The monitoring module 710 is used to continuously monitor the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device within the same time period;
[0098] An acquisition module 720, configured to acquire a second clock information message at a current moment according to a monitored first clock information message or a controller area network message;
[0099] The sending module 730 is used to send the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message.
[0100] In some implementations, the acquisition module 720 is further configured to:
[0101] In response to monitoring a first clock information message at the current moment, determining the first clock information message monitored at the current moment as a second clock information message;
[0102] In response to not monitoring the first clock information message at the current moment, obtaining the second clock information message according to the historical clock information message or the controller area network message, the historical clock information message being the last frame of the first clock information message monitored at a historical moment in the current time period.
[0103] In some implementations, the acquisition module 720 is further configured to:
[0104] Determine whether historical clock information messages are monitored within the current time period;
[0105] In response to monitoring the historical clock information message, a second clock information message is obtained according to the clock information in the historical clock information message and the first timing information of the system clock, wherein the first timing information of the system clock is the timing information obtained by the system clock starting from monitoring the historical clock information message.
[0106] In some implementations, the acquisition module 720 is further configured to:
[0107] In response to not monitoring the historical clock information message, determining whether a controller area network message is monitored at the current moment;
[0108] In response to monitoring a controller area network message at the current moment, a second clock information message is acquired according to the clock information in the controller area network message.
[0109] In some implementations, the acquisition module 720 is further configured to:
[0110] In response to not monitoring a controller area network message at the current moment, acquiring a second clock information message according to a historical controller area network message and second timing information of a system clock;
[0111] The historical CAN message is the last frame of CAN message monitored at a historical moment in the current time period, and the second timing information is the timing information obtained by the system clock starting from monitoring the historical CAN message.
[0112] In some implementations, the monitoring module 710 is further configured to:
[0113] Comparing the clock information in the monitored first clock information message with a preset first time range, and filtering the first clock information message whose clock information does not exist in the first time range; and / or
[0114] The clock information in the monitored CAN message is compared with a preset second time range, and the CAN message whose clock information does not exist in the second time range is filtered.
[0115] In some implementations, the monitoring module 710 is further configured to:
[0116] In response to monitoring the first clock information message, determining whether a message type of the clock information in the first clock information message is missing;
[0117] In response to the absence of a message type of the clock information in the first clock information message, the first clock information message is filtered.
[0118] In some implementations, controller area network messages are monitored based on a controller area network; and / or first clock information messages are monitored based on Ethernet.
[0119] In an embodiment of the present application, a second clock information message at the current moment is obtained based on the first clock information message or the controller LAN message monitored, and the second clock information message is sent to multiple domain controllers. That is to say, the central gateway is used as the vehicle backup time publishing source to redundantly broadcast the vehicle time, which can ensure the time synchronization between the vehicle domain controllers in the event of a TSN protocol stack failure, avoid time jumps, and improve the accuracy of time synchronization.
[0120] Figure 8 is a structural block diagram of a time synchronization device for a vehicle according to an exemplary embodiment. Figure 8 As shown, based on the same application concept, the embodiment of the present application further provides a vehicle time synchronization device 800, including:
[0121] A monitoring module 810, configured to monitor reference clock information sent by a global navigation satellite system;
[0122] A first acquisition module 820, configured to acquire a clock information message and / or a controller area network message based on the reference clock information in response to monitoring the reference clock information, and send the clock information message and / or the controller area network message to the central gateway;
[0123] The second acquisition module 830 is used to acquire real-time clock information in response to failure to monitor the reference clock information, and acquire the controller area network message according to the real-time clock information and send it to the central gateway.
[0124] In some implementations, a controller area network message is sent to the central gateway based on a controller area network; and / or a first clock information message is sent to the central gateway based on Ethernet.
[0125] In an embodiment of the present application, clock information messages and / or controller LAN messages are obtained and sent to the central gateway, so that the central gateway can be used as the backup time publishing source for the whole vehicle to redundantly broadcast the whole vehicle time. In the event of failure of the TSN protocol stack, time synchronization between the various domain controllers of the vehicle can be guaranteed, time jumps can be avoided, and the accuracy of time synchronization can be improved.
[0126] Fig. 9 It is a block diagram of a chip architecture according to an exemplary embodiment. Fig. 9 The chip shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0127] like Fig. 9 As shown, the architecture 1000 of the chip includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a memory 1006 to a random access memory (RAM) 1003. In RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processor 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0128] The following components are connected to the I / O interface 1005: a memory 1006 including a hard disk, etc.; and a communication part 1007 including a network interface card such as a LAN (Local Area Network) card, a modem, etc., and the communication part 1007 performs communication processing via a network such as the Internet; a drive 1008 is also connected to the I / O interface 1005 as needed.
[0129] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1007. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the method of the present application are executed.
[0130] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 1001 of the electronic device 1000 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0131] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0132] Fig.10 It is a structural block diagram of a chip according to an exemplary embodiment. Fig.10 The structure of the chip shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Fig.10 As shown, the structure 1100 of the chip includes a processor 1101 and a memory 1102. The memory 1102 is used to store program codes, and the processor 1101 is connected to the memory 1102 to read the program codes from the memory 1102 to implement the control method in the above embodiment.
[0133] Optionally, the number of processors 1101 may be one or more.
[0134] Optionally, the chip structure may further include an interface 1103, and the number of the interface 1103 may be multiple. The interface 1103 may be connected to an application program and may receive data from an external device such as a sensor.
[0135] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0136] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A vehicle time synchronization method, characterized in that: Executed by the central gateway, including: In the same time period, continuously monitor the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device, wherein the controller area network message sent by the vehicle-mounted Internet of Things device is monitored based on the controller area network, and the first clock information message sent by the vehicle-mounted Internet of Things device is monitored based on Ethernet; Acquire the current second clock information message according to the monitored first clock information message or the controller local area network message; Sending the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information in the second clock information message; The acquiring the second clock information message of the current frame according to the monitored first clock information message or the controller local area network message includes: In response to monitoring the first clock information message at the current moment, determining the first clock information message monitored at the current moment as the second clock information message; In response to not monitoring the first clock information message at the current moment, obtaining the second clock information message according to the historical clock information message or the controller LAN message, wherein the historical clock information message is the last frame of the first clock information message monitored at a historical moment in the current time period.
2. The method according to claim 1, characterized in that The acquiring the second clock information message according to the historical clock information message or the controller local area network message includes: Determine whether the historical clock information message is monitored within the current time period; In response to monitoring the historical clock information message, the second clock information message is obtained according to the historical clock information message and the first timing information of the system clock, and the first timing information of the system clock is the timing information obtained by the system clock after monitoring the historical clock information message.
3. The method according to claim 2, characterized in that Also includes: In response to not monitoring the historical clock information message, determining whether the controller area network message is monitored at the current moment; In response to monitoring the controller area network message at the current moment, acquiring the second clock information message according to the clock information in the controller area network message.
4. The method according to claim 3, characterized in that Also includes: In response to not monitoring the controller area network message at the current moment, acquiring the second clock information message according to the historical controller area network message and the second timing information of the system clock; The historical CAN message is the last frame of the CAN message monitored at a historical moment in the current time period, and the second timing information is the timing information obtained by the system clock starting from monitoring the historical CAN message.
5. The method according to any one of claims 1 to 4, characterized in that: After the continuous monitoring of the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device, the method further includes: Comparing the monitored clock information in the first clock information message with a preset first time range, and filtering the first clock information message whose clock information does not exist in the first time range; and / or The clock information in the monitored CAN message is compared with a preset second time range, and the CAN message whose clock information does not exist in the second time range is filtered.
6. The method according to any one of claims 1 to 4, characterized in that: After the continuous monitoring of the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device, the method further includes: In response to monitoring the first clock information message, determining whether a message type of the clock information in the first clock information message is missing; In response to the absence of a message type of clock information in the first clock information message, the first clock information message is filtered.
7. The method according to any one of claims 1 to 4, characterized in that: Also includes: Monitoring the controller area network message based on the controller area network; and / or The first clock information message is monitored based on Ethernet.
8. The method according to any one of claims 1 to 4, characterized in that: Also includes: The time period is an ignition period; or The time period is a time period during which the whole vehicle is not fully powered; or The time period is a time period during which the entire vehicle is not completely powered off.
9. A vehicle time synchronization method, characterized in that: Executed by the vehicle IoT device, including: Monitor the reference clock information sent by the global navigation satellite system; In response to monitoring the reference clock information, acquiring a clock information message and / or a controller area network message based on the reference clock information, and sending the clock information message and / or the controller area network message to a central gateway; In response to not monitoring the reference clock information, real-time clock information is obtained, the controller local area network message is obtained according to the real-time clock information and sent to the central gateway, and the central gateway executes the vehicle time synchronization method as described in any one of claims 1-8.
10. The method according to claim 9, characterized in that Also includes: Sending the controller area network message to the central gateway based on the controller area network; and / or The first clock information message is sent to the central gateway based on Ethernet.
11. A time synchronization device for a vehicle, characterized in that: include: A monitoring module, used for continuously monitoring the controller area network message with clock information and the first clock information message sent by the vehicle-mounted Internet of Things device within the same time period; An acquisition module, configured to acquire a second clock information message at a current moment according to the first clock information message or the controller area network message monitored; A sending module, used for sending the second clock information message to multiple domain controllers to instruct the multiple domain controllers to perform time synchronization according to the clock information of the second clock information message; The acquiring the second clock information message of the current frame according to the monitored first clock information message or the controller local area network message includes: In response to monitoring the first clock information message at the current moment, determining the first clock information message monitored at the current moment as the second clock information message; In response to not monitoring the first clock information message at the current moment, obtaining the second clock information message according to the historical clock information message or the controller LAN message, wherein the historical clock information message is the last frame of the first clock information message monitored at a historical moment in the current time period.
12. A time synchronization device for a vehicle, characterized in that: include: A monitoring module, used for monitoring reference clock information sent by the global navigation satellite system; A first acquisition module, configured to acquire a clock information message and / or a controller area network message based on the reference clock information in response to monitoring the reference clock information, and send the clock information message and / or the controller area network message to a central gateway; The second acquisition module is used to obtain real-time clock information in response to not listening to the reference clock information, obtain the controller local area network message according to the real-time clock information and send it to the central gateway, and the central gateway executes the vehicle time synchronization method as described in any one of claims 1-8.
13. A vehicle, characterized in that: The vehicle comprises: the time synchronization device for a vehicle according to claim 11 or the synchronization device for a vehicle according to claim 12 .
14. A chip, characterized in that: include: A memory for storing program codes; A processor, connected to the memory, is used to read the program code from the memory to execute the vehicle time synchronization method as described in any one of claims 1-8, or to execute the vehicle time synchronization method as described in any one of claims 9-10.
15. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the vehicle time synchronization method as described in any one of claims 1-8, or execute the vehicle time synchronization method as described in any one of claims 9-10.
16. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the vehicle time synchronization method described in any one of claims 1 to 8, or executes the vehicle time synchronization method described in any one of claims 9 to 10.
Citation Information
Patent Citations
System architecture and method for vehicle time synchronization and vehicle
CN115348657A