CN114020527A - Snapshot recovery method and device, computer equipment and storage medium - Google Patents

Snapshot recovery method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114020527A
CN114020527A CN202111262390.6A CN202111262390A CN114020527A CN 114020527 A CN114020527 A CN 114020527A CN 202111262390 A CN202111262390 A CN 202111262390A CN 114020527 A CN114020527 A CN 114020527A
Authority
CN
China
Prior art keywords
snapshot
bitmap information
target
current
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111262390.6A
Other languages
Chinese (zh)
Inventor
李红磊
刘为峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202111262390.6A priority Critical patent/CN114020527A/en
Publication of CN114020527A publication Critical patent/CN114020527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a snapshot recovery method, a device, computer equipment and a storage medium, which are applicable to the technical field of computers, and the method comprises the following steps: acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data change between the target snapshot and the last snapshot; acquiring current bitmap information and current data corresponding to the current moment; determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information; and restoring the target snapshot according to the variable quantity and the current data. By adopting the method, only the changed data needs to be copied, so that the data copying time is shortened, the target snapshot recovery efficiency is improved, the data integrity is ensured, and the occurrence of data loss is reduced. The method and the device can quickly complete the recovery of the snapshot data of the disk under the condition of ensuring the safety and the integrity of the original data.

Description

Snapshot recovery method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a snapshot recovery method, a snapshot recovery device, computer equipment and a storage medium.
Background
The Snapshot (Snapshot) of the disk is a fast backup of the archive system for the entire volume of the disk, and the most important difference from other backup modes is the speed. When taking a disk snapshot, no file copy action is involved. Even if the amount of data is larger, the backup action can be completed within one second. The snapshot data is used for testing, and no damage is caused to the production data. Snapshots are also ideal test data sources for data mining (data mining) and electronic discovery (eDiscovery) applications. In the aspect of disaster recovery, the snapshot is a very effective method, and is very suitable for data recovery when logic errors such as malicious software attack, human misoperation and data damage occur.
However, when recovering the disk snapshot data, the data on the recovered snapshot must be all copied to a new disk file and a consistency rollback is performed. The larger the data in the snapshot, the longer the time to copy, and the probability of problems occurring too long rises. May result in loss of the original data after recovery, or may be incomplete.
Therefore, how to quickly complete the recovery of the disk snapshot data under the condition of ensuring the safety and the integrity of the original data becomes a problem to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present invention provide a snapshot recovery method, an apparatus, a computer device, and a storage medium, so as to solve the problem of quickly completing recovery of disk snapshot data under the condition that security and integrity of original data are guaranteed.
According to a first aspect, an embodiment of the present invention provides a snapshot recovery method, including: acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data change between the target snapshot and the last snapshot; acquiring current bitmap information and current data corresponding to the current moment; determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information; and restoring the target snapshot according to the variable quantity and the current data.
In the embodiment of the application, according to the current bitmap information and the target bitmap information, the variation between the data corresponding to the current time and the data corresponding to the target snapshot is determined, and the target snapshot is recovered according to the variation and the current data. Therefore, all data corresponding to the target snapshot does not need to be copied, and only the changed data needs to be copied, so that the data copying time is shortened, the target snapshot recovery efficiency is improved, the data integrity is ensured, and the occurrence of data loss is reduced. The method and the device can quickly complete the recovery of the snapshot data of the disk under the condition of ensuring the safety and the integrity of the original data.
With reference to the first aspect, in a first implementation manner of the first aspect, determining, according to the current bitmap information and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot includes: judging whether the quick-shot data is recovered; and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
In the embodiment of the application, whether the snapshot data is recovered or not is judged, and the variation between the data corresponding to the current moment and the data corresponding to the target snapshot is determined according to the judgment result, the current bitmap information and the target bitmap information. Therefore, the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot can be accurately determined according to which bitmap information is required to be utilized to solve the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot, and then the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot is determined according to the obtained current bitmap information, the obtained target bitmap information and other required bitmap information, so that the accuracy of the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot is ensured according to the obtained current bitmap information, the obtained target bitmap information and other required bitmap information.
With reference to the first embodiment of the first aspect, in the second embodiment of the first aspect, if the determination result is that the snapshot data is not recovered, determining, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot, includes: acquiring target bitmap information and bitmap information between current bitmap information and target bitmap information; and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
In the embodiment of the application, target bitmap information and bitmap information between current bitmap information and target bitmap information are obtained. And performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot. Therefore, the accuracy of the variation between the calculated data corresponding to the current moment and the calculated data corresponding to the target snapshot can be ensured, and the accuracy of target snapshot recovery is improved.
With reference to the first embodiment of the first aspect, in the third embodiment of the first aspect, if the determination result is to recover the snapshot data, determining, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot, includes: judging whether the recovered snapshot is before the target snapshot or not; if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
In the embodiment of the application, whether the recovered snapshot is before the target snapshot or not is judged, and recovery bitmap information corresponding to the recovered snapshot is acquired under the condition that whether the recovered snapshot is before the target snapshot or not is judged; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot. Therefore, the variation between the calculated data corresponding to the current moment and the calculated data corresponding to the target snapshot can be ensured.
With reference to the third embodiment of the first aspect, in a fourth embodiment of the first aspect, the method further includes: if the recovered snapshot is behind the target snapshot, acquiring each bitmap information and recovered bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots.
In the embodiment of the application, if the recovered snapshot is behind the target snapshot, obtaining each bitmap information and recovery bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots. Therefore, the accuracy of the calculated variation between the data corresponding to the current moment and the data corresponding to the target snapshot is ensured.
With reference to the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the restoring the target snapshot according to the variation and the current data includes: creating a snapshot recovery process; determining changed data based on the variation and the current data; the changed data is exported based on the snapshot recovery process.
In the embodiment of the application, a snapshot recovery process is created; determining changed data based on the variation and the current data; the changed data is exported based on the snapshot recovery process. Therefore, the target snapshot is restored, all data corresponding to the target snapshot does not need to be copied, and only the changed data needs to be copied, so that the data copying time is shortened, the efficiency of restoring the target snapshot is improved, the integrity of the data is ensured, and the occurrence of data loss is reduced.
With reference to the first aspect, in a sixth implementation manner of the first aspect, the obtaining current bitmap information corresponding to a current time includes: acquiring current data; comparing the current data with the data corresponding to the snapshot at the current moment; determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result; and generating current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot at the current moment.
In the embodiment of the application, current data is obtained; comparing the current data with the data corresponding to the snapshot at the current moment; determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result; and generating current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot at the current moment. Thereby, an accurate row of the generated current bitmap information can be ensured.
According to a second aspect, an embodiment of the present invention provides a snapshot recovery apparatus, including:
the first acquisition module is used for acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data change between the target snapshot and the last snapshot;
the second acquisition module is used for acquiring current bitmap information and current data corresponding to the current moment;
the determining module is used for determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information;
and the recovery module is used for recovering the target snapshot according to the variable quantity and the current data.
With reference to the second aspect, in a first embodiment of the second aspect, the determining module includes:
the judging unit is used for judging whether the quick-shot data is recovered or not;
and the first determining unit is used for determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
With reference to the first embodiment of the second aspect, in the second embodiment of the second aspect, if the determination result is that the snapshot data is not recovered, the first determining unit is specifically configured to obtain the target bitmap information and bitmap information between the current bitmap information and the target bitmap information; and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
With reference to the first embodiment of the second aspect, in a third embodiment of the second aspect, if the determination result is to restore the excessively snapshot data, the first determining unit is specifically configured to determine whether the restored snapshot is before the target snapshot; if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
With reference to the third embodiment of the second aspect, in a fourth implementation of the second aspect, the first determining unit is further configured to, if the recovered snapshot is after the target snapshot, obtain bitmap information and recovery bitmap information corresponding to snapshots between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots.
With reference to the second aspect, in a fifth embodiment of the second aspect, the recovery module includes:
the creating unit is used for creating a snapshot recovery process;
a second determination unit configured to determine data that has changed based on the amount of change and the current data;
and the recovery unit is used for exporting the changed data based on the snapshot recovery process.
With reference to the second aspect, in a sixth implementation manner of the second aspect, the second obtaining module includes:
an acquisition unit configured to acquire current data;
the comparison unit is used for comparing the current data with the data corresponding to the snapshot at the current moment;
the third determining unit is used for determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result;
and the generating unit is used for generating the current bitmap information based on the variation between the current data and the data corresponding to the snapshot at the current moment.
According to a third aspect, an embodiment of the present invention provides a computer device, including: the snapshot recovery method includes a memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the first aspect or the snapshot recovery method in any one of the embodiments of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions for causing a computer to execute the snapshot recovery method in the first aspect or any one of the implementation manners of the first aspect.
According to a fifth aspect, an embodiment of the present invention provides a computer program product, the computer program product including a computer program stored on a computer-readable storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the first aspect or the snapshot recovery method in any one of the implementation manners of the first aspect.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
FIG. 1 is a flow diagram that illustrates the steps of a snapshot restore method in one embodiment;
FIG. 2 is a diagram showing virtual machine information in a snapshot recovery method in another embodiment;
FIG. 3 is a flow diagram illustrating the steps of a snapshot restore method in another embodiment;
FIG. 4 is a flow diagram illustrating the steps of a snapshot restore method in another embodiment;
FIG. 5 is a diagram illustrating a first target snapshot in a snapshot restoration method in accordance with another embodiment;
FIG. 6 is a diagram illustrating an ORing operation in the snapshot recovery method in another embodiment;
FIG. 7 is a diagram illustrating an ORing operation in the snapshot recovery method in another embodiment;
FIG. 8 is a flowchart showing the steps of a snapshot restore method in another embodiment;
FIG. 9 is a diagram illustrating a target snapshot after a restored snapshot in a snapshot restoration method in another embodiment;
FIG. 10 is a flowchart showing the steps of a snapshot restore method in another embodiment;
FIG. 11 is a diagram illustrating a target snapshot before a restored snapshot in a snapshot restoration method in another embodiment;
FIG. 12 is a flowchart showing the steps of a snapshot restore method in another embodiment;
FIG. 13 is a diagram showing a recovery process in the snapshot recovery method in another embodiment;
FIG. 14 is a diagram showing a recovery process in the snapshot recovery method in another embodiment;
FIG. 15 is a diagram showing a recovery process in the snapshot recovery method in another embodiment;
FIG. 16 is a flowchart showing the steps of a snapshot restore method in another embodiment;
FIG. 17 is a flowchart showing the steps of a snapshot restore method in another embodiment;
fig. 18 is a block diagram showing the configuration of a snapshot restoration apparatus in another embodiment;
FIG. 19 is a diagram illustrating an internal structure of one embodiment of a computer device in the form of a server;
FIG. 20 is a diagram that illustrates an internal structure of a computer device that is a terminal according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that in the method for recovering a snapshot provided in the embodiment of the present application, an execution subject of the method may be a device for recovering a snapshot, and the device for recovering a snapshot may be implemented in a software, hardware, or a combination of software and hardware to become part or all of a computer device, where the computer device may be a server or a terminal, where the server in the embodiment of the present application may be one server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application may be another intelligent hardware device such as a smart phone, a personal computer, a tablet computer, a wearable device, and an intelligent robot. In the following method embodiments, the execution subject is a computer device as an example.
In an embodiment of the present application, a snapshot recovery method is provided, as shown in fig. 1, which is described by taking the method as an example applied to a computer device, and includes the following steps:
101, obtaining target bitmap information of a target snapshot to be restored.
And the target bitmap information is used for recording data change between the target snapshot and the last snapshot. The target snapshot may be snapshot information corresponding to a disk, or snapshot information corresponding to a hard disk, or snapshot information corresponding to other storage devices.
In an optional implementation manner, the computer device may receive identification information of a target snapshot to be restored, which is input by a user, then find a position of a corresponding target snapshot in the snapshot chain according to the identification information, and derive target bitmap information corresponding to the target snapshot.
In another optional implementation, the computer device may further receive identification information of a target snapshot to be restored, which is sent by another device, then find a position of the corresponding target snapshot in the snapshot chain according to the identification information, and derive target bitmap information corresponding to the target snapshot in the virtual machine disk.
For example, please refer to fig. 2, which takes a disk snapshot of a virtual machine as an example, and shows bitmap information corresponding to each snapshot in a snapshot chain in the disk of the virtual machine. Where disk1 may represent snapshot 1, disk2 may represent snapshot 2, and disk3 may represent snapshot 3.
In another optional implementation, the computer device may further receive target bitmap information of the target snapshot to be restored, which is sent by the user or other devices.
And 102, acquiring current bitmap information and current data corresponding to the current moment.
Specifically, the computer device may read data in the storage device, so as to obtain current data in the storage device. And then, the computer equipment acquires current bitmap information corresponding to the current moment through the current data.
And 103, determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information.
In particular, the computer device may compare the current bitmap information with the target bitmap information. The computer equipment can acquire a matrix corresponding to the current bitmap information and a matrix corresponding to the target bitmap information, compare the matrix corresponding to the current bitmap information with data in the matrix corresponding to the target bitmap information, and if the numerical values of the same position of the matrix are the same, the data corresponding to the position are not changed; if the values at the same position of the matrix are different, the data corresponding to the position are changed. And the computer equipment determines the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the comparison result between the current bitmap information and the target bitmap information.
And 104, restoring the target snapshot according to the variable quantity and the current data.
In an optional implementation manner, the computer device determines the changed data according to the change amount and the current data, and then copies the changed data in the data corresponding to the target snapshot to the corresponding position of the current data according to the position of the data, so as to restore the target snapshot.
In another optional implementation, the computer device determines how the data corresponding to the target snapshot changes to obtain current data according to the change amount, and performs back-stepping on the change amount by using the current data to obtain data corresponding to the target snapshot data, so as to restore the target snapshot.
For example, assuming that the current data is 4 and the variation is-1, that is, it is determined that the data corresponding to the target snapshot is subtracted from 1 to obtain the current data, the computing device adds 1 to the current data to obtain the target snapshot data, thereby recovering the target snapshot.
In the embodiment of the application, according to the current bitmap information and the target bitmap information, the variation between the data corresponding to the current time and the data corresponding to the target snapshot is determined, and the target snapshot is recovered according to the variation and the current data. Therefore, all data corresponding to the target snapshot does not need to be copied, and only the changed data needs to be copied, so that the data copying time is shortened, the target snapshot recovery efficiency is improved, the data integrity is ensured, and the occurrence of data loss is reduced. The method and the device can quickly complete the recovery of the snapshot data of the disk under the condition of ensuring the safety and the integrity of the original data.
In an embodiment of the present application, as shown in fig. 3, the step 103 of "determining a variation between data corresponding to the current time and data corresponding to the target snapshot according to the current bitmap information and the target bitmap information" may include the following steps:
301, determine whether to restore the snapshot data.
And 302, determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
Specifically, whether the snapshot data is restored or not is related to which bitmap information the computer device needs to utilize to solve the variation between the data corresponding to the current time and the data corresponding to the target snapshot. Therefore, before determining the amount of change between the data corresponding to the current time and the data corresponding to the target snapshot, the computer device needs to determine whether to restore the snapshot-too-high data.
Optionally, the computer device may read snapshot data in the snapshot chain, and determine whether to recover the snapshot data; the computer device can also add the recovery identifier after the snapshot data is recovered, so that the computer device can judge whether the snapshot data is recovered or not by reading the recovery identifier.
And the computer equipment determines which bitmap information needs to be utilized to solve the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, and then determines the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the obtained current bitmap information, the obtained target bitmap information and other needed bitmap information.
In the embodiment of the application, whether the snapshot data is recovered or not is judged, and the variation between the data corresponding to the current moment and the data corresponding to the target snapshot is determined according to the judgment result, the current bitmap information and the target bitmap information. Therefore, the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot can be accurately determined by utilizing which bitmap information is required to solve, and then the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot is determined according to the obtained current bitmap information, the obtained target bitmap information and other required bitmap information, so that the accuracy of determining the variable quantity between the data corresponding to the current time and the data corresponding to the target snapshot according to the obtained current bitmap information, the obtained target bitmap information and other required bitmap information is ensured.
In an embodiment of the application, if the determination result is that the snapshot data is not recovered, as shown in fig. 4, the "determining, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot" in 302 may include the following:
401, obtaining the target bitmap information and the bitmap information between the current bitmap information and the target bitmap information.
Specifically, as a result of the determination, the snapshot data is not restored, and thus it is known that the snapshot data is changing according to the chronological order. And the bitmap information records the data change amount between each snapshot and the last snapshot. Therefore, in order to determine the amount of change between the data corresponding to the current time and the data corresponding to the target snapshot, the computer device needs to acquire the target bitmap information and each piece of bitmap information between the current bitmap information and the target bitmap information.
And 402, performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
Specifically, the computer device may first acquire the latest bitmap information between the current bitmap information and the target bitmap information. The computer device may perform an or operation on the current bitmap information and the latest bitmap information to obtain the alternative bitmap information. Wherein the alternative bitmap information characterizes the amount of change between the current data compared to the last snapshot data.
Optionally, the computer device may perform an or operation on the alternative bitmap information and each bitmap information between the current bitmap information and the target bitmap information in sequence according to a time reverse order until the or operation between the alternative bitmap information and the target bitmap information is solved, so as to obtain new bitmap information, where the new bitmap information represents a variation between data corresponding to the current time and data corresponding to the target snapshot.
Optionally, the computer device may further perform an or operation on the alternative bitmap information, the current bitmap information, and the target bitmap information together to obtain new bitmap information, where the new bitmap information represents a variation between data corresponding to the current time and data corresponding to the target snapshot.
For example, please refer to fig. 5, wherein snp1 represents snapshot 1, Bitmap1 represents Bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents Bitmap information 2,. Assume that the target snapshot to be restored currently is the snapshot data corresponding to snapshot 3.
The computer equipment firstly merges a current Bitmap and a Bitmap N +1 corresponding to the latest snapshot of the virtual machine, the merging strategy is OR operation, and the Bitmap N + 1' is Bitmap | Bitmap N + 1. And the Bitmap N + 1' represents the alternative Bitmap information after the current Bitmap and the Bitmap N +1 corresponding to the latest snapshot are merged.
Then, the computer device finds out the target bitmap information corresponding to the target snapshot and the bitmap information between the target bitmap information and the latest bitmap information. Then, the computer device performs or operation on the alternative Bitmap information Bitmap N +1 ' and Bitmap3, Bitmap4, … and Bitmap N in fig. 5 to obtain a Bitmap3 ═ Bitmap3|, Bitmap4| … | Bitmap N +1 ', where the Bitmap3 ' is new Bitmap information and is used for representing the variation between the data at the current time and the data corresponding to the snapshot 3.
For a clearer explanation, please refer to fig. 6, the current Bitmap and the Bitmap N +1 corresponding to the latest snapshot are or-ed. Wherein, the operation logic is: if the same position of the Bitmap N +1 corresponding to the previous Bitmap and the Bitmap N +1 corresponding to the latest snapshot is 1, the corresponding position of the Bitmap N + 1' is 1; if the same position of the Bitmap N +1 corresponding to the previous Bitmap and the Bitmap corresponding to the latest snapshot is 0, the corresponding position of the Bitmap N + 1' is 0. Where 1 indicates that the data corresponding to the position has changed from the previous snapshot data, and 0 indicates that the data corresponding to the position has not changed from the previous snapshot data.
As shown in fig. 7, the process of performing an or operation on Bitmap2 and Bitmap3 to obtain Bitmap 2' may be characterized.
In the embodiment of the application, target bitmap information and bitmap information between current bitmap information and target bitmap information are obtained. And performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot. Therefore, the accuracy of the variation between the calculated data corresponding to the current moment and the calculated data corresponding to the target snapshot can be ensured, and the accuracy of target snapshot recovery is improved.
In an embodiment of the application, if the determination result is to recover the over-snapshot data, as shown in fig. 8, the "determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot according to the determination result, the current bitmap information, and the target bitmap information" in 302 may include the following steps:
801, determine if the recovered snapshot is before the target snapshot.
Specifically, since whether the recovered snapshot is before the target snapshot is related to which bitmap information the computer device needs to use to solve the variation between the data corresponding to the current time and the data corresponding to the target snapshot, before determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot, the computer device needs to determine whether the recovered snapshot is before the target snapshot.
And 802, if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot.
Specifically, if the determination result is that the recovered snapshot is before the target snapshot, the computer device may determine the recovery bitmap information corresponding to the recovered snapshot by reading the recovery identifier.
803, or-ing the current bitmap information, the target bitmap information and the recovery bitmap information to determine the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
Specifically, if the recovered snapshot is before the target snapshot, that is, the second recovered snapshot is after the first recovered snapshot, the computer device needs to acquire the recovery bitmap information corresponding to the snapshot that has been recovered.
Because the virtual machine has already recovered the snapshot data, the computer device may perform an or operation on bitmap information corresponding to the recovered snapshot data and current bitmap information to obtain transition bitmap information, where the transition bitmap information represents a variation between the current data and the recovered snapshot data.
And then, the computer equipment performs OR operation on the transition bitmap information and the target bitmap information, and the calculated bitmap information represents the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
For example, please refer to fig. 9, wherein snp1 represents snapshot 1, Bitmap1 represents Bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents Bitmap information 2,. The snapshot to be restored for the first time is snapshot 2, and the target snapshot to be restored at present is assumed to be snapshot data corresponding to snapshot 3, that is, the restored snapshot is before the target snapshot.
The computer device firstly obtains Bitmap information Bitmap2 corresponding to the snapshot 2, and then performs or operation on Bitmap2 and the Bitmap to obtain Bitmap2 ═ Bitmap2| -Bitmap by calculation, wherein the Bitmap 2' represents transition Bitmap information and represents the variation between the current data and the recovered snapshot data.
The computer device then merges the Bitmap 2' and Bitmap3 Bitmap information, Bitmap3 ″, Bitmap2|, Bitmap 3. The Bitmap 3' represents the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
In the embodiment of the application, whether the recovered snapshot is before the target snapshot or not is judged, and recovery bitmap information corresponding to the recovered snapshot is acquired under the condition that whether the recovered snapshot is before the target snapshot or not is judged; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot. Therefore, the variation between the calculated data corresponding to the current moment and the calculated data corresponding to the target snapshot can be ensured.
In an embodiment of the present application, as shown in fig. 10, the method may further include the following:
1001, if the recovered snapshot is after the target snapshot, acquiring each bitmap information and recovery bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot.
Specifically, after the recovered snapshot is the target snapshot, the computer device needs to acquire the data change amount between the recovered snapshot and the target snapshot, and therefore, the computer device needs to acquire each bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot and the recovered bitmap information.
And 1002, performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and the bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current time and the data corresponding to the target snapshots.
Specifically, the computer device may perform an or operation on the current bitmap information and the recovered bitmap information, then perform an or operation on the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot in sequence, and finally obtain bitmap information that can represent a variation between data corresponding to the current time and data corresponding to the target snapshot.
Illustratively, as shown in fig. 11, snp1 represents snapshot 1, Bitmap1 represents Bitmap information 1, snp2 represents snapshot 2, Bitmap2 represents Bitmap information 2,. The snapshot to be restored for the first time is snapshot N, and it is assumed that the snapshot data corresponding to snapshot 3 needs to be restored currently. The recovered snapshot is snapshot N and the target snapshot is snapshot 3, i.e., the recovered snapshot is after the target snapshot.
The computer device calculates the or operation of the Bitmap N and the Bitmap to obtain the Bitmap N ═ Bitmap N | Bitmap. Then, the computer device combines or operations of bitmaps 3, bitmaps 4, and … bitmaps N ', calculates a Bitmap 3' to Bitmap3| Bitmap4| … | Bitmap N ', and finally calculates a Bitmap 3' to represent a variation between data corresponding to the current time and data corresponding to the target snapshot.
In the embodiment of the application, if the recovered snapshot is behind the target snapshot, obtaining each bitmap information and recovery bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots. Therefore, the accuracy of the calculated variation between the data corresponding to the current moment and the data corresponding to the target snapshot is ensured.
In an embodiment of the present application, as shown in fig. 12, the "restore the target snapshot according to the amount of change and the current data" in the above 104 may include the following:
1201, create a snapshot restore process.
Specifically, before the target snapshot needs to be restored, the computer device needs to create a snapshot restoration process for completing a task of snapshot restoration.
1202, the changed data is determined based on the amount of change and the current data.
Specifically, the computer device compares the variation between the data corresponding to the current time and the data corresponding to the target snapshot, which are obtained by calculation in the implementation, with the current data, and determines the changed data.
1203, exporting the changed data based on the snapshot recovery process.
Specifically, the computer device exports the changed data to a disk file of the virtual machine based on the snapshot recovery process.
For example, as shown in fig. 13, when the judgment result shows that the snapshot data has not been restored, the computer device exports the calculated changed data out of the virtual machine disk file based on the snapshot restoring process, so as to implement the restoration of the target snapshot.
Fig. 14 is an embodiment of implementing the recovery of the target snapshot by the computer device exporting the changed data obtained by calculation to the disk file of the virtual machine based on the snapshot recovery process when the determination result is that the snapshot data is recovered and the recovered snapshot is before the target snapshot.
Fig. 15 is an embodiment of implementing the recovery of the target snapshot by the computer device exporting the changed data obtained by calculation to the disk file of the virtual machine based on the snapshot recovery process, in the case that the determination result is that the snapshot data is recovered and the recovered snapshot is after the target snapshot.
In the embodiment of the application, a snapshot recovery process is created; determining changed data based on the variation and the current data; the changed data is exported based on the snapshot recovery process. Therefore, the target snapshot is restored, all data corresponding to the target snapshot does not need to be copied, and only the changed data needs to be copied, so that the data copying time is shortened, the efficiency of restoring the target snapshot is improved, the integrity of the data is ensured, and the occurrence of data loss is reduced.
In an embodiment of the present application, as shown in fig. 16, the "acquiring current bitmap information corresponding to the current time" in the foregoing step 102 may include the following steps:
1601, current data is obtained.
Specifically, the computer device may read data in the storage device, so as to obtain current data in the virtual machine disk.
And 1602, comparing the current data with data corresponding to one snapshot at the current time.
Specifically, the computer device obtains data corresponding to a snapshot between current times. And the computer equipment compares the current data with the data corresponding to the snapshot at the current moment.
1603, determining the variation between the current data and the data corresponding to the snapshot between the current time according to the comparison result.
Specifically, the computer device determines the variation between the current data and the data corresponding to the snapshot at the time between the current times according to the result of comparing the current data with the data corresponding to the snapshot at the time between the current times.
1604, current bitmap information is generated based on the amount of change between the current data and the data corresponding to the one snapshot between the current times.
Specifically, the computer device generates current bitmap information based on the amount of change between data corresponding to one snapshot between the current data and the current time.
In an optional implementation manner, the computer device may further record a change condition of the data in real time, and the computer device determines, according to the change condition of the data, a change amount between data corresponding to a snapshot between the current data and the current time, and then generates the current bitmap information based on the change amount between the data corresponding to the snapshot between the current data and the current time.
In the embodiment of the application, current data is obtained; comparing the current data with the data corresponding to the snapshot at the current moment; determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result; and generating current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot at the current moment. Thereby, an accurate row of the generated current bitmap information can be ensured.
To better explain the snapshot recovery method provided in the embodiment of the present application, as shown in fig. 17, an overall flowchart of the snapshot recovery method provided in the embodiment of the present application may include the following steps:
1701, target bitmap information of a target snapshot to be restored is obtained.
1702, obtain current data.
1703, comparing the current data with data corresponding to a snapshot at the current time.
1704, according to the comparison result, determining the variation between the current data and the data corresponding to the snapshot between the current time.
And 1705, generating current bitmap information based on a variation between data corresponding to one snapshot between the current data and the current time.
1706, judging whether the quick photo data is recovered, if the judgment result is that the quick photo data is not recovered, executing 1707; if the judgment result is that the quick photo data is recovered, executing 1709;
1707, the target bitmap information and bitmap information between the current bitmap information and the target bitmap information are obtained.
1708, performing or operation on the current bitmap information, the target bitmap information, and each bitmap information between the current bitmap information and the target bitmap information, and determining a variation between data corresponding to the current time and data corresponding to the target snapshot.
1709, determining whether the recovered snapshot is before the target snapshot, and if the recovered snapshot is before the target snapshot, 1710 executing; if the recovered snapshot is after the target snapshot, 1712 is performed.
And 1710, acquiring recovery bitmap information corresponding to the recovered snapshot.
1711, performing an or operation on the current bitmap information, the target bitmap information, and the recovery bitmap information, and determining a variation between data corresponding to the current time and data corresponding to the target snapshot.
1712, obtaining the corresponding bitmap information and recovery bitmap information of the recovered snapshot and the target snapshot.
1713, performing an or operation on the current bitmap information, the recovered bitmap information, the target bitmap information, and each piece of bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshots.
1714, based on the amount of change and the current data, the changed data is determined.
1715, a snapshot restore process is created.
1716, the changed data is exported based on the snapshot restore process.
It should be understood that although the various steps in the flowcharts of fig. 1, 3, 4, 8, 10, 12, 16 and 17 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1, 3, 4, 8, 10, 12, 16, and 17 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternatingly with other steps or at least some of the other steps.
Accordingly, referring to fig. 18, an embodiment of the invention provides a snapshot recovery apparatus 1800, where the snapshot recovery apparatus 1800 includes:
a first obtaining module 1810, configured to obtain target bitmap information of a target snapshot to be restored; and the target bitmap information is used for recording data change between the target snapshot and the last snapshot.
The second obtaining module 1820 is configured to obtain current bitmap information and current data corresponding to a current time.
The determining module 1830 is configured to determine, according to the current bitmap information and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot.
And a recovery module 1840, configured to recover the target snapshot according to the variation and the current data.
In one embodiment of the present application, the determining module 1830 includes:
a judging unit 1831, configured to judge whether to recover the snapshot data;
the first determining unit 1832 is configured to determine, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot.
In an embodiment of the present application, if the determination result is that the snapshot data is not recovered, the first determining unit 1832 is specifically configured to obtain the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information; and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
In an embodiment of the present application, if the determination result is to recover the snapshot data, the first determining unit 1832 is specifically configured to obtain recovery bitmap information corresponding to the recovered disk snapshot; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
In an embodiment of the present application, the recovery module 1840 includes:
a second determining unit 1841 for determining the changed data based on the amount of change and the current data;
and a recovery unit 1842, configured to recover the target snapshot based on the changed data.
In an embodiment of the present application, the recovery unit 1842 is specifically configured to create a snapshot recovery process; the changed data is exported based on the snapshot recovery process.
In an embodiment of the present application, the second obtaining module 1820 includes:
an obtaining unit 1821 is configured to obtain current data.
The comparison unit 1822 is configured to compare the current data with data corresponding to one snapshot at the current time.
The third determining unit 1823 is configured to determine, according to the comparison result, a variation between data corresponding to one snapshot between the current data and the current time.
The generating unit 1824 is configured to generate current bitmap information based on a variation between data corresponding to one snapshot between current data and a current time.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 19. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a snapshot recovery method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 20. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing snapshot recovery data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a snapshot recovery method.
It will be appreciated by those skilled in the art that the configurations shown in fig. 19 and 20 are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment of the present application, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program: acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data change between the target snapshot and the last snapshot; acquiring current bitmap information and current data corresponding to the current moment; determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information; and restoring the target snapshot according to the variable quantity and the current data.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: judging whether the quick-shot data is recovered; and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
In an embodiment of the application, if the determination result is that the snapshot data is not recovered, the processor further implements the following steps when executing the computer program: acquiring target bitmap information and bitmap information between current bitmap information and target bitmap information; and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
In an embodiment of the present application, if the determination result is that the over-snapshot data is recovered, the processor further implements the following steps when executing the computer program: judging whether the recovered snapshot is before the target snapshot or not; if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: if the recovered snapshot is behind the target snapshot, acquiring each bitmap information and recovered bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: creating a snapshot recovery process; determining changed data based on the variation and the current data; the changed data is exported based on the snapshot recovery process.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: acquiring current data; comparing the current data with the data corresponding to the snapshot at the current moment; determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result; and generating current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot at the current moment.
In one embodiment of the present application, there is provided a computer readable storage medium having a computer program stored thereon, the computer program when executed by a processor implementing the steps of: acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data change between the target snapshot and the last snapshot; acquiring current bitmap information and current data corresponding to the current moment; determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information; and restoring the target snapshot according to the variable quantity and the current data.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: judging whether the quick-shot data is recovered; and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
In an embodiment of the application, if the determination result is that the snapshot data is not recovered, the computer program when executed by the processor further implements the following steps: acquiring target bitmap information and bitmap information between current bitmap information and target bitmap information; and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current time and the data corresponding to the target snapshot.
In an embodiment of the application, if the determination result is that the snapshot data is recovered, the computer program further implements the following steps when executed by the processor: judging whether the recovered snapshot is before the target snapshot or not; if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot; and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: if the recovered snapshot is behind the target snapshot, acquiring each bitmap information and recovered bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot; and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshots and the target snapshots to determine the variation between the data corresponding to the current moment and the data corresponding to the target snapshots.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: creating a snapshot recovery process; determining changed data based on the variation and the current data; the changed data is exported based on the snapshot recovery process.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring current data; comparing the current data with the data corresponding to the snapshot at the current moment; determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result; and generating current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot at the current moment.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A snapshot recovery method, the method comprising:
acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data changes between the target snapshot and the last snapshot;
acquiring current bitmap information and current data corresponding to the current moment;
determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information;
and recovering the target snapshot according to the variable quantity and the current data.
2. The method according to claim 1, wherein the determining, according to the current bitmap information and the target bitmap information, a variation between data corresponding to a current time and data corresponding to the target snapshot comprises:
judging whether the quick-shot data is recovered;
and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the judgment result, the current bitmap information and the target bitmap information.
3. The method according to claim 2, wherein if the determination result is that the snapshot data is not recovered, the determining, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot includes:
acquiring the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information;
and performing OR operation on the current bitmap information, the target bitmap information and each bitmap information between the current bitmap information and the target bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
4. The method according to claim 2, wherein if the determination result is that the snapshot data is recovered, determining, according to the determination result, the current bitmap information, and the target bitmap information, a variation between data corresponding to the current time and data corresponding to the target snapshot includes:
judging whether the recovered snapshot is before the target snapshot or not;
if the recovered snapshot is before the target snapshot, acquiring recovery bitmap information corresponding to the recovered snapshot;
and performing OR operation on the current bitmap information, the target bitmap information and the recovery bitmap information, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
5. The method of claim 4, further comprising:
if the recovered snapshot is behind the target snapshot, acquiring each bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot and the recovered bitmap information;
and performing OR operation on the current bitmap information, the recovered bitmap information, the target bitmap information and each bitmap information corresponding to each snapshot between the recovered snapshot and the target snapshot, and determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot.
6. The method of claim 1, wherein the restoring the target snapshot according to the delta and the current data comprises:
creating a snapshot recovery process;
determining changed data based on the change amount and the current data;
and exporting the changed data based on the snapshot recovery process.
7. The method according to claim 1, wherein the obtaining current bitmap information corresponding to the current time includes:
acquiring current data;
comparing the current data with data corresponding to one snapshot at the current moment;
determining the variation between the current data and the data corresponding to the snapshot at the current moment according to the comparison result;
and generating the current bitmap information based on the variable quantity between the current data and the data corresponding to the snapshot between the current time.
8. A snapshot restoration apparatus, the apparatus comprising:
the first acquisition module is used for acquiring target bitmap information of a target snapshot to be restored; the target bitmap information is used for recording data changes between the target snapshot and the last snapshot;
the second acquisition module is used for acquiring current bitmap information and current data corresponding to the current moment;
the determining module is used for determining the variation between the data corresponding to the current moment and the data corresponding to the target snapshot according to the current bitmap information and the target bitmap information;
and the restoring module is used for restoring the target snapshot according to the variable quantity and the current data.
9. A computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the snapshot recovery method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the snapshot restoration method of any one of claims 1-7.
CN202111262390.6A 2021-10-28 2021-10-28 Snapshot recovery method and device, computer equipment and storage medium Pending CN114020527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111262390.6A CN114020527A (en) 2021-10-28 2021-10-28 Snapshot recovery method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111262390.6A CN114020527A (en) 2021-10-28 2021-10-28 Snapshot recovery method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114020527A true CN114020527A (en) 2022-02-08

Family

ID=80058293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111262390.6A Pending CN114020527A (en) 2021-10-28 2021-10-28 Snapshot recovery method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114020527A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269270A (en) * 2022-08-02 2022-11-01 广州鼎甲计算机科技有限公司 Backup merging method, device and equipment
CN115292094A (en) * 2022-08-10 2022-11-04 广州鼎甲计算机科技有限公司 Data recovery processing method, apparatus, device, storage medium, and program product

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115269270A (en) * 2022-08-02 2022-11-01 广州鼎甲计算机科技有限公司 Backup merging method, device and equipment
CN115292094A (en) * 2022-08-10 2022-11-04 广州鼎甲计算机科技有限公司 Data recovery processing method, apparatus, device, storage medium, and program product
CN115292094B (en) * 2022-08-10 2023-11-14 广州鼎甲计算机科技有限公司 Data recovery processing method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
US10268695B2 (en) Snapshot creation
CN106951345B (en) Consistency test method and device for disk data of virtual machine
US20200110655A1 (en) Proactive data protection on predicted failures
CN114020527A (en) Snapshot recovery method and device, computer equipment and storage medium
KR102031606B1 (en) Versioned memory implementation
EP3474143B1 (en) Method and apparatus for incremental recovery of data
WO2019097360A1 (en) Machine learning to enhance redundant array of independent disks rebuilds
US11436021B2 (en) Adaptive system for smart boot sequence formation of VMs for disaster recovery
CN116560914B (en) Incremental backup method, system and storage medium under virtual machine CBT failure
US11150831B2 (en) Virtual machine synchronization and recovery
US20200233674A1 (en) Automatically configuring boot order in recovery operations
CN109491961B (en) File system snapshot method and snapshot device
US20230088318A1 (en) Remotely healing crashed processes
CN110968456A (en) Method and device for processing fault disk in distributed storage system
CN114003172A (en) Storage capacity correction method, storage capacity correction device, computer equipment and storage medium
CN113312309A (en) Management method and device of snapshot chain and storage medium
CN109324931B (en) Method for realizing vmware mount recovery in data de-duplication system
KR101449202B1 (en) System and method for data copy and restoration in steel process middleware
CN110658989B (en) System and method for backup storage garbage collection
US11709738B1 (en) Intelligent protection of virtual machine by identifying the degree of risk at a granular level
CN110008114B (en) Configuration information maintenance method, device, equipment and readable storage medium
CN107656747B (en) Data upgrading method and mobile terminal
CN116578446B (en) Virtual machine backup method, device and system, electronic equipment and storage medium
US11301161B2 (en) Recommendation system for replication policies
CN113031851B (en) Data snapshot method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination