Snapshot recovery method, device, computer equipment and storage medium

By obtaining the bitmap information between the target snapshot and the current snapshot, determining the amount of data change, and restoring only the changed data, the problem of quickly completing disk snapshot data recovery while ensuring the safety and integrity of the original data is solved, achieving efficient data recovery.

CN114020527BActive Publication Date: 2025-10-03JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111262390.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2025-10-03
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

How to quickly restore disk snapshot data while ensuring the security and integrity of the original data.

Method used

By obtaining the bitmap information between the target snapshot and the current snapshot, the data changes are determined and only the changed data is restored, avoiding a full copy.

Benefits of technology

It shortens data copy time, improves recovery efficiency, ensures data integrity and security, and reduces data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020527B_ABST
    Figure CN114020527B_ABST
Patent Text Reader

Abstract

The present invention discloses a snapshot recovery method, apparatus, computer equipment, and storage medium applicable to the field of computer technology. The method comprises: obtaining target bitmap information of a target snapshot to be recovered; wherein the target bitmap information is used to record data changes between the target snapshot and the previous snapshot; obtaining current bitmap information and current data corresponding to the current moment; determining the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the current bitmap information and the target bitmap information; and restoring the target snapshot based on the amount of change and the current data. Using this method, only the changed data needs to be copied, thereby shortening the data copying time, improving the efficiency of target snapshot recovery, ensuring data integrity, and reducing the occurrence of data loss. The method solves the problem of quickly completing the recovery of disk snapshot data while ensuring the safety and integrity of the original data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] A disk snapshot is a fast file system backup of an entire disk volume. Its primary difference from other backup methods is speed. No file copying is involved when taking a disk snapshot. Even for large amounts of data, the backup can generally be completed within one second. Testing with snapshot data does not damage production data. Snapshots are also ideal test data sources for data mining and eDiscovery applications. Snapshots are a highly effective method for disaster recovery, ideally suited for recovering data from logical errors such as malware attacks, human error, and data corruption.

[0003] However, when restoring disk snapshot data, all data in the restored snapshot must be copied to a new disk file and rolled back for consistency. The larger the data in the snapshot, the longer the copying time, which increases the probability of problems. This may result in loss or incompleteness of the original data after restoration.

[0004] So how to quickly restore disk snapshot data while ensuring the security and integrity of the original data has become an urgent problem to be solved. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a snapshot recovery method, apparatus, computer device, and storage medium to solve the problem of quickly completing the recovery of disk snapshot data while ensuring the security and integrity of the original data.

[0006] According to a first aspect, an embodiment of the present invention provides a snapshot recovery method, the method comprising: obtaining target bitmap information of a target snapshot to be recovered; wherein the target bitmap information is used to record data changes between the target snapshot and the previous snapshot; obtaining current bitmap information and current data corresponding to the current moment; determining, based on the current bitmap information and the target bitmap information, an amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot; and restoring the target snapshot based on the amount of change and the current data.

[0007] In an embodiment of the present application, the difference between the data corresponding to the current moment and the data corresponding to the target snapshot is determined based on the current bitmap information and the target bitmap information. Based on this difference and the current data, the target snapshot is restored. This eliminates the need to copy all the data corresponding to the target snapshot; only the changed data needs to be copied. This reduces the time required to copy data, improves the efficiency of target snapshot restoration, ensures data integrity, and reduces the risk of data loss. This approach allows for rapid recovery of disk snapshot data while ensuring the security and integrity of the original data.

[0008] In combination with the first aspect, in the first embodiment of the first aspect, the change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined based on the current bitmap information and the target bitmap information, including: judging whether the snapshot data has been restored; and determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the judgment result, the current bitmap information and the target bitmap information.

[0009] In an embodiment of the present application, a determination is made as to whether snapshot data has been restored, and based on the determination result, the current bitmap information, and the target bitmap information, the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined. This allows accurate determination of which bitmap information is required to resolve the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot, and then, based on the current bitmap information, the target bitmap information, and other required bitmap information, the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined, thereby ensuring the accuracy of the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot determined based on the current bitmap information, the target bitmap information, and other required bitmap information.

[0010] In combination with the first embodiment of the first aspect, in the second embodiment of the first aspect, if the judgment result is that the snapshot data has not been restored, then the change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined based on the judgment result, the current bitmap information and the target bitmap information, including: obtaining the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; performing an OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0011] In an embodiment of the present application, target bitmap information and each bitmap information between the current bitmap information and the target bitmap information are obtained. The current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures the accuracy of the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot, thereby improving the accuracy of target snapshot recovery.

[0012] In combination with the first embodiment of the first aspect, in the third embodiment of the first aspect, if the judgment result is that the snapshot data has been restored, the change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined based on the judgment result, the current bitmap information and the target bitmap information, including: judging whether the restored snapshot is before the target snapshot; if the restored snapshot is before the target snapshot, obtaining the recovery bitmap information corresponding to the restored snapshot; performing an OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0013] In this embodiment of the present application, it is determined whether the restored snapshot is before the target snapshot. If so, the restored bitmap information corresponding to the restored snapshot is obtained. The current bitmap information, the target bitmap information, and the restored bitmap information are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures that the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot is correct.

[0014] In combination with the third embodiment of the first aspect, in the fourth embodiment of the first aspect, the method also includes: if the restored snapshot is after the target snapshot, obtaining the bitmap information and recovery bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot; performing an OR operation on the current bitmap information, the recovery bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0015] In this embodiment of the present application, if the restored snapshot is after the target snapshot, the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot, as well as the restored bitmap information, is obtained. The current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures the accuracy of the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0016] In combination with the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, the target snapshot is restored based on the change amount and the current data, including: creating a snapshot recovery process; determining the changed data based on the change amount and the current data; and exporting the changed data based on the snapshot recovery process.

[0017] In the embodiment of the present application, a snapshot recovery process is created; based on the amount of change and the current data, the changed data is determined; and based on the snapshot recovery process, the changed data is exported. This allows recovery of the target snapshot without having to copy all the data corresponding to the target snapshot, only the changed data. This shortens the data copy time, improves the efficiency of target snapshot recovery, ensures data integrity, and reduces the risk of data loss.

[0018] In combination with the first aspect, in the sixth embodiment of the first aspect, obtaining the current bitmap information corresponding to the current moment includes: obtaining the current data; comparing the current data with the data corresponding to a snapshot before the current moment; determining the amount of change between the current data and the data corresponding to a snapshot before the current moment based on the comparison result; and generating the current bitmap information based on the amount of change between the current data and the data corresponding to a snapshot before the current moment.

[0019] In the embodiment of the present application, current data is obtained; the current data is compared with data corresponding to a snapshot before the current moment; based on the comparison result, the amount of change between the current data and the data corresponding to the snapshot before the current moment is determined; and current bitmap information is generated based on the amount of change between the current data and the data corresponding to the snapshot before the current moment. This ensures that the generated current bitmap information is accurate.

[0020] According to a second aspect, an embodiment of the present invention provides a snapshot recovery device, the device comprising:

[0021] A first acquisition module is configured to acquire target bitmap information of a target snapshot to be restored; wherein the target bitmap information is used to record data changes between the target snapshot and the previous snapshot;

[0022] The second acquisition module is used to obtain the current bitmap information and current data corresponding to the current moment;

[0023] A determination module, configured to determine a change between data corresponding to a current moment and data corresponding to a target snapshot based on current bitmap information and target bitmap information;

[0024] The recovery module is used to restore the target snapshot based on the change amount and current data.

[0025] In conjunction with the second aspect, in a first implementation of the second aspect, the determining module includes:

[0026] A judgment unit, used to judge whether the snapshot data has been restored;

[0027] The first determining unit is configured to determine a change between data corresponding to a current moment and data corresponding to a target snapshot according to a judgment result, current bitmap information, and target bitmap information.

[0028] In combination with the first embodiment of the second aspect, in the second embodiment of the second aspect, if the judgment result is that the snapshot data has not been restored, the above-mentioned first determination unit is specifically used to obtain the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; perform an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0029] In combination with the first embodiment of the second aspect, in the third embodiment of the second aspect, if the judgment result is that the snapshot data has been restored, the above-mentioned first determination unit is specifically used to determine whether the restored snapshot is before the target snapshot; if the restored snapshot is before the target snapshot, the recovery bitmap information corresponding to the restored snapshot is obtained; the current bitmap information, the target bitmap information and the recovery bitmap information are ORed to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0030] In combination with the third embodiment of the second aspect, in the fourth implementation manner of the second aspect, the above-mentioned first determination unit is also used to obtain the bitmap information and recovery bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot if the restored snapshot is after the target snapshot; perform an OR operation on the current bitmap information, the recovery bitmap information, the target bitmap information and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0031] In conjunction with the second aspect, in a fifth implementation of the second aspect, the recovery module includes:

[0032] Create a unit for creating a snapshot recovery process;

[0033] A second determining unit is used to determine the changed data based on the change amount and the current data;

[0034] The recovery unit is used to restore the process based on the snapshot and export the changed data.

[0035] In combination with the second aspect, in a sixth implementation of the second aspect, the second acquisition module includes:

[0036] Acquisition unit, used to obtain current data;

[0037] A comparison unit, used to compare current data with data corresponding to a snapshot between the current moment;

[0038] a third determining unit, configured to determine, based on the comparison result, a change between the current data and the data corresponding to a snapshot between the current time and the current time;

[0039] The generating unit is configured to generate current bitmap information based on a change between current data and data corresponding to a snapshot between the current moment and the current moment.

[0040] According to a third aspect, an embodiment of 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 snapshot recovery method according to the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

[0041] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the snapshot recovery method in the first aspect or any one of the implementations of the first aspect.

[0042] According to the fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the snapshot recovery method in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:

[0044] Figure 1 A flowchart showing the steps of a snapshot recovery method in one embodiment is shown;

[0045] Figure 2 A schematic diagram showing virtual machine information in a snapshot recovery method according to another embodiment is shown;

[0046] Figure 3 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0047] Figure 4 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0048] Figure 5 A schematic diagram of a first target snapshot in a snapshot recovery method in another embodiment is shown;

[0049] Figure 6 A schematic diagram of an OR operation in a snapshot recovery method according to another embodiment is shown;

[0050] Figure 7 A schematic diagram of an OR operation in a snapshot recovery method according to another embodiment is shown;

[0051] Figure 8 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0052] Figure 9 A schematic diagram showing a target snapshot after a restored snapshot in a snapshot restoration method according to another embodiment is shown;

[0053] Figure 10 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0054] Figure 11 A schematic diagram showing a target snapshot before a restored snapshot in a snapshot restoration method according to another embodiment is shown;

[0055] Figure 12 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0056] Figure 13 A schematic diagram of the recovery process in a snapshot recovery method according to another embodiment is shown;

[0057] Figure 14 A schematic diagram of the recovery process in a snapshot recovery method according to another embodiment is shown;

[0058] Figure 15 A schematic diagram of the recovery process in a snapshot recovery method according to another embodiment is shown;

[0059] Figure 16 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0060] Figure 17 A flowchart showing the steps of a snapshot recovery method in another embodiment is shown;

[0061] Figure 18 shows a structural block diagram of a snapshot recovery device in another embodiment;

[0062] Figure 19 The figure shows the internal structure of a computer device as a server according to an embodiment;

[0063] Figure 20The figure shows the internal structure of a computer device in an embodiment when it is a terminal. DETAILED DESCRIPTION

[0064] 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0065] It should be noted that the execution subject of the snapshot recovery method provided in the embodiments of the present application can be a snapshot recovery device, which can be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware. The computer device can be a server or a terminal. The server in the embodiments of the present application can be a single server or a server cluster composed of multiple servers. The terminal in the embodiments of the present application can be a smart phone, personal computer, tablet computer, wearable device, intelligent robot or other intelligent hardware device. In the following method embodiments, the execution subject is a computer device as an example for description.

[0066] In one embodiment of the present application, a snapshot recovery method is provided, such as Figure 1 As shown, the method is described by taking the application of the method to a computer device as an example, and includes the following steps:

[0067] 101. Obtain target bitmap information of the target snapshot to be restored.

[0068] The target bitmap information is used to record the data changes between the target snapshot and the previous snapshot. The target snapshot can be snapshot information corresponding to a disk, a hard disk, or other storage devices.

[0069] In an optional embodiment, the computer device may receive identification information of the target snapshot to be restored input by the user, and then find the position of the corresponding target snapshot in the snapshot chain based on the identification information, and derive target bitmap information corresponding to the target snapshot.

[0070] In another optional embodiment, the computer device can also receive identification information of the target snapshot to be restored sent by other devices, and then find the position of the corresponding target snapshot in the snapshot chain based on the identification information, and export the target bitmap information corresponding to the target snapshot in the virtual machine disk.

[0071] For example, see Figure 2Taking virtual machine disk snapshots as an example, it shows the bitmap information corresponding to each snapshot in the snapshot chain of the virtual machine disk. Among them, disk1 can represent snapshot 1, disk2 can represent snapshot 2, and disk3 can represent snapshot 3.

[0072] In another optional implementation, the computer device may also receive target bitmap information of the target snapshot to be restored sent by a user or other device.

[0073] 102. Obtain current bitmap information and current data corresponding to the current moment.

[0074] Specifically, the computer device can read the data in the storage device to obtain the current data in the storage device. Then, the computer device obtains the current bitmap information corresponding to the current moment through the current data.

[0075] 103 : Determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information.

[0076] Specifically, the computer device can compare the current bitmap information with the target bitmap information. The computer device can obtain the matrix corresponding to the current bitmap information and the matrix corresponding to the target bitmap information, and compare the data in the matrix corresponding to the current bitmap information with the matrix corresponding to the target bitmap information. If the values ​​at the same position in the matrix are the same, it means that the data corresponding to that position has not changed; if the values ​​at the same position in the matrix are different, it means that the data corresponding to that position has changed. Based on the comparison results between the current bitmap information and the target bitmap information, the computer device determines the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0077] 104. Restore the target snapshot based on the change amount and current data.

[0078] In an optional implementation, the computer device determines the changed data based on the change amount and the current data, and then copies the changed data in the data corresponding to the target snapshot to the location corresponding to the current data based on the location of the data, thereby restoring the target snapshot.

[0079] In another optional implementation, the computer device determines how the data corresponding to the target snapshot changes to obtain the current data based on the change amount, and uses the current data to reversely infer the change amount to obtain the data corresponding to the target snapshot data, thereby restoring the target snapshot.

[0080] For example, assuming that the current data is 4 and the change is -1, that is, the data corresponding to the target snapshot is subtracted by 1 to obtain the current data, then the computing device adds 1 to the current data to obtain the target snapshot data, thereby restoring the target snapshot.

[0081] In an embodiment of the present application, the difference between the data corresponding to the current moment and the data corresponding to the target snapshot is determined based on the current bitmap information and the target bitmap information. Based on this difference and the current data, the target snapshot is restored. This eliminates the need to copy all the data corresponding to the target snapshot; only the changed data needs to be copied. This reduces the time required to copy data, improves the efficiency of target snapshot restoration, ensures data integrity, and reduces the risk of data loss. This approach allows for rapid recovery of disk snapshot data while ensuring the security and integrity of the original data.

[0082] In one embodiment of the present application, Figure 3 As shown, the above step 103 of "determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information" may include the following steps:

[0083] 301. Determine whether the snapshot data has been restored.

[0084] 302 : Determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information, and the target bitmap information.

[0085] Specifically, whether snapshot data has been restored affects which bitmap information the computer device uses to determine the difference between the current data and the target snapshot data. Therefore, before determining the difference between the current data and the target snapshot data, the computer device must determine whether the snapshot data has been restored.

[0086] Optionally, the computer device can read the snapshot data in the snapshot chain to determine whether the snapshot data has been restored; the computer device can also add a recovery identifier after restoring the snapshot data, so that the computer device can determine whether the snapshot data has been restored by reading the recovery identifier.

[0087] Based on the judgment result, the computer device determines which bitmap information needs to be used to solve the change between the data corresponding to the current moment and the data corresponding to the target snapshot, and then determines the change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the current bitmap information, target bitmap information and other required bitmap information.

[0088] In an embodiment of the present application, a determination is made as to whether snapshot data has been restored, and based on the determination result, the current bitmap information, and the target bitmap information, the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined. This allows accurate determination of which bitmap information is required to resolve the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot, and then, based on the current bitmap information, the target bitmap information, and other required bitmap information, the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot is determined, thereby ensuring the accuracy of the determination of the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the current bitmap information, the target bitmap information, and other required bitmap information.

[0089] In one embodiment of the present application, if the judgment result is that the snapshot data has not been restored, such as Figure 4 As shown, the above step 302 of “determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information, and the target bitmap information” may include the following:

[0090] 401 , obtaining target bitmap information and each bitmap information between the current bitmap information and the target bitmap information.

[0091] Specifically, since the result indicates that snapshot data has not been restored, it can be seen that snapshot data changes in chronological order. Bitmap information, on the other hand, records the amount of data change between each snapshot and the previous snapshot. Therefore, to determine the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot, the computer device needs to obtain the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information.

[0092] 402 , perform an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine a change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0093] Specifically, the computer device may first obtain the latest bitmap information between the current bitmap information and the target bitmap information. The computer device may first perform an OR operation on the current bitmap information and the latest bitmap information to obtain the candidate bitmap information. The candidate bitmap information represents the amount of change between the current data and the last snapshot data.

[0094] Optionally, the computer device can perform an OR operation on the alternative bitmap information with each bitmap information between the current bitmap information and the target bitmap information in reverse chronological order until the OR operation with the target bitmap information is solved to obtain new bitmap information, which represents the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0095] Optionally, the computer device may also perform an OR operation on the alternative bitmap information, the current bitmap information and the target bitmap information to obtain new bitmap information, where the new bitmap information represents the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0096] For example, see Figure 5 , where snp1 represents snapshot 1, Bitmap1 represents bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents bitmap information 2, ..., snpN+1 represents the latest snapshot, BitmapN+1 represents the latest bitmap information, and Bitmap represents the current bitmap information. Assume that the target snapshot to be restored is the snapshot data corresponding to snapshot 3.

[0097] The computer device first merges the virtual machine's current bitmap Bitmap with the bitmap BitmapN+1 corresponding to the latest snapshot. The merging strategy is an OR operation: BitmapN+1 = Bitmap | BitmapN+1. BitmapN+1 represents the candidate bitmap information after the current bitmap Bitmap and the bitmap BitmapN+1 corresponding to the latest snapshot are merged.

[0098] Then, the computer device finds the target bitmap information corresponding to the target snapshot and each bitmap information between the target bitmap information and the latest bitmap information. Then the computer device compares the candidate bitmap information Bitmap N+1` with the target snapshot. Figure 5 Bitmap3, Bitmap4, ..., BitmapN in the snapshot are ORed to obtain Bitmap3`=Bitmap3|Bitmap4|...|BitmapN+1`, where Bitmap3` is the new bitmap information used to represent the change between the current moment data and the data corresponding to snapshot 3.

[0099] To explain more clearly the above content, the current bitmap Bitmap and the bitmap BitmapN+1 corresponding to the latest snapshot are ORed together, see Figure 6 The operation logic is as follows: if the same position of the previous bitmap Bitmap and the bitmap Bitmap N+1 corresponding to the latest snapshot has 1, then the corresponding position of Bitmap N+1` is 1; if the same position of the previous bitmap Bitmap and the bitmap Bitmap N+1 corresponding to the latest snapshot are both 0, then the corresponding position of Bitmap N+1` is 0. 1 indicates that the data corresponding to the position has changed compared to the data in the previous snapshot, and 0 indicates that the data corresponding to the position has not changed compared to the data in the previous snapshot.

[0100] like Figure 7As shown, the process of performing an OR operation on Bitmap 2 and Bitmap 3 to obtain Bitmap2` can be represented.

[0101] In an embodiment of the present application, target bitmap information and each bitmap information between the current bitmap information and the target bitmap information are obtained. The current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures the accuracy of the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot, thereby improving the accuracy of target snapshot recovery.

[0102] In one embodiment of the present application, if the judgment result is that the snapshot data has been restored, such as Figure 8 As shown, the above step 302 of “determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information, and the target bitmap information” may include the following:

[0103] 801. Determine whether the restored snapshot is before the target snapshot.

[0104] Specifically, since whether the restored snapshot is before the target snapshot is related to which bitmap information the computer device needs to use to solve the change between the data corresponding to the current moment and the data corresponding to the target snapshot, before determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot, the computer device needs to determine whether the restored snapshot is before the target snapshot.

[0105] 802. If the restored snapshot is before the target snapshot, obtain restoration bitmap information corresponding to the restored snapshot.

[0106] Specifically, if the determination result is whether the restored snapshot is before the target snapshot, the computer device may determine the restoration bitmap information corresponding to the restored snapshot by reading the restoration identifier.

[0107] 803 , performing an OR operation on the current bitmap information, the target bitmap information, and the recovery bitmap information to determine a change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0108] Specifically, whether the restored snapshot is before the target snapshot, that is, the second restored snapshot is after the first restored snapshot, the computer device needs to obtain the restoration bitmap information corresponding to the restored snapshot.

[0109] Since the virtual machine has restored the snapshot data, the computer device can perform an OR operation on the bitmap information corresponding to the restored snapshot data and the current bitmap information to obtain transition bitmap information, wherein the transition bitmap information represents the change between the current data and the restored snapshot data.

[0110] Then, the computer device performs an OR operation on the transition bitmap information and the target bitmap information, and the calculated bitmap information represents the amount of change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0111] For example, see Figure 9 , where snp1 represents snapshot 1, Bitmap1 represents bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents bitmap information 2, ..., snpN+1 represents the latest snapshot, BitmapN+1 represents the latest bitmap information, and Bitmap represents the current bitmap information. The first restored snapshot is snapshot 2. Assume that the target snapshot to be restored is the snapshot data corresponding to snapshot 3. That is, the restored snapshot is before the target snapshot.

[0112] The computer device first obtains the bitmap information Bitmap2 corresponding to snapshot 2, and then performs an OR operation on Bitmap2 and Bitmap to obtain Bitmap2`=Bitmap2|Bitmap, where Bitmap2` represents transition bitmap information, representing the change between the current data and the restored snapshot data.

[0113] Then, the computer device merges the bitmap information of Bitmap2' and Bitmap3, Bitmap3'=Bitmap2'|Bitmap3, wherein Bitmap3' represents the difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0114] In this embodiment of the present application, it is determined whether the restored snapshot is before the target snapshot. If so, the restored bitmap information corresponding to the restored snapshot is obtained. The current bitmap information, the target bitmap information, and the restored bitmap information are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures that the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot is correct.

[0115] In one embodiment of the present application, Figure 10 As shown, the above method may further include the following:

[0116] 1001. If the restored snapshot is after the target snapshot, obtain bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and restored bitmap information.

[0117] Specifically, since the restored snapshot is after the target snapshot, the computer device needs to obtain the data change between the restored snapshot and the target snapshot. Therefore, the computer device needs to obtain each bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and the restored bitmap information.

[0118] 1002 , perform an OR operation on the current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0119] Specifically, the computer device can first perform an OR operation on the current bitmap information and the restored bitmap information, and then perform an OR operation on the target bitmap information and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot in turn. The bitmap information finally calculated can represent the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0120] For example, Figure 11 As shown in the figure, snp1 represents snapshot 1, Bitmap1 represents bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents bitmap information 2, ..., snpN+1 represents the latest snapshot, BitmapN+1 represents the latest bitmap information, and Bitmap represents the current bitmap information. The first restored snapshot is snapshot N. Suppose you need to restore the snapshot data corresponding to snapshot 3. The restored snapshot is snapshot N, and the target snapshot is snapshot 3. That is, the restored snapshot comes after the target snapshot.

[0121] The computer device first calculates the OR operation of Bitmap N and Bitmap, and calculates Bitmap N` = Bitmap N | Bitmap. Then, the computer device combines the OR operation of Bitmap 3, Bitmap 4, ..., Bitmap N`, and calculates Bitmap3` = Bitmap 3 | Bitmap4 | ... | Bitmap N`. The resulting Bitmap3` represents the difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0122] In this embodiment of the present application, if the restored snapshot is after the target snapshot, the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot, as well as the restored bitmap information, is obtained. The current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot are ORed together to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot. This ensures the accuracy of the calculated difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0123] In one embodiment of the present application, Figure 12 As shown, the “restoring the target snapshot according to the change amount and the current data” in the above 104 may include the following:

[0124] 1201, creating a snapshot recovery process.

[0125] Specifically, before restoring a target snapshot, the computer device needs to create a snapshot restoration process to complete the snapshot restoration task.

[0126] 1202. Determine the changed data based on the change amount and the current data.

[0127] Specifically, the computer device compares the change between the data corresponding to the current moment and the data corresponding to the target snapshot calculated in the above implementation with the current data to determine the changed data.

[0128] 1203. Based on the snapshot recovery process, export the changed data.

[0129] Specifically, the computer device exports the changed data to the disk file of the virtual machine based on the snapshot recovery process.

[0130] For example, Figure 13 In an embodiment in which, when the result of the determination is that the snapshot data has not been restored, the computer device exports the calculated changed data to a virtual machine disk file based on the snapshot recovery process to achieve the restoration of the target snapshot.

[0131] like Figure 14 In order to determine whether the result is restored snapshot data and whether the restored snapshot is before the target snapshot, the computer device exports the calculated changed data to the virtual machine disk file based on the snapshot recovery process to implement an embodiment of restoring the target snapshot.

[0132] like Figure 15In order to determine whether the result is restored snapshot data and whether the restored snapshot is after the target snapshot, the computer device exports the calculated changed data to the virtual machine disk file based on the snapshot recovery process to implement an embodiment of restoring the target snapshot.

[0133] In the embodiment of the present application, a snapshot recovery process is created; based on the amount of change and the current data, the changed data is determined; and based on the snapshot recovery process, the changed data is exported. This allows recovery of the target snapshot without having to copy all the data corresponding to the target snapshot, only the changed data. This shortens the data copy time, improves the efficiency of target snapshot recovery, ensures data integrity, and reduces the risk of data loss.

[0134] In one embodiment of the present application, Figure 16 As shown, the "obtaining the current bitmap information corresponding to the current moment" in the above 102 may include the following:

[0135] 1601, get current data.

[0136] Specifically, the computer device can read the data in the storage device, thereby obtaining the current data in the virtual machine disk.

[0137] 1602 , compare the current data with the data corresponding to a snapshot before the current moment.

[0138] Specifically, the computer device obtains data corresponding to a snapshot between the current moment and compares the current data with the data corresponding to the snapshot between the current moment.

[0139] 1603. Determine the change between the current data and the data corresponding to a snapshot at the current moment according to the comparison result.

[0140] Specifically, the computer device determines the amount of change between the current data and the data corresponding to the snapshot before the current moment based on a result of comparing the current data with the data corresponding to the snapshot before the current moment.

[0141] 1604 : Generate current bitmap information based on a change between the current data and the data corresponding to a snapshot at the current moment.

[0142] Specifically, the computer device generates current bitmap information based on a change between current data and data corresponding to a snapshot at a current moment.

[0143] In an optional embodiment, the computer device can also record the changes in data in real time. The computer device determines the change amount between the current data and the data corresponding to a snapshot between the current moment based on the changes in the data, and then generates the current bitmap information based on the change amount between the current data and the data corresponding to a snapshot between the current moment.

[0144] In the embodiment of the present application, current data is obtained; the current data is compared with data corresponding to a snapshot before the current moment; based on the comparison result, the amount of change between the current data and the data corresponding to the snapshot before the current moment is determined; and current bitmap information is generated based on the amount of change between the current data and the data corresponding to the snapshot before the current moment. This ensures that the generated current bitmap information is accurate.

[0145] In order to better explain the snapshot recovery method provided in the embodiment of the present application, Figure 17 As shown, the embodiment of the present application provides an overall flow chart of a snapshot recovery method, which may include the following:

[0146] 1701. Obtain target bitmap information of the target snapshot to be restored.

[0147] 1702, get current data.

[0148] 1703. Compare the current data with the data corresponding to a snapshot before the current moment.

[0149] 1704 , determining the amount of change between the current data and the data corresponding to a snapshot between the current time and the current time according to the comparison result.

[0150] 1705 : Generate current bitmap information based on the change between the current data and the data corresponding to a snapshot at the current moment.

[0151] 1706, determining whether the snapshot data has been restored. If the determination result is that the snapshot data has not been restored, executing 1707; if the determination result is that the snapshot data has been restored, executing 1709;

[0152] 1707 , obtain target bitmap information and each bitmap information between the current bitmap information and the target bitmap information.

[0153] 1708 , perform an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine a change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0154] 1709 , determine whether the restored snapshot is before the target snapshot. If so, execute 1710 ; if so, execute 1712 .

[0155] 1710. Obtain restoration bitmap information corresponding to the restored snapshot.

[0156] 1711 , perform an OR operation on the current bitmap information, the target bitmap information, and the recovery bitmap information to determine a change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0157] 1712. Obtain bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and restored bitmap information.

[0158] 1713 , perform an OR operation on the current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the difference between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0159] 1714 , based on the change amount and the current data, determine the changed data.

[0160] 1715, creating a snapshot recovery process.

[0161] 1716, based on the snapshot recovery process, export the changed data.

[0162] It should be understood that although Figure 1 、 3 The steps in the flowcharts 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, and 17 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 3 , 4, 8, 10, 12, 16 and at least part of the steps 17 may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0163] Accordingly, please refer to Figure 18 An embodiment of the present invention provides a snapshot recovery device 1800, comprising:

[0164] The first acquisition module 1810 is configured to acquire target bitmap information of a target snapshot to be restored. The target bitmap information is used to record data changes between the target snapshot and the previous snapshot.

[0165] The second acquisition module 1820 is used to acquire the current bitmap information and current data corresponding to the current moment.

[0166] The determination module 1830 is configured to determine a change between data corresponding to the current moment and data corresponding to the target snapshot based on the current bitmap information and the target bitmap information.

[0167] The recovery module 1840 is configured to recover the target snapshot based on the change amount and the current data.

[0168] In one embodiment of the present application, the determination module 1830 includes:

[0169] The judging unit 1831 is used to judge whether the snapshot data has been restored;

[0170] The first determining unit 1832 is configured to determine a change between data corresponding to the current moment and data corresponding to the target snapshot according to the determination result, the current bitmap information, and the target bitmap information.

[0171] In one embodiment of the present application, if the judgment result is that the snapshot data has not been restored, the above-mentioned first determination unit 1832 is specifically used to obtain the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; perform an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0172] In one embodiment of the present application, if the judgment result is that the snapshot data has been restored, the above-mentioned first determination unit 1832 is specifically used to obtain the recovery bitmap information corresponding to the restored disk snapshot; the current bitmap information, the target bitmap information and the recovery bitmap information are ORed to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0173] In one embodiment of the present application, the recovery module 1840 includes:

[0174] The second determining unit 1841 is configured to determine the changed data based on the change amount and the current data;

[0175] The recovery unit 1842 is configured to recover the target snapshot based on the changed data.

[0176] In one embodiment of the present application, the above-mentioned recovery unit 1842 is specifically used to create a snapshot recovery process; and export the changed data based on the snapshot recovery process.

[0177] In one embodiment of the present application, the second acquisition module 1820 includes:

[0178] The acquisition unit 1821 is used to acquire current data.

[0179] The comparing unit 1822 is configured to compare the current data with the data corresponding to a snapshot before the current moment.

[0180] The third determining unit 1823 is configured to determine, based on the comparison result, a change between the current data and the data corresponding to a snapshot between the current time and the current time.

[0181] The generating unit 1824 is configured to generate current bitmap information based on a change between the current data and data corresponding to a snapshot between the current time and the current time.

[0182] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 19 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a snapshot recovery method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.

[0183] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 20As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store snapshot recovery data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a snapshot recovery method.

[0184] Those skilled in the art will understand that Figure 19 and 20 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0185] In one embodiment of the present application, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: obtaining target bitmap information of a target snapshot to be restored; wherein the target bitmap information is used to record data changes between the target snapshot and a previous snapshot; obtaining current bitmap information and current data corresponding to a current moment; determining, based on the current bitmap information and the target bitmap information, an amount of change between data corresponding to the current moment and data corresponding to the target snapshot; and restoring the target snapshot based on the amount of change and the current data.

[0186] In one embodiment of the present application, when the processor executes the computer program, it also implements the following steps: determining whether the snapshot data has been restored; and determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the judgment result, the current bitmap information, and the target bitmap information.

[0187] In one embodiment of the present application, if the judgment result is that the snapshot data has not been restored, the processor also implements the following steps when executing the computer program: obtaining the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; performing an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0188] In one embodiment of the present application, if the judgment result is that the snapshot data has been restored, the processor further implements the following steps when executing the computer program: determining whether the restored snapshot is before the target snapshot; if the restored snapshot is before the target snapshot, obtaining the restoration bitmap information corresponding to the restored snapshot; performing an OR operation on the current bitmap information, the target bitmap information, and the restoration bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0189] In one embodiment of the present application, when the processor executes the computer program, it further implements the following steps: if the restored snapshot is after the target snapshot, obtaining the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and the restored bitmap information; performing an OR operation on the current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0190] In one embodiment of the present application, when the processor executes the computer program, the following steps are further implemented: creating a snapshot recovery process; determining the changed data based on the change amount and the current data; and exporting the changed data based on the snapshot recovery process.

[0191] In one embodiment of the present application, when the processor executes the computer program, it also implements the following steps: obtaining current data; comparing the current data with data corresponding to a snapshot before the current moment; determining the amount of change between the current data and data corresponding to a snapshot before the current moment based on the comparison result; and generating current bitmap information based on the amount of change between the current data and data corresponding to a snapshot before the current moment.

[0192] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining target bitmap information of a target snapshot to be restored; wherein the target bitmap information is used to record data changes between the target snapshot and a previous snapshot; obtaining current bitmap information and current data corresponding to a current moment; determining, based on the current bitmap information and the target bitmap information, an amount of change between data corresponding to the current moment and data corresponding to the target snapshot; and restoring the target snapshot based on the amount of change and the current data.

[0193] In one embodiment of the present application, when the computer program is executed by the processor, the following steps are also implemented: determining whether the snapshot data has been restored; and determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the judgment result, the current bitmap information, and the target bitmap information.

[0194] In one embodiment of the present application, if the judgment result is that the snapshot data has not been restored, the computer program also implements the following steps when executed by the processor: obtaining the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; performing an OR operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0195] In one embodiment of the present application, if the judgment result is that the snapshot data has been restored, the computer program further implements the following steps when executed by the processor: determine whether the restored snapshot is before the target snapshot; if the restored snapshot is before the target snapshot, obtain the restoration bitmap information corresponding to the restored snapshot; perform an OR operation on the current bitmap information, the target bitmap information and the restoration bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0196] In one embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented: if the restored snapshot is after the target snapshot, obtaining the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and the restored bitmap information; performing an OR operation on the current bitmap information, the restored bitmap information, the target bitmap information, and the bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot.

[0197] In one embodiment of the present application, when the computer program is executed by the processor, the following steps are further implemented: creating a snapshot recovery process; determining the changed data based on the change amount and the current data; and exporting the changed data based on the snapshot recovery process.

[0198] In one embodiment of the present application, when the computer program is executed by the processor, the following steps are also implemented: obtaining current data; comparing the current data with data corresponding to a snapshot before the current moment; determining the amount of change between the current data and data corresponding to a snapshot before the current moment based on the comparison result; and generating current bitmap information based on the amount of change between the current data and data corresponding to a snapshot before the current moment.

[0199] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). The storage medium can also include a combination of the above-mentioned types of memory.

[0200] 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. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A snapshot recovery method, characterized in that: The method comprises: Obtaining target bitmap information of a target snapshot to be restored; wherein the target bitmap information is used to record data changes between the target snapshot and the previous snapshot; Get the current bitmap information and current data corresponding to the current moment; Determining a change between data corresponding to a current moment and data corresponding to the target snapshot based on the current bitmap information and the target bitmap information; Restoring the target snapshot according to the change amount and the current data; The step of determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information includes: Determine whether snapshot data has been restored; Determining a change between data corresponding to a current moment and data corresponding to the target snapshot based on the judgment result, the current bitmap information, and the target bitmap information; If the judgment result is that the snapshot data has been restored, determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information, and the target bitmap information, including: Determine whether the restored snapshot is before the target snapshot; If the restored snapshot is before the target snapshot, obtaining restoration bitmap information corresponding to the restored snapshot; Performing an OR operation on the restored bitmap information and the current bitmap information to obtain transition bitmap information; An OR operation is performed on the transition bitmap information and the target bitmap information to determine a change between data corresponding to the current moment and data corresponding to the target snapshot.

2. The method according to claim 1, characterized in that If the judgment result is that the snapshot data has not been restored, determining the change between the data corresponding to the current moment and the data corresponding to the target snapshot based on the judgment result, the current bitmap information, and the target bitmap information includes: Acquire the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; An OR operation is performed on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information to determine a change between data corresponding to the current moment and data corresponding to the target snapshot.

3. The method according to claim 1, characterized in that The method further comprises: If the restored snapshot is after the target snapshot, obtaining bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot and the restored bitmap information; An OR operation is performed on the current bitmap information, the restored bitmap information, the target bitmap information, and each bitmap information corresponding to each snapshot between the restored snapshot and the target snapshot to determine a change between data corresponding to the current moment and data corresponding to the target snapshot.

4. The method according to claim 1, wherein Restoring the target snapshot according to the change amount and the current data includes: Create a snapshot recovery process; Determining the changed data based on the change amount and the current data; Based on the snapshot recovery process, the changed data is exported.

5. The method according to claim 1, wherein The obtaining of the current bitmap information corresponding to the current moment includes: Get current data; Comparing the current data with data corresponding to a snapshot before the current moment; Determine, based on the comparison result, a change between the current data and data corresponding to a snapshot before the current moment; The current bitmap information is generated based on a change between the current data and data corresponding to a snapshot between the current moment.

6. A snapshot recovery device, characterized in that: The device comprises: A first acquisition module is configured to acquire target bitmap information of a target snapshot to be restored; wherein the target bitmap information is used to record data changes between the target snapshot and the previous snapshot; The second acquisition module is used to obtain the current bitmap information and current data corresponding to the current moment; a determination module configured to determine, based on the current bitmap information and the target bitmap information, a change between the data corresponding to the current moment and the data corresponding to the target snapshot; wherein, determining, based on the current bitmap information and the target bitmap information, the change between the data corresponding to the current moment and the data corresponding to the target snapshot comprises: determining whether snapshot data has been restored; determining, based on the determination result, the current bitmap information, and the target bitmap information, the change between the data corresponding to the current moment and the data corresponding to the target snapshot; if the determination result is that the snapshot data has been restored, determining, based on the determination result, the current bitmap information, and the target bitmap information, the change between the data corresponding to the current moment and the data corresponding to the target snapshot, comprising: determining whether the restored snapshot is before the target snapshot; if the restored snapshot is before the target snapshot, obtaining restoration bitmap information corresponding to the restored snapshot; performing an OR operation on the restoration bitmap information and the current bitmap information to obtain transition bitmap information; and performing an OR operation on the transition bitmap information and the target bitmap information to determine the change between the data corresponding to the current moment and the data corresponding to the target snapshot; A recovery module is used to restore the target snapshot according to the change amount and the current data.

7. 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 snapshot recovery method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the snapshot recovery method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Difference recovery method and difference recovery device based on FusionComput platform

    CN111611110A