Calibration Method, Device, Equipment and Medium of Real-Time Clock
By synchronizing the timing of real-time clock and the power supply system, clock calibration parameters are obtained, compensation errors are calculated, and wake-up timestamps are calibrated, which solves the problem of electric vehicle small battery exhaustion, and improves the RTC timing accuracy without adding hardware components, ensuring that the vehicle accurately wakes up the entire vehicle controller for charging.
Patent Information
- Application Number
- CN202411934316.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-12-26
AI Technical Summary
In the long-term parking or sleeping state of electric vehicles, small battery power exhaustion causes the vehicle to be unable to use normally. In the prior art, the high-precision RTC chip wake-up function fails to be effective at poor network signals, increasing hardware costs and being impractical.
Through the real-time clock and the power supply system synchronous timing, the clock calibration parameters are obtained, the compensation error is calculated, and the wake-up time stamp is calibrated to ensure that the vehicle controller is awakened to charge when the battery voltage reaches the critical voltage.
It realizes improving the RTC timing accuracy without adding hardware components, ensuring that the vehicle accurately wakes up the vehicle controller for charging in a dormant state, solving the problem of vehicle failure caused by the battery voltage being lower than the critical voltage, and reducing development costs.
Smart Images

Figure CN119814211B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of charging time calibration for electric vehicles, and in particular to a calibration method, device, equipment and medium for a real-time clock. Background Art
[0002] With the complication and intellectualization of the functions of electric vehicles, the number of electronic control units inside the vehicle increases, resulting in an increase in the static current, making the small battery more likely to run out of power during long-term parking or in a sleep state, thus affecting the normal use of the vehicle. For example, when the voltage of the small battery is lower than a certain threshold, the vehicle may not be able to start.
[0003] Electric vehicles are usually equipped with two sets of electrical systems, a high-voltage system and a low-voltage system. The high-voltage system is charged by a high-voltage battery, and the low-voltage system is charged by a small battery. The high-voltage system is used to drive the motor and high-power subsystems, and the low-voltage system is responsible for power supply to low-power electrical appliances such as door unlocking, starting the vehicle, and vehicle lights. During the normal operation of the vehicle, the vehicle controller can monitor the power of the small battery in real time, and convert the electrical energy of the high-voltage battery into electrical energy suitable for charging the small battery through a DC-DC converter to ensure that the small battery can be charged in time.
[0004] However, when the vehicle is in a stationary state (or sleep state), the power of the small battery cannot be directly detected, resulting in the problem that the small battery runs out of power during long-term parking or in a sleep state, affecting the normal use of the vehicle. Summary of the Invention
[0005] In view of the above problems and technical requirements, the applicant of this application proposes a calibration method, device, equipment and medium for a real-time clock to solve the problem in the prior art that when the vehicle is in a sleep state, due to the long-term parking or sleep state of the vehicle causing the battery to run out of power, resulting in the vehicle being unable to be used normally. When receiving a sleep instruction, a target wake-up timestamp is determined to wake up the sleeping vehicle controller at the target wake-up timestamp, so that the vehicle controller controls the high-voltage system to charge the battery, solving the problem that the vehicle cannot be used normally due to the battery voltage being lower than the critical voltage.
[0006] An embodiment of this application provides a calibration method for a real-time clock, and the method includes:
[0007] When it is determined that the vehicle is in an operating state, clock calibration parameters are obtained based on a preset time interval, where the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located. The first timestamp is obtained by timing with a real-time clock, the second timestamp is obtained by timing with the vehicle's power supply replenishment system, and the real-time clock and the power supply replenishment system are synchronized in timing;
[0008] When the vehicle is in the operating state, a compensation error calculation process is performed based on the clock calibration parameter to obtain a compensation error until the vehicle is in the sleep state;
[0009] Wherein, the compensation error calculation process includes:
[0010] Calculating a target time error based on the first timestamp and the second timestamp, and calculating a target temperature error based on the controller temperature, the ambient temperature and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain the compensation error;
[0011] When a sleep instruction is received and it is determined that the vehicle is not in the sleep state, a wake-up timestamp for waking up the vehicle controller is obtained, and the wake-up timestamp is calibrated using the compensation error to obtain a target wake-up timestamp, where the target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches the critical voltage, and is used to indicate the vehicle to wake up the vehicle controller, so that the vehicle controller controls the high-voltage system to charge the battery.
[0012] According to the real-time clock calibration method of an embodiment of the present application, calculating a target time error based on the first timestamp and the second timestamp includes:
[0013] After each time the first timestamp and the second timestamp are obtained, calculate the time error between the current first timestamp and second timestamp and the previous first timestamp and second timestamp, and obtain and store the current time error;
[0014] Perform a filtering process on the stored multiple time errors to obtain and store the target time error.
[0015] According to the real-time clock calibration method of an embodiment of the present application, performing a filtering process on the stored multiple time errors to obtain the target time error includes:
[0016] Input the time error into a preset time error calculation formula to obtain the target time error output by the time error calculation formula;
[0017] Wherein, the time error calculation formula includes:
[0018]
[0019] Wherein, δ represents the target time error, N represents the number of time errors in the time error, δ i represents the i-th time error in the time error, δ max represents the maximum time error in the time error, δ min represents the minimum time error in the time error.
[0020] Before storing the target time error, the real-time clock calibration method according to an embodiment of the present application further includes:
[0021] Evaluating whether the current time error is qualified based on a preset evaluation strategy;
[0022] When it is determined that the current time error is qualified, record the evaluation times corresponding to the current evaluation, and execute the steps of storing the evaluation times and storing the target time error.
[0023] The real-time clock calibration method according to an embodiment of the present application, calculating the target temperature error based on the controller temperature, the ambient temperature and a preset temperature error mapping table, includes:
[0024] Input the controller temperature and the ambient temperature into a preset temperature gradient difference calculation formula to obtain the temperature gradient difference output by the temperature gradient difference calculation formula;
[0025] Wherein, the temperature gradient difference calculation formula includes:
[0026]
[0027] Wherein, ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, T ki represents the i-th controller temperature, T kmax represents the maximum controller temperature among multiple controller temperatures, T kmin represents the minimum controller temperature among multiple controller temperatures, T hi represents the i-th ambient temperature, T hmax represents the maximum ambient temperature among multiple ambient temperatures, T hmin represents the minimum ambient temperature among multiple ambient temperatures;
[0028] Query the temperature error mapping table to obtain the target temperature error corresponding to the temperature gradient difference.
[0029] The real-time clock calibration method according to an embodiment of the present application, using the compensation error to calibrate the wake-up timestamp to obtain the target wake-up timestamp, includes:
[0030] Input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula;
[0031] Wherein, the error calibration formula includes:
[0032] T m = T X + TX *δ h ;
[0033] wherein, T m represents the target wake-up timestamp, T X represents the wake-up timestamp, and δ h represents the compensation error.
[0034] According to the calibration method of the real-time clock according to an embodiment of the present application, after obtaining the first timestamp and the second timestamp each time, calculate the time error between the current first timestamp and the second timestamp and the previous first timestamp and the second timestamp, and obtain and store the current time error, including:
[0035] After obtaining the first timestamp and the second timestamp for the first time, calculate the time error between the first timestamp and the second timestamp for the first time and the first preset timestamp and the second preset timestamp, and obtain and store the time error for the first time.
[0036] The embodiment of the present application also provides a calibration device for a real-time clock, including:
[0037] An acquisition module, configured to obtain clock calibration parameters based on a preset time interval when it is determined that the vehicle is in a running state, wherein the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located, wherein the first timestamp is obtained by timing with the real-time clock, the second timestamp is obtained by timing with the vehicle's power supply replenishment system, and the real-time clock and the power supply replenishment system are synchronized in timing;
[0038] A calculation module, configured to execute a compensation error calculation process based on the clock calibration parameters when the vehicle is in the running state to obtain a compensation error until the vehicle is in a sleep state;
[0039] wherein, the compensation error calculation process includes: <X
[0040] Calculating a target time error based on the first timestamp and the second timestamp, and calculating a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain the compensation error;
[0041] A calibration module, configured to obtain a wake-up timestamp for waking up a vehicle controller when receiving a sleep instruction and determining that the vehicle is not in the sleep state, and calibrate the wake-up timestamp by using the compensation error to obtain a target wake-up timestamp, where the target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches a critical voltage, and is used to instruct the vehicle to wake up the vehicle controller, so that the vehicle controller controls the high-voltage system to charge the battery.
[0042] An embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the real-time clock calibration method described in any one of the above are implemented.
[0043] An embodiment of the present application further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the real-time clock calibration method described in any one of the above are implemented.
[0044] The real-time clock calibration method, device, equipment, and medium provided by the embodiments of the present application obtain clock calibration parameters based on a preset time interval when determining that the vehicle is in an operating state, where the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located. The first timestamp is obtained by timing through a real-time clock, and the second timestamp is obtained by timing through the vehicle's power supply replenishment system. The real-time clock and the power supply replenishment system are synchronized for timing. The present application synchronously collects timestamps through the real-time clock and the power supply replenishment system to ensure that the acquisition start times of the timestamps are the same, providing an effective data basis for the subsequent calculation of the compensation voltage. When the vehicle is in an operating state, a compensation error calculation process is executed based on the clock calibration parameters to obtain a compensation error until the vehicle is in a sleep state. The compensation error calculation process includes: calculating a target time error based on the first timestamp and the second timestamp, and calculating a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain a compensation error. Due to the operation of the vehicle, temperature errors and time errors are caused. The present application monitors the vehicle all the time before the vehicle enters the sleep state to obtain the compensation error generated due to the operation of the vehicle. And when receiving a sleep instruction and determining that the vehicle is not in the sleep state, obtain a wake-up timestamp for waking up the vehicle controller, and calibrate the wake-up timestamp by using the compensation error to obtain a target wake-up timestamp, realizing determining the target wake-up timestamp when the vehicle receives the sleep instruction to wake up the sleeping vehicle controller at the target wake-up timestamp, so that the vehicle controller controls the high-voltage system to charge the battery, and solving the problem that the vehicle cannot be used normally due to the battery voltage being lower than the critical voltage. Description of the Drawings
[0045] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0046] Figure 1 is one of the flow diagrams of the real-time clock calibration method provided by the embodiments of the present application;
[0047] Figure 2 is the second of the flow diagrams of the real-time clock calibration method provided by the embodiments of the present application;
[0048] Figure 3 is the structural diagram of the real-time clock calibration device provided by the embodiments of the present application;
[0049] Figure 4 is the structural diagram of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0051] To be able to further illustrate the problems of the present application with respect to the prior art:
[0052] To solve the problem that the vehicle cannot be used due to a dead battery, an intelligent battery charging system has emerged. Before the vehicle goes into sleep mode, a wake-up time is set. After waking up, the intelligent battery charging system monitors the voltage of the small battery and automatically wakes up the vehicle controller (vehicle control unit) to charge the small battery when the voltage is lower than the set value, so as to ensure that the vehicle can start and run normally. The intelligent battery charging system needs to be able to accurately wake up the vehicle controller at the set time and control the high-voltage system to charge the small battery through the vehicle controller.
[0053] Timed wake-up tasks are usually implemented with the help of a Real-Time Clock (RTC). Among them, the RTC can be divided into an integrated type and an independent type. An integrated RTC chip means that the RTC function is concentrated in one chip, and the RTC is just a sub-function of the chip; an independent RTC chip refers to a dedicated chip for timing. Usually, the integrated RTC chip has a lower accuracy, while the independent RTC chip has a higher accuracy but a higher hardware cost.
[0054] In the prior art, by using a high-precision RTC chip, a vehicle communication module (TBOX) is adopted to perform timed wake-up of the vehicle controller. Due to the use of TBOX, there is a high requirement for the quality of the network signal. In places with poor network signal quality, such as underground garages. In this case, there is a risk that the timed wake-up function fails, which may lead to the problem that the small battery cannot be charged in time, resulting in serious power loss and the vehicle cannot start.
[0055] In addition, since TBOX wakes up the vehicle controller through the CAN network, the vehicle controller needs to support the CAN wake-up function, and the hardware of the vehicle controller needs to be redesigned, which increases the time cost.
[0056] To solve the above problems, an embodiment of the present application provides a method for calibrating a real-time clock. This method can be applied in a power supply replenishment system. Some other descriptions in the embodiments of the present application are for illustrative purposes and are not used to limit the protection scope of the present application, and will not be elaborated one by one hereafter. The specific implementation of this method is as Figure 1 shown:
[0057] Step 101, when it is determined that the vehicle is in a running state, obtain clock calibration parameters based on a preset time interval.
[0058] Among them, the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle control unit, and the ambient temperature of the vehicle's location. Among them, the first timestamp is obtained by timing with the real-time clock, the second timestamp is obtained by timing with the vehicle's power supply replenishment system, and the real-time clock and the power supply replenishment system are synchronized for timing.
[0059] Step 102, when the vehicle is in a running state, perform a compensation error calculation process based on the clock calibration parameters to obtain a compensation error until the vehicle is in a sleep state.
[0060] Among them, the compensation error calculation process includes: calculating a target time error based on the first timestamp and the second timestamp, and calculating a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain a compensation error.
[0061] Step 103: When a sleep instruction is received and it is determined that the vehicle is not in the sleep state, obtain the wake-up timestamp for waking up the vehicle controller, and calibrate the wake-up timestamp using the compensation error to obtain the target wake-up timestamp.
[0062] The target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches the critical voltage, and is used to indicate the vehicle to wake up the vehicle controller, so that the vehicle controller controls the high-voltage system to charge the battery.
[0063] The real-time clock calibration method provided by the embodiments of the present application obtains clock calibration parameters at preset time intervals when it is determined that the vehicle is in the running state. The clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located. The first timestamp is obtained by timing with the real-time clock, and the second timestamp is obtained by timing with the vehicle's power replenishment system. The real-time clock and the power replenishment system are synchronized for timing. The present application synchronously collects timestamps through the real-time clock and the power replenishment system to ensure that the acquisition start time of the timestamps is the same, providing an effective data basis for the subsequent calculation of the compensation voltage; when the vehicle is in the running state, perform a compensation error calculation process based on the clock calibration parameters to obtain the compensation error until the vehicle is in the sleep state; the compensation error calculation process includes: calculating the target time error based on the first timestamp and the second timestamp, and calculating the target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain the compensation error. Due to the operation of the vehicle causing temperature error and time error, the present application monitors the vehicle until it is in the sleep state to obtain the compensation error generated due to the operation of the vehicle; and when a sleep instruction is received and it is determined that the vehicle is not in the sleep state, obtain the wake-up timestamp for waking up the vehicle controller, and calibrate the wake-up timestamp using the compensation error to obtain the target wake-up timestamp, realizing determining the target wake-up timestamp when receiving the sleep instruction to wake up the sleeping vehicle controller at the target wake-up timestamp, so that the vehicle controller controls the high-voltage system to charge the battery, and solving the problem that the vehicle cannot be used normally due to the battery voltage being lower than the critical voltage.
[0064] Specifically, through analysis, it can be seen that the error sources of the RTC mainly come from three places. One is the inherent deviation of the RTC clock source, that is, the crystal oscillator it uses. The second is the deviation caused by the change of the external ambient temperature. The third is the deviation brought by the unstable power supply. Since the internal power supply of the vehicle controller is the voltage regulated by the low-dropout regulator (LDO), the present application does not consider the deviation brought by the power supply.
[0065] The inherent deviation of the crystal is the main source, while the deviation caused by temperature is relatively small. Since the inherent deviation generated by the crystal oscillator is different for each control unit, the same error compensation value cannot be used for all control units. By compensating for the error through the self-learning process of the error compensation calculation, the RTC accuracy in the vehicle controller is improved, and the accurate timing wake-up function can be achieved without changing the current design of the vehicle controller.
[0066] Specifically, through the crystal error (corresponding to the time error) and the temperature error, the timing time when the vehicle is powered off is compensated to obtain the final timing time, so that the vehicle controller is woken up at the final timing time.
[0067] This application can improve the RTC timing accuracy without adding any auxiliary circuits, ensure that the vehicle controller is accurately woken up, is simple to implement, and effectively saves the development cost.
[0068] In a specific embodiment, the specific implementation of calculating the target time error based on the first timestamp and the second timestamp includes:
[0069] After obtaining the first timestamp and the second timestamp each time, calculate the time error between the current first timestamp and second timestamp and the previous first timestamp and second timestamp, obtain and store the current time error; perform filtering processing on the stored multiple time errors to obtain and store the target time error.
[0070] In a specific embodiment, after obtaining the first timestamp and the second timestamp for the first time, calculate the time error between the first timestamp and the second timestamp for the first time and the first preset timestamp and the second preset timestamp, and obtain and store the time error for the first time.
[0071] Specifically, it is also possible not to calculate the time error after obtaining the first timestamp and the second timestamp for the first time, and start calculating the time error after obtaining the first timestamp and the second timestamp for the second time. The following takes this scenario as an example for specific description.
[0072] Specifically, through Figure 2 Specifically, the scenario of each power-on of any electronic control unit of the vehicle controller is described in detail: ]>
[0073] Step 201, when the electronic control unit is powered on and running, obtain the clock calibration parameters.
[0074] Specifically, the RTC performs an initialization operation and starts timing after the initialization operation is completed. The power supply replenishment system also starts timing at the moment when the RTC starts timing, and records the initial timestamp, that is, the first timestamp and the second timestamp for the first time. At the same time, record the controller temperature and the ambient temperature at the start of power-on.
[0075] Step 202, after a preset time interval, record the first timestamp and the second timestamp for the second time, as well as the controller temperature and the ambient temperature for the second time.
[0076] Step 203, through the error calculation formula, obtain the second time error corresponding to the first timestamp and the second timestamp obtained for the second time.
[0077] The error calculation formula is shown in Formula (1):
[0078] δ1 = ((T R2 - T R1 ) - (T M2 - T M1 )) / (T M2 - T M1 ).............(1)
[0079] Among them, δ1 represents the time error obtained for the first time, T R2 represents the first timestamp obtained for the second time, T<* R1 represents the first timestamp obtained for the first time, T M2 represents the second timestamp obtained for the second time, T M1 represents the second timestamp obtained for the first time.
[0080] Step 204, after obtaining the first time error, increment the preset number of successful learning attempts by 1, and store the first time error, the controller temperature and the ambient temperature for the second time in an array.
[0081] Among them, the initial value of the number of successful learning attempts can be set to zero.
[0082] Step 205, determine whether the ECU is about to enter the sleep state. If so, return to execute Step 206; otherwise, execute Step 202.
[0083] Specifically, after receiving the sleep instruction, the vehicle will not immediately enter the sleep state. It will perform some necessary operations before powering off and then officially enter the sleep state. The so-called about to enter the sleep state refers to the period after receiving the sleep instruction and before officially entering the sleep state.
[0084] Step 206, evaluate whether the current time error is qualified. If so, execute Step 207; otherwise, execute Step *210.
[0085] Step 207, perform filtering processing on the stored multiple time errors to obtain the target time error, and calculate the target temperature error based on the controller temperature, the ambient temperature and a preset temperature error mapping table.
[0086] Step 208, store the compensation error in the non - volatile memory. It should be noted that there seems to be an incorrect tag reference in the original text at line 27 which is "<* R1 " and in step 47 which is "*210" in the translation. These should be corrected according to the correct original content.
[0087] Step 209: Input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula.
[0088] Step 210: Determine whether the non-volatile memory stores the previous time error. If so, execute Step 209; otherwise, execute Step 211.
[0089] Step 211: Obtain a preset inherent error value, and input the inherent error value and the wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula.
[0090] Among them, the inherent error value is pre-calibrated through a large number of experiments. Although it is not very accurate, it can also improve the timing accuracy of the RTC to a certain extent.
[0091] In a specific embodiment, the specific implementation of filtering multiple stored time errors to obtain the target time error includes:
[0092] Input the time error into a preset time error calculation formula to obtain the target time error output by the time error calculation formula.
[0093] Among them, the time error calculation formula is shown in Formula (2):
[0094]
[0095] Among them, δ represents the target time error, N represents the number of time errors in the time error, δ i represents the i-th time error in the time error, δ max represents the maximum time error in the time error, δ min represents the minimum time error in the time error.
[0096] In a specific embodiment, based on a preset evaluation strategy, evaluate whether the current time error is qualified; in the case of determining that the current time error is qualified, record the evaluation times corresponding to the current evaluation, and execute the steps of storing the evaluation times and storing the target time error.
[0097] Specifically, the evaluation strategy includes: whether the number of learning successes corresponding to the current time is greater than the number of learning successes corresponding to the previous time, and whether the controller temperature corresponding to the current time is different from the control temperature corresponding to the previous time.
[0098] Specifically, when it is determined that the number of successful learning times corresponding to the current time is greater than the number of successful learning times corresponding to the previous time, and the controller temperature corresponding to the current time is different from the control temperature corresponding to the previous time, it is determined that the time error for the current time is qualified; when it is determined that any one or more of the above conditions are not met, it is determined that the time error for the current time is unqualified.
[0099] Among them, the number of evaluation times is equivalent to the number of successful learning times.
[0100] In a specific embodiment, the specific implementation of calculating the target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table includes:
[0101] Input the controller temperature and the ambient temperature into a preset temperature gradient difference calculation formula to obtain the temperature gradient difference output by the temperature gradient difference calculation formula; query the temperature error mapping table to obtain the target temperature error corresponding to the temperature gradient difference.
[0102] Among them, the temperature gradient difference calculation formula is shown in Formula (3):
[0103]
[0104] Among them, ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, T ki represents the i-th controller temperature, T kmax represents the maximum controller temperature among multiple controller temperatures, T kmin represents the minimum controller temperature among multiple controller temperatures, T hi represents the i-th ambient temperature, T hmax represents the maximum ambient temperature among multiple ambient temperatures, T hmin represents the minimum ambient temperature among multiple ambient temperatures.
[0105] Specifically, the temperature error mapping table is used to characterize the corresponding relationship between the temperature gradient difference and the target temperature error.
[0106] Specifically, the temperature error mapping table is obtained through a mapping table calculation formula, where the mapping table calculation formula is shown in Formula (4):
[0107]
[0108] Among them, Δf represents the frequency deviation (corresponding to the temperature gradient difference), f represents the fundamental frequency, k represents the curvature coefficient, which is a constant, T represents the temperature value within a preset temperature range (corresponding to the target temperature error), T0 represents the reference temperature, which is a constant, and f0 represents the preset frequency, which is a constant.
[0109] In a specific embodiment, the specific implementation of calibrating the wake-up timestamp using the compensation error to obtain the target wake-up timestamp includes:
[0110] Input the compensation error and wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula.
[0111] Among them, the error calibration formula is shown in Formula (5):
[0112] T m = T X + T X * δ h ………………………………(5)
[0113] Among them, T m represents the target wake-up timestamp, T X represents the wake-up timestamp, and δ h represents the compensation error.
[0114] In this application, by setting a preset time interval, the timing results of the power supply replenishment system and the RTC are compared to obtain the target time error; and it is determined whether the learning is successful, and the data corresponding to the successful learning is stored in the NVM for use when the learning is unsuccessful next time. And based on the controller temperature, the ambient temperature, and a pre-obtained temperature error mapping table, the target temperature error is obtained. Furthermore, based on the target time error and the target temperature error, the compensation error is obtained, and the wake-up timestamp is compensated using the compensation error to obtain the target wake-up timestamp.
[0115] This application can effectively improve the timing accuracy of the RTC built in the vehicle controller. Without adding hardware components or changing the controller design when the vehicle has a requirement for a timed wake-up function, the purpose of high-precision timing can be achieved.
[0116] This embodiment of the application also provides a calibration device for a real-time clock. The specific implementation of this device can refer to the description in the calibration method of the real-time clock, and the repeated parts will not be elaborated. As Figure 3 shown, this device includes:
[0117] An acquisition module 301, configured to obtain clock calibration parameters based on a preset time interval when it is determined that the vehicle is in an operating state. Among them, the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located. Among them, the first timestamp is obtained by timing with the real-time clock, the second timestamp is obtained by timing with the vehicle's power supply replenishment system, and the real-time clock and the power supply replenishment system are synchronized for timing.
[0118] A calculation module 302, configured to execute a compensation error calculation process based on the clock calibration parameters when the vehicle is in an operating state to obtain the compensation error until the vehicle is in a sleep state.
[0119] Among them, the compensation error calculation process includes:
[0120] Calculate the target time error based on the first timestamp and the second timestamp, and calculate the target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and sum the target time error and the target temperature error to obtain a compensation error.
[0121] The calibration module 303 is configured to, when receiving a sleep instruction and determining that the vehicle is not in a sleep state, obtain a wake-up timestamp for waking up the vehicle controller, and calibrate the wake-up timestamp using the compensation error to obtain a target wake-up timestamp, where the target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches a critical voltage, and is used to instruct the vehicle to wake up the vehicle controller, so that the vehicle controller controls the high-voltage system to charge the battery.
[0122] In a specific embodiment, the calculation module 302 is configured to, after obtaining the first timestamp and the second timestamp each time, calculate the time error between the current first timestamp and second timestamp and the previous first timestamp and second timestamp, obtain and store the current time error; perform a filtering process on the stored multiple time errors to obtain and store the target time error.
[0123] In a specific embodiment, the calculation module 302 is configured to input the time error into a preset time error calculation formula to obtain the target time error output by the time error calculation formula.
[0124] Wherein, the time error calculation formula includes:
[0125]
[0126] Wherein, δ represents the target time error, N represents the number of time errors in the time error, δ i represents the i-th time error in the time error, δ max represents the maximum time error in the time error, δ min represents the minimum time error in the time error.
[0127] In a specific embodiment, the calculation module 302 is configured to evaluate whether the current time error is qualified based on a preset evaluation strategy; when determining that the current time error is qualified, record the evaluation times corresponding to the current evaluation, and perform the steps of storing the evaluation times and storing the target time error.
[0128] In a specific embodiment, the calculation module 302 is configured to input the controller temperature and the ambient temperature into a preset temperature gradient difference calculation formula to obtain the temperature gradient difference output by the temperature gradient difference calculation formula.
[0129] Wherein, the temperature gradient difference calculation formula includes:
[0130]
[0131] Among them, ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, T ko represents the temperature of the i-th controller, T kmax represents the maximum controller temperature among multiple controller temperatures, T kmin represents the minimum controller temperature among multiple controller temperatures, T hi represents the i-th ambient temperature, T hmax represents the maximum ambient temperature among multiple ambient temperatures, T hmin represents the minimum ambient temperature among multiple ambient temperatures.
[0132] Query the temperature error mapping table to obtain the target temperature error corresponding to the temperature gradient difference.
[0133] In a specific embodiment, the calibration module 303 is configured to input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula.
[0134] Among them, the error calibration formula includes:
[0135] T m = T X + T X * δ h ;
[0136] Among them, T m represents the target wake-up timestamp, T X represents the wake-up timestamp, δ h represents the compensation error.
[0137] In a specific embodiment, the calculation module 302 is configured to calculate the time error between the first timestamp and the second timestamp obtained for the first time and the first preset timestamp and the second preset timestamp, and obtain and store the time error obtained for the first time.
[0138] Figure 4 Illustrates a schematic physical structure diagram of an electronic device, as Figure 4 shown. The electronic device may include: a processor 401, a communication interface 402, a memory 403, and a communication bus 404. Among them, the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404. The processor 401 can call the logical instructions in the memory 403 to execute the calibration method of the real-time clock.
[0139] In addition, when the logical instructions in the above-mentioned memory 403 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0140] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the real-time clock calibration method provided by the above-mentioned various methods.
[0141] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the real-time clock calibration method provided by the above-mentioned various embodiments.
[0142] The device embodiments described above are illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0143] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disks, optical discs, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.
[0144] Finally, it should be noted that the above are only the preferred embodiments of the present application, and the present application is not limited to the above embodiments. Other improvements and changes directly derived or associated by those skilled in the art without departing from the spirit and concept of the present application should be considered to be included within the protection scope of the present application.
Claims
1. A calibration method for a real-time clock, characterized in that, The method includes: When it is determined that the vehicle is in an operating state, obtaining clock calibration parameters based on a preset time interval, where the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle control unit, and the ambient temperature of the environment where the vehicle is located. The first timestamp is obtained by timing with a real-time clock, the second timestamp is obtained by timing with the vehicle's battery charging system, and the real-time clock and the battery charging system are synchronized for timing; When the vehicle is in the operating state, performing a compensation error calculation process based on the clock calibration parameters to obtain a compensation error until the vehicle is in a sleep state; Among them, the compensation error calculation process includes: Calculating a target time error based on the first timestamp and the second timestamp, and calculating a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and performing a summation process on the target time error and the target temperature error to obtain the compensation error; When a sleep instruction is received and it is determined that the vehicle is not in the sleep state, obtaining a wake-up timestamp for waking up the vehicle control unit, and calibrating the wake-up timestamp with the compensation error to obtain a target wake-up timestamp, where the target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches a critical voltage, and is used to indicate that the vehicle wakes up the vehicle control unit, so that the vehicle control unit controls the high-voltage system to charge the battery.
2. The calibration method of the real-time clock according to claim 1, characterized in that Calculating a target time error based on the first timestamp and the second timestamp includes: After obtaining the first timestamp and the second timestamp each time, calculating the time error between the current first timestamp and second timestamp and the previous first timestamp and second timestamp, and obtaining and storing the current time error; Performing a filtering process on the stored multiple time errors to obtain and store the target time error.
3. The calibration method of the real-time clock according to claim 2, wherein Performing a filtering process on the stored multiple time errors to obtain the target time error includes: Inputting the time error into a preset time error calculation formula to obtain the target time error output by the time error calculation formula; Among them, the time error calculation formula includes: Among them, δ represents the target time error, N represents the number of time errors in the time error, δ i represents the i-th time error in the time error, δ max represents the maximum time error in the time error, δ min represents the minimum time error in the time error.
4. The calibration method of the real-time clock according to claim 2, characterized in that Before storing the target time error, it further includes: Evaluating whether the current time error is qualified based on a preset evaluation strategy; When it is determined that the current time error is qualified, recording the evaluation times corresponding to the current evaluation, and performing the steps of storing the evaluation times and storing the target time error.
5. The calibration method of the real-time clock according to any one of claims 1-4, characterized in that Calculating a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table includes: Inputting the controller temperature and the ambient temperature into a preset temperature gradient difference calculation formula to obtain the temperature gradient difference output by the temperature gradient difference calculation formula; Among them, the temperature gradient difference calculation formula includes: where ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, T ki represents the i-th controller temperature, T kmax represents the maximum controller temperature among multiple controller temperatures, T kmin represents the minimum controller temperature among multiple controller temperatures, T hi represents the i-th ambient temperature, T hmax represents the maximum ambient temperature among multiple ambient temperatures, T hmin represents the minimum ambient temperature among multiple ambient temperatures; Querying the temperature error mapping table to obtain the target temperature error corresponding to the temperature gradient difference.
6. The calibration method of the real-time clock according to any one of claims 1-4, characterized in that Calibrating the wake-up timestamp with the compensation error to obtain a target wake-up timestamp includes: Input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain the target wake-up timestamp output by the error calibration formula; wherein, the error calibration formula includes: T m = T X + T X * δ h ; Among them, T m represents the target wake-up timestamp, T X represents the wake-up timestamp, and δ h represents the compensation error.
7. The calibration method of the real-time clock according to claim 2, wherein After obtaining the first timestamp and the second timestamp each time, calculate the time error between the current first timestamp and second timestamp and the previous first timestamp and second timestamp, and obtain and store the current time error, including: After obtaining the first timestamp and the second timestamp for the first time, calculate the time error between the first timestamp and the second timestamp obtained for the first time and the first preset timestamp and the second preset timestamp, and obtain and store the time error for the first time.
8. A calibration device for a real-time clock, characterized in that, The device includes: An acquisition module, configured to obtain clock calibration parameters based on a preset time interval when it is determined that the vehicle is in a running state, wherein the clock calibration parameters include: a first timestamp, a second timestamp, the controller temperature of the vehicle's vehicle controller, and the ambient temperature of the environment where the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, the second timestamp is obtained by timing with the vehicle's battery charging system, and the real-time clock and the battery charging system are synchronized for timing; A calculation module, configured to execute a compensation error calculation process based on the clock calibration parameters when the vehicle is in the running state to obtain a compensation error until the vehicle is in a sleep state; wherein, the compensation error calculation process includes: Calculate a target time error based on the first timestamp and the second timestamp, and calculate a target temperature error based on the controller temperature, the ambient temperature, and a preset temperature error mapping table, and perform a summation process on the target time error and the target temperature error to obtain the compensation error; A calibration module, configured to obtain a wake-up timestamp for waking up the vehicle controller when a sleep instruction is received and it is determined that the vehicle is not in the sleep state, and calibrate the wake-up timestamp using the compensation error to obtain a target wake-up timestamp, wherein the target wake-up timestamp is the timestamp when the voltage of the vehicle's battery reaches a critical voltage, and is used to instruct the vehicle to wake up the vehicle controller so that the vehicle controller controls the high-voltage system to charge the battery.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the real-time clock calibration method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the real-time clock calibration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Verification method and device of battery monitoring mechanism, electronic equipment and storage medium
CN116872784A
Bus communication module automatic calibration method, device and equipment and storage medium
CN118921247A