Method and system for regularly starting up within specified week, terminal and storage medium
By selecting any day of the week in the BIOS or operating system as the target date for the timed startup, and combining the date difference calculation of the RTC register and the cross-month date conversion algorithm, the problem that the computer cannot specify the timed startup within the week is solved, and the accurate automatic startup function is achieved.
Patent Information
- Application Number
- CN202510608943.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-22
AI Technical Summary
The prior art cannot realize the computer's automatic start-up in a timely manner in a week unit, and cannot meet the user's requirement to start the computer any day within a week.
By providing an interactive interface in the BIOS or operating system, selecting any day of the week as the target date of the timed startup, combining the date difference calculation of the RTC register and the cross-month date conversion algorithm, the RTC register is configured to achieve a timed startup within a week, and triggering the startup process through an interrupt signal.
It realizes the accurate automatic start of the computer in any day of a week, meets the needs of special application scenarios, is compatible with existing hardware without increasing costs, and has high accuracy in cross-month date conversion.
Smart Images

Figure CN120523518A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of scheduled computer startup, and more particularly to a method, system, terminal and storage medium for scheduled startup within a specified week. Background Art
[0002] RTC wakeup is widely used in the computer field. Its advantage is that users can specify a time to automatically start the computer, eliminating the need for manual startup. Examples include advertising machines in shopping malls and buildings, digital signage, office computers, and unmanned industrial control sites.
[0003] In the computer field, traditional RTC (Real Time Clock) wakeup is also known as scheduled power-on. Users typically set the wakeup time in the BIOS (Basic Input & Output System) or operating system. After a normal shutdown, while AC power is continuously supplied, existing technologies use the BIOS or operating system to set scheduled power-on parameters, supporting fixed-time wakeup with accuracy to the hour, minute, and second, periodic wakeup for a specified date within the month, and delayed wakeup based on the duration of the shutdown. All three methods rely on the predefined wakeup mechanism for the date of the month in the RTC register. Their core limitation is that the RTC register does not define a wakeup register for the date of the week, making it impossible to directly support scheduled power-on requirements based on weeks. Summary of the Invention
[0004] The technical problem to be solved by the present invention is how to realize the function of automatically starting the computer at a specified time on any day of the week specified by the user. In view of the above-mentioned defects of the prior art, a method, system, terminal and storage medium for starting the computer at a specified time within the week are provided.
[0005] The technical solution adopted by the present invention to solve its technical problem is:
[0006] A method for starting a computer at a specified time within a week includes the following steps:
[0007] A user interface setting step is to provide an interactive interface in the computer's BIOS or operating system, allowing a user to select any day of the week as the scheduled startup target date T, wherein the interactive interface includes options for Sunday and Monday to Saturday, with index values corresponding to 0-6 respectively;
[0008] Real-time date acquisition step: obtain the current week date index value W by reading the RTC register 06h offset address, and obtain the current month day D, month M and year Y through the 07h, 08h and 09h offset addresses;
[0009] The date difference calculation step is to calculate the absolute difference in days between the user-set index value U and the current week date index value W, Δ=|UW|: if UW is greater than or equal to 0, Δ=|UW|=UW; if UW is less than 0, Δ=|UW|=7-|UW|;
[0010] The step of converting the date across months is to compare the result T of D + Δ with the threshold of the number of days in the current month M. When T exceeds the threshold, a span correction is performed to obtain a valid date within the month.
[0011] RTC register wake-up configuration step: write the valid month date to the RTC register 0Dh offset address, and write the user-set hour, minute, and second values to the 05h, 03h, and 01h offset addresses respectively to complete the scheduled power-on configuration;
[0012] Wake-up signal triggering step: When the RTC time matches, an interrupt signal is generated through register 0Ch to trigger the power management module to start the boot process.
[0013] Preferably, the step of converting based on the spanning date further includes:
[0014] If the current month is January, March, May, July, August, October, or December, and the preliminary target date T is more than 31 days away, then T is updated to T-31;
[0015] If the current month is April, June, September or November, and the preliminary target date T is more than 30 days away, then T is updated to T-30;
[0016] If the current month is February, the number of days in the month is determined based on whether the current year Y is a leap year. If the preliminary target date T exceeds the number of days in the month, the date of the next month is obtained by subtracting the corresponding number of days in the month from T.
[0017] Preferably, if the current year Y is divisible by 4 and not divisible by 100, or is divisible by 400, it is determined to be a leap year, otherwise it is a non-leap year.
[0018] Preferably, the RTC register configuration step is performed during the computer startup or shutdown process, and the BIOS dynamically writes the adjusted target date into the RTC register.
[0019] Preferably, the date difference calculation step further includes:
[0020] When Δ=0, the current month date D is directly written into the 0Dh offset address, and the wake-up time is set to the wake-up time set by the user.
[0021] Preferably, the user interface setting step further includes:
[0022] A recurrence option is provided, allowing the user to choose to repeat the scheduled power-on configuration every week.
[0023] on the other hand
[0024] A system for timing startup within a specified week, comprising:
[0025] The user input module is an interactive interface integrated into the BIOS chip, which allows users to select index values from Monday to Sunday;
[0026] A date processing unit, including a microcontroller, is used to perform date difference calculations and implement the intra-month date conversion algorithm;
[0027] The RTC driver module is configured to write the target date and hour, minute, and second data to the RTC register offset addresses 0Dh, 05h, 03h, and 01h;
[0028] Power management module, receives RTC interrupt signal and triggers system startup;
[0029] The cross-month correction module is used to perform cross-month correction operations on the target date based on the current month attributes, including processing date overflow correction for 31-day months, processing date overflow correction for 30-day months, and determining the number of days in February through year value calculation.
[0030] The third aspect
[0031] A terminal that is turned on at a specified time during a week comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any one of the methods are implemented.
[0032] The fourth aspect
[0033] A computer-readable storage medium stores a computer program, wherein the computer program, when executed, implements the steps of any one of the methods for timing power-on within a specified week.
[0034] The beneficial effects of the present invention are:
[0035] 1. This solves the long-standing problem of computers not being able to automatically start up on a specific day of the week, meeting customer needs for special application scenarios;
[0036] 2. Strong compatibility, based on the existing RTC hardware architecture without adding additional hardware costs;
[0037] 3. Accurate calculations: By improving the judgment of the number of days in a month and the leap year algorithm, the accuracy of cross-month date conversion is ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be further described below with reference to the accompanying drawings and embodiments. The drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive efforts.
[0039] Figure 1 Flowchart of a method for timing power-on within a specified week according to a preferred embodiment of the present invention.
[0040] Figure 2 This is a definition diagram of the RTC-related offset address register in an embodiment of the present application. DETAILED DESCRIPTION
[0041] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the following will be a clear and complete description of the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work shall fall within the scope of protection of the present invention.
[0042] Example 1
[0043] The preferred embodiment of the present invention is as follows Figure 1 A method for timing power-on within a specified week is shown, comprising the following steps:
[0044] The user interface setting step provides an interactive interface in the computer's BIOS or operating system, allowing users to select any day of the week as the scheduled power-on target date T. The interactive interface includes options for Sunday and Monday to Saturday, with index values corresponding to 0-6 respectively; a periodic repetition option is provided, allowing users to choose to repeat the scheduled power-on configuration every week.
[0045] The real-time date acquisition step is to obtain the current week date index value W by reading the RTC register 06h offset address, and obtain the current month day D, month M and year Y through the 07h, 08h and 09h offset addresses.
[0046] The date difference calculation step calculates the absolute day difference Δ=|UW| between the user-set index value U and the current week date index value W: if UW is greater than or equal to 0, Δ=|UW|=UW; if UW is less than 0, Δ=|UW|=7-|UW|; when Δ=0, directly write the current month date D to the 0Dh offset address, and set the wake-up time to the wake-up time set by the user.
[0047] The step of converting the date across months is to compare the result T of D + Δ with the threshold of the number of days in the current month M. When T exceeds the threshold, a span correction is performed to obtain a valid date within the month.
[0048] If the current month is January, March, May, July, August, October, or December, and the preliminary target date T exceeds 31 days, T is updated to T-31. If the current month is April, June, September, or November, and the preliminary target date T exceeds 30 days, T is updated to T-30. If the current month is February, the number of days in the current month is determined based on whether the current year Y is a leap year. If the preliminary target date T exceeds the number of days in the current month, the corresponding number of days in the current month is subtracted from T to determine the date of the next month. If it is a leap year and the preliminary target date T exceeds 29 days, T is updated to T-29. If it is a non-leap year and the preliminary target date T exceeds 28 days, T is updated to T-28. If the current year Y is divisible by 4 and not by 100, or is divisible by 400, it is considered a leap year; otherwise, it is a non-leap year.
[0049] The RTC register wakeup configuration step writes the valid date of the month to the RTC register offset 0Dh, and the user-set hour, minute, and second values to offsets 05h, 03h, and 01h, respectively, completing the scheduled power-on configuration. This is executed during the computer startup or shutdown process, and the BIOS dynamically writes the adjusted target date to the RTC register.
[0050] In the wake-up signal triggering step, when the RTC time matches, an interrupt signal is generated through register 0Ch to trigger the power management module to start the boot process. In this embodiment of the application, based on the current industry-wide RTC wake-up function, the BIOS has added a function option menu through program code that allows users to set wake-up according to any day of the week, and the user has set the relevant option menu for the RTC wake-up function. At the same time, all steps and actions in the embodiment of the application are implemented by the code added to the BIOS.
[0051] refer to Figure 1 U indicates the user-set index value, i.e., the day of the week set by the user; W indicates the date index value within the current week, i.e., the day of the current week; |UW| indicates the absolute value of the day of the week set by the user minus the day of the current week; Y indicates the current year; M indicates the current month; D indicates the current date; T indicates the number after adding the current date to the "absolute value of the day" in the previous text; where "=" is not the equal sign in mathematics, but the assignment symbol borrowed from the computer C language).
[0052] refer to Figure 2 , where 0D (Register D) is the register for wake-up by date; 05h, 03h, and 01h are the hour, minute, and second registers for setting the scheduled automatic power-on.
[0053] Example 2
[0054] A system for timing startup within a specified week includes a user input module, a date processing unit, an RTC drive module, a power management module and a cross-month correction module.
[0055] The user input module is an interactive interface integrated into the BIOS chip, which supports users to select index values from Monday to Sunday.
[0056] The date processing unit includes a microcontroller for executing the date difference computer month date conversion algorithm.
[0057] The RTC driver module is configured to write the target date, minute, and second data to the 0Dh, 05h, 03h, and 01h offset addresses of the RTC register.
[0058] The power management module receives the RTC interrupt signal and triggers the system to start up.
[0059] The cross-month correction module is used to perform cross-month correction operations on the target date based on the current month attributes, including processing date overflow correction for 31-day months, processing date overflow correction for 30-day months, and determining the number of days in February through year value calculation.
[0060] Example 3
[0061] A terminal for scheduled power-on within a specified week includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any one of the methods for scheduled power-on within a specified week in Example 1 are implemented.
[0062] Example 4
[0063] A computer-readable storage medium stores a computer program, which, when executed, implements the steps of any one of the methods for timing power-on within a specified week in embodiment 1.
[0064] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes should fall within the scope of protection of the appended claims of the present invention.
Claims
1. A method for starting up a computer at a specified time within a week, characterized in that: The following steps are involved: A user interface setting step is to provide an interactive interface in the computer's BIOS or operating system, allowing a user to select any day of the week as the scheduled startup target date T, wherein the interactive interface includes options for Sunday and Monday to Saturday, with index values corresponding to 0-6 respectively; Real-time date acquisition step: obtain the current week date index value W by reading the RTC register 06h offset address, and obtain the current month day D, month M and year Y through the 07h, 08h and 09h offset addresses; The date difference calculation step is to calculate the absolute difference in days between the user-set index value U and the current week date index value W, Δ=|UW|: if UW is greater than or equal to 0, Δ=|UW|=UW; if UW is less than 0, Δ=|UW|=7-|UW|; The step of converting the date across months is to compare the result T of D + Δ with the threshold of the number of days in the current month M. When T exceeds the threshold, a span correction is performed to obtain a valid date within the month. RTC register wake-up configuration step: write the valid month date to the RTC register 0Dh offset address, and write the user-set hour, minute, and second values to the 05h, 03h, and 01h offset addresses respectively to complete the scheduled power-on configuration; Wake-up signal triggering step: When the RTC time matches, an interrupt signal is generated through register 0Ch to trigger the power management module to start the boot process.
2. The method for starting up a computer at a specified time within a specified week according to claim 1, wherein: The step of converting based on the spanning date further includes: If the current month is January, March, May, July, August, October, or December, and the preliminary target date T is more than 31 days away, then T is updated to T-31; If the current month is April, June, September or November, and the preliminary target date T is more than 30 days away, then T is updated to T-30; If the current month is February, the number of days in the month is determined based on whether the current year Y is a leap year. If the preliminary target date T exceeds the number of days in the month, the corresponding number of days is subtracted from T to obtain the date of the next month.
3. The method for starting up the computer at a specified time within a specified week according to claim 2, wherein: If the current year Y is divisible by 4 and not divisible by 100, or is divisible by 400, it is considered a leap year; otherwise, it is a non-leap year.
4. The method for timing power-on within a specified week according to claim 1, characterized in that: Based on the RTC register wake-up configuration step, it is executed during the computer startup or shutdown process, and the BIOS dynamically writes the adjusted target date into the RTC register.
5. The method for starting up a computer at a specified time within a specified week according to claim 1, wherein: The date difference calculation step further includes: When Δ=0, the current month date D is directly written into the 0Dh offset address, and the wake-up time is set to the same time of the next day.
6. The method for starting up a computer at a specified time within a specified week according to claim 1, wherein: The user interface setting step further includes: A recurrence option is provided, allowing the user to choose to repeat the scheduled power-on configuration every week.
7. A system for timing startup within a specified week, characterized in that: include: The user input module is an interactive interface integrated into the BIOS chip, which allows users to select index values from Monday to Sunday; A date processing unit comprising a microcontroller for executing a date difference computer intra-month date conversion algorithm; The RTC driver module is configured to write the target date, hour, minute, and second data to the RTC register offset addresses 0Dh, 05h, 03h, and 01h; Power management module, receives RTC interrupt signal and triggers system startup; The cross-month correction module is used to perform cross-month correction operations on the target date based on the current month attributes, including processing date overflow correction for 31-day months, processing date overflow correction for 30-day months, and determining the number of days in February through year value calculation.
8. A terminal that is capable of being turned on at a specified time during a specified week, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the method according to any one of claims 1 to 6 are implemented.