Rtc temperature compensation method, device, apparatus, storage medium and program product

By acquiring the temperatures of the RTC module and oscillator and using a thermoelectric module for dynamic temperature regulation, the problem of insufficient accuracy in RTC counting time was solved, enabling stable operation of the RTC within the set temperature range and improving timing accuracy and adaptability.

CN122308558APending Publication Date: 2026-06-30SHAANXI GREEN ENERGY ELECTRONIC TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHAANXI GREEN ENERGY ELECTRONIC TECH CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of time determination through RTC counting needs to be improved.

Method used

By acquiring the temperatures of the RTC module and the RTC oscillator, dynamic temperature regulation is performed using a thermoelectric module to ensure that they operate within the set temperature threshold range, including cooling or heating, to stabilize the oscillator's operating temperature.

Benefits of technology

It significantly improves the timing accuracy of RTC counting, reduces timing errors, adapts to extreme temperature environments, and reduces the risk of mechanical component and refrigerant leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122308558A_ABST
    Figure CN122308558A_ABST
Patent Text Reader

Abstract

This application provides an RTC temperature compensation method, apparatus, device, storage medium, and program product, relating to the field of circuit electronics technology. The method includes: acquiring a first temperature of a real-time clock (RTC) module and a second temperature of an RTC oscillator; cooling the RTC module and RTC oscillator when the first temperature and / or the second temperature is higher than a first preset temperature threshold; or heating the RTC module and RTC oscillator when the first temperature and / or the second temperature is lower than a second preset temperature threshold; wherein the second preset temperature threshold is less than or equal to the first preset temperature threshold. This method is used to improve the accuracy of time determined by RTC counting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of circuit electronics technology, and in particular to an RTC temperature compensation method, apparatus, device, storage medium, and program product. Background Technology

[0002] Currently, timing functions in the electronic field are mainly achieved through real-time clock (RTC) counting. An RTC is a hardware module in electronic devices used to continuously and accurately record time and date.

[0003] However, the accuracy of the time determined by RTC counting needs to be improved. Summary of the Invention

[0004] This application provides an RTC temperature compensation method, apparatus, device, storage medium, and program product, which can improve the accuracy of time determined by RTC counting.

[0005] In a first aspect, this application provides an RTC temperature compensation method, the method comprising: acquiring a first temperature of a real-time clock RTC module and a second temperature of an RTC oscillator; cooling the RTC module and the RTC oscillator when the first temperature and / or the second temperature is higher than a first preset temperature threshold; or heating the RTC module and the RTC oscillator when the first temperature and / or the second temperature is lower than a second preset temperature threshold; wherein the second preset temperature threshold is less than or equal to the first preset temperature threshold.

[0006] The RTC temperature compensation method provided in this application can obtain a first temperature of the RTC module and a second temperature of the RTC oscillator. If the first temperature and / or the second temperature is higher than a first preset temperature threshold, the RTC module and the RTC oscillator can be cooled; or, if the first temperature and / or the second temperature is lower than a second preset temperature threshold, the RTC module and the RTC oscillator can be heated. The second preset temperature threshold is less than or equal to the first preset temperature threshold. This allows for real-time temperature monitoring of the RTC module and the RTC oscillator, achieving dynamic balance adjustment and ensuring that the RTC module and the RTC oscillator always operate within the set temperature threshold range. By ensuring a constant operating temperature, frequency deviation of the crystal oscillator is avoided, thereby improving the clock accuracy of the RTC.

[0007] Optionally, cooling the RTC module and RTC oscillator includes: controlling the forward flow of current through the thermoelectric module to cool the RTC module and RTC oscillator; heating the RTC module and RTC oscillator includes: controlling the reverse flow of current through the thermoelectric module to heat the RTC module and RTC oscillator.

[0008] The thermoelectric module used in this application can achieve precise temperature control of ±0.1℃. The oscillator frequency of the RTC module is susceptible to temperature drift (e.g., an error of -30ppm / ℃), while the thermoelectric module can actively compensate for ambient temperature fluctuations, stabilizing the oscillator operating temperature within an ideal range (e.g., 25℃), significantly reducing timing errors.

[0009] Furthermore, the thermoelectric module has no mechanical parts and can switch between cooling and heating modes in milliseconds after being powered on. When the ambient temperature or the equipment's operating temperature changes abruptly, this characteristic can quickly offset thermal shocks and prevent the RTC from accumulating errors due to temperature variations.

[0010] Next, by reversing the current direction, the thermoelectric module can both cool and heat. In RTC applications, this feature can flexibly cope with extreme low temperature (such as winter) or high temperature (such as summer) environments, ensuring that the crystal oscillator of the RTC oscillator is always in the optimal operating temperature range, improving reliability throughout the year.

[0011] Finally, this application uses a thermoelectric module that eliminates the risk of refrigerant leakage, making it suitable for enclosed equipment. It can be integrated into a PCB with minimal space requirements and is vibration-free, making it suitable for scenarios sensitive to electromagnetic interference.

[0012] Optionally, after cooling the RTC module and RTC oscillator when the first temperature and / or the second temperature are higher than the first preset temperature threshold, the method further includes: stopping the cooling of the RTC module and RTC oscillator in response to both the first temperature and the second temperature being lower than the first preset temperature threshold.

[0013] Optionally, after heating the RTC module and RTC oscillator when the first temperature and / or the second temperature is lower than the second preset temperature threshold, the method further includes: stopping heating the RTC module and RTC oscillator in response to both the first temperature and the second temperature being higher than the second preset temperature threshold.

[0014] Optionally, the method further includes: determining a first predicted temperature of the RTC module and a second predicted temperature of the RTC oscillator at a future time based on a first historical temperature of the RTC module, a second historical temperature of the RTC oscillator, and a pre-trained temperature prediction model; cooling the RTC module and the RTC oscillator for a preset duration before the future time if the first predicted temperature and / or the second predicted temperature is higher than a first temperature threshold; and heating the RTC module and the RTC oscillator for a preset duration before the future time if the first predicted temperature and / or the second predicted temperature is lower than a second temperature threshold.

[0015] Optionally, the temperature prediction model is trained by: obtaining a training sample set; the training sample set includes multiple training samples, each training sample including the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, the first predicted temperature label of the RTC module at a future time, and the second predicted temperature label of the RTC oscillator at a future time; and training a preset initial model based on the training sample set to obtain the temperature prediction model.

[0016] The RTC temperature compensation method provided in this application can also utilize historical temperature data of the RTC module and RTC oscillator, as well as a pre-trained temperature prediction model, to predict the temperature of both in the future. It can also pre-start temperature control adjustment within a preset time before the predicted temperature exceeds the threshold, thereby achieving forward-looking and predictive temperature compensation. This can avoid the adjustment lag problem of real-time temperature control, further improve the timeliness and accuracy of temperature control, minimize the frequency deviation of the RTC oscillator, and continuously ensure the timing accuracy of the RTC module under complex operating conditions.

[0017] Secondly, this application provides an RTC temperature compensation device, which includes an acquisition module and a processing module.

[0018] The acquisition module is used to acquire the first temperature of the real-time clock (RTC) module and the second temperature of the RTC oscillator.

[0019] The processing module is configured to cool down the RTC module and the RTC oscillator when the first temperature and / or the second temperature is higher than the first preset temperature threshold; or to heat the RTC module and the RTC oscillator when the first temperature and / or the second temperature is lower than the second preset temperature threshold; wherein the second preset temperature threshold is less than or equal to the first preset temperature threshold.

[0020] Optionally, the processing module is specifically used to control the forward flow of current through the thermoelectric module to cool the RTC module and the RTC oscillator; or, to control the reverse flow of current through the thermoelectric module to heat the RTC module and the RTC oscillator.

[0021] Optionally, after cooling the RTC module and RTC oscillator when the first temperature and / or the second temperature are higher than the first preset temperature threshold, the processing module is further configured to stop cooling the RTC module and RTC oscillator in response to the first temperature and the second temperature being lower than the first preset temperature threshold.

[0022] Optionally, after heating the RTC module and RTC oscillator when the first temperature and / or the second temperature is lower than the second preset temperature threshold, the processing module is further configured to stop heating the RTC module and RTC oscillator in response to the first temperature and the second temperature both being higher than the second preset temperature threshold.

[0023] Optionally, the processing module is further configured to determine a first predicted temperature of the RTC module and a second predicted temperature of the RTC oscillator at a future time based on a first historical temperature of the RTC module, a second historical temperature of the RTC oscillator, and a pre-trained temperature prediction model; if the first predicted temperature and / or the second predicted temperature are higher than a first temperature threshold, cool the RTC module and the RTC oscillator for a preset duration before the future time; if the first predicted temperature and / or the second predicted temperature are lower than a second temperature threshold, heat the RTC module and the RTC oscillator for a preset duration before the future time.

[0024] Optionally, the acquisition module is also used to acquire a training sample set; the training sample set includes multiple training samples, each training sample including the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, the first predicted temperature label of the RTC module at a future time, and the second predicted temperature label of the RTC oscillator at a future time; the processing module is also used to train a preset initial model based on the training sample set to obtain a temperature prediction model.

[0025] Thirdly, this application provides an electronic device comprising: a processor and a memory; the memory storing instructions executable by the processor; the processor being configured to, when executing the instructions, cause the electronic device to perform the method provided in the first aspect above.

[0026] Fourthly, this application provides a readable storage medium comprising: software instructions; when the software instructions are executed in an electronic device, the electronic device causes the electronic device to implement the method provided in the first aspect above.

[0027] Fifthly, this application provides a computer program product including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method provided in the first aspect above.

[0028] The beneficial effects of aspects two through five above can be referred to in aspect one, and will not be repeated here. Attached Figure Description

[0029] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of the present invention and do not constitute a limitation on the technical solutions of the present invention.

[0030] Figure 1 This is a schematic diagram of the composition of the RTC temperature compensation system provided in the embodiments of this application; Figure 2 A schematic flowchart of the RTC temperature compensation method provided in the embodiments of this application; Figure 3 Another flowchart illustrating the RTC temperature compensation method provided in this application embodiment; Figure 4 A schematic flowchart illustrating the temperature prediction model training method provided in this application embodiment; Figure 5 This is a schematic diagram of the RTC temperature compensation process provided in an embodiment of this application; Figure 6 This is a schematic diagram of the composition of the RTC temperature compensation device provided in the embodiments of this application; Figure 7 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] Unless the context otherwise requires, throughout the specification and claims, the term "comprise" and other forms such as the third-person singular "comprises" and the present participle "comprising" are interpreted as open-ended and encompassing, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiments," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this application. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples.

[0033] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0034] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0035] In addition, the use of “based on” implies openness and inclusivity, because processes, steps, calculations or other actions “based on” one or more of the stated conditions or values ​​may in practice be based on additional conditions or values ​​beyond those stated.

[0036] Currently, timing functions in the electronic field are mainly achieved through real-time clock (RTC) counting. An RTC is a hardware module in electronic devices used to continuously and accurately record time and date.

[0037] However, the accuracy of the time determined by RTC counting needs to be improved.

[0038] Based on this, embodiments of this application provide an RTC temperature compensation method, apparatus, device, storage medium, and program product, which can perform constant temperature control on the RTC module and RTC oscillator to improve the accuracy of the time determined by RTC counting.

[0039] The following description is provided in conjunction with the accompanying drawings.

[0040] Figure 1 This is a schematic diagram illustrating the composition of the RTC temperature compensation system provided in an embodiment of this application. Figure 1 As shown, the RTC temperature compensation system may include: an RTC device 100, a temperature detection module 200, a processor 300, and a thermoelectric module 400.

[0041] RTC device 100 may include an RTC module and an RTC oscillator.

[0042] Temperature detection module 200 can be used to detect the temperature of (RTC device 100) (the first temperature of the RTC module and the second temperature of the RTC oscillator).

[0043] The processor 300 can be used to control the thermoelectric module 400 to regulate the temperature of the RTC device 100. For example, the processor 300 can control the thermoelectric module 400 to cool the RTC module and RTC oscillator when the first temperature and / or the second temperature is higher than a first preset temperature threshold; or, when the first temperature and / or the second temperature is lower than a second preset temperature threshold, control the thermoelectric module 400 to heat the RTC module and RTC oscillator. Specific procedures can be found in the following method embodiments, and will not be repeated here.

[0044] The RTC temperature compensation method provided in this application is implemented by an RTC temperature compensation device. This RTC temperature compensation device can be an electronic device equipped with an RTC module and an RTC oscillator (e.g., a charging pile); or, it can be another electronic device (e.g., a computer or server with computing capabilities) that is communicatively connected to the aforementioned electronic device equipped with an RTC module and an RTC oscillator.

[0045] The server can be a single server or a server cluster consisting of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. Optionally, the server can also be implemented on a cloud platform, such as a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, and multi-cloud, or any combination thereof. This application does not impose any limitations on these embodiments.

[0046] In some embodiments, the RTC temperature compensation device may also be a processor in the aforementioned electronic device (e.g., the one described above). Figure 1 The RTC temperature compensation device can be a processor 300 in the aforementioned electronic device; or, it can be an application (APP) with RTC temperature compensation function installed in the aforementioned electronic device; or, it can be a software system or platform deployed in the aforementioned electronic device; or, it can be a functional module in the aforementioned electronic device used to execute the RTC temperature compensation method, etc. This application does not limit these possibilities.

[0047] For the sake of simplicity, the following description will take the RTC temperature compensation device as the execution subject of the RTC temperature compensation method provided in the embodiments of this application as an example.

[0048] Figure 2 This is a schematic flowchart illustrating the RTC temperature compensation method provided in an embodiment of this application. Figure 2 As shown, the method may include the following steps: S101. Obtain the first temperature of the RTC module and the second temperature of the RTC oscillator.

[0049] As an example, a temperature sensor can be installed at the RTC module and the RTC oscillator, and the RTC temperature compensation device can acquire the first temperature and the second temperature collected by the temperature sensor.

[0050] S102, when the first temperature and / or the second temperature are higher than the first preset temperature threshold, the RTC module and the RTC oscillator are cooled down.

[0051] The first preset temperature threshold can be preset in the RTC temperature compensation device. For example, the first preset temperature threshold can be set to 28℃, 29℃, 30℃, or 31℃, etc. This application embodiment does not limit the specific value of the first preset temperature threshold.

[0052] As an example, an RTC temperature compensation device can cool the RTC module and RTC oscillator using a thermoelectric module. For instance, the RTC temperature compensation device can control the forward flow of current through the thermoelectric module to cool the RTC module and RTC oscillator.

[0053] In some embodiments, the RTC temperature compensation device may also stop cooling the RTC module and RTC oscillator in response to both the first temperature and the second temperature being lower than the first preset temperature threshold.

[0054] S103. When the first temperature and / or the second temperature are lower than the second preset temperature threshold, the RTC module and the RTC oscillator are heated.

[0055] The second preset temperature threshold is less than or equal to the first preset temperature threshold. For example, the second preset temperature threshold can be set to 18℃, 19℃, 20℃, 21℃, or 30℃, etc. This application embodiment does not limit the specific value of the second preset temperature threshold.

[0056] As an example, the RTC temperature compensation device can heat the RTC module and RTC oscillator via a thermoelectric module. For instance, the RTC temperature compensation device can control the current flowing in reverse through the thermoelectric module to heat the RTC module and RTC oscillator.

[0057] In some embodiments, the RTC temperature compensation device may also stop heating the RTC module and the RTC oscillator in response to both the first temperature and the second temperature being higher than a second preset temperature threshold.

[0058] In the RTC temperature compensation method provided in this application embodiment, the RTC temperature compensation device can obtain a first temperature of the RTC module and a second temperature of the RTC oscillator. If the first temperature and / or the second temperature is higher than a first preset temperature threshold, the device can cool the RTC module and the RTC oscillator; or, if the first temperature and / or the second temperature is lower than a second preset temperature threshold, the device can heat the RTC module and the RTC oscillator. The second preset temperature threshold is less than or equal to the first preset temperature threshold. This allows for real-time temperature monitoring of the RTC module and the RTC oscillator, achieving dynamic balance adjustment and ensuring that the RTC module and the RTC oscillator always operate within the set temperature threshold range. By ensuring a constant operating temperature, frequency deviation of the crystal oscillator is avoided, thereby improving the clock accuracy of the RTC.

[0059] Furthermore, the thermoelectric module used in this embodiment can achieve precise temperature control of ±0.1℃. The oscillator frequency of the RTC module is susceptible to temperature drift (e.g., an error of -30ppm / ℃), while the thermoelectric module can actively compensate for ambient temperature fluctuations, stabilizing the oscillator operating temperature within an ideal range (e.g., 25℃), significantly reducing timing errors.

[0060] Furthermore, the thermoelectric module has no mechanical parts and can switch between cooling and heating modes in milliseconds after being powered on. When the ambient temperature or the equipment's operating temperature changes abruptly, this characteristic can quickly offset thermal shocks and prevent the RTC from accumulating errors due to temperature variations.

[0061] Next, by reversing the current direction, the thermoelectric module can both cool and heat. In RTC applications, this feature can flexibly cope with extreme low temperature (such as winter) or high temperature (such as summer) environments, ensuring that the crystal oscillator of the RTC oscillator is always in the optimal operating temperature range, improving reliability throughout the year.

[0062] Finally, the thermoelectric module used in this application has no risk of refrigerant leakage, is suitable for sealed equipment, can be integrated into a PCB, occupies less space, and is vibration-free, making it suitable for scenarios sensitive to electromagnetic interference.

[0063] In some possible embodiments, the RTC temperature compensation device can also preemptively adjust the temperature in case the RTC module and RTC oscillator are predicted to be too hot or too cold. In this case, Figure 3 This is another schematic flowchart illustrating the RTC temperature compensation method provided in an embodiment of this application. Figure 3 As shown, the method may also include the following steps: S201. Based on the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, and the pre-trained temperature prediction model, determine the first predicted temperature of the RTC module and the second predicted temperature of the RTC oscillator at future times.

[0064] The temperature prediction model has the function of predicting the future temperature based on the historical temperature of the RTC module and RTC oscillator. The specific training process of the temperature prediction model can be referred to in the following embodiments, and will not be repeated here.

[0065] S202, if the first predicted temperature and / or the second predicted temperature are higher than the first temperature threshold, the RTC module and the RTC oscillator are cooled down within a preset time period before a future time.

[0066] The preset duration can be preset in the RTC temperature compensation device. For example, the preset duration can be set to 1 minute, 3 minutes, 5 minutes, or 10 minutes, etc. This application embodiment does not limit the specific duration of the preset duration.

[0067] S203, if the first predicted temperature and / or the second predicted temperature are lower than the second temperature threshold, heat the RTC module and the RTC oscillator for a preset duration before a future time.

[0068] In some possible embodiments, prior to S201 above, the RTC temperature compensation device may also acquire a pre-trained temperature prediction model.

[0069] In one possible implementation, the RTC temperature compensation device can directly download or transfer a pre-trained temperature prediction model from other devices via an intermediate storage medium.

[0070] In another possible implementation, the RTC temperature compensation device can also be trained to obtain a temperature prediction model.

[0071] For example, Figure 4 This is a flowchart illustrating the temperature prediction model training method provided in an embodiment of this application. Figure 4 As shown, the training process for a temperature prediction model can include the following steps: S301. Obtain the training sample set.

[0072] The training sample set includes multiple training samples. Each training sample includes the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, the first predicted temperature label of the RTC module at a future time, and the second predicted temperature label of the RTC oscillator at a future time.

[0073] S302. Train the preset initial model based on the training sample set to obtain the temperature prediction model.

[0074] As an example, the initial model can be a Long Short-Term Memory network (LSTM) model.

[0075] As an example, the RTC temperature compensation device can input one or more training samples into the initial model each time to obtain the first predicted temperature and the second predicted temperature output by the initial model. Then, based on the deviation between the first predicted temperature and the first predicted temperature label, and the deviation between the second predicted temperature and the second predicted temperature label, a loss function is calculated, and the parameters in the initial model are adjusted based on the loss function until the iteration stopping condition is met, thus obtaining a pre-trained temperature prediction model.

[0076] Optionally, the iteration stopping condition may include: the number of times the training samples are input into the initial model reaches a threshold, and / or the error of the initial model is less than an error threshold.

[0077] The number of cycles threshold can be preset in the RTC temperature compensation device. For example, the number of cycles threshold can be set to 500, 1000, 5000, or 10000. This application embodiment does not limit the specific value of the number of cycles threshold. The error threshold can also be preset in the RTC temperature compensation device. For example, the error threshold can be set to 5%, 10%, 15%, or 20%. This application embodiment does not limit the specific value of the error threshold.

[0078] In the RTC temperature compensation method provided in this application embodiment, the RTC temperature compensation device can also use the historical temperature data of the RTC module and the RTC oscillator and the pre-trained temperature prediction model to predict the temperature of the two in the future. The temperature control adjustment is initiated in advance within a preset time before the predicted temperature exceeds the threshold, so as to realize forward-looking and predictive temperature compensation. This can avoid the adjustment lag problem of real-time temperature control, further improve the timeliness and accuracy of temperature control, minimize the frequency deviation of the RTC oscillator, and continuously ensure the timing accuracy of the RTC module under complex working conditions.

[0079] Based on the understanding of the above embodiments, Figure 5 This is a schematic diagram of the RTC temperature compensation process provided in an embodiment of this application. Figure 5 As shown, the RTC temperature compensation process may include the following steps: The S401, RTC module, and RTC oscillator are working normally.

[0080] S402. Detect whether the ambient temperature of the RTC module and RTC oscillator exceeds the temperature threshold.

[0081] If not, execute S403; if yes, execute S404.

[0082] S403, Continue monitoring the temperature.

[0083] S404. Determine whether the temperature is higher than the first temperature threshold or lower than the second temperature threshold.

[0084] If the temperature is higher than the first temperature threshold, then execute S405; if the temperature is lower than the second temperature threshold, then execute S406.

[0085] S405, control the forward flow of current through the thermoelectric module to cool the RTC module and RTC oscillator.

[0086] S406. Control the reverse flow of current through the thermoelectric module to heat the RTC module and RCT oscillator.

[0087] After executing S405 or S406, you can return to S402 for closed-loop control.

[0088] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the aforementioned functions, each device, such as an RTC temperature compensation device, includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Experts may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0089] This application embodiment can divide the RTC temperature compensation device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one functional module. The integrated module can be implemented in hardware or software. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. The following description uses the example of dividing each functional module according to each function.

[0090] In an exemplary embodiment, this application provides an RTC temperature compensation device. Figure 6 This is a schematic diagram illustrating the composition of the RTC temperature compensation device provided in an embodiment of this application. Figure 6 As shown, the control device may include an acquisition module 601 and a processing module 602.

[0091] The acquisition module 601 is used to acquire the first temperature of the real-time clock (RTC) module and the second temperature of the RTC oscillator.

[0092] The processing module 602 is used to cool down the RTC module and the RTC oscillator when the first temperature and / or the second temperature is higher than the first preset temperature threshold; or to heat the RTC module and the RTC oscillator when the first temperature and / or the second temperature is lower than the second preset temperature threshold; wherein the second preset temperature threshold is less than or equal to the first preset temperature threshold.

[0093] In some possible embodiments, the processing module 602 is specifically configured to control the forward flow of current through the thermoelectric module to cool the RTC module and the RTC oscillator; or, to control the reverse flow of current through the thermoelectric module to heat the RTC module and the RTC oscillator.

[0094] In some possible embodiments, after cooling the RTC module and RTC oscillator when the first temperature and / or the second temperature are higher than the first preset temperature threshold, the processing module 602 is further configured to stop cooling the RTC module and RTC oscillator in response to the first temperature and the second temperature being lower than the first preset temperature threshold.

[0095] In some possible embodiments, after heating the RTC module and RTC oscillator when the first temperature and / or the second temperature is lower than the second preset temperature threshold, the processing module 602 is further configured to stop heating the RTC module and RTC oscillator in response to the first temperature and the second temperature both being higher than the second preset temperature threshold.

[0096] In some possible embodiments, the processing module 602 is further configured to determine a first predicted temperature of the RTC module and a second predicted temperature of the RTC oscillator at a future time based on a first historical temperature of the RTC module, a second historical temperature of the RTC oscillator, and a pre-trained temperature prediction model; if the first predicted temperature and / or the second predicted temperature are higher than a first temperature threshold, cool the RTC module and the RTC oscillator for a preset duration before the future time; if the first predicted temperature and / or the second predicted temperature are lower than the second temperature threshold, heat the RTC module and the RTC oscillator for a preset duration before the future time.

[0097] In some possible embodiments, the acquisition module 601 is further configured to acquire a training sample set; the training sample set includes multiple training samples, each training sample including a first historical temperature of the RTC module, a second historical temperature of the RTC oscillator, a first predicted temperature label of the RTC module at a future time, and a second predicted temperature label of the RTC oscillator at a future time; the processing module 602 is further configured to train a preset initial model based on the training sample set to obtain a temperature prediction model.

[0098] It should be noted that the above Figure 6 Modules in a module can also be called units; for example, a processing module can be called a processing unit. Additionally, in... Figure 6 In the embodiments shown, the names of the modules may not be the same as those shown in the figure. For example, the acquisition module may also be called the transceiver module or the communication module.

[0099] Figure 6 If the various modules in the application are implemented as software functional modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of software products. These software products are stored in a storage medium and include several instructions to cause an electronic device (which may be a mobile phone, personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0100] In an exemplary embodiment, this application also provides an electronic device. Figure 7 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device includes a processor 702, a communication interface 703, and a bus 704. As an example, the electronic device may also include a memory 701.

[0101] Processor 702 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 702 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 702 may also be a combination that implements computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0102] The communication interface 703 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0103] The memory 701 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0104] As one possible implementation, the memory 701 can exist independently of the processor 702. The memory 701 can be connected to the processor 702 via a bus 704 and is used to store instructions or program code. When the processor 702 calls and executes the instructions or program code stored in the memory 701, it can implement the RTC temperature compensation method provided in this application embodiment.

[0105] In another possible implementation, the memory 701 can also be integrated with the processor 702.

[0106] The 704 bus can be an extended industry standard architecture (EISA) bus, etc. The 704 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0107] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the RTC temperature compensation device can be divided into different functional modules to complete all or part of the functions described above.

[0108] In an exemplary embodiment, this application also provides a readable storage medium including software instructions that, when executed in an electronic device, cause the electronic device to implement the methods described in the above embodiments. The readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device. Further, the readable storage medium can include both internal storage units and external storage devices of the electronic device. The readable storage medium is used to store the software instructions and other programs and data required by the electronic device. The readable storage medium can also be used to temporarily store data that has been output or will be output.

[0109] In an exemplary embodiment, this application also provides a computer program product including computer instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the above method embodiments.

[0110] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer-executable instructions. When these computer-executable instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer-executable instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, Bluetooth, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape) or an optical medium (e.g., DVD), etc.

[0111] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0112] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

[0113] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An RTC temperature compensation method, characterized in that, The method includes: Obtain the first temperature of the real-time clock (RTC) module and the second temperature of the RTC oscillator; If the first temperature and / or the second temperature is higher than a first preset temperature threshold, the RTC module and the RTC oscillator are cooled down; or... When the first temperature and / or the second temperature is lower than the second preset temperature threshold, the RTC module and the RTC oscillator are heated; the second preset temperature threshold is less than or equal to the first preset temperature threshold.

2. The method according to claim 1, characterized in that, The cooling of the RTC module and the RTC oscillator includes: Control the forward flow of current through the thermoelectric module to cool the RTC module and the RTC oscillator; The heating of the RTC module and the RTC oscillator includes: The current flowing through the thermoelectric module is controlled to flow in reverse to heat the RTC module and the RTC oscillator.

3. The method according to claim 1, characterized in that, After cooling the RTC module and the RTC oscillator when the first temperature and / or the second temperature is higher than a first preset temperature threshold, the method further includes: In response to both the first temperature and the second temperature being lower than the first preset temperature threshold, the cooling of the RTC module and the RTC oscillator is stopped.

4. The method according to claim 1, characterized in that, After heating the RTC module and the RTC oscillator when the first temperature and / or the second temperature is lower than a second preset temperature threshold, the method further includes: In response to both the first temperature and the second temperature being higher than the second preset temperature threshold, heating of the RTC module and the RTC oscillator is stopped.

5. The method according to claim 1, characterized in that, The method further includes: Based on the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, and the pre-trained temperature prediction model, determine the first predicted temperature of the RTC module at a future time and the second predicted temperature of the RTC oscillator at that future time. If the first predicted temperature and / or the second predicted temperature are higher than the first temperature threshold, the RTC module and the RTC oscillator are cooled down within a preset time period before the future time. If the first predicted temperature and / or the second predicted temperature are lower than the second temperature threshold, the RTC module and the RTC oscillator are heated for a preset period of time before the future time.

6. The method according to claim 4, characterized in that, The temperature prediction model was trained in the following way: Obtain a training sample set; the training sample set includes multiple training samples, each of which includes the first historical temperature of the RTC module, the second historical temperature of the RTC oscillator, the first predicted temperature label of the RTC module at a future time, and the second predicted temperature label of the RTC oscillator at the future time. The temperature prediction model is obtained by training the preset initial model based on the training sample set.

7. An RTC temperature compensation device, characterized in that, include: Acquisition module and processing module; The acquisition module is used to acquire the first temperature of the real-time clock (RTC) module and the second temperature of the RTC oscillator. The processing module is configured to cool down the RTC module and the RTC oscillator when the first temperature and / or the second temperature is higher than a first preset temperature threshold; or to heat the RTC module and the RTC oscillator when the first temperature and / or the second temperature is lower than a second preset temperature threshold. The second preset temperature threshold is less than or equal to the first preset temperature threshold.

8. An electronic device, characterized in that, The electronic device includes: a memory and a processor; The memory stores instructions that the processor can execute; When the processor is configured to execute the instructions, the electronic device performs the method as described in any one of claims 1-6.

9. A readable storage medium, characterized in that, include: Software instructions; When the software instructions are executed in an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, include: Computer instructions; When the computer instructions are executed in an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-6.