Data recovery method, computer equipment, storage medium and program product

By comparing CDP snapshots and status information tables on the production side equipment, the data is directly restored to the target backup version state, solving the problem of low data rollback efficiency in the existing technology, and achieving efficient data recovery and resource conservation.

CN118708406BActive Publication Date: 2024-11-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411180368.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-15
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The prior art is relatively inefficient in the data rollback process, requiring two rollback operations, and the ordinary snapshot mechanism leads to waste of volume specifications and long data recovery time.

Method used

When receiving the rollback instruction, a CDP snapshot operation is performed on the target production volume, the identification of the first snapshot and the first snapshot are generated, the identification of the rollback backup version is obtained, and the first backup status information table and the second backup status information table are matched. , directly analyze and restore data to the rollback backup version state, avoiding unnecessary data recovery operations.

Benefits of technology

Improves data recovery efficiency, saves resources, reduces the number of rollback operations, and does not need to create snapshot volumes when using CDP snapshots, saves volume specifications, and can restore to the previous state when data recovery fails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708406B_ABST
    Figure CN118708406B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of storage technology, and discloses a data recovery method, a computer device, a storage medium, and a program product, including: when receiving a rollback instruction for a target production volume, taking a snapshot operation on the target production volume, generating a first snapshot and an identifier of the first snapshot, the target production volume is divided into at least one storage particle, and the rollback instruction includes an identifier of a rollback backup version; obtaining an identifier of the target backup version of the latest cloud backup operation; obtaining a first backup status information table according to the identifier of the rollback backup version; obtaining a second backup status information table according to each storage particle and the identifier of the target backup version; and restoring the data stored in the target production volume to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version, and the identifier of the first snapshot. The present invention can improve data recovery efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a data recovery method, a computer device, a storage medium and a program product. Background Art

[0002] In the field of storage technology, a large amount of data can be stored in the production-end device. In order to ensure the security of the data, the data is generally backed up. For example, cloud backup technology is currently generally used. During the initial backup, the full amount of data stored in the production-end device is backed up to the backup-end device. During subsequent backups, incremental backups are used. After the data in the production-end device is damaged, the data at a certain backup time can be obtained from the backup-end device according to user needs, and the data in the production-end device can be restored.

[0003] In the related art, when the production-end device needs to restore data from the backup-end device to the state of the n-generation backup version, the production-end device can first obtain the backup status information table of the n-generation backup version (not the first backup), wherein the backup status information table records the identifier of the backup version to which the latest data belongs at the time point corresponding to the n-generation backup version for each storage particle of the production volume. Then, the production-end device first restores the data in the production volume to the state at the time point corresponding to the latest backup version according to the snapshot corresponding to the latest backup version (m). Afterwards, the m backup status information table corresponding to the m-generation backup version and the n backup status information table corresponding to the n-generation backup version are compared. The specific processing can be: traversing each storage particle of the production volume, taking the target storage particle as an example, the production-end device compares the identifier of the first backup version of the target storage particle in the m backup status information table and the identifier of the second backup version of the target storage particle in the n backup status information table. If the identifier of the first backup version and the identifier of the second backup version are the same, it is considered that the target storage particle does not need to be rolled back. If the identifier of the first backup version is different from the identifier of the second backup version, the data of the target storage granule under the nth generation backup version can be obtained from the backup end device and written into the target storage granule in the production volume.

[0004] In this way, when rolling back the production volume to the nth generation version, two rollbacks are required, which is inefficient. Summary of the invention

[0005] In view of this, the present invention provides a data recovery method, apparatus, computer equipment, storage medium and program product to solve the problem of low data rollback efficiency.

[0006] In a first aspect, the present invention provides a data recovery method, which is applied to a backup system, wherein the backup system includes a production end device and a backup end device, and the method is executed by the production end device, and the method includes:

[0007] When receiving a rollback instruction for a target production volume in the production-end device, taking a snapshot of the target production volume to generate a first snapshot and an identifier of the first snapshot, wherein the target production volume is divided into at least one storage granularity, and the rollback instruction includes an identifier of the rollback backup version;

[0008] Obtaining an identifier of a target backup version of a latest cloud backup operation on the target production volume before receiving the rollback instruction;

[0009] According to the identifier of the rolled-back backup version, obtaining a first backup status information table matching the identifier of the rolled-back backup version;

[0010] According to each of the storage granules and the identifier of the target backup version, acquiring a second backup status information table that matches the identifier of the target backup version;

[0011] The data stored in the target production volume is restored to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version, and the identifier of the first snapshot.

[0012] A data recovery method provided by the present invention has the following advantages:

[0013] Before performing the rollback operation, the production-end device (production-end device) of this solution first takes a snapshot of the target production volume and generates a first snapshot and an identifier of the first snapshot. Then, the production-end device can obtain the first backup status information table according to the identifier of the rollback backup version included in the rollback instruction. In addition, the production-end device determines the identifier of the target backup version and obtains the corresponding second backup status information table. Unlike the related art, this solution does not need to obtain the snapshot corresponding to the target backup version according to the identifier of the target backup version, and first rolls back the target production volume to the state corresponding to the target backup version. Instead, after directly performing analysis operations based on the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot, the data stored in the target production volume is directly restored to the state corresponding to the rollback backup version. In this way, this solution only needs to perform one rollback operation, which can improve data recovery efficiency.

[0014] In an optional implementation, the first backup status information table includes an identifier of each storage granule and an identifier of a backup version corresponding to the identifier of each storage granule at the time of rollback backup, and the second backup status information table includes an identifier of each storage granule and an identifier of a backup version corresponding to the identifier of each storage granule at the time of target backup;

[0015] The step of restoring the data stored in the target production volume to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version, and the identifier of the first snapshot includes:

[0016] Traversing each of the storage particles;

[0017] Each time a storage granule is traversed, according to the identifier of the traversed target storage granule, the identifier of the first backup version corresponding to the identifier of the target storage granule is extracted from the first backup status information table, and the identifier of the second backup version corresponding to the identifier of the target storage granule is extracted from the second backup status information table;

[0018] Determining whether to perform a data recovery operation on the target storage granule according to the identifier of the first backup version, the identifier of the second backup version, the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot;

[0019] When it is determined to perform a data recovery operation on the target storage granule, according to the identifier of the target storage granule and the identifier of the rollback backup version, the target data of the target storage granule under the rollback backup version is acquired from the backup end device;

[0020] The data in the target storage particle is restored to the target data.

[0021] Specifically, by preliminarily comparing the identifiers of the backup versions corresponding to the storage particles at the rollback backup time and the target backup time, it is possible to accurately determine whether the backup-end device has recorded whether the data of the storage particles has changed. When it is determined that a change has occurred (when a data recovery operation is required), a data recovery operation is performed instead of restoring data for all storage particles. This can save resources and improve data recovery efficiency.

[0022] In an optional implementation, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the first backup version, the identifier of the second backup version, the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot includes:

[0023] Determining whether the identifier of the first backup version is consistent with the identifier of the second backup version;

[0024] When it is determined that the identifier of the first backup version and the identifier of the second backup version are inconsistent, determining that the target storage granule performs a data recovery operation;

[0025] or,

[0026] When it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, it is determined whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule and the identifier of the first snapshot.

[0027] Specifically, when it is determined that the identifier of the first backup version and the identifier of the second backup version are inconsistent, it can be considered that the data in the target storage particle is different at the rollback backup time and the target backup time, and it is necessary to restore it, so it can be directly restored. When it is determined that the identifier of the first backup version and the identifier of the second backup version are consistent, there may be two situations, so further confirmation is required. Since each recovery is equivalent to a new data write operation, if all storage particles are directly restored, more storage resources will be wasted. This solution does not need to restore all storage particles, but through sophisticated judgment steps, it can save resources and improve recovery efficiency.

[0028] In an optional implementation, when it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot includes:

[0029] According to the identifier of the rolled-back backup version, acquiring an identifier of a second snapshot corresponding to the identifier of the rolled-back backup version;

[0030] Determining first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot;

[0031] determining second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot;

[0032] It is determined whether to perform a data recovery operation on the target storage particle according to the first physical location information and the second physical location information.

[0033] Specifically, this solution can obtain the identifier of the second snapshot by using the identifier of the rollback backup version, and the storage pool module of the production-end device records the actual physical location of each storage particle at each snapshot time. Therefore, it is possible to compare whether the actual physical location of the storage particles at two snapshot times has changed, and it is possible to accurately determine whether data recovery operations are required, thereby saving resources and improving recovery efficiency.

[0034] In an optional implementation, determining whether to perform a data recovery operation on the target storage particle according to the first physical location information and the second physical location information includes:

[0035] determining whether the first physical location information and the second physical location information are the same;

[0036] When it is determined that the first physical location information and the second physical location information are different, determining to perform a data recovery operation on the target storage particle;

[0037] or,

[0038] When it is determined that the first physical location information and the second physical location information are the same, it is determined not to perform a data recovery operation on the target storage particle.

[0039] Specifically, the data recovery operation is performed only when the first physical location information and the second physical location information are different, which can save resources and improve recovery efficiency.

[0040] In an optional implementation, after obtaining the identifier of the target backup version of the latest cloud backup operation on the target production volume before receiving the rollback instruction, the method further includes:

[0041] Determine whether the identifier of the rollback backup version is consistent with the identifier of the target backup version;

[0042] When it is determined that the identifier of the rolled-back backup version is inconsistent with the identifier of the target backup version, a first backup status information table matching the identifier of the rolled-back backup version is obtained according to the identifier of the rolled-back backup version.

[0043] Specifically, since the identifier of the rollback backup version is inconsistent with the identifier of the target backup version, it indicates that the first backup status information table and the second backup status information table are different. Therefore, the comparison between the first backup status information table and the second backup status information table can be performed only in this case, which can save resources and improve data recovery efficiency.

[0044] In an optional implementation, when it is determined that the identifier of the rollback backup version is consistent with the identifier of the target backup version, the method further includes:

[0045] Directly traverse each of the storage particles;

[0046] Each time a storage granule is traversed, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the traversed target storage granule, the identifier of the rollback backup version, and the identifier of the first snapshot;

[0047] When it is determined to perform a data recovery operation on the target storage granule, according to the identifier of the target storage granule and the identifier of the rollback backup version, the target data of the target storage granule under the rollback backup version is acquired from the backup end device;

[0048] The data in the target storage particle is restored to the target data.

[0049] Specifically, since the identifier of the rollback backup version and the identifier of the target backup version are consistent, it indicates that the first backup status information table and the second backup status information table are completely consistent. Therefore, in this case, the comparison between the first backup status information table and the second backup status information table may not be performed, which can save resources and improve data recovery efficiency.

[0050] In an optional embodiment, the method further includes:

[0051] In the event that the data recovery operation fails, the data in the target production volume is restored to a state before the rollback instruction is received according to the first snapshot.

[0052] Specifically, if the data recovery operation fails, part of the data in the target production volume will be new data and part will be old data, resulting in data inconsistency. Therefore, when a rollback instruction is received, a snapshot operation is performed, and when the data recovery operation fails, recovery is performed based on the first snapshot to ensure data security and consistency.

[0053] In an optional implementation, before acquiring the identifier of the second snapshot corresponding to the identifier of the rolled back backup version according to the identifier of the rolled back backup version, the method further includes:

[0054] When the backup instruction is obtained, a backup operation is performed on the target production volume, and a snapshot operation is performed on the target production volume to generate a second snapshot, an identifier of the second snapshot, and an identifier of a third backup version, wherein the identifier of the third backup version is the identifier of the rollback backup version;

[0055] The second snapshot, the identification information of the second snapshot, and the identification of the third backup version are stored correspondingly.

[0056] Specifically, taking a snapshot at each backup can facilitate obtaining the snapshot at the time of rollback backup when it is determined that the identifier of the first backup version is the same as the identifier of the second backup version, so as to perform further comparison operations and accurately understand whether data recovery operations are needed, thereby improving data recovery efficiency.

[0057] In an optional implementation, determining the first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot includes:

[0058] According to the identifier of the first snapshot, a first correspondence table storing identifiers and physical location information of particles at a snapshot time corresponding to the first snapshot is acquired;

[0059] According to the identifier of the target storage particle, the first physical location information corresponding to the identifier of the target storage particle is determined in the first correspondence table.

[0060] Specifically, this solution can be used to accurately determine whether a data recovery operation is required by obtaining the actual physical location information of the storage particles, thereby saving resources and improving recovery efficiency.

[0061] In an optional implementation, determining the second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot includes:

[0062] According to the identifier of the second snapshot, obtaining a second correspondence table storing identifiers and physical location information of particles at the snapshot moment corresponding to the second snapshot;

[0063] According to the identifier of the target storage particle, the second physical location information corresponding to the identifier of the target storage particle is determined in the second correspondence table.

[0064] Specifically, this solution can be used to accurately determine whether a data recovery operation is required by obtaining the actual physical location information of the storage particles, thereby saving resources and improving recovery efficiency.

[0065] In an optional implementation, the snapshot is a continuous protection CDP snapshot.

[0066] Specifically, this solution uses CDP snapshots. First, there is no need to create snapshot volumes, which can save volume specifications. Second, when performing data recovery operations, there is no need to copy old data to the snapshot volume first, but to directly write data, which can speed up the rollback speed, that is, improve data recovery efficiency. Third, in the event of data recovery failure, it is also possible to restore to the state before the rollback operation based on the snapshot taken when the rollback instruction is received.

[0067] In a second aspect, the present invention provides a data recovery device, the device is applied to a backup system, the backup system includes a production end device and a backup end device, the device includes:

[0068] a receiving module, configured to, when receiving a rollback instruction for a target production volume in the production-end device, perform a snapshot operation on the target production volume to generate a first snapshot and an identifier of the first snapshot, wherein the target production volume is divided into at least one storage granularity, and the rollback instruction includes an identifier of a rollback backup version;

[0069] An acquisition module is used to acquire the identifier of the target backup version of the latest cloud backup operation on the target production volume before receiving the rollback instruction; according to the identifier of the rollback backup version, acquire a first backup status information table that matches the identifier of the rollback backup version; according to each of the storage particles and the identifier of the target backup version, acquire a second backup status information table that matches the identifier of the target backup version;

[0070] A recovery module is used to restore the data stored in the target production volume to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot.

[0071] 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 data recovery method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0072] 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 data recovery method of the first aspect or any corresponding embodiment thereof.

[0073] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data recovery method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. 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 creative work.

[0075] Figure 1 is a schematic diagram of the architecture of a backup system according to an embodiment of the present invention;

[0076] Figure 2 is a flow chart of a data recovery method according to an embodiment of the present invention;

[0077] Figure 3 is a schematic diagram of a backup status information table according to an embodiment of the present invention;

[0078] Figure 4 is a flow chart of another data recovery method according to an embodiment of the present invention;

[0079] Figure 5 is a flow chart of another data recovery method according to an embodiment of the present invention;

[0080] Figure 6 is a structural block diagram of a data recovery device according to an embodiment of the present invention;

[0081] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0082] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the 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 creative work are within the scope of protection of the present invention.

[0083] The present invention provides a backup system, such as Figure 1 As shown, the backup system includes a production end device (also called a local device, i.e., a user's own device) and a backup end device (also called a cloud device). The production end device and the backup end device can both be servers, and the server can include a processor, a memory, a baseboard management controller, and a storage device, and the storage device can be divided into at least one production volume.

[0084] The professional terms involved in the embodiments of the present invention are explained below.

[0085] Ordinary snapshot: It is a data protection technology based on a point in time for production devices. Each time a snapshot is taken of a target production volume (any production volume in a production device), the production device will create an additional new volume (called the target volume) and create a mapping relationship between the production volume and the target volume. The production volume and the target volume have the same capacity and are divided into several storage grains (Grains) of the same unit size.

[0086] Copy on First Write (COW) mechanism of ordinary snapshots: After taking a snapshot of the target production volume for the first time, upon receiving a write IO to the target storage granule of the target production volume, the snapshot module in the production-end device will first read the old data in the target production volume and write it to the corresponding position of the target volume, and then write the new data to the target production volume according to the received write IO.

[0087] Continuous Data Protection (CDP): is a data protection technology for production-end devices. After taking a snapshot, when receiving each write IO, a snapshot identifier (Generation ID, gen_id) is added to each write IO to record which generation of snapshot relationship each write IO belongs to. In this way, all write IOs can be attributed to the production volume itself, without the need to generate an additional snapshot volume.

[0088] For example, for the target production volume, when no CDP snapshot is created, the gen_id of all received write IOs will be assigned a value of 0. After a CDP snapshot is created, the CDP snapshot is the 0th generation snapshot, and the corresponding data is all the data of the target production volume with a gen_id of 0. If another CDP snapshot is created, this new CDP snapshot will be the 1st generation snapshot, and the gen_id will be increased by 1, and the gen_id of all subsequent write IOs will be assigned a value of 1, and so on. It should be noted that the host write IO is not uniform, that is, some storage particles of the target production volume may often receive write IOs, while some storage particles receive write IOs more rarely. Therefore, at the same time point, the gen_id of each storage particle is not equal. When you want to read the data of the target production volume, you only need to read the data with the largest gen_id in each storage particle. When you want to read the data of a certain generation of CDP snapshots, you need to specify the target gen_id. For the target storage particle, if the target storage particle has the target gen_id, the corresponding data is read directly. If not, the target gen_id-1 is checked to see if it exists. The search continues until the data is found. The data found is the data corresponding to the target gen_id.

[0089] Cloud backup: According to the amount of data uploaded, cloud backup can be divided into full backup and incremental backup. Full backup means uploading all the data of the production volume to the backup device, while incremental backup only uploads the data that has changed since the last backup to the backup device. The data that has not changed in the incremental backup depends on the previous generations of data backed up. Therefore, when a production volume is backed up in the cloud, a full data backup is usually performed for the first time, and incremental backups are performed each time thereafter.

[0090] In the related technology, when the production-end device needs to restore data from the backup-end device to the state of the n-th generation backup version, the production-end device can first obtain the backup status information table of the n-th generation backup version (not the initial backup), wherein the backup status information table records the identifier of the backup version to which the latest data belongs at the time point corresponding to the n-th generation backup version for each storage particle of the production volume.

[0091] Before receiving the rollback instruction, the production-end device may have modified the data of some storage grains (for example, grain 4) in the production volume after performing the last (m) backup operation (the nth generation backup version is earlier than the mth generation backup version). These storage grains have not changed in each backup after the nth generation backup, and the modified data has not been backed up yet. Therefore, if the nth generation backup data is directly obtained from the backup-end device for data rollback, the data in grain 4 may still remain in the modified state and not be rolled back. Therefore, the production-end device first restores the data in the production volume to the state at the time point corresponding to the latest backup version based on the snapshot corresponding to the latest backup version (m). Afterwards, a comparison is performed based on the m backup status information table corresponding to the m-th generation backup version and the n backup status information table corresponding to the n-th generation backup version. The specific processing may be: traverse each storage particle of the production volume, take the target storage particle as an example, the production end device compares the identifier of the first backup version of the target storage particle in the m backup status information table with the identifier of the second backup version of the target storage particle in the n backup status information table. If the identifier of the first backup version and the identifier of the second backup version are the same, it is considered that the target storage particle does not need to be rolled back. If the identifier of the first backup version and the identifier of the second backup version are different, the data of the target storage particle under the n-th generation backup version can be obtained from the backup end device and written into the target storage particle in the production volume.

[0092] In this way, when rolling back the production volume to the nth generation version, two rollbacks are required, which is inefficient.

[0093] In addition, the related art uses ordinary snapshots, and each time an ordinary snapshot is taken, an additional snapshot volume needs to be generated, resulting in a waste of volume specifications. Moreover, each time a rollback operation is performed, from the perspective of the production-end device, it is equivalent to receiving a new write IO, and under the mechanism of ordinary snapshots, each time a write IO is executed, the old data needs to be written to the snapshot volume before the write operation can be performed according to the new write IO, resulting in a slower rollback operation process and a longer data recovery time.

[0094] According to an embodiment of the present invention, a data recovery method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, 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.

[0095] In this embodiment, a data recovery method is provided, which can be executed by the above-mentioned production end device. Figure 2 is a flow chart of a data recovery method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0096] Step S201: when a rollback instruction for a target production volume in a production-end device is received, a snapshot operation is performed on the target production volume to generate a first snapshot and an identifier of the first snapshot.

[0097] The rollback instruction may include an identifier of the rollback backup version and an identifier of the target production volume. The snapshot may be a CDP snapshot.

[0098] Specifically, the user can perform a rollback operation on the user-side device, and the user-side device can generate a corresponding rollback instruction according to the user's rollback operation and send it to the production-side device. The production-side device can receive the rollback instruction and extract the identification of the production volume and the identification of the backup version targeted by the rollback operation from the rollback instruction. Then, the production-side device can find the corresponding production volume according to the identification information of the production volume, take a snapshot of it, and generate a corresponding snapshot and snapshot identification. In addition, the production-side device can also record the time point of taking the snapshot.

[0099] Step S202: Obtain an identifier of a target backup version of the latest cloud backup operation on the target production volume before receiving the rollback instruction.

[0100] Specifically, the production-end device can record the backup version identifier and backup time point each time a backup operation is performed. In this way, the production-end device can use the time point when the rollback instruction is received as the target time point, and then determine the identifier of the target backup version corresponding to the backup time point closest to the target time point before the target time point based on the target time point and all the backup time points recorded by the production-end device.

[0101] Step S203: According to the identifier of the rolled-back backup version, a first backup status information table matching the identifier of the rolled-back backup version is obtained.

[0102] The first backup state information table (Grain Table) includes the identifier of each storage grain and the identifier of the backup version corresponding to the identifier of each storage grain at the time of rollback backup.

[0103] Specifically, the production-end device may pre-record the identifier of each storage particle in the target production volume. During the first backup operation, the production-end device may generate a third backup status information table based on the identifier of each storage particle and the identifier of the first backup version. Since, except for the first backup, all other backup operations are incremental backups, and, during non-first backup operations, the production-end device will determine at least one changed storage particle whose data has changed. Therefore, the production-end device may obtain the fourth backup status information table corresponding to the last backup operation, and according to the identifier of each changed storage particle, update the identifier of the backup version corresponding to the last backup time corresponding to the identifier of each changed storage particle in the fourth backup status information table to the identifier of the backup version corresponding to the current backup operation, and generate a fifth backup status information table. In this way, the production-end device may store a backup status information table corresponding to the identifier of each backup version. When performing a rollback operation, the first backup status information table matching the identifier of the rolled-back backup version may be found according to the identifier of the rolled-back backup version.

[0104] like Figure 3 As shown, the identifiers of the backup versions corresponding to the four storage particles in the target production volume at the time of the first backup can be

[1111] . During the second backup operation, the incremental backup is the data of the first two storage particles. Therefore, the identifiers of the backup versions corresponding to the four storage particles in the target production volume at the time of the second backup can be

[2211] . During the third backup operation, the incremental backup is the data of the second and third storage particles. Therefore, the identifiers of the backup versions corresponding to the four storage particles in the target production volume at the time of the third backup can be

[2331] .

[0105] Step S204: According to each storage granule and the identifier of the target backup version, a second backup status information table matching the identifier of the target backup version is obtained.

[0106] The second backup status information table may include an identifier of each storage particle and an identifier of a backup version corresponding to the identifier of each storage particle at the target backup time.

[0107] The specific processing of step S204 can refer to the specific processing of step S203, which will not be repeated here.

[0108] Step S205 , according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot, the data stored in the target production volume is restored to a state corresponding to the rollback backup version.

[0109] Step 1: traverse each storage particle.

[0110] Step 2: Every time a storage particle is traversed, according to the identifier of the traversed target storage particle, the identifier of the first backup version corresponding to the identifier of the target storage particle is extracted from the first backup status information table, and the identifier of the second backup version corresponding to the identifier of the target storage particle is extracted from the second backup status information table.

[0111] Step three: determine whether to perform a data recovery operation on the target storage granule according to the identifier of the first backup version, the identifier of the second backup version, the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot.

[0112] Step 3 may include the following specific processing steps:

[0113] Step a: determine whether the identifier of the first backup version is consistent with the identifier of the second backup version.

[0114] Step b: when it is determined that the identifier of the first backup version and the identifier of the second backup version are inconsistent, determining a target storage granule to perform a data recovery operation.

[0115] Step c: when it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, determine whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule and the identifier of the first snapshot.

[0116] Specifically, since the identifier of the first backup version is inconsistent with the identifier of the second backup version, it means that after the rollback backup time, the data of the target storage granule has changed, and the changed data has been recorded in the target backup version. Therefore, the production end device can download data from the backup end device, that is, execute step 4 to step 5. The identifier of the first backup version is consistent with the identifier of the second backup version, which means that after the rollback backup time and before the target backup time, the data in the target storage granule has not changed. At this time, it can be considered that there are two situations. First, before the rollback instruction is received after the target backup time, the data in the target storage granule has not changed, that is, the data in the target storage granule is the data at the rollback backup time, and the data recovery operation can be omitted. Second, before the rollback instruction is received after the target backup time, the data in the target storage granule has changed, and each backup version of the backup end device has not recorded the latest data in the target storage granule, and the target backup status information table also fails to reflect this change (the identifier of the first backup version is consistent with the identifier of the second backup version), and a data recovery operation is required.

[0117] For example, in Figure 3In the example, the data of the fourth storage granule is "A" during the first, second, and third backups, and the corresponding backup version identifier in the backup status information table generated for each backup is "1". After the third backup, the host changes "A" in the fourth storage granule to "D". Assuming that the identifier of the current rollback backup version is "2" and the identifier of the latest target backup version is "3", it can be seen from the backup status information table corresponding to the second (rollback backup version identifier) ​​backup that the backup version identifier of the fourth storage granule at the time of the rollback backup is "1", and from the backup status information table corresponding to the third (rollback backup version identifier) ​​backup, it can be seen that the backup version identifier of the fourth storage granule at the time of the rollback backup is also "1". After comparison, although the identifiers of the two backup versions are the same, the data of the fourth storage granule has actually changed, which belongs to the second case mentioned above.

[0118] Since the production-end device takes a snapshot of the target production volume when receiving the rollback instruction, when it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, it can be combined with the snapshot identifier to further analyze and determine whether the data in the target storage granule at the first snapshot moment has changed relative to the rollback backup moment, and then determine whether to perform a data recovery operation on the target storage granule. Accordingly, step c may include the following specific processing steps:

[0119] Step c1: according to the identifier of the rollback backup version, obtain the identifier of the second snapshot corresponding to the identifier of the rollback backup version.

[0120] Step c2: determining first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot.

[0121] Step c2 may include the following specific processing steps:

[0122] First, according to the identifier of the first snapshot, a first correspondence table between the identifier and the physical location information of the storage particle at the snapshot time corresponding to the first snapshot is obtained.

[0123] Second, according to the identifier of the target storage particle, first physical location information corresponding to the identifier of the target storage particle is determined in the first correspondence table.

[0124] Step c3: determining the second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot.

[0125] Step c3 may include the following specific processing steps:

[0126] First, according to the identifier of the second snapshot, a second correspondence table storing the identifiers and physical location information of particles at the snapshot time corresponding to the second snapshot is obtained.

[0127] Second, according to the identifier of the target storage particle, second physical location information corresponding to the identifier of the target storage particle is determined in the second correspondence table.

[0128] Step c4: determining whether to perform a data recovery operation on the target storage particle according to the first physical location information and the second physical location information.

[0129] Step c4 may include the following specific processing steps:

[0130] First, determine whether the first physical location information and the second physical location information are the same.

[0131] Second, when it is determined that the first physical location information and the second physical location information are different, it is determined to perform a data recovery operation on the target storage particle.

[0132] Third, when it is determined that the first physical location information and the second physical location information are the same, it is determined not to perform a data recovery operation on the target storage particle.

[0133] Specifically, at each backup, the production-end device will perform the following operations: upon obtaining the backup instruction, perform the backup operation on the target production volume, and take a snapshot of the target production volume, generating a snapshot, an identifier of the snapshot, and an identifier of the backup version. The snapshot, the identification information of the snapshot, and the identifier of the backup version are recorded in correspondence. Accordingly, at the time of rolling back the backup, upon obtaining the backup instruction, the production end will perform the backup operation on the target production volume, and take a snapshot of the target production volume, and will generate a second snapshot, an identifier of the second snapshot, and an identifier of the third backup version. The identifier of the third backup version is the identifier of the rollback backup version, and the second snapshot, the identification information of the second snapshot, and the identifier of the third backup version are stored in correspondence.

[0134] In addition, the above storage granules are the divisions of the target production volume in terms of logical addresses. In fact, although the data of some storage granules are modified after each snapshot, the old data corresponding to the snapshot time is still stored in the target production volume. In addition, the target production volume will record the physical location information of the data corresponding to each storage granule at different snapshot times.

[0135] Therefore, the production-end device can first obtain the identifier of the second snapshot corresponding to the identifier of the rollback backup version according to the identifier of the rollback backup version. Then, the actual physical location (second physical location information) of the data in each storage particle in the target production volume at the time of the second snapshot can be determined according to the identifier of the second snapshot, and the actual physical location (first physical location information) of the data in each storage particle in the target production volume at the time of the first snapshot can be determined according to the identifier of the first snapshot. Finally, for the target storage particle, it can be determined whether the actual physical location of the data of the target storage particle at the first snapshot moment is the same as the actual physical location of the data at the second snapshot moment. If yes, it can be considered that the data of the target storage particle at the first snapshot moment and the second snapshot moment are consistent and have not changed, that is, after the rollback backup moment, the data in the target storage particle has indeed not changed, and the data recovery operation can be omitted. If no, it can be considered that the data of the target storage particle at the first snapshot moment and the second snapshot moment are inconsistent, that is, after the rollback backup moment, the data in the target storage particle has indeed changed, and the data recovery operation needs to be performed.

[0136] In some optional implementations, step c may also be as follows:

[0137] When it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the target storage granule and the identifier of the first snapshot may be:

[0138] According to the identification of the target storage granule, the gen_id corresponding to at least one write IO corresponding to the target storage granule is obtained, and it is determined whether there is a target write IO whose gen_id is equal to the identification of the first snapshot. If yes, it can be considered that the data in the target storage granule has changed, and it can be determined to perform a data recovery operation on the target storage granule. If no, it can be considered that the data of the target storage granule at the current moment is the same as the data at the time of the rollback backup, and no data recovery operation is required.

[0139] Step 4: when it is determined to perform a data recovery operation on the target storage granule, the target data of the target storage granule under the rollback backup version is obtained from the backup end device according to the identifier of the target storage granule and the identifier of the rollback backup version.

[0140] Specifically, the production-end device can send the identifier of the target storage granule and the identifier of the rollback backup version to the backup-end device, and the backup-end device can obtain the incremental backup data corresponding to the rollback backup version according to the identifier of the rollback backup version, and the incremental backup data includes the data corresponding to the identifier of the changed storage granule. Then, the backup-end device can select the target data corresponding to the target storage granule at the rollback backup time in the incremental backup data according to the identifier of the target storage granule, and send the target data to the production-end device.

[0141] In some optional implementations, after determining all storage particles that require data recovery, the production-end device may obtain the data of these storage particles under the rollback backup version from the backup-end device to reduce the number of communications.

[0142] In some optional implementations, when determining to perform a data recovery operation on a target storage particle, the production end device can directly read the target data from the physical location corresponding to the first physical location information according to the first physical location information, and perform a data recovery operation on the target storage particle according to the target data. In this way, there is no need to obtain the corresponding data from the backup end device, and the data can be directly copied locally, which can save communication resources and improve data recovery efficiency.

[0143] Step 5: restore the data in the target storage particle to the target data.

[0144] Specifically, after receiving the target data, the production end device can restore the data in the target storage granule to the target data. After processing each storage granule according to the processing flow of steps 1 to 5, the data in the target production volume can be restored to the state corresponding to the rollback backup version.

[0145] The processing flow of steps 1 to 5 above can be as follows: Figure 4 shown.

[0146] In some optional implementations, in the event of a data recovery operation failure (or, based on user requirements), the data in the target production volume is restored to a state before the rollback instruction is received based on the first snapshot.

[0147] The data recovery method provided in this embodiment is that before performing the rollback operation, the production end device (production end device) first takes a snapshot of the target production volume to generate a first snapshot and an identifier of the first snapshot. Then, the production end device can obtain the first backup status information table according to the identifier of the rollback backup version included in the rollback instruction. In addition, the production end device determines the identifier of the target backup version and obtains the corresponding second backup status information table. Different from the related art, this solution does not need to obtain the snapshot corresponding to the target backup version according to the identifier of the target backup version, and first rolls back the target production volume to the state corresponding to the target backup version. Instead, after directly performing an analysis operation according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot, the data stored in the target production volume is directly restored to the state corresponding to the rollback backup version. In this way, this solution only needs to perform one rollback operation, which can improve data recovery efficiency.

[0148] In addition, this solution uses CDP snapshots. First, there is no need to create snapshot volumes, which can save volume specifications. Second, when performing data recovery operations, there is no need to copy old data to the snapshot volume first, but to directly write data, which can speed up the rollback speed, that is, improve data recovery efficiency. Third, in the event of data recovery failure, it can also be restored to the state before the rollback operation based on the snapshot taken when the rollback instruction is received.

[0149] In this embodiment, another data recovery method is provided, which can be executed by the above-mentioned production end device. Figure 5 is a flow chart of a data recovery method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0150] Step S501: when a rollback instruction for a target production volume in a production-end device is received, a snapshot operation is performed on the target production volume to generate a first snapshot and an identifier of the first snapshot.

[0151] The target production volume is divided into at least one storage granule, and the rollback instruction includes an identifier of the rollback backup version.

[0152] Step S502: Obtain an identifier of a target backup version of the latest cloud backup operation on the target production volume before receiving the rollback instruction.

[0153] The specific processing from step S501 to step S502 can refer to the specific processing from step S201 to step S202, which will not be repeated here.

[0154] Step S503: determine whether the identifier of the rollback backup version is consistent with the identifier of the target backup version.

[0155] Step S504: when it is determined that the identifier of the rolled-back backup version is inconsistent with the identifier of the target backup version, a first backup status information table matching the identifier of the rolled-back backup version is obtained according to the identifier of the rolled-back backup version.

[0156] Step S505: According to each storage granule and the identifier of the target backup version, a second backup status information table matching the identifier of the target backup version is obtained.

[0157] Step S506: restore the data stored in the target production volume to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot.

[0158] The specific processing of steps S504 to S506 can refer to the specific processing of steps S203 to S205, which will not be repeated here.

[0159] Step S507: When it is determined that the identifier of the rollback backup version is consistent with the identifier of the target backup version, each storage granule is directly traversed.

[0160] Specifically, the consistency between the identifier of the rolled-back backup version and the identifier of the target backup version indicates that the first backup status information table and the second backup status information table are completely consistent. There is no need to compare the identifier of the backup version of each storage granule at the time of the rollback backup with the identifier of the backup version at the time of the target backup. It is possible to directly determine whether the data in the target storage granule has undergone changes that are not recorded by the backup end after the time of the rollback backup.

[0161] Step S508: Every time a storage granule is traversed, it is determined whether to perform a data recovery operation on the target storage granule according to the identifier of the traversed target storage granule, the identifier of the rollback backup version, and the identifier of the first snapshot.

[0162] The specific processing of step S508 can refer to the specific processing of step c in step S205, which will not be repeated here.

[0163] Step S509 , when it is determined to perform a data recovery operation on the target storage granule, the target data of the target storage granule under the rollback backup version is obtained from the backup end device according to the identifier of the target storage granule and the identifier of the rollback backup version.

[0164] Step S510: restore the data stored in the target storage particle to target data.

[0165] The specific processing of step S509 to step S510 can refer to the specific processing of step 4 to step 5 in step S203, which will not be repeated here.

[0166] In the data recovery method provided by this embodiment, the consistency between the identifier of the rollback backup version and the identifier of the target backup version indicates that the first backup status information table and the second backup status information table are completely consistent. Therefore, in this case, the comparison between the first backup status information table and the second backup status information table may not be performed, which can save resources and improve data recovery efficiency.

[0167] In this embodiment, a data recovery device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0168] This embodiment provides a data recovery device, such as Figure 6 As shown, including:

[0169] The receiving module 601 is used for, when receiving a rollback instruction for a target production volume in a production end device, taking a snapshot of the target production volume, generating a first snapshot and an identifier of the first snapshot, wherein the target production volume is divided into at least one storage granularity, and the rollback instruction includes an identifier of the rollback backup version;

[0170] The acquisition module 602 is used to obtain the identifier of the target backup version of the latest cloud backup operation on the target production volume before the rollback instruction is received; according to the identifier of the rollback backup version, obtain a first backup status information table that matches the identifier of the rollback backup version; according to each storage particle and the identifier of the target backup version, obtain a second backup status information table that matches the identifier of the target backup version;

[0171] The recovery module 603 is used to restore the data stored in the target production volume to a state corresponding to the rollback backup version according to the first backup status information table, the second backup status information table, the identifier of the rollback backup version and the identifier of the first snapshot.

[0172] In an optional implementation, the first backup status information table includes an identifier of each storage granule and an identifier of a backup version corresponding to the identifier of each storage granule at the time of rollback backup, and the second backup status information table includes an identifier of each storage granule and an identifier of a backup version corresponding to the identifier of each storage granule at the target backup time;

[0173] The recovery module 603 is specifically used for:

[0174] Traverse each storage particle;

[0175] Each time a storage granule is traversed, according to the identifier of the traversed target storage granule, the identifier of the first backup version corresponding to the identifier of the target storage granule is extracted from the first backup status information table, and the identifier of the second backup version corresponding to the identifier of the target storage granule is extracted from the second backup status information table;

[0176] Determine whether to perform a data recovery operation on the target storage granule according to the identifier of the first backup version, the identifier of the second backup version, the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot;

[0177] When it is determined to perform a data recovery operation on the target storage granule, the target data of the target storage granule under the rollback backup version is obtained from the backup end device according to the identifier of the target storage granule and the identifier of the rollback backup version;

[0178] Restore the data in the target storage granule to the target data.

[0179] In an optional implementation, the recovery module 603 is specifically configured to:

[0180] Determine whether the identifier of the first backup version is consistent with the identifier of the second backup version;

[0181] When it is determined that the identifier of the first backup version is inconsistent with the identifier of the second backup version, determining a target storage granule to perform a data recovery operation;

[0182] or,

[0183] When it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, it is determined whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule and the identifier of the first snapshot.

[0184] In an optional implementation, the recovery module 603 is specifically configured to:

[0185] According to the identifier of the rollback backup version, obtaining the identifier of the second snapshot corresponding to the identifier of the rollback backup version;

[0186] Determine first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot;

[0187] Determine second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot;

[0188] It is determined whether to perform a data recovery operation on a target storage particle according to the first physical location information and the second physical location information.

[0189] In an optional implementation, the recovery module 603 is specifically configured to:

[0190] determining whether the first physical location information and the second physical location information are the same;

[0191] When it is determined that the first physical location information and the second physical location information are different, determining to perform a data recovery operation on the target storage particle;

[0192] or,

[0193] When it is determined that the first physical location information and the second physical location information are the same, it is determined not to perform a data recovery operation on the target storage particle.

[0194] In an optional implementation, the acquisition module 602 is further configured to:

[0195] Determine whether the identifier of the rollback backup version is consistent with the identifier of the target backup version;

[0196] When it is determined that the identifier of the rolled-back backup version is inconsistent with the identifier of the target backup version, a first backup state information table matching the identifier of the rolled-back backup version is obtained according to the identifier of the rolled-back backup version.

[0197] In an optional implementation, when it is determined that the identifier of the rollback backup version is consistent with the identifier of the target backup version, the recovery module 603 is further configured to:

[0198] Directly traverse each storage particle;

[0199] Each time a storage granule is traversed, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the traversed target storage granule, the identifier of the rollback backup version, and the identifier of the first snapshot;

[0200] When it is determined to perform a data recovery operation on the target storage granule, the target data of the target storage granule under the rollback backup version is obtained from the backup end device according to the identifier of the target storage granule and the identifier of the rollback backup version;

[0201] Restore the data in the target storage granule to the target data.

[0202] In an optional implementation, the recovery module 603 is further configured to:

[0203] In the event that the data recovery operation fails, the data in the target production volume is restored to a state before the rollback instruction is received according to the first snapshot.

[0204] In an optional implementation, the device further includes a backup module 604, which is used to:

[0205] When the backup instruction is obtained, a backup operation is performed on the target production volume, and a snapshot operation is performed on the target production volume to generate a second snapshot, an identifier of the second snapshot, and an identifier of a third backup version, where the identifier of the third backup version is the identifier of the rollback backup version;

[0206] The second snapshot, the identification information of the second snapshot, and the identification of the third backup version are stored correspondingly.

[0207] In an optional implementation, the recovery module 603 is specifically configured to:

[0208] According to the identifier of the first snapshot, a first correspondence table between the identifier and the physical location information of the storage particle at the snapshot time corresponding to the first snapshot is obtained;

[0209] According to the identifier of the target storage particle, first physical location information corresponding to the identifier of the target storage particle is determined in the first correspondence table.

[0210] In an optional implementation, the recovery module 603 is specifically configured to:

[0211] According to the identifier of the second snapshot, a second correspondence table storing identifiers and physical location information of particles at the snapshot time corresponding to the second snapshot is obtained;

[0212] According to the identifier of the target storage particle, second physical location information corresponding to the identifier of the target storage particle is determined in the second correspondence table.

[0213] In an optional implementation, the snapshot is a continuous protection CDP snapshot.

[0214] 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.

[0215] The data recovery 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.

[0216] The embodiment of the present invention also provides a computer device having the above Figure 6 The data recovery device shown.

[0217] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, 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 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. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0218] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.

[0219] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0220] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to 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 arranged 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.

[0221] 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.

[0222] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0223] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, 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 hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. 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.

[0224] A part 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 existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and 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 accessible to the computer.

[0225] Although the embodiments of the present invention have been described in conjunction with 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 are all within the scope defined by the appended claims.

Claims

1. A data recovery method, It is characterized in that The method is applied to a backup system, the backup system includes a production end device and a backup end device, the method is performed by the production end device, and the method includes: When receiving a rollback instruction for a target production volume in the production-end device, taking a snapshot of the target production volume to generate a first snapshot and an identifier of the first snapshot, wherein the target production volume is divided into at least one storage granularity, and the rollback instruction includes an identifier of the rollback backup version; Obtaining an identifier of a target backup version of a latest cloud backup operation on the target production volume before receiving the rollback instruction; According to the identifier of the rollback backup version, a first backup status information table matching the identifier of the rollback backup version is obtained, wherein the first backup status information table includes the identifier of each storage particle and the identifier of the backup version corresponding to the identifier of each storage particle at the rollback backup moment; According to the identifier of each storage granule and the identifier of the target backup version, a second backup status information table matching the identifier of the target backup version is acquired, wherein the second backup status information table includes the identifier of each storage granule and the identifier of the backup version corresponding to the identifier of each storage granule at the target backup time; Traversing each of the storage particles; Each time a storage granule is traversed, according to the identifier of the traversed target storage granule, the identifier of the first backup version corresponding to the identifier of the target storage granule is extracted from the first backup status information table, and the identifier of the second backup version corresponding to the identifier of the target storage granule is extracted from the second backup status information table; When it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot; When it is determined to perform a data recovery operation on the target storage granule, according to the identifier of the target storage granule and the identifier of the rollback backup version, the target data of the target storage granule under the rollback backup version is acquired from the backup end device; The data in the target storage particle is restored to the target data.

2. The method according to claim 1, It is characterized in that The method further comprises: When it is determined that the identifier of the first backup version is inconsistent with the identifier of the second backup version, it is determined to perform a data recovery operation on the target storage granule.

3. The method according to claim 2, It is characterized in that When it is determined that the identifier of the first backup version is consistent with the identifier of the second backup version, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the rollback backup version, the identifier of the target storage granule, and the identifier of the first snapshot includes: According to the identifier of the rolled-back backup version, acquiring an identifier of a second snapshot corresponding to the identifier of the rolled-back backup version; Determining first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot; determining second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot; It is determined whether to perform a data recovery operation on the target storage particle according to the first physical location information and the second physical location information.

4. The method according to claim 3, It is characterized in that The determining, according to the first physical location information and the second physical location information, whether to perform a data recovery operation on the target storage particle includes: determining whether the first physical location information and the second physical location information are the same; When it is determined that the first physical location information and the second physical location information are different, determining to perform a data recovery operation on the target storage particle; When it is determined that the first physical location information and the second physical location information are the same, it is determined not to perform a data recovery operation on the target storage particle.

5. The method according to claim 1, It is characterized in that After obtaining the identifier of the target backup version of the latest cloud backup operation on the target production volume before receiving the rollback instruction, the method further includes: Determine whether the identifier of the rollback backup version is consistent with the identifier of the target backup version; When it is determined that the identifier of the rolled-back backup version is inconsistent with the identifier of the target backup version, a first backup status information table matching the identifier of the rolled-back backup version is obtained according to the identifier of the rolled-back backup version.

6. The method according to claim 5, It is characterized in that When it is determined that the identifier of the rollback backup version is consistent with the identifier of the target backup version, the method further includes: Directly traverse each of the storage particles; Each time a storage granule is traversed, determining whether to perform a data recovery operation on the target storage granule according to the identifier of the traversed target storage granule, the identifier of the rollback backup version, and the identifier of the first snapshot; When it is determined to perform a data recovery operation on the target storage granule, according to the identifier of the target storage granule and the identifier of the rollback backup version, the target data of the target storage granule under the rollback backup version is acquired from the backup end device; The data in the target storage particle is restored to the target data.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: In the event that the data recovery operation fails, the data in the target production volume is restored to a state before the rollback instruction is received according to the first snapshot.

8. The method according to claim 3 or 4, It is characterized in that Before acquiring the identifier of the second snapshot corresponding to the identifier of the rolled-back backup version according to the identifier of the rolled-back backup version, the method further includes: When the backup instruction is obtained, a backup operation is performed on the target production volume, and a snapshot operation is performed on the target production volume to generate a second snapshot, an identifier of the second snapshot, and an identifier of a third backup version, wherein the identifier of the third backup version is the identifier of the rollback backup version; The second snapshot, the identification information of the second snapshot, and the identification of the third backup version are stored correspondingly.

9. The method according to claim 3 or 4, It is characterized in that The determining the first physical location information according to the identifier of the target storage granule and the identifier of the first snapshot includes: According to the identifier of the first snapshot, a first correspondence table storing identifiers and physical location information of particles at a snapshot time corresponding to the first snapshot is acquired; According to the identifier of the target storage particle, the first physical location information corresponding to the identifier of the target storage particle is determined in the first correspondence table.

10. The method according to claim 3 or 4, It is characterized in that The determining the second physical location information according to the identifier of the target storage granule and the identifier of the second snapshot includes: According to the identifier of the second snapshot, obtaining a second correspondence table storing identifiers and physical location information of particles at the snapshot moment corresponding to the second snapshot; According to the identifier of the target storage particle, the second physical location information corresponding to the identifier of the target storage particle is determined in the second correspondence table.

11. The method according to any one of claims 1 to 6, It is characterized in that The snapshot is a continuous protection CDP snapshot.

12. A computer device, It is 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 data recovery method according to any one of claims 1 to 11 by executing the computer instructions.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data recovery method according to any one of claims 1 to 11.

14. A computer program product, It is characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the data recovery method according to any one of claims 1 to 11.