This application claims the benefit of Taiwan patent application No. 104103544, filed on Feb. 3, 2015, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
The present invention relates to a scanning and recovering method, and more particularly relates to an automatic scanning and recovering method after an electronic device crash problem has been solved.
2. Description of Related Art
In a conventional electronic device, such as a personal computer, a laptop, a smart phone, a tablet, etc, and in a process of the electronic device executing software, when the electronic device has hardware defects, the electronic device may fail to proceed with the process. In general, the electronic device may display an abnormal screen to show possible crash reasons as a reference for the technicians to troubleshoot and repair the electronic device.
For a common user of the conventional electronic device, when the abnormal screen is shown on the electronic device, system reboot is a commonly adopted method to overcome the abnormal screen. The electronic device can work properly after rebooting. However, the crash is often caused by the hardware defect of the electronic device itself For example, the hardware defect of the electronic device may be caused by bad sectors of the hard drive. After the abnormal screen is showed on the electronic device, the user has to directly disconnect the power source to shut down the electronic device. Thereafter, the user reconnects the power source to boot the electronic device again.
When the electronic device has not accessed the bad sectors of the hard drive yet, the abnormal screen would not be shown on the electronic device, such that the user may misunderstand that the electronic device can be fixed by rebooting the system.
However, when the user uses some specific software, the electronic device would access the bad sectors of the hard drive. As a result, the abnormal screen would be shown on the electronic device again. Therefore, the user has to reboot the electronic device to use the electronic device, and it is very inconvenient. Besides, the electronic device turned off by disconnecting from the power source will cause deterioration of the electronic device and shorten the lifetime of the electronic device.
Accordingly, an objective of the present invention is to provide an automatic scanning and recovering method for an electronic device to automatically scan and recover the electronic device from a crash situation last time after the crash problem of the electronic device has been fixed.
The automatic scanning and recovering method for an electronic device is executed by the electronic device and includes steps of:
receiving a booting command;
determining whether a crash flag is in an activating status when the electronic device is turned on;
performing a system diagnostics utility to scan and recover the electronic device when the crash flag is in the activating status; and
setting the crash flag to be in an inactivating status and performing a rebooting procedure.
After the electronic device is turned on and before the operating system is loaded, the automatic scanning and recovering method of the present invention is executed in advance. The method of the present invention determines whether the system diagnostics utility is executed to scan and recover the electronic device in accordance with the crash flag. When the crash flag is in the activating status, it represents that the electronic device is not properly shut down last time and the system diagnostics utility is executed. On the contrary, when the crash flag is in the inactivating status, it represents that the electronic device is properly shut down last time and the system diagnostics utility is not required to be executed.
By setting the crash flag, the electronic device can be determined whether the electronic device is shut down properly last time. When the operating system is not shut down properly, the system diagnostics utility automatically executes to scan and recover the electronic device. The users without professional skills who do not understand error information shown on the abnormal screen can have the electronic device repaired by itself so as to avoid the electronic device being frequently shut down for the same reason. The usage convenience is enhanced and the lifetime of the electronic device can be extended.
These and other aspects of the embodiments herein will be better appreciated and understood when considered in conjunction with the following description and the accompanying drawings.
With reference to
receiving a booting command (S11);
determining whether a crash flag is in an activating status when turning on the electronic device (S12);
performing a system diagnostics utility to scan and recover the electronic device when the crash flag is in the activating status (S13); and
performing a rebooting procedure after the crash flag is set to be in an inactivating status (S14).
The method in the present invention determines the crash flag in advance after the electronic device is turned on and before loading the operating system. The method will determine that a system diagnostics utility is automatically executed or not in accordance with a determination result. When the crash flag is in the activating status, it represents that the electronic device does not follow a regular procedure to shut down an operating system of the electronic device since the electronic device is crashed and the operating system cannot be shut down properly. Therefore, the system diagnostics utility is performed to scan and recover the electronic device. When the crash flag is in the inactivating status, it represents that the electronic device follows the regular procedure to shut down the operating system of the electronic device. Therefore, the system diagnostics utility is not required to be performed.
The automatic scanning and recovering method for the electronic device further includes the following steps:
setting the crash flag to be in the activating status and then booting the operating system when the crash flag is in the inactivating status (S15);
performing an operating system shutdown procedure (S16);
shutting the operating system down after the crash flag is set to be in the inactivating status (S17).
When the crash flag is in the inactivating status, it represents that the electronic device is shut down in accordance with the operating system shutdown procedure. Therefore, the crash flag is set to be in the activating status in advance and then the operating system is booted to let the user use the electronic device normally.
When a user would like to shut down the operating system of the electronic device, the operating system shutdown procedure is performed via the electronic device so the electronic device normally shuts down the operating system.
At this moment, the crash flag is set to be in the inactivating status by the electronic device. Therefore, the electronic device will execute the automatic scanning and recovering method for the electronic device in the present invention to determine that the operating system has been shut down properly last time, and the operating system is directly loaded for the user to use. However, when the operating system of the electronic device is not shut down by the operating system shutdown procedure, it represents that the abnormal screen was shown on the electronic device because of the crash of the electronic device and the user has to directly disconnect the power source of the electronic device to shut down the operating system. Therefore, the electronic device will skip the step S16 and the step S17, and the crash flag will not be set in the inactivating status. Therefore, when the electronic device is turned on next time, the electronic device will determine the operating system is not shut down properly in accordance with the crash flag. The system diagnostics utility is directly performed to scan and recover the electronic device. After scanning, the rebooting procedure is performed to restart the electronic device.
The following description is to specify the steps in the automatic scanning and recovering method for the electronic device in the present invention. In step S11, the booting command is received. It represents that the user will turn on the electronic device. For example, the user pushes a power button to turn on the electronic device, and a booting command is generated to turn on the electronic device. In step S12, the activating status and the inactivating status in the crash flag respectively represent an abnormal shutdown of the operating system last time and a normal shutdown of the operating system last time. For example, the crash flag is a one-bit data. When the crash flag is 1, it represents that the crash flag is in the activating status and the electronic device does not shut down the operating system properly. On the contrary, when the crash flag is 0, it represents that the crash flag is in the inactivating status and the electronic device shuts down the operating system properly.
In step S13, since the electronic device determined that the operating system is not shut down properly, the electronic device performs the system diagnostics utility to scan and recover the electronic device. In step S14, when the electronic device has been scanned and recovered, the crash flag is set to be in the inactivating status and the rebooting procedure is performed to restart the electronic device. When the electronic device is restarted, the electronic device will repeat the step S12 to determine whether the crash flag is in the activating status or not.
In step S15, when the crash flag is in the inactivating status, it represents that the electronic device is shut down properly last time. And then, the crash flag is set to be in the activating status after booting the operating system. In step S16, after the crash flag is set to be in the activating status, the operating system is booting and the user can use the electronic device normally. In step S17, when the user would like to shut down the operating system of the electronic device, the operating system shutdown procedure is performed by the electronic device and the electronic device normally shuts down the operating system. Before the electronic device performs the operating system shutdown procedure, the crash flag is reset to be in the inactivating status in advance. The crash flag is reset before booting the operating system. It is to avoid that the crash flag still in the activating status to cause the electronic device will automatically perform the diagnosis when the electronic device is turned on next time.
With reference to
With reference to
Furthermore, as in the aforementioned step S13, the system diagnostics utility is to scan and recover hard drive and memory in the electronic device and isolate bad sectors in the hard drive and the memory in the electronic device to avoid using those bad sectors so as to recover the electronic device. Specifically, a manner to scan and recover the hard drive and the memory of the electronic device is to scan out bad sectors of the hard drive and the memory and isolate the bad sectors of the hard drive and the memory. After the system diagnostics utility scans and recovers the hard drive and the memory of the electronic device, the bad sectors in the hard drive and the memory are isolated to avoid other programs or software using the bad sectors and causing the abnormal screen, and the electronic device is recovered.
While the present invention has been described in terms of what are presently considered to be the most practical and preferred embodiments, it is to be understood that the present invention need not be restricted to the disclosed embodiment. On the contrary, it is intended to cover various modifications and similar arrangements included within the spirit and scope of the appended claims which are to be accorded with the broadest interpretation so as to encompass all such modifications and similar structures. Therefore, the above description and illustration should not be taken as limiting the scope of the present invention which is defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
104103544 A | Feb 2015 | TW | national |
Number | Name | Date | Kind |
---|---|---|---|
6189114 | Orr | Feb 2001 | B1 |
6216226 | Agha | Apr 2001 | B1 |
7181611 | Chang | Feb 2007 | B2 |
7281160 | Stewart | Oct 2007 | B2 |
7424643 | Atri | Sep 2008 | B2 |
7555677 | Wiley | Jun 2009 | B1 |
8312256 | Anbazhagan | Nov 2012 | B2 |
20160062819 | Oh | Mar 2016 | A1 |
Number | Date | Country | |
---|---|---|---|
20160224428 A1 | Aug 2016 | US |