Method and device for realizing alarm clock and electronic equipment
By combining the minute alarm interrupt and second timer interrupt of the RTC module, the precise wake-up of the second alarm clock is achieved in the system sleep state, solving the problem that the second alarm clock cannot be accurately wake-up in the existing technology, and the low-power second alarm function is realized.
Patent Information
- Application Number
- CN202411798191.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art cannot realize the precise wake-up of the second-level alarm clock in the system sleep state, resulting in large system power consumption.
By combining minute-level alarm interrupts and second-level timer interrupts in the real-time clock module (RTC), the precise wake-up of second-level alarm clock is achieved in the system sleep state. The specific method includes: if the alarm interval time is less than or equal to the first preset value, then set a second-level timer interrupt; if the interval time is greater than the first preset value and the remaining result with the second preset value is 0, and the current time is an entire minute level, then set a minute-level alarm interrupt; if the interval time is greater than the first preset value and the remaining result is not 0, and the current time is a non-full minute level, then set a minute-level alarm interrupt and a second-level timer interrupt based on the alarm type.
It realizes accurate wake-up of the second-level alarm clock in the system sleep state, and effectively reduces system power consumption.
Smart Images

Figure CN119960553A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuit design, and in particular to a method and device for realizing an alarm clock, and electronic equipment. Background Art
[0002] HYM8563 is a low-power CMOS (complementary metal oxide semiconductor) real-time clock / calendar chip. Taking HYM8563 as an example, the default Alarm (timer mechanism) only provides minute-level alarms, resulting in the system being unable to be woken up in time when an accurate alarm (accurate to the second level) is required in sleep mode. For example, a countdown alarm can only be implemented using the CPU Timer (high-precision timer mechanism) when the system remains awake, resulting in high system power consumption. Summary of the invention
[0003] The present invention provides a method and device for realizing an alarm clock, and an electronic device, which can realize a second-level alarm clock and effectively reduce system power consumption.
[0004] In one aspect of the present invention, a method for implementing an alarm is provided. The method includes: obtaining the current time, the interval time for the alarm, and the type of the alarm; if the interval time is less than or equal to a first preset value, setting a second-level timer interrupt in the real-time clock module according to the interval time, the first preset value being the maximum duration of the second-level timer interrupt; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is an integer minute, setting a minute-level alarm interrupt in the real-time clock module according to the interval time, the second preset value being one minute; and if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute, setting the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the interval time based on the type of the alarm.
[0005] In another aspect of the present invention, a device for implementing an alarm is provided. The device includes: a real-time clock module configured to generate a minute-level alarm interrupt and a second-level timer interrupt; and a control module electrically coupled to the real-time clock module and configured to: obtain the current time, the interval time for the alarm, and the type of the alarm; if the interval time is less than or equal to a first preset value, set the second-level timer interrupt in the real-time clock module according to the interval time, the first preset value being the maximum duration of the second-level timer interrupt; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the whole minute level, set the minute-level alarm interrupt in the real-time clock module according to the interval time, the second preset value being one minute; and if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not at the whole minute level, set the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the interval time based on the type of the alarm.
[0006] In another aspect of the present invention, an electronic device is provided, which includes a memory configured to store an executable program and a processor configured to execute the program so that the electronic device executes the above-mentioned method for realizing an alarm clock.
[0007] According to the present invention, if the interval time of the alarm is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the integer minute level, then the minute-level alarm interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not at the integer minute level, then the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm; in this way, by combining the alarm_irq (minute-level alarm interrupt) and timer_irq (second-level timer interrupt) of the RTC (real-time clock) module, accurate wake-up of the second-level alarm can be achieved in the system sleep state, thereby achieving the second-level alarm while effectively reducing system power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a flow chart of a method for realizing an alarm clock according to an embodiment of the present invention; Figure 2 A schematic diagram of a flow chart of a method for realizing an alarm clock according to an embodiment of the present invention; Figure 3 A schematic diagram of the interaction between the SOC chip and the RTC module in the method for realizing an alarm clock according to an embodiment of the present invention; Figure 4 A schematic diagram of a device for realizing an alarm clock according to an embodiment of the present invention; Figure 5 FIG. 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0009] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0010] In the existing technology, when the system is in sleep mode and needs an accurate alarm (accurate to the second level), it cannot be woken up in time to process. For example, a countdown alarm can only be implemented by using the CPU Timer (high-precision timer mechanism) when the system remains awake, resulting in high system power consumption.
[0011] In order to solve at least the above technical problems, the present disclosure provides a method for realizing an alarm clock. According to the present disclosure, if the interval time of the alarm clock is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the whole minute level, then the minute-level alarm interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not at the whole minute level, then the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm clock. In this way, by combining the alarm_irq and timer_irq of the RTC module, the accurate wake-up of the second-level alarm clock can also be realized in the system sleep state, thereby realizing the second-level alarm clock while effectively reducing the system power consumption.
[0012] Hereinafter, the technical solution according to the present disclosure will be described with reference to specific embodiments and in conjunction with the accompanying drawings.
[0013] Figure 1 1 is a flow chart showing a method 100 for implementing an alarm clock according to an embodiment of the present disclosure. Figure 1 The method 100 includes the following steps 102 to 108.
[0014] In step 102, the current time, the interval time for the alarm, and the type of the alarm are obtained. The interval time is the interval time between the current time and the alarm.
[0015] In step 104, if the interval time is less than or equal to the first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time.
[0016] The first preset value is the maximum duration of the second-level timer interrupt. For example, the maximum duration of timer_irq in the RTC module provided by the HYM8563 chip is 255s, then the first preset value is 255s, assuming that the interruption time is 30s, then timer_irq can be set directly.
[0017] In step 106, if the interval time is greater than the first preset value, the modulus of the interval time and the second preset value is 0, and the current time is in the whole minute level, a minute-level alarm interrupt in the real-time clock module is set according to the interval time. The second preset value is one minute, i.e., 60 seconds.
[0018] For example, the current time is 10:10:00, which is at the minute level, the interval time is 10min, which is greater than the first preset value 255s, and the modulo result with 60s is 0, then alarm_irq can be set directly, and alarm_irq provides alarm interrupts for year, month, day, hour, and minute expiration.
[0019] In step 108, if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute, then the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm.
[0020] In some embodiments, if the alarm type is a precise type, the minute-level alarm interrupt in the real-time clock module is set according to the minute-level portion of the interval time. After being awakened by the minute-level alarm interrupt, the second-level timer interrupt in the real-time clock module is set according to the second-level portion of the interval time. In this way, through the cooperation of the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module, precise awakening of the second-level alarm can be achieved even in the system sleep state.
[0021] Precise alarms refer to those that must be woken up on time, such as the countdown set by the user, the exact clock set by the user. If the user sets the alarm at 8:00, it must be ensured that the alarm is woken up on time at 8:00 to notify the user. In this case, alarm_irq can be used to meet this requirement, as described in step 106. Assuming that the automatic page turning function on the electronic paper book device, the user sets the page turning timer to 10 seconds, it must be ensured that the page turning interval is 10 seconds. At this time, alarm_irq cannot meet the application requirements, and timer_irq is required to implement it, as described in step 104. Assuming that the countdown set by the user is 10min30s, which exceeds the first preset value, alarm_irq and timer_irq need to be implemented in coordination, that is, first set the alarm_irq wake-up of 10min, and then set the timer_irq wake-up of 30s, so that there is one more wake-up.
[0022] In some embodiments, if the type of the alarm clock is an imprecise type, and the alarm clock is an alarm clock with an automatic repeating interval, a new interval time is calculated based on the current time and the interval time. At least one of the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module is set according to the new interval time. In addition, after the alarm clock corresponding to the new interval time wakes up, the minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm clock with an automatic repeating interval. In this way, for an imprecise alarm clock and an alarm clock with an automatic repeating interval, the power consumption problem caused by the coordinated use of the minute-level alarm interrupt and the second-level timer interrupt can be optimized by calculating the new interval time, and while realizing the second-level alarm clock, the system power consumption is further reduced.
[0023] Inaccurate alarms refer to scenarios where precise wake-up is not required, such as when some applications update data at regular intervals and do not strictly require accuracy. For such alarms, the alarms can be aligned to the next minute. Inaccurate alarms also include alarms with automatic repeat intervals, such as when the system automatically updates the battery level at regular intervals.
[0024] In some embodiments, calculating a new interval time according to the current time and the interval time comprises using the following equation: ; Wherein, interval′ represents the new interval time, interval represents the interval time, now.tv_sec represents the current time, / / represents division and rounding, Indicates multiplication.
[0025] In some embodiments, at least one of the minute-level alarm interrupt and the second-level timer interrupt is set so that a new alarm of the whole minute level is obtained by adding the new interval time including at least one of the minute-level part and the second-level part to the current time. In addition, the minute-level alarm interrupt in the real-time clock module is set according to the new alarm.
[0026] In some embodiments, after being awakened by the minute-level alarm interrupt, the minute-level alarm interrupt in the real-time clock module is set again according to the interval time.
[0027] For example, continuing the above example, the system updates the power every 10 minutes. Assuming the current time is 10:00:30 and the interval is 10 minutes, the default alarm should be 10:10:30. However, if it is set directly, the minute-level alarm interrupt and the second-level timer interrupt will be used, resulting in two wake-up times. In order to further reduce power consumption, the new interval time is calculated. , so the new alarm time is 10:00:30+9m30s, which can round the default alarm to 10:10:00. When the next alarm comes at 10:10:00, now.tv_sec=10:10:00, and set the interval time to 10min again. There will be no seconds, and the driver can automatically wake up at 10min intervals.
[0028] In this way, the current time is added to the interval time, divided by 60s, and then multiplied, so that the alarm time can be rounded to minutes, so that only minute-level alarm interrupts are needed for subsequent wake-up, reducing system power consumption.
[0029] In some embodiments, if the alarm type is inaccurate and the alarm is a one-time wake-up alarm, the alarm is rounded to the whole minute level to obtain a new alarm. In addition, the minute-level alarm interrupt in the real-time clock module is set according to the new alarm.
[0030] Inaccurate alarm clocks also include one-time wake-up alarm clocks, such as waking up at a certain time every day. For this type of inaccurate alarm clock, simply round the alarm clock to the whole minute level and set the minute-level alarm interrupt in the real-time clock module according to the new alarm clock. Assuming there are two inaccurate alarm clocks: 10:10:30 and 10:09:30, then you can directly respond to both alarm clocks at 10:10:00.
[0031] In this way, for an inaccurate alarm that wakes up once, the alarm is directly rounded to the whole minute level, and the minute-level alarm interrupt in the real-time clock module is set according to the new alarm, thereby reducing system power consumption.
[0032] In some embodiments, the method 100 may also include: if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is not an integer minute level, and if the type of the alarm is an inexact type, then a new interval time is calculated based on the current time and the interval time. According to the new interval time, the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set so that the time of the adjusted alarm corresponding to the new interval time is an integer minute level. In addition, after the adjustment alarm wakes up, the minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm with an automatic repeating interval.
[0033] Hereinafter, the method and apparatus for implementing an alarm clock and application scenarios of an electronic device according to an embodiment of the present invention will be described by way of examples.
[0034] Figure 2 is a flow chart showing a method for implementing an alarm clock according to an embodiment of the present invention. Figure 2 The method includes the following steps 201 to 211.
[0035] In step 201, the current time, the interval time for the alarm, and the type of the alarm are obtained.
[0036] In step 202, if the interval time is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time. The first preset value is the maximum duration of the second-level timer interrupt.
[0037] In step 203, if the interval time is greater than the first preset value, the modulus of the interval time and the second preset value is 0, and the current time is a whole minute, a minute-level alarm interrupt in the real-time clock module is set according to the interval time. The second preset value is one minute.
[0038] In step 204, if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute, then steps 205 to 211 are executed.
[0039] In step 205, if the alarm type is a precise type, a minute-level alarm interrupt in the real-time clock module is set according to the minute-level portion of the interval time.
[0040] In step 206, after being awakened by the minute-level alarm interrupt, a second-level timer interrupt in the real-time clock module is set according to the second-level part of the interval time.
[0041] In step 207, if the alarm type is non-precise and the alarm is an automatic repeating interval alarm, a new interval time is calculated according to the current time and the interval time, specifically: ; In the formula, interval′ represents the new interval time, interval represents the interval time, now.tv_sec represents the current time, / / represents division and rounding, Indicates multiplication.
[0042] In step 208, at least one of a minute-level alarm interrupt and a second-level timer interrupt in the real-time clock module is set according to the new interval time.
[0043] In some embodiments, a new alarm is obtained by adding the new interval time to the current time; and at least one of a minute-level alarm interrupt and a second-level timer interrupt in the real-time clock module is set according to the new alarm.
[0044] In step 209, after the alarm corresponding to the new interval time wakes up, the minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm with an automatic repeating interval.
[0045] In this embodiment, obtaining an alarm with an automatic repeating interval includes: after being awakened by a minute-level alarm interrupt, setting a minute-level alarm interrupt in a real-time clock module again according to the interval time.
[0046] In step 210, if the alarm type is inexact and the alarm is a one-time wake-up alarm, the alarm is rounded to the whole minute level to obtain a new alarm.
[0047] In step 211, a minute-level alarm interrupt in the real-time clock module is set according to the new alarm.
[0048] In some embodiments, the method may further include: if the interval time is greater than a first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is not an integer minute level, and if the alarm type is an inaccurate type, then a new interval time is calculated based on the current time and the interval time. According to the new interval time, a minute-level alarm interrupt and a second-level timer interrupt in the real-time clock module are set, so that the time of the adjusted alarm corresponding to the new interval time is an integer minute level. In addition, after the adjustment alarm wakes up, a minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm with an automatically repeated interval.
[0049] Figure 3 Schematic diagram showing the interaction between a SOC chip (system on chip) and an RTC module (real time clock module) for implementing an alarm clock method according to an embodiment of the present invention. Figure 3The RTC module supports alarm and timer. The SOC chip and RTC module interact through the data signal line (SDA) and serial clock line (SCL) of the I2C bus.
[0050] According to another aspect of the present invention, Figure 4 3 is a block diagram showing an apparatus 300 for implementing an alarm clock according to an embodiment of the present invention. Figure 4 The device 300 for implementing an alarm clock includes a real-time clock module 302 and a control module 304 .
[0051] The real time clock module 302 is configured to generate minute-level alarm interrupts and second-level timer interrupts.
[0052] The control module 304 is electrically coupled to the real-time clock module 302. The control module 304 is configured to obtain the current time, the interval time for the alarm, and the type of the alarm. The control module 304 is configured to set the second-level timer interrupt in the real-time clock module according to the interval time if the interval time is less than or equal to a first preset value, and the first preset value is the maximum duration of the second-level timer interrupt. The control module 304 is configured to set the minute-level alarm interrupt in the real-time clock module according to the interval time if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the whole minute level, and the second preset value is one minute. In addition, the control module 304 is configured to set the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the interval time based on the type of the alarm if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not at the whole minute level.
[0053] The device for realizing an alarm clock according to the embodiment of the present invention may be integrated into a SOC chip supporting alarm and timer.
[0054] It should be understood that the real-time clock module 302 and the control module 304 may be further configured to execute the corresponding steps or actions in the method described above, which will not be described in detail herein.
[0055] According to yet another aspect of the present invention, Figure 5 4 is a schematic diagram showing a device 400 for implementing an alarm clock according to an embodiment of the present invention. Figure 5 , the electronic device 400 includes a memory 402 and a processor 404. The memory 402 is configured to store an executable program that can be run on the processor 404. The processor 404 is configured to execute the program so that the electronic device implements the various steps or actions of the method for implementing an alarm clock as described above.
[0056] In summary, the present invention provides a method and device for realizing an alarm clock, and an electronic device. If the interval time of the alarm clock is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is an integer minute level, a minute-level alarm clock interrupt in the real-time clock module is set according to the interval time; if the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute level, then the minute-level alarm clock interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm clock, so that by combining the alarm_irq and timer_irq of the RTC module in the system sleep state, the accurate wake-up of the second-level alarm clock can be realized, thereby realizing the second-level alarm clock and effectively reducing the system power consumption. In addition, for an inaccurate alarm clock and an alarm clock with an automatically repeated interval, the power consumption problem caused by the coordinated use of the minute-level alarm clock interrupt and the second-level timer interrupt can be optimized by calculating the new interval time, so that the second-level alarm clock can be realized while further reducing the system power consumption. At the same time, for an inaccurate alarm that wakes up once, the alarm is directly rounded to the whole minute level, and the minute-level alarm interrupt in the real-time clock module is set according to the new alarm, thereby reducing system power consumption.
[0057] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for realizing an alarm clock, characterized in that: include: Get the current time, the interval used for the alarm, and the alarm type; If the interval time is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time, and the first preset value is the maximum duration of the second-level timer interrupt; If the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the whole minute level, then a minute-level alarm interrupt in the real-time clock module is set according to the interval time, and the second preset value is one minute; as well as If the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute, then the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm.
2. The method according to claim 1, characterized in that Setting the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the interval time based on the type of the alarm includes: If the alarm type is a precise type, setting the minute-level alarm interrupt in the real-time clock module according to the minute-level portion of the interval time; and After being awakened by the minute-level alarm interrupt, the second-level timer interrupt in the real-time clock module is set according to the second-level part of the interval time.
3. The method according to claim 1, characterized in that: Also includes: If the type of the alarm clock is non-precise, and the alarm clock is an automatic repeating interval alarm clock, then calculating a new interval time according to the current time and the interval time; Setting at least one of the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the new interval time; and After the alarm corresponding to the new interval time wakes up, the minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm with automatically repeated intervals.
4. The method according to claim 3, characterized in that Calculating a new interval time based on the current time and the interval time includes using the following equation: ; Wherein, interval′ represents the new interval time, interval represents the interval time, now.tv_sec represents the current time, / / represents division and rounding, Indicates multiplication.
5. The method according to claim 3, characterized in that: Setting at least one of the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module according to the new interval time includes: Setting at least one of the minute-level alarm interrupt and the second-level timer interrupt so that a new alarm of the whole minute level is obtained by adding the new interval time including at least one of the minute-level part and the second-level part to the current time; and The minute-level alarm interrupt in the real-time clock module is set according to the new alarm.
6. The method according to claim 3, characterized in that Alarms that get automatic repeat intervals include: After being awakened by the minute-level alarm interrupt, the minute-level alarm interrupt in the real-time clock module is set again according to the interval time.
7. The method according to claim 2, characterized in that Also includes: If the type of the alarm is inexact, and the alarm is a one-time wake-up alarm, round the alarm to the whole minute level to obtain a new alarm; as well as The minute-level alarm interrupt in the real-time clock module is set according to the new alarm.
8. The method according to claim 1, characterized in that Also includes: If the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is not an integer minute, and if the type of the alarm clock is an inexact type, a new interval time is calculated according to the current time and the interval time; The minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the new interval time, so that the time of the adjusted alarm corresponding to the new interval time is at the whole minute level; as well as After the adjustment of the alarm wake-up, the minute-level alarm interrupt in the real-time clock module is set according to the interval time, thereby obtaining an alarm with an automatic repeating interval.
9. A device for realizing an alarm clock, characterized in that: include: A real-time clock module configured to generate minute-level alarm interrupts and second-level timer interrupts; as well as A control module is electrically coupled to the real time clock module and is configured to: Get the current time, the interval used for the alarm, and the alarm type; If the interval time is less than or equal to a first preset value, a second-level timer interrupt in the real-time clock module is set according to the interval time, and the first preset value is the maximum duration of the second-level timer interrupt; If the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is 0, and the current time is at the whole minute level, then a minute-level alarm interrupt in the real-time clock module is set according to the interval time, and the second preset value is one minute; as well as If the interval time is greater than the first preset value, the modulo result of the interval time and the second preset value is not 0, and the current time is not an integer minute, then the minute-level alarm interrupt and the second-level timer interrupt in the real-time clock module are set according to the interval time based on the type of the alarm.
10. An electronic device, characterized in that: include: a memory configured to store an executable program; as well as A processor is configured to execute the program so that the electronic device performs the method according to any one of claims 1 to 8.