A Time Calibration Method, Device, Equipment and Storage Medium for a Whole Vehicle Domain Controller

By building an NTP server request list and comparing the return time, obtaining the most accurate time and updating the local time of the microprocessor, the time abnormality problem of microcontrollers and microprocessors in the vehicle domain controller is solved, and the stability and reliability of the time system are improved.

CN115529099BActive Publication Date: 2025-07-08DEEPAL AUTOMOBILE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211200601.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-07-08
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

The time-related function abnormalities occur in microcontrollers and microprocessors in vehicle domain controllers, resulting in the time system being not stable and reliable enough, and the existing technology is difficult to improve the accuracy and reliability of time settings.

Method used

By building a network time protocol server request list, requests are initiated at the same time to compare the returned time and obtain the most accurate time as a reference, and update the local time of the microprocessor to correct the microprocessor and microcontroller.

Benefits of technology

It improves the time accuracy and reliability of the vehicle domain controller, reduces the possibility of system time jumps, and improves the stability of time-related functions and user experience of car use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529099B_ABST
    Figure CN115529099B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for calibrating the time of a vehicle domain controller, including: calibrating the microprocessor in the vehicle domain controller, and using the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller. Among them, the process of calibrating the microprocessor includes: constructing a network time protocol server request list, and simultaneously sending requests to all network time protocol servers in the network time protocol server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol calibration of the microprocessor. The present application improves the accuracy and reliability of the time set locally in the vehicle control system by comparing the NTP server response times, greatly reduces the possibility of abnormalities in vehicle functions caused by time, and thereby improves the user's vehicle use experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of vehicle control, and particularly relates to a method, device, equipment and storage medium for calibrating the time of a vehicle domain controller. Background Art

[0002] A vehicle control unit (VCU) is a controller used in pure electric vehicles. Its function is similar to the engine management system (EMS) of a fuel vehicle and is the "brain-level" controller in the new energy vehicle control system.

[0003] Currently, functional abnormalities related to time may occur in the microcontroller MCU (Microcontroller Unit) and microprocessor MPU (Microprocessor Unit) inside some vehicle domain controllers. The abnormal problems include: the seconds of time are discontinuous at the MCU end, the time at the MCU end jumps by more than a dozen hours, the set timer at the MPU end does not time out at the specified time and times out 3 minutes later, and the timed time and the current local time at the MCU end differ by 4 minutes when the MCU end receives the timer timeout message. These abnormal problems caused by time fully illustrate that the time system inside the vehicle domain controller is not stable and reliable enough and needs further optimization and improvement.

[0004] Among them, the time of the MCU is sourced from the MPU synchronization. When the MPU sets the time from the time source to the MPU local time, it will synchronize to the MCU. There are multiple time sources for the MPU, including the update within the MPU module system itself, the NTP (Network Time Protocol) server, and the GPS (Global Positioning System). When the MPU local time is updated, it directly updates the received time from the time source to the local. The time abnormalities of the MPU and MCU themselves can basically be determined to originate from the abnormal update of the MPU local time. Therefore, when optimizing and improving the vehicle domain controller, it is necessary to solve how to improve the accuracy and reliability of the time set to the system when the MPU local time is updated. Summary of the Invention

[0005] In view of the above-mentioned disadvantages of the prior art, this application provides a method, device, equipment and storage medium for calibrating the time of a vehicle domain controller to solve the above technical problems.

[0006] The present application provides a method for calibrating the time of a vehicle domain controller, including: calibrating the microprocessor in the vehicle domain controller, and using the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller; wherein, the process of calibrating the microprocessor includes:

[0007] Construct a list of Network Time Protocol (NTP) server requests;

[0008] Initiate requests to all NTP servers in the list of NTP server requests simultaneously;

[0009] Arbitrarily select multiple times from the returned times for comparison, and obtain the most accurate time as the reference time;

[0010] Update the local time of the microprocessor according to the reference time to complete the NTP calibration of the microprocessor.

[0011] In an embodiment of the present application, the process of arbitrarily selecting multiple times from the returned times for comparison and obtaining the most accurate time as the reference time includes:

[0012] Arbitrarily select four times from the returned times, and sort the selected four times, denoted as the first time T1, the second time T2, the third time T3, and the fourth time T4 respectively;

[0013] Based on the sorted first time T1, second time T2, third time T3, and fourth time T4, calculate the most accurate time as the reference time T, where: T = (T2 + T3) / 2.

[0014] In an embodiment of the present application, the process of calculating the most accurate time as the reference time T based on the sorted first time T1, second time T2, third time T3, and fourth time T4 includes:

[0015] Obtain the sorted four times, the first time T1, the second time T2, the third time T3, and the fourth time T4, and determine whether any two adjacent times are equal;

[0016] If there are any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians;

[0017] If there are no two adjacent times that are not equal, calculate the most accurate time as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

[0018] In an embodiment of the present application, the process of calculating the most accurate one of the first time T1, the second time T2, the third time T3, and the fourth time T4 as the reference time T based on the sorted times includes:

[0019] Obtain the sorted four times, namely the first time T1, the second time T2, the third time T3, and the fourth time T4, and determine whether the time differences between any two adjacent times are equal;

[0020] If there are time differences between any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians;

[0021] If there are no time differences between any two adjacent times that are not equal, calculate the most accurate one of the first time T1, the second time T2, the third time T3, and the fourth time T4 as the reference time based on the sorted times.

[0022] In an embodiment of the present application, before constructing the network time protocol server request list, the method further includes:

[0023] Power on and wake up the microprocessor in the vehicle domain controller, and calibrate the microprocessor module;

[0024] Use the microprocessor after calibrating the microprocessor module to calibrate the microcontroller in the vehicle domain controller.

[0025] In an embodiment of the present application, before calibrating the microprocessor module, the method further includes at least one of the following: setting the cycle duration for calibrating the microprocessor, setting the cycle duration for calibrating the microprocessor module, and setting the cycle duration for calibrating the microprocessor using the network time protocol.

[0026] In an embodiment of the present application, after completing the network time protocol calibration of the microprocessor, the method further includes: performing positioning calibration on the microprocessor, and using the microprocessor after completing the positioning calibration to calibrate the microcontroller in the vehicle domain controller.

[0027] The present application also provides a calibration device for a vehicle domain controller, and the device includes:

[0028] A microprocessor calibration module for calibrating the microprocessor in the vehicle domain controller;

[0029] A microcontroller calibration module for using the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller;

[0030] Among them, the process of the microprocessor time calibration module calibrating the microprocessor in the vehicle domain controller includes: constructing a network time protocol server request list, and simultaneously initiating requests to all network time protocol servers in the network time protocol server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol calibration of the microprocessor.

[0031] The present application also provides a vehicle domain controller time calibration device, and the device includes:

[0032] One or more processors;

[0033] A storage device for storing one or more programs, which when executed by the one or more processors, cause the device to implement the vehicle domain controller time calibration method described in any one of the above.

[0034] The present application also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor of a computer, causes the computer to execute the vehicle domain controller time calibration method described in any one of the above.

[0035] As described above, the present application provides a vehicle domain controller time calibration method, device, equipment and storage medium, which have the following beneficial effects:

[0036] This application first calibrates the microprocessor in the vehicle domain controller, and then uses the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller. Among them, the process of calibrating the microprocessor includes: constructing a network time protocol server request list, and simultaneously sending requests to all network time protocol servers in the network time protocol server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol calibration of the microprocessor. It can be seen that this application can perform network time protocol calibration (hereinafter referred to as NTP calibration) on the microprocessor in the vehicle domain controller. At the same time, due to the problems of non-response, large network latency, and even incorrect time return of the current NTP server, this application improves the accuracy and reliability of the time set to the local vehicle control system by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network latency, but also can greatly reduce the time jumps caused by abnormal time settings returned by the time server to the local, and can greatly reduce the non-NTP calibration caused by the non-response of the NTP server. Moreover, when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charge replenishment, reservation function, etc., this application can significantly improve the stability and reliability of the system time, thereby greatly reducing the possibility of function anomalies caused by time, and further improving the user's vehicle use experience.

[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this application. Brief Description of the Drawings

[0038] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application. Obviously, the accompanying drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. In the drawings:

[0039] Figure 1 It is a schematic diagram of an exemplary system architecture for applying the technical solutions in one or more embodiments of this application;

[0040] Figure 2 It is a schematic flowchart of NTP calibration for the MPU in the vehicle domain controller provided in an embodiment of this application;

[0041] Figure 3 It is a schematic flowchart of the vehicle domain controller calibration method provided in an embodiment of this application;

[0042] Figure 4 Schematic diagram of the hardware structure of the vehicle domain controller time calibration system provided in an embodiment of the present application;

[0043] Figure 5 Schematic diagram of the hardware structure of the vehicle domain controller time calibration device applicable to implement one or more embodiments of the present application. Specific embodiments

[0044] The following will describe the embodiments of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for explaining the present application, rather than for limiting the protection scope of the present application.

[0045] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Therefore, only the components related to the present application are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0046] The “and / or” in the present application describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character “ / ” generally represents an “or” relationship between the associated objects before and after.

[0047] The multiple referred to in the present application means two or more.

[0048] In the description of the present application, words such as “first” and “second” are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0049] In addition, in the embodiments of the present application, the word “exemplary” is used to mean being an example, illustration, or description. Any embodiment or implementation solution described as “exemplary” in the present application should not be construed as being more preferred or having more advantages than other embodiments or implementation solutions. Exactly speaking, the use of the word “exemplary” is intended to present concepts in a specific way.

[0050] In the following description, numerous specific details are set forth to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring the embodiments of the present application.

[0051] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solutions in one or more embodiments of the present application can be applied is presented. As Figure 1 shown, the system architecture 100 may include a terminal device 110, a network 120, and a server 130. The terminal device 110 may include various electronic devices such as a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. The server 130 may be an independent physical server, or may be a server cluster or a distributed system composed of multiple physical servers, or may also be a cloud server providing cloud computing services. The network 120 may be a communication medium of various connection types capable of providing a communication link between the terminal device 110 and the server 130. For example, it may be a wired communication link or a wireless communication link.

[0052] According to the implementation requirements, the system architecture in the embodiments of the present application may have any number of terminal devices, networks, and servers. For example, the server 130 may be a server group composed of multiple server devices. In addition, the technical solutions provided in the embodiments of the present application may be applied to the terminal device 110, or may be applied to the server 130, or may be jointly implemented by the terminal device 110 and the server 130. The present application makes no special limitation thereto.

[0053] In one embodiment of the present application, the terminal device 110 or the server 130 of the present application can perform time calibration on the microprocessor in the vehicle domain controller, and then use the time-calibrated microprocessor to perform time calibration on the microcontroller in the vehicle domain controller. Among them, the process of performing time calibration on the microprocessor includes: constructing a network time protocol server request list, and simultaneously sending requests to all network time protocol servers in the network time protocol server request list; randomly selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol time calibration of the microprocessor. By using the terminal device 110 or the server 130 to execute the vehicle domain controller time calibration method, NTP time calibration can be performed on the microprocessor in the vehicle domain controller. At the same time, due to problems such as non-response, large network latency, and even incorrect time return of the current NTP server, the present application improves the accuracy and reliability of the time set to the local vehicle control system by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network latency, but also greatly reduces the time jumps caused by abnormal time settings returned by the time server to the local, and can greatly reduce the failure to perform NTP time calibration due to non-response of the NTP server. Moreover, when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charging replenishment, reservation functions, etc., it can not only significantly improve the stability and reliability of the system time, but also greatly reduce the possibility of function anomalies caused by time, thereby improving the user's vehicle use experience.

[0054] The above part introduced the content of the exemplary system architecture applying the technical solution of the present application. Next, the vehicle domain controller time calibration method of the present application will be continued to be introduced.

[0055] In an exemplary embodiment, the present embodiment provides a vehicle domain controller time calibration method, which includes the following steps: performing time calibration on the microprocessor MPU in the vehicle domain controller, and using the time-calibrated microprocessor MPU to perform time calibration on the microcontroller MCU in the vehicle domain controller. Figure 2 The flowchart showing the NTP time calibration of the MPU in the vehicle domain controller in this embodiment is as follows Figure 2 As shown, the process of performing NTP time calibration on the microprocessor MPU includes:

[0056] Constructing a network time protocol NTP server request list;

[0057] Simultaneously sending requests to all network time protocol NTP servers in the network time protocol NTP server request list;

[0058] Arbitrarily select multiple times from the returned times for comparison, and obtain the most accurate one as the reference time;

[0059] Update the local time of the microprocessor MPU according to the reference time to complete the Network Time Protocol calibration of the microprocessor MPU.

[0060] It can be seen that due to problems such as non - response, large network latency, and even return of incorrect times in the current NTP server, after completing NTP calibration through this embodiment, a list containing multiple NTP servers can be established, and then requests are made to all NTP servers in the list to obtain times. After obtaining the times, they are not immediately set to the system. Instead, after arbitrarily obtaining responses from four NTP servers, a comparison is made to find the most accurate time and then set it to the system and synchronized to the MCU. Therefore, this embodiment improves the accuracy and reliability of the time set to the vehicle control system locally by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network latency, but also greatly reduces the time jumps caused by abnormal times returned by the time server being set locally, and can greatly reduce the situation of not passing NTP calibration due to non - response of the NTP server. Moreover, when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charge replenishment, reservation functions, etc., this embodiment can significantly improve the stability and reliability of the system time, thereby greatly reducing the possibility of function abnormalities caused by time, and further enhancing the user's vehicle - using experience.

[0061] According to the above description, in an exemplary embodiment, the process of arbitrarily selecting multiple times from the returned times for comparison and obtaining the most accurate one as the reference time includes: arbitrarily selecting four times from the returned times, and sorting the four selected times, which are respectively denoted as the first time T1, the second time T2, the third time T3, and the fourth time T4; based on the sorted first time T1, second time T2, third time T3, and fourth time T4, calculate the most accurate one as the reference time T, and there is: T=(T2 + T3) / 2.

[0062] As an example, the process of calculating the most accurate one of the first time T1, second time T2, third time T3, and fourth time T4 after sorting as the reference time T includes: obtaining the four sorted times, namely the first time T1, second time T2, third time T3, and fourth time T4, and determining whether any two adjacent times are equal. If there are any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians. If there are no two adjacent times that are not equal, calculate the most accurate one of the times as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

[0063] As another example, the process of calculating the most accurate one of the first time T1, second time T2, third time T3, and fourth time T4 after sorting as the reference time T includes: obtaining the four sorted times, namely the first time T1, second time T2, third time T3, and fourth time T4, and determining whether the time difference between any two adjacent times is equal. If there is a time difference between any two adjacent times that is not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians. If there is no time difference between any two adjacent times that is not equal, calculate the most accurate one of the times as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

[0064] According to the above description, specifically, as Figure 2 shown, by arbitrarily selecting four from the multiple NTP times returned for comparison, this embodiment can further increase the time reliability by increasing the number of NTP servers and the number of NTP times selected for comparison.

[0065] The method for obtaining the relatively most accurate time by comparing four arbitrarily selected times is as follows: after sorting the four times, they are T1, T2, T3, and T4 respectively, then the final obtained time is:

[0066] T = (T2 + T3) / 2;

[0067] Under normal circumstances, T1, T2, T3, and T4 should be equal or differ by 1 s. If an abnormal time occurs, after sorting, it will generally be T1 or T4, and then this embodiment directly excludes this abnormal time. If two abnormal times occur, the average value of the median can also effectively reduce the abnormal time error. Since the probability that the NTP server itself returns an abnormal time is very small, and the probability of two or more abnormal times is even smaller, this embodiment can effectively reduce the probability of setting an abnormal time to the local area!

[0068] In an exemplary embodiment, before constructing a Network Time Protocol (NTP) server request list, the method further includes: powering on and waking up a microprocessor MPU in the vehicle domain controller, and calibrating the time of the microprocessor MPU module; using the microprocessor MPU after completing the time calibration of the microprocessor MPU module to calibrate the time of a microcontroller MCU in the vehicle domain controller. Wherein, before calibrating the time of the microprocessor MPU module, the method further includes at least one of the following: setting a cycle duration for calibrating the time of the microprocessor MPU, setting a cycle duration for calibrating the time of the microprocessor MPU module, and setting a cycle duration for calibrating the time of the microprocessor MPU using the Network Time Protocol. Wherein, the cycle duration in this embodiment can be set according to the actual situation. For example, the cycle duration for calibrating the time of the microprocessor MPU can be set to 1 hour; in addition, the cycle duration for calibrating the time of the microprocessor MPU module can also be set to 1 hour.

[0069] In an exemplary embodiment, after completing the Network Time Protocol time calibration of the microprocessor MPU, the method further includes: performing positioning time calibration on the microprocessor MPU, and using the microprocessor MPU after completing the positioning time calibration to calibrate the time of a microcontroller MCU in the vehicle domain controller.

[0070] According to the above description, as Figure 3 shown, the present application further provides a method for calibrating the time of a vehicle domain controller, including the following steps:

[0071] Performing MPU module time calibration on the MPU in the vehicle domain controller, including: powering on and waking up a microprocessor MPU in the vehicle domain controller, and calibrating the time of the microprocessor MPU module; and,

[0072] Perform NTP time calibration on the MPU in the vehicle domain controller, including: constructing a network time protocol NTP server request list; simultaneously initiating requests to all network time protocol NTP servers in the network time protocol NTP server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor MPU according to the reference time to complete NTP time calibration for the microprocessor MPU; and,

[0073] Perform GPS time calibration on the MPU in the vehicle domain controller;

[0074] Use the microprocessor MPU after completing the time calibration of the microprocessor MPU module to calibrate the microcontroller MCU in the vehicle domain controller, and / or use the microprocessor MPU after completing NTP time calibration to calibrate the microcontroller MCU in the vehicle domain controller, and / or use the microprocessor MPU after completing GPS time calibration to calibrate the microcontroller MCU in the vehicle domain controller.

[0075] In this embodiment, by using the microprocessor MPU after completing NTP time calibration to calibrate the microcontroller MCU in the vehicle domain controller, the possibility of system time jumps caused by network latency can be greatly reduced. That is, for directly setting the time of the response returned by a single NTP server to the system, once a large network latency such as 5s is encountered, the system time will immediately have a 5s jump and error, and there will be another 5s jump when the subsequent time is resynchronized to the correct time. However, by adopting the scheme of comparing the response times of multiple NTP servers, even if one NTP server has a latency, this embodiment can use the times of other NTP servers for comparison and calibration. Even if the latency time is included in the comparison time source, this embodiment can exclude the abnormal time through comparison. And it can also greatly reduce the time jumps caused by the abnormal time returned by the time server being set locally; that is, if the NTP server returns an incorrect time and single NTP server time calibration is used, it will directly cause an error in the local time. While using multi-NTP comparison and calibration, this embodiment can also exclude the incorrect time. In addition, it can also greatly reduce the failure to perform NTP time calibration due to the non-response of the NTP server; that is, the current NTP server used is a public server that everyone can access, and the server itself has a limit on the number of client requests it can process per second, resulting in the problem of unresponsive requests, and multiple servers greatly reduce the probability of this event.

[0076] In summary, the present application provides a method for calibrating the time of a vehicle domain controller. First, the microprocessor in the vehicle domain controller is calibrated for time, and then the calibrated microprocessor is used to calibrate the microcontroller in the vehicle domain controller. Among them, the process of calibrating the microprocessor for time includes: constructing a network time protocol server request list, and simultaneously sending requests to all network time protocol servers in the network time protocol server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol calibration of the microprocessor. It can be seen from this that this method can perform network time protocol calibration (hereinafter referred to as NTP calibration) on the microprocessor in the vehicle domain controller. At the same time, due to problems such as non-response, large network latency, and even incorrect time return of the current NTP server, this method improves the accuracy and reliability of the time set to the local vehicle control system by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network latency, but also can greatly reduce the time jumps caused by the abnormal time returned by the time server being set locally, and can greatly reduce the failure to pass NTP calibration due to non-response of the NTP server. And when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charging compensation, reservation functions, etc., this method can significantly improve the stability and reliability of the system time, thereby greatly reducing the possibility of function anomalies caused by time, and further improving the user's vehicle use experience.

[0077] As Figure 4 shown, the present application also provides a device for calibrating the time of a vehicle domain controller, and the device includes:

[0078] A microprocessor time calibration module 410, configured to calibrate the microprocessor MPU in the vehicle domain controller for time;

[0079] A microcontroller time calibration module 420, configured to use the calibrated microprocessor MPU to calibrate the microcontroller MCU in the vehicle domain controller for time;

[0080] Among them, the process of the microprocessor MPU time calibration module calibrating the microprocessor MPU in the vehicle domain controller for time includes: constructing a network time protocol NTP server request list, and simultaneously sending requests to all network time protocol NTP servers in the network time protocol NTP server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate one as the reference time; updating the local time of the microprocessor MPU according to the reference time to complete the network time protocol calibration of the microprocessor MPU.

[0081] It can be seen that due to the problems of non - response, large network latency, and even incorrect time return of the current NTP server, after completing NTP time calibration through this embodiment, a list containing multiple NTP servers can be established, and then requests are sent to all NTP servers in the list to obtain the time. After obtaining the time, it is not immediately set to the system. Instead, after obtaining responses from any four NTP servers, a comparison is made to find the most accurate time and then set it to the system and synchronized to the MCU. Therefore, this embodiment improves the accuracy and reliability of the time set to the vehicle control system locally by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network latency, but also can greatly reduce the time jumps caused by the abnormal time set returned by the time server to the local, and can greatly reduce the situation of not performing NTP time calibration due to the non - response of the NTP server. Moreover, when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charge replenishment, reservation functions, etc., this embodiment can significantly improve the stability and reliability of the system time, thereby greatly reducing the possibility of function anomalies caused by time, and further enhancing the user's vehicle - using experience.

[0082] According to the above description, in an exemplary embodiment, the process of arbitrarily selecting multiple times from the returned times for comparison and obtaining the most accurate time as the reference time includes: arbitrarily selecting four times from the returned times, and sorting the selected four times, which are respectively denoted as the first time T1, the second time T2, the third time T3, and the fourth time T4; based on the sorted first time T1, second time T2, third time T3, and fourth time T4, calculate the most accurate time as the reference time T, and there is: T=(T2 + T3) / 2.

[0083] As an example, the process of calculating the most accurate time as the reference time T based on the sorted first time T1, second time T2, third time T3, and fourth time T4 includes: obtaining the sorted four times, the first time T1, the second time T2, the third time T3, and the fourth time T4, and determining whether any two adjacent times are equal. If there are any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians. If there are no two adjacent times that are not equal, calculate the most accurate time as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

[0084] As another example, the process of calculating the most accurate time as the reference time T based on the sorted first time T1, second time T2, third time T3, and fourth time T4 includes: obtaining the sorted four times, i.e., the first time T1, the second time T2, the third time T3, and the fourth time T4, and determining whether the time differences between any two adjacent times are equal. If there are unequal time differences between any two adjacent times, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians. If there are no unequal time differences between any two adjacent times, calculate the most accurate time as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

[0085] According to the above description, specifically, as Figure 2 shown, from the multiple NTP times returned, any four are arbitrarily selected for comparison. In this embodiment, the time reliability can be further increased by increasing the number of NTP servers and the number of NTP times selected for comparison.

[0086] The method for obtaining the relatively most accurate time by comparing any four randomly selected times is as follows: After sorting the four times, they are T1, T2, T3, and T4 respectively, then the finally obtained time is:

[0087] T = (T2 + T3) / 2;

[0088] Normally, T1, T2, T3, and T4 should be equal or differ by 1 s. If there is an abnormal time, after sorting, it is generally T1 or T4, then this abnormal time is directly excluded in this embodiment. If there are two abnormal times, the abnormal time error can also be effectively reduced by calculating the average of the medians. Since the probability of the NTP server itself returning an abnormal time is very small, and the probability of two or more abnormal times is even smaller, this embodiment can effectively reduce the probability of setting an abnormal time to the local!

[0089] In an exemplary embodiment, before constructing a list of Network Time Protocol (NTP) server requests, the method further includes: powering on and waking up the microprocessor unit (MPU) in the vehicle domain controller, and calibrating the time of the MPU module; using the MPU that has completed the time calibration of the MPU module to calibrate the time of the microcontroller unit (MCU) in the vehicle domain controller. Among them, before calibrating the time of the MPU module, the method further includes at least one of the following: setting the cycle duration for calibrating the time of the MPU, setting the cycle duration for calibrating the time of the MPU module, setting the cycle duration for calibrating the time of the MPU using the Network Time Protocol. The cycle duration in this embodiment can be set according to the actual situation. For example, the cycle duration for calibrating the time of the MPU can be set to 1 hour; in addition, the cycle duration for calibrating the time of the MPU module can also be set to 1 hour.

[0090] In an exemplary embodiment, after completing the calibration of the time of the MPU using the Network Time Protocol, the method further includes: performing positioning time calibration on the MPU, and using the MPU that has completed the positioning time calibration to calibrate the time of the MCU in the vehicle domain controller.

[0091] In summary, the present application provides a vehicle domain controller time calibration device. First, the microprocessor in the vehicle domain controller is calibrated, and then the calibrated microprocessor is used to calibrate the microcontroller in the vehicle domain controller. Among them, the process of calibrating the microprocessor includes: constructing a network time protocol server request list, and simultaneously sending requests to all network time protocol servers in the network time protocol server request list; arbitrarily selecting multiple times from the returned times for comparison, and obtaining the most accurate time as the reference time; updating the local time of the microprocessor according to the reference time to complete the network time protocol calibration of the microprocessor. It can be seen that this device can perform network time protocol calibration (hereinafter referred to as NTP calibration) on the microprocessor in the vehicle domain controller. At the same time, due to the problems of non-response, large network delay, and even incorrect time return of the current NTP server, this device improves the accuracy and reliability of the time set in the local vehicle control system by comparing the response times of multiple NTP servers. It not only greatly reduces the possibility of system time jumps caused by network delays, but also can greatly reduce the time jumps caused by abnormal time settings returned by the time server to the local, and can greatly reduce the failure to pass NTP calibration due to non-response of the NTP server. And when there are multiple functions directly related to time in the vehicle domain controller, such as intelligent charging compensation, reservation functions, etc., this device can significantly improve the stability and reliability of the system time, thereby greatly reducing the possibility of function anomalies caused by time, and further improving the user's vehicle use experience.

[0092] It should be noted that the vehicle domain controller time calibration device provided in the above embodiment and the vehicle domain controller time calibration method provided in the above embodiment belong to the same concept. The specific ways in which each module and unit perform operations have been described in detail in the method embodiment, and will not be repeated here. In actual application, the vehicle domain controller time calibration device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above. This is not limited here either.

[0093] The embodiment of the present application also provides a vehicle domain controller time calibration device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the vehicle domain controller time calibration device to implement the vehicle domain controller time calibration methods provided in the above embodiments.

[0094] Figure 5 The structural schematic diagram of a computer device suitable for implementing the vehicle domain controller time calibration device of the embodiment of the present application is shown. It should be noted that Figure 5The computer system 1000 of the vehicle domain controller time calibration device shown is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

[0095] As Figure 5 shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage section 1008 into the random access memory (RAM) 1003, such as executing the method described in the above embodiments. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0096] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that the computer program read from it can be installed into the storage section 1008 as needed.

[0097] Specifically, according to the embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 1009 and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the device of the present application are executed.

[0098] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the above two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of apparatuses, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0100] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the units themselves.

[0101] On the other hand, this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is caused to execute the vehicle domain controller time calibration method as described above. The computer-readable storage medium can be included in the vehicle domain controller time calibration device described in the above embodiments, or can exist alone without being assembled into the vehicle domain controller time calibration device.

[0102] On the other hand, this application also provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the vehicle domain controller time calibration method provided in the above various embodiments.

[0103] The above embodiments are only used to exemplarily illustrate the principles and effects of this application, rather than to limit this application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for calibrating the time of a vehicle domain controller, characterized in that Including: Calibrate the microprocessor in the vehicle domain controller, and use the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller; wherein, the process of calibrating the microprocessor includes: Construct a Network Time Protocol (NTP) server request list; Initiate requests to all NTP servers in the NTP server request list simultaneously; Arbitrarily select multiple times from the returned times for comparison, and obtain the most accurate one as the reference time; including: arbitrarily select four times from the returned times, and sort the selected four times, denoted as the first time T1, the second time T2, the third time T3, and the fourth time T4 respectively; based on the sorted first time T1, second time T2, third time T3, and fourth time T4, calculate the most accurate one as the reference time T, where: T = (T2 + T3) / 2; and, obtain the sorted four times, the first time T1, the second time T2, the third time T3, and the fourth time T4, and determine whether any two adjacent times are equal; if there are any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians; if there are no two adjacent times that are not equal, calculate the most accurate one as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4; Update the local time of the microprocessor according to the reference time to complete the NTP calibration of the microprocessor.

2. The vehicle domain controller time calibration method according to claim 1, wherein The process of calculating the most accurate one as the reference time T based on the sorted first time T1, second time T2, third time T3, and fourth time T4 includes: Obtain the sorted four times, the first time T1, the second time T2, third time T3, and fourth time T4, and determine whether the time difference between any two adjacent times is equal; If there is a time difference between any two adjacent times that is not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians; If there is no time difference between any two adjacent times that is not equal, calculate the most accurate one as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

3. The vehicle domain controller time calibration method according to claim 1 or 2, characterized in that, Before constructing the NTP server request list, the method further includes: Power on and wake up the microprocessor in the vehicle domain controller, and calibrate the microprocessor module; Use the microprocessor after completing the calibration of the microprocessor module to calibrate the microcontroller in the vehicle domain controller.

4. The vehicle domain controller time calibration method according to claim 3, characterized in that, Before calibrating the time of the microprocessor module, the method further includes at least one of the following: setting the cycle duration for calibrating the time of the microprocessor, setting the cycle duration for calibrating the time of the microprocessor module, and setting the cycle duration for calibrating the time of the microprocessor using the Network Time Protocol (NTP).

5. The method for calibrating the time of the vehicle domain controller according to claim 1 or 2, characterized in that, After completing the NTP calibration of the microprocessor, the method further includes: performing positioning-based time calibration on the microprocessor, and using the microprocessor after positioning-based time calibration to calibrate the microcontroller in the vehicle domain controller.

6. A vehicle domain controller time calibration device, characterized in that, The device includes: A microprocessor time calibration module for calibrating the time of the microprocessor in the vehicle domain controller; A microcontroller time calibration module for using the calibrated microprocessor to calibrate the microcontroller in the vehicle domain controller; Wherein, the process of the microprocessor time calibration module calibrating the time of the microprocessor in the vehicle domain controller includes: constructing a list of requests for the NTP server, and simultaneously sending requests to all NTP servers in the list of requests for the NTP server; randomly selecting multiple times from the returned times for comparison, and obtaining the most accurate time as the reference time; updating the local time of the microprocessor according to the reference time to complete the NTP calibration of the microprocessor. Wherein, the process of obtaining the most accurate time as the reference time includes: randomly selecting four times from the returned times, and sorting the selected four times, denoted as the first time T1, the second time T2, the third time T3, and the fourth time T4 respectively; based on the sorted first time T1, second time T2, third time T3, and fourth time T4, calculating the most accurate time as the reference time T, where T = (T2 + T3) / 2; and obtaining the sorted four times, the first time T1, the second time T2, the third time T3, and the fourth time T4, and determining whether any two adjacent times are equal; if there are any two adjacent times that are not equal, first check the first time T1 and the fourth time T4, and when both the first time T1 and the fourth time T4 are abnormal, reduce the abnormal time error by calculating the average of the medians; if there are no two adjacent times that are not equal, calculate the most accurate time as the reference time based on the sorted first time T1, second time T2, third time T3, and fourth time T4.

7. An in-vehicle domain controller time calibration device, characterized in that, The device includes: One or more processors; A storage device for storing one or more programs, which when executed by the one or more processors, cause the device to implement the vehicle domain controller time calibration method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, A computer program is stored thereon, which when executed by the processor of the computer, causes the computer to execute the vehicle domain controller time calibration method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • A time source ranking system for an autonomous driving vehicle

    CN110858786A

  • Network time synchronization method and system with traceability

    CN113589675A