Backup and restoration method for multi-restoration-point system of domestic operating system
Through the incremental backup and differential restore technology of the multi-restore point system backup module, the problem of waste of storage space and low recovery efficiency of the operating system backup system is solved, and flexible backup and efficient restore process are realized.
Patent Information
- Application Number
- CN202411064421.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-15
AI Technical Summary
The backup and restore solutions of existing domestic operating systems have problems such as wasting storage space and low multi-restore point recovery efficiency, especially full backups occupy a large amount of space, while incremental backups are difficult to achieve flexible multi-restore point recovery, and the recovery process is long and Prone to errors.
The multi-restore point system backup module is used to determine whether the first backup is not required, select the full or incremental backup mode, jointly mount the backup directory for differential file identification and backup, save the incremental backup point, and the user can select any restore point for differential restore. .
有效节约存储空间,提高备份效率,并允许用户灵活选择还原点,缩短还原时间,提高还原过程的准确性和效率。
Smart Images

Figure CN118964093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for backing up and restoring a system with multiple restore points in a domestic operating system. Background Art
[0002] For domestic operating systems, virus invasion and improper human operation may cause data loss, abnormal program operation, and even operating system crash. Therefore, it is necessary to provide backup and restore functions for the operating system and user data. Users can back up the operating system and data at a certain time point and restore them to the system state at the time of backup when needed. In short, the system backup and restore function is the last line of defense for system reliability. Its purpose is to quickly repair the system and user data when the system is abnormal.
[0003] Multiple restore points means that the user has made multiple system backups at different time points. When needed, the user can choose to restore the system to the state at the time of a backup. The multiple restore point backup and restore technology not only ensures the reliability of the system, but also further improves the usability and flexibility of the system.
[0004] At present, there are two main backup and restore solutions for domestic Linux-based operating systems: (1) One is the full system backup and restore solution, which is to back up the entire system in full. The disadvantage of this solution is that if the user performs multiple system backups, it will take up a lot of redundant storage space. For example, if the initial data of a system is 50GB, then each system backup will repeatedly save the above 50GB system data.
[0005] (2) Another is the incremental system backup and restore solution, which means that the entire system is fully backed up only during the first system backup, and only the files that are different from the last system backup are backed up during subsequent system backups. The advantage of this solution is that it greatly reduces the storage space occupied by the backup files. The disadvantage of this solution is that it is very difficult to implement a multi-restore point system restore. For example, when performing incremental system backup, some technologies will overwrite the last backup node with each incremental backup, resulting in the user being unable to choose to restore to the system state at a certain system backup, and can only restore to the system state at the last backup; some technologies can retain n incremental backup nodes, but when choosing to restore to the previous i-th backup node, the system needs to roll back the state in sequence, from the nth, n-1, n-2... to the i-th backup node, and the system needs a total of (ni) rollbacks. The biggest disadvantage of this technology is that the system restoration time is long and prone to errors. Summary of the invention
[0006] To solve the above problems, the present invention provides a method for backing up and restoring a system with multiple restore points in a domestic operating system, which adopts the following technical solutions: A method for backing up and restoring a system with multiple restore points for a domestic operating system, comprising: When the user needs to perform a system backup, the multi-restore point system backup module determines the backup mode corresponding to the current system, and backs up the current system based on the backup mode, which includes full backup and incremental backup; When the user needs to restore the system, the current system is restored based on the system restore point selected by the user by using the multi-restore point system restore module.
[0007] In a possible implementation, determining a backup mode corresponding to the current system by a multi-restore point system backup module, and backing up the current system based on the backup mode includes: Step S101, obtaining the current backup date and determining whether it is the first system backup. If it is the first system backup, executing step S102; if not, continuing to executing step S104; Step S102, creating an initial backup directory in the backup partition; Step S103, back up the current system in full to the initial backup directory, save the initial backup system, and continue to step S109; Step S104, creating an incremental backup directory marked with a backup date in the backup partition; Step S105, jointly mounting the incremental backup directory and the initial backup directory, setting the initial backup directory to read-only mode and the incremental backup directory to read-write mode; Step S106, comparing the system files of the current system with the system files recorded in the initial backup directory in the joint mount directory, identifying the differences between the current system and the initial backup system, and obtaining a backup difference file; Step S107, performing incremental backup, backing up the backup difference file to the incremental backup directory created this time; Step S108, canceling the joint mount; Step S109: setting a system restore point based on the backup date.
[0008] In a possible implementation, comparing the system files of the current system with the system files recorded in the initial backup directory in the joint mount directory, identifying the differences between the current system and the initial backup system, and obtaining the backup difference file includes: Using rolling weak verification and strong verification, the system files of the current system are compared with the system files recorded in the initial backup directory in the joint mount directory, the differences between the current system and the initial backup system are identified, and the backup difference files are obtained.
[0009] In a possible implementation, restoring the current system based on the system restore point selected by the user by using the multi-restore point system restore module includes: Step S201, the user selects a corresponding system restore point according to the system state to be restored; Step S202, determining whether the system restore point with a date mark is an initial restore point, if yes, executing step S203, if no, executing step S205; Step S203, mounting the initial backup directory; Step S204, perform initial restoration, restore the current system to the initial backup state, and continue to step S210; Step S205, selecting a corresponding incremental backup directory based on the date identifier of the system restore point; Step S206, jointly mounting the selected incremental backup directory and the initial backup directory; Step S207, comparing the system files in the joint mount directory with the system files of the current system through rolling weak verification and strong verification, and identifying the difference files to be restored; Step S208, performing differential restoration based on the restored differential file; Step S209, canceling the joint mount; Step S210: the current system is restored to the system state corresponding to the system restore point selected by the user.
[0010] In summary, this application includes the following beneficial technical effects: (1) When performing a multi-restore point system backup, since only incremental backup is performed, the storage space occupied by the system backup files can be effectively saved, while significantly improving the efficiency of the system backup.
[0011] (2) When performing a multi-restore point system restore, since the system restore points during the incremental backup are saved, the user can select any system restore point to restore the system to the system state during the incremental backup. In addition, since only differential restoration is performed, the efficiency of system restore is also improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the workflow of the multi-restore point system backup module in an embodiment of the present application.
[0013] Figure 2 This is an example diagram of a joint mounting operation on an incremental backup directory and an initial backup directory in an embodiment of the present application.
[0014] Figure 3Schematic diagram of the workflow of the multi-restore point system restore module in the embodiment of the present application.
[0015] Figure 4 This is an example diagram of performing system backup and restoration in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The present application is further described in detail below in conjunction with the accompanying drawings.
[0017] After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed, but such modifications are protected by patent law as long as they are within the scope of the claims of this application.
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0020] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0021] The embodiment of the present application provides a method for backing up and restoring a system with multiple restore points in a domestic operating system, including two parts: system backup and system restoration. The system backup is performed through a multi-restore point system backup module, and the system restoration is performed through a multi-restore point system restoration module. 1. The specific workflow of the multi-restore point system backup module is as follows: Figure 1 As shown, the specific process includes the following: Step S101, obtaining the current backup date and determining whether it is the first system backup. If it is the first system backup, executing step S102; if not, continuing to executing step S104; Step S102, creating an initial backup directory in the backup partition; Step S103, back up the current system in full to the initial backup directory, save the initial backup system, and continue to step S109; Step S104, creating an incremental backup directory marked with a backup date in the backup partition; Step S105, jointly mount the incremental backup directory and the initial backup directory, set the initial backup directory to read-only mode, and set the incremental backup directory to read-write mode.
[0022] For the embodiment of the present application, joint mounting means that in order to retain the restore point during the incremental backup of the system, each time the incremental backup is performed, the incremental backup directory identified by the backup date and the initial backup directory are merged into one directory through mounting, that is, the joint mount directory.
[0023] When joint mounting, in order to retain the system restore point of the first full backup, the initial backup directory needs to be set as a read-only directory; in order to save the incremental restore point of each incremental backup, a new incremental backup directory needs to be created for each incremental backup and set to read-write. Therefore, all file operations (addition, deletion, modification) on the joint mounting directory will only be saved in the incremental backup directory, and the initial backup directory files will remain unchanged.
[0024] For ease of understanding, Figure 2 As shown in the figure, when the system is backed up, the following operations are performed on the joint mount directory: modify File2, delete File3, and add File4. The file operation results will be kept in the incremental backup directory, so each incremental restore point can be retained; the initial backup directory file will not change and will remain the initial restore point.
[0025] Step S106, comparing the system files of the current system with the system files recorded in the initial backup directory in the joint mount directory, identifying the differences between the current system and the initial backup system, and obtaining a backup difference file.
[0026] For the embodiment of the present application, by using rolling weak check and strong check, the system files of the current system are compared with the system files recorded in the initial backup directory in the joint mount directory, the difference between the current system and the initial backup system is identified, and the backup difference file is obtained, wherein the rolling weak check and strong check refer to dividing the files of the two directories into a number of non-overlapping data blocks of size N (the size of the blocks at the end of the file may be less than N), and performing two different methods of checking these data blocks: 32-bit weak check and 128-bit strong check, generating a weak check value and a strong check value for each data block. By matching the weak check and strong check values in sequence, the difference files between the two directories can be quickly found.
[0027] Step S107, performing incremental backup, backing up the backup difference file to the incremental backup directory created this time; Step S108, cancel the joint mount.
[0028] For the embodiment of the present application, since the initial backup directory is read-only, the incremental backup directory stores the difference files between the current system and the initial backup system; The files saved in the incremental backup directory here are the system difference files of the current system backup time point relative to the initial backup time point (including not only newly added files, but also modified files and deleted files), rather than the system changes relative to the previous incremental backup time point.
[0029] Step S109: setting a system restore point based on the backup date.
[0030] 2. The specific workflow of the multi-restore point system restore module is as follows: Figure 3 As shown, the specific process is as follows: Step S201, the user selects a corresponding system restore point according to the system state to be restored; Step S202, determining whether the system restore point with a date mark is an initial restore point, if yes, executing step S203, if no, executing step S205; Step S203, mounting the initial backup directory; Step S204, perform initial restoration, restore the current system to the initial backup state, and continue to step S210; Step S205, selecting a corresponding incremental backup directory based on the date identifier of the system restore point; Step S206, jointly mounting the selected incremental backup directory and the initial backup directory; Step S207, comparing the system files in the joint mount directory with the system files of the current system through rolling weak verification and strong verification, and identifying the difference files to be restored; Step S208, performing differential restoration based on the restored differential file; Step S209, canceling the joint mount; Step S210: the current system is restored to the system state corresponding to the system restore point selected by the user.
[0031] In order to facilitate a clearer understanding of the technical solution of this application, Figure 4 As shown, the domestic operating system multi-restore point system backup and restore method proposed in this application will be described in combination with examples, as follows: Assume that the current system has been backed up three times and has three system restore points: when performing the first system backup, assuming that the running system files are 50G, a full backup is performed at this time, occupying 50G of storage space of the backup partition, and the first system restore point is created; when performing the second system backup, an incremental backup method is used. Assuming that the current running system files increase by 20G, the total system files are 70G, at this time the incremental backup only needs to occupy 20G of storage space of the backup partition, and the second system restore point is created, while the first system restore point is retained. When the user selects the second system restore point, the system running state corresponding to the second system restore point can be restored; When performing the third system backup, assuming that the running system backup file increases by another 10G, that is, the current system file is 80G in total. At this time, the incremental backup only needs to occupy 30G of storage space of the backup partition, and create a third system restore point. At the same time, the second system restore point is retained. When the user selects the third system restore point, the system running state corresponding to the third system restore point can be restored.
[0032] At this time, the three backup files of the system occupy a total of 100G of storage space of the backup partition. When the backup scheme of the prior art is adopted, all full backups are used. Continuing with the above example, when the first backup is performed, 50G of storage space of the backup partition will be occupied. When the second system backup is performed, 70G of storage space of the backup partition will be occupied. When the three system backups are performed, 80G of storage space of the backup partition will be occupied. That is, when the backup scheme in the prior art is adopted, a total of 200G of storage space of the backup partition will be occupied. Therefore, the present application can significantly reduce the storage space of the backup partition occupied by the backup files. The present application saves multiple system backup nodes and only performs differential restoration, thereby improving the restoration efficiency of the system.
[0033] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for backing up and restoring a system with multiple restore points in a domestic operating system, characterized in that: include: When the user needs to perform a system backup, the multi-restore point system backup module determines the backup mode corresponding to the current system, and backs up the current system based on the backup mode, which includes full backup and incremental backup; When the user needs to restore the system, the current system is restored based on the system restore point selected by the user by using the multi-restore point system restore module.
2. According to claim 1, a method for backing up and restoring a system with multiple restore points in a domestic operating system, characterized in that: The step of determining a backup mode corresponding to the current system by using a multi-restore point system backup module and backing up the current system based on the backup mode includes: Step S101, obtaining the current backup date and determining whether it is the first system backup. If it is the first system backup, executing step S102; if not, continuing to executing step S104; Step S102, creating an initial backup directory in the backup partition; Step S103, back up the current system in full to the initial backup directory, save the initial backup system, and continue to step S109; Step S104, creating an incremental backup directory marked with a backup date in the backup partition; Step S105, jointly mounting the incremental backup directory and the initial backup directory, setting the initial backup directory to read-only mode and the incremental backup directory to read-write mode; Step S106, comparing the system files of the current system with the system files recorded in the initial backup directory in the joint mount directory, identifying the differences between the current system and the initial backup system, and obtaining a backup difference file; Step S107, performing incremental backup, backing up the backup difference file to the incremental backup directory created this time; Step S108, canceling the joint mount; Step S109: setting a system restore point based on the backup date.
3. According to claim 2, a method for backing up and restoring a system with multiple restore points in a domestic operating system, characterized in that: The system files of the current system are compared with the system files recorded in the initial backup directory in the joint mount directory, the difference between the current system and the initial backup system is identified, and the backup difference file is obtained, including: Using rolling weak verification and strong verification, the system files of the current system are compared with the system files recorded in the initial backup directory in the joint mount directory, the differences between the current system and the initial backup system are identified, and the backup difference files are obtained.
4. According to claim 1, a method for backing up and restoring a system with multiple restore points of a domestic operating system is characterized in that: The method of restoring the current system based on the system restore point selected by the user by using the multi-restore point system restore module includes: Step S201, the user selects a corresponding system restore point according to the system state to be restored; Step S202, determining whether the system restore point with a date mark is an initial restore point, if yes, executing step S203, if no, executing step S205; Step S203, mounting the initial backup directory; Step S204, perform initial restoration, restore the current system to the initial backup state, and continue to step S210; Step S205, selecting a corresponding incremental backup directory based on the date identifier of the system restore point; Step S206, jointly mounting the selected incremental backup directory and the initial backup directory; Step S207, comparing the system files in the joint mount directory with the system files of the current system through rolling weak verification and strong verification, and identifying the difference files to be restored; Step S208, performing differential restoration based on the restored differential file; Step S209, canceling the joint mount; Step S210: the current system is restored to the system state corresponding to the system restore point selected by the user.
