Method, system and storage medium for realizing high-precision timing of automobile cockpit system

By adopting a high-precision timing implementation method in the car cockpit system, using the full-second calibration processing and interrupt processing program, the problem of time synchronization delay in the prior art is solved, and the millisecond-level time synchronization of each operating system is realized to meet the timing requirements of the automatic driving function.

CN116300381BActive Publication Date: 2025-04-18HUIZHOU DESAY SV AUTOMOTIVE
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211725726.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-04-18
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In the existing car cockpit system, the MCU sends time to QNX through communication mechanisms such as SPI. QNX synchronizes time to Android through Socket, resulting in a delay of 50ms when the channel is busy, which cannot meet the accuracy requirements of time synchronization.

Method used

A high-precision time-telephone implementation method is adopted. The first operating system sends a second clock signal for the whole second, and the second operating system sends a synchronous calibration signal for the next full second to perform a full second calibration process, and gradually synchronizes to the third operating system to ensure that the time error of each operating system is controlled at the millisecond level.

Benefits of technology

It realizes high-precision synchronization of time milliseconds for each operating system, meets the timing system function requirements of the integrated autonomous driving function into the cockpit system, and simplifies system log comparison and application programming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116300381B_ABST
    Figure CN116300381B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, system and storage medium for realizing high-precision time synchronization of a car cockpit system, the method comprising: a first operating system sends a second clock signal to a second operating system in the first full second, and sends a first synchronization calibration signal to the second operating system in the second full second; after the second operating system receives the first synchronization calibration signal, it performs a full-second calibration process on the second clock to obtain a first calibration second clock, which is synchronized to the time of the second operating system; the second operating system sends a first calibration second clock signal to a third operating system in the third full second, and sends a second synchronization calibration signal to the third operating system in the fourth full second; after the third operating system receives the second synchronization calibration signal, it performs a full-second calibration process on the first calibration second clock to obtain a second calibration second clock, which is synchronized to the time of the third operating system. The present invention performs a full-second calibration process on the system time through an additional synchronization calibration signal, so that the time of each operating system is synchronized with high millisecond precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic information technology, and in particular to a method, system and storage medium for realizing high-precision time synchronization of a vehicle cockpit system. Background Art

[0002] With the development of electronic information technology, server clusters composed of multiple servers often need to use a unified time base. For example, when a server cluster fails, the cause and process of the accident can be accurately analyzed based on the time when the failure occurred; or the logs of different servers can be combined and analyzed based on the time recorded in the server logs, etc.

[0003] For details, such as the current car cockpit system, see the attached Figure 1 and attached Figure 2 , generally composed of three operating systems: real-time operating system MCU, QNX and Android. Our functions can be deployed in various systems in a dispersed manner, for example, CAN data is obtained on MCU, Sensor data is obtained on QNX, and Location data is obtained on the Android system. As some functions of autonomous driving are integrated into the cockpit, our high-precision map navigation, low-speed assisted driving and other businesses may need to obtain these three types of data, and the three data must be timestamped. Then the deviation of the system time of the three systems is within 10ms or even lower. The traditional time synchronization solution is that MCU sends the time to QNX through communication mechanisms such as SPI, and QNX synchronizes the time to Android through Socket. This mechanism may delay up to 50ms when channels such as SPI are busy. It cannot meet the accuracy requirements of time synchronization. Summary of the invention

[0004] The present invention aims to overcome the problems in the prior art that the automobile cockpit system uses MCU to send time to QNX through communication mechanisms such as SPI, and QNX synchronizes time to Android through Socket. When channels such as SPI are busy, the delay may reach 50ms, and the accuracy requirements of time synchronization cannot be met. A method, system and storage medium for realizing high-precision time synchronization for an automobile cockpit system are provided to overcome the problems.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A method for realizing high-precision time synchronization of a vehicle cockpit system comprises the following steps:

[0007] The first operating system sends a second clock signal to the second operating system at the first full second;

[0008] The first operating system sends a first synchronization calibration signal to the second operating system at the second full second;

[0009] After receiving the first synchronization calibration signal, the second operating system performs whole second calibration processing on the second clock to obtain a first calibrated second clock, and synchronizes it to the second operating system time;

[0010] The second operating system sends the first calibrated second clock signal to the third operating system at the third full second;

[0011] The second operating system sends a second synchronization calibration signal to the third operating system at the fourth full second;

[0012] After receiving the second synchronization calibration signal, the third operating system performs whole-second calibration processing on the first calibration second clock to obtain a second calibration second clock, and synchronizes it to the third operating system time.

[0013] Further, as a preferred technical solution, the whole second calibration process for the second clock specifically includes:

[0014] determining a first time difference between the second full second and the first full second;

[0015] The received second clock is calibrated by adding a first time difference, thereby obtaining a first calibrated second clock.

[0016] Further, as a preferred technical solution, the whole second calibration process for the first calibration second clock specifically includes:

[0017] determining a second time difference between the fourth full second and the third full second;

[0018] The received first calibrated second clock is calibrated by adding the second time difference, so as to obtain a second calibrated second clock.

[0019] Further, as a preferred technical solution, a first calibration interrupt processing program that responds to customization is provided in the first operating system, and the first synchronous calibration signal is triggered and sent by the first calibration interrupt processing program;

[0020] A second calibration interrupt processing program that responds to customization is set in the second operating system, and the second clock performs calibration processing in the second calibration interrupt processing program, and simultaneously triggers and sends the first calibration second clock signal;

[0021] A third calibration interrupt processing program responsive to customization is provided in the third operating system, and the first calibration second clock is calibrated in the third calibration interrupt processing program.

[0022] Furthermore, as a preferred technical solution, the second clock is the time of the first operating system; the first operating system is an MCU operating system, the second operating system is a QNX operating system, and the third operating system is an Android operating system.

[0023] Further, as a preferred technical solution, the first full second is the current full second of the first operating system, and the second full second is the next full second of the first operating system;

[0024] The third full second is the current full second of the second operating system, and the fourth full second is the next full second of the second operating system.

[0025] A high-precision time synchronization implementation system for a vehicle cockpit system, which uses the above-mentioned high-precision time synchronization implementation method for a vehicle cockpit system to realize cross-system communication calibration time;

[0026] The system comprises: a first operating system, a second operating system and a third operating system, wherein the first operating system is connected in communication with the second operating system, and the second operating system is connected in communication with the third operating system;

[0027] The first operating system is used to send a second clock signal to the second operating system at the first full second, and at the same time, send a first synchronization calibration signal to the second operating system at the second full second;

[0028] The second operating system is used to perform whole-second calibration processing on the second clock after receiving the first synchronization calibration signal, thereby obtaining a first calibrated second clock, and synchronize it to the second operating system time; at the same time, send the first calibrated second clock signal to the third operating system at the third whole second, and send the second synchronization calibration signal to the third operating system at the fourth whole second;

[0029] The third operating system is used to perform whole-second calibration processing on the first calibration second clock after receiving the second synchronization calibration signal, thereby obtaining the second calibration second clock and synchronizing it to the third operating system time.

[0030] Further, as a preferred technical solution, the first operating system sends a second clock signal to the second operating system via SPI, and sends a first synchronization calibration signal to the second operating system via GPIO;

[0031] The second operating system sends a first calibrated second clock signal to the third operating system via the Socket, and sends a second synchronous calibration signal to the third operating system via the GPIO.

[0032] Further, as a preferred technical solution, a first time synchronization module is provided in the first operating system, and the first time synchronization module is used to trigger and send a first synchronization calibration signal;

[0033] The second operating system is provided with a second time synchronization module, the second time synchronization module is used to calibrate the second clock and trigger and send the first calibration second clock signal;

[0034] The third operating system is provided with a third time synchronization module, and the third time synchronization module is used to calibrate the first calibrated second clock.

[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for implementing high-precision timing of a vehicle cockpit system.

[0036] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0037] After the first operating system of the present invention sends the second clock signal at the current full second, it triggers the calibration interrupt handler at the next full second to perform full second calibration processing on the full second, and controls the time error within 1ms; then the second operating system gives the event synchronization to the third operating system, and at the same time triggers the calibration interrupt handler at the next full second to perform full second calibration processing, and controls the time error within 2ms, so that the time of each operating system is synchronized with high precision at the millisecond level, meeting the functional requirements of the timing system for integrating the subsequent automatic driving function into the cockpit system. And the high-precision time synchronization is convenient for comparing system logs for subsequent troubleshooting; it is compatible with standard system time, and there is no need to maintain an additional set of private time, which is convenient for application programming. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 The figure is a structural block diagram of an existing time synchronization system in the background technology of the present invention.

[0039] Figure 2 It is a flow chart of the existing time and steps in the background technology of the present invention.

[0040] Figure 3 This is a flow chart of the steps of the high-precision timing implementation method of the present invention

[0041] Figure 4 This is a structural block diagram of the high-precision timing implementation system of the present invention.

[0042] The drawings are only used for illustrative purposes and should not be construed as limitations on this patent. In order to better illustrate this embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted. The same or similar numbers correspond to the same or similar parts. The terms describing the positional relationship in the drawings are only used for illustrative purposes and should not be construed as limitations on this patent. DETAILED DESCRIPTION

[0043] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer definition of the protection scope of the present invention.

[0044] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limitations on this patent.

[0045] In addition, if there are terms such as "first" and "second", they are only used for descriptive purposes, mainly to distinguish different devices, elements or components (the specific types and structures may be the same or different), and are not used to indicate or imply the relative importance and quantity of the indicated devices, elements or components, and cannot be understood as indicating or implying relative importance.

[0046] Example 1

[0047] In order to overcome the problems in the prior art that the car cockpit system uses MCU to send time to QNX through communication mechanisms such as SPI, and QNX synchronizes the time to Android through Socket, the delay may reach 50ms when the SPI and other channels are busy, and the accuracy requirements of time synchronization cannot be met. This embodiment discloses a method for implementing high-precision time synchronization for a car cockpit system to improve the time synchronization accuracy, thereby meeting the timing system function requirements for integrating subsequent autonomous driving functions into the cockpit system.

[0048] This embodiment discloses a method for implementing high-precision time synchronization of a vehicle cockpit system. Figure 3 As shown, the steps include:

[0049] S10. The first operating system sends a second clock signal to the second operating system at the first full second.

[0050] S20. The first operating system sends a first synchronization calibration signal to the second operating system at the second full second.

[0051] In the above steps, the second clock is the time of the first operating system, the first full second is the current full second of the first operating system, and the second full second is the next full second of the first operating system; in addition, a first calibration interrupt handler that responds to customization is provided in the first operating system, and the first synchronous calibration signal is triggered and sent by the first calibration interrupt handler.

[0052] In this step, the communication between the first operating system and the second operating system specifically includes:

[0053] The first operating system sends a second clock signal to the second operating system via SPI at the first full second, and simultaneously the first operating system sends a first synchronous calibration signal triggered by a first calibration interrupt handler to the second operating system via GPIO at the second full second.

[0054] S30. After receiving the first synchronization calibration signal, the second operating system performs whole-second calibration processing on the second clock to obtain a first calibrated second clock, and synchronizes it to the second operating system time.

[0055] In this step, a second calibration interrupt processing program that responds to customization is set in the second operating system. The second clock performs calibration processing in the second calibration interrupt processing program, and simultaneously triggers and sends the first calibration second clock signal.

[0056] Therefore, after the second operating system receives the second clock signal sent by the first operating system, it does not rush to synchronize the system time. After receiving the first synchronization calibration signal sent by the first operating system, it triggers the second calibration interrupt handler, thereby calibrating the second clock signal to whole seconds to obtain the first calibrated second clock, and synchronizes the first calibrated second clock to the second operating system time.

[0057] In this step, the whole second calibration process of the second clock specifically includes:

[0058] determining a first time difference between the second full second and the first full second;

[0059] The received second clock is calibrated by adding a first time difference, thereby obtaining a first calibrated second clock.

[0060] For example: a second clock signal is sent to the second operating system at T seconds, and after an interval of t seconds, that is, at T+t seconds, a first synchronization calibration signal is sent to the second operating system. After receiving the first synchronization calibration signal, the second operating system performs T+t processing on the received second clock to obtain a first calibrated second clock.

[0061] As a preferred embodiment, the commonly used solution is:

[0062] The first operating system sends a second clock signal to the second operating system in the current full second, and then sends a first synchronization calibration signal to the second operating system in the next full second. After receiving the first synchronization calibration signal, the second operating system performs T+1 processing on the received second clock to obtain the first calibrated second clock, and synchronizes it to the second operating system time.

[0063] S40. The second operating system sends the first calibrated second clock signal to the third operating system at the third full second.

[0064] S50. The second operating system sends a second synchronization calibration signal to the third operating system at the fourth full second.

[0065] In the above steps, the third full second is the current full second of the second operating system, and the fourth full second is the next full second of the second operating system. Since a second calibration interrupt handler that responds to customization is provided in the second operating system, the second clock performs calibration processing in the second calibration interrupt handler, and simultaneously triggers and sends the second synchronous calibration signal.

[0066] In this step, the communication between the second operating system and the third operating system specifically includes:

[0067] The second operating system sends the first calibration second clock signal to the third operating system through the Socket at the third full second, and the second operating system sends the second synchronization calibration signal triggered by the second calibration interrupt handler to the third operating system through the GPIO at the fourth full second.

[0068] S60. After receiving the second synchronization calibration signal, the third operating system performs whole-second calibration processing on the first calibration second clock to obtain a second calibration second clock, and synchronizes it to the third operating system time.

[0069] In this step, a third calibration interrupt processing program that responds to customization is set in the third operating system, and the first calibration second clock is calibrated in the third calibration interrupt processing program.

[0070] Therefore, after the third operating system receives the first calibration second clock signal sent by the second operating system, it does not rush to synchronize the system time. After receiving the second synchronization calibration signal sent by the second operating system, it triggers the third calibration interrupt handler, thereby calibrating the first calibration second clock signal to the whole second to obtain the second calibration second clock, and synchronize the second calibrated second clock to the third operating system time.

[0071] In this step, the whole second calibration process for the first calibration second clock specifically includes:

[0072] determining a second time difference between the third full second and the fourth full second;

[0073] The received first calibrated second clock is calibrated by adding the second time difference, so as to obtain a second calibrated second clock.

[0074] For example: a first calibration second clock signal is sent to a third operating system at T seconds, and after an interval of t seconds, that is, at T+t seconds, a second synchronization calibration signal is sent to the third operating system. After receiving the second synchronization calibration signal, the third operating system performs T+t processing on the received first calibration second clock to obtain a second calibration second clock.

[0075] As a preferred embodiment, the commonly used solution is:

[0076] The second operating system sends a first calibrated second clock signal to the third operating system in the current full second, and then sends a second synchronization calibration signal to the third operating system in the next full second. After receiving the second synchronization calibration signal, the third operating system will perform T+1 processing on the received first calibrated second clock to obtain the second calibrated second clock, and synchronize it to the third operating system time.

[0077] In this embodiment, the first operating system is an MCU operating system, the second operating system is a QNX operating system, and the third operating system is an Android operating system.

[0078] Therefore, in this embodiment, after the MCU operating system sends the second clock signal in the current full second, it triggers the calibration interrupt handler in the next full second to perform full second calibration processing on the full second, and controls the time error within 1ms; then the QNX operating system gives the event synchronization to the Android operating system, and at the same time triggers the calibration interrupt handler in the next full second to perform full second calibration processing, and controls the time error within 2ms, so that the time of each operating system is synchronized with high precision at the millisecond level, meeting the requirements of the timing system function of the subsequent automatic driving function integrated into the cockpit system. In addition, high-precision time synchronization is convenient for comparing system logs for subsequent troubleshooting; it is compatible with standard system time, and there is no need to maintain an additional set of private time, which is convenient for application programming.

[0079] Example 2

[0080] This embodiment discloses a high-precision time synchronization implementation system for a vehicle cockpit system, which adopts a high-precision time synchronization implementation method for a vehicle cockpit system described in Example 1 to achieve cross-system communication calibration time.

[0081] This embodiment discloses a high-precision time synchronization implementation system for a vehicle cockpit system, see Figure 4 As shown: it includes a first operating system, a second operating system and a third operating system, the first operating system is communicatively connected with the second operating system, and the second operating system is communicatively connected with the third operating system.

[0082] Among them, a first time synchronization module is provided in the first operating system, and the first time synchronization module is used to trigger and send a first synchronization calibration signal; a second time synchronization module is provided in the second operating system, and the second time synchronization module is used to calibrate the second clock and trigger and send the first calibration second clock signal at the same time; a third time synchronization module is provided in the third operating system, and the third time synchronization module is used to calibrate the first calibration second clock.

[0083] In this embodiment, the first operating system is used to send a second clock signal to the second operating system at the first full second, and at the same time, send a first synchronization calibration signal to the second operating system at the second full second.

[0084] Specifically, the first operating system sends a second clock signal to the second operating system via SPI at the first full second, and sends a first synchronization calibration signal to the second operating system via GPIO at the second full second.

[0085] The second operating system is used to perform whole-second calibration on the second clock after receiving the first synchronization calibration signal, thereby obtaining the first calibrated second clock and synchronizing it to the second operating system time; at the same time, sending the first calibrated second clock signal to the third operating system at the third whole second, and sending the second synchronization calibration signal to the third operating system at the fourth whole second.

[0086] Specifically: the second operating system is used to calibrate the second clock to the whole second after receiving the first synchronization calibration signal, so as to obtain the first calibrated second clock, and synchronize it to the second operating system time; send the first calibrated second clock signal to the third operating system through the Socket at the third whole second, and send the second synchronization calibration signal to the third operating system through the GPIO at the fourth whole second.

[0087] The third operating system is used to perform whole-second calibration processing on the first calibration second clock after receiving the second synchronization calibration signal, thereby obtaining the second calibration second clock and synchronizing it to the third operating system time.

[0088] In this embodiment, the first operating system is an MCU operating system, the second operating system is a QNX operating system, and the third operating system is an Android operating system; the second operating system performs whole-second calibration processing on the second clock after receiving the first synchronization calibration signal, so as to obtain the specific calculation process of the first calibration second clock, see Example 1, which will not be repeated in this embodiment. The third operating system performs whole-second calibration processing on the first calibration second clock after receiving the second synchronization calibration signal, so as to obtain the second calibration second clock, see Example 1, which will not be repeated in this embodiment.

[0089] Example 3

[0090] This embodiment discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for implementing high-precision timing of a vehicle cockpit system described in Embodiment 1 are implemented.

[0091] In this embodiment, the specific implementation steps refer to Embodiment 1, and this embodiment will not repeat them.

[0092] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for realizing high-precision timing of a vehicle cockpit system, characterized in that: The steps include: The first operating system sends a second clock signal to the second operating system via SPI at the first full second; The first operating system sends a first synchronization calibration signal to the second operating system via the GPIO at the second full second; After receiving the first synchronization calibration signal, the second operating system performs whole second calibration processing on the second clock to obtain a first calibrated second clock, and synchronizes it to the second operating system time; The second operating system sends the first calibrated second clock signal to the third operating system via the Socket at the third full second; The second operating system sends a second synchronization calibration signal to the third operating system via the GPIO at the fourth full second; After receiving the second synchronization calibration signal, the third operating system performs whole second calibration processing on the first calibration second clock to obtain a second calibration second clock, and synchronizes it to the third operating system time; The second clock is the time of the first operating system; the first operating system is an MCU operating system, the second operating system is a QNX operating system, and the third operating system is an Android operating system.

2. A method for realizing high-precision timing of a vehicle cockpit system according to claim 1, characterized in that: The whole second calibration process for the second clock specifically includes: determining a first time difference between the second full second and the first full second; The received second clock is calibrated by adding a first time difference, thereby obtaining a first calibrated second clock.

3. The method for realizing high-precision timing of a vehicle cockpit system according to claim 1, characterized in that: The whole second calibration process for the first calibration second clock specifically includes: determining a second time difference between the fourth full second and the third full second; The received first calibrated second clock is calibrated by adding the second time difference, so as to obtain a second calibrated second clock.

4. The method for realizing high-precision timing of a vehicle cockpit system according to claim 1, characterized in that: A customized first calibration interrupt processing program is provided in the first operating system, and the first synchronous calibration signal is triggered and sent by the first calibration interrupt processing program; A second calibration interrupt processing program that responds to customization is set in the second operating system, and the second clock performs calibration processing in the second calibration interrupt processing program, and simultaneously triggers and sends the first calibration second clock signal; A third calibration interrupt processing program responsive to customization is provided in the third operating system, and the first calibration second clock is calibrated in the third calibration interrupt processing program.

5. The method for realizing high-precision timing of a vehicle cockpit system according to claim 1, characterized in that: The first full second is the current full second of the first operating system, and the second full second is the next full second of the first operating system; The third full second is the current full second of the second operating system, and the fourth full second is the next full second of the second operating system.

6. A high-precision time synchronization implementation system for a vehicle cockpit system, which uses a high-precision time synchronization implementation method for a vehicle cockpit system as claimed in any one of claims 1 to 5 to implement cross-system communication calibration time; The system comprises: A first operating system, a second operating system and a third operating system, wherein the first operating system is communicatively connected to the second operating system, and the second operating system is communicatively connected to the third operating system; The first operating system is used to send a second clock signal to the second operating system at the first full second, and at the same time, send a first synchronization calibration signal to the second operating system at the second full second; The second operating system is used to perform whole-second calibration processing on the second clock after receiving the first synchronization calibration signal, thereby obtaining a first calibrated second clock, and synchronize it to the second operating system time; at the same time, send the first calibrated second clock signal to the third operating system at the third whole second, and send the second synchronization calibration signal to the third operating system at the fourth whole second; The third operating system is used to perform whole-second calibration processing on the first calibration second clock after receiving the second synchronization calibration signal, thereby obtaining the second calibration second clock and synchronizing it to the third operating system time.

7. A high-precision timing system for a vehicle cockpit system according to claim 6, characterized in that: A first time synchronization module is provided in the first operating system, and the first time synchronization module is used to trigger and send a first synchronization calibration signal; The second operating system is provided with a second time synchronization module, the second time synchronization module is used to calibrate the second clock and trigger and send the first calibration second clock signal; The third operating system is provided with a third time synchronization module, and the third time synchronization module is used to calibrate the first calibrated second clock.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for realizing high-precision timing of a vehicle cockpit system according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Time synchronization method and system

    CN102752065A