Object bucket-based snapshot method, device and system

文档序号:1755017 发布日期:2019-11-29 浏览:2次 中文

阅读说明:本技术 基于对象存储桶的快照方法、装置和系统 (Object bucket-based snapshot method, device and system ) 是由 张天旭 鲁加福 王豪迈 胥昕 于 2019-08-02 设计创作,主要内容包括:本发明公开了一种基于对象存储桶的快照方法、装置和系统。其中,该方法包括:在接收待写入的对象后,确定目标快照,其中,目标快照为最后生成的快照;为对象添加目标快照的版本信息,得到携带有版本信息的对象;将携带有版本信息的对象写入对象存储系统,并生成所述对象的元数据,其中,所述对象的元数据指示所述对象数据属于所述目标快照。本发明解决了现有技术中的对象存储领域无高性能快照方案的技术问题。(The invention discloses a snapshot method, a snapshot device and a snapshot system based on an object bucket. Wherein, the method comprises the following steps: after receiving an object to be written, determining a target snapshot, wherein the target snapshot is a snapshot generated at last; adding version information of the target snapshot to the object to obtain the object carrying the version information; writing an object carrying version information into an object storage system, and generating metadata of the object, wherein the metadata of the object indicates that the object data belongs to the target snapshot. The invention solves the technical problem that no high-performance snapshot scheme exists in the field of object storage in the prior art.)

1. a kind of Snapshot Method based on object bucket, which is characterized in that the snapshot includes: metadata and object data, Wherein, the metadata is used to record linking relationship between snapshot, the linking relationship include sub- snapshot to father's snapshot according to The relationship of relying, the object data is for recording the object for belonging to the snapshot, the Snapshot Method packet based on object bucket It includes:

After receiving object to be written, target snapshot is determined, wherein the target snapshot is the snapshot ultimately produced;

The version information that the target snapshot is added for the object obtains the object for carrying version information;

Object storage system is written into the object for carrying the version information, and generates the metadata of the object, wherein institute The metadata for stating object indicates that the object data belongs to the target snapshot.

2. the method according to claim 1, wherein the object for carrying version information write-in object is deposited Storage system, and generate the metadata of the object, comprising:

If the corresponding object data of the object is not present in the target snapshot, the object of version information will be directly carried Object storage system is written, and generates the metadata of the object;

If the corresponding object data of the existing object, uses pair for carrying the version information in the target snapshot As replacing the already present object in the object storage system, and generate the metadata of the object.

3. the method according to claim 1, wherein the method also includes:

It receives first and deletes instruction, and delete instruction according to described first and determine snapshot to be deleted, wherein described first deletes It include the identification information of snapshot to be deleted in instruction;

Judge whether the snapshot to be deleted is quoted by other snapshots;

It is to delete by the metadata token of the snapshot to be deleted if the snapshot to be deleted is quoted by other snapshots;

If the snapshot to be deleted is not quoted by other snapshots, the metadata and number of objects of the snapshot to be deleted are deleted According to.

4. according to the method described in claim 3, its feature is being, if the snapshot to be deleted is illuminated the way fastly by other With, then after being to delete by the metadata token of the snapshot to be deleted, the method also includes:

Father's snapshot of the sub- snapshot of the snapshot to be deleted is changed to father's snapshot of the snapshot to be deleted.

5. the method according to claim 1, wherein the method also includes:

Receive second deleting instruction, wherein the second deleting instruction is for deleting the object to be deleted for belonging to any snapshot;

Judge former snapshot belonging to the object to be deleted whether cited in other snapshots;

If the original snapshot adds institute in the invisible list object of the object to be deleted cited in other snapshots State former snapshot;

If the original snapshot not cited in other snapshots, deletes the object data of object to be deleted in the former snapshot.

6. the method according to claim 1, wherein the method also includes:

Receive rollback instruction, wherein the rollback instruction includes the mark of the purpose snapshot to rollback;

Creation rollback snapshot is instructed according to the rollback, and determines that the rollback snapshot is the sub- snapshot of the purpose snapshot.

7. according to the method described in claim 6, it is characterized in that, creating new snapshot according to rollback instruction, and really Surely after the new snapshot created is the sub- snapshot of the purpose snapshot, the method also includes:

The creation for creating snapshot is received to instruct;

Whether detect in the rollback snapshot has object;

If deleting the rollback snapshot without object in the rollback snapshot, and with the non-rollback snapshot that is newly created for father Snapshot creates sub- snapshot;

It is that father's snapshot creates sub- snapshot with the rollback snapshot if having object in the rollback snapshot.

8. the method according to claim 1, wherein the method also includes:

Detect the creation time with two sub- snapshots of identical father's snapshot;

If the creation time of described two sub- snapshots is less than preset time threshold, described two sub- snapshots are merged, And by described two sub- snapshots labeled as deleting, wherein disconnect wherein any one sub- snapshot and father's snapshot links pass System, and will be switched off being connected to another sub- snapshot with the sub- snapshot of the linking relationship of father's snapshot.

9. a kind of fast photographing device based on object bucket, which is characterized in that the snapshot includes: metadata and object data, Wherein, the metadata is used to record linking relationship between snapshot, the linking relationship include sub- snapshot to father's snapshot according to The relationship of relying, the object data is for recording the object for belonging to the snapshot, the fast photographing device packet based on object bucket It includes:

Determining module, for determining target snapshot after receiving object to be written, wherein the target snapshot is last raw At snapshot;

Adding module obtains pair for carrying version information for adding the version information of the target snapshot for the object As;

Writing module, object storage system is written in the object for that will carry the version information, and generates the object Metadata, wherein the metadata of the object indicates that the object data belongs to the target snapshot.

10. a kind of fast photographic system based on object bucket, which is characterized in that the system comprises the objects for storage object Storage system and at least one snapshot, at least one described snapshot include:

Metadata, for recording the linking relationship between snapshot, the linking relationship includes that sub- snapshot closes the dependence of father's snapshot System;

Object data, for recording the object for belonging to the snapshot.

11. system according to claim 10, which is characterized in that the metadata includes: father's snapshot identification, the fast sighting target of son Know the mark with deleted father's snapshot.

12. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment perform claim require any one of 1 to 8 described in based on the fast of object bucket According to method.

13. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run Benefit require any one of 1 to 8 described in the Snapshot Method based on object bucket.

Technical field

The present invention relates to field of data storage, in particular to a kind of Snapshot Method based on object bucket, device And system.

Background technique

For snapshot for referring to a completely available copy about specified data acquisition system, which includes corresponding data at some The image at time point (time point that copy starts).Fig. 1 a is the schematic diagram of snapping technique in the prior art, as shown in connection with fig. 1, Direction along the time axis, brief snapshot operation may include: data write-in, creation snapshot T1, modification data, be rolled back to T1 Deng.

The implementation of snapshot mainly includes the following two kinds at present, and one is Copy on write, as COW (Copy On Write), second is that writing redirection, as ROW (Redirect On Write).Fig. 1 b is the schematic diagram of COW, in conjunction with Fig. 1 b institute Show, after creating snapshot, during write operation, if the data of source book are changed, fast photographic system can first will be original (see the step 1) of Fig. 1 b, then source book is rewritten (see Fig. 1 b's again in corresponding data block in data copy to snapped volume Step 2).In the operating process, one 2 times of write operation is at least caused to write amplification.During read operation, if necessary to read Data in snapshot, then directly from snapshot read (see the step 3) of Fig. 1 b.Fig. 1 c is the schematic diagram that ROW reads data, figure 1d is the schematic diagram that ROW deletes data, and shown in set Fig. 1 c and 1d, in ROW model, delta file is written in snapshot 's.At the time of reading from snapshot reads incremental portion, unmodified part is read in source, it has been combined by the data segment (volume) in the two regions Whole target data.

During the deletion of ROW model, due to containing increment information in snapshot, and the incremental data has uniquely Property, therefore when deletion snapshot, it needs to carry out data backfill (as shown in Figure 1 d, the data B in snapshot is backfilled in source book), causes Secondary write operation.

It can be seen that either Copy on write (COW) still writes redirection (ROW) and all there is respective disadvantage, but can not It avoids being copied, if COW mode will carry out data copy when creating snapshot, ROW mode will carry out data when deleting and copy Shellfish so that writing speed, reading speed or delete speed it is lower, therefore cause so that snapshot there are degraded performances.

Data Migration is all referred to for snapshot scheme in the prior art, so that writing speed, reading speed or deletion Speed is lower, causes so that snapshot has degraded performance, currently no effective solution has been proposed.

Summary of the invention

The embodiment of the invention provides a kind of Snapshot Methods based on object bucket, device and system, at least to solve The technical issues of object field of storage in the prior art is without high-performance snapshot scheme.

According to an aspect of an embodiment of the present invention, a kind of Snapshot Method based on object bucket, snapshot packet are provided It includes: metadata and object data, wherein metadata is used to record the linking relationship between snapshot, and linking relationship includes sub- snapshot To the dependence of father's snapshot, object data is for recording the object for belonging to snapshot, the Snapshot Method packet based on object bucket It includes: after receiving object to be written, determining target snapshot, wherein target snapshot is the snapshot ultimately produced;For object addition The version information of target snapshot obtains the object for carrying version information;The object for carrying version information write-in object is deposited Storage system, and generate the metadata of object, wherein the metadata instruction object data of object belongs to target snapshot.

Further, if the corresponding object data of object is not present in target snapshot, version information will directly be carried Object object storage system is written, and generate the metadata of object;If the corresponding object of existing object in target snapshot Data replace already present object in object storage system using the object for carrying version information, and generate first number of object According to.

Further, the above method further include: receive first and delete instruction, and deleted according to first and instruct determination to be deleted Snapshot, wherein first delete instruction in include snapshot to be deleted identification information;Judge snapshot to be deleted whether by other Snapshot reference;If snapshot to be deleted is quoted by other snapshots, the metadata of snapshot to be deleted is deleted, is retained to be deleted fast According to object data;It is to delete by the metadata token of snapshot to be deleted if snapshot to be deleted is quoted by other snapshots.

Further, if snapshot to be deleted is quoted by other snapshots, by the metadata token of snapshot to be deleted After deleting, father's snapshot of the sub- snapshot of snapshot to be deleted is changed to father's snapshot of snapshot to be deleted.

Further, the above method further include: receive second deleting instruction, wherein second deleting instruction belongs to for deleting In the object to be deleted of any snapshot;Judge former snapshot belonging to object to be deleted whether cited in other snapshots;If former Snapshot adds former snapshot cited in other snapshots, then in the invisible list object of object to be deleted;If former snapshot is not Cited in other snapshots, then the object data of object to be deleted in former snapshot is deleted.

Further, the above method further include: receive rollback instruction, wherein rollback instruction include to rollback purpose it is fast According to mark;Creation rollback snapshot is instructed according to rollback, and determines that rollback snapshot is the sub- snapshot of purpose snapshot.

Further, new snapshot is being created according to rollback instruction, and is determining that the new snapshot of creation is purpose snapshot After sub- snapshot, receives the creation for creating snapshot and instruct;Whether there is object in detection rollback snapshot;If in rollback snapshot Without object, then rollback snapshot is deleted, and is that father's snapshot creates sub- snapshot with the non-rollback snapshot being newly created;If rollback snapshot In have object, then be that father's snapshot creates sub- snapshot with rollback snapshot.

Further, the above method further include: detect the creation time with two sub- snapshots of identical father's snapshot;If The creation time of two sub- snapshots is less than preset time threshold, then merges to two sub- snapshots, and by two fast sighting targets of son It is denoted as deletion, wherein disconnect the linking relationship of wherein any one sub- snapshot and father's snapshot, and will be switched off linking with father's snapshot The sub- snapshot of relationship is connected to another sub- snapshot

According to an aspect of an embodiment of the present invention, a kind of fast photographing device based on object bucket, snapshot packet are provided It includes: metadata and object data, wherein metadata is used to record the linking relationship between snapshot, and linking relationship includes sub- snapshot To the dependence of father's snapshot, object data is for recording the object for belonging to snapshot, the fast photographing device packet based on object bucket Include: determining module, for determining target snapshot after receiving object to be written, wherein target snapshot be ultimately produce it is fast According to;Adding module obtains the object for carrying version information for adding the version information of target snapshot for object;Mould is written Block, object storage system is written in the object for that will carry version information, and generates the metadata of object, wherein object Metadata instruction object data belongs to target snapshot.

According to an aspect of an embodiment of the present invention, a kind of fast photographic system based on object bucket, system packet are provided The object storage system and at least one snapshot for storage object are included, at least one snapshot includes: metadata, fast for recording Linking relationship according between, linking relationship include dependence of the sub- snapshot to father's snapshot;Object data belongs to fastly for recording According to object.

Further, above-mentioned metadata includes: the mark of father's snapshot identification, sub- snapshot identification and deleted father's snapshot.

According to an aspect of an embodiment of the present invention, a kind of storage medium is provided, storage medium includes the program of storage, Wherein, when program is run, equipment where control storage medium executes the above-mentioned Snapshot Method based on object bucket.

According to an aspect of an embodiment of the present invention, a kind of processor is provided, processor is for running program, wherein The perform claim above-mentioned Snapshot Method based on object bucket when program is run.

The embodiment of the present invention increases version information on the basis of ROW, to the object name of upload objects all under snapshot, comes Progress object data is associated with snapshot, so that operation all after creation snapshot can carry version information at one Object on carry out.That is, all data are all independent portions under each snapshot, all associations to the snapshot version This.Above scheme also increases SNAPSHOT INFO the data structure of father's snapshot and sub- snapshot, so that reading some snapshot letter When breath, splicing threading is carried out according to the linking relationship between snapshot, can therefrom extract each newest object in link, is realized In the zero-copy bucket snapshot of object field of storage.By the ability, so that the space utilization of system maximizes, without any true Real data copy, same data can only store portion, and data never need to migrate back and forth, and then solve the prior art In object field of storage without high-performance snapshot scheme the technical issues of.

Detailed description of the invention

The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:

Fig. 1 a is the schematic diagram of snapping technique in the prior art;

Fig. 1 b is the schematic diagram of COW;

Fig. 1 c is the schematic diagram that ROW reads data;

Fig. 1 d is the schematic diagram that ROW deletes data;

Fig. 2 is a kind of flow chart of Snapshot Method based on object bucket according to an embodiment of the present invention;

Fig. 3 is a kind of schematic diagram of storage organization according to an embodiment of the present invention;

Fig. 4 is a kind of schematic diagram for deleting snapshot according to an embodiment of the present invention;

Fig. 5 is a kind of schematic diagram for deleting object according to an embodiment of the present invention;

Fig. 6 is that seed snapshot according to an embodiment of the present invention counts the schematic diagram being not zero;

Fig. 7 is a kind of schematic diagram of the visibility status of object OBJ according to an embodiment of the present invention;

Fig. 8 is a kind of schematic diagram of tree-shaped relationship according to an embodiment of the present invention;

Fig. 9 is the schematic diagram of a kind of creation snapshot according to an embodiment of the present invention and upload object;

Figure 10 is the schematic diagram that T2 is rolled back on the basis of Fig. 9;

Figure 11 is the schematic diagram of the upload object data in rollback snapshot;

Figure 12 is a kind of schematic diagram that snapshot is created after rollback snapshot according to an embodiment of the present invention;

Figure 13 is another schematic diagram that snapshot is created after rollback snapshot according to an embodiment of the present invention;

Figure 14 is the schematic diagram of the first list object according to embodiments of the present invention;

Figure 15 is the schematic diagram of the first fast photographing device based on object bucket according to embodiments of the present invention.

In the following, in order to make it easy to understand, carrying out description below explanation to the technical term that the application occurs:

Store snapshot: about a completely available copy of specified data set sum, which includes corresponding data at some The image at time point (time point that copy starts).Snapshot can be a copy of the data represented by it, be also possible to count According to a duplicate.

Bucket snapshot: Bucket Snapshot, the purpose of bucket be in object storage system object carry out logic every From, bucket snapshot is a completely available copy for total data and index set generation to the target bucket a certain moment, It can restore the ability of the target bucket time point of creation (snapshot) corresponding total data at some time point by the copy.

Snapshot bucket: Snapshot Bucket enables the object bucket (container) of bucket snapshot functions.

Snapshot rollback: Snapshot Rollback, snapshot rollback, which is commonly applied to data exception, faulty operation and business, to be needed The scene for needing data-backoff such as seek.Whole metadata and object data after rollback will be updated to the shape of snapshot creation time point The purpose of state, behaviour group is to provide the ability of data backtracking.Any upload, deletion can be implemented to any object in this state Deng operation and new snapshot can be created save current state and be rolled back to any snapshot version herein.

It is visual: Visual, to any object created under snapshot bucket, with whether visually come characterize the object can be at certain It is shown under one snapshot.Visibility status characterization object whether there is under some snapshot state and how exist.

Object version: Object Version distinguishes in difference the object uploaded into bucket with different versions Period creation/update object of the same name.The upload of object can get pair of a matching snapshot version under each snapshot As version.Object version is distinguished by prefix/infix/suffix.In the case where not creating new snapshot, object updates operation and contains use There is the new object of same version identifier to be updated rather than generates the object of a new version.In other words, under each snapshot Whole objects can all have an exclusive version, such as T1_ object A, T2_ object A, T3_ object A.

Read-only materialized view: read-only Snapshot, logic are return back under a certain target snapshot version.Under the state, under Carry object obtain by be target snapshot version contents of object.

Bucket snapshot list object: it is clear to obtain object visual under target snapshot by Bucket Snapshot Object List It is single.

Specific embodiment

In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.

It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据存储的方法及终端设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类