Time synchronization method, device, storage medium and vehicle
By obtaining the GNSS standard time and generating time synchronization messages, the challenge of in-vehicle time synchronization in intelligent connected vehicles is solved, high-precision time synchronization is achieved, and the time consistency of various systems in the vehicle is ensured.
Patent Information
- Application Number
- CN202311833579.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-27
AI Technical Summary
In intelligent connected cars, there are challenges in synchronizing the in-car time with the real UTC time. Especially in scenarios such as remote control, Bluetooth key authorization, certificate authentication, and V2X vehicle interior and exterior perception fusion, the synchronization requirements for in-car time information are very high. , but it is difficult for the existing technology to effectively solve the impact of the internal delay of the master clock system on time synchronization.
By obtaining the Global Navigation Satellite System (GNSS) standard time, the system base time of the master clock system is updated, and a time synchronization message is generated based on the updated system base time and the predetermined target error time, and is sent to the slave clock system to eliminate The influence of the internal delay of the master clock system ensures the time consistency of various systems in the vehicle.
It achieves high-precision time synchronization, eliminates the impact of the internal delay of the master clock system on time synchronization, ensures the time consistency of various systems in the vehicle, and improves the accuracy of time expression.
Smart Images

Figure CN117728913B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a time synchronization method, device, storage medium and vehicle. Background Art
[0002] With the continuous development of intelligent connected vehicles, scenarios such as remote control, Bluetooth key authorization, certificate authentication, large-screen time display, time alignment of V2X in-vehicle and out-of-vehicle perception fusion, etc. will involve in-vehicle time information, and have very high requirements for the synchronization of in-vehicle time with the real UTC (Coordinated Universal Time). Summary of the invention
[0003] To overcome the problems existing in the related art, the present disclosure provides a time synchronization method, device, storage medium and vehicle.
[0004] According to a first aspect of an embodiment of the present disclosure, a time synchronization method is provided, which is applied to a master clock system, and the method includes:
[0005] Get the GNSS standard time;
[0006] Updating the system reference time of the master clock system according to the GNSS standard time;
[0007] According to the updated system reference time and target error time, a time synchronization message is sent to multiple slave clock systems; the time synchronization message is used to instruct the slave clock system to synchronize time information according to the time synchronization message, and the target error time is the predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to multiple slave clock systems.
[0008] Optionally, the master clock system includes a first node, a second node and a third node; wherein the first node is used to obtain the GNSS standard time, the second node is used to update the system reference time of the master clock system according to the GNSS standard time, and the third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time; the target error time is determined by the following method:
[0009] Obtaining a first second pulse signal corresponding to the first node, a second second pulse signal corresponding to the second node, and a third second pulse signal corresponding to the third node at the same target time;
[0010] The target time error is determined according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal.
[0011] Optionally, determining the target time error according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal comprises:
[0012] Determine a first time error between the first node and the second node according to the first pulse second signal and the second pulse second signal;
[0013] determining a second time error between the second node and the third node according to the second pulse second signal and the third pulse second signal;
[0014] The target time error is determined according to the first time error and the second time error.
[0015] Optionally, the pulse-per-second signal is obtained by:
[0016] The pulse-per-second signal at the target time corresponding to the node is obtained through an oscilloscope.
[0017] Optionally, the pulse-per-second signal is obtained by:
[0018] Trigger an interrupt instruction at the target time, and obtain an interrupt signal corresponding to the interrupt instruction;
[0019] The interrupt signal is used as the pulse-per-second signal.
[0020] Optionally, the method further comprises:
[0021] When the first time error and / or the second time error is greater than or equal to a preset time error threshold, a prompt message is generated.
[0022] Optionally, sending time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time includes:
[0023] The sum of the updated system reference time and the target error time is used as the target reference time;
[0024] According to the target reference time, a time synchronization message is sent to multiple slave clock systems.
[0025] According to a second aspect of an embodiment of the present disclosure, a time synchronization device is provided, which is applied to a master clock system, and the device includes:
[0026] An acquisition module is configured to acquire a global navigation satellite system GNSS standard time;
[0027] An updating module, configured to update a system reference time of the master clock system according to the GNSS standard time;
[0028] A sending module is configured to send time synchronization messages to multiple slave clock systems according to an updated system reference time and a target error time; the time synchronization message is used to instruct the slave clock system to synchronize time information according to the time synchronization message, and the target error time is a predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to multiple slave clock systems.
[0029] Optionally, the master clock system includes a first node, a second node and a third node; wherein the first node is used to obtain the GNSS standard time, the second node is used to update the system reference time of the master clock system according to the GNSS standard time, and the third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time; the target error time is determined by the following method:
[0030] Obtaining a first second pulse signal corresponding to the first node, a second second pulse signal corresponding to the second node, and a third second pulse signal corresponding to the third node at the same target time;
[0031] The target time error is determined according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal.
[0032] Optionally, determining the target time error according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal comprises:
[0033] Determine a first time error between the first node and the second node according to the first pulse second signal and the second pulse second signal;
[0034] determining a second time error between the second node and the third node according to the second pulse second signal and the third pulse second signal;
[0035] The target time error is determined according to the first time error and the second time error.
[0036] Optionally, the pulse-per-second signal is obtained by:
[0037] The pulse-per-second signal at the target time corresponding to the node is obtained through an oscilloscope.
[0038] Optionally, the pulse-per-second signal is obtained by:
[0039] Trigger an interrupt instruction at the target time, and obtain an interrupt signal corresponding to the interrupt instruction;
[0040] The interrupt signal is used as the pulse-per-second signal.
[0041] Optionally, the method further comprises:
[0042] When the first time error and / or the second time error is greater than or equal to a preset time error threshold, a prompt message is generated.
[0043] Optionally, the sending module is configured to use the sum of the updated system reference time and the target error time as the target reference time; and send time synchronization messages to multiple slave clock systems according to the target reference time.
[0044] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the time synchronization method provided by the first aspect of the present disclosure are implemented.
[0045] According to a fourth aspect of an embodiment of the present disclosure, a vehicle is provided, comprising: a master clock system and a plurality of slave clock systems; wherein the master clock system is configured to implement the steps of the time synchronization method provided in the first aspect of the present disclosure.
[0046] The technical solution provided by the embodiment of the present disclosure may include the following beneficial effects: first, obtain the GNSS standard time of the global navigation satellite system. Then, according to the GNSS standard time, update the system reference time of the master clock system. Finally, according to the updated system reference time and the target error time, send a time synchronization message to multiple slave clock systems; the time synchronization message is used to instruct the slave clock system to synchronize the time information according to the time synchronization message, and the target error time is the predetermined time consumed by the master clock system from obtaining the GNSS standard time to sending the time synchronization message to multiple slave clock systems. Using the above method, the target error time is obtained by predetermining the time consumed by the master clock system from obtaining the GNSS standard time to sending the time synchronization message to multiple slave clock systems. In the process of time synchronization, after the master clock system updates its own system reference time, a time synchronization message can be generated according to the target error time and system reference time inside the master clock system, thereby eliminating the influence of the internal delay of the master clock system. And by sending time synchronization messages to multiple slave clock systems, the slave clock system performs time synchronization according to the time synchronization message. In this way, the time consistency of each system in the vehicle can be ensured, achieving high-precision time synchronization.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0049] Figure 1 The present invention is a flowchart of a time synchronization method according to an exemplary embodiment.
[0050] Figure 2 The diagram is a node flow chart of a master clock system according to an exemplary embodiment.
[0051] Figure 3 The figure is a flowchart showing another time synchronization method according to an exemplary embodiment.
[0052] Figure 4 The diagram is a schematic diagram of a node flow of another master clock system according to an exemplary embodiment.
[0053] Figure 5 The figure is a flowchart showing another time synchronization method according to an exemplary embodiment.
[0054] Figure 6 The figure is a flowchart showing another time synchronization method according to an exemplary embodiment.
[0055] Figure 7 The invention is a block diagram showing a time synchronization device according to an exemplary embodiment.
[0056] Figure 8 It is a schematic diagram of a functional block diagram of a vehicle showing an exemplary embodiment. DETAILED DESCRIPTION
[0057] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0058] The terms "first", "second", etc. in the specification and claims of this application and the above drawings are used to distinguish similar objects and do not have to be understood as a specific order or sequence. In addition, in the description with reference to the drawings, the same symbols in different drawings represent the same elements.
[0059] In the description of the present disclosure, unless otherwise specified, "multiple" means two or more than two, and other quantifiers are similar thereto; "at least one item", "one item or multiple items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one item or multiple items among a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of description of the association relationship of associated objects, indicating that there can be three kinds of relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " indicates that the associated objects before and after are in an "or" relationship.
[0060] Although operations or steps are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present disclosure, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.
[0061] Before introducing a method, device, storage medium and vehicle for time synchronization provided by the present disclosure, the application scenarios involved in each embodiment of the present disclosure are first introduced. The present disclosure can be applied to the scenario of time synchronization in a vehicle. In this scenario, in order to synchronize the time information on various devices in the vehicle, the Ethernet-based GPTP (General Precise Time Protocol) protocol is often used. Usually, one device is set as the master clock system (also known as the timemaster), and other devices are set as slave clock systems (also known as time slaves). The time of the master clock system is used as the time reference to synchronously update the time of other slave clock systems to complete the time calibration. Since the requirements for time accuracy of each system in the vehicle are often very high, in order to reduce the time delay and improve the accuracy of time expression. What is usually considered is to offset the transmission delay between the master clock system and the slave clock system, that is, to eliminate the delay error between end to end.
[0062] For the master clock system, after obtaining the external GNSS standard time, it will first update its own system time, and then send a time synchronization message to other slave clock systems in the car for time synchronization. Since the time synchronization message carries the timestamp of obtaining the external GNSS standard time, there is a certain system delay from obtaining the external GNSS standard time to sending the time synchronization message. In other words, there is a system delay inside the master clock system, which will further affect the accuracy of the time in other slave clock systems.
[0063] In order to solve the above technical problems, the present invention provides a method, device, storage medium and vehicle for time synchronization. The target error time is obtained by predetermining the time consumed by the master clock system from acquiring the GNSS standard time to sending time synchronization messages to multiple slave clock systems. In the process of time synchronization, after the master clock system updates its own system reference time, a time synchronization message can be generated according to the target error time and the system reference time inside the master clock system, thereby eliminating the influence of the internal delay of the master clock system. And by sending time synchronization messages to multiple slave clock systems, the slave clock systems can synchronize time according to the time synchronization messages. In this way, the time consistency of each system in the vehicle can be ensured, and high-precision time synchronization can be achieved.
[0064] The specific implementation modes of the present invention are described in detail below with reference to the accompanying drawings.
[0065] Figure 1 This is a flowchart of a method for time synchronization according to an exemplary embodiment. The method can be used in a master clock system, wherein the master clock system can be a device pre-designated in the vehicle as a time reference. In the vehicle time synchronization scenario, it usually includes a master clock system and multiple slave clock systems (i.e., devices in the vehicle that need to be time synchronized except the master clock system). When the master clock system obtains the timing of the Global Navigation Satellite System (GNSS), it will send time synchronization messages to other slave clock systems for time synchronization. Figure 1 As shown, the method may include the following steps:
[0066] In step S101, the global navigation satellite system GNSS standard time is acquired.
[0067] The master clock system may obtain the GNSS standard time from the global navigation satellite system GNSS via the GNSS antenna on the vehicle.
[0068] In step S102, the system reference time of the master clock system is updated according to the GNSS standard time.
[0069] In one implementation, the GNSS standard time may be used to directly replace the system reference time of the master clock system, that is, the GNSS standard time may be directly used as the new system reference time of the master clock system.
[0070] In step S103, a time synchronization message is sent to multiple slave clock systems according to the updated system reference time and target error time.
[0071] The time synchronization message is used to instruct the slave clock system to synchronize time information according to the time synchronization message, and the time synchronization message may be a GPTP message, for example. The target error time is the predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to multiple slave clock systems.
[0072] For example, a corresponding time synchronization message may be generated according to the updated system reference time and target error time, and the time synchronization message may be sent to multiple slave clock systems, wherein the master clock system may send the time synchronization message to each slave clock system at the same time.
[0073] In some embodiments, the master clock system may include a first node (e.g., a GNSS module), a second node (e.g., an A core system clock), and a third node (e.g., a GPTP stack). The first node is used to obtain the GNSS standard time of the global navigation satellite system, and the second node is used to update the system reference time of the master clock system according to the GNSS standard time. The third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time.
[0074] The following is a schematic diagram of the node flow inside the master clock system in a specific usage scenario. Figure 2 As shown, the first node is a GNSS module, the second node is an A core system clock, and the third node is a GPTP stack. After the GNSS module obtains the GNSS standard time, the A core system clock can call the GNSS standard time obtained by the GNSS module through a preset callback function. Afterwards, the GNSS standard time can be passed to the GPTP stack through the phy2sys data link between the GPTP stack. Next, the GPTP stack can generate a time synchronization message based on the GNSS standard time and the target error time, and send the time synchronization message to multiple slave clock systems, so that the slave clock systems can perform time synchronization according to the time synchronization message.
[0075] It should be noted that obtaining data through a callback function or through a phy2sys data link are merely examples of two data transmission methods shown in this embodiment. The present disclosure is not limited to the transmission method of the callback function or the phy2sys data link, and other data transmission methods may also be used.
[0076] By adopting the above method, the target error time is obtained by predetermining the time consumed by the master clock system from obtaining the GNSS standard time to sending time synchronization messages to multiple slave clock systems. In the process of time synchronization, after the master clock system updates its own system reference time, a time synchronization message can be generated according to the target error time and system reference time inside the master clock system, thereby eliminating the influence of the internal delay of the master clock system. And by sending time synchronization messages to multiple slave clock systems, the slave clock systems can synchronize time according to the time synchronization messages. In this way, the time consistency of each system in the vehicle can be ensured, and high-precision time synchronization can be achieved.
[0077] For the sake of convenience, the following continues to take the above example where the master clock system includes a first node, a second node, and a third node as an example, and describes in detail the method for determining the above target error time. Figure 3 As shown, the target error time can be determined by the following steps:
[0078] S1, obtaining a first pulse-per-second signal corresponding to a first node, a second pulse-per-second signal corresponding to a second node, and a third pulse-per-second signal corresponding to a third node at the same target time.
[0079] In some embodiments, the degree of deviation of the time between each node can be determined by capturing the pulse per second (PPS) signal output by each node at the same time, and then judging the degree of deviation of the waveform corresponding to each pulse per second signal at the same time. It is understandable that for the same signal, the corresponding time when passing through different nodes during the transmission process is deviated. It is by utilizing this characteristic that the data transmission time between each node can be determined by obtaining the first pulse per second signal corresponding to the first node, the second pulse per second signal corresponding to the second node, and the third pulse per second signal corresponding to the third node at the same target time, that is, the delay of each node can be identified.
[0080] like Figure 4 As shown, the pulse-per-second signal output by each node at the same target time can be obtained by an oscilloscope. In this embodiment, there are two ways of using an oscilloscope to obtain the pulse-per-second signal output by the node:
[0081] In a possible implementation, if the node itself has a pps clock interface, an oscilloscope can be connected to the pps clock interface on the node through a hard line, and then the pulse per second signal at the target time corresponding to the node can be obtained through the oscilloscope.
[0082] For example, Figure 4 The GNSS module in the embodiment has a GPIO interface (ie, a pps clock interface), which can be connected to an oscilloscope through a hard wire, and then the first second pulse signal of the target time corresponding to the first node can be obtained through the oscilloscope.
[0083] In another possible implementation, if the node itself does not have a PPS clock interface, the whole second pulse signal can be simulated by software. Specifically, an interrupt instruction can be triggered at the target time, an interrupt signal corresponding to the interrupt instruction can be obtained, and the interrupt signal can be used as the pulse signal. That is, an interrupt can be generated by software, and the interrupt can be output to a pin of the node, and then the pin can be connected to an oscilloscope, and the signal output by the pin (i.e., the pulse signal) can be observed through the oscilloscope.
[0084] For example, Figure 4 If neither the A core system clock (i.e., the second node) nor the GPTP stack (i.e., the third node) has a pps clock interface, then an interrupt can be generated and output to a certain pin, and then the second second pulse signal corresponding to the second node and the third second pulse signal corresponding to the third node can be obtained through an oscilloscope.
[0085] S2, determining the target time error according to the first pulse per second signal, the second pulse per second signal, and the third pulse per second signal.
[0086] Specifically, first, the first time error between the first node and the second node can be determined according to the first second pulse signal and the second second pulse signal. Then, the second time error between the second node and the third node can be determined according to the second second pulse signal and the third second pulse signal. Finally, the target time error can be determined according to the first time error and the second time error.
[0087] For example, the sum of the first time error and the second time error can be used as the target time error. For example, if the first time error is 3ms (indicating that it takes 3ms for the first node to transmit data to the second node), and the second time error is 5ms (indicating that it takes 5ms for the second node to transmit data to the third node), then the target time error is 8ms.
[0088] It should be noted that, in order to improve the accuracy of the target time error, the first time error and the second time error may be measured multiple times, and the average of the target time errors calculated multiple times may be taken to obtain the final target time error.
[0089] In some embodiments, Figure 5 As shown, the method may also include the following steps:
[0090] S3: Generate prompt information when the first time error and / or the second time error is greater than or equal to a preset time error threshold.
[0091] In this step, if the first time error and / or the second time error is too large, it is considered that the delay may be too large due to system load scheduling, code design logic, etc. At this time, in order to facilitate further investigation of the cause of the problem, a prompt message can be generated when the first time error and / or the second time error is greater than or equal to a preset time error threshold, so as to facilitate technical personnel to investigate the link.
[0092] Figure 6 is a flow chart showing another time synchronization method according to an exemplary embodiment. Figure 6 As shown, in the above step S103, sending time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time may include the following steps:
[0093] In step S1031, the sum of the updated system reference time and the target error time is used as the target reference time.
[0094] In step S1032, a time synchronization message is sent to multiple slave clock systems according to the target reference time.
[0095] It is understandable that in the related art, the timestamp recorded in the time synchronization message sent by the master clock system to the slave clock system is the timestamp of obtaining the GNSS standard time, and the internal delay of the master clock system is not taken into account. In this embodiment, by compensating the updated system reference time with a target error time, the internal delay of the master clock system is taken into account in the entire time synchronization process. In this way, each slave clock system can synchronize the system time of its own system according to the accurate target reference time, ensuring the time consistency of each system in the vehicle.
[0096] In addition, considering that there is still a certain degree of delay in the process of data transmission from the first node of the master clock system to the second node, in order to ensure the accuracy of the system reference time of the master clock system, the system reference time of the master clock system can also be updated according to the acquired GNSS standard time and the first time error. For example, the system reference time of the master clock system can be updated with the sum of the GNSS standard time and the first time error.
[0097] By adopting the above method, the target error time is obtained by predetermining the time consumed by the master clock system from obtaining the GNSS standard time to sending time synchronization messages to multiple slave clock systems. In the process of time synchronization, after the master clock system updates its own system reference time, a time synchronization message can be generated according to the target error time and system reference time inside the master clock system, thereby eliminating the influence of the internal delay of the master clock system. And by sending time synchronization messages to multiple slave clock systems, the slave clock systems can synchronize time according to the time synchronization messages. In this way, the time consistency of each system in the vehicle can be ensured, and high-precision time synchronization can be achieved.
[0098] Figure 7 is a block diagram of a time synchronization device according to an exemplary embodiment, which is applied to a master clock system, such as Figure 7 As shown, the device 200 includes:
[0099] The acquisition module 201 is configured to acquire the global navigation satellite system GNSS standard time;
[0100] An updating module 202 is configured to update the system reference time of the master clock system according to the GNSS standard time;
[0101] The sending module 203 is configured to send a time synchronization message to multiple slave clock systems based on the updated system reference time and target error time; the time synchronization message is used to instruct the slave clock system to synchronize the time information according to the time synchronization message, and the target error time is the predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to multiple slave clock systems.
[0102] Optionally, the master clock system includes a first node, a second node and a third node; wherein the first node is used to obtain the GNSS standard time, the second node is used to update the system reference time of the master clock system according to the GNSS standard time, and the third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time; the target error time is determined by:
[0103] Obtaining a first second pulse signal corresponding to the first node, a second second pulse signal corresponding to the second node, and a third second pulse signal corresponding to the third node at the same target time;
[0104] The target time error is determined according to the first pulse per second signal, the second pulse per second signal and the third pulse per second signal.
[0105] Optionally, determining the target time error according to the first pulse per second signal, the second pulse per second signal, and the third pulse per second signal includes:
[0106] Determine a first time error between the first node and the second node according to the first pulse second signal and the second pulse second signal;
[0107] Determine a second time error between the second node and the third node according to the second pulse second signal and the third pulse second signal;
[0108] The target time error is determined according to the first time error and the second time error.
[0109] Optionally, the pulse-per-second signal is obtained by:
[0110] The pulse-per-second signal of the target time corresponding to the node is obtained through an oscilloscope.
[0111] Optionally, the pulse-per-second signal is obtained by:
[0112] Trigger an interrupt instruction at the target time, and obtain an interrupt signal corresponding to the interrupt instruction;
[0113] The interrupt signal is used as the pulse-per-second signal.
[0114] Optionally, the method further comprises:
[0115] When the first time error and / or the second time error is greater than or equal to a preset time error threshold, a prompt message is generated.
[0116] Optionally, the sending module 203 is configured to use the sum of the updated system reference time and the target error time as the target reference time; and send time synchronization messages to multiple slave clock systems according to the target reference time.
[0117] By adopting the above device, the target error time is obtained by predetermining the time consumed by the master clock system from obtaining the GNSS standard time to sending time synchronization messages to multiple slave clock systems. In the process of time synchronization, after the master clock system updates its own system reference time, a time synchronization message can be generated according to the target error time and system reference time inside the master clock system, thereby eliminating the influence of the internal delay of the master clock system. And by sending time synchronization messages to multiple slave clock systems, the slave clock systems can synchronize time according to the time synchronization messages. In this way, the time consistency of each system in the vehicle can be ensured, and high-precision time synchronization can be achieved.
[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0119] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which implement the steps of the time synchronization method provided by the present disclosure when the program instructions are executed by a processor.
[0120] Figure 8 is a block diagram of a vehicle 300 according to an exemplary embodiment. For example, the vehicle 300 may be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or other types of vehicles. The vehicle 300 may be an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle.
[0121] Reference Figure 8 , the vehicle 300 may include various subsystems, for example, an infotainment system 310, a perception system 320, a decision control system 330, a drive system 340, and a computing platform 350. The vehicle 300 may also include more or fewer subsystems, and each subsystem may include multiple components. In addition, each subsystem and each component of the vehicle 300 may be interconnected by wire or wireless means.
[0122] In some embodiments, the infotainment system 310 may include a communication system, an entertainment system, and a navigation system, among others.
[0123] The perception system 320 may include several sensors for sensing information about the environment around the vehicle 300. For example, the perception system 320 may include a global positioning system (the global positioning system may be a GPS system, or a Beidou system or other positioning systems), an inertial measurement unit (IMU), a laser radar, a millimeter wave radar, an ultrasonic radar, and a camera.
[0124] The decision control system 330 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system.
[0125] The drive system 340 may include components that provide power movement for the vehicle 300. In one embodiment, the drive system 340 may include an engine, an energy source, a transmission system, and wheels. The engine may be one or a combination of an internal combustion engine, an electric motor, and an air compression engine. The engine is capable of converting energy provided by the energy source into mechanical energy.
[0126] Some or all functions of the vehicle 300 are controlled by a computing platform 350. The computing platform 350 may include at least one processor 351 and a memory 352, and the processor 351 may execute instructions 353 stored in the memory 352.
[0127] The processor 351 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.
[0128] The memory 352 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0129] In addition to instructions 353 , memory 352 may also store data, such as road maps, route information, vehicle location, direction, speed, etc. The data stored in memory 352 may be used by computing platform 350 .
[0130] In the embodiment of the present disclosure, the processor 351 may execute the instruction 353 to complete all or part of the steps of the above-mentioned time synchronization method.
[0131] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned time synchronization method when executed by the programmable device.
[0132] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0133] It should be understood that the present disclosure is not limited to the exact 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 disclosure is limited only by the appended claims.
Claims
1. A time synchronization method, characterized in that: Applied to a master clock system, the method comprises: Get the GNSS standard time; Updating the system reference time of the master clock system according to the GNSS standard time; Sending a time synchronization message to multiple slave clock systems according to the updated system reference time and target error time; the time synchronization message is used to instruct the slave clock system to synchronize time information according to the time synchronization message, and the target error time is the predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to multiple slave clock systems; The master clock system includes a first node, a second node and a third node; wherein the first node is used to obtain the GNSS standard time, the second node is used to update the system reference time of the master clock system according to the GNSS standard time, and the third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time; the target error time is determined by the following method: Obtaining a first second pulse signal corresponding to the first node, a second second pulse signal corresponding to the second node, and a third second pulse signal corresponding to the third node at the same target time; Determining the target time error according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal; The determining the target time error according to the first pulse-per-second signal, the second pulse-per-second signal, and the third pulse-per-second signal comprises: Determine a first time error between the first node and the second node according to the first pulse second signal and the second pulse second signal; determining a second time error between the second node and the third node according to the second pulse second signal and the third pulse second signal; The target time error is determined according to the first time error and the second time error.
2. The method according to claim 1, characterized in that: The pulse-per-second signal is obtained by: The pulse-per-second signal at the target time corresponding to the node is obtained through an oscilloscope.
3. The method according to claim 1, characterized in that The pulse-per-second signal is obtained by: Trigger an interrupt instruction at the target time, and obtain an interrupt signal corresponding to the interrupt instruction; The interrupt signal is used as the pulse-per-second signal.
4. The method according to claim 1, characterized in that: The method further comprises: When the first time error and / or the second time error is greater than or equal to a preset time error threshold, a prompt message is generated.
5. The method according to any one of claims 1 to 4, characterized in that The sending of time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time includes: The sum of the updated system reference time and the target error time is used as the target reference time; According to the target reference time, a time synchronization message is sent to a plurality of slave clock systems.
6. A time synchronization device, characterized in that: Applied to a master clock system, the device comprises: An acquisition module is configured to acquire a global navigation satellite system GNSS standard time; An updating module, configured to update a system reference time of the master clock system according to the GNSS standard time; A sending module, configured to send a time synchronization message to a plurality of slave clock systems according to an updated system reference time and a target error time; the time synchronization message is used to instruct the slave clock system to synchronize time information according to the time synchronization message, and the target error time is a predetermined time consumed by the master clock system from acquiring the GNSS standard time to sending the time synchronization message to the plurality of slave clock systems; The master clock system includes a first node, a second node and a third node; wherein the first node is used to obtain the GNSS standard time, the second node is used to update the system reference time of the master clock system according to the GNSS standard time, and the third node is used to send time synchronization messages to multiple slave clock systems according to the updated system reference time and target error time; The target error time is determined by: obtaining a first second pulse signal corresponding to the first node, a second second pulse signal corresponding to the second node, and a third second pulse signal corresponding to the third node at the same target time; determining the target time error according to the first second pulse signal, the second second pulse signal, and the third second pulse signal; Determining the target time error based on the first second pulse signal, the second second pulse signal and the third second pulse signal includes: determining the first time error between the first node and the second node based on the first second pulse signal and the second second pulse signal; determining the second time error between the second node and the third node based on the second second pulse signal and the third second pulse signal; determining the target time error based on the first time error and the second time error.
7. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
8. A vehicle, characterized in that: include: A master clock system and multiple slave clock systems; Wherein, the master clock system is configured to implement the steps of the method described in any one of claims 1 to 5.
