Disclosure of Invention
The invention provides a system backup and restoration method, a BIOS and a computer, wherein an operating system is subjected to two backups corresponding to different time points under the BIOS environment, two backup files which correspond to the two time points and can be used for restoring the operating system are generated, one of the two backup files is used for restoring the operating system, the operating system environment is not needed, and the defects of the prior art are overcome.
The invention provides a system backup method, which is applied to a BIOS and comprises the following steps:
responding to a command for backing up the operating system data received at a first time point, and generating a backup file corresponding to the first time point according to the operating system backup data at the first time point;
storing the backup file corresponding to the first time point in a hidden protection area HPA;
responding to a command for backing up the operating system data received at the second time point, and generating a backup file corresponding to the second time point according to the operating system backup data at the second time point;
storing the backup file corresponding to the second time point in a hidden protection area HPA;
and storing the backup file corresponding to the second time point in a hidden protection area HPA, wherein the backup file corresponding to the second time point does not cover the backup file corresponding to the first time point.
In the method, two or more memory partitions of the memory are provided with the operating system,
generating a backup file corresponding to the first time point according to the operating system backup data of the first time point, which specifically comprises the following steps:
generating a backup subfile for each memory partition specified by a user at a first point in time;
packing the backup subfiles of each memory partition appointed by a user at a first time point to generate a backup file corresponding to the first time point;
generating a backup file corresponding to the second time point according to the operating system backup data of the second time point, which specifically includes the following steps:
generating a backup subfile for each memory partition specified by the user at the second point in time;
and packaging the backup subfiles of each memory partition designated by the user at the second time point to generate the backup file corresponding to the first time point.
The invention provides a system restoring method applied to a BIOS, which comprises the following steps:
in response to a command for restoring the operating system at the specified time point, restoring the operating system by using operating system backup data contained in a backup file corresponding to the specified time point stored in a hidden protection area HPA;
wherein the designated time point is a first time point or a second time point.
In the above method, if the backup file corresponding to the designated time point includes backup files of operating systems of two or more memory partitions, the operating system is restored by using the operating system backup data included in the backup file corresponding to the designated time point stored in the hidden protection area HPA, which specifically includes the following steps:
and restoring the operating system according to the backup data of the specified memory partition in the backup file corresponding to the specified time point.
The invention provides a BIOS, which comprises the following modules:
the first generation module is used for responding to a command of backing up the operating system data received at a first time point and generating a backup file corresponding to the first time point according to the operating system backup data at the first time point;
the first storage module is used for storing the backup files corresponding to the first time point in a hidden protection area HPA;
the second generation module is used for responding to a command for backing up the operating system data received at a second time point and generating a backup file corresponding to the second time point according to the operating system backup data at the second time point;
the second storage module is used for storing the backup files corresponding to the second time point in a hidden protection area HPA;
and storing the backup file corresponding to the second time point in a hidden protection area HPA, wherein the backup file corresponding to the second time point does not cover the backup file corresponding to the first time point.
The BIOS, described above, hosts an operating system in two or more memory partitions of the memory,
the first generating module specifically includes:
a first generation sub-module for generating a backup subfile for each memory partition designated by a user at a first point in time;
the first packing submodule is used for packing the backup subfiles of each memory partition appointed by a user at a first time point to generate a backup file corresponding to the first time point;
the second generating module specifically includes:
a second generation sub-module for generating a backup subfile for each memory partition designated by the user at a second point in time;
and the second packaging submodule is used for packaging the backup subfiles of each memory partition appointed by the user at the second time point and generating the backup file corresponding to the first time point.
The invention provides a BIOS, which comprises the following modules:
the restoration module is used for responding to a command of restoring the operating system at the specified time point and restoring the operating system by using the operating system backup data contained in the backup file corresponding to the specified time point stored in the hidden protection area HPA;
wherein the designated time point is a first time point or a second time point.
The BIOS, if the backup file corresponding to the designated time point includes backup files of an operating system of two or more memory partitions, the restoring module specifically includes:
and the restoring submodule is used for restoring the operating system according to the backup data of the specified memory partition in the backup file corresponding to the specified time point.
The invention provides a computer comprising any one of the above-mentioned BIOS.
The method, the BIOS and the computer can back up the operating system twice in the BIOS environment to generate two back-up files for restoring the operating system at different time, are not limited by the version and the type of the operating system, and are more flexible in backing up and restoring the operating system.
Detailed Description
The present invention is not limited by the following examples, and specific embodiments may be determined according to the technical solutions and practical situations of the present invention.
The invention is further described with reference to the following examples and figures:
example 1: fig. 1 is a flowchart of a system backup method provided by the present invention, applied to a BIOS, including the following steps:
step S1, responding to the command of backing up the operating system data received at the first time point, and generating a backup file corresponding to the first time point according to the operating system backup data at the first time point;
step S2, storing the backup file corresponding to the first time point in a hidden protection area HPA;
step S3, responding to the command of backing up the operating system data received at the second time point, and generating a backup file corresponding to the second time point according to the operating system backup data at the second time point;
step S4, storing the backup file corresponding to the second time point in a hidden protection area HPA;
step S4 stores the backup file corresponding to the second time point in the hidden protection area HPA, where the backup file corresponding to the second time point does not cover the backup file corresponding to the first time point.
The method of the invention can be applied to the BIOS of the domestic platform (such as Loongson platform, Shenwei platform and the like), the BIOS of the imported platform is often closed, and the customization capability is poor. The method of the invention completes the functions on the bottom layer of the BIOS, and can support various operating systems, and the operating system backed up by the method of the invention can be android, WINDOWS, UNIX or LINUX. The operating system of the domestic platform has relatively higher probability of being unable to enter the operating system due to immature technology, so that the problem that the operating system is possibly unable to enter when the backup and recovery operating system is used in the operating system is generated. In the prior art, the operating system which is widely applied to a mature platform has high stability, the operating system can not be accessed rarely, the mature operating system provides a complete tool for backing up and restoring the operating system, the use is convenient, and the BIOS does not have a mature tool for backing up and restoring the operating system, so that in the prior art, the operating system is backed up in the operating system environment, and the function of backing up and restoring the operating system in the BIOS environment is not easy to think.
The first time point and the second time point are two different time points when the user backs up the operating system and generates the backup file. And during backup, generating a backup file according to the backup data of the operating system during backup of the operating system. The backup file may be a compressed file package, which needs to be decompressed first when the operating system is restored. In the invention, the backup file generated later and the backup file generated earlier are stored in different positions, and do not cover the backup file generated earlier, which is different from the backup file generated by the current backup and covers the backup file backed up last time in the prior art. Thus, when the operating system is restored, the user has two different backup files, and can select one of the two backup files to be used for restoring the operating system. The advantage of generating two backup files for restoring the operating system is that the operating system can be restored to two different states before when the operating system is restored, so that more choices are available, and the backup and the restoration are more flexible.
For example, the operating system is backed up at time T1, the state of the operating system is stable, and after function a is added, the operating system is backed up at time T2, and then the operating system is debugged, which causes an error. At this time, the user can select to restore the state of the operating system at the time point T1 or the state of the operating system at the time point T2, so as to more conveniently determine whether the added function a causes a system error. In order to facilitate the user to distinguish the backup files, the backup files may be named as the time of the backup operating system, may be named as a version number, or may be named as a user-defined name.
After the two backup files are generated, if a command for backing up the operating system is received, the command can be manually selected by a user, and the backup file generated by the current backup is used for replacing the existing backup file.
Optionally, the operating system may also be backed up at multiple time points, and backup files for restoring the operating system at multiple time points are generated. As long as the storage space for storing the backup files is large enough, several more backup files can be stored.
The preferred scheme has the advantages that a user can generate more backup files of the operating system for restoration according to needs, more backup files of the operating system can be used for restoring the operating system during system restoration, and the operating system can be flexibly backed up and restored.
Optionally, when a plurality of backup files exist in the hidden protection area HPA but cannot accommodate the backup file of the operating system that is backed up this time, the backup file that is generated this time may be used to overwrite the earliest generated backup file.
The preferred scheme has the advantages that under the condition that the storage space for storing the backup files is insufficient, the backup files which are generated earlier and have relatively low effectiveness are automatically replaced, the time for manually selecting which backup file needs to be replaced is saved, the backup automation is higher, and the time for backing up the operating system is saved.
The backup file may be stored in a hidden Protected Area HPA (main Protected Area). The principle of the hidden protection area HPA is that after the maximum addressable capacity of the memory is set by the ATA command, the memory area behind this capacity (i.e., the hidden protection area HPA) will be hidden protected, and for this block of hidden protection area, the BIOS or the operating system cannot normally access it unless the hidden protection is turned off by the ATA specific command. To enhance the security of the hidden protected area HPA, higher security level commands in ATAPI (ATA Packet Interface) may be used, such as setting a password, locking, and freezing a lock on the hidden protected area HPA.
Optionally, in embodiment 1 of the present invention, before generating the backup file corresponding to the first time point according to the operating system backup data at the first time point, setting a hidden protection area HPA, and setting an unlocking password of the hidden protection area HPA.
The preferred scheme has the advantages that the unlocking password for unlocking the HPA is set, the HPA can be unlocked only when the user inputs the correct unlocking password, and the safety of the HPA is improved.
Optionally, after storing the backup file corresponding to the second time point in the hidden protection area HPA, embodiment 1 of the present invention further includes locking the hidden protection area HPA.
The method of the invention can carry out two backups under the BIOS environment, generates two backup files for restoring the operating system at different time, is not limited by the version and the type of the operating system, and backs up
The operating system is more flexible.
Example 2: in the method, two or more memory partitions of the memory are provided with the operating system,
step S1 is to generate a backup file corresponding to the first time point according to the operating system backup data at the first time point, which includes the following steps:
step S11, generating a backup subfile of each memory partition designated by the user at a first time point;
step S12, packing the backup subfiles of each memory partition appointed by the user at the first time point, and generating a backup file corresponding to the first time point;
step S3 is to generate a backup file corresponding to the second time point according to the operating system backup data at the second time point, which includes the following steps:
step S31, generating a backup subfile for each memory partition specified by the user at the second point in time;
step S32, packaging the backup subfiles of each memory partition specified by the user at the second time point, and generating a backup file corresponding to the first time point.
In practical applications, the memory may be a hard disk or a flash memory. Embodiment 2 applies to the case where different memory partitions of the memory are loaded with different operating systems, for example, the C-disk is loaded with the Linux operating system and the D-disk is loaded with the Windows operating system, or different memory partitions are loaded with different versions of the operating system, for example, the C-disk is loaded with the Windows 7 operating system and the D-disk is loaded with the Windows 10 operating system.
Embodiment 2 a user may specify an operating system to backup one or more memory partitions. The mode of generating the backup subfiles of one memory partition may be to backup the data of the operating systems in the two memory partitions according to the sectors, and generate the backup subfiles of the two memory partitions respectively. And then packaging and compressing the generated backup subfiles of all the memory partitions to synthesize a backup file.
In this embodiment, the backup file of each memory partition is generated according to the backup data of each memory partition, and when the operating system of a partial memory partition is restored, the backup file of the entire memory does not need to be restored, the backup file of the memory partition specified by the user only needs to be restored, and the speed of restoring the operating system is higher.
Alternatively, the backup operating system may backup the backup data of all memory partitions of the memory into one backup file by sector.
In the preferred embodiment, the operating systems of all the memory partitions of the memory are backed up as a whole, and when the operating systems of all the partitions of the whole memory are restored, the operating systems of all the partitions do not need to be restored by the backup files of all the memory partitions in sequence, so that the speed is higher.
Example 3: the invention provides a system restoring method applied to a BIOS, which comprises the following steps:
step S1, in response to the command of restoring the operating system at the specified time point, restoring the operating system by using the operating system backup data contained in the backup file corresponding to the specified time point stored in the hidden protection area HPA;
wherein the designated time point is a first time point or a second time point.
In practice, the hidden protection area HPA is typically not visible in the default state. The user can set in the BIOS interface to display the HPA of the hidden protection area, and if the HPA of the hidden protection area can be displayed only by setting the password, the password needs to be input. After the hidden protection area HPA is displayed, a user may query the interface of the BIOS for one or more backup files in the hidden protection area HPA for restoring the operating system, and the user may decide which backup file to use to restore the operating system.
The embodiment can determine which time point backup file is used for restoring the operating system according to the selection of the user in the BIOS environment, so that the operating system can be more flexibly restored to the state of the operating system at the time of the backup operating system at the selected time point according to the selection of the user without being limited by the operating system.
Example 4: in the above method, the backup file corresponding to the designated time point includes backup files of operating systems of two or more memory partitions, then step S1 restores the operating system using the operating system backup data included in the backup file corresponding to the designated time point stored in the hidden protection area HPA, which specifically includes the following steps:
step S11 is to restore the operating system according to the backup data of the designated memory partition in the backup file corresponding to the designated point in time.
In practical applications, the present embodiment generally applies to an environment where there are multiple memory partitions in the memory, and different partitions are equipped with different operating systems. The user may specify to restore one or more memory partitions. The backup file for restore is typically a compressed file that includes the backup files for the operating system that was used to restore the multiple memory partitions. The user-specified number of memory partitions may be less than the number of reducible memory partitions contained in the backup file. For example, the backup files included in the backup files may be used to restore the operating systems of the C disk and the D disk, and the user may specify the storage partitions for restoring the C disk and the D disk at most, or may specify the storage partitions for restoring the C disk or the D disk separately.
According to the embodiment, the operating systems of part or all of the memory partitions designated by the user can be restored in the BIOS environment, different operating systems of a plurality of memory partitions can be restored at one time when different operating systems exist in different memory partitions, and the automation degree of restoring the operating systems is higher.
Based on the same inventive concept, the embodiment of the invention also provides the BIOS and the computer for backing up and restoring the operating system, and because the principle of solving the problems of the BIOS and the computer is similar to the method, the implementation of the BIOS and the computer can refer to the implementation of the method, and repeated parts are not described again.
Example 5: FIG. 2 is a schematic diagram of a BIOS according to embodiment 5, comprising the following modules:
the first generation module is used for responding to a command of backing up the operating system data received at a first time point and generating a backup file corresponding to the first time point according to the operating system backup data at the first time point;
the first storage module is used for storing the backup files corresponding to the first time point in a hidden protection area HPA;
the second generation module is used for responding to a command for backing up the operating system data received at a second time point and generating a backup file corresponding to the second time point according to the operating system backup data at the second time point;
the second storage module is used for storing the backup files corresponding to the second time point in a hidden protection area HPA;
and storing the backup file corresponding to the second time point in a hidden protection area HPA, wherein the backup file corresponding to the second time point does not cover the backup file corresponding to the first time point.
Example 6: the BIOS, described above, hosts an operating system in two or more memory partitions of the memory,
the first generating module specifically includes:
a first generation sub-module for generating a backup subfile for each memory partition designated by a user at a first point in time;
the first packing submodule is used for packing the backup subfiles of each memory partition appointed by a user at a first time point to generate a backup file corresponding to the first time point;
the second generating module specifically includes:
a second generation sub-module for generating a backup subfile for each memory partition designated by the user at a second point in time;
and the second packaging submodule is used for packaging the backup subfiles of each memory partition appointed by the user at the second time point and generating the backup file corresponding to the first time point.
Example 7: the invention provides a BIOS, which comprises the following modules:
the restoration module is used for responding to a command of restoring the operating system at the specified time point and restoring the operating system by using the operating system backup data contained in the backup file corresponding to the specified time point stored in the hidden protection area HPA;
wherein the designated time point is a first time point or a second time point.
Example 8: the BIOS, if the backup file corresponding to the designated time point includes backup files of an operating system of two or more memory partitions, the restoring module specifically includes:
and the restoring submodule is used for restoring the operating system according to the backup data of the specified memory partition in the backup file corresponding to the specified time point.
Example 9: the invention provides a computer comprising any one of the above-mentioned BIOS.
The technical characteristics form an embodiment of the invention, which has strong adaptability and implementation effect, and unnecessary technical characteristics can be increased or decreased according to actual needs to meet the requirements of different situations.