Time compensation method, domain controller, storage medium and vehicle-mounted terminal

By adopting the time compensation method in the automotive autonomous driving domain controller, the problem of inconsistent time in each control domain is solved, ensuring that the system can effectively synchronize time when the external time source is lost, improving the applicability and stability of the system, and simplifying The time compensation process reduces resource investment and enhances user experience.

CN118784127APending Publication Date: 2024-10-15SHENZHEN DESAY SV AUTOMOTIVE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410694332.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The time in each control domain of the car's autonomous driving domain controller is not unified. As a result, the smart driving function cannot be used when there is no signal or the external time source is lost, affecting the user experience and normal operation of the system.

Method used

Using the time compensation method, by recording the time when the system was last powered off and the duration of continuous loss of the external time source, the status of the external time source is detected in real time, and an appropriate time compensation process is selected to ensure the accuracy and stability of the system time, including the first The time compensation process and the second time compensation process ensure that the system can effectively synchronize time under different circumstances.

Benefits of technology

It improves the applicability and flexibility of the system in various situations, reduces resource and cost investment, simplifies the time compensation process, enhances the sustainability, maintainability and manageability of the system, and prevents the loss of time synchronization signals caused by system failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784127A_ABST
    Figure CN118784127A_ABST
Patent Text Reader

Abstract

The invention provides a time compensation method, a domain controller, a storage medium and a vehicle-mounted terminal, and the time compensation method comprises the steps: entering a first time compensation process or a second time compensation process according to an external time source obtaining condition after a target system is powered on; in the first time compensation process, local system time or an external time source is adopted as target system time according to the loss condition of the external time source; and in the second time compensation scene, reading the first system time and the first system time correction value from the time compensation device to calculate the second system time as the target system time. According to the invention, two different time compensation processes are adopted, the applicability and flexibility of the system under various conditions are improved, the stability and reliability of system functions are guaranteed, the resource and cost investments of the system in processing the time synchronization problem are reduced, the sustainability of the system is improved, the time compensation process is simplified, and the time compensation efficiency is improved. And the maintainability and manageability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of time compensation, and in particular to a time compensation method, a domain controller, a storage medium and a vehicle-mounted terminal. Background Art

[0002] Currently, the automobile autonomous driving domain controller is divided into multiple control domains. Each control domain is an independent system, and the software operating systems running in each control domain are different. Data interaction and processing between different control domains need to be carried out under a unified time base.

[0003] When the car has no signal or cannot obtain an external time source for a long time, some intelligent driving functions will be unusable, affecting the user experience.

[0004] If the time synchronization signal is lost for a period of time and then restored during the driving of the car, the system time will jump, which will affect the normal data interaction and processing in the control domain. Summary of the invention

[0005] In order to solve the technical problem in the prior art that the time of each control domain is not unified, which affects the intelligent driving function, the present application provides a time compensation method, a domain controller, a storage medium and a vehicle-mounted terminal.

[0006] Specifically, the present application provides a time compensation method, using a time compensation device to record the system time when the target system was last powered off as the first system time, the power-off duration of the target system as the first correction value of the system time, and the continuous loss duration of the external time source as the second correction value of the system time. The time compensation method includes the following steps:

[0007] After the target system is powered on, an external time source is obtained, and the external time source is used as the third system time, and it is determined whether the acquisition is successful. If successful, the first time compensation process is entered; if the acquisition fails for a preset number of consecutive times, the second time compensation process is entered.

[0008] Among them, in the first time compensation process, the third system time is used as the target system time, and the loss of the external time source is detected in real time. If lost, the timing function of the time compensation device is started until the target system obtains the external time source, and then the timing function is ended to obtain the second correction value of the system time; based on the second correction value of the system time, it is determined whether to continue to use the external time source as the target system time. If the judgment result is to use it, the third system time continues to be used as the target system time; otherwise, the local system time is used as the target system time.

[0009] In the second time compensation process, the first system time and the first correction value of the system time are read from the time compensation device to calculate the second system time as the target system time.

[0010] In the above technical solution, two different time compensation scenarios are adopted according to the availability of the external time source, which improves the applicability and flexibility of the system in various situations.

[0011] Among them, in the first time compensation scenario, the status of the external time source is detected in real time, and different times are obtained as the target system time according to the situation, ensuring the accuracy and synchronization of the system time; when the target system is powered on and fails to successfully obtain the external clock source information, the second system time is calculated through the algorithm in the second time compensation scenario to ensure the fault tolerance and stability of the system and prevent system failures caused by the loss of time synchronization signals.

[0012] The above effective time compensation method reduces the system's resource and cost investment in dealing with time synchronization issues, improves the sustainability of the system, simplifies the time compensation process, and improves the maintainability and manageability of the system.

[0013] Further, in the first time compensation process, when the external time source is detected to be lost for the first time, the time of the current target system is recorded as the fourth system time.

[0014] And when the time compensation device ends the timing function, the time of the current target system is recorded as the fifth system time.

[0015] Determining whether to continue to use the external time source as the target system time includes:

[0016] The first difference of system time is calculated according to the fourth system time and the fifth system time, so as to determine whether the preset condition is met based on the first difference of system time and the second correction value of system time. If so, the third system time continues to be used as the target system time of the first control domain and the second control domain; otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, and the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

[0017] In the above technical scheme, by timely recording the current system time and making appropriate judgments, the system's tolerance for the loss of external time sources can be enhanced to prevent time jumps and affect the user's driving experience; it can be flexibly selected whether to use an external time source based on the actual situation and conditions of the system, so as to maintain the accuracy and stability of time in different scenarios; when an external time source is not needed, turning off the external clock source detection and stopping the timing function of the time compensation device can reduce the complexity of the system and simplify the maintenance and debugging process.

[0018] Furthermore, in the second time compensation scenario, it includes:

[0019] The sixth system time of the current target system when the timing function is ended is obtained from the time compensation device.

[0020] The first system time and the first correction value of the system time are read from the time compensation device, and the preceding time compensation data of the time compensation device is cleared, and the seventh system time of the current target system is obtained at the same time.

[0021] A second system time difference is calculated according to the sixth system time and the seventh system time, so as to calculate a second system time according to the first system time, the first system time correction value and the second system time difference.

[0022] In the above technical solution, by obtaining the system time and the corresponding correction value at multiple time points and performing calculations, the accuracy of the system time compensation can be improved to ensure the accuracy and stability of the system time; clearing the previous time compensation data can ensure that the system will not be affected by outdated or invalid data, keeping the system clean and running efficiently; by calculating the new system time based on the current system time and related data, it can adapt to different scenarios and needs to ensure the continuity and consistency of the system time.

[0023] Furthermore, after calculating the second system time, the following steps are also included:

[0024] The second system time is set as the target system time of the first control domain, and the second system time is sent to the second control domain, so that the second system time is used as the target system time of the second control domain.

[0025] In the above technical solution, the second system time is sent to the second control domain, ensuring that the target system time of the second control domain is synchronized with the first control domain in real time, thereby improving the accuracy and real-time performance of the system time synchronization, and helping to avoid system failures or errors caused by time asynchrony; by ensuring the consistency and synchronization of time between each control domain, it helps to improve the overall performance of the system, ensure the efficient operation of the system in various situations, and enhance the adaptability and flexibility of the system.

[0026] Further, after the second system time is used as the target system time of the second control domain, a first time compensation process is entered, including:

[0027] A fourth system time is obtained, and a first system time difference is calculated according to the fourth system time and the fifth system time.

[0028] Based on the first system time difference and the second system time correction value, it is determined whether a preset condition is met. If so, the third system time is used as the target system time of the first control domain and the second control domain.

[0029] Otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, and the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

[0030] In the above technical solution, re-entering the first time compensation process can ensure the comprehensive adjustment of the system time, including comprehensive consideration and adjustment of the target system time of the first and second control domains, so as to maintain the overall accuracy and stability of the system time; by re-performing the first time compensation process, the system can detect and handle the loss of the external time source again, thereby enhancing the system's fault tolerance and robustness to abnormal situations, ensuring that the system can adopt the most appropriate time compensation strategy in different situations, and improving the system's adaptability and stability.

[0031] Furthermore, the time compensation device is also used to record the eighth system time of the current target system in response to a power-off instruction of the target system, so as to use the eighth system time as the first system time and save it in the time compensation device.

[0032] In the above technical solution, the eighth system time is saved and used as the new first system time, which is beneficial for reading the first system time to calculate the second system time during the next time compensation.

[0033] Furthermore, after storing the eighth system time in the time compensation device, the method further includes: starting a timing function of the time compensation device to complete power-off of the target system.

[0034] In the above technical solution, the timing function is started and the power is turned off, and the corresponding time compensation process is entered according to the preset conditions when the target system is started next time.

[0035] Based on the same concept, the present application also provides a domain controller, which at least includes a first control domain, a second control domain and a time compensation device.

[0036] The first control domain and the second control domain use the target system time as a reference time for data interaction and / or data processing.

[0037] The target system time is based on the time compensation device and is obtained by the time compensation method.

[0038] In the above technical solution, the first control domain and the second control domain use the target system time as the reference time for data interaction and processing, ensuring the consistency and synchronization of time between various modules within the entire system, and improving the stability and reliability of the system; the target system time is obtained by using the time compensation method, and the domain controller can be flexibly applied to different scenarios and needs, providing a universal time synchronization solution suitable for a variety of systems and environments; based on the unified target system time, the domain controller can achieve efficient data interaction and processing, avoiding data confusion and errors caused by time asynchrony, and improving the system's data processing efficiency and accuracy.

[0039] Based on the same concept, the present application also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the time compensation method when running.

[0040] Based on the same concept, the present application also provides a vehicle-mounted terminal, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the time compensation method.

[0041] Compared with the prior art, the beneficial effects of this application are:

[0042] This application determines whether to enter the first time compensation process or the second time compensation process according to whether the external time source is successfully obtained after the target system is powered on; in the first time compensation process, it detects in real time whether the external time source is lost, so as to keep using the local system time or directly use the external time source as the target system time according to the loss situation; in the second time compensation scenario, the first system time and the first correction value of the system time are read from the time compensation device to calculate the second system time as the target system time. This application adopts two different time compensation processes, which improves the applicability and flexibility of the system in various situations and ensures the stability and reliability of the system functions; through an effective time compensation method, it reduces the system's resource and cost investment in dealing with time synchronization issues, improves the sustainability of the system, and simplifies the time compensation process, improving the maintainability and manageability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a flow chart of the time compensation method described in Example 1.

[0044] Figure 2 This is a framework diagram of the domain controller described in Example 2. DETAILED DESCRIPTION

[0045] The present application provides a time compensation method, a domain controller, a storage medium and a vehicle-mounted terminal to solve the technical problem in the prior art that the time of each control domain is not unified, which affects the intelligent driving function.

[0046] The following is a further detailed description of a time compensation method, domain controller, storage medium and vehicle-mounted terminal of the present application in conjunction with specific embodiments and drawings.

[0047] Embodiment 1:

[0048] See also Figure 1 The present application provides a time compensation method, which uses a time compensation device to record the system time when the target system was last powered off as the first system time, the power-off duration of the target system as the first correction value of the system time, and the continuous loss duration of the external time source as the second correction value of the system time. The time compensation method includes the following steps:

[0049] After the target system is powered on, an external time source is obtained, and the external time source is used as the third system time, and it is determined whether the acquisition is successful. If successful, the first time compensation process is entered; if the acquisition fails for a preset number of consecutive times, the second time compensation process is entered.

[0050] In this embodiment, every time the target system is powered on, the vehicle-mounted terminal detects a power-on signal, and in response to the power-on signal, the target system enters a time compensation process.

[0051] Among them, the external time source is first obtained. If the acquisition is successful, the "compensation in operation" process is entered, that is, the first time compensation process, and the external time source is obtained from TBOX.

[0052] If the acquisition fails for the preset number of times in a row, the "compensation at startup" process, that is, the second time compensation process, is entered.

[0053] It should be noted that, in this embodiment, the preset number is assumed to be 3 times, but the preset number can be adaptively set by those skilled in the art according to actual application requirements and is not limited to 3 times.

[0054] In addition, each time the target system is powered off, the vehicle terminal will detect a power-off signal, and in response to the power-off signal, start the timing function of the time compensation device, record the power-off duration of the target system at this time as the first correction value of the system time T1 (unit: second), and record the system UTC time before the target system is powered off as the first system time T2, and save the first system time T2 to the file last_systime, and store T2 in the time compensation device (because the time compensation device is physical storage, it prevents the compensation from failing after the last_systime file of the target system is lost or damaged, and physical storage is more reliable). With the record of the power-off duration and the first system time before power-off, basic data can be provided for the calculation of subsequent time compensation scenarios, which increases the predictability of the system time status and improves the system's ability to respond to time synchronization issues; at the same time, it makes the entire time compensation process more complete and coherent, and further improves maintainability.

[0055] Among them, in the first time compensation process, the third system time is used as the target system time, and the loss of the external time source is detected in real time. If lost, the timing function of the time compensation device is started until the target system obtains the external time source, and then the timing function is ended to obtain the second correction value of the system time; based on the second correction value of the system time, it is determined whether to continue to use the external time source as the target system time. If the judgment result is to use it, the third system time continues to be used as the target system time; otherwise, the local system time is used as the target system time.

[0056] Further, in the first time compensation process, when the external time source is detected to be lost for the first time, the time of the current target system is recorded as the fourth system time.

[0057] And when the time compensation device ends the timing function, the time of the current target system is recorded as the fifth system time.

[0058] During the operation of the target system, it is detected in real time whether the external time source can be successfully obtained. If the acquisition fails for a preset number of consecutive times (assuming it is 3 times), it proves that the external time source is lost. The MONOTONIC time of the target system when the external time source is first detected to be lost is recorded as the fourth system time T3, saved in the variable lost_time_mono, and the local system time of the target system is obtained in real time.

[0059] Further, after detecting that the external time source is restored, the timing function of the time compensation device is terminated, and the MONOTONIC time of the current target system is obtained as the fifth system time T4, and saved in the variable external_time_mono.

[0060] Among them, MONOTONIC time refers to the time that has elapsed since the target system was started.

[0061] Further, determining whether to continue to use the external time source as the target system time includes:

[0062] The first difference of system time is calculated according to the fourth system time and the fifth system time, so as to determine whether the preset condition is met based on the first difference of system time and the second correction value of system time. If so, the third system time continues to be used as the target system time of the first control domain and the second control domain; otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, and the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

[0063] In this embodiment, the difference between the fourth system time and the fifth system time is calculated, that is, the first system time difference T5=T4-T3, and the continuous loss duration of the external time source is recorded as the second system time correction value T6. When |T5-T6|<=1ms (that is, the first system time difference and the second system time correction value meet the preset conditions), the third system time (that is, the external time source) continues to be used as the target system time of the first control domain and the second control domain.

[0064] When |T5–T6|>1ms (i.e., the first difference value of the system time and the second correction value of the system time do not meet the preset conditions), turn off the external clock source detection, stop the timing function of the time compensation device, and clear the historical time compensation data in the time compensation device to keep the local system time (UTC time of the current target system) unchanged, so as to prevent the target system time from jumping and affecting the user experience.

[0065] Among them, UTC time refers to the universal time.

[0066] It should be noted that the preset condition can be set by technical personnel in this field according to actual application requirements. It is not limited to being set to the absolute value of the difference between the first difference of the system time and the second correction value of the system time being less than or equal to 1ms, but can also be set to other differences according to accuracy requirements.

[0067] In the above technical scheme, by timely recording the current system time and making appropriate judgments, the system's tolerance for the loss of external time sources can be enhanced to prevent time jumps and affect the user's driving experience; it can be flexibly selected whether to use an external time source based on the actual situation and conditions of the system, so as to maintain the accuracy and stability of time in different scenarios; when an external time source is not needed, turning off the external clock source detection and stopping the timing function of the time compensation device can reduce the complexity of the system and simplify the maintenance and debugging process.

[0068] In the second time compensation process, the first system time and the first correction value of the system time are read from the time compensation device to calculate the second system time as the target system time.

[0069] Furthermore, in the second time compensation scenario, it includes:

[0070] The MONOTONIC time of the current target system when the timing function is ended obtained from the time compensation device is the sixth system time T7.

[0071] First, check whether the last_systime file storing the first system time T2 in the target system is valid. If it is valid, read the first system time T2 from the last_systime file of the target system and save it to the variable last_sys_utc.

[0072] Otherwise, read the first system time T2 (UTC) and the first correction value of the system time T1 (difference, unit accurate to us) from the time compensation device, save them to variables last_sys_utc=T2 and had_poweroff_time_cycle=T1 respectively, and clear the previous time compensation data of the time compensation device, and at the same time obtain the MONOTONIC time of the current target system as the seventh system time T8.

[0073] The sixth system time is the current MONOTONIC time of the target system when the timing function ends, and the seventh system time is the MONOTONIC time after reading the first system time T2 and the first correction value T1 of the system time.

[0074] A second system time difference is calculated according to the sixth system time and the seventh system time, so as to calculate a second system time according to the first system time, the first system time correction value and the second system time difference.

[0075] In this embodiment, the second system time difference T9=T8-T7 is calculated, and then the second system time T10=T2+T1+T9 is calculated.

[0076] In the above technical solution, by obtaining the system time and the corresponding correction value at multiple time points and performing calculations, the accuracy of the system time compensation can be improved to ensure the accuracy and stability of the system time; clearing the previous time compensation data can ensure that the system will not be affected by outdated or invalid data, keeping the system clean and running efficiently; by calculating the new system time based on the current system time and related data, it can adapt to different scenarios and needs to ensure the continuity and consistency of the system time.

[0077] Furthermore, after calculating the second system time, the following steps are also included:

[0078] The second system time is set as the target system time of the first control domain, and the second system time is sent to the second control domain, so that the second system time is used as the target system time of the second control domain.

[0079] In this embodiment, the first control domain is the SOC domain, and the second control domain is the MCU domain; the system time (target system time) of the SOC domain is updated to the second system time T10.

[0080] Furthermore, the second system time T10 is sent to the MCU domain via a network message as its system time, and then the second system time T10 is used as the time of the entire target system.

[0081] In the above technical solution, the second system time is sent to the second control domain, ensuring that the target system time of the second control domain is synchronized with the first control domain in real time, thereby improving the accuracy and real-time performance of the system time synchronization, and helping to avoid system failures or errors caused by time asynchrony; by ensuring the consistency and synchronization of time between each control domain, it helps to improve the overall performance of the system, ensure the efficient operation of the system in various situations, and enhance the adaptability and flexibility of the system.

[0082] Further, after the second system time is used as the target system time of the second control domain, a first time compensation process is entered, including:

[0083] A fourth system time is obtained, and a first system time difference is calculated according to the fourth system time and the fifth system time.

[0084] In this embodiment, the difference between the fourth system time and the fifth system time is calculated, that is, the first difference in system time T5 = T4 - T3.

[0085] Based on the first system time difference and the second system time correction value, it is determined whether a preset condition is met. If so, the third system time is used as the target system time of the first control domain and the second control domain.

[0086] Among them, when |T5-T6|<=1ms (that is, the first system time difference and the second system time correction value meet the preset conditions), the third system time (that is, the external time source) continues to be used as the target system time of the first control domain and the second control domain.

[0087] Otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, and the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

[0088] When |T5–T6|>1ms (i.e., the first difference value of the system time and the second correction value of the system time do not meet the preset conditions), turn off the external clock source detection, stop the timing function of the time compensation device, and clear the historical time compensation data in the time compensation device to keep the local system time (UTC time of the current target system) unchanged, so as to prevent the target system time from jumping and affecting the user experience.

[0089] It should be noted that the preset condition can be set by technical personnel in this field according to actual application requirements. It is not limited to being set to the absolute value of the difference between the first difference of the system time and the second correction value of the system time being less than or equal to 1ms, but can also be set to other differences according to accuracy requirements.

[0090] In the above technical solution, re-entering the first time compensation process can ensure the comprehensive adjustment of the system time, including comprehensive consideration and adjustment of the target system time of the first and second control domains, so as to maintain the overall accuracy and stability of the system time; by re-performing the first time compensation process, the system can detect and handle the loss of the external time source again, thereby enhancing the system's fault tolerance and robustness to abnormal situations, ensuring that the system can adopt the most appropriate time compensation strategy in different situations, and improving the system's adaptability and stability.

[0091] Furthermore, the time compensation device is also used to record the eighth system time of the current target system in response to a power-off instruction of the target system, so as to use the eighth system time as the first system time and save it in the time compensation device.

[0092] In this embodiment, after receiving the power-off instruction, the UTC time T11 (ie, the eighth system time) of the target system is first obtained, and the eighth system time T11 is saved in the file last_systime as the new first system time T2.

[0093] In the above technical solution, the eighth system time is saved and used as the new first system time, which is beneficial for reading the first system time to calculate the second system time during the next time compensation.

[0094] Furthermore, after storing the eighth system time T11 in the time compensation device, the method further includes: starting a timing function of the time compensation device to complete power-off of the target system.

[0095] In this embodiment, after the eighth system time is stored as the first system time in the last_systime file of the time compensation device and the target system respectively, the power-off of the target system is completed, and the corresponding time compensation process is entered according to the corresponding conditions (whether the external time source can be successfully obtained) when the target system is started next time.

[0096] In the above technical solution, T11 is stored in the last_systime file of the target system and the time compensation device respectively, which improves the startup performance of the system under the premise of ensuring data security.

[0097] Embodiment 2:

[0098] See also Figure 2 The present application also provides a domain controller, comprising at least a first control domain, a second control domain and a time compensation device; the first control domain and the second control domain use the target system time as the reference time for data interaction and / or data processing; the target system time is obtained based on the time compensation device and through the time compensation method described in Example 1.

[0099] In this embodiment, the first control domain and the second control domain are the SOC domain and the MCU domain respectively. Data interaction and processing between the SOC domain and the MCU domain need to be performed under a unified time reference, so a target system time needs to be obtained as the unified time reference.

[0100] The target system time is calculated and obtained by the time compensation method described in the first embodiment, so that the SOC domain and the MCU domain perform data interaction and processing based on the obtained target system time.

[0101] Furthermore, the external time source in the first embodiment is obtained through TBOX, and the domain controller is provided with the TBOX and a Switch domain.

[0102] Among them, the SOC domain obtains the relevant time listed and recorded in Example 1 from the time compensation device as the target system time, and then sends the target system time to the Switch domain, and then sends it to the MCU domain through the Switch domain, so that the time of the MCU domain is synchronized with that of the SOC domain.

[0103] When an external time source is used as the target system time, the MCU domain first obtains the external time source from the TBOX, and then sends it to the SOC domain through the Switch domain, so that the time of the MCU domain is synchronized with that of the SOC domain.

[0104] In the above technical solution, the first control domain and the second control domain use the target system time as the reference time for data interaction and processing, ensuring the consistency and synchronization of time between various modules within the entire system, and improving the stability and reliability of the system; the target system time is obtained by using the time compensation method, and the domain controller can be flexibly applied to different scenarios and needs, providing a universal time synchronization solution suitable for a variety of systems and environments; based on the unified target system time, the domain controller can achieve efficient data interaction and processing, avoiding data confusion and errors caused by time asynchrony, and improving the system's data processing efficiency and accuracy.

[0105] Embodiment three:

[0106] The present application also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the time compensation method described in the first embodiment when running.

[0107] In this embodiment, the storage medium stores a number of computer programs for enabling a vehicle-mounted terminal to execute all or part of the steps of the method described in each embodiment of the present application.

[0108] The storage medium may include a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and other storage media that can store program codes.

[0109] Embodiment 4:

[0110] The present application also provides a vehicle-mounted terminal, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the time compensation method described in Example 1.

[0111] In this embodiment, the memory and the processor are interconnected via a bus; the processor may be one or more CPUs. When the processor is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor is used to control various functional modules of the vehicle terminal and process signals.

[0112] The memory includes, but is not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), and CD-ROM (Compact Disc Read-Only Memory). The memory is used to store computer programs, operating systems, various applications and data, such as storing a computer program for implementing the time compensation method described in Example 1.

[0113] The present application provides a time compensation method, a domain controller, a storage medium and a vehicle-mounted terminal. After the target system is powered on, whether to enter the first time compensation process or the second time compensation process is determined according to whether the external time source is successfully obtained; in the first time compensation process, whether the external time source is lost is detected in real time, so as to keep using the local system time or directly use the external time source as the target system time according to the loss situation; in the second time compensation scenario, the first system time and the first correction value of the system time are read from the time compensation device to calculate the second system time as the target system time. The present application adopts two different time compensation processes, which improves the applicability and flexibility of the system in various situations and ensures the stability and reliability of the system functions; through an effective time compensation method, the system reduces the resource and cost investment in processing time synchronization issues, improves the sustainability of the system, simplifies the time compensation process, and improves the maintainability and manageability of the system.

[0114] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present application to this. Those of ordinary skill in the art may make various changes and modifications therein without departing from the scope and spirit of the present application. All these changes and modifications are intended to be included within the scope of the present application as required by the appended claims.

[0115] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0117] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some modules according to the embodiments of the present application. The application can also be implemented as a device program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0118] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0119] Although the description of the present application is carried out in conjunction with the above specific embodiments, it is obvious that those skilled in the art can make many substitutions, modifications and changes based on the above content. Therefore, all such substitutions, improvements and changes are included in the spirit and scope of the appended claims.

Claims

1. A time compensation method, characterized in that: A time compensation device is used to record the system time when the target system was last powered off as the first system time, the duration of the target system power off as the first correction value of the system time, and the duration of continuous loss of the external time source as the second correction value of the system time. The time compensation method includes the following steps: After the target system is powered on, it obtains an external time source and uses the external time source as the third system time. It then determines whether the acquisition is successful. If successful, it enters the first time compensation process. If the acquisition fails for a preset number of consecutive times, it enters the second time compensation process. In the first time compensation process, the third system time is used as the target system time, and the external time source is detected in real time to see if it is lost. If lost, the timing function of the time compensation device is started, and the timing function is terminated until the target system obtains the external time source, thereby obtaining a second correction value of the system time. determining whether to continue to use the external time source as the target system time based on the second corrected value of the system time, and if so, continuing to use the third system time as the target system time; otherwise, using the local system time as the target system time; In the second time compensation process, the first system time and the first correction value of the system time are read from the time compensation device to calculate the second system time as the target system time.

2. The time compensation method according to claim 1, characterized in that: In the first time compensation process, when the external time source is detected to be lost for the first time, the time of the current target system is recorded as the fourth system time; and when the time compensation device ends the timing function, recording the time of the current target system as the fifth system time; Determining whether to continue using the external time source as the target system time includes: The first difference of the system time is calculated according to the fourth system time and the fifth system time, so as to determine whether the preset condition is met based on the first difference of the system time and the second correction value of the system time. If so, the third system time is continued to be used as the target system time of the first control domain and the second control domain; otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, and the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

3. The time compensation method according to claim 1, characterized in that: In the second time compensation scenario, the method includes: obtaining, from the time compensation device, a sixth system time of the current target system when the timing function ends; Reading the first system time and the first correction value of the system time from the time compensation device, clearing the previous time compensation data of the time compensation device, and simultaneously acquiring the seventh system time of the current target system; A second system time difference is calculated according to the sixth system time and the seventh system time, so as to calculate a second system time according to the first system time, the first system time correction value and the second system time difference.

4. The time compensation method according to claim 3, characterized in that: After calculating the second system time, the method further includes: setting the second system time as the target system time of the first control domain, and sending the second system time to the second control domain so as to use the second system time as the target system time of the second control domain.

5. The time compensation method according to claim 4, characterized in that: After the second system time is used as the target system time of the second control domain, a first time compensation process is entered, including: Acquire a fourth system time, and calculate a first system time difference based on the fourth system time and the fifth system time; determining whether a preset condition is met based on the first system time difference and the second system time correction value, and if so, adopting the third system time as the target system time of the first control domain and the second control domain; Otherwise, the external clock source detection is turned off, the timing function of the time compensation device is stopped, the historical time compensation data in the time compensation device is cleared, and the local system time is used as the target system time.

6. The time compensation method according to claim 1, characterized in that: The time compensation device is further configured to record the eighth system time of the current target system in response to a power-off instruction of the target system, so as to use the eighth system time as the first system time and store it in the time compensation device.

7. The time compensation method according to claim 1, characterized in that: After storing the eighth system time in the time compensation device, the method further includes: The timing function of the time compensation device is started to complete the power-off operation of the target system.

8. A domain controller, characterized in that: At least comprising a first control domain, a second control domain and a time compensation device; The first control domain and the second control domain use the target system time as a reference time for data interaction and / or data processing; The target system time is obtained based on the time compensation device and by the time compensation method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the time compensation method according to any one of claims 1 to 7 when running.

10. A vehicle-mounted terminal, characterized in that: The vehicle-mounted terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the time compensation method as described in any one of claims 1-7.