Data revocation method and related device

The bitmap algorithm is used to effectively cancel incremental data between two snapshots in snapshot technology, solving the problem of low data processing efficiency in the prior art, and improving user experience and testing efficiency.

CN119025334APending Publication Date: 2024-11-26XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411044960.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing snapshot-based data recovery methods cannot efficiently undo the incremental data between two snapshots, resulting in low data processing efficiency and poor user experience. Especially when business components need to be frequently reinstalled during software testing, the test efficiency is particularly low. .

Method used

By obtaining the selection information input by the user, the bitmap information between the data to be revoked and the data to be recovered is used to achieve accurate position coverage of the data to be revoked, and the data is revoked, which improves the data processing efficiency and User experience.

Benefits of technology

It realizes efficient revocation of incremental data between two snapshots, simplifies the software testing process, improves testing efficiency, and meets users' needs for fine data revocation and historical record management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025334A_ABST
    Figure CN119025334A_ABST
Patent Text Reader

Abstract

The data revocation method comprises the following steps: acquiring selection information input by a user; according to the selection information, a first snapshot and a second snapshot are determined, the first snapshot is a snapshot corresponding to the to-be-revoked data, the second snapshot is a snapshot corresponding to the to-be-recovered data, and the first snapshot and the second snapshot are snapshots created for the source data disk in sequence; determining first bitmap information of the first snapshot and second bitmap information of the second snapshot; determining third bitmap information according to the first bitmap information and the second bitmap information; copying the total data corresponding to the second snapshot to the target disk; and according to the third bitmap information, copying data indicated by the third bitmap information of the last snapshot of the first snapshot to the target disk to obtain target data. According to the method and the device, through the bitmap algorithm, the revocation work of the incremental data between two snapshots is realized, the data processing efficiency is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data revocation method and related devices. Background Art

[0002] Snapshot technology is a common data backup technology. A snapshot is a fully available copy of a specified data set, which is equivalent to the image of the specified data set at a certain point in time (the time when the snapshot is created). Users can achieve data recovery by rolling back data to any snapshot. Existing snapshot-based data recovery methods cannot undo the incremental data between two snapshots, resulting in low data processing efficiency and poor user experience.

[0003] For example, during the software testing process, multiple business components need to be installed. After completing a business component, a snapshot can be created to mark the business at that stage. If one or more components affect the test results during the test, they need to be reinstalled. The existing snapshot-based data recovery method needs to roll back the data to the snapshot before the business component needs to be reinstalled and restart the test process. Since several correctly installed business components are retested, the test efficiency is low. Summary of the invention

[0004] The embodiment of the present application provides a data revocation method and related device, which realizes the revocation of incremental data between two snapshots through a bitmap algorithm, improves the efficiency of data processing, and improves the user experience. For example, in the process of software testing, the data of the business component that needs to be reinstalled can be revoked, that is, when restarting the test process, only the test process of the target component needs to be restarted, which improves the test efficiency.

[0005] In a first aspect, an embodiment of the present application provides a data revocation method, including: obtaining selection information input by a user, the selection information indicating data to be revoked and data to be restored, the data to be revoked being incremental data between a first snapshot and a snapshot previous to the first snapshot, the data to be restored being full data of a second snapshot, the first snapshot and the second snapshot being snapshots created successively for a source data disk; determining, based on the selection information, first bitmap information of the first snapshot and second bitmap information of the second snapshot, the first bitmap information being bitmap information of the incremental data of the first snapshot relative to the previous snapshot, and the second bitmap information being bitmap information of the incremental data of the second snapshot relative to the first snapshot; determining, based on the first bitmap information and the second bitmap information, third bitmap information being a disk location where data to be copied in the snapshot previous to the first snapshot is located; copying the full data corresponding to the second snapshot to a target disk; and obtaining the target data based on the third bitmap information.

[0006] In the technical solution of the present application, the third bitmap information is determined according to the first bitmap information and the second bitmap information through a bitmap algorithm. According to the third bitmap information, the disk location distribution of the data to be overwritten in the data to be revoked can be clarified, thereby realizing the undo operation of the data to be revoked. Compared with the method of directly restoring data through snapshots, the present application can realize the revocation of incremental data in a snapshot before a certain restored snapshot through a bitmap algorithm, thereby realizing the function of combining data recovery and data revocation, meeting user needs. The snapshot involved in the present application is a COW snapshot. Multiple snapshots in the COW snapshot are de-associated. Each snapshot is equivalent to a mapping of the source data disk. Each snapshot disk contains all the data of the source data disk at the time of creation. Therefore, the data revocation process of the present application will not change the data in the snapshot disk other than the snapshot to be revoked. The present application can realize the data revocation of a specific disk location through the third bitmap information. It is a fine-grained data revocation method that can realize fine data revocation and historical record management.

[0007] In a possible implementation, determining the third bitmap information according to the first bitmap information and the second bitmap information includes: performing an inversion operation on the second bitmap information to determine the second inverted bitmap information; and performing an AND operation on the second inverted bitmap information and the first bitmap information to determine the third bitmap information.

[0008] In this implementation, the second bitmap negation information is determined based on the second bitmap information, and the second bitmap negation information indicates the disk positions that are not covered by the incremental data of the second snapshot relative to the first snapshot. Therefore, based on the second bitmap negation information and the first bitmap information, it is possible to determine which disk positions belong to both the first bitmap information and the second bitmap negation information, and then determine the third bitmap information, so that the third bitmap information can indicate which disk positions are in the first bitmap information but not in the second bitmap information, thereby achieving data revocation at a precise location. This implementation provides an implementation for determining the second bitmap negation information and the third bitmap information, but does not constitute a specific limitation on the implementation for determining the second bitmap negation information and the third bitmap information of the present application.

[0009] In a possible implementation, obtaining the target data according to the third bitmap information includes: copying the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the third bitmap information.

[0010] In this implementation, a method for obtaining target data according to the third bitmap information is provided. The target data can be obtained by copying the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk; or the data at the disk location in the source data disk indicated by the third bitmap information before the data is revoked can be read by other methods. In other words, the embodiment of the present application does not limit the method for obtaining the "data overwritten by the data to be revoked".

[0011] In one possible implementation, an AND operation is performed on the second bitmap negation information and the first bitmap information to determine the third bitmap information, including: for items in the second bitmap negation information and the first bitmap information that are both 0, setting the corresponding items in the third bitmap information to 0; for items in the second bitmap negation information and the first bitmap information that are not both 0, performing an XOR calculation, and setting the corresponding items in the third bitmap information to the values ​​after the XOR calculation.

[0012] In this implementation, an implementation of an AND operation is provided, but does not constitute a specific limitation on the AND operation of the present application.

[0013] In one possible implementation, based on the third bitmap information, copying the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk includes: reading the data indicated by the third bitmap information in the full data of the previous snapshot of the first snapshot; and copying the read data to the disk position indicated by the third bitmap information in the target disk.

[0014] In this implementation, an implementation method for copying data according to the third bitmap information is provided. The data indicated by the third bitmap information in the full data of the previous snapshot of the first snapshot is read; and the read data is copied to the disk position indicated by the third bitmap information in the target disk. The full data in the previous snapshot of the first snapshot corresponds to the disk position indicated by the third bitmap information, and can replace the data at the disk position indicated by the third bitmap information after the full data of the second snapshot is copied.

[0015] In a possible implementation, when the first snapshot and the second snapshot are non-adjacent snapshots, the second bitmap information is obtained by ORing bitmap information of at least one intermediate snapshot and the second snapshot, where the intermediate snapshot is a snapshot created later than the first snapshot and earlier than the second snapshot.

[0016] In this implementation, when the first snapshot and the second snapshot are non-adjacent snapshots, an OR operation can be performed on the bitmap information of at least one intermediate snapshot between the first snapshot and the second snapshot to obtain the second bitmap information. In other words, the bitmap information of the next snapshot of the first snapshot, ..., the second snapshot, etc., is ORed to obtain the second bitmap information. Data undoing can be performed based on the second bitmap information without the need to copy the data of multiple intermediate snapshots separately, thereby improving the efficiency of data copying.

[0017] In a possible implementation, the method further includes: determining a third snapshot according to the selection information, the third snapshot being a snapshot created earlier than the first snapshot, and the third snapshot being a snapshot other than the first snapshot corresponding to the data to be revoked; determining fourth bitmap information of the third snapshot and fifth bitmap information of the second snapshot, the fourth bitmap information being bitmap information of incremental data of the third snapshot relative to the previous snapshot, and the fifth bitmap information being bitmap information of incremental data of the second snapshot relative to the third snapshot; determining sixth bitmap information according to the fourth bitmap information and the fifth bitmap information, the sixth bitmap information being bitmap information of data to be overwritten in the data to be revoked corresponding to the third snapshot. The above-mentioned obtaining target data according to the third bitmap information includes: obtaining target data according to the third bitmap information and the sixth bitmap information.

[0018] In this implementation, an implementation method is provided when the snapshot to be revoked includes two snapshots. That is, in the process of restoring the data of the second snapshot, the incremental data in multiple snapshots can be revoked. In the process of revoking multiple snapshots, it can be understood as multiple executions of the revocation of a single snapshot in this application. Thus, the user's demand for revoking the incremental data in multiple snapshots is met.

[0019] In a possible implementation, the above-mentioned obtaining the target data based on the third bitmap information and the sixth bitmap information includes: based on the third bitmap information, copying the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the third bitmap information; based on the sixth bitmap information, copying the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the sixth bitmap information to obtain the target data.

[0020] In this implementation, a method for obtaining target data based on the third bitmap information and the sixth bitmap information is provided. For example, the target data can be obtained by copying the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk, and copying the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot to the target disk. The data of the disk location in the source data disk indicated by the third bitmap information and the sixth bitmap information before the data is revoked can also be read by other methods. In other words, the embodiment of the present application does not limit the method for obtaining the "data overwritten by the data to be revoked", and obtaining it from the previous snapshot is only an example.

[0021] In a possible implementation, determining the fourth bitmap information of the third snapshot and the fifth bitmap information of the second snapshot includes: obtaining the fourth bitmap information based on the bitmap information of the incremental data of the third snapshot relative to the previous snapshot; or calculating the bitmap information of the intermediate snapshots other than the first snapshot and the second snapshot to determine the fifth bitmap information, wherein the intermediate snapshots other than the first snapshot are one or more snapshots other than the first snapshot whose creation time is later than the third snapshot and earlier than the second snapshot.

[0022] In this implementation, the bitmap information of the intermediate snapshots and the second snapshot other than the first snapshot can be ORed to determine the fifth bitmap information. The fifth bitmap information does not include the bitmap information of the first snapshot, so the data undoing process of the first snapshot and the third snapshot can be completed independently, thereby achieving the purpose of undoing the incremental data in multiple snapshots.

[0023] In a possible implementation, the method further includes: performing deduplication processing on the third bitmap information, the deduplication processing including setting the items in the third bitmap information that are both 1 to 0 when the sixth bitmap information and the third bitmap information have items that are both 1.

[0024] In this implementation, the third bitmap information needs to be deduplicated. The data at a certain disk position may be overwritten by the data to be undone multiple times. Deduplication can restore the data at the certain disk position to the state before it was first overwritten by the data to be undone. Specifically, for positions that are both 1, the item at the position in the third bitmap information is set to 0, and the item at the position in the sixth bitmap information is set to 1. The reason is that the creation time of the third snapshot corresponding to the sixth bitmap information is earlier than the creation time of the first snapshot corresponding to the third bitmap information, thereby achieving the purpose of "withdrawing all the way to the end". In addition, deduplication makes it possible for there to be no overlapping disk positions between the data to be undone in the first snapshot and the data to be undone in the third snapshot, thereby achieving the undo operation of the first snapshot and the third snapshot in parallel, that is, copying the data of the previous snapshot of the first snapshot and the data of the previous snapshot of the third snapshot in parallel, thereby improving the efficiency of data copying.

[0025] In a second aspect, an embodiment of the present application provides a data revocation device, including: an acquisition module, used to acquire selection information input by a user, the selection information indicating the data to be revoked and the data to be restored in the source data disk, the data to be revoked is the incremental data between a first snapshot and a snapshot previous to the first snapshot, the data to be restored is the full data of the second snapshot, the first snapshot and the second snapshot are snapshots created successively for the source data disk; a processing module, used to determine, according to the selection information, first bitmap information of the first snapshot and second bitmap information of the second snapshot, the first bitmap information being the bitmap information of the incremental data of the first snapshot relative to the previous snapshot, and the second bitmap information being the bitmap information of the incremental data of the second snapshot relative to the first snapshot; and, according to the first bitmap information and the second bitmap information, determining third bitmap information, the third bitmap information being the disk location of the data to be copied in the snapshot previous to the first snapshot; copying the full data corresponding to the second snapshot to the target disk; and obtaining the target data according to the third bitmap information.

[0026] In a possible implementation, the processing module is specifically configured to: perform a negation operation on the second bitmap information to determine the second bitmap negation information; and perform an AND operation on the second bitmap negation information and the first bitmap information to determine the third bitmap information.

[0027] In a possible implementation, the processing module is specifically configured to copy data indicated by the third bitmap information in a snapshot previous to the first snapshot to the target disk to replace data at a corresponding disk position in the full amount of data indicated by the third bitmap information.

[0028] In a possible implementation, the processing module is specifically used to: for items in the second bitmap negation information and the first bitmap information that are both 0, set the corresponding items in the third bitmap information to 0; for items in the second bitmap negation information and the first bitmap information that are not both 0, perform XOR calculation, and set the corresponding items in the third bitmap information to the values ​​after the XOR calculation;

[0029] In a possible implementation, the processing module is specifically configured to: read data indicated by third bitmap information in full data of a snapshot previous to the first snapshot; and copy the read data to a disk location indicated by the third bitmap information in a target disk.

[0030] In a possible implementation, when the first snapshot and the second snapshot are non-adjacent snapshots, the second bitmap information is obtained by ORing bitmap information of at least one intermediate snapshot and the second snapshot, where the intermediate snapshot is a snapshot created later than the first snapshot and earlier than the second snapshot.

[0031] In a possible implementation, the processing module is further used to: determine the third snapshot according to the selection information, the third snapshot is a snapshot created earlier than the first snapshot, and the third snapshot is a snapshot other than the first snapshot corresponding to the data to be revoked; determine the fourth bitmap information of the third snapshot and the fifth bitmap information of the second snapshot, the fourth bitmap information is the bitmap information of the incremental data of the third snapshot relative to the previous snapshot, and the fifth bitmap information is the bitmap information of the incremental data of the second snapshot relative to the third snapshot; determine the sixth bitmap information according to the fourth bitmap information and the fifth bitmap information, the sixth bitmap information is the bitmap information of the data to be covered in the data to be revoked corresponding to the third snapshot. The processing module is specifically used to: obtain the target data according to the third bitmap information and the sixth bitmap information.

[0032] In one possible implementation, the processing module is specifically used to: obtain fourth bitmap information based on bitmap information of incremental data of the third snapshot relative to the previous snapshot; or calculate bitmap information of intermediate snapshots other than the first snapshot and the second snapshot to determine fifth bitmap information, where the intermediate snapshots other than the first snapshot are one or more snapshots other than the first snapshot whose creation time is later than the third snapshot and earlier than the second snapshot.

[0033] In a possible implementation, the processing module is further used to: perform deduplication processing on the third bitmap information, the deduplication processing including setting the items in the third bitmap information that are both 1 to 0 when the sixth bitmap information and the third bitmap information have items that are both 1.

[0034] In one possible implementation, the processing module is also used to: based on the third bitmap information, copy the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the third bitmap information; based on the sixth bitmap information, copy the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the sixth bitmap information to obtain the target data.

[0035] In a third aspect, an embodiment of the present application provides a user interface system, comprising: a user interface, comprising multiple controls, each control being used to indicate data to be revoked or data to be restored; a server, being used to obtain user selection information of multiple controls from the user interface, and to determine, based on the selection information, a first snapshot corresponding to the data to be revoked and a second snapshot corresponding to the data to be restored, as well as a method for executing any one of the above-mentioned first aspect and its implementation method.

[0036] In a fourth aspect, an embodiment of the present application provides a data revocation system, comprising: a terminal device and a server. The terminal device is used to provide a user interface, and a user determines selection information of snapshots to be revoked and restored through the user interface. The server is used to receive the selection information and, based on the selection information, execute the method of any one of the above-mentioned first aspect and its implementation methods.

[0037] In a fifth aspect, an embodiment of the present application provides a computing device, the computing device comprising: a processor and a memory. The memory stores instruction operations or codes. The processor is configured to communicate with the memory and execute the instruction operations or codes in the memory to perform the method of any one of the above-mentioned first aspect and its implementation.

[0038] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes the method of any one of the above-mentioned first aspect and its implementation methods.

[0039] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed by a computing device, enables the computing device to execute a method of any one of the above-mentioned first aspect and its implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The following is a brief introduction to the drawings required for use in the embodiments or technical descriptions.

[0041] Figure 1 A schematic diagram of the creation process and data recovery of multiple COW snapshots provided in an embodiment of the present application;

[0042] Figure 2 A schematic diagram of the composition of a data revocation system provided in an embodiment of the present application;

[0043] Figure 3 A flowchart of a data revocation method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of a process for determining second bitmap information when a first snapshot and a second snapshot are adjacent snapshots provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of a process for determining second bitmap information when a first snapshot and a second snapshot are non-adjacent snapshots provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a process for determining the inverted information of a second bitmap provided in an embodiment of the present application;

[0047] Figure 7A schematic diagram of determining third bitmap information provided in an embodiment of the present application;

[0048] Figure 8 A schematic diagram of a process for determining target data provided by an embodiment of the present application;

[0049] Figure 9a A schematic diagram of a process of determining bitmap information when a first snapshot and a third snapshot provided in an embodiment of the present application are adjacent snapshots;

[0050] Figure 9b A schematic diagram of a process of determining bitmap information when a first snapshot and a third snapshot provided in an embodiment of the present application are non-adjacent snapshots;

[0051] Fig.10 A schematic diagram of a deduplication process when the first snapshot and the third snapshot provided in an embodiment of the present application are non-adjacent snapshots;

[0052] Fig.11 A schematic diagram of another process for determining target data provided by an embodiment of the present application;

[0053] Fig.12 A schematic diagram of an example of the composition of a user interface system provided in an embodiment of the present application;

[0054] Fig.13 A schematic diagram of selection information of a user interface of a first example of a data revocation method provided in an embodiment of the present application;

[0055] Fig.14 A schematic diagram of determining target data in a first example of a data revocation method provided in an embodiment of the present application;

[0056] Fig.15 A schematic diagram of selection information of a user interface of a second example of a data revocation method provided in an embodiment of the present application;

[0057] Fig.16 A schematic diagram of determining target data in a second example of a data revocation method provided in an embodiment of the present application;

[0058] Fig.17 A schematic diagram of the composition of a data revocation device provided in an embodiment of the present application;

[0059] Fig.18 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0061] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0062] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.

[0063] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0064] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.

[0065] In order to facilitate understanding of the solution provided by the embodiment of the present application, some terms involved in the solution are first briefly introduced.

[0066] Disk Bitmap is a data structure used to manage free and used areas of a disk. It is a bit vector or bit array of the same size as the disk, and each bit represents a block or sector on the disk. Disk bitmaps are usually used in file systems or storage systems to track the allocation of each block on the disk. Each bit (usually a binary bit) can represent the status of the corresponding block, such as 0 for free and 1 for used. Through the disk bitmap, you can quickly query and manage free and used blocks on the disk. When a new block needs to be allocated, you can find the first free bit in the bitmap and set it to the used state. When you need to release a used block, you can set the corresponding bitmap position to the free state.

[0067] The COW (Copy-On-Write) snapshot technology is a common data snapshot management method, which is widely used in file systems, virtualization, storage systems and other fields. It implements efficient data snapshot functions by delaying write operations and sharing data blocks. In the COW snapshot technology, when a snapshot needs to be created, the system will first record the metadata information of the current data and create a pointer to the original data to obtain the metadata of the snapshot. Then, when the original data is modified, the COW technology will copy the original data block before the modification, and modify the pointer of the snapshot metadata to point to the address of the copied original data, and then modify the original data instead of directly modifying the original data. That is to say, the metadata of the snapshot is always linked to the original data at the time point of creating the snapshot. In this way, data isolation between the snapshot and the original data can be ensured, and the consistency of the snapshot can be maintained. Among them, the disk storing the original data is also called the source data disk (also called the source volume), and the disk storing the copied original data after the snapshot is created is also called the snapshot disk (also called the snapshot volume). That is to say, if the original data on the source data disk needs to be rewritten, the corresponding original data is first copied to the snapshot disk, and then rewritten, and the corresponding pointer in the snapshot is modified to the original data copied in the snapshot disk. This ensures that the snapshot pointer always points to the original data before modification, thus achieving the purpose of data backup.

[0068] Bitmap information refers to the disk bitmap information of certain data. The bitmap information of a snapshot refers to the bitmap information of the incremental data between the snapshot and its previous snapshot. There are many ways to determine the bitmap information of a snapshot. For example, when creating the snapshot, the data of the snapshot disk of the previous snapshot of the snapshot reflects which data has changed. Therefore, the bitmap information of the snapshot can be obtained based on the data of the snapshot disk of the previous snapshot of the snapshot; or, in the process of generating the incremental data between the snapshot and its previous snapshot, the bitmap information of the snapshot can be recorded.

[0069] A virtual machine (VM) is a virtual computing environment that can simulate multiple virtual machines on a single physical computer. A virtual machine runs on an isolated partition of the host computer and has its own CPU, memory, operating system (such as Windows, Linux, macOS), and other resources.

[0070] Snapshot technology is a common data backup technology. A snapshot is a fully available copy of a specified data set, which is equivalent to the image of the specified data set at a certain point in time (the time when the snapshot is created). In other words, a snapshot can be understood as a copy of the specified data set. Snapshot technology is often used in data backup, data recovery, data protection and other fields. It has the advantages of fast speed, small backup data, and no impact on the normal operation of the system.

[0071] Taking the COW (Copy-On-Write) snapshot technology as an example, the process of creating a snapshot and restoring data using the snapshot technology is exemplarily described.

[0072] Figure 1 The schematic diagram of the creation process and data recovery of multiple COW snapshots provided in the embodiment of the present application. Figure 1 As shown, external tasks read and write disk data through the IO interface. In order to save process data, snapshots are created for the disk at different times (for example, Figure 1 As shown, there are snapshot 1 created at time t1, snapshot 2 created at time t2, snapshot 3 created at time t3, ..., snapshot n created at time tn) to back up disk data at different times.

[0073] Exemplarily, the embodiments of the present application also provide bitmap information corresponding to the snapshot. The bitmap information is used to indicate which data in the snapshot is incremental data relative to the previous snapshot, or the bitmap information is used to indicate which data in the snapshot has changed during the period from the creation of the previous snapshot to the creation of the current snapshot. For example, the bitmap information of snapshot 1 is Indicates that the incremental data of snapshot 1 relative to the previous snapshot is the data in the source data disk. Position data; the bitmap information of snapshot 2 is Indicates that the incremental data of snapshot 2 relative to the previous snapshot is the data in the source data disk. Position data; the bitmap information of snapshot 3 is Indicates that the incremental data of snapshot 3 relative to the previous snapshot is the data in the source data disk. The data of the position; the bitmap information of snapshot n is Indicates that the incremental data of snapshot n relative to the previous snapshot is the data in the source data disk. Location data.

[0074] like Figure 1 As shown, when the disk data needs to be restored to the state of the target snapshot and the incremental data between the target snapshot and the previous snapshot needs to be undone, it is only necessary to copy the full amount of data in the previous snapshot of the target snapshot to the disk. Figure 1As shown, when the disk data needs to be restored to the state of snapshot 3 and the incremental data between snapshot 3 and snapshot 2 needs to be undone (that is, the data at the disk location indicated by the bitmap information of snapshot 3 needs to be undone), it is only necessary to copy the data in snapshot 2 to the disk through snapshot rollback according to the file fast copy (reflink) technology.

[0075] like Figure 1 As shown in the figure, in the COW snapshot technology, when there are multiple snapshots, if you need to restore the disk data to the state of the target snapshot and undo the incremental data between any two snapshots before the target snapshot, you cannot do so by Figure 1 The data is restored in a manner similar to "data rollback" as shown. Figure 1 As shown, when the disk data needs to be restored to the state of snapshot 3 and the incremental data between snapshot 1 and snapshot 2 needs to be undone (that is, the data at the disk position indicated by the bitmap information of snapshot 2 needs to be undone), data recovery cannot be performed by snapshot rollback.

[0076] In view of this, an embodiment of the present application provides a data undo method, which can restore disk data to the state of a target snapshot based on the bitmap information of incremental data, and at the same time undo the incremental data between any two snapshots before the target snapshot, thereby realizing the undoing of data within a specific time period (the time period between any two snapshots).

[0077] First, a hardware layout scenario involved in an embodiment of the present application is introduced to facilitate a more intuitive understanding of the technical solution of an embodiment of the present application.

[0078] Figure 2 A schematic diagram of the composition of a data revocation system provided in an embodiment of the present application. Figure 2 As shown, the data revocation system includes a terminal device 210 and a server 220. The terminal device 210 is responsible for providing a user interface, and the user selects the data to be revoked and the data to be restored through the user interface. The server 220 is responsible for receiving the selection information of the data to be revoked and the data to be restored, and according to the selection information, determines the snapshot corresponding to the data to be revoked and the snapshot corresponding to the data to be restored, and performs the actual data recovery and data revocation operations. The terminal device 210 and the server 220 can establish a direct communication connection through wired communication, or can establish an indirect communication connection through wireless communication, which is not limited in the embodiments of the present application.

[0079] The snapshot corresponding to the data to be revoked refers to the incremental data between the snapshot and the previous snapshot; the snapshot corresponding to the data to be restored refers to the full amount of data indicated by the snapshot pointer.

[0080] Furthermore, the server 220 may include one or more servers ( Figure 2 In the example, a server is included, and the server 220 can provide the method and / or apparatus provided in the embodiment of the present application for one or more terminal devices 210.

[0081] It should be understood that in some optional implementations, the terminal device 210 can be deployed with a processor so that the terminal device 210 can also complete the process of completing the data revocation action based on the received selection information by itself without the need for server cooperation. The embodiments of the present application are not limited to this.

[0082] Next, the possible product forms of the terminal device 210 are described. The terminal device 210 in the embodiment of the present application may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this. Exemplary embodiments of the terminal device 210 involved in this solution include but are not limited to electronic devices equipped with iOS, android, Windows, Harmony OS or other operating systems. The embodiment of the present application does not specifically limit the type of electronic device.

[0083] Next, the possible product forms of the server 220 are described. It can be further understood that the server 220 can be a variety of servers, such as an X86 architecture server, and can specifically be a whole cabinet server, a blade server, a high-density server, a rack server, or a high-performance server. In other words, the embodiment of the present application does not specifically limit the specific type of the server. Further, it can be understood that, Figure 2 The structure of the server shown does not constitute a limitation on the structure of the server. The server may include more or less components than shown in the figure, or combine some components, or arrange the components differently.

[0084] Furthermore, server 220 can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers. It can also be configured as a cloud server or cloud server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms. The cloud server cluster is deployed in several cloud data centers; the software can be an application that implements object control methods, etc., but is not limited to the above forms.

[0085] Next, the communication connection mode between the terminal device 210 and the server 220 is described. Exemplarily, the terminal device 210 and the server 220 are connected via a network, so that the terminal device 210 can access the cloud management platform deployed by the cloud server cluster. Among them, the network can be a wired network or a wireless network. For example, the wired network can be a cable network, an optical fiber network, a digital data network (Digital Data Network, DDN), etc., and the wireless network can be a telecommunications network, an internal network, the Internet, a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), a wireless local area network (Wireless Local Area Network, WLAN), a metropolitan area network (Metropolitan Area Network, MAN), a public switched telephone network (Public Service Telephone Network, PSTN), a Bluetooth network, a ZigBee network (ZigBee), a mobile phone (Global System for Mobile Communications, GSM), a CDMA (Code Division Multiple Access) network, a CPRS (General Packet Radio Service) network, etc. or any combination thereof.

[0086] It is understandable that the network can use any known network communication protocol to achieve communication between different terminal device layers and gateways. The above-mentioned network communication protocol can be various wired or wireless communication protocols, such as Ethernet, universal serial bus (USB), Firewire, global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), new radio (NR), Bluetooth, wireless fidelity (Wi-Fi) and other communication protocols.

[0087] In one possible scenario, the server 220 can be used as a cloud (a software platform that uses application virtualization technology, integrating multiple functions such as software search, download, use, management, and backup). In specific use, the server 220 can deploy a cloud management platform and a data center, and the terminal device 210 and the cloud interact through the cloud management platform. In addition, the data center can deploy nodes, where the nodes in the data center can be virtual machine instances, container instances, physical servers, etc.

[0088] That is to say, the method provided in the embodiment of the present application can be applied to the above-mentioned terminal device 210, and can also be applied to the server 220. In specific implementation, the above-mentioned method can be executed by the terminal device or the server, and can be executed by the program code or program module deployed in the terminal device or the server. The program module includes routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.

[0089] Furthermore, if Figure 2 As shown, the embodiment of the present application further provides a user interface 211, including multiple controls, each of which is used to indicate data to be revoked or data to be restored. Figure 2The selection buttons corresponding to the character text boxes named "File 1", "File 2", etc. are shown. The user inputs the selection information of the data to be revoked and the data to be restored through the multiple controls. The server 220 determines the first snapshot to be revoked and the second snapshot to be restored according to the selection information, and then executes the data revocation method of the embodiment of the present application.

[0090] For example, Figure 2 As shown, the user interface 211 is displayed on the display screen of the terminal device 210, and the user selects the data to be revoked through the user interface 211 displayed by the terminal device 210; the server 220 receives the user's selection information, and determines the first snapshot to be revoked and the second snapshot to be restored based on the selection information, and then executes the data revocation method of the embodiment of the present application.

[0091] The above is an introduction to a data revocation system and user interface provided in an embodiment of the present application. Next, based on the above content, a data revocation method provided in an embodiment of the present application is introduced.

[0092] For example, Figure 3 FIG. 1 is a flow chart of a data revocation method provided in an embodiment of the present application. Figure 3 As shown, the data revocation method can be executed by the server 220, and the method mainly includes the following steps:

[0093] Step S310, obtaining selection information input by the user, the selection information indicating the data to be revoked and the data to be restored, the data to be revoked is the incremental data between the first snapshot and the previous snapshot of the first snapshot, the data to be restored is the full data of the second snapshot, and the first snapshot and the second snapshot are snapshots created successively for the source data disk.

[0094] Step S320, determining first bitmap information of the first snapshot and second bitmap information of the second snapshot according to the selection information, wherein the first bitmap information is bitmap information of incremental data of the first snapshot relative to the previous snapshot, and the second bitmap information is bitmap information of incremental data of the second snapshot relative to the first snapshot.

[0095] Step S330: Determine third bitmap information according to the first bitmap information and the second bitmap information, where the third bitmap information is used to indicate a disk location where data to be copied in a snapshot previous to the first snapshot is located.

[0096] Step S340: copy the full amount of data corresponding to the second snapshot to the target disk.

[0097] Step S350, obtaining target data according to the third bitmap information.

[0098] In a possible implementation, when the first snapshot and the second snapshot are non-adjacent snapshots, bitmap information of the intermediate snapshot and the second snapshot are ORed to determine the second bitmap information, wherein the intermediate snapshot includes a snapshot whose creation time is greater than the first snapshot and less than the second snapshot.

[0099] For example, Figure 4 As shown, the first snapshot and the second snapshot are adjacent snapshots, and the bitmap information of the first snapshot can be directly determined as the first bitmap information, and the bitmap information of the second snapshot can be directly determined as the second bitmap information. For the method of determining the bitmap information of the snapshot, please refer to the relevant description of the embodiment of the present application, which will not be repeated here.

[0100] For example, Figure 5 As shown, the first snapshot and the second snapshot are non-adjacent snapshots, that is, there is at least one intermediate snapshot between the first snapshot and the second snapshot, and the bitmap information of the at least one intermediate snapshot between the first snapshot and the second snapshot can be ORed to obtain the second bitmap information. Figure 5 As shown, the bitmap information of the next snapshot of the first snapshot, ..., the second snapshot, etc., is ORed to obtain the second bitmap information. Therefore, the second bitmap information is obtained by ORing the bitmap information of the intermediate snapshot and the second snapshot. Data undoing can be performed based on the second bitmap information without copying the data of the intermediate snapshot multiple times, thereby improving the efficiency of data copying.

[0101] That is to say, when the first snapshot and the second snapshot are non-adjacent snapshots, since the essence of the second bitmap information is the bitmap information of the incremental data between the first snapshot and the second snapshot, and the incremental data between the first snapshot and the second snapshot is the sum of the incremental data of at least one intermediate snapshot and the second snapshot, therefore, by ORing the bitmap information of at least one intermediate snapshot and the first snapshot, it is possible to obtain the bitmap information of the sum of the incremental data, that is, the second bitmap information.

[0102] In a possible implementation, the second bitmap negation information is determined based on the second bitmap information, such as a negation operation. The second bitmap information indicates the disk position covered by the incremental data of the second snapshot relative to the first snapshot, so the second bitmap negation information indicates the disk position not covered by the incremental data of the second snapshot relative to the first snapshot. The third bitmap information is determined based on the second bitmap negation information and the first bitmap information, such as an AND operation or a “⊕” operation.

[0103] In one example, if Figure 6 As shown, the second bitmap information is After negating the second bitmap information, the second bitmap negation information is obtained as like Figure 7 As shown, the first bitmap information is After the first bitmap information and the second bitmap inverse information are operated, the third bitmap information is obtained as follows:

[0104] In one example, the “⊕” operation of the first bitmap information and the inverted information of the second bitmap can be understood as an operation of an exclusive OR operation, and the operation of filtering the input data to be zero. An exemplary code logic is: IF (A = 0 AND B = 0): Result = Ignored; ELSE: Result = XNOR (A, B). A and B represent input data, that is, the first bitmap information and the inverted information of the second bitmap, Result is the third bitmap information, Ignored means ignoring, and XNOR means exclusive OR operation.

[0105] It should be noted that the incremental data of the source data disk is constantly overwritten by new data. Therefore, for the disk position that is successively overwritten by the incremental data of the first snapshot and the incremental data of the second snapshot, since the latest data of the disk position is the incremental data of the second snapshot, the incremental data of the first snapshot of the disk position has been overwritten. Therefore, there is no need to revoke the incremental data of the first snapshot of the disk position. In other words, it is only necessary to revoke the data of the disk position that is overwritten by the incremental data of the first snapshot but not overwritten by the incremental data of the second snapshot. Among them, the purpose of the second bitmap inversion information is to find the disk position that is not overwritten by the incremental data of the second snapshot, and the purpose of the third bitmap information is to find the disk position that is overwritten by the incremental data of the first snapshot but not overwritten by the incremental data of the second snapshot. Therefore, according to the third bitmap information, the disk position of the data that needs to be revoked can be known.

[0106] In one possible implementation, Figure 8 As shown, the first copy data is obtained based on the full data of the second snapshot; the data indicated by the third bitmap information in the previous snapshot of the first snapshot is extracted (i.e., copied) based on the third bitmap information to obtain the second copy data; the target data is obtained based on the first copy data and the second copy data. In the process of obtaining the target data, the disk locations of the first copy data and the second copy data are not the same, and they can be copied in parallel, which improves the speed of obtaining the target data. Specifically, the target data is obtained based on the first copy data and the second copy data, including: first copying the first copy data to the target disk, and then replacing the data at the location indicated by the third bitmap information of the first copy data on the disk with the second copy data to obtain the target data.

[0107] In a possible implementation, an embodiment of the present application provides an implementation method when the revoked snapshot includes two snapshots. An exemplary description is given below. Exemplarily, the snapshot to be revoked also includes a third snapshot, and the creation time of the third snapshot is earlier than the second snapshot. The creation time of the third snapshot may be earlier than or later than the first snapshot. In this example, the creation time of the third snapshot is earlier than the first snapshot. By the same token, the relevant conclusion that the creation time of the third snapshot is later than the first snapshot can be deduced.

[0108] Optionally, when the third snapshot is adjacent to the first snapshot, the incremental data in the first snapshot and the incremental data in the third snapshot may be revoked respectively according to the above data revocation method. Figure 9a As shown, the fourth bitmap information of the third snapshot and the first bitmap information of the first snapshot are ORed to obtain the merged bitmap information. Furthermore, according to the above-mentioned data revocation method, the third bitmap information can be obtained according to the merged bitmap information and the second bitmap information. According to the indication of the third bitmap information, the data indicated by the third bitmap information of the previous snapshot of the third snapshot is copied to obtain the second copied data. The second copied data is used to overwrite the data indicated by the third bitmap information in the full data of the second snapshot copied to the target disk to obtain the target data. In other words, when the third snapshot is adjacent to the first snapshot, the bitmap information of the third snapshot and the first snapshot can be ORed, so that the third snapshot and the first snapshot are considered as a merged new snapshot, and then the data revocation method of the embodiment of the present application is executed.

[0109] Optionally, when the third snapshot is not adjacent to the first snapshot, the incremental data in the first snapshot and the incremental data in the third snapshot can be revoked respectively according to the above data revocation method. The revocation process of the incremental data in the first snapshot will not be described here, and the revocation process of the incremental data in the third snapshot will be further described below.

[0110] Further, the fourth bitmap information of the third snapshot to be revoked and the fifth bitmap information of the second snapshot to be restored are obtained, the fourth bitmap information is used to indicate the disk position of the incremental data of the third snapshot relative to the previous snapshot, and the fifth bitmap information is used to indicate the disk position of the incremental data of the second snapshot relative to the third snapshot; according to the fourth bitmap information and the fifth bitmap information, the sixth bitmap information is determined, and the sixth bitmap information indicates the disk position where the incremental data of the second snapshot relative to the third snapshot is not covered and the incremental data in the third snapshot is covered. According to the third bitmap information and the sixth bitmap information, the target data is determined, the third bitmap information is used to revoke the data after the incremental data of the first snapshot relative to the previous snapshot, and the sixth bitmap information is used to revoke the data after the incremental data in the third snapshot. That is to say, in the process of restoring the data of the second snapshot, multiple snapshots can be undone. In the process of revoking multiple snapshots, it can be understood as multiple executions of a single snapshot revocation in this application. Thereby meeting the user's demand for revoking incremental data in multiple snapshots.

[0111] In the embodiment of the present application, the implementation method of "determining the sixth bitmap information according to the fourth bitmap information and the fifth bitmap information" refers to the implementation method of "determining the third bitmap information according to the first bitmap information and the second bitmap information" in the embodiment of the present application, which will not be repeated here.

[0112] In one possible implementation, Figure 9b As shown, the fifth bitmap information may be determined by performing an OR operation on the bitmap information of at least one second intermediate snapshot other than the first snapshot and the second snapshot.

[0113] Optionally, the third bitmap information may be deduplicated, and the target data may be determined based on the deduplicated third bitmap information and the sixth bitmap information. The deduplication process includes setting the items in the third bitmap information that are both "1" to 0 when the third bitmap information and the sixth bitmap information have items that are both "1".

[0114] For example, in one example, Fig.10 As shown, the third bitmap information is The sixth bitmap information is After deduplication, the third bitmap information is The sixth bitmap information is

[0115] Furthermore, deduplication processing is performed on the third bitmap information and the sixth bitmap information so that there is no overlapping disk location between the data to be undone in the first snapshot and the data to be undone in the third snapshot, thereby enabling the undo operations of the first snapshot and the third snapshot to be performed in parallel, that is, the second copy data and the third copy data mentioned above to be copied in parallel, thereby improving the efficiency of data copying.

[0116] That is, if the third bitmap information is not deduplicated, the second duplicate data needs to be copied first, and then the third duplicate data needs to be copied, but the second duplicate data and the third duplicate data cannot be copied in parallel.

[0117] In one possible implementation, Fig.11 As shown, an embodiment of the present application provides a method for determining target data. Specifically, the first copy data is obtained based on the full data of the second snapshot; the data indicated by the third bitmap information of the previous snapshot of the first snapshot is extracted based on the third bitmap information to obtain the second copy data; the data indicated by the sixth bitmap information of the previous snapshot of the third snapshot is extracted based on the sixth bitmap information to obtain the third copy data; the second copy data is used to overwrite the data indicated by the third bitmap information in the first copy data; and the third copy data is used to overwrite the data indicated by the sixth bitmap information in the first copy data to obtain the target data. Among them, the disk locations where the first copy data, the second copy data, and the third copy data are stored are not the same, and can be copied in parallel, which improves the speed of obtaining the target data.

[0118] In the technical solution of the present application, the third bitmap information is determined based on the first bitmap information and the second bitmap information through a bitmap algorithm. According to the third bitmap information, the disk location distribution of the data to be overwritten in the data to be revoked can be clarified, thereby realizing the undo operation of the data to be revoked. Compared with the method of directly restoring data through snapshots, the present application can realize the undoing of incremental data in one or more snapshots before the snapshot is restored through a bitmap algorithm, thereby realizing the function of combining multiple data recovery and data undo, meeting user needs.

[0119] It should be noted that, illustratively, the snapshot involved in this application can be a COW snapshot, and multiple snapshots in a COW snapshot are de-associated, and each snapshot is equivalent to a mapping of the source data disk. Each snapshot disk contains all the data of the source data disk at the time of creation. Therefore, the data revocation process of this application will not change the data in the snapshot disk other than the snapshot to be revoked. This application can realize the data revocation of a specific disk location through the third bitmap information. It is a fine-grained data revocation method, which reduces the number of data copies and improves the efficiency of data replication.

[0120] Next, combine Figures 12 to 16 , a data revocation method provided by the embodiment of the present application is described in detail by way of example. The embodiment of the present application will be described in combination with two embodiments to exemplarily illustrate the feasibility of the technical solution of the embodiment of the present application, but the two embodiments do not constitute a limitation on the technical solution of the embodiment of the present application.

[0121] Fig.12The following is a schematic diagram of an example of a user interface system provided in an embodiment of the present application. Fig.12 As shown in the example, the incremental data between different snapshots are generally saved in the form of files. Therefore, in the user interface, the control corresponding to each incremental data is named "file*". For example, Fig.12 The "file A", "file B", "file C", "file D", "file E", "file F", "file G", etc. are shown. For example, Fig.12 As shown, the underlying snapshot of the server corresponding to file A is snapshot A. File A is used to represent the incremental data of snapshot A relative to the previous snapshot. The bitmap of the incremental data is bitmap A. Bitmap A is used to represent the disk location of the incremental data in the source data disk. For example, bitmap A is , it means that the disk location of the incremental data in the source data disk is the block or sector corresponding to the second row and the second column.

[0122] Fig.13 This is a schematic diagram of selection information of a user interface of a first example of a data revocation method provided in an embodiment of the present application. Fig.13 As shown, in the first example, the user selects in the user interface: save the data of file A and file C, and delete the data of file B. Saving the data of file A and file C is equivalent to keeping the incremental data of snapshot A relative to its previous snapshot and the incremental data of snapshot C relative to its previous snapshot, and snapshot C is a later snapshot. The incremental data of snapshot A and snapshot C relative to their previous snapshots are also included in the full data of snapshot C, so it can be achieved by restoring the full data of snapshot C, because the incremental data of snapshot A is also included in the full data of snapshot C; deleting the data of file B can be achieved by undoing the incremental data in snapshot B.

[0123] For example, in a virtual machine scenario, the first example can be understood as: a user needs to restore a virtual machine that contains data of file C and file A but does not contain data of file B, that is, the data of snapshot B needs to be undone.

[0124] like Fig.13 As shown, the bitmap A of snapshot A is The bitmap B of snapshot B is The bitmap C of snapshot C is According to the above data revocation method, the bitmap C of snapshot C is Take the inversion and get the inverted bitmap C* of snapshot C: Used to indicate the disk location that is not overwritten by the incremental data of snapshot C. Bitmap for snapshot B and the inverted bitmap of snapshot C Perform the “⊕” operation or AND operation provided above to obtain the bitmap B* corresponding to snapshot B:

[0125] Fig.14 This is a schematic diagram of determining target data for a first example of a data revocation method provided in an embodiment of the present application. Fig.14 As shown, in the first example, according to the method provided above, the fast copy technology (reflink) is executed to copy the full amount of data of snapshot C to the target disk to obtain the first copy data; according to the bitmap The data indicated by the bitmap B* of snapshot A (the previous snapshot of snapshot B) is copied to the target disk to replace the data at the disk position indicated by the bitmap B* of the first copy data in the target disk, and the second copy data is obtained; at this time, the data in the target disk is the target data including file C and file A, but not including file B, that is, the incremental data of snapshot B is unwound. The target disk can be the source data disk, or any other disk or storage device, which is not limited in the embodiments of the present application.

[0126] Fig.15 This is a schematic diagram of selection information of a user interface of a second example of a data revocation method provided in an embodiment of the present application. Fig.15 As shown, in the second example, the user's selection information in the user interface is: save the data of file A, file C, file D and file F, and delete the data of file B and file E. Among them, saving the data of file A, file C, file D and file F is equivalent to keeping the incremental data of snapshot A, snapshot C, snapshot D and snapshot F relative to their previous snapshot, and snapshot F is the latest snapshot. The incremental data of snapshot A, snapshot C and snapshot D relative to their previous snapshot is also included in the full data of snapshot F, so it can be achieved by restoring the full data of snapshot F; deleting the data of file B is equivalent to deleting the incremental data of snapshot B relative to its previous snapshot, so it can be achieved by undoing the incremental data in snapshot B; deleting the data of file E is equivalent to deleting the incremental data of snapshot E relative to its previous snapshot, so it can be achieved by undoing the incremental data in snapshot E.

[0127] For example, in a virtual machine scenario, the second example can be understood as: a user needs to restore a virtual machine that contains data of file A, file C, file D, and file F, but does not contain data of file B and file E, that is, the data of snapshot B and snapshot E need to be undone.

[0128] like Fig.15 As shown, the bitmap A of snapshot A is The bitmap B of snapshot B is The bitmap C of snapshot C is The bitmap D of snapshot D is The bitmap E of snapshot E is The bitmap F of snapshot F is

[0129] The following describes the method for undoing file E. According to the above data undo method, the bitmap F of snapshot F is Negate, and get the inverted bitmap F* of snapshot F as Used to indicate the disk location that is not overwritten by the incremental data of snapshot F. Bitmap for snapshot E and the inverted bitmap of snapshot F Perform the “⊕” operation or AND operation provided above to obtain the bitmap E* of snapshot E:

[0130] The following describes the method for undoing file B. The bitmap C of snapshot C is The bitmap D of snapshot D is The bitmap F of snapshot F is Perform an OR operation to obtain the bitmap F# from snapshot C to snapshot F. The bitmap F# from snapshot C to snapshot F is Take the inversion and get the inversion bitmap F#* of snapshot C to snapshot F. Used to indicate the disk location where the incremental data from snapshot C to snapshot F is not overwritten. Bitmap for snapshot B and the inverted bitmap of snapshot F Perform the “⊕” operation or AND operation provided above to obtain the bitmap B** of snapshot B: Used to indicate the disk location of the source data disk that is not covered by the incremental data from snapshot C to snapshot F but is covered by the incremental data of snapshot B. Bitmap for snapshot B and the bitmap of snapshot E Perform deduplication processing, and for the positions with the same value of 1, replace the bitmap of snapshot E The data at this position is set to 0, so the bitmap E* of snapshot E is That is to say, if the data at a certain disk location of the source data disk is successively overwritten by the data in two snapshots to be undone, then when the data is undone, the data overwritten by the two snapshots to be undone at the disk location must be removed to achieve the effect of "undoing all the way to the end" to avoid performing the undo work twice and increasing the workload. Therefore, the "1" of the disk bitmap is retained in the bitmap of the snapshot with an earlier creation time, so as to copy the data from the previous snapshot of the snapshot with an earlier creation time to the data before being overwritten by the data in the two snapshots to be undone, so as to achieve the effect of "undoing all the way to the end".

[0131] Fig.16 This is a schematic diagram of determining target data in a second example of a data revocation method provided in an embodiment of the present application. Fig.16As shown, in the first example, according to the method provided above, the fast copy technology (reflink) is executed to copy the full amount of data of snapshot F to the target disk to obtain the first copy data; according to the bitmap Copy the data indicated by the bitmap E* of snapshot D (the previous snapshot of snapshot E) to the target disk to replace the data indicated by the bitmap E* in the first copy data in the target disk, and obtain the second copy data; according to the bitmap The data indicated by the bitmap B** of snapshot A (the previous snapshot of snapshot B) is copied to the target disk to replace the data indicated by the bitmap B** in the first copy data in the target disk, and the third copy data is obtained; at this time, the data in the target disk is the target data including file C and file A, but not including file B, that is, the incremental data of snapshot B is revoked. The target disk can be the source data disk, or any other disk or storage device, which is not limited in the embodiment of the present application.

[0132] It should be noted that in the embodiment of the present application, according to the bitmap, the full data of the snapshot is copied to obtain the copied data, which can be understood as: according to the indication of the bitmap, the disk position of "1" in the bitmap is determined as the target position, and the data at the corresponding target position in the full data of the snapshot is copied to obtain the copied data.

[0133] Based on the same inventive concept as the aforementioned data revocation method, the present application embodiment provides a data revocation device. Fig.17 Further explanation will be given.

[0134] Fig.17 A schematic diagram of the composition of a data revocation device provided in an embodiment of the present application. Fig.17 As shown, the embodiment of the present application provides a data revocation device 1700, which mainly includes:

[0135] Acquisition module 1710 is used to obtain selection information input by the user, the selection information indicates the data to be revoked and the data to be restored in the source data disk, the data to be revoked is the incremental data between the first snapshot and the previous snapshot of the first snapshot, the data to be restored is the full data of the second snapshot, and the first snapshot and the second snapshot are snapshots created successively for the source data disk.

[0136] Processing module 1720 is used to determine the first snapshot and the second snapshot according to the selection information, the first snapshot is the snapshot corresponding to the data to be revoked, the second snapshot is the snapshot corresponding to the data to be restored, and the first snapshot and the second snapshot are snapshots created successively for the source data disk; and, determine the first bitmap information of the first snapshot and the second bitmap information of the second snapshot, the first bitmap information is the bitmap information of the incremental data of the first snapshot relative to the previous snapshot, and the second bitmap information is the bitmap information of the incremental data of the second snapshot relative to the first snapshot; and, determine the third bitmap information according to the first bitmap information and the second bitmap information, the third bitmap information is the disk location of the data to be copied in the previous snapshot of the first snapshot; copy the full amount of data corresponding to the second snapshot to the target disk; and obtain the target data according to the third bitmap information.

[0137] In a possible implementation, the processing module 1720 is specifically configured to: perform a negation operation on the second bitmap information to determine the second bitmap negation information; and perform an AND operation on the second bitmap negation information and the first bitmap information to determine the third bitmap information.

[0138] In a possible implementation, the processing module 1720 is specifically used to copy the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk to replace the data at the corresponding disk position in the full data indicated by the third bitmap information.

[0139] In a possible implementation, the processing module 1720 is specifically used to: for items in the second bitmap negation information and the first bitmap information that are both 0, set the corresponding items in the third bitmap information to 0; for items in the second bitmap negation information and the first bitmap information that are not both 0, perform XOR calculation, and set the corresponding items in the third bitmap information to the values ​​after the XOR calculation;

[0140] In a possible implementation, the processing module 1720 is specifically configured to: read data indicated by the third bitmap information in the full data of the previous snapshot of the first snapshot; and copy the read data to the disk location indicated by the third bitmap information in the target disk.

[0141] In a possible implementation, when the first snapshot and the second snapshot are non-adjacent snapshots, the second bitmap information is obtained by ORing bitmap information of at least one intermediate snapshot and the second snapshot, where the intermediate snapshot is a snapshot created later than the first snapshot and earlier than the second snapshot.

[0142] In a possible implementation, the processing module 1720 is further used to: determine the third snapshot according to the selection information, the third snapshot is a snapshot created earlier than the first snapshot, and the third snapshot is a snapshot other than the first snapshot corresponding to the data to be revoked; determine the fourth bitmap information of the third snapshot and the fifth bitmap information of the second snapshot, the fourth bitmap information is the bitmap information of the incremental data of the third snapshot relative to the previous snapshot, and the fifth bitmap information is the bitmap information of the incremental data of the second snapshot relative to the third snapshot; determine the sixth bitmap information according to the fourth bitmap information and the fifth bitmap information, the sixth bitmap information is the bitmap information of the data to be overwritten in the data to be revoked corresponding to the third snapshot. The processing module 1720 is specifically used to: copy the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk according to the third bitmap information, so as to replace the data at the disk position indicated by the third bitmap information in the target disk; copy the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot to the target disk according to the sixth bitmap information, so as to replace the data at the disk position indicated by the sixth bitmap information in the second snapshot, so as to obtain the target data.

[0143] In one possible implementation, the processing module 1720 is specifically used to: obtain fourth bitmap information based on the bitmap information of the incremental data of the third snapshot relative to the previous snapshot; or calculate the bitmap information of the intermediate snapshot other than the first snapshot and the second snapshot to determine the fifth bitmap information, where the intermediate snapshot other than the first snapshot is one or more snapshots other than the first snapshot whose creation time is later than the third snapshot and earlier than the second snapshot.

[0144] In a possible implementation, the processing module 1720 is further used to: perform deduplication processing on the third bitmap information, the deduplication processing including setting the items in the third bitmap information that are both 1 to 0 when the sixth bitmap information and the third bitmap information have items that are both 1.

[0145] In one possible implementation, the processing module 1720 is also used to: copy the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk according to the third bitmap information to replace the data at the corresponding disk position in the full data indicated by the third bitmap information; and copy the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot to the target disk according to the sixth bitmap information to replace the data at the corresponding disk position in the full data indicated by the sixth bitmap information to obtain the target data.

[0146] Based on the same concept as the aforementioned data revocation method, an embodiment of the present application also provides a computing device.

[0147] Fig.18 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. Fig.18As shown, the computing device 1800 includes at least one processor 1810 and a memory 1820. The memory 1820 stores computer instructions, and the processor 1810 executes the computer instructions to perform the method in the aforementioned method embodiment.

[0148] Optionally, the computing device 1800 further includes a communication interface 1830. The processor 1810, the memory 1820 and the communication interface 1830 are connected in communication, and the communication connection can be realized by wired means (such as a bus) or by wireless means. The communication interface 1830 is used to receive data sent by other devices.

[0149] It should be understood that in the embodiment of the present application, the processor 1810 may be a central processing unit CPU, and the processor 1810 may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0150] The memory 1820 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1810. The memory 1820 may also include a nonvolatile random access memory.

[0151] The memory 1820 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct ram bus RAM (DRRAM).

[0152] It should be understood that the computing device 1800 according to the embodiment of the present application can execute the method mentioned in the embodiment of the present application. The detailed description of the implementation of the method is shown above, and for the sake of brevity, it will not be repeated here.

[0153] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer instructions are executed by a processor, the above-mentioned method is implemented.

[0154] An embodiment of the present application provides a computer program or a computer program product, wherein the computer program or the computer program product comprises instructions, and when the instructions are executed, the computer is caused to execute the above-mentioned method.

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

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

[0157] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A data revocation method, characterized in that: include: Acquire selection information input by a user, where the selection information is used to indicate data to be revoked and data to be restored, where the data to be revoked is incremental data between a first snapshot and a snapshot previous to the first snapshot, and the data to be restored is full data of the second snapshot, where the first snapshot and the second snapshot are snapshots created successively for a source data disk; Determine, according to the selection information, first bitmap information of the first snapshot and second bitmap information of the second snapshot, wherein the first bitmap information is bitmap information of incremental data of the first snapshot relative to the previous snapshot, and the second bitmap information is bitmap information of incremental data of the second snapshot relative to the first snapshot; Determine third bitmap information according to the first bitmap information and the second bitmap information, where the third bitmap information is used to indicate a disk location where data to be copied in a snapshot previous to the first snapshot is located; Copying the full amount of data corresponding to the second snapshot to the target disk; The target data is obtained according to the third bitmap information.

2. The method according to claim 1, characterized in that The determining the third bitmap information according to the first bitmap information and the second bitmap information includes: Performing a negation operation on the second bitmap information to determine second bitmap negation information; An AND operation is performed on the second bitmap inversion information and the first bitmap information to determine third bitmap information.

3. The method according to claim 1 or 2, characterized in that: The step of obtaining target data according to the third bitmap information includes: The data indicated by the third bitmap information in the snapshot previous to the first snapshot is copied to the target disk to replace the data at the corresponding disk position in the full amount of data indicated by the third bitmap information.

4. The method according to any one of claims 1 to 3, characterized in that: When the first snapshot and the second snapshot are non-adjacent snapshots, the second bitmap information is obtained by ORing bitmap information of at least one intermediate snapshot and the second snapshot, where the intermediate snapshot is a snapshot created later than the first snapshot and earlier than the second snapshot.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Determine a third snapshot according to the selection information, where the third snapshot is a snapshot created earlier than the first snapshot, and the third snapshot is a snapshot other than the first snapshot corresponding to the data to be revoked; Determine fourth bitmap information of the third snapshot and fifth bitmap information of the second snapshot, wherein the fourth bitmap information is bitmap information of incremental data of the third snapshot relative to the previous snapshot, and the fifth bitmap information is bitmap information of incremental data of the second snapshot relative to the third snapshot; Determine sixth bitmap information according to the fourth bitmap information and the fifth bitmap information, where the sixth bitmap information is the bitmap information of the data to be covered in the data to be revoked corresponding to the third snapshot; The step of obtaining target data according to the third bitmap information includes: The target data is obtained according to the third bitmap information and the sixth bitmap information.

6. The method according to claim 5, characterized in that The step of obtaining the target data according to the third bitmap information and the sixth bitmap information includes: According to the third bitmap information, copy the data indicated by the third bitmap information in the previous snapshot of the first snapshot to the target disk to replace the data at the corresponding disk position in the full amount of data indicated by the third bitmap information; According to the sixth bitmap information, the data indicated by the sixth bitmap information in the previous snapshot of the third snapshot is copied to the target disk to replace the data at the corresponding disk position in the full data indicated by the sixth bitmap information to obtain the target data.

7. The method according to claim 5 or 6, characterized in that: The determining the fourth bitmap information of the third snapshot and the fifth bitmap information of the second snapshot includes: Obtaining the fourth bitmap information according to the bitmap information of the incremental data of the third snapshot relative to the previous snapshot; The fifth bitmap information is determined by performing an OR operation on the bitmap information of the intermediate snapshots other than the first snapshot and the second snapshot, wherein the intermediate snapshots other than the first snapshot are one or more snapshots other than the first snapshot whose creation time is later than the third snapshot and earlier than the second snapshot.

8. The method according to any one of claims 5 to 7, characterized in that: Also includes: The third bitmap information is deduplicated, and the deduplication processing includes setting the items in the third bitmap information that are both 1 to 0 when the sixth bitmap information and the third bitmap information have items that are both 1.

9. A computing device, characterized in that The computing device comprises: a processor and a memory; the memory stores instruction operations or codes; the processor is configured to communicate with the memory and execute the instruction operations or codes in the memory to execute any one of the methods described in claims 1-8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 8.