Calibration method and device of real-time clock, equipment and medium
Through real-time clock calibration method, the wake-up timestamp is calculated and calibrated, which solves the problem of small batteries exhausted in the dormant state of electric vehicles, ensuring that the vehicle can wake up and charge normally.
Patent Information
- Application Number
- CN202411934316.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When an electric car is in a dormant state, long-term parking or sleeping will cause the small battery to run out of power, causing the vehicle to be unable to use normally.
Through the calibration method of real-time clock, clock calibration parameters are obtained, including the first time stamp, the second time stamp, the vehicle controller temperature and ambient temperature, and the compensation error is calculated, and when the sleep command is received, the wake-up timestamp is calibrated to wake up the vehicle controller when the target wakes up the timestamp, so that it controls the high-voltage system to charge the battery.
It effectively solves the problem that the vehicle cannot be used normally due to the battery voltage below the critical voltage, ensuring that the vehicle can wake up and charge it in time when needed.
Smart Images

Figure CN119814211A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of charging time calibration of electric vehicles, and in particular to a calibration method, device, equipment and medium for a real-time clock. Background Art
[0002] As electric vehicles become more complex and intelligent, the number of electronic control units inside the vehicle increases, resulting in an increase in static current, making it easier for small batteries to run out of power when parked or dormant for a long time, thus affecting the normal use of the vehicle. For example, when the small battery voltage is below a certain threshold, the vehicle may not start.
[0003] Electric vehicles are usually equipped with two 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 powering low-power electrical appliances such as unlocking doors, starting the vehicle, and lights. During normal operation of the vehicle, the vehicle controller can monitor the power of the small battery in real time, and convert the power of the high-voltage battery into power 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 stationary (or in a dormant state), the power level of the small battery cannot be directly detected, causing the small battery to run out of power after being parked or dormant for a long time, affecting the normal use of the vehicle. Summary of the invention
[0005] In response to the above-mentioned problems and technical needs, the applicant has proposed a real-time clock calibration method, device, equipment and medium to solve the problem in the prior art that when a vehicle is in a dormant state, the battery power is exhausted due to long-term parking or dormant state, causing the vehicle to be unable to be used normally. When receiving a dormant command, a target wake-up timestamp is determined to wake up the dormant vehicle controller at the target wake-up timestamp, so that the vehicle controller controls the high-voltage system to charge the battery, thereby 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 the present application provides a real-time clock calibration method, the method comprising:
[0007] When it is determined that the vehicle is in a running state, a clock calibration parameter is obtained based on a preset time interval, wherein the clock calibration parameter includes: a first timestamp, a second timestamp, a controller temperature of a vehicle controller of the vehicle, and an ambient temperature of an environment in which the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, and the second timestamp is obtained by timing with a power supplement system of the vehicle, and the real-time clock and the power supplement system are synchronized in timing;
[0008] When the vehicle is in the running state, performing a compensation error calculation process based on the clock calibration parameter to obtain a compensation error until the vehicle is in a dormant 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 summing the target time error and the target temperature error to obtain the compensation error;
[0011] When a sleep command 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, wherein the target wake-up timestamp is the timestamp when the voltage of the battery of the vehicle reaches a critical voltage, which 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.
[0012] According to a real-time clock calibration method according to an embodiment of the present application, a target time error is calculated based on the first timestamp and the second timestamp, including:
[0013] 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 first timestamp and the second timestamp of the previous time, and obtain and store the current time error;
[0014] The stored multiple time errors are filtered to obtain and store the target time error.
[0015] According to a real-time clock calibration method according to an embodiment of the present application, filtering is performed on a plurality of stored time errors to obtain the target time error, including:
[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] The time error calculation formula includes:
[0018]
[0019] 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 among the time errors, δ min Indicates the minimum time error among the time errors.
[0020] According to a real-time clock calibration method according to an embodiment of the present application, before storing the target time error, the method further includes:
[0021] Based on the preset evaluation strategy, evaluate whether the current time error is qualified;
[0022] When it is determined that the current time error is qualified, the evaluation number corresponding to the current evaluation is recorded, and the steps of storing the evaluation number and storing the target time error are performed.
[0023] According to a real-time clock calibration method according to an embodiment of the present application, a target temperature error is calculated based on the controller temperature, the ambient temperature and a preset temperature error mapping table, including:
[0024] 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;
[0025] Wherein, the temperature gradient difference calculation formula includes:
[0026]
[0027] Where ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, and T ki represents the temperature of the i-th controller, T kmax Indicates the maximum controller temperature among multiple controller temperatures, T kmin Indicates the minimum controller temperature among multiple controller temperatures, T hi represents the ith ambient temperature, T hmax Indicates the maximum ambient temperature among multiple ambient temperatures, T hmin Indicates the minimum ambient temperature among multiple ambient temperatures;
[0028] The temperature error mapping table is queried to obtain a target temperature error corresponding to the temperature gradient difference.
[0029] According to a real-time clock calibration method according to an embodiment of the present application, the wake-up timestamp is calibrated using the compensation error to obtain a target wake-up timestamp, including:
[0030] Inputting 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] Among them, T m Indicates the target wake-up timestamp, T X Indicates the wake-up timestamp, δ h Indicates compensation error.
[0034] According to a real-time clock calibration method according to an embodiment of the present application, after obtaining a first timestamp and a second timestamp each time, calculating a time error between the current first timestamp and the second timestamp and the previous first timestamp and the second timestamp, obtaining and storing the current time error, includes:
[0035] After the first timestamp and the second timestamp are obtained for the first time, the time errors between the first timestamp and the second timestamp and the first preset timestamp and the second preset timestamp are calculated to obtain and store the first time error.
[0036] The embodiment of the present application also provides a real-time clock calibration device, including:
[0037] an acquisition module, configured to acquire 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, a controller temperature of a vehicle controller of the vehicle, and an ambient temperature of an environment in which the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, and the second timestamp is obtained by timing with a power supply system of the vehicle, and the real-time clock and the power supply system are synchronized in timing;
[0038] a calculation module, configured to perform a compensation error calculation process based on the clock calibration parameter to obtain a compensation error when the vehicle is in the running state, until the vehicle is in a dormant state;
[0039] Wherein, the compensation error calculation process includes:
[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 summing the target time error and the target temperature error to obtain the compensation error;
[0041] A calibration module is used to obtain a wake-up timestamp for waking up the vehicle controller when a sleep command is received and it is determined that the vehicle is not in the sleep state, and to 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 battery of the vehicle 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 also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the real-time clock calibration method as described in any one of the above items are implemented.
[0043] An embodiment of the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the real-time clock calibration method as described in any one of the above items.
[0044] The real-time clock calibration method, device, equipment and medium provided in the embodiments of the present application obtain clock calibration parameters based on preset time intervals when it is determined that the vehicle is in a running state, wherein the clock calibration parameters include: a first timestamp, a second timestamp, a controller temperature of the vehicle controller and an ambient temperature of the environment in which the vehicle is located, wherein the first timestamp is obtained by timing the real-time clock, and the second timestamp is obtained by timing the vehicle's power supply system, and the real-time clock and the power supply system are synchronized. The present application synchronously collects timestamps through the real-time clock and the power supply system to ensure that the collection start time of the timestamp is consistent, thereby providing an effective data basis for the subsequent calculation of the compensation voltage; when the vehicle is in a running state, a compensation error calculation process is performed based on the clock calibration parameters to obtain a compensation error until the vehicle is in a dormant state; wherein the compensation error calculation process includes: based on the first timestamp The target time error is calculated with the second timestamp, and the target temperature error is calculated based on the controller temperature, the ambient temperature and a preset temperature error mapping table, and the target time error and the target temperature error are summed to obtain a compensation error. Since the temperature error and time error are caused by the operation of the vehicle, the present application monitors the vehicle before it is in a sleep state in the vehicle to obtain a compensation error caused by the operation of the vehicle; and when a sleep command is received and it is determined that the vehicle is not in a sleep state, a wake-up timestamp for waking up the entire vehicle controller is obtained, and the wake-up timestamp is calibrated using the compensation error to obtain a target wake-up timestamp, so that when the vehicle receives the sleep command, the target wake-up timestamp is determined to wake up the dormant vehicle controller at the target wake-up timestamp, so that the vehicle controller controls the high-voltage system to charge the battery, thereby solving the problem that the vehicle cannot be used normally due to the battery voltage being lower than the critical voltage. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 This is one of the flow charts of the real-time clock calibration method provided in the embodiment of the present application;
[0047] Figure 2 This is a second flow chart of a real-time clock calibration method provided in an embodiment of the present application;
[0048] Figure 3 is a schematic diagram of the structure of a real-time clock calibration device provided in an embodiment of the present application;
[0049] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In order to clearly illustrate the problems of the prior art in this application, further explanation is given:
[0052] In order to solve the problem of the vehicle being unusable due to battery power loss, the intelligent charging system came into being. The wake-up time is set before the vehicle goes into sleep mode. After waking up, the intelligent charging system monitors the voltage of the small battery and automatically wakes up the vehicle controller (vehicle controller) to charge the small battery when the voltage is lower than the set value to ensure that the vehicle can start and run normally. The intelligent 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] The timed wake-up task is usually implemented with the help of a real-time clock (RTC), of which RTC is divided into integrated and independent types. An integrated RTC chip means that the RTC function is concentrated in one chip, and RTC is only a sub-function of the chip; an independent RTC chip refers to a chip specifically used for timing. Generally speaking, the precision of an integrated RTC chip is low, and the precision of an independent RTC chip is high, but the hardware cost is high.
[0054] The prior art uses a high-precision RTC chip and a vehicle-mounted communication module (TBOX) to perform a timed wake-up of the vehicle controller. Due to the use of TBOX, the quality of the network signal is required to be high. In places where the network signal quality is poor, such as underground garages, the timed wake-up function is at risk of failure, which may cause the small battery to fail to replenish power in time, resulting in the problem that the vehicle cannot start due to serious power loss.
[0055] In addition, TBOX wakes up the vehicle controller through the CAN network, which requires the vehicle controller to support the CAN wake-up function. The vehicle controller hardware needs to be redesigned, which increases the time cost.
[0056] In order to solve the above problems, the embodiment of the present application provides a real-time clock calibration method. The method can be applied in the power replenishment system. Some other descriptions in the embodiment of the present application are for illustrative purposes only and are not used to limit the protection scope of the present application. They will not be described one by one later. The specific implementation of the method is as follows Figure 1 As shown:
[0057] Step 101 : when it is determined that the vehicle is in a running state, a clock calibration parameter is obtained 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 controller and the ambient temperature of the vehicle's environment, wherein the first timestamp is obtained by real-time clock timing, and the second timestamp is obtained by vehicle's power supply system timing, and the real-time clock and the power supply system are synchronized.
[0059] Step 102 , when the vehicle is in a running state, a compensation error calculation process is performed based on a clock calibration parameter to obtain a compensation error, until the vehicle is in a dormant state.
[0060] Among them, 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 the preset temperature error mapping table, and summing the target time error and the target temperature error to obtain the compensation error.
[0061] Step 103, when the sleep instruction is received and it is determined that the vehicle is not in a sleep state, a wake-up timestamp for waking up the vehicle controller is obtained, and the wake-up timestamp is calibrated by using the compensation error to obtain a 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, which 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.
[0063] The real-time clock calibration method provided in the embodiment of the present application obtains clock calibration parameters based on preset time intervals when it is determined that the vehicle is in a running state, wherein the clock calibration parameters include: a first timestamp, a second timestamp, a controller temperature of the vehicle controller of the vehicle and an ambient temperature of the environment in which the vehicle is located, wherein the first timestamp is obtained by timing the real-time clock, and the second timestamp is obtained by timing the vehicle's power supply system, and the real-time clock and the power supply system are synchronized. The present application synchronously collects timestamps through the real-time clock and the power supply system to ensure that the collection start time of the timestamp is consistent, thereby providing an effective data basis for the subsequent calculation of the compensation voltage; when the vehicle is in a running state, a compensation error calculation process is performed based on the clock calibration parameters to obtain a compensation error until the vehicle is in a dormant state; wherein the compensation error calculation process includes: based on the first timestamp and the second timestamp The target time error is calculated by using a timestamp, and the target temperature error is calculated based on the controller temperature, the ambient temperature and a preset temperature error mapping table, and the target time error and the target temperature error are summed to obtain a compensation error. Since the temperature error and time error are caused by the operation of the vehicle, the present application monitors the vehicle before it is in a sleep state in the vehicle to obtain a compensation error caused by the operation of the vehicle; and when a sleep command is received and it is determined that the vehicle is not in a sleep state, a wake-up timestamp for waking up the whole vehicle controller is obtained, and the wake-up timestamp is calibrated using the compensation error to obtain a target wake-up timestamp, which realizes that when a sleep command is received, the 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.
[0064] Specifically, through analysis, it can be seen that the RTC error is mainly generated from three places: the inherent deviation of the RTC clock source, that is, the crystal oscillator used; the deviation caused by the change of the external environment temperature; and the deviation caused by the unstable power supply. Since the internal power supply of the vehicle controller is a voltage stabilized by a low dropout regulator (LDO), this application does not consider the deviation caused by the power supply.
[0065] The inherent deviation of the crystal is the main source, while the deviation caused by temperature is smaller. Since the inherent deviation of the crystal oscillator is different on each control unit, all control units cannot use the same error compensation value. The RTC accuracy in the vehicle controller is improved by self-learning the compensation error during the compensation error calculation process, and the accurate timed wake-up function can be achieved without changing the design of the current vehicle controller.
[0066] Specifically, the timing time when the vehicle is powered off is compensated through crystal error (corresponding to time error) and temperature error to obtain the final timing time, so that the vehicle controller is awakened at the final timing time.
[0067] This application can improve the RTC timing accuracy without adding any auxiliary circuits, ensuring that the vehicle controller is accurately awakened. It is simple to implement and effectively saves development costs.
[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, the time error between the current first timestamp and the second timestamp and the previous first timestamp and the second timestamp is calculated to obtain and store the current time error; and the stored multiple time errors are filtered to obtain and store the target time error.
[0070] In a specific embodiment, after the first timestamp and the second timestamp are obtained for the first time, the time errors between the first timestamp and the second timestamp and the first preset timestamp and the second preset timestamp are calculated to obtain and store the first time error.
[0071] Specifically, the time error may not be calculated after the first timestamp and the second timestamp are obtained for the first time, and the time error may be calculated after the first timestamp and the second timestamp are obtained for the second time. This scenario is taken as an example for specific description.
[0072] Specifically, through Figure 2 The following is a specific description of the scenario in which any electronic control unit of the vehicle controller is powered on each time:
[0073] Step 201 : when the electronic control unit is powered on and running, a clock calibration parameter is obtained.
[0074] Specifically, the RTC performs an initialization operation and starts timing after the initialization operation is completed. The power compensation 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. At the same time, the controller temperature and the ambient temperature at the beginning of power-on are recorded.
[0075] Step 202 : After a preset time interval, record the second first timestamp and the second timestamp, as well as the second controller temperature and the ambient temperature.
[0076] Step 203: Obtain a second time error corresponding to the first timestamp and the second timestamp through an error calculation formula.
[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 Indicates the first timestamp obtained for the second time, T R1 Indicates the first timestamp obtained for the first time, T M2 Indicates the second timestamp obtained for the second time, T M1 Indicates the second timestamp obtained for the first time.
[0080] Step 204, after obtaining the first time error, the preset number of successful learning is increased by 1, and the first time error, the second controller temperature and the ambient temperature are stored in an array.
[0081] The initial value of the number of successful learning times may be set to zero.
[0082] Step 205 , determining whether the ECU is about to enter a dormant state, if so, returning to step 206 , otherwise, executing step 202 .
[0083] Specifically, after receiving the sleep command, the vehicle will not immediately enter the sleep state, but will perform some necessary operations to power off the battery, and then officially enter the sleep state. The "about to enter the sleep state" at this time is the period after receiving the sleep command and before officially entering the sleep state.
[0084] Step 206 , evaluating whether the current time error is qualified, if so, executing step 207 , otherwise, executing step 210 .
[0085] Step 207 , filtering the stored multiple time errors to obtain a target time error, and calculating a 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 a non-volatile memory.
[0087] Step 209 , input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain a target wake-up timestamp output by the error calibration formula.
[0088] Step 210 , determining whether the non-volatile memory stores the last time error, if so, executing step 209 , otherwise, executing step 211 .
[0089] Step 211 , obtaining a preset inherent error value, and inputting the inherent error value and the wake-up timestamp into a preset error calibration formula to obtain a 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 improve the timing accuracy of the RTC to a certain extent.
[0091] In a specific embodiment, filtering the stored multiple time errors to obtain the target time error includes:
[0092] The time error is input into a preset time error calculation formula to obtain a target time error output by the time error calculation formula.
[0093] 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 among the time errors, δ min Indicates the minimum time error among the time errors.
[0096] In a specific embodiment, based on a preset evaluation strategy, it is evaluated whether the current time error is qualified; if it is determined that the current time error is qualified, the evaluation number corresponding to the current evaluation is recorded, and the steps of storing the evaluation number and storing the target time error are executed.
[0097] Specifically, the evaluation strategy includes: whether 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 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 current time error is qualified; when it is determined that any one or more of the above conditions are not met, it is determined that the current time error is unqualified.
[0099] The number of evaluations is equivalent to the number of successful learning.
[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] The controller temperature and the ambient temperature are input into a preset temperature gradient difference calculation formula to obtain the temperature gradient difference output by the temperature gradient difference calculation formula; the temperature error mapping table is queried to obtain the target temperature error corresponding to the temperature gradient difference.
[0102] The temperature gradient difference calculation formula is shown in formula (3):
[0103]
[0104] Where ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, and T ki represents the temperature of the i-th controller, T kmax Indicates the maximum controller temperature among multiple controller temperatures, T kmin Indicates the minimum controller temperature among multiple controller temperatures, T hi represents the ith ambient temperature, T hmax Indicates the maximum ambient temperature among multiple ambient temperatures, T hmin Indicates 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 by a mapping table calculation formula, wherein 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 the 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 by compensating the error to obtain the target wake-up timestamp includes:
[0110] The compensation error and the wake-up timestamp are input into a preset error calibration formula to obtain a target wake-up timestamp output by the error calibration formula.
[0111] The error calibration formula is shown in formula (5):
[0112] T m =T X +T X *δ h ………………………………(5)
[0113] Among them, T m Indicates the target wake-up timestamp, T X Indicates the wake-up timestamp, δ h Indicates compensation error.
[0114] This application sets a preset time interval to compare the timing results of the power replenishment system and the RTC to obtain the target time error; and determines whether the learning is successful, and stores the corresponding data of the successful learning into the NVM for use when the learning is unsuccessful next time. The target temperature error is obtained through the controller temperature, ambient temperature and the pre-obtained temperature error mapping table, and then the compensation error is obtained based on the target time error and the target temperature error, and the compensation error is used to compensate the wake-up timestamp to obtain the target wake-up timestamp.
[0115] This application can effectively improve the timing accuracy of the RTC built into the vehicle controller, and can achieve high-precision timing without adding hardware components or changing the controller design when the vehicle requires a timed wake-up function.
[0116] The embodiment of the present application also provides a real-time clock calibration device. The specific implementation of the device can refer to the description of the real-time clock calibration method, and the repeated parts will not be repeated. Figure 3 As shown, the device comprises:
[0117] The acquisition module 301 is used to acquire clock calibration parameters based on preset time intervals when it is determined that the vehicle is in a running state, wherein the clock calibration parameters include: a first timestamp, a second timestamp, a controller temperature of the vehicle controller of the vehicle, and an ambient temperature of the environment in which the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, and the second timestamp is obtained by timing with a power supply system of the vehicle, and the real-time clock and the power supply system are synchronized.
[0118] The calculation module 302 is used to perform a compensation error calculation process based on the clock calibration parameter to obtain a compensation error when the vehicle is in a running state until the vehicle is in a dormant state.
[0119] The compensation error calculation process includes:
[0120] The target time error is calculated based on the first timestamp and the second timestamp, and the target temperature error is calculated based on the controller temperature, the ambient temperature and a preset temperature error mapping table, and the target time error and the target temperature error are summed to obtain a compensation error.
[0121] The calibration module 303 is used to obtain a wake-up timestamp for waking up the vehicle controller when a sleep command is received and it is determined that the vehicle is not in a sleep state, and to calibrate the wake-up timestamp using a 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.
[0122] In a specific embodiment, the calculation module 302 is used to calculate the time error between the current first timestamp and the second timestamp and the previous first timestamp and the second timestamp after each time the first timestamp and the second timestamp are obtained, to obtain and store the current time error; and to filter the stored multiple time errors to obtain and store the target time error.
[0123] In a specific embodiment, the calculation module 302 is used to input the time error into a preset time error calculation formula to obtain a target time error output by the time error calculation formula.
[0124] The time error calculation formula includes:
[0125]
[0126] 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 among the time errors, δ min Indicates the minimum time error among the time errors.
[0127] In a specific embodiment, the calculation module 302 is used to evaluate whether the current time error is qualified based on a preset evaluation strategy; if it is determined that the current time error is qualified, the evaluation number corresponding to the current evaluation is recorded, and the steps of storing the evaluation number and storing the target time error are executed.
[0128] In a specific embodiment, the calculation module 302 is used 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] Among them, the temperature gradient difference calculation formula includes:
[0130]
[0131] Where ΔT represents the temperature gradient difference, M represents the total number of controller temperatures or the total number of ambient temperatures, and T ko represents the temperature of the i-th controller, T kmax Indicates the maximum controller temperature among multiple controller temperatures, T kmin Indicates the minimum controller temperature among multiple controller temperatures, T hi represents the ith ambient temperature, T hmax Indicates the maximum ambient temperature among multiple ambient temperatures, T hmin Indicates the minimum ambient temperature among multiple ambient temperatures.
[0132] The temperature error mapping table is queried to obtain the target temperature error corresponding to the temperature gradient difference.
[0133] In a specific embodiment, the calibration module 303 is used to input the compensation error and the wake-up timestamp into a preset error calibration formula to obtain a 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 Indicates the target wake-up timestamp, T X Indicates the wake-up timestamp, δ h Indicates compensation error.
[0137] In a specific embodiment, the calculation module 302 is used to calculate the time error between the first timestamp and the second timestamp and the first preset timestamp and the second preset timestamp after obtaining the first timestamp and the second timestamp for the first time, and obtain and store the first time error.
[0138] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 401, a communications interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communications interface 402 and the memory 403 communicate with each other via the communication bus 404. The processor 401 may call the logic instructions in the memory 403 to execute the real-time clock calibration method.
[0139] In addition, the logic instructions in the above-mentioned memory 403 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and 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 methods.
[0141] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the real-time clock calibration method provided by the above embodiments.
[0142] The device embodiments described above are schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method 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 this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0144] Finally, it should be noted that the above is only the preferred implementation 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 in the scope of protection of the present application.
Claims
1. A method for calibrating a real-time clock, characterized in that: The method comprises: When it is determined that the vehicle is in a running state, a clock calibration parameter is obtained based on a preset time interval, wherein the clock calibration parameter includes: a first timestamp, a second timestamp, a controller temperature of a vehicle controller of the vehicle, and an ambient temperature of an environment in which the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, and the second timestamp is obtained by timing with a power supplement system of the vehicle, and the real-time clock and the power supplement system are synchronized in timing; When the vehicle is in the running state, performing a compensation error calculation process based on the clock calibration parameter to obtain a compensation error until the vehicle is in a dormant state; Wherein, 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 summing the target time error and the target temperature error to obtain the compensation error; When a sleep command 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, wherein the target wake-up timestamp is the timestamp when the voltage of the battery of the vehicle reaches a critical voltage, which 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.
2. The real-time clock calibration method 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, calculate the time error between the current first timestamp and the second timestamp and the first timestamp and the second timestamp of the previous time, and obtain and store the current time error; The stored multiple time errors are filtered to obtain and store the target time error.
3. The real-time clock calibration method according to claim 2, characterized in that: Filtering the stored multiple time errors to obtain the target time error includes: Input the time error into a preset time error calculation formula to obtain the target time error output by the time error calculation formula; 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 among the time errors, δ min Indicates the minimum time error among the time errors.
4. The real-time clock calibration method according to claim 2, characterized in that: Before storing the target time error, the method further includes: Based on the preset evaluation strategy, evaluate whether the current time error is qualified; When it is determined that the current time error is qualified, the evaluation number corresponding to the current evaluation is recorded, and the steps of storing the evaluation number and storing the target time error are performed.
5. The real-time clock calibration method according to any one of claims 1 to 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; Wherein, 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, and T ki represents the temperature of the i-th controller, T kmax Indicates the maximum controller temperature among multiple controller temperatures, T kmin Indicates the minimum controller temperature among multiple controller temperatures, T hi represents the ith ambient temperature, T hmax Indicates the maximum ambient temperature among multiple ambient temperatures, T hmin Indicates the minimum ambient temperature among multiple ambient temperatures; The temperature error mapping table is queried to obtain a target temperature error corresponding to the temperature gradient difference.
6. The real-time clock calibration method according to any one of claims 1 to 4, characterized in that: Calibrating the wake-up timestamp using the compensation error to obtain a target wake-up timestamp includes: Inputting 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 Indicates the target wake-up timestamp, T X Indicates the wake-up timestamp, δ h Indicates compensation error.
7. The real-time clock calibration method according to claim 2, characterized in that: After obtaining the first timestamp and the second timestamp each time, calculating the time error between the current first timestamp and the second timestamp and the first timestamp and the second timestamp of the previous time, obtaining and storing the current time error, includes: After the first timestamp and the second timestamp are obtained for the first time, the time errors between the first timestamp and the second timestamp and the first preset timestamp and the second preset timestamp are calculated to obtain and store the first time error.
8. A real-time clock calibration device, characterized in that: The device comprises: an acquisition module, configured to acquire 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, a controller temperature of a vehicle controller of the vehicle, and an ambient temperature of an environment in which the vehicle is located, wherein the first timestamp is obtained by timing with a real-time clock, and the second timestamp is obtained by timing with a power supply system of the vehicle, and the real-time clock and the power supply system are synchronized in timing; a calculation module, configured to perform a compensation error calculation process based on the clock calibration parameter to obtain a compensation error when the vehicle is in the running state, until the vehicle is in a dormant state; Wherein, 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 summing the target time error and the target temperature error to obtain the compensation error; A calibration module is used to obtain a wake-up timestamp for waking up the vehicle controller when a sleep command is received and it is determined that the vehicle is not in the sleep state, and to 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 battery of the vehicle 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 in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the real-time clock calibration method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the real-time clock calibration method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Wide range temperature error compensating method of real-time clock and system thereof
CN102163041A
Timing correction method and corresponding controller, vehicle, equipment and medium
CN113050497A
Awakening system, dormancy awakening method and clock calibration method based on Ethernet
CN115793836A
Time calibration method and device, electronic equipment and storage medium
CN116582214A
Verification method and device of battery monitoring mechanism, electronic equipment and storage medium
CN116872784A
Cited By
Clock calibration method, computer equipment, readable storage medium and program product
CN120994016A
Clock calibration method, computer device, readable storage medium and program product
CN120994016B
Time compensation method, battery management system, vehicle, server and service system
CN121200864A
Real-time clock calibration method and apparatus, device, and medium
WO2026137976A1