Cloud hard disk backup method and device, computer equipment and storage medium
By using an encrypted data volume to encrypt the data to be backed up during the cloud disk backup process, and copying the encrypted data to the backup data volume, the problem that the security of the cloud disk backup data cannot be guaranteed during the transmission and storage process is solved, and data security is achieved. Confidentiality and Security.
Patent Information
- Application Number
- CN202411864652.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-12-17
AI Technical Summary
The prior art cannot effectively ensure the security of cloud hard disk backup data during transmission and storage, and there is a risk of data leakage and unauthorized access.
By obtaining the encrypted data volume, the data to be backed up is copied to the encrypted data volume, and the data is encrypted based on the encryption information to obtain the encrypted backup data. Then, copy the encrypted backup data and encrypted information in the encrypted data volume to the backup data volume to complete the encrypted backup of the cloud disk to be backed up.
Ensure the confidentiality of data to be backed up during transmission and storage to prevent data leakage. Even if an attacker can access the backup data volume, the encrypted data to be backed up cannot be directly read, thereby preventing unauthorized access.
Smart Images

Figure CN119336548A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a cloud hard disk backup method, device, computer equipment, and storage medium. Background Art
[0002] Cloud drive backup helps users protect valuable data from accidental damage, deletion, or loss. Users back up disks storing important data and quickly restore data backed up to the original disk in the event of a cloud host disk failure, accidental data deletion, or a hacker attack, ensuring the integrity of user data. Backup data on cloud drives contains a large amount of sensitive information and core assets. Any data leak or unauthorized access could result in severe financial losses and reputational damage. Therefore, ensuring the security of backup data on cloud drives is crucial.
[0003] OpenStack is a cloud platform management project that provides basic cloud disk backup functions, including cloud disk data storage and recovery. However, the security of backup data during transmission and storage cannot be guaranteed. Summary of the Invention
[0004] In view of this, the present invention provides a cloud hard disk backup method, device, computer equipment and storage medium to solve the problem that related technologies cannot guarantee the security of backup data during transmission and storage.
[0005] In a first aspect, the present invention provides a cloud hard disk backup method, comprising: Get the data to be backed up from the cloud hard disk; Obtaining an encrypted data volume, copying the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, and the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, and obtaining and saving the encrypted backup data; Create a backup data volume and copy the encrypted backup data and encryption information in the encrypted data volume to the backup data volume.
[0006] The cloud hard disk backup method provided in this embodiment obtains an encrypted data volume, copies the data to be backed up to the encrypted data volume, and the encrypted data volume encrypts the data to be backed up according to the encryption information to obtain and save the encrypted backup data; the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume to complete the encrypted backup of the cloud hard disk to be backed up. This method can not only protect user data from the risk of accidental damage, deletion, or loss, but also ensure the confidentiality of the data to be backed up during transmission and storage, preventing data leakage. Moreover, even if an attacker can access the backup data volume, he cannot directly read the encrypted data to be backed up in the backup data volume, thereby preventing unauthorized access. This solves the problem that related technologies cannot guarantee the security of backup data during transmission and storage.
[0007] In some optional implementations, obtaining the encrypted data volume includes: Obtain the data volume list corresponding to the cloud hard disk to be backed up on the backup backend; Determine whether there is a data volume in the data volume list with the same capacity and encryption type as the backup size in the backup record. If so, use the data volume as an encrypted data volume. The backup record is used to represent the backup information of the cloud hard disk to be backed up. If it does not exist, use the first component to create a first empty data volume with the same capacity as the backup size in the backup record on the backup backend, format the first empty data volume using the encryption type information in the backup record, obtain an encrypted data volume, and generate encryption information in the encrypted data volume.
[0008] In this embodiment, an encrypted data volume containing encryption information is obtained or created on the backup backend. During the process of backing up the backup cloud hard disk, the encrypted data volume can encrypt the backup data according to the encryption information, and obtain and save the encrypted backup data. This not only ensures the confidentiality of the backup data during transmission and storage, but also prevents attackers from directly reading the encrypted backup data even if they can obtain it, thereby preventing unauthorized access.
[0009] In some optional implementations, before determining whether there is a data volume in the data volume list with a capacity identical to the backup size in the backup record and an encryption type identical to the encryption type information in the backup record, the method further includes: Obtain encryption algorithm configuration information, encryption operation information, encryption algorithm and key length; Obtaining encryption type information based on the encryption algorithm configuration information, the encryption operation information, the encryption algorithm, and the key length, wherein the encryption type information is used to generate encryption information in the encrypted data volume; Get the backup name and backup size; Creates a backup record in the database that contains the encryption type information, the backup name, and the backup size.
[0010] In this embodiment, a backup record is created containing encryption type information, backup name, and backup size. Subsequently, an encrypted data volume can be created based on the encryption type information in the backup record, and a backup data volume can be created based on the backup name and backup size in the backup record, thereby realizing encrypted backup of the backup cloud hard drive.
[0011] In some optional implementations, obtaining the data to be backed up from the cloud hard disk to be backed up includes: Freeze the file system of the cloud hard disk to be backed up; Creating a snapshot of the cloud hard disk to be backed up according to the first component, wherein the snapshot includes the data to be backed up; A temporary cloud hard disk is generated based on the snapshot to restore the file system. The temporary cloud hard disk is used to temporarily store data to be backed up.
[0012] In some optional implementations, copying the data to be backed up to the encrypted data volume includes: Mount the temporary cloud hard disk and encrypted data volume to the host machine; Use the host machine to compare the temporary cloud hard disk and the encrypted data volume, determine the difference data, and use the difference data as the data to be backed up; Use the host machine's preset protocol framework to write the data to be backed up to the encrypted data volume.
[0013] In this implementation, the host compares the temporary cloud hard drive with the encrypted data volume to identify the difference, allowing full and incremental backups of the backup cloud host. Leveraging the host's pre-set protocol framework, the backup data is written to the encrypted data volume in parallel, improving data backup efficiency.
[0014] In some optional implementations, mounting the temporary cloud hard disk and the encrypted data volume to the host machine includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, the temporary cloud hard disk is mounted to the host file directory of the host machine through the preset mount command; If yes, the temporary cloud hard disk is decrypted using the preset decryption command, and the decrypted temporary cloud hard disk is mounted to the host file directory using the preset mount command; The encrypted data volume is decrypted using a preset decryption command, and the decrypted encrypted data volume is mounted to the host file directory using a preset mount command.
[0015] In some optional implementations, creating a backup data volume and copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume includes: Obtain the backup name and backup size from the backup record, create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; Unmount the encrypted data volume on the host machine; Use the backup backend to establish a local replication relationship between the encrypted data volume and the backup data volume; Based on the local replication relationship, the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume.
[0016] In this embodiment, a backup data volume is created on the backup backend, the encrypted data volume is unmounted on the host machine, and the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume using the local replication function of the backup backend, thereby improving data replication efficiency without occupying the available resources of the host machine.
[0017] In some optional implementations, creating a backup data volume and copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume includes: Obtain the backup name and backup size from the backup record, create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; Mount the backup data volume to the host machine; The encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume using the preset protocol framework of the host machine.
[0018] In this embodiment, the encrypted backup data and the encrypted information in the encrypted data volume are written into the encrypted data volume in parallel by utilizing the preset protocol framework of the host machine, thereby improving data backup efficiency.
[0019] In some optional implementations, unmounting the encrypted data volume on the host machine includes: Unmount the encrypted data volume from the host file directory using the preset unmount command; Execute the data volume close command to close the encrypted data volume.
[0020] In some optional implementations, after writing the data to be backed up to the encrypted data volume, the method further includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, use the preset uninstall command to uninstall the temporary cloud hard disk from the host file directory; If yes, the temporary cloud hard disk is uninstalled from the host file directory through the preset uninstall command, and the cloud hard disk close command is executed to close the temporary cloud hard disk.
[0021] In some optional embodiments, the method further comprises: Before creating a snapshot of the cloud hard disk to be backed up according to the first component, modifying the status of the cloud hard disk to be backed up to being backed up in the database; After creating a snapshot of the cloud hard disk to be backed up according to the first component, the state of the cloud hard disk to be backed up is modified to an available state in the database.
[0022] In this implementation, before creating a snapshot of the cloud drive to be backed up, the status of the cloud drive to be backed up is changed to "Backing Up" to prevent backup failures caused by other operations performed on the cloud drive during the backup process. After creating the snapshot, the status of the cloud drive to be backed up is changed to "Available" to allow the cloud host to read and write to the cloud drive, ensuring that the encrypted backup process does not affect the normal production operations of the cloud host.
[0023] In some optional implementations, after copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume, the method further includes: Upon receiving the data recovery instruction and the key, the backup data volume is decrypted using the key, and the data to be recovered corresponding to the data recovery instruction is obtained from the decrypted backup data volume; Determine the target cloud drive according to the data recovery instructions and restore the data to be restored to the target cloud drive.
[0024] In this embodiment, data recovery instructions and keys are used to restore the data to be recovered to the target cloud hard disk, which not only provides data protection and recovery capabilities, ensuring that user data can be quickly restored in the event of loss, damage or accidental loss, effectively ensuring the integrity of user data, but also ensures the confidentiality of backup data during transmission and storage, thereby enhancing data security.
[0025] In a second aspect, the present invention provides a cloud hard disk backup device, comprising: A data acquisition module is used to acquire the data to be backed up from the cloud hard disk; A first backup module is configured to obtain an encrypted data volume and copy the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, and obtain and save the encrypted backup data; The second backup module is used to create a backup data volume and copy the encrypted backup data and encryption information in the encrypted data volume to the backup data volume.
[0026] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to thereby execute the cloud hard disk backup method of the first aspect or any corresponding embodiment thereof.
[0027] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the cloud hard disk backup method of the first aspect or any corresponding embodiment thereof.
[0028] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, which are used to enable a computer to execute the cloud hard disk backup method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in related technologies, the following briefly introduces the drawings required for use in the specific embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0030] Figure 1 1 is a flow chart of a cloud hard disk backup method according to an embodiment of the present invention; Figure 2 This is a diagram of a cloud hard disk encryption backup architecture according to an embodiment of the present invention; Figure 3 1 is a flowchart of a cloud hard disk encryption backup method according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a cloud hard disk backup device according to an embodiment of the present invention; Figure 5 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0032] OpenStack is a cloud platform management project that provides software for building and managing public, private, and hybrid clouds. OpenStack's primary mission is to simplify cloud deployment and ensure scalability. OpenStack is composed of several key components, including Cinder and Nova. Cinder is the OpenStack block storage service, adding persistent storage to virtual machines. Cinder provides an infrastructure for managing data volumes and interacting with the OpenStack compute service. Cinder also enables volume snapshots and volume type management. Nova is OpenStack's core service, responsible for maintaining and managing the computing resources of the cloud environment. Virtual machine lifecycle management is also implemented through Nova.
[0033] Although the OpenStack cloud platform has implemented the basic functions of cloud disk backup, it only has the ability to protect and restore cloud disk data. Backup data may be leaked during transmission and storage, and the security of backup data cannot be guaranteed.
[0034] Based on the above, an embodiment of the present invention provides a cloud hard disk backup method. First, all the data to be backed up on the cloud hard disk to be backed up is copied to a temporary cloud hard disk; then, the temporary cloud hard disk and the encrypted data volume are simultaneously mounted on the host machine. The host machine concurrently copies the data to be backed up to the encrypted data volume, which contains encryption information used to encrypt the data to be backed up; after the copy is completed, the encrypted data volume is unmounted from the host machine; a backup volume is created on the backup backend, and the local copy function of the backup backend is used to copy all the data in the encrypted data volume to the backup volume, which also contains encryption information, completing the backup and encryption process of the cloud hard disk to be backed up. Backing up and encrypting the cloud hard disk data without affecting the production tasks of the cloud host not only ensures the confidentiality of the backup data during transmission and storage, preventing data leakage, but also prevents the attacker from directly reading the encrypted backup data even if they have access to the cloud storage service, thereby preventing unauthorized access. This ensures that user data is protected from the risk of accidental damage, deletion, or loss, and ensures the confidentiality of the backup data during transmission and storage, thereby enhancing the security of user data.
[0035] According to an embodiment of the present invention, a cloud hard disk backup embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device with data processing capabilities, such as a computer, a server, etc., and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] In this embodiment, a cloud hard disk backup method is provided. Figure 1 FIG. 1 is a flow chart of a cloud hard disk backup method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101: Obtain the data to be backed up from the cloud hard disk.
[0037] Specifically, if Figure 1 As shown in the figure, OpenStack is used to manage cloud hosts and cloud hard disks. The Nova component in OpenStack is used to manage cloud hosts, and the Cinder component is used to manage cloud hard disks in the storage backend.
[0038] Determine the source cloud hard disk in the storage backend. The source cloud hard disk is the cloud hard disk that needs to be backed up. Use the source cloud hard disk as the cloud hard disk to be backed up. The present invention supports full backup and incremental backup of cloud hard disks. Obtain the data to be backed up of the cloud hard disk to be backed up. If it is a full backup, all the data in the cloud hard disk to be backed up will be used as the data to be backed up; if it is an incremental backup, the changed data in the cloud hard disk to be backed up compared to the previous backup will be used as the data to be backed up. In addition, the snapshot function of the backup backend can be used to copy all the data to be backed up of the cloud hard disk to a temporary cloud hard disk. The data to be backed up is temporarily stored in the temporary cloud hard disk to ensure that the data reading and writing functions of the cloud hard disk to be backed up are not affected during the backup of the data to be backed up.
[0039] Step S102 : obtaining an encrypted data volume, and copying the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, and the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, and obtain and save the encrypted backup data.
[0040] Specifically, the backup backend obtains an encrypted data volume, such as an encrypted Base volume. If the backup backend already has an encrypted data volume associated with the cloud disk to be backed up, it will be used directly. If not, an empty data volume will be created on the backup backend and the encryption information will be written to the empty volume to obtain the encrypted data volume. The encrypted data volume contains encryption information, such as the encryption algorithm, disk encryption technology, key length, and encryption operation location.
[0041] Copy the data to be backed up to the encrypted data volume. You can mount the cloud hard drive (such as a temporary cloud hard drive) storing the data to be backed up and the encrypted data volume to the same host machine. Use the host machine to copy the data to be backed up to the encrypted data volume. The encrypted data volume can encrypt the data to be backed up based on the encryption information, and then obtain and save the encrypted backup data.
[0042] Step S103: creating a backup data volume, and copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume.
[0043] Specifically, a backup data volume is created on the backup backend. Both the backup data volume and the encrypted data volume reside on the backup backend. Therefore, you can first unmount the encrypted data volume from the host machine and then use the backup backend's local copy function to copy the encrypted backup data and encryption information from the encrypted data volume to the backup data volume. Alternatively, you can also mount the backup data volume on the host machine and use the host machine to copy the encrypted backup data and encryption information from the encrypted data volume to the backup data volume. Finally, unmount and delete the temporary cloud hard drive from the host machine, completing the backup and encryption process for the cloud hard drive to be backed up.
[0044] The cloud hard disk backup method provided in this embodiment obtains an encrypted data volume, copies the data to be backed up to the encrypted data volume, and the encrypted data volume encrypts the data to be backed up according to the encryption information to obtain and save the encrypted backup data; the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume to complete the encrypted backup of the cloud hard disk to be backed up. This method can not only protect user data from the risk of accidental damage, deletion, or loss, but also ensure the confidentiality of the data to be backed up during transmission and storage, preventing data leakage. Moreover, even if an attacker can access the backup data volume, he cannot directly read the encrypted data to be backed up in the backup data volume, thereby preventing unauthorized access. This solves the problem that related technologies cannot guarantee the security of backup data during transmission and storage.
[0045] In some optional implementations, obtaining the encrypted data volume includes: Obtain the data volume list corresponding to the cloud hard disk to be backed up on the backup backend; Determine whether there is a data volume in the data volume list with the same capacity and encryption type as the backup size in the backup record. If so, use the data volume as an encrypted data volume. The backup record is used to represent the backup information of the cloud hard disk to be backed up. If it does not exist, use the first component to create a first empty data volume with the same capacity as the backup size in the backup record on the backup backend, format the first empty data volume using the encryption type information in the backup record, obtain an encrypted data volume, and generate encryption information in the encrypted data volume.
[0046] Specifically, the backup backend obtains the base volume list (i.e., the data volume list) associated with the source cloud hard disk. The source cloud hard disk is the cloud hard disk to be backed up.
[0047] Check whether there is a data volume in the data volume list that was created recently, has the same capacity as the backup size in the backup record, and uses the same encryption type as the backup record. If so, this indicates that this is not the first time an encrypted backup of the source cloud drive has been created. The encrypted base volume contains encryption information and the source cloud drive's last backup data, and the data volume is considered an encrypted data volume. The backup record represents the backup information of the cloud drive to be backed up. The backup size in the backup record is the size of the cloud drive to be backed up, and the encryption information in the backup record contains the encryption type of the backup to be created.
[0048] If the data volume does not exist in the data volume list, this indicates that this is the first time an encrypted backup of the source cloud drive has been created, and a new encrypted data volume needs to be created. For example, the first component is the Cinder component. Use this component to create a first empty data volume on the backup backend with the same capacity as the backup size in the backup record. Use the cryptsetup luksFormat command to format the first empty data volume based on the encryption type information in the backup record. After formatting, the first empty data volume contains the encryption information, and the encrypted data volume is obtained.
[0049] In this embodiment, an encrypted data volume containing encryption information is obtained or created on the backup backend. During the process of backing up the backup cloud hard disk, the encrypted data volume can encrypt the backup data according to the encryption information, and obtain and save the encrypted backup data. This not only ensures the confidentiality of the backup data during transmission and storage, but also prevents attackers from directly reading the encrypted backup data even if they can obtain it, thereby preventing unauthorized access.
[0050] In some optional implementations, before determining whether there is a data volume in the data volume list with a capacity identical to the backup size in the backup record and an encryption type identical to the encryption type information in the backup record, the method further includes: Obtain encryption algorithm configuration information, encryption operation information, encryption algorithm and key length; Obtaining encryption type information based on the encryption algorithm configuration information, the encryption operation information, the encryption algorithm, and the key length, wherein the encryption type information is used to generate encryption information in the encrypted data volume; Get the backup name and backup size; Creates a backup record in the database that contains the encryption type information, the backup name, and the backup size.
[0051] Specifically, when performing an encrypted backup of a cloud hard drive, you first need to specify the backup's encryption type. This encryption type information is used to generate encryption information within the encrypted data volume. The encryption type information consists of four configuration parameters: provider, control location, encryption algorithm, and key length. The provider, or encryption algorithm configuration information, refers to the software library, service, or hardware module that implements the encryption algorithm. For example, LUKS (Linux Unified Key Setup), a standard for Linux hard drive encryption, is a commonly used disk encryption technology. By providing a standard disk format, it not only promotes compatibility between distributions but also provides secure management of multiple user passwords. LUKS stores all necessary configuration information in the partition header, enabling users to seamlessly transfer or migrate their data. The control location, or encryption operation information, refers to the context or environment in which encryption operations occur. The default control location is the frontend, and its corresponding service is the Nova component. The encryption algorithm is the core of the encryption process, defining how data is encrypted and decrypted. For example, aes-xts-plain64, where aes is the encryption algorithm, xts is the encryption mode, and plain64 is the initialization vector mode for the encryption mode. The key length is the number of bits in the key used in the encryption algorithm. Longer keys generally provide greater security. Key lengths are generally 128 or 256 bits.
[0052] Obtain the backup name and size. Set the backup name based on actual needs, and the backup size should be the same as the size of the cloud drive to be backed up. Create a backup record in the database containing the encryption type, backup name, and backup size. The backup record may also include information such as the backup status and the source cloud drive ID (identity document). The backup status may include: creating, idle, or in use.
[0053] In the cloud hard disk encryption backup method of this embodiment, the user only needs to specify the backup name, encryption type, and backup backend. It is simple to operate and has strong usability. It does not require additional hardware and software costs and has low production costs.
[0054] In this embodiment, a backup record is created containing encryption type information, backup name, and backup size. Subsequently, an encrypted data volume can be created based on the encryption type information in the backup record, and a backup data volume can be created based on the backup name and backup size in the backup record, thereby realizing encrypted backup of the backup cloud hard drive.
[0055] In some optional implementations, obtaining the data to be backed up from the cloud hard disk to be backed up includes: Freeze the file system of the cloud hard disk to be backed up; Creating a snapshot of the cloud hard disk to be backed up according to the first component, wherein the snapshot includes the data to be backed up; A temporary cloud hard disk is generated based on the snapshot to restore the file system. The temporary cloud hard disk is used to temporarily store data to be backed up.
[0056] Specifically, this embodiment is used to create a temporary cloud hard disk. First, the file system of the source cloud hard disk, ie, the cloud hard disk to be backed up, is frozen to prevent the cloud host from performing read and write operations on the cloud hard disk to be backed up.
[0057] The first component is, for example, the Cinder component. Create a snapshot of the cloud hard disk to be backed up at the current moment based on the first component. Create a snapshot of the cloud hard disk to be backed up based on the first component. For example, you can directly use the snapshot as a temporary cloud hard disk; or create an empty cloud hard disk, write the data in the snapshot to the empty cloud hard disk and use it as a temporary cloud hard disk. Since the cloud hard disk to be backed up and the temporary cloud hard disk are located in the same storage backend, all the data of the cloud hard disk to be backed up is copied to the temporary cloud hard disk through the local replication function of the storage backend. Figure 2 As shown, a snapshot of the source cloud drive is created on the storage backend, and a temporary cloud drive is created based on the snapshot. After the temporary cloud drive is created, the file system of the source cloud drive is restored, and the cloud host can read and write to the backup cloud drive. Subsequent encrypted backups are completed by the temporary cloud drive, without affecting the normal production operations of the cloud host.
[0058] In some optional implementations, copying the data to be backed up to the encrypted data volume includes: Mount the temporary cloud hard disk and encrypted data volume to the host machine; Use the host machine to compare the temporary cloud hard disk and the encrypted data volume, determine the difference data, and use the difference data as the data to be backed up; Use the host machine's preset protocol framework to write the data to be backed up to the encrypted data volume.
[0059] Specifically, this embodiment uses the host machine to transmit data between the temporary cloud hard disk and the encrypted data volume. The temporary cloud hard disk and the encrypted data volume are mounted on the host machine.
[0060] After both the temporary cloud drive and the encrypted data volume are mounted to the host, the user data in the temporary cloud drive and the encrypted data volume are compared. If this is not the first encrypted backup of the backup cloud drive, the incremental data in the temporary cloud drive is read and used as the differential data. If this is the first encrypted backup of the backup cloud drive, the full data in the temporary cloud drive is read and used as the differential data.
[0061] The host's preset protocol framework, for example, the eventlet library's coroutine framework. Utilize the host's preset protocol framework to concurrently write the data to be backed up into the encrypted data volume. After the temporary cloud hard drive data is copied to the encrypted data volume, except for the encryption information in the encrypted data volume, the other data in the encrypted data volume is completely consistent with the data in the temporary cloud hard drive and the source cloud hard drive. Figure 2 As shown, the data of the temporary cloud hard disk is copied to the encrypted Base volume of the backup backend.
[0062] In this implementation, the host compares the temporary cloud hard drive with the encrypted data volume to identify the difference, allowing full and incremental backups of the backup cloud host. Leveraging the host's pre-set protocol framework, the backup data is written to the encrypted data volume in parallel, improving data backup efficiency.
[0063] In some optional implementations, mounting the temporary cloud hard disk and the encrypted data volume to the host machine includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, the temporary cloud hard disk is mounted to the host file directory of the host machine through the preset mount command; If yes, the temporary cloud hard disk is decrypted using the preset decryption command, and the decrypted temporary cloud hard disk is mounted to the host file directory using the preset mount command; The encrypted data volume is decrypted using a preset decryption command, and the decrypted encrypted data volume is mounted to the host file directory using a preset mount command.
[0064] Specifically, this embodiment is used to mount a temporary cloud drive and an encrypted data volume to a host machine. When a temporary cloud drive is created, all data in the cloud drive to be backed up, including encrypted data, is copied to the temporary cloud drive. Therefore, if the source cloud drive is an encrypted cloud drive, the temporary cloud drive is also an encrypted cloud drive.
[0065] Determine whether the temporary cloud drive is an encrypted cloud drive. If it is, decrypt it before mounting it on the host. Preset decryption commands include the cryptsetup luksOpen command and mount commands include the mount command. Use the preset decryption command to decrypt and open the temporary cloud drive, then use the preset mount command to mount the decrypted temporary cloud drive to the host's file directory. If the temporary cloud drive is a standard cloud drive, not an encrypted one, use the preset mount command to mount it directly to the host's file directory or mount point directory.
[0066] The encrypted data volume is decrypted using a preset decryption command, and then the decrypted encrypted data volume is mounted to a host file directory or a host mount point directory using a preset mount command.
[0067] In some optional implementations, creating a backup data volume and copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume includes: Obtain the backup name and backup size from the backup record, create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; Unmount the encrypted data volume on the host machine; Use the backup backend to establish a local replication relationship between the encrypted data volume and the backup data volume; Based on the local replication relationship, the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume.
[0068] Specifically, the backup name and backup size are obtained from the backup record. The backup name is set according to actual needs, and the backup size is the same as the size of the cloud hard disk to be backed up.
[0069] On the backup backend, create a second empty data volume with the same name and size as the backup volume, and use the second empty data volume as the backup data volume.
[0070] After the backup volume is created, since both the encrypted and backup volumes are on the backup backend, you can use the backup backend's local replication feature to replicate data. To facilitate the use of the backup backend's local replication feature, you must first unmount the encrypted volume on the host machine.
[0071] Use the backup backend to establish a local replication relationship between the encrypted data volume and the backup data volume. Based on the local replication relationship, all encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume. After the copy is completed, the backup data volume becomes the encrypted backup volume of the source cloud hard disk. Figure 2 As shown in the figure, on the backup backend, data in the encrypted Base volume is copied to the encrypted backup volume through local replication.
[0072] In this embodiment, a backup data volume is created on the backup backend, the encrypted data volume is unmounted on the host machine, and the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume using the local replication function of the backup backend, thereby improving data replication efficiency without occupying the available resources of the host machine.
[0073] In some optional implementations, creating a backup data volume and copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume includes: Obtain the backup name and backup size from the backup record, create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; Mount the backup data volume to the host machine; The encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume using the preset protocol framework of the host machine.
[0074] Specifically, the backup name and backup size are obtained from the backup record. The backup name is set according to actual needs, and the backup size is the same as the size of the cloud hard disk to be backed up.
[0075] On the backup backend, create a second empty data volume with the same name and size as the backup volume, and use the second empty data volume as the backup data volume.
[0076] The host's default protocol framework, for example, the eventlet library's coroutine framework. Because it allows for concurrent data replication and improves data replication efficiency, it can be used for data replication. To facilitate the use of the host's default protocol framework, you must first mount the backup data volume on the host.
[0077] Leveraging the host's pre-defined protocol framework, the encrypted backup data and encryption information in the encrypted data volume are concurrently copied to the backup data volume. Once the copy is complete, the backup data volume becomes the encrypted backup volume of the source cloud drive. Except for the encryption information in the backup data volume, all other data in the backup data volume is identical to the data in the temporary cloud drive and the source cloud drive.
[0078] In this embodiment, the encrypted backup data and the encrypted information in the encrypted data volume are written into the encrypted data volume in parallel by utilizing the preset protocol framework of the host machine, thereby improving data backup efficiency.
[0079] In some optional implementations, unmounting the encrypted data volume on the host machine includes: Unmount the encrypted data volume from the host file directory using the preset unmount command; Execute the data volume close command to close the encrypted data volume.
[0080] Specifically, the preset uninstallation command is, for example, the umount command, and the data volume closing command is, for example, the cryptsetupluksClose command.
[0081] After the backup data of the temporary cloud hard disk is copied to the encrypted data volume, the encrypted data volume is unmounted from the host file directory using the preset unmount command, and the data volume close command is executed to close the encrypted data volume to complete the unmounting of the encrypted data volume.
[0082] It should be noted that after the encrypted backup of the cloud hard disk to be backed up is completed, the encrypted data volume will not be deleted. The encrypted data volume will be used to copy the user incremental data when the encrypted backup of the cloud hard disk to be backed up is performed next time.
[0083] In some optional implementations, after writing the data to be backed up to the encrypted data volume, the method further includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, use the preset uninstall command to uninstall the temporary cloud hard disk from the host file directory; If yes, the temporary cloud hard disk is uninstalled from the host file directory through the preset uninstall command, and the cloud hard disk close command is executed to close the temporary cloud hard disk.
[0084] Specifically, when the host machine uninstalls the temporary cloud hard disk, it is also necessary to determine whether the temporary cloud hard disk is an encrypted cloud hard disk. If the temporary cloud hard disk is an encrypted cloud hard disk, it needs to be decrypted first.
[0085] The default unmount command is: umount. The cloud disk close command is: cryptsetup luksClose.
[0086] If the temporary cloud drive is not an encrypted cloud drive, directly uninstall the temporary cloud drive from the host's file directory using the preset uninstall command. After the temporary cloud drive is uninstalled from the host, delete the temporary cloud drive.
[0087] If the temporary cloud drive is an encrypted cloud drive, first uninstall the temporary cloud drive from the host's file directory using the preset uninstall command, and then execute the cloud drive shutdown command to shut down the temporary cloud drive. After the temporary cloud drive is uninstalled from the host, delete the temporary cloud drive.
[0088] In some optional embodiments, the method further comprises: Before creating a snapshot of the cloud hard disk to be backed up according to the first component, modifying the status of the cloud hard disk to be backed up to being backed up in the database; After creating a snapshot of the cloud hard disk to be backed up according to the first component, the state of the cloud hard disk to be backed up is modified to an available state in the database.
[0089] Specifically, before creating a snapshot of the cloud hard disk to be backed up based on the first component, the file system of the source cloud hard disk, i.e., the cloud hard disk to be backed up, is frozen, and the cloud hard disk status in the database is changed from being in use to being backed up, to prevent users from performing other operations on the cloud hard disk to be backed up during the backup process.
[0090] After creating a snapshot of the cloud drive to be backed up, or after the temporary cloud drive is created, restore the file system of the cloud drive to be backed up, change the status of the cloud drive to be backed up to available in the database, and the cloud host can read and write to the cloud drive to be backed up. The subsequent encrypted backup process is completed by the temporary cloud drive and will not affect the normal production business of the cloud host.
[0091] In this implementation, before creating a snapshot of the cloud drive to be backed up, the status of the cloud drive to be backed up is changed to "Backing Up" to prevent backup failures caused by other operations performed on the cloud drive during the backup process. After creating the snapshot, the status of the cloud drive to be backed up is changed to "Available" to allow the cloud host to read and write to the cloud drive, ensuring that the encrypted backup process does not affect the normal production operations of the cloud host.
[0092] In some optional implementations, after copying the encrypted backup data and encryption information in the encrypted data volume to the backup data volume, the method further includes: Upon receiving the data recovery instruction and the key, the backup data volume is decrypted using the key, and the data to be recovered corresponding to the data recovery instruction is obtained from the decrypted backup data volume; Determine the target cloud drive according to the data recovery instructions and restore the data to be restored to the target cloud drive.
[0093] Specifically, after the encrypted backup data and encryption information in the encrypted data volume are copied to the backup data volume, the encrypted backup of the cloud hard disk to be backed up is completed. The status of the backup data volume in the database is changed from being created to being available. At this time, the user can use the backup data volume to restore data. For example: the user sends a data recovery instruction and a key to the backup backend. The user specifies the data to be restored, i.e., the data to be restored, and the location to which the data needs to be restored, such as the target cloud hard disk, through the data recovery instruction. The backup backend uses the key to decrypt the backup data volume, and obtains the data to be restored corresponding to the data recovery instruction from the decrypted backup data volume; determines the target cloud hard disk according to the data recovery instruction, and restores the data to be restored to the target cloud hard disk.
[0094] In this embodiment, data recovery instructions and keys are used to restore the data to be recovered to the target cloud hard disk, which not only provides data protection and recovery capabilities, ensuring that user data can be quickly restored in the event of loss, damage or accidental loss, effectively ensuring the integrity of user data, but also ensures the confidentiality of backup data during transmission and storage, thereby enhancing data security.
[0095] In some optional implementations, a custom policy may be set to automatically back up the cloud hard disk. The specific process may include steps A1 to A4.
[0096] Step A1: After creating a cloud hard drive, determine the cloud hard drive that needs to be automatically backed up.
[0097] Specifically, users select the type of cloud disk through the OpenStack Cinder component according to their needs, create the required cloud disk, and determine the cloud disk to be automatically backed up among the created cloud disks.
[0098] Step A2: Create a customized backup policy based on business needs.
[0099] Specifically, the basic operation types provided by the policy module create a custom backup policy, set the backup policy's attributes, and enable the backup policy. The backup policy is stored in a separate data table extended and added based on the OpenStack database. Users can perform basic data operations on the custom backup policy, including create, delete, modify, query, associate, enable, and disable. Cloud disk backup policies are service resource types provided by the data service component that extends the business framework of OpenStack.
[0100] In step A3, the created backup policy is associated with the cloud hard disk that needs to be automatically backed up, and the association relationship information is stored in the corresponding association relationship data table in the database.
[0101] Specifically, the relationship between backup policies and cloud drives is one-to-many: one backup policy can be associated with multiple cloud drives, but one cloud drive can only be associated with one backup policy. The backup policy's attributes include its ID, name, status, cycle (daily, weekly, or monthly), time point (a specified moment), and ownership information. The association information includes the cloud drive ID, backup policy ID, and ownership information. For example, if cloud drive A and cloud drive B are both associated with the backup policy created in step A2, two cloud drive-backup policy associations will be generated, one for cloud drive A and one for cloud drive B (recording the cloud drive ID, backup policy ID, ownership information, etc.), and stored in the corresponding association data table in the database.
[0102] Step A4, create an automatic backup script, which is used to scan the association relationship information in the association relationship data table according to the backup strategy, and use the cloud hard disk backup method in steps S101 to S103 and other embodiments to automatically back up the cloud hard disk determined to be automatically backed up, and generate its corresponding backup data volume.
[0103] Specifically, the automatic backup script will scan the association information recorded in the association data table according to the defined backup strategy, and use the cloud hard disk backup method in steps S101 to S103 and other embodiments to automatically back up the cloud hard disk that is determined to be automatically backed up at the period and time point specified in the backup strategy of the cloud hard disk, and generate its corresponding backup data volume.
[0104] In this embodiment, a customized backup policy service is added to realize automatic backup of a specified cloud hard disk based on a specified time point and a specified policy. This method greatly reduces the risk of data security storage. At the same time, it is more user-friendly and convenient for users, thereby improving the user experience.
[0105] In some optional embodiments, Figure 3 This is a flow chart of a cloud hard disk encryption backup method according to an embodiment of the present invention. This method can also solve the problem that related technologies cannot guarantee the security of backup data during transmission and storage. Figure 3 As shown, the method includes the following steps: Specify the encryption type; modify the source cloud hard disk status; create a backup record in the database; create a temporary cloud hard disk; determine whether the source cloud hard disk is encrypted. If so, decrypt and mount the temporary cloud hard disk on the host; if not, mount the temporary cloud hard disk on the host; determine whether an encrypted base volume exists; if not, create the base volume, encrypt and format the base volume, and decrypt and mount the base volume on the host; if yes, decrypt and mount the base volume on the host; copy data from the temporary cloud hard disk to the base volume; unmount the base volume on the host; create a backup volume; copy data from the base volume to the backup volume; unmount and delete the temporary cloud hard disk; update the source cloud hard disk and backup status.
[0106] In this embodiment, not only can user data be protected from the risk of accidental damage, deletion or loss, and data protection and recovery capabilities can be provided, but the confidentiality of backup data during transmission and storage is also guaranteed, preventing unauthorized access, thereby further enhancing the security of user data.
[0107] In this embodiment, a cloud hard disk backup device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation methods. The details that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
[0108] This embodiment provides a cloud hard disk backup device, such as Figure 4 As shown, including: The data acquisition module 401 is used to acquire the data to be backed up from the cloud hard disk; A first backup module 402 is configured to obtain an encrypted data volume and copy the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, and the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, thereby obtaining and storing the encrypted backup data; The second backup module 403 is configured to create a backup data volume and copy the encrypted backup data and encryption information in the encrypted data volume to the backup data volume.
[0109] In some optional implementations, the first backup module 402 includes: An acquisition unit is used to obtain a list of data volumes corresponding to the cloud hard disk to be backed up from the backup backend; a determination unit, configured to determine whether a data volume exists in the data volume list, with a capacity identical to the backup size in the backup record and an encryption type identical to the encryption type information in the backup record; and if so, to use the data volume as an encrypted data volume, wherein the backup record is used to represent backup information of the cloud hard disk to be backed up; The first creation unit is used to create a first empty data volume with the same capacity as the backup size in the backup record using the first component on the backup backend if it does not exist, format the first empty data volume using the encryption type information in the backup record, obtain an encrypted data volume, and generate encryption information in the encrypted data volume.
[0110] In some optional embodiments, the device further comprises: The first acquisition module is used to obtain encryption algorithm configuration information, encryption operation information, encryption algorithm and key length; An obtaining module is used to obtain encryption type information according to encryption algorithm configuration information, encryption operation information, encryption algorithm and key length, wherein the encryption type information is used to generate encryption information in the encrypted data volume; The second acquisition module is used to obtain the backup name and backup size; A creation module is used to create a backup record in the database that contains encryption type information, backup name, and backup size.
[0111] In some optional implementations, the data acquisition module 401 includes: A freezing unit, used to freeze the file system of the cloud hard disk to be backed up; A second creating unit, configured to create a snapshot of the cloud hard disk to be backed up according to the first component, wherein the snapshot includes the data to be backed up; The recovery unit is used to generate a temporary cloud hard disk according to the snapshot and restore the file system, wherein the temporary cloud hard disk is used to temporarily store data to be backed up.
[0112] In some optional implementations, the first backup module 402 includes: The first mounting unit is used to mount the temporary cloud hard disk and encrypted data volume to the host machine; A determination unit, configured to compare the temporary cloud hard disk and the encrypted data volume using the host machine, determine difference data, and use the difference data as data to be backed up; The writing unit is used to write the data to be backed up into the encrypted data volume by using the preset protocol framework of the host machine.
[0113] In some optional embodiments, the first mounting unit includes: The first judgment submodule is used to judge whether the temporary cloud hard disk is an encrypted cloud hard disk; The first mounting submodule is used to mount the temporary cloud hard disk to the host file directory of the host machine through a preset mounting command if not; The second mounting submodule is used to decrypt the temporary cloud hard disk using a preset decryption command if yes, and mount the decrypted temporary cloud hard disk to the host file directory using a preset mounting command; The third mounting submodule is used to decrypt the encrypted data volume using a preset decryption command, and mount the decrypted encrypted data volume to a host file directory using a preset mounting command.
[0114] In some optional implementations, the second backup module 403 includes: a third creation unit, configured to obtain a backup name and a backup size from the backup record, and create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; An unmounting unit, used to unmount the encrypted data volume on the host machine; An establishing unit, configured to establish a local replication relationship between the encrypted data volume and the backup data volume using a backup backend; The first replication unit is configured to replicate the encrypted backup data and encryption information in the encrypted data volume to the backup data volume based on the local replication relationship.
[0115] In some optional implementations, the second backup module 403 includes: a fourth creation unit, configured to obtain a backup name and a backup size from the backup record, and create a second empty data volume with the same name and size as the backup on the backup backend, and use the second empty data volume as the backup data volume; The second mounting unit is used to mount the backup data volume to the host machine; The second copying unit is used to copy the encrypted backup data and encryption information in the encrypted data volume to the backup data volume by using a preset protocol framework of the host machine.
[0116] In some optional embodiments, the unloading unit includes: A first uninstallation submodule, configured to uninstall the encrypted data volume from the host file directory using a preset uninstallation command; The close submodule is used to execute the data volume close command and close the encrypted data volume.
[0117] In some optional implementations, the first backup module 402 further includes: The second judgment submodule is used to judge whether the temporary cloud hard disk is an encrypted cloud hard disk; The second uninstallation submodule is used to uninstall the temporary cloud hard disk from the host file directory using a preset uninstallation command if not; The third uninstallation submodule is used to, if yes, uninstall the temporary cloud hard disk from the host file directory through a preset uninstallation command, and execute a cloud hard disk closing command to close the temporary cloud hard disk.
[0118] In some optional implementations, the data acquisition module 401 further includes: A first state modifying unit, configured to modify the state of the cloud hard disk to be backed up to being backed up in the database before creating a snapshot of the cloud hard disk to be backed up according to the first component; The second state modifying unit is configured to modify the state of the cloud hard disk to be backed up to an available state in the database after creating a snapshot of the cloud hard disk to be backed up according to the first component.
[0119] In some optional embodiments, the device further comprises: A decryption module is used to decrypt the backup data volume using the key upon receiving the data recovery instruction and the key, and obtain the data to be recovered corresponding to the data recovery instruction from the decrypted backup data volume; The recovery module is used to determine the target cloud hard disk according to the data recovery instruction and restore the data to be recovered to the target cloud hard disk.
[0120] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0121] The cloud hard disk backup device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0122] The embodiment of the present invention also provides a computer device having the above Figure 4 The cloud hard drive backup device is shown.
[0123] See also Figure 5 , Figure 5 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0124] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include an integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0125] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0126] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0128] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0129] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0130] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0131] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations shall fall within the scope defined in this application.
Claims
1. A cloud hard disk backup method, characterized in that: The method comprises: Obtain the data to be backed up from the cloud hard disk to be backed up; Acquire an encrypted data volume, and copy the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, and the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, and obtain and save the encrypted backup data; A backup data volume is created, and the encrypted backup data and the encryption information in the encrypted data volume are copied to the backup data volume.
2. The method according to claim 1, characterized in that The step of obtaining the encrypted data volume includes: Obtaining a list of data volumes corresponding to the cloud hard disk to be backed up on the backup backend; Determine whether there is a data volume in the data volume list whose capacity is the same as the backup size in the backup record and whose encryption type is the same as the encryption type information in the backup record; if so, use the data volume as the encrypted data volume, wherein the backup record is used to represent the backup information of the cloud hard disk to be backed up; If it does not exist, use the first component to create a first empty data volume with the same capacity as the backup size in the backup record in the backup backend, format the first empty data volume using the encryption type information in the backup record, obtain the encrypted data volume and generate the encryption information in the encrypted data volume.
3. The method according to claim 2, characterized in that Before determining whether there is a data volume in the data volume list having a capacity that is the same as the backup size in the backup record and an encryption type that is the same as the encryption type information in the backup record, the method further includes: Obtain encryption algorithm configuration information, encryption operation information, encryption algorithm and key length; Obtaining encryption type information according to the encryption algorithm configuration information, the encryption operation information, the encryption algorithm, and the key length, wherein the encryption type information is used to generate the encryption information in the encrypted data volume; Get the backup name and backup size; The backup record including the encryption type information, the backup name, and the backup size is created in a database.
4. The method according to claim 3, characterized in that The step of obtaining the data to be backed up of the cloud hard disk to be backed up includes: Freeze the file system of the cloud hard disk to be backed up; Creating a snapshot of the cloud hard disk to be backed up according to the first component, wherein the snapshot includes the data to be backed up; A temporary cloud hard disk is generated according to the snapshot, and the file system is restored, wherein the temporary cloud hard disk is used to temporarily store the data to be backed up.
5. The method according to claim 4, characterized in that The step of copying the data to be backed up to the encrypted data volume comprises: Mounting the temporary cloud hard disk and the encrypted data volume to the host machine; Using the host machine to compare the temporary cloud hard disk and the encrypted data volume, determine differential data, and use the differential data as the data to be backed up; The data to be backed up is written into the encrypted data volume using a preset protocol framework of the host machine.
6. The method according to claim 5, characterized in that The step of mounting the temporary cloud hard disk and the encrypted data volume on the host machine includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, the temporary cloud hard disk is mounted to the host file directory of the host machine through a preset mount command; If yes, decrypt the temporary cloud hard disk using a preset decryption command, and mount the decrypted temporary cloud hard disk to the host file directory using the preset mount command; The encrypted data volume is decrypted by the preset decryption command, and the decrypted encrypted data volume is mounted to the host file directory by the preset mounting command.
7. The method according to claim 5, characterized in that The step of creating a backup data volume and copying the encrypted backup data and the encryption information in the encrypted data volume to the backup data volume includes: Acquire the backup name and the backup size from the backup record, create a second empty data volume with the same name and the same size as the backup name on the backup backend, and use the second empty data volume as the backup data volume; Unmounting the encrypted data volume on the host machine; Using the backup backend to establish a local replication relationship between the encrypted data volume and the backup data volume; Based on the local replication relationship, the encrypted backup data and the encryption information in the encrypted data volume are copied to the backup data volume.
8. The method according to claim 5, characterized in that The step of creating a backup data volume and copying the encrypted backup data and the encryption information in the encrypted data volume to the backup data volume includes: Acquire the backup name and the backup size from the backup record, create a second empty data volume with the same name and the same size as the backup name on the backup backend, and use the second empty data volume as the backup data volume; Mounting the backup data volume to the host machine; The encrypted backup data and the encryption information in the encrypted data volume are copied to the backup data volume by using the preset protocol framework of the host machine.
9. The method according to claim 7, characterized in that: Unmounting the encrypted data volume on the host machine includes: Uninstalling the encrypted data volume from the host file directory using a preset uninstall command; Execute a data volume closing command to close the encrypted data volume.
10. The method according to claim 5, characterized in that After writing the data to be backed up into the encrypted data volume, the method further includes: Determine whether the temporary cloud hard disk is an encrypted cloud hard disk; If not, uninstall the temporary cloud hard disk from the host file directory using a preset uninstall command; If yes, the temporary cloud hard disk is uninstalled from the host file directory through the preset uninstall command, and the cloud hard disk close command is executed to close the temporary cloud hard disk.
11. The method according to claim 5, characterized in that The method further comprises: Before creating the snapshot of the cloud hard disk to be backed up according to the first component, modifying the status of the cloud hard disk to be backed up in the database to be in backup; After creating the snapshot of the cloud hard disk to be backed up according to the first component, modifying the status of the cloud hard disk to be backed up to an available status in the database.
12. The method according to claim 1, characterized in that After copying the encrypted backup data and the encryption information in the encrypted data volume to the backup data volume, the method further includes: When receiving the data recovery instruction and the key, decrypting the backup data volume using the key, and obtaining the to-be-recovered data corresponding to the data recovery instruction from the decrypted backup data volume; A target cloud hard disk is determined according to the data recovery instruction, and the data to be recovered is recovered to the target cloud hard disk.
13. A cloud hard disk backup device, characterized in that: The device comprises: A data acquisition module is used to acquire the data to be backed up from the cloud hard disk to be backed up; A first backup module, used to obtain an encrypted data volume, and copy the data to be backed up to the encrypted data volume, wherein the encrypted data volume contains encryption information, and the encrypted data volume is used to encrypt the data to be backed up according to the encryption information, and obtain and save the encrypted backup data; The second backup module is used to create a backup data volume, and copy the encrypted backup data and the encryption information in the encrypted data volume to the backup data volume.
14. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the cloud hard disk backup method according to any one of claims 1 to 12 by executing the computer instructions.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the cloud hard disk backup method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and system for managing cloud disk
CN116383870A
Encrypted volume migration method and device, computer equipment and storage medium
CN117591016A
File storage method and device, equipment, storage medium and computer program product
CN119071019A
Archiving NAS servers to the cloud
US20190235968A1
Method and apparatus for data compression, backup and recovery of cloud hard disk, device and storage medium
WO2023000674A1
Cited By
Data processing system, method, equipment and medium
CN120498774A