Low-frequency clock calibration method, device, equipment and medium
By obtaining the temperature and frequency difference before and after sleep of the terminal device, the second hardware calibration is performed, which solves the problem of synchronization failure of low-frequency clock calibration under changes in temperature and channel environment, and achieves effective calibration of the low-frequency clock and terminal equipment. Improved stability.
Patent Information
- Application Number
- CN202311817579.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2024-10-22
AI Technical Summary
Existing low-frequency clock calibration methods are prone to synchronization failures under the influence of factors such as temperature changes and channel environment changes, and cannot effectively reduce low-frequency clock frequency deviations, causing terminal devices to lose network during sleep.
By obtaining the temperature before and after sleep of the terminal device and the calibration frequency of the low-frequency clock, it is determined whether the temperature and frequency difference exceeds the preset threshold. If it exceeds the preset threshold, a second hardware calibration is performed to complete the synchronization calibration and ensure that the duration is shorter than the business processing time to avoid increased power consumption.
It achieves synchronous calibration of low-frequency clocks, reduces frequency deviations caused by changes in temperature and channel environment, avoids terminal equipment losing network during sleep, and improves the performance and reliability of terminal equipment.
Smart Images

Figure CN118828845A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Internet of Things technology, and in particular relates to a low-frequency clock calibration method, apparatus, device, and medium. Background Art
[0002] Narrowband Internet of Things (NB-IoT) addresses the inability of traditional 2G / 3G / 4G (GPRS) networks to meet the low-power and low-cost requirements of IoT terminal devices. Existing NB-IoT terminal implementations typically use a high-frequency crystal oscillator (e.g., 38.4 MHz) as the system clock for wakeup. Furthermore, when the terminal device is in sleep mode, the high-frequency clock is disabled to reduce power consumption, and a low-frequency clock is used for timing. Because the clock is affected by temperature and other factors, the low-frequency clock frequency can deviate from its nominal frequency. Therefore, the low-frequency clock must be calibrated to reduce this deviation and improve terminal performance.
[0003] There are two common methods for low-frequency clock calibration: hardware calibration and software calibration based on timing deviation. Hardware clock calibration uses a high-frequency stable system clock as a reference to calculate the frequency of the low-frequency clock crystal. The calculation duration is usually not an integer multiple of the high-frequency clock, which may result in calibration errors. The disadvantages of software calibration based on synchronization deviation are: first, this method assumes that the timing deviation before and after sleep is only due to inaccurate low-frequency clocks. However, in actual network environments, timing deviations may also be caused by changes in the channel environment or changes in the transmission distance between the terminal and the base station, and this calibration method may make incorrect adjustments. Second, when the low-frequency clock drifts significantly due to factors such as temperature, it may also exceed the range of the timing synchronization algorithm, resulting in synchronization failure.
[0004] Therefore, the low-frequency clock calibration method in the prior art may cause synchronization failure. Summary of the Invention
[0005] The embodiments of the present application provide a low-frequency clock calibration method, apparatus, device, and medium, which implement synchronous calibration of a low-frequency clock.
[0006] In a first aspect, an embodiment of the present application provides a low-frequency clock calibration method, the method comprising:
[0007] Obtaining the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle;
[0008] When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to a second preset threshold, performing a second hardware calibration according to a second duration to complete the synchronous calibration;
[0009] Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
[0010] In an optional implementation of the first aspect, the method further includes:
[0011] Obtain the synchronization error of the time synchronization after the terminal device wakes up in the N-1th paging cycle;
[0012] When the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold, and / or the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is less than a second preset threshold, determining a synchronization error range according to the post-sleep calibration frequency and the post-sleep temperature;
[0013] When the synchronization error is within the synchronization error range, synchronization error calibration is performed.
[0014] In an optional implementation of the first aspect, the method further includes:
[0015] If the synchronization error is not within the synchronization error range, the synchronization error is deleted.
[0016] In an optional implementation of the first aspect, determining the synchronization error range according to the post-sleep calibration frequency and the post-sleep temperature includes:
[0017] Determine the error range of the low-frequency clock based on the post-sleep calibration frequency and the frequency of the high-frequency clock;
[0018] The synchronization error range is determined based on the error range of the low-frequency clock and the temperature after sleep.
[0019] In an optional implementation of the first aspect, it is characterized in that before performing the second hardware calibration according to the second duration to complete the synchronization calibration, the method further includes:
[0020] Get the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock;
[0021] The second duration is calculated based on the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock.
[0022] In an optional implementation of the first aspect, the second duration is calculated according to the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization, and the frequency of the high-frequency clock, satisfying the following relationship:
[0023] Second duration>sleep duration / (frequency of high-frequency clock*time range of time synchronization).
[0024] In a second aspect, an embodiment of the present application provides a low-frequency clock calibration device, the device comprising:
[0025] An acquisition module is configured to acquire the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle;
[0026] A calibration module, configured to, when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to a second preset threshold, perform a second hardware calibration according to a second duration to obtain a pre-sleep calibration frequency of the low-frequency clock of the terminal device before sleep in the Nth paging cycle;
[0027] Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
[0028] In a third aspect, an embodiment of the present application provides a low-frequency clock calibration device, the device comprising:
[0029] A temperature reading module is used to obtain the pre-sleep temperature and post-sleep temperature of the terminal device in the N-1th paging cycle;
[0030] A hardware calibration circuit is configured to perform a first hardware calibration to obtain a pre-sleep calibration frequency of the low-frequency clock in an N-1th paging cycle and a post-sleep calibration frequency of the low-frequency clock in an Nth paging cycle;
[0031] a calibration strategy module, configured to determine whether a difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and whether a difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold;
[0032] The hardware calibration circuit is further configured to, when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold, perform a second hardware calibration according to a second duration to obtain a pre-sleep calibration frequency of the low-frequency clock of the terminal device before sleep in the Nth paging cycle;
[0033] Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
[0034] In an optional implementation of the third aspect, the apparatus further includes a time synchronization algorithm module;
[0035] The calibration strategy module is further configured to determine a synchronization error range based on the post-sleep temperature and the post-sleep calibration frequency when the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold, and / or the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is less than a second preset threshold;
[0036] The time synchronization algorithm module is used to calibrate the synchronization error when the synchronization error is within the synchronization error range.
[0037] In a fourth aspect, an embodiment of the present application provides a low-frequency clock calibration device, which includes a low-frequency clock calibration apparatus provided by any optional implementation in the third aspect above.
[0038] In a fifth aspect, an electronic device is provided, comprising: a memory for storing computer program instructions; and a processor for reading and running the computer program instructions stored in the memory to execute the low-frequency clock calibration method provided by any optional implementation in the first aspect.
[0039] In a sixth aspect, a computer storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the low-frequency clock calibration method provided by any optional implementation method in the first aspect is implemented.
[0040] In a seventh aspect, a computer program product is provided. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the low-frequency clock calibration method provided by any optional implementation method in the first aspect.
[0041] In an embodiment of the present application, the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle can be obtained. When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, that is, when a large change occurs in the low-frequency clock, a second hardware calibration is performed according to the second duration to complete the synchronous calibration. In this way, since the duration of the short hardware calibration is shorter than the service transmission time, the power consumption of the terminal device will not be increased, and when it is determined through the short hardware calibration that a large change occurs in the low-frequency clock, a long hardware calibration is performed, which not only realizes the synchronous calibration of the low-frequency clock, but also reduces the problem of the terminal device losing the network during the terminal entering sleep due to factors such as changes in the channel environment or changes in the transmission distance between the terminal and the base station, large temperature changes, etc., due to large deviations in the low clock frequency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0043] Figure 1 This is an architectural diagram of a low-frequency clock calibration device provided in an embodiment of the present application;
[0044] Figure 2 This is a flow chart of a low-frequency clock calibration method provided in an embodiment of the present application;
[0045] Figure 3 This is a timing diagram of a low-frequency clock calibration provided by an embodiment of the present application;
[0046] Figure 4 Which embodiment of the present application provides a flowchart of a low-frequency clock calibration method?
[0047] Figure 5 This is a schematic structural diagram of a low-frequency clock calibration device provided in an embodiment of the present application;
[0048] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.
[0050] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0051] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0052] In order to solve the problems existing in the above-mentioned prior art, the embodiments of the present application provide a low-frequency clock calibration method, apparatus, device and medium, which can obtain the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle. When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, indicating that the low-frequency clock has undergone a large change, a second hardware calibration is performed according to the second duration to complete the synchronization calibration. In this way, since the duration of short hardware calibration is shorter than the service transmission time, the power consumption of the terminal device will not be increased. In addition, when it is determined through short hardware calibration that the low-frequency clock has changed significantly, long hardware calibration is performed. This not only realizes the synchronous calibration of the low-frequency clock, but also reduces the problem of the terminal device losing the network during the terminal entering sleep due to factors such as changes in the channel environment or changes in the transmission distance between the terminal and the base station, large temperature changes, etc., due to large low clock frequency deviations.
[0053] Based on this, an embodiment of the present application provides a low-frequency clock calibration device, which may include a low-frequency clock calibration apparatus. The low-frequency clock calibration apparatus provided in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.
[0054] Figure 1 This is an architectural diagram of a low-frequency clock calibration device provided in an embodiment of the present application.
[0055] like Figure 1 As shown, the low-frequency clock calibration apparatus 100 may include a temperature reading module 11, a hardware calibration circuit 12, and a calibration strategy module 13. The temperature reading module 11 and the hardware calibration circuit 12 may both be connected to the calibration strategy module 13. It should also be noted that the temperature reading module 11 is a hardware circuit, while the calibration strategy module 13 is a software module. These details will not be elaborated upon here.
[0056] Based on this, the temperature reading module 11 is used to obtain the pre-sleep temperature of the terminal device and the post-sleep temperature of the terminal device in the N-1th paging cycle;
[0057] The hardware calibration circuit 12 is configured to perform a first hardware calibration to obtain a pre-sleep calibration frequency of the low-frequency clock in the N-1th paging cycle and a post-sleep calibration frequency of the low-frequency clock in the Nth paging cycle;
[0058] a calibration strategy module 13, configured to determine whether the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and whether the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold;
[0059] The first preset threshold may be a temperature threshold preset based on actual experience or circumstances, which is not specifically limited herein. The second preset threshold may be an efficiency threshold preset based on actual experience or circumstances, which is not specifically limited herein.
[0060] The hardware calibration circuit 12 is further configured to perform a second hardware calibration for a second duration to complete the synchronous calibration when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold;
[0061] Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
[0062] In addition, continue as Figure 1 As shown, the low-frequency clock calibration device 100 mentioned above may further include a time synchronization algorithm module 14 , and the time synchronization algorithm module 14 may be connected to the calibration strategy module 13 .
[0063] Based on this, the calibration strategy module 13 is further configured to determine a synchronization error range based on the post-sleep temperature and the post-sleep calibration frequency when the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold, and / or when the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is less than a second preset threshold;
[0064] The time synchronization algorithm module 14 is configured to perform synchronization error calibration when the synchronization error is within the synchronization error range.
[0065] Based on the above low-frequency clock calibration device architecture diagram, the following can be combined with Figure 2 A flowchart of a low-frequency clock calibration method is provided for an embodiment of the present application.
[0066] like Figure 2 As shown, the execution subject of the low-frequency clock calibration method may be a low-frequency clock calibration device, and the method may specifically include the following steps:
[0067] S210, obtain the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle.
[0068] Among them, N is a positive integer greater than 1. The paging cycle involved above can be determined according to actual conditions. The paging cycle can include the wake-up time and sleep time of the terminal device, and no further restrictions are made here.
[0069] The terminal devices mentioned above may include narrowband Internet of Things terminals, which are not limited here.
[0070] Specifically, the low-frequency clock calibration device can read the pre-sleep temperature (emperatureBeforeSleep) of the terminal device before the sleep time of the N-1th paging cycle of the terminal device, and obtain the pre-sleep calibration frequency (FreqCalibrateShortBeforeSleep) of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle by performing a first hardware calibration. And after the sleep time of the N-1th paging cycle of the terminal device, the terminal device can be read after the sleep temperature (TemperatureAfterSleep), and obtain the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle by performing a first hardware calibration.
[0071] In one example, if Figure 3 As shown, the Figure 3 This section describes the timing diagram for clock calibration between paging cycle N-1 (paging cycle N-1), paging cycle N, and paging cycle N+1. Reference numeral 31 indicates the pre-sleep temperature of the terminal device during paging cycle N-1, and reference numeral 32 indicates the post-sleep temperature of the terminal device during paging cycle N-1.
[0072] S220, when the difference between the temperature before sleep and the temperature after sleep is greater than or equal to the first preset threshold, and the difference between the calibration frequency after sleep and the calibration frequency before sleep is greater than or equal to the second preset threshold, perform a second hardware calibration according to the second duration to complete the synchronous calibration.
[0073] The first hardware calibration can be a short hardware calibration, i.e., the first duration of the first hardware calibration is less than the service processing time after the terminal device wakes up within each paging cycle, and the second hardware calibration can be a long hardware calibration, i.e., the second duration is greater than the first duration. It should be noted that the short hardware calibration and the long hardware calibration differ only in the length of the required calibration time.
[0074] In addition, the first preset threshold mentioned above may be a temperature threshold preset based on actual experience or circumstances, which is not limited here. The second preset threshold mentioned above may be a frequency threshold preset based on actual experience or circumstances, which is not limited here.
[0075] Specifically, the low-frequency clock calibration device can obtain the pre-sleep temperature, post-sleep temperature, pre-sleep frequency and post-sleep frequency. If the difference between the above-mentioned pre-sleep temperature and post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the above-mentioned pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, it indicates that the low-frequency clock has undergone a large change, which may be beyond the estimation range of the synchronization algorithm or the synchronization error calibration calculation range. Based on this, the low-frequency clock calibration device can perform a second hardware calibration according to the second time length to complete the synchronization calibration.
[0076] In one example, continue as Figure 3 As shown, if the difference between the above-mentioned pre-sleep temperature and the post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the above-mentioned pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, the low-frequency clock calibration device can perform a second hardware calibration according to the second duration in the Nth paging cycle to complete the synchronization calibration.
[0077] In an embodiment of the present application, the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle can be obtained. When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, that is, when a large change occurs in the low-frequency clock, a second hardware calibration is performed according to the second duration to complete the synchronous calibration. In this way, since the duration of the short hardware calibration is shorter than the service transmission time, the power consumption of the terminal device will not be increased, and when it is determined through the short hardware calibration that a large change occurs in the low-frequency clock, a long hardware calibration is performed, which not only realizes the synchronous calibration of the low-frequency clock, but also reduces the problem of the terminal device losing the network during the terminal entering sleep due to factors such as changes in the channel environment or changes in the transmission distance between the terminal and the base station, large temperature changes, etc., due to large deviations in the low clock frequency.
[0078] In one embodiment, Figure 4 As shown, the low-frequency clock calibration method mentioned above may further include the following steps:
[0079] S410, obtaining a synchronization error of time synchronization after the terminal device wakes up in the N-1th paging cycle.
[0080] Specifically, the low-frequency clock calibration device can perform time synchronization after the terminal device wakes up in the N-1th paging cycle to obtain the synchronization error of the time synchronization after the terminal device wakes up.
[0081] S420, when the difference between the temperature before sleep and the temperature after sleep is less than the first preset threshold, and / or the difference between the calibration frequency before sleep and the calibration frequency after sleep is less than the second preset threshold, determine the synchronization error range based on the calibration frequency after sleep and the temperature after sleep.
[0082] Specifically, after obtaining the pre-sleep temperature, post-sleep temperature, pre-sleep calibration frequency and post-sleep calibration frequency, if the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold, and / or the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is less than a second preset threshold, the low-frequency clock calibration device can determine the synchronization error range based on the post-sleep calibration frequency and the post-sleep temperature.
[0083] S430: When the synchronization error is within the synchronization error range, perform synchronization error calibration.
[0084] When the synchronization error of the time synchronization after the terminal device wakes up in the N-1th paging cycle and the synchronization error range are obtained, if the synchronization error is within the synchronization error range, the low-frequency clock calibration device can perform synchronization error calibration.
[0085] In this embodiment, if the difference between the temperature before sleep and the temperature after sleep is less than the first preset threshold, and the difference between the calibration frequency before sleep and the calibration frequency after sleep is less than the second preset threshold, it indicates that the low-frequency clock has not changed significantly. Based on this, if the synchronization error is within the synchronization error range, it indicates whether the synchronization error is caused by a change in the low-frequency clock, and then synchronization error calibration can be performed.
[0086] In one embodiment, the low-frequency clock calibration method mentioned above may further include the following method:
[0087] If the synchronization error is not within the synchronization error range, the synchronization error is deleted.
[0088] Specifically, when obtaining the synchronization error of the time synchronization after the terminal device wakes up in the N-1th paging cycle and the synchronization error range, if the above synchronization error is not within the above synchronization error range, the low-frequency clock calibration device can delete the synchronization error.
[0089] In this embodiment, if the synchronization error is no longer within the synchronization error range, it indicates that the synchronization error is not caused by the change of the low-frequency clock. Based on this, the synchronization error can be deleted and synchronization error calibration is not performed.
[0090] In one embodiment, the above-mentioned step of determining the synchronization error range based on the post-sleep calibration frequency and the post-sleep temperature may specifically include the following steps:
[0091] Determine the error range of the low-frequency clock based on the post-sleep calibration frequency and the frequency of the high-frequency clock;
[0092] The synchronization error range is determined based on the error range of the low-frequency clock and the temperature after sleep.
[0093] Specifically, the low-frequency clock calibration device can determine the error range of the low-frequency clock based on the post-sleep calibration frequency and the frequency of the high-frequency clock, and further determine the synchronization error range according to the error range of the low-frequency clock and the post-sleep temperature.
[0094] In this embodiment, the synchronization error range can be accurately determined by the post-sleep calibration frequency, the frequency of the high-frequency clock, and the post-sleep temperature, so that it can be accurately determined whether the synchronization deviation is caused by the low-frequency clock change based on the synchronization error range.
[0095] In one embodiment, before performing the second hardware calibration according to the second duration to complete the synchronization calibration, the low-frequency clock calibration method may further include the following steps:
[0096] Get the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock;
[0097] The second duration is calculated based on the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock.
[0098] Specifically, the low-frequency clock calibration device can perform a second hardware calibration according to the second duration, and before completing the synchronization calibration, obtain the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock, and then calculate the second duration based on the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock.
[0099] In this embodiment, the second duration can be calculated based on the sleep duration of the terminal device, the time range of time synchronization, and the frequency of the high-frequency clock during the Nth paging cycle. This ensures that the wake-up time deviation of the next cycle is within the estimated range, and can also be shortened as much as possible, thereby reducing power consumption.
[0100] In one embodiment, the second duration is calculated based on the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization, and the frequency of the high-frequency clock, and the following relationship is satisfied:
[0101] Second duration > sleep duration / (frequency of high-frequency clock * time synchronization time range)
[0102] In this embodiment, the second duration can be determined by the sleep duration of the terminal device in the next paging cycle, as well as the duration range of time synchronization and the frequency of the high-frequency clock. In this way, it can not only ensure that the wake-up time deviation of the next cycle is within the estimated range, but also shorten the time as much as possible and reduce power consumption.
[0103] Based on the same inventive concept, the embodiment of the present application also provides a low-frequency clock calibration device. Figure 5 The low-frequency clock calibration device provided in the embodiment of the present application is described in detail.
[0104] Figure 5 It is a structural diagram of a low-frequency clock calibration device provided in an embodiment of the present application.
[0105] like Figure 5 As shown, the low-frequency clock calibration device 500 may include: an acquisition module 510 and a calibration module 520
[0106] An acquisition module 510 is configured to acquire a pre-sleep temperature of the terminal device in the N-1th paging cycle, a pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, a post-sleep temperature of the terminal device in the N-1th paging cycle, and a post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle;
[0107] a calibration module 520 configured to perform a second hardware calibration for a second duration to complete synchronization calibration when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to a second preset threshold;
[0108] Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
[0109] In one embodiment, the low-frequency clock calibration device may include a determination module.
[0110] Based on this, the above acquisition module is also used to obtain the synchronization error of the time synchronization after the terminal device wakes up in the N-1th paging cycle;
[0111] a determination module, configured to determine a synchronization error range based on the post-sleep calibration frequency and the post-sleep temperature when the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold and / or the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is less than a second preset threshold;
[0112] The calibration module is used to perform synchronization error calibration when the synchronization error is within the synchronization error range.
[0113] In one embodiment, the low-frequency clock calibration device mentioned above may further include a deletion module.
[0114] The deletion module is used to delete the synchronization error when the synchronization error is not within the synchronization error range.
[0115] In one embodiment, the aforementioned determination module is specifically configured to:
[0116] Determine the error range of the low-frequency clock based on the post-sleep calibration frequency and the frequency of the high-frequency clock;
[0117] The synchronization error range is determined based on the error range of the low-frequency clock and the temperature after sleep.
[0118] In one embodiment, the low-frequency clock calibration device mentioned above may further include a calculation module.
[0119] The acquisition module is further configured to obtain the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization, and the frequency of the high-frequency clock before performing the second hardware calibration according to the second duration to complete the synchronization calibration;
[0120] The calculation module is used to calculate the second duration according to the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock.
[0121] In one embodiment, the calculation modules involved above satisfy the following relationship:
[0122] Second duration>sleep duration / (frequency of high-frequency clock*time range of time synchronization).
[0123] In an embodiment of the present application, the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the Nth paging cycle can be obtained. When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to the first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to the second preset threshold, it indicates that the low-frequency clock has undergone a large change, and a second hardware calibration is performed according to the second duration to complete the synchronization calibration. In this way, since the duration of the short hardware calibration is shorter than the service transmission time, the power consumption of the terminal device will not be increased, and when the low-frequency clock undergoes a large change, a long hardware calibration is performed, which reduces the problem of the terminal device losing the network during the terminal entering sleep due to large temperature changes and large low clock frequency deviations.
[0124] Each module in the low-frequency clock calibration device provided in the embodiment of the present application can achieve Figure 2 or Figure 4 The method steps of the illustrated embodiment can achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.
[0125] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0126] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.
[0127] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0128] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 602 may include removable or non-removable (or fixed) media. Where appropriate, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0129] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0130] The processor 601 reads and executes computer program instructions stored in the memory 602 to implement any one of the low-frequency clock calibration methods in the above embodiments.
[0131] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0132] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0133] Bus 610 includes hardware, software or both, and the parts of online data flow metering equipment are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0134] In addition, in conjunction with the low-frequency clock calibration method in the above embodiment, the present invention can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the low-frequency clock calibration method provided in the present invention can be implemented.
[0135] An embodiment of the present application further provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the low-frequency clock calibration method provided in the embodiment of the present application.
[0136] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0137] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0138] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0139] Aspects of the present disclosure are described above with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable low-frequency clock calibration device to produce a machine such that these instructions, when executed by the processor of the computer or other programmable low-frequency clock calibration device, enable the implementation of the functions / actions specified in one or more blocks in the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It will also be understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0140] The above is only a specific implementation method of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with this technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the scope of protection of this application.
Claims
1. A low frequency clock calibration method, characterized in that: The method comprises: Obtain the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle; When the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to a second preset threshold, performing a second hardware calibration according to a second duration to complete synchronous calibration; Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
2. The method according to claim 1, characterized in that The method further comprises: Obtain the synchronization error of the time synchronization after the terminal device wakes up in the N-1th paging cycle; When the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold, and / or the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is less than a second preset threshold, determining a synchronization error range according to the post-sleep calibration frequency and the post-sleep temperature; When the synchronization error is within the synchronization error range, synchronization error calibration is performed.
3. The method according to claim 2, characterized in that The method further comprises: If the synchronization error is not within the synchronization error range, the synchronization error is deleted.
4. The method according to claim 2, characterized in that: The step of determining a synchronization error range according to the post-sleep calibration frequency and the post-sleep temperature includes: Determining an error range of the low-frequency clock according to the post-sleep calibration frequency and the frequency of the high-frequency clock; The synchronization error range is determined according to the error range of the low-frequency clock and the post-sleep temperature.
5. The method according to any one of claims 1 to 4, characterized in that: Before performing the second hardware calibration according to the second duration to complete the synchronization calibration, the method further includes: Get the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock; The second duration is calculated according to the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock.
6. The method according to claim 5, characterized in that The second duration is calculated according to the sleep duration of the terminal device in the Nth paging cycle, the time range of time synchronization and the frequency of the high-frequency clock, satisfying the following relationship: The second duration>sleep duration / (frequency of high-frequency clock*time range of time synchronization).
7. A low-frequency clock calibration device, characterized in that: The device comprises: An acquisition module is used to acquire the pre-sleep temperature of the terminal device in the N-1th paging cycle, the pre-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle, the post-sleep temperature of the terminal device in the N-1th paging cycle, and the post-sleep calibration frequency of the low-frequency clock obtained by the first hardware calibration in the N-1th paging cycle; a calibration module, configured to perform a second hardware calibration according to a second duration to complete synchronization calibration when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold and the difference between the pre-sleep calibration frequency and the post-sleep calibration frequency is greater than or equal to a second preset threshold; Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
8. A low-frequency clock calibration device, characterized in that: The device comprises: A temperature reading module, used to obtain the pre-sleep temperature of the terminal device and the post-sleep temperature of the terminal device in the N-1th paging cycle; The hardware calibration circuit is used to perform a first hardware calibration to obtain a pre-sleep calibration frequency of the low-frequency clock in the N-1th paging cycle and a post-sleep calibration frequency of the low-frequency clock in the Nth paging cycle; a calibration strategy module, configured to determine whether a difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and whether a difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold; The hardware calibration circuit is further configured to, when the difference between the pre-sleep temperature and the post-sleep temperature is greater than or equal to a first preset threshold, and the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is greater than or equal to a second preset threshold, perform a second hardware calibration according to a second duration to obtain a pre-sleep calibration frequency of the low-frequency clock of the terminal device before sleep in the Nth paging cycle; Among them, the first duration of the first hardware calibration is less than the duration of the service processing time after the terminal device wakes up in each paging cycle, and the second duration is greater than the first duration.
9. The device according to claim 8, characterized in that The device also includes a time synchronization algorithm module; The calibration strategy module is further configured to determine a synchronization error range according to the post-sleep temperature and the post-sleep calibration frequency when the difference between the pre-sleep temperature and the post-sleep temperature is less than a first preset threshold value and / or the difference between the post-sleep calibration frequency and the pre-sleep calibration frequency is less than a second preset threshold value; The time synchronization algorithm module is used to perform synchronization error calibration when the synchronization error is within the synchronization error range.
10. A low-frequency clock calibration device, characterized in that: The device comprises the low-frequency clock calibration apparatus as claimed in any one of claims 8 and 9.
11. A low-frequency clock calibration device, characterized in that: The device includes a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the low-frequency clock calibration method according to any one of claims 1-6.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the low-frequency clock calibration method according to any one of claims 1 to 6 is implemented.
