Encrypted disk backup method, device, electronic device, storage medium and product

By setting the encrypted disk format to the source disk format and avoiding decryption processing, secure backup of the encrypted disk is achieved, solving the problem of data leakage during the backup process, supporting full and incremental backup, ensuring data security and backup flexibility. .

CN118260815BActive Publication Date: 2024-08-27JINAN INSPUR DATA TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202410693343.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-27
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

Existing encrypted disk backup methods require decryption processing during the backup process, which risks data leakage and affects data security.

Method used

By setting the encrypted disk format to the source disk format (RAW format), data blocks are backed up during backup to avoid decryption processing, thereby achieving full and incremental backup and ensuring data security.

Benefits of technology

It effectively avoids the problem of data leakage during the encrypted disk backup process, ensures the security of disk data, and supports full and incremental backup modes, with high flexibility and applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260815B
    Figure CN118260815B
Patent Text Reader

Abstract

The present invention discloses an encrypted disk backup method, device, electronic device, storage medium and product, which are applied to the field of data security technology and are used to solve the problem of disk data leakage caused by the need to decrypt the disk during the traditional encrypted disk backup process. The method comprises: determining a target encrypted disk and a backup working mode according to a backup request; setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; the format conversion disk comprises a plurality of data blocks in an encrypted state; in a full disk backup mode, backing up each data block in the format conversion disk to obtain each first backup data block; generating a full backup disk based on each first backup data block; in an incremental disk backup mode, determining each incremental data block in the format conversion disk according to an IO log of the target encrypted disk; backing up each incremental data block to obtain each second backup data block; and generating an incremental backup disk based on each second backup data block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data security technology, and in particular to an encrypted disk backup method, and also to an encrypted disk backup device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] Due to market needs, especially in some user scenarios that require strict confidentiality, data security is particularly important. For these users, in order to prevent data leakage, the disk needs to be encrypted. At the same time, in order to prevent data loss, the disk data needs to be backed up regularly. However, the existing method of backing up encrypted disks often requires the use of user keys (i.e., the keys of encrypted disks), so it involves the decryption of encrypted disks. Obviously, this will have the risk of stored data being leaked, affecting data security.

[0003] Therefore, how to avoid disk data leakage and ensure disk data security during encrypted disk backup is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0004] An object of the present invention is to provide an encrypted disk backup method, which can avoid disk data leakage during the encrypted disk backup process and ensure the security of the disk data; another object of the present invention is to provide an encrypted disk backup device, an electronic device, a computer-readable storage medium and a computer program product, all of which have the above-mentioned beneficial effects.

[0005] In a first aspect, the present invention provides an encrypted disk backup method, comprising:

[0006] Determine the target encrypted disk and the backup working mode according to the backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode;

[0007] Setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state;

[0008] When the backup working mode is the full disk backup mode, each data block in the format conversion disk is backed up to obtain each first backup data block; a full backup disk is generated based on each first backup data block to achieve full backup of the target encrypted disk;

[0009] When the backup working mode is the incremental disk backup mode, the incremental data blocks in the format conversion disk are determined according to the IO log of the target encrypted disk; each incremental data block is backed up to obtain each second backup data block; and an incremental backup disk is generated based on each second backup data block to realize the incremental backup of the target encrypted disk.

[0010] The step of backing up each data block in the format conversion disk to obtain each first backup data block includes:

[0011] Determine the target virtual machine to which the target encrypted disk belongs;

[0012] When the target virtual machine is in operation, snapshot processing is performed on the format conversion disk to obtain a first disk snapshot; each data block in the first disk snapshot is backed up to obtain each first backup data block;

[0013] When the target virtual machine is in a non-operating state, each data block in the format conversion disk is backed up to obtain each first backup data block.

[0014] Wherein, determining each incremental data block in the format conversion disk according to the IO log of the target encrypted disk includes:

[0015] Determine the latest historical backup disk and the historical IO log corresponding to the latest historical backup disk;

[0016] Obtaining a current IO log of the target encrypted disk, and determining an incremental IO log according to the current IO log and the historical IO log;

[0017] Performing snapshot processing on the latest historical backup disk to obtain a second disk snapshot;

[0018] The incremental data blocks in the format conversion disk are determined according to the second disk snapshot and the incremental IO log.

[0019] Wherein, after backing up each of the incremental data blocks to obtain each of the second backup data blocks, the method further includes:

[0020] Get the execution result of the current incremental backup operation;

[0021] If the execution result of the current incremental backup operation is successful, the historical IO log is deleted and the current IO log is saved;

[0022] If the execution result of the current incremental backup operation is execution failure, the historical IO log is retained and backup failure prompt information is output.

[0023] Wherein, the encrypted disk backup method further comprises:

[0024] Determine the target virtual machine to which the target encrypted disk belongs;

[0025] Creating an IO log corresponding to the target encrypted disk for the target virtual machine;

[0026] The number of record fields in the IO log is equal to the number of data blocks in the target encrypted disk, the record fields correspond to the data blocks one by one, and the record fields are used to store change flags of corresponding data blocks.

[0027] The step of creating an IO log corresponding to the target encrypted disk for the target virtual machine includes:

[0028] Determine whether the target virtual machine is in a running state;

[0029] When the target virtual machine is in a non-operating state, creating a virtual machine management process corresponding to the target encrypted disk, and using the virtual machine management process to execute a log adding command to create an IO log corresponding to the target encrypted disk;

[0030] When the target virtual machine is in a running state, the log adding command is executed using the current virtual machine process to create an IO log corresponding to the target encrypted disk.

[0031] Wherein, after using the virtual machine management process to execute the log adding command to create the IO log corresponding to the target encrypted disk, it also includes:

[0032] Close the virtual machine management process corresponding to the target encrypted disk.

[0033] Wherein, the encrypted disk backup method further comprises:

[0034] Creating a backup storage pool corresponding to the target encrypted disk;

[0035] Correspondingly, after generating a full backup disk based on each of the first backup data blocks to implement a full backup of the target encrypted disk, the method further includes: saving the full backup disk to the backup storage pool;

[0036] After generating an incremental backup disk based on each of the second backup data blocks to implement the incremental backup of the target encrypted disk, the method further includes: saving the incremental backup disk to the backup storage pool.

[0037] The step of creating a backup storage pool corresponding to the target encrypted disk includes:

[0038] Determine the disk size of the target encrypted disk;

[0039] Create a backup storage pool with a storage space no less than the disk size.

[0040] Before the incremental backup disk is saved in the backup storage pool, the method further includes:

[0041] Determine the current available space size of the backup storage pool;

[0042] When the current available space size is not less than the disk size of the incremental backup disk, executing the step of saving the incremental backup disk to the backup storage pool;

[0043] When the current available space size is smaller than the disk size of the incremental backup disk, an alarm prompt is output.

[0044] Wherein, the encrypted disk backup method further comprises:

[0045] When receiving a virtual machine recovery request, determining a request type of the virtual machine recovery request;

[0046] When the request type is a request to restore a new virtual machine, a new virtual machine is created, and the full backup disk or the incremental backup disk is overwritten with a new disk of the new virtual machine, and an encryption key corresponding to the new virtual machine is generated to realize virtual machine recovery;

[0047] When the request type is a request to restore the original virtual machine, the original virtual machine is shut down, and the full backup disk or the incremental backup disk overwrites the original disk of the original virtual machine to achieve virtual machine recovery.

[0048] The backup working mode is determined according to the backup request, including:

[0049] Determining whether the backup request is a first backup request for the target encrypted disk;

[0050] If the backup request is the first backup request, determining that the backup working mode is the full disk backup mode;

[0051] If the backup request is not the first backup request, the backup working mode is determined to be the incremental disk backup mode.

[0052] In a second aspect, the present invention further discloses an encrypted disk backup device, comprising:

[0053] A determination module, used to determine a target encrypted disk and a backup working mode according to a backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode;

[0054] A conversion module, used to set the disk format of the target encrypted disk to the source disk format, and obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state;

[0055] A first backup module, configured to back up each data block in the format conversion disk to obtain each first backup data block when the backup working mode is the full disk backup mode; and generate a full backup disk based on each first backup data block to achieve a full backup of the target encrypted disk;

[0056] The second backup module is used to determine each incremental data block in the format conversion disk according to the IO log of the target encrypted disk when the backup working mode is the incremental disk backup mode; back up each incremental data block to obtain each second backup data block; generate an incremental backup disk based on each second backup data block to realize the incremental backup of the target encrypted disk.

[0057] In a third aspect, the present invention further discloses an electronic device, comprising:

[0058] Memory for storing computer programs;

[0059] A processor is used to implement the steps of any one of the encrypted disk backup methods described above when executing the computer program.

[0060] In a fourth aspect, the present invention further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the encrypted disk backup methods described above are implemented.

[0061] In a fifth aspect, the present invention further discloses a computer program product, including a computer program / instruction, which implements the steps of any one of the encrypted disk backup methods described above when executed by a processor.

[0062] The present invention provides an encrypted disk backup method, comprising: determining a target encrypted disk and a backup working mode according to a backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode; setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state; when the backup working mode is the full disk backup mode, backing up each data block in the format conversion disk to obtain each first backup data block; generating a full backup disk based on each first backup data block to achieve a full backup of the target encrypted disk; when the backup working mode is the incremental disk backup mode, determining each incremental data block in the format conversion disk according to an IO log of the target encrypted disk; backing up each incremental data block to obtain each second backup data block; generating an incremental backup disk based on each second backup data block to achieve an incremental backup of the target encrypted disk.

[0063] By applying the technical solution provided by the present invention, for the encrypted disk to be backed up, the disk format can be set first, that is, the disk format can be set to the source disk format (RAW format, RAW Image Format). Therefore, when backing up the encrypted disk, it can be treated as a common disk for backup processing, that is, the encrypted disk is backed up in units of data blocks, and the data blocks are data blocks in an encrypted state. Obviously, there is no need to decrypt the encrypted data blocks in this process, so the backup process of the entire encrypted disk will not involve the decryption processing of the encrypted disk. Therefore, it will not cause the problem of disk data leakage, and effectively ensure the security of the disk data. In addition, the encrypted disk backup processing method provided by the technical solution can support both full backup mode and incremental backup mode. In the full backup mode, each disk data block can be directly backed up, and in the incremental backup mode, the incremental data block can be determined and backed up in combination with the IO log corresponding to the target encrypted disk, which has high flexibility and applicability.

[0064] The encrypted disk backup device, electronic device, computer-readable storage medium and computer program product provided by the present invention also have the above-mentioned technical effects, and the present invention will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present invention, the drawings required for describing the prior art and the embodiments of the present invention are briefly introduced below. Of course, the drawings related to the embodiments of the present invention below only describe some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present invention.

[0066] Figure 1 A schematic diagram of the structure of an encrypted disk backup system provided by the present invention;

[0067] Figure 2 A schematic diagram of the principle of a LUKS encrypted disk backup method provided by the present invention;

[0068] Figure 3 A schematic diagram of the format of an IO log provided by the present invention;

[0069] Figure 4 A schematic diagram of the structure of an encrypted disk backup device provided by the present invention;

[0070] Figure 5 The present invention is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0071] The core of the present invention is to provide an encrypted disk backup method, which can avoid disk data leakage during the encrypted disk backup process and ensure the security of the disk data; another core of the present invention is to provide an encrypted disk backup device, electronic device, computer-readable storage medium and computer program product, all of which have the above-mentioned beneficial effects.

[0072] In order to describe the technical solutions in the embodiments of the present invention more clearly and completely, the technical solutions in the embodiments of the present invention will be introduced below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] An embodiment of the present invention provides an encrypted disk backup method.

[0074] Please refer to Figure 1 , Figure 1 This is a flow chart of an encrypted disk backup method provided by the present invention. The encrypted disk backup method may include the following S101 to S104.

[0075] S101: Determine a target encrypted disk and a backup working mode according to a backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode;

[0076] This step aims to determine the target encrypted disk and the backup working mode, wherein the target encrypted disk is the encrypted disk that needs to be backed up (the disk in the encrypted state, the encryption method is not limited), and the backup working mode is the backup method of the target encrypted disk, which can include the full disk backup mode and the incremental disk backup mode. Specifically, the target encrypted disk and the backup working mode can be determined according to the backup request, which can be achieved by parsing the backup request. The method of obtaining the backup request is not unique, and can be directly initiated by the user based on the terminal, or can be automatically triggered based on the preset response conditions, which is not limited by the present invention.

[0077] In one embodiment of the present invention, determining the backup working mode according to the backup request may include:

[0078] Determine whether the backup request is the first backup request for the target encrypted disk;

[0079] If the backup request is the first backup request, the backup working mode is determined to be the full disk backup mode;

[0080] If the backup request is not the first backup request, the backup working mode is determined to be the incremental disk backup mode.

[0081] The embodiment of the present invention provides an implementation method for determining a backup working mode according to a backup request. It can be understood that full backup refers to backing up all data, and incremental backup refers to backing up only the changed data among all data. Therefore, for the target encrypted disk, a full backup can be performed only when the backup operation is performed for the first time, and only incremental backup can be performed thereafter. In the implementation process, it can be first determined whether the currently received backup request is the first backup request for the target encrypted disk. If so, the full disk backup mode can be directly adopted. Otherwise, the incremental disk backup mode can be adopted.

[0082] S102: Setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state;

[0083] This step is to achieve the disk format setting process, that is, to set the disk format of the target encrypted disk to the source disk format, here the RAW format, to obtain a format conversion disk, which includes multiple data blocks in an encrypted state. It is understandable that after completing the source format setting, when backing up the target encrypted disk in the source format, it can be backed up as a normal disk, that is, the encrypted disk is backed up in encrypted data blocks. Obviously, there is no need to decrypt the encrypted data blocks in this process, so the entire encrypted disk backup process does not involve the decryption of the encrypted disk, so it will not cause disk data leakage problems, and can effectively ensure the security of disk data.

[0084] The setting of the disk format may be implemented based on corresponding tools, for example, the convert command of the qemu-img tool may be used.

[0085] S103: When the backup working mode is the full disk backup mode, back up each data block in the format conversion disk to obtain each first backup data block; generate a full backup disk based on each first backup data block to achieve full backup of the target encrypted disk;

[0086] This step is aimed at achieving full disk backup. Specifically, when it is determined that the current backup working mode is the full disk backup mode, each data block in the format conversion disk can be directly backed up (it should be noted that each data block here is in an encrypted state and does not need to be decrypted during the backup process). Here, each data block can be backed up in sequence according to the arrangement order of each data block to obtain each backup data block, that is, the first backup data block mentioned above. Thus, a full backup disk can be generated based on each first backup data block to achieve full backup of the target encrypted disk.

[0087] In one embodiment of the present invention, backing up each data block in the format conversion disk to obtain each first backup data block may include:

[0088] Determine the target virtual machine to which the target encrypted disk belongs;

[0089] When the target virtual machine is in a running state, snapshot processing is performed on the format conversion disk to obtain a first disk snapshot; each data block in the first disk snapshot is backed up to obtain each first backup data block;

[0090] When the target virtual machine is in a non-operating state, each data block in the format conversion disk is backed up to obtain each first backup data block.

[0091] The embodiment of the present invention provides a method for implementing a full backup of a target encrypted disk. Specifically, when the target encrypted disk is a virtual machine disk, the full backup process can be implemented in combination with the running state of the virtual machine to which the target encrypted disk belongs (i.e., the above-mentioned target virtual machine). It can be understood that when the target virtual machine is in a running state, if the target encrypted disk is directly backed up, the problem of inconsistent disk data before and after the backup may occur due to the read and write processing of the target encrypted disk by the target virtual machine during the backup process, which may also cause instability in the backup process. Therefore, when the target virtual machine is in a running state, a snapshot of the format conversion disk (i.e., the above-mentioned first disk snapshot) can be used to implement a full backup of the target encrypted disk. When the target virtual machine is in a non-running state, since the read and write processing of the target encrypted disk by the target virtual machine is not involved, the target encrypted disk can be directly backed up in full.

[0092] In one embodiment of the present invention, backing up each data block in the format conversion disk to obtain each first backup data block may include:

[0093] For each data block in the format conversion disk, determining identification information of the data block;

[0094] When the identification information is a zero flag bit, the data block is removed;

[0095] When the identification information is a data flag bit, the data blocks are backed up to obtain first backup data blocks.

[0096] The embodiment of the present invention provides a method for implementing a full backup of a target encrypted disk. It is understandable that in the process of reading and writing data on the encrypted disk, some of the data blocks therein may be invalid data blocks. Therefore, in order to ensure the backup efficiency, they may not be backed up, wherein the flag information of each data block may be used to determine whether each data block is a valid data block. Specifically, for each data block in the format conversion disk, the identification information of the data block may be determined first, and the identification information may be divided into a zero flag bit (zero flag bit) and a data flag bit (data flag bit). The zero flag bit indicates that the data block is invalid (the data block is not used), and the data flag bit indicates that the data block is valid (the data block is actually used). Therefore, the data blocks with the flag information of the zero flag bit may be directly skipped, and only the data blocks with the flag information of the data flag bit may be backed up, thereby obtaining each first backup data block.

[0097] Therefore, invalid data blocks are eliminated during the backup process, and only valid data blocks in the target encrypted disk are backed up. This can reduce the number of data blocks to be backed up to a certain extent without affecting the backup results of the target encrypted disk, effectively improving the backup efficiency of the encrypted disk.

[0098] S104: When the backup working mode is the incremental disk backup mode, determine each incremental data block in the format conversion disk according to the IO log of the target encrypted disk; back up each incremental data block to obtain each second backup data block; generate an incremental backup disk based on each second backup data block to achieve incremental backup of the target encrypted disk.

[0099] This step is intended to achieve incremental disk backup. Specifically, an IO log can be added to the target encrypted disk to record the data changes of each encrypted data block in the target encrypted disk. Therefore, when the current backup working mode is determined to be the incremental disk backup mode, the encrypted data blocks with data changes can be determined in combination with the IO log of the target encrypted disk, i.e., the incremental data blocks mentioned above, and backed up to obtain the incremental data blocks of each backup, i.e., the second backup data blocks mentioned above. Therefore, an incremental backup disk can be generated based on each second backup data block to achieve incremental backup of the target encrypted disk.

[0100] In one embodiment of the present invention, the above-mentioned determining each incremental data block in the format conversion disk according to the IO log of the target encryption disk may include:

[0101] Determine the latest backup disk and the historical IO log corresponding to the latest backup disk;

[0102] Obtain the current IO log of the target encrypted disk, and determine the incremental IO log based on the current IO log and historical IO log;

[0103] Take a snapshot of the latest backup disk in history to obtain a second disk snapshot;

[0104] The incremental data blocks in the format conversion disk are determined according to the second disk snapshot and the incremental IO log.

[0105] The embodiment of the present invention provides an implementation method for determining incremental data blocks based on IO logs. It can be understood that incremental backup refers to backing up only the data blocks with data changes in the encrypted disk, while the data blocks with no data changes do not need to be backed up. Therefore, in the process of two adjacent incremental backup operations, the data blocks for the latter incremental backup are: the data blocks with data changes between the time of the last incremental backup and the time of the next incremental backup.

[0106] Based on this, in the incremental disk backup mode, the latest historical backup disk and its corresponding historical IO log can be determined first, where the latest historical backup disk is the backup disk obtained by the most recent incremental backup, and the historical IO log is the IO log obtained at the most recent backup time; then the current IO log of the target encrypted disk is obtained, that is, the IO log obtained at the current backup time, and thus, the incremental IO log can be determined by comparing the current IO log with the historical IO log, that is, the IO log between the most recent incremental backup time and the current incremental backup time; finally, the incremental data blocks in the format conversion disk can be determined based on the latest historical backup disk and the incremental IO log, and this process can be implemented based on the snapshot (that is, the second disk snapshot mentioned above) to effectively avoid the problem of inconsistent disk data before and after the backup due to the read and write processing of the target virtual machine on the target encrypted disk during the backup process, thereby ensuring the accuracy of the encrypted disk backup result.

[0107] In one embodiment of the present invention, after backing up each incremental data block to obtain each second backup data block, the following steps may also be included:

[0108] Get the execution result of the current incremental backup operation;

[0109] If the execution result of the current incremental backup operation is successful, the historical IO log is deleted and the current IO log is saved;

[0110] If the execution result of the current incremental backup operation is failure, the historical IO log is retained and a backup failure prompt message is output.

[0111] The encrypted disk backup method provided by the embodiment of the present invention further realizes the post-processing function of the backup operation. After completing the current incremental backup operation, its execution result can be obtained, that is, whether the incremental backup operation is successfully executed. If it is successfully executed, the historical IO log can be deleted, and only the current IO log is retained to effectively save storage resources. Among them, the retained current IO log can be used as the historical IO log for the next incremental backup operation; on the contrary, if the incremental backup operation fails to execute, the historical IO log can continue to be retained (the current IO log is not credible), and the backup failure prompt information can be output at the same time to remind the user to handle the exception in time.

[0112] In one embodiment of the present invention, the encrypted disk backup method may further include:

[0113] Determine the target virtual machine to which the target encrypted disk belongs;

[0114] Create an IO log corresponding to the target encrypted disk for the target virtual machine;

[0115] The number of record fields in the IO log is equal to the number of data blocks in the target encrypted disk, the record fields correspond to the data blocks one by one, and the record fields are used to store the change flags of the corresponding data blocks.

[0116] As described above, the incremental backup processing of the target encrypted disk can be realized in combination with the IO log of the target encrypted disk. Therefore, at the beginning of the use of the target encrypted disk, an IO log can be created for the target encrypted disk. Specifically, when the target encrypted disk is a virtual machine disk, an IO log can be directly created for the target virtual machine to which the target encrypted disk belongs. The IO log consists of a certain number of record fields, and a record field is used to store the data change of an encrypted data block, that is, the above-mentioned change flag. For example, when there is a data change, the corresponding record field is set to 1, and when there is no data change, the corresponding record field is set to 0. Therefore, the number of record fields in the IO log is equal to the number of encrypted data blocks in the target encrypted disk, and the two correspond one to one.

[0117] In one embodiment of the present invention, the above-mentioned creation of an IO log corresponding to the target encrypted disk for the target virtual machine may include:

[0118] Determine whether the target virtual machine is in a running state;

[0119] When the target virtual machine is in a non-operating state, a virtual machine management process corresponding to the target encrypted disk is created, and a log adding command is executed by using the virtual machine management process to create an IO log corresponding to the target encrypted disk;

[0120] When the target virtual machine is in a running state, the log adding command is executed using the current virtual machine process to create an IO log corresponding to the target encrypted disk.

[0121] The embodiment of the present invention provides a method for creating an IO log for a target encrypted disk. Specifically, different IO log creation methods can be used for different target virtual machine running states. When the target virtual machine is in a non-running state, a virtual machine management process corresponding to the target encrypted disk can be created first, thereby executing a log adding command through the virtual machine management process to achieve the creation of an IO log corresponding to the target encrypted disk; when the target virtual machine is in a running state, the current virtual machine process (the virtual machine process currently running in the target virtual machine) can be directly used to execute a log adding command to achieve the creation of an IO log corresponding to the target encrypted disk.

[0122] Furthermore, after the virtual machine management process is used to execute the log adding command to create the IO log corresponding to the target encrypted disk, the method may further include: closing the virtual machine management process corresponding to the target encrypted disk.

[0123] It can be seen that the encrypted disk backup method provided by the embodiment of the present invention can first set the disk format of the encrypted disk to be backed up, that is, set its disk format to the source disk format (RAW format). Therefore, when backing up the encrypted disk, it can be treated as a common disk for backup processing, that is, the encrypted disk is backed up in units of data blocks, and the data blocks are data blocks in an encrypted state. Obviously, there is no need to decrypt the encrypted data blocks in this process, so the backup process of the entire encrypted disk will not involve the decryption processing of the encrypted disk. Therefore, it will not cause the problem of disk data leakage, and effectively ensure the security of the disk data. In addition, the encrypted disk backup processing method provided by the technical solution can simultaneously support the full backup mode and the incremental backup mode. In the full backup mode, each disk data block can be directly backed up, and in the incremental backup mode, the incremental data block can be determined and backed up in combination with the IO log corresponding to the target encrypted disk, which has high flexibility and applicability.

[0124] Based on the above embodiments:

[0125] In one embodiment of the present invention, the encrypted disk backup method may further include:

[0126] Create a backup storage pool corresponding to the target encrypted disk;

[0127] Accordingly, after generating a full backup disk based on each first backup data block to implement a full backup of the target encrypted disk, the method further includes: saving the full backup disk to a backup storage pool;

[0128] After generating an incremental backup disk based on each second backup data block to implement the incremental backup of the target encrypted disk, the method further includes: saving the incremental backup disk to a backup storage pool.

[0129] In order to realize the backup processing of the target encrypted disk, a corresponding backup storage pool can be further created to store the backup disk corresponding to the target encrypted disk. Therefore, after obtaining the full backup disk of the target encrypted disk, it can be saved to the backup storage pool; after obtaining the incremental backup disk of the target encrypted disk, it can also be saved to the backup storage pool.

[0130] In one embodiment of the present invention, the above-mentioned creation of a backup storage pool corresponding to the target encrypted disk may include:

[0131] Determine the disk size of the target encrypted disk;

[0132] Create a backup storage pool with a storage space no less than the disk size.

[0133] An embodiment of the present invention provides a method for creating a backup storage pool, which can be implemented with reference to the disk size of a target encrypted disk. Since the backup storage pool is used to store the backup disk of the target encrypted disk, the storage space of the backup storage pool must not be smaller than the disk size of the target encrypted disk itself. Therefore, a backup storage pool with a storage space not less than the disk size of the target encrypted disk can be created to provide backup services for the target encrypted disk.

[0134] In one embodiment of the present invention, before saving the incremental backup disk to the backup storage pool, the following steps may also be included:

[0135] Determine the current available space size of the backup storage pool;

[0136] When the current available space size is not less than the disk size of the incremental backup disk, executing the step of saving the incremental backup disk to the backup storage pool;

[0137] When the current available space is smaller than the size of the incremental backup disk, an alarm is output.

[0138] It is understandable that in the incremental backup mode, the backup storage pool may need to store one or more incremental backup disks at the same time. Therefore, before saving the incremental backup disk to the backup storage pool, it is possible to first determine whether the current available space size of the backup storage pool is not less than the disk size of the current incremental backup disk, and then execute the operation of saving the incremental backup disk to the backup storage pool when it is determined that the conditions are met. Otherwise, an alarm prompt for insufficient storage space can be directly output.

[0139] In one embodiment of the present invention, the encrypted disk backup method may further include:

[0140] When receiving a virtual machine recovery request, determining a request type of the virtual machine recovery request;

[0141] When the request type is to restore a new virtual machine, a new virtual machine is created, and the full backup disk or incremental backup disk is overwritten with the new disk of the new virtual machine, and an encryption key corresponding to the new virtual machine is generated to realize virtual machine recovery;

[0142] When the request type is to request to restore the original virtual machine, the original virtual machine is shut down, and the full backup disk or the incremental backup disk overwrites the original disk of the original virtual machine to achieve virtual machine recovery.

[0143] It is understandable that the purpose of backing up the encrypted disk is that when an abnormality occurs on the original encrypted disk, the corresponding backup encrypted disk can be used to continue the corresponding business processing. Therefore, the backup encrypted disk can be used to restore the virtual machine to continue the virtual machine business. Among them, the recovery operation of the virtual machine can be divided into recovery as a new virtual machine and recovery as the original virtual machine. When it is necessary to restore a new virtual machine based on the backup disk, a new virtual machine can be created first, and the backup disk can be directly overwritten on the new disk of the new virtual machine to achieve the recovery of the new virtual machine. Of course, since it is a new virtual machine, a new encryption key needs to be regenerated for it; when it is necessary to restore the old virtual machine based on the backup disk, the backup disk can be directly overwritten on the original disk of the old virtual machine to achieve the recovery of the old virtual machine. Since the old virtual machine itself has been assigned an encryption key, there is no need to regenerate the encryption key, and the previous encryption key can be continued.

[0144] An embodiment of the present invention provides another encrypted disk backup method.

[0145] The embodiment of the present invention takes LUKS (Linux Unified Key Setup) encrypted disk as an example to introduce the encrypted disk backup method. LUKS is one of the commonly used disk encryption technologies in Linux system (it is an encryption specification, not an encryption algorithm), which allows users to choose from a series of symmetric encryption algorithms. Please refer to Figure 2 , Figure 2 The schematic diagram of the principle of a LUKS encrypted disk backup method provided by the present invention is as follows:

[0146] 1. Create a backup storage pool and determine whether the backup storage pool has enough space. If the storage space is sufficient, create a disk (backup disk) in the backup storage pool that is the same size as the LUKS encrypted disk to be backed up by the virtual machine to store all the data. If the storage space is insufficient, a storage space expansion prompt can be output.

[0147] 2. Add IO logs for the virtual machine: Please refer to Figure 3 , Figure 3 This is a schematic diagram of the format of an IO log provided by the present invention. The LUKS encrypted disk is divided into blocks at a granularity of 262144. Assuming that the disk has 1G, it can be divided into 4096 data blocks. Initially, all zeros are set: {0000…000}, with a total of 4096 zeros. When IO is issued, the corresponding position is set to 1, such as {0011…0011}. Therefore, which data blocks in the LUKS encrypted disk have changed can be calculated based on the position of 1 multiplied by 262144.

[0148] 3. If the virtual machine is running, you can directly use the qemu-monitor-command command to add an IO log; if the virtual machine is not running, you need to start a qemu-kvm process (virtual machine management process) for the LUKS encrypted disk, and then use the qemu-monitor-command command to add an IO log. After adding, you can export the IO log to the local computer, and then close the qemu-kvm process.

[0149] 4. If the virtual machine is running, you can use cp-reflink to take a snapshot of the LUKS disk and use the snapshot to back up the full data; if the virtual machine is not running, you can directly use the LUKS encrypted disk for backup. Here, the full backup can use the convert command of the qemu-img tool to transfer data.

[0150] 5. When performing incremental backup, you can first execute cp –reflink on the snapshot of the last backup, use it as the data receiving disk for this incremental backup, and continue to add new IO logs after the last backup. At the same time, export the IO logs added during the last backup to the local computer and parse them into strings for easy reading. Thus, the incremental IO logs can be determined by comparing the two IO logs. It should be noted that it is also necessary to first determine whether the storage space of the backup storage pool is sufficient. If so, use cp –reflink to take a snapshot of the LUKS encrypted disk at the time of the last backup, and determine the changed data blocks based on the incremental IO log. Here, the snapshot is taken because the changed data blocks between the current time and the time of the last backup need to be obtained. If the original LUKS encrypted disk of the virtual machine is used directly to take a snapshot, the data obtained according to the IO log may be inconsistent. Among them, when obtaining data, the offset calculated by the IO log can be used to offset the playback-offset backward. For example, the value in this solution is 1052672.

[0151] 6. When the incremental backup succeeds, you can directly delete the IO log added during the last backup and keep the current IO log; when the incremental backup fails, you can delete the current IO log and keep the IO log added during the last backup, and you can further output the corresponding prompt information. Among them, the main reason for the failure of incremental backup may be insufficient storage space in the backup storage pool, or a failure in the backup storage pool causing an IO error. Of course, after fixing the problem, you can continue the incremental backup without restarting the backup.

[0152] 7. Repeat steps 5 and 6 to continue incremental backup.

[0153] 8. When you need to restore a virtual machine, you can customize the time point to restore the virtual machine. Among them, virtual machine recovery can be divided into restoring to a new virtual machine and restoring the original virtual machine. If you want to restore to a new virtual machine, you can first create a virtual machine, then use the qemu-img convert tool to overwrite the backup disk with the disk of the new virtual machine, and regenerate a key; if you want to restore the original virtual machine, you can shut down the original virtual machine, and then overwrite the backup disk with the disk of the original virtual machine. At this time, you do not need to generate a new key.

[0154] It can be seen that the encrypted disk backup method provided by the embodiment of the present invention can first set the disk format of the encrypted disk to be backed up, that is, set its disk format to the source disk format (RAW format). Therefore, when backing up the encrypted disk, it can be treated as a common disk for backup processing, that is, the encrypted disk is backed up in units of data blocks, and the data blocks are data blocks in an encrypted state. Obviously, there is no need to decrypt the encrypted data blocks in this process, so the backup process of the entire encrypted disk will not involve the decryption processing of the encrypted disk. Therefore, it will not cause the problem of disk data leakage, and effectively ensure the security of the disk data. In addition, the encrypted disk backup processing method provided by the technical solution can simultaneously support the full backup mode and the incremental backup mode. In the full backup mode, each disk data block can be directly backed up, and in the incremental backup mode, the incremental data block can be determined and backed up in combination with the IO log corresponding to the target encrypted disk, which has high flexibility and applicability.

[0155] An embodiment of the present invention provides an encrypted disk backup device.

[0156] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of an encrypted disk backup device provided by the present invention, and the encrypted disk backup device may include:

[0157] Determination module 1, used to determine the target encrypted disk and the backup working mode according to the backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode;

[0158] Conversion module 2, used to set the disk format of the target encrypted disk to the source disk format, and obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state;

[0159] The first backup module 3 is used for backing up each data block in the format conversion disk to obtain each first backup data block when the backup working mode is the full disk backup mode; generating a full backup disk based on each first backup data block to achieve full backup of the target encrypted disk;

[0160] The second backup module 4 is used to determine each incremental data block in the format conversion disk according to the IO log of the target encrypted disk when the backup working mode is the incremental disk backup mode; back up each incremental data block to obtain each second backup data block; generate an incremental backup disk based on each second backup data block to realize the incremental backup of the target encrypted disk.

[0161] It can be seen that the encrypted disk backup device provided by the embodiment of the present invention can first set the disk format of the encrypted disk to be backed up, that is, set its disk format to the source disk format (RAW format). Therefore, when backing up the encrypted disk, it can be treated as a common disk for backup processing, that is, the encrypted disk is backed up in units of data blocks, and the data blocks are data blocks in an encrypted state. Obviously, there is no need to decrypt the encrypted data blocks in this process, so the entire encrypted disk backup process will not involve the decryption processing of the encrypted disk. Therefore, it will not cause the disk data leakage problem, and effectively ensure the disk data security. In addition, the encrypted disk backup processing method provided by the technical solution can simultaneously support the full backup mode and the incremental backup mode. In the full backup mode, each disk data block can be directly backed up, and in the incremental backup mode, the incremental data block can be determined and backed up in combination with the IO log corresponding to the target encrypted disk, which has high flexibility and applicability.

[0162] In one embodiment of the present invention, the above-mentioned first backup module 3 can be specifically used to determine the target virtual machine to which the target encrypted disk belongs; when the target virtual machine is in a running state, a snapshot of the format conversion disk is performed to obtain a first disk snapshot; each data block in the first disk snapshot is backed up to obtain each first backup data block; when the target virtual machine is in a non-running state, each data block in the format conversion disk is backed up to obtain each first backup data block.

[0163] In one embodiment of the present invention, the above-mentioned second backup module 4 can be specifically used to determine the latest historical backup disk and the historical IO log corresponding to the latest historical backup disk; obtain the current IO log of the target encrypted disk, and determine the incremental IO log based on the current IO log and the historical IO log; perform snapshot processing on the latest historical backup disk to obtain a second disk snapshot; determine each incremental data block in the format conversion disk based on the second disk snapshot and the incremental IO log.

[0164] In one embodiment of the present invention, the above-mentioned second backup module 4 can also be used to obtain the execution result of the current incremental backup operation after backing up each incremental data block and obtaining each second backup data block; if the execution result of the current incremental backup operation is successful, the historical IO log is deleted and the current IO log is saved; if the execution result of the current incremental backup operation is failed, the historical IO log is retained and a backup failure prompt message is output.

[0165] In one embodiment of the present invention, the encrypted disk backup device may also include an adding module for determining the target virtual machine to which the target encrypted disk belongs; creating an IO log corresponding to the target encrypted disk for the target virtual machine; wherein the number of record fields in the IO log is equal to the number of data blocks in the target encrypted disk, the record fields correspond one-to-one to the data blocks, and the record fields are used to store change flags of corresponding data blocks.

[0166] In one embodiment of the present invention, the above-mentioned adding module can be specifically used to determine whether the target virtual machine is in a running state; when the target virtual machine is in a non-running state, a virtual machine management process corresponding to the target encrypted disk is created, and the virtual machine management process is used to execute a log adding command to create an IO log corresponding to the target encrypted disk; when the target virtual machine is in a running state, the current virtual machine process is used to execute a log adding command to create an IO log corresponding to the target encrypted disk.

[0167] In one embodiment of the present invention, the above-mentioned adding module can also be used to close the virtual machine management process corresponding to the target encrypted disk after the above-mentioned virtual machine management process is used to execute the log adding command to create the IO log corresponding to the target encrypted disk.

[0168] In one embodiment of the present invention, the encrypted disk backup device may further include:

[0169] A creation module is used to create a backup storage pool corresponding to the target encrypted disk;

[0170] A first saving module is used to save the full backup disk to a backup storage pool after generating the full backup disk based on each first backup data block to achieve full backup of the target encrypted disk;

[0171] The second saving module is used to save the incremental backup disk to the backup storage pool after the incremental backup disk is generated based on each second backup data block to realize the incremental backup of the target encrypted disk.

[0172] In one embodiment of the present invention, the creation module can be specifically used to determine the disk size of the target encrypted disk; and create a backup storage pool with a storage space not less than the disk size.

[0173] In one embodiment of the present invention, the above-mentioned second saving module can also be used to determine the current available space size of the backup storage pool before saving the incremental backup disk to the backup storage pool; when the current available space size is not less than the disk size of the incremental backup disk, execute the step of saving the incremental backup disk to the backup storage pool; when the current available space size is less than the disk size of the incremental backup disk, output an alarm prompt.

[0174] In one embodiment of the present invention, the encrypted disk backup device may further include:

[0175] The recovery module is used to determine the request type of the virtual machine recovery request when a virtual machine recovery request is received; when the request type is a request to restore a new virtual machine, a new virtual machine is created, and the full backup disk or incremental backup disk is used to overwrite the new disk of the new virtual machine, and an encryption key corresponding to the new virtual machine is generated to achieve virtual machine recovery; when the request type is a request to restore the original virtual machine, the original virtual machine is shut down, and the full backup disk or incremental backup disk is used to overwrite the original disk of the original virtual machine to achieve virtual machine recovery.

[0176] In one embodiment of the present invention, the above-mentioned determination module 1 can be specifically used to determine whether the backup request is the first backup request regarding the target encrypted disk; if the backup request is the first backup request, the backup working mode is determined to be the full disk backup mode; if the backup request is not the first backup request, the backup working mode is determined to be the incremental disk backup mode.

[0177] For an introduction to the device provided in the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0178] An embodiment of the present invention provides an electronic device.

[0179] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided by the present invention, and the electronic device may include:

[0180] A memory 11, used for storing computer programs;

[0181] The processor 10 can implement the steps of any one of the above-mentioned encrypted disk backup methods when executing a computer program.

[0182] like Figure 5 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.

[0183] In the embodiment of the present invention, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices.

[0184] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in the embodiment of the encrypted disk backup method.

[0185] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present invention, the memory 11 at least stores programs for implementing the following functions:

[0186] Determine the target encrypted disk and the backup working mode according to the backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode;

[0187] Setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state;

[0188] When the backup working mode is the full disk backup mode, each data block in the format conversion disk is backed up to obtain each first backup data block; a full backup disk is generated based on each first backup data block to achieve full backup of the target encrypted disk;

[0189] When the backup working mode is the incremental disk backup mode, the incremental data blocks in the format conversion disk are determined according to the IO log of the target encrypted disk; each incremental data block is backed up to obtain each second backup data block; an incremental backup disk is generated based on each second backup data block to realize the incremental backup of the target encrypted disk.

[0190] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.

[0191] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0192] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.

[0193] Of course, it should be noted that Figure 5The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 5 More or fewer components than shown, or combinations of certain components.

[0194] An embodiment of the present invention provides a computer-readable storage medium.

[0195] The computer-readable storage medium provided in the embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned encrypted disk backup methods can be implemented.

[0196] Among them, the computer-readable storage medium can be any available medium that can be stored in a computer or a data storage device such as a server or data center that includes one or more available media integrated. For example, it can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk) and other media that can store computer program codes.

[0197] For an introduction to the computer-readable storage medium provided in an embodiment of the present invention, please refer to the above method embodiment, and the present invention will not elaborate on it here.

[0198] An embodiment of the present invention provides a computer program product.

[0199] The computer program product provided by the embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of any one of the above-mentioned encrypted disk backup methods can be implemented.

[0200] Specifically, in the above embodiments, all or part of them can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of them can be implemented in the form of a computer program product.

[0201] Among them, the computer program product may include one or more computer programs / instructions, and when the computer program / instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention may be generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line, etc.) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0202] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0203] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0204] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0205] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0206] The technical solution provided by the present invention is described in detail above. Specific examples are used herein to illustrate the principle and implementation of the present invention, and the description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. An encrypted disk backup method, characterized in that: include: Determine the target encrypted disk and the backup working mode according to the backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode; Setting the disk format of the target encrypted disk to the source disk format to obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state; When the backup working mode is the full disk backup mode, each data block in the format conversion disk is backed up to obtain each first backup data block; a full backup disk is generated based on each first backup data block to achieve full backup of the target encrypted disk; When the backup working mode is the incremental disk backup mode, the incremental data blocks in the format conversion disk are determined according to the IO log of the target encrypted disk; each incremental data block is backed up to obtain each second backup data block; an incremental backup disk is generated based on each second backup data block to realize the incremental backup of the target encrypted disk; The method of backing up each data block in the format conversion disk to obtain each first backup data block includes: determining a target virtual machine to which the target encrypted disk belongs; when the target virtual machine is in a running state, performing a snapshot process on the format conversion disk to obtain a first disk snapshot; backing up each data block in the first disk snapshot to obtain each first backup data block; when the target virtual machine is in a non-running state, backing up each data block in the format conversion disk to obtain each first backup data block; Backing up each data block in the format conversion disk to obtain each first backup data block, including: for each data block in the format conversion disk, determining the identification information of the data block; when the identification information is a zero flag bit, removing the data block; when the identification information is a data flag bit, backing up the data block to obtain each first backup data block; Determining each incremental data block in the format conversion disk according to the IO log of the target encrypted disk includes: determining the latest historical backup disk and the historical IO log corresponding to the latest historical backup disk; obtaining the current IO log of the target encrypted disk, and determining the incremental IO log according to the current IO log and the historical IO log; performing snapshot processing on the latest historical backup disk to obtain a second disk snapshot; and determining each incremental data block in the format conversion disk according to the second disk snapshot and the incremental IO log.

2. The encrypted disk backup method according to claim 1, characterized in that: After backing up each of the incremental data blocks to obtain each of the second backup data blocks, the method further includes: Get the execution result of the current incremental backup operation; If the execution result of the current incremental backup operation is successful, the historical IO log is deleted and the current IO log is saved; If the execution result of the current incremental backup operation is execution failure, the historical IO log is retained and backup failure prompt information is output.

3. The encrypted disk backup method according to claim 1, characterized in that: Also includes: Determine the target virtual machine to which the target encrypted disk belongs; Creating an IO log corresponding to the target encrypted disk for the target virtual machine; The number of record fields in the IO log is equal to the number of data blocks in the target encrypted disk, the record fields correspond to the data blocks one by one, and the record fields are used to store change flags of corresponding data blocks.

4. The encrypted disk backup method according to claim 3, characterized in that: Creating an IO log corresponding to the target encrypted disk for the target virtual machine includes: Determine whether the target virtual machine is in a running state; When the target virtual machine is in a non-operating state, creating a virtual machine management process corresponding to the target encrypted disk, and using the virtual machine management process to execute a log adding command to create an IO log corresponding to the target encrypted disk; When the target virtual machine is in a running state, the log adding command is executed using the current virtual machine process to create an IO log corresponding to the target encrypted disk.

5. The encrypted disk backup method according to claim 4, characterized in that: After executing the log adding command by the virtual machine management process to create the IO log corresponding to the target encrypted disk, the method further includes: Close the virtual machine management process corresponding to the target encrypted disk.

6. The encrypted disk backup method according to any one of claims 1 to 5, characterized in that: Also includes: Creating a backup storage pool corresponding to the target encrypted disk; Correspondingly, after generating a full backup disk based on each of the first backup data blocks to implement a full backup of the target encrypted disk, the method further includes: saving the full backup disk to the backup storage pool; After generating an incremental backup disk based on each of the second backup data blocks to implement the incremental backup of the target encrypted disk, the method further includes: saving the incremental backup disk to the backup storage pool.

7. The encrypted disk backup method according to claim 6, characterized in that: Creating a backup storage pool corresponding to the target encrypted disk includes: Determine the disk size of the target encrypted disk; Create a backup storage pool with a storage space no less than the disk size.

8. The encrypted disk backup method according to claim 6, characterized in that: Before saving the incremental backup disk to the backup storage pool, the method further includes: Determine the current available space size of the backup storage pool; When the current available space size is not less than the disk size of the incremental backup disk, executing the step of saving the incremental backup disk to the backup storage pool; When the current available space size is smaller than the disk size of the incremental backup disk, an alarm prompt is output.

9. The encrypted disk backup method according to claim 1, characterized in that: Also includes: When receiving a virtual machine recovery request, determining a request type of the virtual machine recovery request; When the request type is a request to restore a new virtual machine, a new virtual machine is created, and the full backup disk or the incremental backup disk is overwritten with a new disk of the new virtual machine, and an encryption key corresponding to the new virtual machine is generated to realize virtual machine recovery; When the request type is a request to restore the original virtual machine, the original virtual machine is shut down, and the full backup disk or the incremental backup disk overwrites the original disk of the original virtual machine to achieve virtual machine recovery.

10. The encrypted disk backup method according to claim 1, characterized in that: Determine the backup working mode based on the backup request, including: Determining whether the backup request is a first backup request for the target encrypted disk; If the backup request is the first backup request, determining that the backup working mode is the full disk backup mode; If the backup request is not the first backup request, the backup working mode is determined to be the incremental disk backup mode.

11. An encrypted disk backup device, characterized in that: include: A determination module, used to determine a target encrypted disk and a backup working mode according to a backup request; wherein the backup working mode includes a full disk backup mode and an incremental disk backup mode; A conversion module, used to set the disk format of the target encrypted disk to the source disk format, and obtain a format conversion disk; wherein the format conversion disk includes a plurality of data blocks in an encrypted state; A first backup module, configured to back up each data block in the format conversion disk to obtain each first backup data block when the backup working mode is the full disk backup mode; and generate a full backup disk based on each first backup data block to achieve a full backup of the target encrypted disk; A second backup module is used for, when the backup working mode is the incremental disk backup mode, determining each incremental data block in the format conversion disk according to the IO log of the target encrypted disk; backing up each incremental data block to obtain each second backup data block; and generating an incremental backup disk based on each second backup data block to realize the incremental backup of the target encrypted disk; The first backup module is specifically used to determine the target virtual machine to which the target encrypted disk belongs; when the target virtual machine is in a running state, snapshot processing is performed on the format conversion disk to obtain a first disk snapshot; each data block in the first disk snapshot is backed up to obtain each first backup data block; when the target virtual machine is in a non-running state, each data block in the format conversion disk is backed up to obtain each first backup data block; The first backup module is specifically used to determine the identification information of each data block in the format conversion disk; when the identification information is a zero flag, remove the data block; when the identification information is a data flag, back up the data block to obtain each first backup data block; The second backup module is specifically used to determine the latest historical backup disk and the historical IO log corresponding to the latest historical backup disk; obtain the current IO log of the target encrypted disk, and determine the incremental IO log based on the current IO log and the historical IO log; perform snapshot processing on the latest historical backup disk to obtain a second disk snapshot; determine each of the incremental data blocks in the format conversion disk based on the second disk snapshot and the incremental IO log.

12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the encrypted disk backup method according to any one of claims 1 to 10 when executing the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the encrypted disk backup method according to any one of claims 1 to 10 are implemented.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the encrypted disk backup method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Data backup method for virtual machines

    CN103678045A

  • Incremental backup data storage method and device, equipment and product

    CN111949445A

  • Method, device and apparatus for continuously protecting virtual machine data

    CN112269681A

  • Virtual machine migration method, device and apparatus and storage medium

    CN112328365A

  • Virtual machine disk data backup method and device, terminal and storage medium

    CN113626256A