CN110750387A - Data snapshot method, device and equipment and computer readable storage medium - Google Patents

Data snapshot method, device and equipment and computer readable storage medium Download PDF

Info

Publication number
CN110750387A
CN110750387A CN201911025175.7A CN201911025175A CN110750387A CN 110750387 A CN110750387 A CN 110750387A CN 201911025175 A CN201911025175 A CN 201911025175A CN 110750387 A CN110750387 A CN 110750387A
Authority
CN
China
Prior art keywords
snapshot
target
data
copy
volume
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.)
Withdrawn
Application number
CN201911025175.7A
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.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent 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 Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201911025175.7A priority Critical patent/CN110750387A/en
Publication of CN110750387A publication Critical patent/CN110750387A/en
Withdrawn 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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

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 data snapshot method, which comprises the following steps: receiving a data snapshot creating command for target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing. By applying the technical scheme provided by the embodiment of the invention, the compatibility of the redirection copy snapshot and the copy-on-write snapshot in the same product system is achieved, the respective advantages of the redirection copy snapshot and the copy-on-write snapshot are fully utilized, and the data snapshot efficiency is improved. The invention also discloses a data snapshot device, equipment and a storage medium, and has corresponding technical effects.

Description

Data snapshot method, device and equipment and computer readable storage medium
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a data snapshot method, apparatus, device, and computer-readable storage medium.
Background
The application of the snapshot technology realizes the quick recovery of data of the storage device. There are two methods for snapshot technology, Copy-On-Write (COW) and Redirect-On-Write (ROW), and the difference between them is mainly how to store the pre-modification content of a modified block. Copy-on-write is to copy out old data and write new data in the original position, i.e. to maintain the integrity of the physical position of the original protected entity (protected entity) as much as possible; redirecting a copy is writing new data at a new location and then pointing a pointer to the new location, so the more rewrites, the more scattered the entire protected entity is.
Copy-on-write requires 3I/O operations per write operation: one read operation and two writes look for the contents of one copy-on-write snapshot because of the computational load to address. Therefore, the copy-on-write snapshot is suitable for a scenario in which a read operation is the primary and a write operation is less. Each time a redirect copy is written, the storage system points the pointer to the modified block to a new location, and then writes the new data to the new location, there is no computational burden to find the contents of a redirect copy snapshot since the snapshot system knows where to find the contents of the original block. Therefore, the redirection copy snapshot is suitable for the scene that the writing operation is main and the reading operation is less.
At present, the traditional storage product only supports copy-on-write snapshots, while the emerging full flash memory product only supports redirect copy snapshots, so that the two situations can not meet the business requirements of needing the copy-on-write snapshots and the redirect copy snapshots in the same product system at the same time, and the respective advantages of the copy-on-write snapshots and the redirect copies can not be fully utilized.
In summary, how to effectively solve the problems that the business requirements of the copy-on-write snapshot and the redirect copy snapshot in the same product system can not be met, the respective advantages of the copy-on-write snapshot and the redirect copy can not be fully utilized, the data snapshot efficiency is low, and the like, is a problem that needs to be solved urgently by technical personnel in the field at present.
Disclosure of Invention
The invention aims to provide a data snapshot method, which realizes the full utilization of respective advantages of a redirected copy snapshot and a copy-on-write snapshot and improves the efficiency of data snapshot; another object of the present invention is to provide a data snapshot apparatus, a device and a computer-readable storage medium.
In order to solve the technical problems, the invention provides the following technical scheme:
a data snapshot method, comprising:
receiving a data snapshot creating command for target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit;
when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume;
and when the current required snapshot type is determined to be a copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when the snapshot is written.
In a specific embodiment of the present invention, after receiving a create data snapshot command for target data, before redirecting a copy snapshot of the target data from a source volume to a target volume or copying a snapshot of the target data from the source volume to the target volume at the time of writing, the method further includes:
judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command;
if yes, respectively judging whether the snapshot types of the source volume and the target volume in the previous snapshot operation are consistent with the current required snapshot type;
and if not, performing snapshot type mismatch prompting operation.
In a specific embodiment of the present invention, parsing the command for creating a data snapshot to obtain a target snapshot type flag bit includes:
analyzing the command for creating the data snapshot to obtain a Boolean-type redirection copy parameter;
when the current needed snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume, wherein the steps of:
when the type of the current needed snapshot is determined to be the redirection copy snapshot according to the redirection copy parameters, the target data is redirected from the source volume to the target volume;
when the current needed snapshot type is determined to be a copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume in a copy-on-write snapshot manner, including:
and when the type of the current required snapshot is determined to be a copy-on-write snapshot according to the redirection copy parameter, copying the target data from the source volume to the target volume when the snapshot is written.
In a specific embodiment of the present invention, when determining that the current required snapshot type is a redirected copy snapshot according to the redirected copy parameter, redirecting and copying the target data from the source volume to the target volume includes:
and when the current required snapshot type is determined to be the redirection copy snapshot by combining the redirection copy parameter and the volume types of the source volume and the target volume, redirecting and copying the target data from the source volume to the target volume.
A data snapshot apparatus, comprising:
the zone bit obtaining module is used for receiving a data snapshot creating command of target data and analyzing the data snapshot creating command to obtain a target snapshot type zone bit;
the redirection copy snapshot module is used for redirecting and copying the target data from a source volume to a target volume when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit;
and the copy-on-write snapshot module is used for copying the target data from the source volume to the target volume when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit.
In one embodiment of the present invention, the method further comprises:
the snapshot command judging module is used for judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command or not after receiving the command for creating the data snapshot of the target data and before redirecting and copying the snapshot of the target data from a source volume to a target volume or copying the snapshot of the target data from the source volume to the target volume during writing;
a snapshot type judging module, configured to respectively judge whether a snapshot type of the source volume and a snapshot type of the target volume in a previous snapshot operation are consistent with the current required snapshot type when it is determined that the command for creating a data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command;
and the prompting module is used for performing snapshot type mismatch prompting operation when the snapshot types of the source volume and the target volume in the previous snapshot operation are determined to be inconsistent with the current required snapshot type.
In a specific embodiment of the present invention, the flag bit obtaining module is specifically a module that analyzes the command to create the data snapshot to obtain a boolean-type redirected copy parameter;
the redirection copy snapshot module is used for specifically redirecting and copying the target data from the source volume to the target volume when the current required snapshot type is determined to be the redirection copy snapshot according to the redirection copy parameter;
the copy-on-write snapshot module is specifically a module that copies the snapshot from the source volume to the target volume when it is determined that the current required snapshot type is the copy-on-write snapshot according to the redirection copy parameter.
In a specific embodiment of the present invention, the redirection copy snapshot module is specifically a module that redirects and copies the target data from the source volume to the target volume when it is determined that the current required snapshot type is the redirection copy snapshot by combining the redirection copy parameter and the volume types of the source volume and the target volume.
A data snapshot device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the data snapshot method as described above when executing the computer program.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a data snapshot method as described above.
By applying the method provided by the embodiment of the invention, a command for creating the data snapshot of the target data is received, and the command for creating the data snapshot is analyzed to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing. By deploying the target snapshot type flag bit in the command for creating the data snapshot, the target snapshot type flag bit can be set to be the corresponding redirected copy snapshot or the copy-on-write snapshot according to actual business needs, so that the same product system is compatible with the redirected copy snapshot and the copy-on-write snapshot, the respective advantages of the redirected copy snapshot and the copy-on-write snapshot are fully utilized, and the data snapshot efficiency is improved.
Correspondingly, the embodiment of the invention also provides a data snapshot device, equipment and a computer readable storage medium corresponding to the data snapshot method, which have the technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of an implementation of a data snapshot method in an embodiment of the present invention;
FIG. 2 is a flow chart of another implementation of a data snapshot method in an embodiment of the present invention;
FIG. 3 is a block diagram of a data snapshot apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of a data snapshot apparatus in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the 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.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart of an implementation of a data snapshot method in an embodiment of the present invention, where the method may include the following steps:
s101: and receiving a data snapshot creating command of the target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit.
When snapshot processing needs to be performed on target data, a create data snapshot command (Map) for the target data may be sent to the snapshot processing center, and a target snapshot type flag bit may be deployed in the create data snapshot command in advance. And the snapshot processing center receives a data snapshot creating command of the target data and analyzes the data snapshot creating command to obtain a target snapshot type zone bit.
The target data can be any data needing snapshot processing.
S102: and when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume.
The target snapshot type flag bit is a flag bit for marking whether the current needed snapshot type is the redirected copy snapshot or the copy-on-write snapshot. After the target snapshot type flag bit is obtained, if the current required snapshot type is determined to be the redirected copy snapshot according to the target snapshot type flag bit, the target data can be redirected from the source volume to the target volume. Specifically, the determined target snapshot type flag bit may be added to the display snapshot related attribute command (lslcmap, list Local Map), and when the current required snapshot type is determined to be the redirected copy snapshot according to the target snapshot type flag bit returned by the display snapshot related attribute command, the target data is redirected from the source volume to the target volume.
S103: and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing.
After the target snapshot type flag bit is obtained, if the current required snapshot type is determined to be a copy-on-write snapshot according to the target snapshot type flag bit, the target data can be copied from the source volume to the target volume in the copy-on-write snapshot. Taking the above example, specifically, the determined target snapshot type flag bit may be added in the snapshot related attribute displaying command (lslcmap, list Local Map), and when it is determined that the current required snapshot type is the copy-on-write snapshot according to the target snapshot type flag bit returned by the snapshot related attribute displaying command, the target data is copied from the source volume to the target volume when the snapshot is written.
By applying the method provided by the embodiment of the invention, a command for creating the data snapshot of the target data is received, and the command for creating the data snapshot is analyzed to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing. By deploying the target snapshot type flag bit in the command for creating the data snapshot, the target snapshot type flag bit can be set to be the corresponding redirected copy snapshot or the copy-on-write snapshot according to actual business needs, so that the same product system is compatible with the redirected copy snapshot and the copy-on-write snapshot, the respective advantages of the redirected copy snapshot and the copy-on-write snapshot are fully utilized, and the data snapshot efficiency is improved.
It should be noted that, based on the first embodiment, the embodiment of the present invention further provides a corresponding improvement scheme. In the following embodiments, steps that are the same as or correspond to those in the first embodiment may be referred to each other, and corresponding advantageous effects may also be referred to each other, which are not described in detail in the following modified embodiments.
Example two:
referring to fig. 2, fig. 2 is a flowchart of another implementation of a data snapshot method in an embodiment of the present invention, where the method may include the following steps:
s201: and receiving a data snapshot creating command of the target data, and analyzing the data snapshot creating command to obtain a Boolean-type redirection copy parameter.
The target snapshot type flag bit deployed in the create data snapshot command may be specifically set to a redirect copy (row) parameter of boolean type (boolean). As shown in table 1, a specific value of a boolean type redirect copy parameter is added to the command to create a data snapshot.
TABLE 1
Figure BDA0002248413430000071
After receiving the command for creating the data snapshot of the target data, the snapshot processing center analyzes the command for creating the data snapshot, and specifically obtains the boolean redirected copy parameter.
S202: and judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command, if so, executing the step S203, and if not, directly executing the step S205 or the step S206.
After receiving the command of creating the data snapshot, the snapshot processing center can determine whether the command of creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command. The meaning of the cascading snapshot command is that the source volume in the current snapshot operation was previously performing the snapshot operation as the target volume. The meaning of the multi-target volume snapshot command is to take a snapshot of the same volume at intervals so as to record the data at different moments, and the snapshot can be used for restoring the data at a specific moment.
When it is determined that the command to create the data snapshot belongs to the cascade snapshot command or the multi-target volume snapshot command, it indicates that a volume that has previously participated in the snapshot operation exists in the source volume and the target volume involved in the current snapshot operation, in this case, step S203 may be continuously performed, and if it is determined that the command to create the data snapshot does not belong to the cascade snapshot command or the multi-target volume snapshot command, the source volume and the target volume involved in the current snapshot operation are both involved in the snapshot operation for the first time, in this case, step S205 or step S206 may be directly performed.
S203: respectively judging whether the snapshot type of the source volume and the target volume in the previous snapshot operation is consistent with the current required snapshot type, if so, executing step S205 or step S206, and if not, executing step S204.
The same copy type condition is required to be satisfied in the cascade snapshot command or the multi-target volume snapshot, that is, the snapshot types of the volumes in the participating snapshots are ensured to be consistent. When it is determined that the command for creating a data snapshot belongs to the cascade snapshot command or the multi-target volume snapshot command, it may be respectively determined whether the snapshot types of the source volume and the target volume in the previous snapshot operation are consistent with the current required snapshot type, if both are consistent, step S205 or step S206 may be performed, and if there is inconsistency, it is indicated that there is a portion in the source volume and the target volume of the current snapshot operation that is not matched with the snapshot type in the previous snapshot operation, in this case, step S204 may be performed.
S204: and carrying out snapshot type mismatch prompt operation.
After the fact that the snapshot type of the source volume and the snapshot type of the target volume in the previous snapshot operation are inconsistent with the current needed snapshot type is determined, snapshot type mismatching prompt operation can be conducted, adjustment work of subsequent snapshot operation is facilitated, and the processing progress of data snapshot operation is promoted.
S205: and when the current required snapshot type is determined to be the redirected copy snapshot by combining the redirected copy parameters and the volume types of the source volume and the target volume, redirecting and copying the target data from the source volume to the target volume.
When the snapshot processing operation is performed on the target data, the volume types of the source volume and the target volume which participate in the current snapshot operation can be considered comprehensively, and when the current required snapshot type is determined to be the redirection copy snapshot by combining the redirection copy parameter and the volume types of the source volume and the target volume, the target data is redirected from the source volume to the target volume.
Specifically, when the current snapshot type is identified as the redirected copy snapshot according to the redirected copy parameter, whether the source volume and the target volume are both thin volumes can be further determined, if both are thin volumes, the current required snapshot type is determined as the redirected copy snapshot, and the target data is redirected from the source volume to the target volume; otherwise, determining that the type of the current needed snapshot is a copy-on-write snapshot, and copying the target data from the source volume to the target volume. By considering the volume types of the source volume and the target volume, namely the simplified volume or the common volume, the method can better follow the management mode of metadata and the data storage principle of the redirected copy snapshot and the copy-on-write snapshot, and ensure the smooth operation of the data snapshot. In support of the above embodiment, as shown in table 2, the copy type adopted by the snapshot is marked according to the boolean redirect copy parameter added in the display snapshot related attribute command.
TABLE 2
Figure BDA0002248413430000091
S206: and when the type of the current needed snapshot is determined to be the copy-on-write snapshot according to the redirection copy parameter, copying the target data from the source volume to the target volume when the snapshot is written.
After obtaining the Boolean type redirection copy parameter, when determining that the current needed snapshot type is a copy-on-write snapshot according to the redirection copy parameter, copying the target data from the source volume to the target volume when writing.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a data snapshot apparatus, and the data snapshot apparatus described below and the data snapshot method described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a block diagram of a data snapshot apparatus according to an embodiment of the present invention, where the apparatus may include:
the flag bit obtaining module 31 is configured to receive a data snapshot creating command for the target data, and analyze the data snapshot creating command to obtain a target snapshot type flag bit;
a redirection copy snapshot module 32, configured to redirect and copy the target data from the source volume to the target volume when it is determined that the current required snapshot type is a redirection copy snapshot according to the target snapshot type flag bit;
and a copy-on-write snapshot module 33, configured to copy the target data from the source volume to the target volume when it is determined that the current required snapshot type is a copy-on-write snapshot according to the target snapshot type flag bit.
The device provided by the embodiment of the invention is applied to receive a command for creating the data snapshot of the target data and analyze the command for creating the data snapshot to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing. By deploying the target snapshot type flag bit in the command for creating the data snapshot, the target snapshot type flag bit can be set to be the corresponding redirected copy snapshot or the copy-on-write snapshot according to actual business needs, so that the same product system is compatible with the redirected copy snapshot and the copy-on-write snapshot, the respective advantages of the redirected copy snapshot and the copy-on-write snapshot are fully utilized, and the data snapshot efficiency is improved.
In one embodiment of the present invention, the apparatus may further include:
the snapshot command judging module is used for judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command or not after receiving the command for creating the data snapshot of the target data and before redirecting and copying the snapshot from the source volume to the target volume or copying the snapshot from the source volume to the target volume when the target data is written;
the snapshot type judging module is used for respectively judging whether the snapshot types of the source volume and the target volume in the previous snapshot operation are consistent with the current needed snapshot type when the data snapshot creating command is determined to belong to the cascade snapshot command or the multi-target volume snapshot command;
and the prompting module is used for performing snapshot type mismatch prompting operation when the snapshot types of the source volume and the target volume in the previous snapshot operation are determined to be inconsistent with the current required snapshot type.
In a specific embodiment of the present invention, the flag bit obtaining module 31 is specifically a module that analyzes the command for creating the data snapshot to obtain a boolean-type redirected copy parameter;
the redirection copy snapshot module 32 is specifically configured to redirect and copy the target data from the source volume to the target volume when it is determined that the current required snapshot type is the redirection copy snapshot according to the redirection copy parameter;
the copy-on-write snapshot module 33 is specifically a module that copies the snapshot of the target data from the source volume to the target volume when it is determined that the current required snapshot type is the copy-on-write snapshot according to the redirection copy parameter.
In one embodiment of the present invention, the redirect-copy snapshot module 32 is embodied as a module that redirects and copies the target data from the source volume to the target volume when it is determined that the current required snapshot type is the redirect-copy snapshot in combination with the redirect-copy parameters and the volume types of the source volume and the target volume.
Corresponding to the above method embodiment, referring to fig. 4, fig. 4 is a schematic diagram of a data snapshot apparatus provided in the present invention, where the apparatus may include:
a memory 41 for storing a computer program;
the processor 42, when executing the computer program stored in the memory 41, may implement the following steps:
receiving a data snapshot creating command for target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing.
For the introduction of the device provided by the present invention, please refer to the above method embodiment, which is not described herein again.
Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
receiving a data snapshot creating command for target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit; when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume; and when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when writing.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A method for data snapshot, comprising:
receiving a data snapshot creating command for target data, and analyzing the data snapshot creating command to obtain a target snapshot type zone bit;
when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume;
and when the current required snapshot type is determined to be a copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume when the snapshot is written.
2. The data snapshot method of claim 1, after receiving a create data snapshot command for target data, and prior to redirecting the copy snapshot of the target data from a source volume to a target volume or copying the snapshot of the target data from the source volume to the target volume upon writing, further comprising:
judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command;
if yes, respectively judging whether the snapshot types of the source volume and the target volume in the previous snapshot operation are consistent with the current required snapshot type;
and if not, performing snapshot type mismatch prompting operation.
3. The data snapshot method of claim 1 or 2, wherein parsing the command for creating the data snapshot to obtain a target snapshot type flag bit comprises:
analyzing the command for creating the data snapshot to obtain a Boolean-type redirection copy parameter;
when the current needed snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit, redirecting and copying the target data from the source volume to the target volume, wherein the steps of:
when the type of the current needed snapshot is determined to be the redirection copy snapshot according to the redirection copy parameters, the target data is redirected from the source volume to the target volume;
when the current needed snapshot type is determined to be a copy-on-write snapshot according to the target snapshot type flag bit, copying the target data from the source volume to the target volume in a copy-on-write snapshot manner, including:
and when the type of the current required snapshot is determined to be a copy-on-write snapshot according to the redirection copy parameter, copying the target data from the source volume to the target volume when the snapshot is written.
4. The data snapshot method of claim 3, wherein when it is determined that the current required snapshot type is a redirected copy snapshot according to the redirected copy parameter, redirecting the copy snapshot of the target data from a source volume to a target volume comprises:
and when the current required snapshot type is determined to be the redirection copy snapshot by combining the redirection copy parameter and the volume types of the source volume and the target volume, redirecting and copying the target data from the source volume to the target volume.
5. A data snapshot apparatus, comprising:
the zone bit obtaining module is used for receiving a data snapshot creating command of target data and analyzing the data snapshot creating command to obtain a target snapshot type zone bit;
the redirection copy snapshot module is used for redirecting and copying the target data from a source volume to a target volume when the current required snapshot type is determined to be the redirection copy snapshot according to the target snapshot type flag bit;
and the copy-on-write snapshot module is used for copying the target data from the source volume to the target volume when the current required snapshot type is determined to be the copy-on-write snapshot according to the target snapshot type flag bit.
6. The data snapshot apparatus of claim 5, further comprising:
the snapshot command judging module is used for judging whether the command for creating the data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command or not after receiving the command for creating the data snapshot of the target data and before redirecting and copying the snapshot of the target data from a source volume to a target volume or copying the snapshot of the target data from the source volume to the target volume during writing;
a snapshot type judging module, configured to respectively judge whether a snapshot type of the source volume and a snapshot type of the target volume in a previous snapshot operation are consistent with the current required snapshot type when it is determined that the command for creating a data snapshot belongs to a cascade snapshot command or a multi-target volume snapshot command;
and the prompting module is used for performing snapshot type mismatch prompting operation when the snapshot types of the source volume and the target volume in the previous snapshot operation are determined to be inconsistent with the current required snapshot type.
7. The data snapshot device according to claim 5 or 6, wherein the flag bit obtaining module is specifically a module that parses the command for creating the data snapshot to obtain a boolean-type redirected copy parameter;
the redirection copy snapshot module is used for specifically redirecting and copying the target data from the source volume to the target volume when the current required snapshot type is determined to be the redirection copy snapshot according to the redirection copy parameter;
the copy-on-write snapshot module is specifically a module that copies the snapshot from the source volume to the target volume when it is determined that the current required snapshot type is the copy-on-write snapshot according to the redirection copy parameter.
8. The apparatus according to claim 7, wherein the redirect-copy snapshot module is specifically a module that redirects the copy snapshot of the target data from the source volume to the target volume when it is determined that the current required snapshot type is the redirect-copy snapshot in combination with the redirect-copy parameters and the volume types of the source volume and the target volume.
9. A data snapshot apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the data snapshot method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps of the data snapshot method of any one of claims 1 to 4.
CN201911025175.7A 2019-10-25 2019-10-25 Data snapshot method, device and equipment and computer readable storage medium Withdrawn CN110750387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911025175.7A CN110750387A (en) 2019-10-25 2019-10-25 Data snapshot method, device and equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911025175.7A CN110750387A (en) 2019-10-25 2019-10-25 Data snapshot method, device and equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110750387A true CN110750387A (en) 2020-02-04

Family

ID=69280077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911025175.7A Withdrawn CN110750387A (en) 2019-10-25 2019-10-25 Data snapshot method, device and equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110750387A (en)

Similar Documents

Publication Publication Date Title
US11455276B2 (en) Method for processing snapshots and distributed block storage system
US20170212781A1 (en) Parallel execution of blockchain transactions
US20100088468A1 (en) Method for optimizing cleaning of maps in flashcopy cascades containing incremental maps
US20190129740A1 (en) Base state for thin-provisioned volumes
CN111382011B (en) File data access method and device and computer readable storage medium
CN105630779A (en) Hadoop distributed file system based small file storage method and apparatus
CN115048435A (en) Intelligent database storage method and system
JP6193406B2 (en) Serialization for differential encoding
US20160147788A1 (en) Pre-synchronization analysis between local documents and an online document management system
CN109542860B (en) Service data management method based on HDFS and terminal equipment
US9507794B2 (en) Method and apparatus for distributed processing of file
US10725877B2 (en) System, method and computer program product for performing a data protection operation
CN110941658A (en) Data export method, device, server and storage medium
CN110750387A (en) Data snapshot method, device and equipment and computer readable storage medium
WO2019072088A1 (en) File management method, file management device, electronic equipment and storage medium
CN110019086A (en) More copy read methods, equipment and storage medium based on distributed file system
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
US10922277B1 (en) Logging file system metadata changes using a single log hold per cached block of metadata
CN110597576B (en) File remark processing method and system
CN109947721B (en) Small file processing method and device
CN105138429A (en) Copy-on-write method and system of snapshots
CN107368393B (en) Method and device for storing snapshot
CN113342579A (en) Data restoration method and device
CN112417821A (en) Method and device for editing management, computer storage medium and terminal
CN112765129A (en) Method and equipment for realizing database data version management

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200204

WW01 Invention patent application withdrawn after publication