[go: up one dir, main page]

CN100565530C - A kind of snapshot system and using method thereof - Google Patents

A kind of snapshot system and using method thereof Download PDF

Info

Publication number
CN100565530C
CN100565530C CNB200710179711XA CN200710179711A CN100565530C CN 100565530 C CN100565530 C CN 100565530C CN B200710179711X A CNB200710179711X A CN B200710179711XA CN 200710179711 A CN200710179711 A CN 200710179711A CN 100565530 C CN100565530 C CN 100565530C
Authority
CN
China
Prior art keywords
snapshot
data
bitmap
value
source
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.)
Expired - Fee Related
Application number
CNB200710179711XA
Other languages
Chinese (zh)
Other versions
CN101183383A (en
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.)
Beijing Zhongke Blue Whale Information Technology Co ltd
Tianjin Zhongke Bluewhale Information Technology Co ltd
Original Assignee
Institute of Computing Technology of CAS
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 Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CNB200710179711XA priority Critical patent/CN100565530C/en
Publication of CN101183383A publication Critical patent/CN101183383A/en
Application granted granted Critical
Publication of CN100565530C publication Critical patent/CN100565530C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供一种快照系统,包括设备管理工具集、快照实现模块以及物理设备;所述的快照实现模块包括用于数据查找和时间点管理的快照机制层,以及用于对所述的物理设备进行分配和回收管理的物理资源管理层,所述的快照机制层中包含有至少一个快照组,不同快照组可采用不同的快照技术;所述的物理资源管理层中包含有与所述的快照组对应的元数据设备与数据设备。本发明可同时支持COW和ROW两种快照技术,用户可根据实际需求,灵活地进行选择。

Figure 200710179711

The present invention provides a snapshot system, which includes a device management tool set, a snapshot implementation module, and a physical device; the snapshot implementation module includes a snapshot mechanism layer for data search and time point management, and is used for the physical device A physical resource management layer for allocation and reclaim management, the snapshot mechanism layer includes at least one snapshot group, and different snapshot groups can use different snapshot technologies; the physical resource management layer contains The metadata device and data device corresponding to the group. The present invention can simultaneously support two snapshot technologies of COW and ROW, and users can choose flexibly according to actual needs.

Figure 200710179711

Description

一种快照系统及其使用方法 A kind of snapshot system and using method thereof

技术领域 technical field

本发明涉及数据保护领域,是一种快照系统及其使用方法。The invention relates to the field of data protection, and relates to a snapshot system and a using method thereof.

背景技术 Background technique

快照是对源数据生成的一个静态集,它在数据备份、数据挖掘等领域得到了广泛应用。快照按照不同的实现技术可以分为:分离镜像(SplitMirror)、写时拷贝(COW:Copy On Write)、写时重定向(ROW:Redirect onWrite)和随处写(WA:Write Anywhere)。目前后三类技术是主流的快照技术,其中ROW和WA技术基本一致,只是在数据的组织上不同。ROW采用了一块与数据空间隔离的,用于存放快照数据的快照空间,当源数据更新时,新数据写入到快照空间。WA没有预留快照空间,快照数据与源数据共用同一块物理空间,混合存放。不同的快照实现技术,在不同的应用负载下,性能差异很大。例如:对于以写操作为主的应用,如联机事务处理(OLTP)应用,ROW与WA快照技术由于其较好的写性能会取得比COW快照技术更好的性能。而对于以读操作为主的应用,如决策支持系统(DSS)应用,COW快照技术具有更好的性能,这是因为COW快照技术不打乱源数据的顺序性,在读源数据时性能不受快照的影响,而ROW和WA快照技术会造成源数据分散,打乱源数据的顺序性,在读操作时可能会面临大量的读合并操作,导致性能较低。Snapshot is a static set generated for source data, which is widely used in data backup, data mining and other fields. According to different implementation technologies, snapshots can be divided into: split mirror (SplitMirror), copy on write (COW: Copy On Write), redirect on write (ROW: Redirect onWrite) and write anywhere (WA: Write Anywhere). At present, the latter three types of technologies are the mainstream snapshot technologies, among which ROW and WA technologies are basically the same, but differ in the organization of data. ROW uses a snapshot space that is isolated from the data space and is used to store snapshot data. When the source data is updated, new data is written to the snapshot space. WA does not reserve snapshot space, and snapshot data and source data share the same physical space and are stored together. The performance of different snapshot implementation technologies varies greatly under different application loads. For example, for applications that mainly focus on write operations, such as online transaction processing (OLTP) applications, the ROW and WA snapshot technologies will achieve better performance than the COW snapshot technology due to their better write performance. For applications that mainly read operations, such as decision support system (DSS) applications, COW snapshot technology has better performance, because COW snapshot technology does not disrupt the sequence of source data, and the performance is not affected when reading source data. The impact of snapshots, while ROW and WA snapshot technologies will cause source data to be scattered and disrupt the sequence of source data, and may face a large number of read merge operations during read operations, resulting in low performance.

现有的快照产品与原型系统是针对特定应用而设计,在某一个特定的快照产品或原型系统中通常采用单一技术实现,例如,IBM ESS FlashCopy只采用了COW技术,而多伦多大学的Clotho系统则采用了WA技术。这些系统针对特定应用具有良好的工作性能。但随着服务整合和虚拟存储系统的广泛应用,存储的应用模式发生显著变化。多种不同类型的应用并发运行在同一个存储平台上,现有技术中一个快照系统只采用一种快照实现技术很可能会带来快照操作实现效率低、系统性能不佳的缺陷。Existing snapshot products and prototype systems are designed for specific applications, and a specific snapshot product or prototype system is usually implemented using a single technology. For example, IBM ESS FlashCopy only uses COW technology, while the Clotho system of the University of Toronto uses Using WA technology. These systems work well for specific applications. However, with the wide application of service integration and virtual storage systems, the application mode of storage has changed significantly. Many different types of applications run concurrently on the same storage platform. In the prior art, a snapshot system only adopts one snapshot implementation technology, which is likely to bring defects of low snapshot operation implementation efficiency and poor system performance.

发明内容 Contents of the invention

因此,本发明的目的是克服现有的快照产品所采用的快照技术单一,不具有通用性的缺陷,从而提供一种能够同时支持COW和ROW两种快照技术的快照系统。Therefore, the object of the present invention is to overcome the defect that the snapshot technology adopted by the existing snapshot products is single and not universal, so as to provide a snapshot system capable of simultaneously supporting both COW and ROW snapshot technologies.

为了实现上述目的,本发明提供了一种快照系统,包括设备管理工具集、快照实现模块以及物理设备;其特征在于,所述的快照实现模块包括用于数据查找和时间点管理的快照机制层,以及用于对所述的物理设备进行分配和回收管理的物理资源管理层,所述的快照机制层中包含有至少一个快照组,不同快照组可采用不同的快照技术;所述的物理资源管理层中包含有与所述的快照组对应的元数据设备与数据设备。In order to achieve the above object, the present invention provides a snapshot system, including a device management tool set, a snapshot implementation module, and a physical device; it is characterized in that, the snapshot implementation module includes a snapshot mechanism layer for data search and time point management , and a physical resource management layer for allocation and reclaim management of the physical device, the snapshot mechanism layer includes at least one snapshot group, and different snapshot groups can adopt different snapshot technologies; the physical resources The management layer includes metadata devices and data devices corresponding to the snapshot group.

上述技术方案中,在所述的快照组中,所采用的快照技术为写时拷贝技术或写时重定向技术。In the above technical solution, in the snapshot group, the adopted snapshot technology is copy-on-write technology or redirect-on-write technology.

上述技术方案中,所述元数据设备中存放元数据,所述的元数据用于指示数据的增量以及所述快照组的快照版本中的数据在所述数据设备上的存放位置;所述元数据采用位图或映射表的形式进行记录。In the above technical solution, metadata is stored in the metadata device, and the metadata is used to indicate the increment of data and the storage location of the data in the snapshot version of the snapshot group on the data device; the Metadata is recorded in the form of bitmaps or maps.

上述技术方案中,所述位图采用多级的结构划分,上一级位图某一位的值为1用于表示对应的下一级位图中存在值为1的位,若为0,则表示对应的下一级位图中不存在值为1的位;在最低级的位图上,某一位的值为1用于表示对应数据块上的数据发生变化,若为0,则对应数据块上的数据不发生变化。In the above technical solution, the bitmap is divided into multi-level structures, and the value of a certain bit in the upper-level bitmap is 1 to indicate that there is a bit with a value of 1 in the corresponding lower-level bitmap. If it is 0, It means that there is no bit with a value of 1 in the corresponding next-level bitmap; on the lowest-level bitmap, a bit with a value of 1 is used to indicate that the data on the corresponding data block has changed. If it is 0, then The data on the corresponding data block does not change.

上述技术方案中,所有的快照组采用相同的内存结构,具有四个指针:包括用于对应读操作时需要访问的物理设备r0,r1指针,以及用于对应写操作时需要访问的物理设备的w0、w1指针。In the above technical solution, all the snapshot groups use the same memory structure and have four pointers: including the physical device r0 and r1 pointers that need to be accessed when corresponding to the read operation, and the physical device that needs to be accessed when corresponding to the write operation. w0, w1 pointers.

上述技术方案中,所述的快照组中,在一定的时间点有相应的快照设备,各个时间点的快照设备间采用链式结构进行组织。In the above technical solution, in the snapshot group, there is a corresponding snapshot device at a certain time point, and the snapshot devices at each time point are organized in a chain structure.

本发明还提供了一种对所述的快照系统的使用方法,包括以下步骤:The present invention also provides a method for using the snapshot system, comprising the following steps:

步骤1)、用户通过所述的设备管理工具集发布创建快照的命令,并在所述的命令中决定选择何种快照技术创建快照;Step 1), the user issues a command to create a snapshot through the device management tool set, and decides which snapshot technology to choose to create a snapshot in the command;

步骤2)、所述的快照实现模块中的快照机制层根据步骤1)中所选择的快照技术创建快照;Step 2), the snapshot mechanism layer in the snapshot implementation module creates a snapshot according to the snapshot technology selected in step 1);

步骤3)、根据用户的需求,对快照做相关的操作,所述的操作包括对快照的读、写以及删除。Step 3), perform relevant operations on the snapshot according to user requirements, and the operations include reading, writing and deleting the snapshot.

上述技术方案中,在所述的步骤2)中,所述的创建快照还包括下列步骤:In the above-mentioned technical solution, in the described step 2), the described creation of the snapshot also includes the following steps:

步骤2-1-1)、创建一个源设备,将所述源设备的所有快照关系指针都指向源设备的物理设备;Step 2-1-1), create a source device, point all the snapshot relationship pointers of the source device to the physical device of the source device;

步骤2-1-2)、在后续的时间点创建快照,并在快照集链表中插入所创建的快照。Step 2-1-2), creating a snapshot at a subsequent point in time, and inserting the created snapshot into the snapshot set linked list.

上述技术方案中,若创建快照时采用写时拷贝技术,则所述的在快照集链表中插入所创建的快照时,将所述源设备的w0指针指向新创建的快照设备,将新创建的快照设备的r0指针指向所述的源设备,若所述快照集链表中还存在时间点更早的快照设备,则将与新创建的快照设备相比时间点更早且时间最接近的快照设备的r0指针指向新创建的快照设备。In the above technical solution, if the copy-on-write technology is used when creating a snapshot, then when inserting the created snapshot into the snapshot set linked list, the w0 pointer of the source device is pointed to the newly created snapshot device, and the newly created The r0 pointer of the snapshot device points to the source device. If there is a snapshot device with an earlier time point in the snapshot set linked list, the snapshot device with an earlier time point and the closest time point will be compared with the newly created snapshot device The r0 pointer points to the newly created snapshot device.

上述技术方案中,若创建快照时采用写时重定向技术,则所述的在快照集链表中插入所创建的快照时,将所述源设备的r0指针指向新创建的快照设备,将所述新创建的快照设备的r0指针指向时间点更早且时间最接近的快照设备;若所述快照集链表中不存在时间点更早的快照设备,则所述新创建的快照设备的r0指针指向零设备。In the above technical solution, if redirection-on-write technology is used when creating a snapshot, when inserting the created snapshot into the snapshot set linked list, the r0 pointer of the source device is pointed to the newly created snapshot device, and the The r0 pointer of the newly created snapshot device points to the snapshot device with an earlier time point and the closest time point; if there is no snapshot device with an earlier time point in the snapshot set linked list, the r0 pointer of the newly created snapshot device points to Zero equipment.

上述技术方案中,在所述的步骤3)中,所述的读取快照中的数据包括对源设备中数据的读取和对快照设备中数据的读取。In the above technical solution, in step 3), the reading of the data in the snapshot includes reading the data in the source device and reading the data in the snapshot device.

上述技术方案中,所述的对源设备中数据的读取还包括以下步骤:In the above technical solution, the reading of the data in the source device also includes the following steps:

步骤3-1-1)、根据所要读取数据的地址在所述位图中查询相应的位,若该位的值为1,则直接在本地读取,并返回所读取的数据值,若该位的值为0,则执行下一步;Step 3-1-1), query the corresponding bit in the bitmap according to the address of the data to be read, if the value of the bit is 1, then directly read locally, and return the read data value, If the value of this bit is 0, execute the next step;

步骤3-1-2)、判断源设备中的数据是否存在相应的快照,若不存在快照,则返回全零数据,若存在快照,则根据快照集链表将读数据请求进行转发,通过对快照数据的读取完成所述的数据读取过程。Step 3-1-2), determine whether there is a corresponding snapshot for the data in the source device, if there is no snapshot, then return all zero data, if there is a snapshot, forward the read data request according to the snapshot set linked list, pass the snapshot The data reading completes the data reading process.

上述技术方案中,所述的判断源设备中的数据是否存在相应的快照时,若所述源设备中的r0指针指向的是物理设备,则不存在快照;若所述源设备中的r0指针指向的是逻辑设备,则存在快照。In the above technical solution, when judging whether there is a corresponding snapshot for the data in the source device, if the r0 pointer in the source device points to a physical device, there is no snapshot; if the r0 pointer in the source device points to a logical device, there is a snapshot.

上述技术方案中,当所述快照采用写时拷贝技术创建时,步骤3)还包括以下步骤,用于对该快照的数据读取:In the above technical solution, when the snapshot is created using the copy-on-write technology, step 3) further includes the following steps for reading data from the snapshot:

步骤3-2-1)、根据位图的值确定数据存放的物理设备,在确定过程中,从快照集链表的尾部向前遍历,如果在某一快照Sk上的位图值为1,则在其前一快照Sk-1的数据设备上读取数据,若位图值为0,则将读数据请求沿着快照集链表转发到前一快照上,直至找到位图值为1的快照;Step 3-2-1), determine the physical device where the data is stored according to the value of the bitmap, during the determination process, traverse forward from the tail of the snapshot set linked list, if the bitmap value on a certain snapshot S k is 1, Then read data on the data device of its previous snapshot S k-1 , if the bitmap value is 0, then forward the read data request to the previous snapshot along the snapshot set linked list until the bitmap value of 1 is found snapshot;

步骤3-2-2)、若在快照集链表的快照中没有找到位图值为1的快照,读数据请求到达源设备,若源设备的位图值为1时,在与源设备相邻快照的数据设备上读取数据,否则在源的数据设备上读取数据;Step 3-2-2), if no snapshot with a bitmap value of 1 is found in the snapshots of the snapshot set linked list, the read data request reaches the source device. If the bitmap value of the source device is 1, it is adjacent to the source device Read data on the data device of the snapshot, otherwise read data on the source data device;

当所述快照采用写时重定向技术创建时,步骤3)还包括以下步骤,用于对该快照的数据读取:When the snapshot is created using redirection-on-write technology, step 3) also includes the following steps for reading data from the snapshot:

首先根据位图的值确定数据存放的物理设备,然后从数据所存放的物理设备上读取数据;其中,在确定数据存放的物理设备时,从快照集链表的尾部向前遍历,若在某一快照Sk上的位图值为1,则在本地的数据设备上读取,并返回相应的数据,若位图值为0,则判断当前快照是否为快照集链表中最老的快照,即是否是快照链表尾端的快照,若是,则返回全0,否则将读数据请求转发到快照链表中的前一快照中。First, determine the physical device where the data is stored according to the value of the bitmap, and then read the data from the physical device where the data is stored; when determining the physical device where the data is stored, it traverses forward from the tail of the snapshot set linked list. A bitmap value on the snapshot S k is 1, then read on the local data device, and return corresponding data, if the bitmap value is 0, then judge whether the current snapshot is the oldest snapshot in the snapshot set linked list, That is, whether it is a snapshot at the end of the snapshot linked list, if so, return all 0, otherwise, forward the read data request to the previous snapshot in the snapshot linked list.

上述技术方案中,如果在快照中完成写数据操作,在所述的步骤3)中还包括以下步骤:In the above technical solution, if the write data operation is completed in the snapshot, the step 3) also includes the following steps:

首先,根据位图的值确定数据存放的物理设备;然后在所确定的物理设备中写入数据。First, determine the physical device where the data is stored according to the value of the bitmap; then write data in the determined physical device.

上述技术方案中,当所述快照采用写时拷贝技术创建时,步骤3)还包括以下步骤,用于对快照数据的写:In the above technical solution, when the snapshot is created using copy-on-write technology, step 3) also includes the following steps for writing the snapshot data:

对位图值进行判断,若位图值为1,则直接写入源的物理设备中;如果位图值为0,则在完成写时拷贝操作后再写入源的物理设备中。Judge the bitmap value, if the bitmap value is 1, write it directly into the source physical device; if the bitmap value is 0, write it into the source physical device after the copy-on-write operation is completed.

上述技术方案中,当所述快照采用写时重定向技术创建时,步骤3)还包括以下步骤,用于对快照数据的写:In the above technical solution, when the snapshot is created using redirection-on-write technology, step 3) also includes the following steps for writing the snapshot data:

对位图值进行判断,如果位图值为1,则直接写入源的物理设备中;如果位图值为0,进行数据块的数据合并后再写入源的物理设备中。The bitmap value is judged, if the bitmap value is 1, it is directly written into the source physical device; if the bitmap value is 0, the data of the data block is merged and then written into the source physical device.

上述技术方案中,在所述的步骤3)中,当所述快照采用写时拷贝技术时,在删除快照的过程中,只能删除时间点最早的快照。In the above technical solution, in step 3), when the snapshot adopts the copy-on-write technology, only the snapshot with the earliest time point can be deleted during the process of deleting the snapshot.

上述技术方案中,在所述的步骤3)中,当所述快照采用写时重定向技术时,在对所要删除的快照做删除操作前,对删除快照所要触发的数据进行合并。In the above technical solution, in step 3), when the snapshot adopts redirection-on-write technology, the data to be triggered by deletion of the snapshot is merged before the delete operation is performed on the snapshot to be deleted.

上述技术方案中,所述的数据合并包括以下步骤:In the above technical solution, the data merging includes the following steps:

步骤3-3-1)、依次读取快照设备S2中每个数据块在位图中的对应位;其中,S2是要删除的快照设备S1的相邻快照设备;Step 3-3-1), sequentially read the corresponding bit of each data block in the snapshot device S2 in the bitmap; wherein, S2 is the adjacent snapshot device of the snapshot device S1 to be deleted;

步骤3-3-2)、将快照设备S2中的位图位与快照设备S 1的相应位图位进行组合,可得到四种情况:Step 3-3-2), the bitmap bit in the snapshot device S2 is combined with the corresponding bitmap bit of the snapshot device S1, four situations can be obtained:

S2      S1S2 S1

a、0    0a.0 0

b、0    1b. 0 1

c、1    0c, 1 0

d、1    1d, 1 1

当S2的位图位为1时,表示有新数据写过,因此在数据合并时只需要将S2的位图位为1的数据块拷贝回S1的数据设备上;When the bitmap bit of S2 is 1, it means that new data has been written, so only the data block whose bitmap bit of S2 is 1 needs to be copied back to the data device of S1 during data merging;

步骤3-3-3)、执行数据回移操作,将S2的数据设备中的数据拷贝到S1的数据设备上;Step 3-3-3), execute the data move back operation, copy the data in the data device of S2 to the data device of S1;

步骤3-3-4)、数据回移结束后,置S2的位图相应位为0;Step 3-3-4), after the data transfer is completed, set the corresponding bit of the bitmap of S2 to be 0;

步骤3-3-5)、如果所有数据块处理完,结束数据合并操作,否则重新执行步骤3-3-1),继续处理下一个数据块。Step 3-3-5), if all data blocks have been processed, end the data merging operation, otherwise re-execute step 3-3-1), and continue to process the next data block.

本发明的优点在于:The advantages of the present invention are:

1、本发明的通用快照系统可同时支持COW和ROW两种快照技术,用户可根据实际需求,灵活地进行选择,为不同应用提供最佳支持。1. The general snapshot system of the present invention can support two snapshot technologies of COW and ROW at the same time, and users can flexibly choose according to actual needs, so as to provide optimal support for different applications.

2、本发明在支持COW和ROW只读快照设备的同时,提供了可写快照支持,拓展了快照技术在服务部署、电子教室等新领域的应用。2. While supporting COW and ROW read-only snapshot devices, the present invention provides writable snapshot support, expanding the application of snapshot technology in new fields such as service deployment and electronic classrooms.

3、本发明采用了链式设备组织结构,某一个具体时间点上,数据只需要在数据设备上保存一份,不随快照个数增加而增加,而在星型结构的COW方式中,存储资源的使用随着快照设备个数的增加而线性增加,因此本发明可以有效节约存储空间3. The present invention adopts a chained device organization structure. At a specific time point, only one copy of data needs to be saved on the data device, which does not increase with the increase in the number of snapshots. In the COW mode of the star structure, storage resources The usage of the snapshot device increases linearly with the increase of the number of snapshot devices, so the present invention can effectively save storage space

4、本发明采用了链式设备组织结构和元数据设备与数据设备分离结构,在性能和容量上具有很好的扩展性。4. The present invention adopts a chained device organization structure and a separation structure between metadata devices and data devices, and has good scalability in terms of performance and capacity.

5、本发明采用独立设备存放元数据,不在数据设备上预留空间,避免了预留空间过大或过小的缺陷,系统规模不受元数据预留区容量的限制。5. The present invention uses an independent device to store metadata and does not reserve space on the data device, avoiding the defect of too large or too small reserved space, and the system scale is not limited by the capacity of the metadata reserved area.

6、本发明采用独立设备存放元数据,使得对元数据的操作不会造成数据设备访问的磁头抖动,不影响用户数据访问的性能。6. The present invention uses an independent device to store metadata, so that the operation of the metadata will not cause the head of the data device to vibrate, and will not affect the performance of user data access.

7、本发明在存储元数据时采用了三级位图内存结构,提供第三级位图的换入换出操作,在保持元数据操作高效的同时占用较少的内存资源。7. The present invention adopts a three-level bitmap memory structure when storing metadata, provides third-level bitmap swap-in and swap-out operations, and occupies less memory resources while maintaining high-efficiency metadata operations.

8、本发明采用了链式组织,读写数据时只涉及到两个数据设备,性能不随快照数量的增加而降低。8. The present invention adopts a chain organization, only two data devices are involved when reading and writing data, and the performance does not decrease with the increase of the number of snapshots.

附图说明 Description of drawings

以下,结合附图来详细说明本发明的实施例,其中:Hereinafter, embodiments of the present invention will be described in detail in conjunction with the accompanying drawings, wherein:

图1为本发明的快照系统的组织结构图;Fig. 1 is the organizational chart of the snapshot system of the present invention;

图2为本发明的快照系统的逻辑结构图;Fig. 2 is a logical structural diagram of the snapshot system of the present invention;

图3为本发明的快照系统中采用COW技术的快照设备关系图;Fig. 3 is the snapshot device relationship diagram adopting COW technology in the snapshot system of the present invention;

图4为本发明的快照系统中采用ROW技术的快照设备关系图;Fig. 4 is a snapshot device relationship diagram using ROW technology in the snapshot system of the present invention;

图5为本发明的快照系统中所采用的三级结构位图的示意图;Fig. 5 is the schematic diagram of the tertiary structure bitmap adopted in the snapshot system of the present invention;

图6为本发明的快照系统中采用COW技术创建快照的示意图;Fig. 6 is the schematic diagram that adopts COW technology to create snapshot in the snapshot system of the present invention;

图7为本发明的快照系统中采用ROW技术创建快照的示意图;FIG. 7 is a schematic diagram of creating a snapshot using ROW technology in the snapshot system of the present invention;

图8为本发明的快照系统在一个实施方式中采用ROW技术创建快照时,元数据与数据的相应变化关系示意图;FIG. 8 is a schematic diagram of the corresponding change relationship between metadata and data when the snapshot system of the present invention uses ROW technology to create a snapshot in one embodiment;

图9为本发明的快照系统在一个实施方式中采用COW技术创建快照时,元数据与数据的相应变化关系示意图;FIG. 9 is a schematic diagram of the corresponding change relationship between metadata and data when the snapshot system of the present invention adopts COW technology to create a snapshot in one embodiment;

图10为本发明的快照系统的使用方法的示意图。FIG. 10 is a schematic diagram of the usage method of the snapshot system of the present invention.

具体实施方式 Detailed ways

下面结合附图和具体实施方式对本发明的快照系统进行说明。The snapshot system of the present invention will be described below with reference to the accompanying drawings and specific embodiments.

在对本发明进行详细说明前,首先对本发明中所涉及的部分名词的定义进行相关的说明:Before the present invention is described in detail, at first carry out relevant description to the definition of part noun involved in the present invention:

逻辑设备:通过本发明的快照系统创建出来的设备称为逻辑设备,分为快照设备与源设备两种。Logical device: The device created by the snapshot system of the present invention is called a logical device, which is divided into two types: snapshot device and source device.

物理设备:逻辑设备所使用的底层设备,用于存放数据的设备称为物理设备。Physical device: the underlying device used by logical devices, and the device used to store data is called a physical device.

元数据设备:存放元数据的物理设备称为元数据设备。Metadata device: The physical device that stores metadata is called a metadata device.

数据设备:存放用户数据的物理设备称为数据设备Data device: The physical device that stores user data is called a data device

零设备:是一个虚拟设备,读取时返回零数据。Zero device: is a virtual device that returns zero data when read.

数据块:I/O请求访问的最小粒度,一般为4K字节。Data block: The minimum granularity of I/O request access, generally 4K bytes.

快照组:一个源设备以及从该源设备派生出的多个快照设备构成的一组设备Snapshot group: A group of devices consisting of a source device and multiple snapshot devices derived from the source device

在对本发明中容易混淆的上述词汇进行说明后,下面对本发明的通用快照系统以及该系统中所涉及的相应方法进行说明。After explaining the above-mentioned words that are easily confused in the present invention, the general snapshot system of the present invention and the corresponding methods involved in the system will be described below.

本发明的通用快照系统是一种设备级的快照系统,该快照系统可同时支持写时拷贝(COW)的快照技术和写时重定向(ROW)的快照技术。如图2所示,一个完整的通用快照系统包括设备管理工具集、快照实现模块以及物理设备。其中,设备管理工具集位于所述的通用快照系统的顶端,是系统与用户间的交互接口,所述的快照实现模块位于设备管理工具集的下一层,属于系统的核心模块,用于实现对快照的各种操作,物理设备是本发明的通用快照系统的底层,用于存储与快照相关的各种数据。下面分别对它们的组成以及功能做进一步的说明。The general snapshot system of the present invention is a device-level snapshot system, and the snapshot system can simultaneously support a copy-on-write (COW) snapshot technology and a write-time redirection (ROW) snapshot technology. As shown in Figure 2, a complete general snapshot system includes a device management tool set, a snapshot implementation module and physical devices. Wherein, the device management tool set is located at the top of the general snapshot system, and is an interactive interface between the system and the user, and the snapshot implementation module is located at the next layer of the device management tool set, which belongs to the core module of the system and is used to realize For various operations of the snapshot, the physical device is the bottom layer of the general snapshot system of the present invention, and is used for storing various data related to the snapshot. The composition and function of them will be further explained below.

设备管理工具集由一组用户程序组成,提供创建/删除/修改快照设备的管理功能。本发明的通用快照系统在创建快照时,需要对采用何种快照技术创建快照进行选择,这一选择过程也由设备管理工具集实现。设备管理工具集的具体实现与现有技术中所存在的快照系统的相应功能模块的实现存在相似性,因此,不在本发明中做重复性说明。The device management toolset consists of a set of user programs that provide management functions for creating/deleting/modifying snapshot devices. When the general snapshot system of the present invention creates a snapshot, it needs to select which snapshot technology to use to create the snapshot, and this selection process is also realized by the device management tool set. The specific implementation of the device management tool set is similar to the implementation of the corresponding functional modules of the snapshot system in the prior art, therefore, repeated description is not made in the present invention.

快照实现模块是通用快照系统的主体部分。从逻辑上可分为两层:快照机制层和物理资源管理层。快照机制层提供快照设备间的关系,用于数据查找和时间点管理。物理资源管理层提供下层物理空间的分配和回收管理。下面对快照机制层与物理资源管理层的组成与功能分别进行说明。The snapshot implementation module is the main part of the general snapshot system. Logically, it can be divided into two layers: the snapshot mechanism layer and the physical resource management layer. The snapshot mechanism layer provides the relationship between snapshot devices for data lookup and point-in-time management. The physical resource management layer provides allocation and reclamation management of the underlying physical space. The composition and functions of the snapshot mechanism layer and the physical resource management layer are described below.

快照机制层包含有多个快照组,一个快照组中所采用的快照技术是相同的,而不同的快照组间则可以使用不同的快照技术。即在本发明中,一个快照组只能选择COW和ROW快照实现技术中的一种,但不同的快照组间的快照实现技术则不必相同。The snapshot mechanism layer includes multiple snapshot groups. The snapshot technology used in a snapshot group is the same, but different snapshot groups can use different snapshot technologies. That is, in the present invention, a snapshot group can only select one of COW and ROW snapshot implementation technologies, but the snapshot implementation technologies of different snapshot groups do not have to be the same.

在一个快照组内,多个快照设备之间按照时间点进行区分,各个快照设备之间采用增量模式和串联方式进行组织。在图3和图4中描述了一个快照组中源设备与快照设备间的关系。图3表示了在COW快照实现技术下,源设备与快照设备间的关系。图4则表示了在ROW快照实现技术下,源设备与快照设备间的关系。ROW设备组中,设备间依赖关系由源设备依次指向最早创建的快照设备,在COW设备组中正好相反,依赖关系由最早创建的快照设备指向源设备。In a snapshot group, multiple snapshot devices are distinguished according to time points, and each snapshot device is organized in an incremental mode and in series. The relationship between the source device and the snapshot device in a snapshot group is described in FIG. 3 and FIG. 4 . Figure 3 shows the relationship between the source device and the snapshot device under the COW snapshot implementation technology. Figure 4 shows the relationship between the source device and the snapshot device under the ROW snapshot implementation technology. In the ROW device group, the dependency between devices is from the source device to the earliest created snapshot device in turn. In the COW device group, the opposite is true, and the dependency is from the earliest created snapshot device to the source device.

虽然在上述的快照组中,快照组可能采用COW技术,也可能采用ROW,但在实现上为了简化设计,整合COW和ROW两种不同技术,本发明采用了四个指针的通用内存结构。在图6中,对四个指针的通用内存结构进行了说明,其中,r0,r1指针对应读操作时需要访问的物理设备,w0,w1对应写操作时需要访问的物理设备。Although in the above-mentioned snapshot group, the snapshot group may adopt COW technology or ROW, but in order to simplify the design and integrate two different technologies of COW and ROW, the present invention adopts a general memory structure of four pointers. In Fig. 6, the general memory structure of four pointers is described, wherein, pointers r0 and r1 correspond to physical devices that need to be accessed during read operations, and w0 and w1 correspond to physical devices that need to be accessed during write operations.

本发明的通用快照系统所提供的快照按照类型可分为只读和可写快照。一般情况下的快照是只读的,源设备与在不同时刻创建的只读快照构成一个链式结构,源设备在链头,作为根结点,时间最早的快照设备在链尾。每个快照设备记录在相邻快照时间点变化的增量数据,为数据版本管理应用提供了源卷上数据的多个时间点的不同版本。在某些特定应用下,本系统还提供可写快照,它通过为只读快照创建一个全新的快照设备,得到只读快照的一个可写副本,实现只读快照的可写。为只读快照创建了可写快照后,原来的只读快照对外仍可见,为只读快照创建的可写快照对外表现为一个全新的快照设备,它相当于一个新的源设备。对可写快照可再创建只读快照,可写快照与其只读快照也构成一条链。对可写快照的写操作都直接写入新的快照设备中。The snapshots provided by the general snapshot system of the present invention can be classified into read-only snapshots and writable snapshots according to types. Generally, snapshots are read-only. The source device and read-only snapshots created at different times form a chain structure. The source device is at the head of the chain, serving as the root node, and the snapshot device with the earliest time is at the end of the chain. Each snapshot device records incremental data changed at adjacent snapshot time points, providing data version management applications with different versions of data on the source volume at multiple time points. In some specific applications, the system also provides writable snapshots. It creates a new snapshot device for read-only snapshots to obtain a writable copy of read-only snapshots, and realizes writable read-only snapshots. After creating a writable snapshot for a read-only snapshot, the original read-only snapshot is still visible to the outside world, and the writable snapshot created for the read-only snapshot appears as a brand new snapshot device, which is equivalent to a new source device. A read-only snapshot can be created for a writable snapshot, and a writable snapshot and its read-only snapshot also form a chain. Write operations to writable snapshots are written directly to the new snapshot device.

对可写快照进行读操作时,首先在可写快照所在的链中查找数据,如果查找不到,则转发到其所依赖的只读快照中进行读取。如图3,4所示,g0为一个快照组,对其中的快照设备snap5做可写快照,产生了snap5’快照设备,继续对snap5’做只读快照,形成g2快照组。快照组g2通过其可写设备snap5’的parent指针与快照组g0进行连接。同理,对快照组g2中的snap5’2做可写快照,最终形成g3快照组。读取g2组中snap5’1设备中的数据时,首先在g2组中进行查找,如果查到链头设备snap5’还没有找到所需数据,则通过snap5’的parent指针在g0组中继续查找。直到找到所需数据。When performing a read operation on a writable snapshot, first search for data in the chain where the writable snapshot is located, and if it cannot be found, forward it to the read-only snapshot it depends on for reading. As shown in Figures 3 and 4, g0 is a snapshot group, and a writable snapshot is made to the snapshot device snap5 in it, and the snap5' snapshot device is generated, and the read-only snapshot is continued to snap5' to form a g2 snapshot group. The snapshot group g2 is connected with the snapshot group g0 through the parent pointer of its writable device snap5'. Similarly, take a writable snapshot of snap5'2 in the snapshot group g2, and finally form the g3 snapshot group. When reading the data in the snap5'1 device in the g2 group, first search in the g2 group, if the chain head device snap5' has not found the required data, then continue to search in the g0 group through the parent pointer of snap5' . until the desired data is found.

物理资源管理层提供逻辑设备所使用的物理设备的管理,包括物理设备的打开、关闭、添加、删除以及合法性检查等等。在一个快照组中,源设备和快照设备都可称为逻辑设备,一个逻辑设备在物理资源层对应两个物理设备,如图1所示,其中一个物理设备为元数据设备,另一个为数据设备。The physical resource management layer provides management of physical devices used by logical devices, including opening, closing, adding, deleting, and legality checks of physical devices. In a snapshot group, both the source device and the snapshot device can be called logical devices, and one logical device corresponds to two physical devices at the physical resource layer, as shown in Figure 1, where one physical device is a metadata device and the other is a data device equipment.

在元数据设备上,对物理设备等物理资源的管理和使用进行标识的元数据进行存储。具体的说,所述的元数据用于指示数据的增量以及快照版本中的数据在数据设备上的存放位置,它反映了某一时间点的快照版本的数据映射关系。对数据设备中的每一个数据块(Chunk),在元数据设备的元数据表中均有对应的项,用于记录该数据块是否被修改过以及该数据块的存放位置。在一个元数据项中必须包括:时间、数据位置、数据修改状态等信息。元数据可以采用位图(bitmap),映射表等多种记录形式。在本实施例中,采用位图方式记录元数据。在具体记录时,每一个逻辑设备均有一个位图,位图中的每一位代表一个数据块大小的地址范围,整个位图覆盖快照设备的逻辑空间,通过位图中相应位的值进行用户数据的定位操作。On the metadata device, the metadata identifying the management and use of physical resources such as physical devices are stored. Specifically, the metadata is used to indicate the increment of data and the storage location of the data in the snapshot version on the data device, which reflects the data mapping relationship of the snapshot version at a certain point in time. For each data block (Chunk) in the data device, there is a corresponding item in the metadata table of the metadata device, which is used to record whether the data block has been modified and the storage location of the data block. A metadata item must include information such as time, data location, and data modification status. Metadata can be recorded in various forms such as bitmaps and mapping tables. In this embodiment, metadata is recorded in a bitmap manner. When recording specifically, each logical device has a bitmap, and each bit in the bitmap represents an address range of a data block size. Locating operations on user data.

用于记录元数据的位图存放在元数据设备中,考虑到元数据的存储空间和访问效率问题,可对位图进行多级的结构划分,所划分的位图结构与数据设备中的数据块大小有密切的联系。在本实施例中,数据块大小设定为4096字节,如图5所示,位图使用如下的三级结构:第一级位图中的每一位代表4T大小的逻辑空间,占用4k字节(1页),第二级位图中的每一位代表128M地址空间,第三级位图中的每一位代表4k地址空间。第一级位图常驻内存,第二、三级采用换入换出机制,保证元数据较小的空间占用。三级位图之间的关系为:第一级位图的某一位如果为1,表示其对应的二级位图中有1存在,类似,如果二级位图中有1存在,则表示其对应的三级位图中有1存在。通过三级位图结构,可以减少位图遍历时间。The bitmap used to record metadata is stored in the metadata device. Considering the storage space and access efficiency of metadata, the bitmap can be divided into multi-level structures. The divided bitmap structure is consistent with the data in the data device. Block size is closely related. In the present embodiment, the data block size is set to 4096 bytes, as shown in Figure 5, the bitmap uses the following three-level structure: each bit in the first-level bitmap represents a logical space of 4T size, occupying 4k Byte (1 page), each bit in the second-level bitmap represents a 128M address space, and each bit in the third-level bitmap represents a 4k address space. The first-level bitmap is resident in memory, and the second and third levels adopt a swap-in and swap-out mechanism to ensure that the metadata occupies a small space. The relationship between the three-level bitmaps is: if a bit of the first-level bitmap is 1, it means that there is a 1 in the corresponding second-level bitmap, similarly, if there is a 1 in the second-level bitmap, it means 1 exists in its corresponding third-level bitmap. Through the three-level bitmap structure, the bitmap traversal time can be reduced.

在本发明的通用快照系统中,当数据在逻辑设备间发生变化时,使用元数据反映上述变化,即元数据具有可用于指示数据增量的功能。采用位图方式记录的元数据在表示两个不同时间点的快照间的增量时,其具体含义如下:In the general snapshot system of the present invention, when data changes between logical devices, metadata is used to reflect the above changes, that is, metadata has the function of indicating data increment. When the metadata recorded in bitmap mode represents the increment between two snapshots at different time points, its specific meaning is as follows:

位图值为1:表示在这两个快照的时间点之间有写操作;The bitmap value is 1: it means that there are write operations between the time points of these two snapshots;

位图值为0:表示在这两个快照的时间点之间没有任何写操作。A bitmap value of 0: indicates that there were no write operations between the two snapshot points in time.

通过元数据可实现对逻辑设备中数据的读取。但在本发明的通用快照系统中,在快照组中所采用的快照实现技术可以是COW快照实现技术,也可以是ROW快照实现技术。因此采用位图方式记录的元数据在两种快照实现技术中具有各自特定的含义,在利用元数据实现对数据的读取时,其内部语义有所不同。此处所涉及的不同的内部语义在利用本发明的通用快照系统进行快照的创建、删除以及快照数据的读取时会有详细的涉及,在下文中将做详细的说明。Data in logical devices can be read through metadata. However, in the general snapshot system of the present invention, the snapshot implementation technology adopted in the snapshot group may be COW snapshot implementation technology or ROW snapshot implementation technology. Therefore, the metadata recorded in bitmap mode has its own specific meaning in the two snapshot implementation technologies, and the internal semantics are different when metadata is used to read data. The different internal semantics involved here will be involved in detail when using the general snapshot system of the present invention to create and delete snapshots and read snapshot data, which will be described in detail below.

对本发明的通用快照系统的结构进行上述说明后,对本发明的通用快照系统的使用方法做进一步说明,包括以下步骤:After the above description of the structure of the general snapshot system of the present invention, the method of using the general snapshot system of the present invention will be further described, including the following steps:

步骤1、用户通过所述的设备管理工具集发布创建快照的命令,并在所述的命令中决定选择何种快照技术创建快照;Step 1. The user issues a command to create a snapshot through the device management tool set, and decides which snapshot technology to choose to create a snapshot in the command;

步骤2、所述的快照实现模块中的快照机制层根据步骤1中所选择的快照技术创建快照;Step 2, the snapshot mechanism layer in the snapshot implementation module creates a snapshot according to the snapshot technology selected in step 1;

步骤3、根据用户的需求,读取快照中的数据;Step 3. According to the needs of the user, read the data in the snapshot;

步骤4、根据用户的需求,在快照中完成写数据的操作;Step 4. Complete the operation of writing data in the snapshot according to the needs of the user;

步骤5、根据用户的需求,对快照进行删除。Step 5, delete the snapshot according to the user's requirement.

在上述的步骤中,所涉及到的快照创建、快照数据读取、快照数据的写以及快照的删除都可能会由于快照技术的不同而存在着差异,下面分别进行说明。In the above steps, the creation of the snapshot, reading of the snapshot data, writing of the snapshot data, and deletion of the snapshot involved may vary due to different snapshot technologies, which will be described separately below.

ROW类快照创建过程如图7所示,只有源设备存在时,其使用的物理设备为物理设备1,当创建快照后,将指定给快照设备的物理设备2交给源设备使用,而源设备使用的物理设备1交给快照设备使用。The process of creating a ROW snapshot is shown in Figure 7. When only the source device exists, the physical device used is physical device 1. After the snapshot is created, the physical device 2 assigned to the snapshot device is handed over to the source device for use, and the source device The used physical device 1 is handed over to the snapshot device.

在ROW模式中,由于创建快照时,元数据设备与数据设备一起被交换,位图中的1与数据设备上的增量数据有一一对应关系。当访问某一时间点快照数据时,其位图中的值含义如下:In the ROW mode, since the metadata device and the data device are exchanged together when creating a snapshot, the 1 in the bitmap has a one-to-one correspondence with the incremental data on the data device. When accessing snapshot data at a certain point in time, the meanings of the values in the bitmap are as follows:

位图值为1:表示与相应位对应的数据块的数据就存放在该快照的数据设备上。The value of the bitmap is 1: it means that the data of the data block corresponding to the corresponding bit is stored on the data device of the snapshot.

位图值为0:表示与相应位对应的数据块的数据不在该快照的数据设备上。A bitmap value of 0: indicates that the data of the data block corresponding to the corresponding bit is not on the data device of the snapshot.

如图8所示,ROW的位图和数据位置是一一对应的,位图为1,表示数据在本设备上,为0则需要向后查找。例如,在图8中,要读取状态6的A数据,则必须向后查找到s1时间点才能确定数据位置。As shown in Figure 8, there is a one-to-one correspondence between the ROW bitmap and the data location. If the bitmap is 1, it means that the data is on the device, and if it is 0, it needs to search backward. For example, in Fig. 8, to read the A data of state 6, it is necessary to search backward to the s1 time point to determine the data position.

COW类快照创建过程如图6所示,在COW模式创建过程中,只交换元数据设备,数据设备不进行交换。设备组的各个逻辑设备间依赖关系与ROW方式不同。例如,源设备对应物理设备1,在创建快照后,源设备仍然对应物理设备1,而快照s1则对应物理设备2。The COW snapshot creation process is shown in Figure 6. In the COW mode creation process, only metadata devices are exchanged, and data devices are not exchanged. The dependency relationship among logical devices of a device group is different from the ROW method. For example, the source device corresponds to physical device 1. After the snapshot is created, the source device still corresponds to physical device 1, and snapshot s1 corresponds to physical device 2.

在COW模式中,快照创建后发生的写会引起COW过程,将数据拷贝到快照中。因此,在未进行COW之前,快照设备元数据的1不能表示数据存放在快照的数据设备上,此时,1只表明在当时对相应的数据块产生了COW操作。结合图6,对COW模式中的数据位置确定方法做如下说明:In COW mode, writes that occur after the snapshot is created cause the COW process to copy data into the snapshot. Therefore, before COW is performed, 1 in the metadata of the snapshot device cannot indicate that the data is stored on the data device of the snapshot. At this time, 1 only indicates that a COW operation was performed on the corresponding data block at that time. In conjunction with Figure 6, the method for determining the data location in the COW mode is described as follows:

在读快照S1时,读取它的后一时间点的快照S2的位图,如果该位图的值为1,表示对应数据块的数据存放在快照S1的数据设备上;如果位图值为0,则沿着链往后面时间点的快照继续查找,如果遇到快照Sk的位图值为1,则表示相应数据块的数据存放在快照Sk-1的数据设备上;如果在查找过程中遇到了源设备,且源设备的位图值为1时,则表示数据块的数据存放在源设备的相邻快照的数据设备上;如果源设备的位图值为0,则表示数据块的数据存放在源的数据设备上。When reading snapshot S1, read the bitmap of snapshot S2 at the next point in time. If the value of the bitmap is 1, it means that the data of the corresponding data block is stored on the data device of snapshot S1; if the value of the bitmap is 0 , then continue to search along the chain to the snapshot at the later point in time, if the bitmap value of the snapshot S k is 1, it means that the data of the corresponding data block is stored on the data device of the snapshot S k-1 ; if in the search process When the source device is encountered in , and the bitmap value of the source device is 1, it means that the data of the data block is stored on the data device of the adjacent snapshot of the source device; if the bitmap value of the source device is 0, it means that the data block The data is stored on the source data device.

如图9所示,1状态为在源写了ABCD四块后创建了s1快照设备,此时s1持有源在s0状态的位图,源的位图清零。在状态2时,写1,3块,此时会触发COW操作,将数据从源设备拷贝到s1快照设备。源的位图相应位置位,快照的位图不变。在状态4时,写源的2,3块,此时触发COW操作,将数据从源设备拷贝到s2快照设备,依次类推。当读取s1时间点数据时,需要向前查找,比如在状态6时,读取D数据,则需要向前查找到s3设备才能最终确定数据的位置。As shown in Figure 9, the 1 state is that the s1 snapshot device is created after the source writes four blocks of ABCD. At this time, s1 holds the bitmap of the source in the s0 state, and the bitmap of the source is cleared. In state 2, write blocks 1 and 3. At this time, the COW operation will be triggered to copy the data from the source device to the s1 snapshot device. The corresponding bits of the bitmap of the source are set, and the bitmap of the snapshot is unchanged. In state 4, write blocks 2 and 3 of the source. At this time, the COW operation is triggered to copy the data from the source device to the s2 snapshot device, and so on. When reading the data at the time point of s1, it is necessary to look forward. For example, in state 6, when reading D data, it is necessary to look forward to the s3 device to finally determine the location of the data.

元数据存储在物理设备中时,可以与数据一起存放在同一物理介质上,实现混合存放,也可以存放在独立的物理设备上,与数据所在的物理介质隔离。在本实施方式中,考虑到效率和扩展性问题,最终采用了分离元数据设备的方案。When metadata is stored in a physical device, it can be stored together with the data on the same physical medium for mixed storage, or it can be stored on an independent physical device and isolated from the physical medium where the data resides. In this embodiment, considering efficiency and scalability issues, a scheme of separating metadata devices is finally adopted.

在对本发明的通用快照系统的基本组成进行说明后,对快照系统创建快照、删除快照、读取数据、数据迁移等过程进行说明。After explaining the basic composition of the general snapshot system of the present invention, the snapshot system creates snapshots, deletes snapshots, reads data, and migrates data.

图6和图7都是对快照创建流程的相应说明,其中的图6是采用COW快照实现技术创建快照的流程,而图7则是采用ROW快照实现技术创建快照的流程。Figure 6 and Figure 7 are the corresponding descriptions of the snapshot creation process, in which Figure 6 is the process of creating a snapshot using the COW snapshot implementation technology, and Figure 7 is the process of creating a snapshot using the ROW snapshot implementation technology.

在图6中,快照设备和源设备中都有四个快照关系指针,分别指向其读写操作需要访问的物理设备,并记录了快照之间、快照与源设备之间的依赖关系。COW模式中快照的创建过程如下:首先创建一个源设备,在创建时,将源设备的所有快照关系指针都指向源设备的物理设备,此时在快照链表中只有源设备本身;然后在下一个时间点创建第一个快照,在快照链表插入快照的过程中,修改源设备的w0指针指向快照,而快照的r0指针指向源,若所创建的快照为只读快照,则需把快照的w0和w1设备修改为空指针;为源设备创建第二个快照时,在链表中插入快照设备2时,修改源设备的w0指针指向快照设备2,快照设备2的r0指针指向源,快照设备1的r0指针指向快照设备2,若该快照为只读快照,同样需把快照设备2的w0和w1设备修改为空指针。通过上述流程,建立起各个不同时间点快照设备之间的依赖关系。In Figure 6, there are four snapshot relationship pointers in both the snapshot device and the source device, respectively pointing to the physical devices that need to be accessed by their read and write operations, and recording the dependencies between snapshots and between snapshots and source devices. The snapshot creation process in COW mode is as follows: first create a source device, when creating, point all the snapshot relationship pointers of the source device to the physical device of the source device, and at this time only the source device itself is in the snapshot list; then at the next time Click to create the first snapshot. During the process of inserting the snapshot into the snapshot linked list, modify the w0 pointer of the source device to point to the snapshot, and the r0 pointer of the snapshot to point to the source. If the created snapshot is a read-only snapshot, you need to set w0 and The w1 device is modified to a null pointer; when creating a second snapshot for the source device, when inserting the snapshot device 2 into the linked list, modify the w0 pointer of the source device to point to the snapshot device 2, the r0 pointer of the snapshot device 2 to point to the source, and the snapshot device 1’s The r0 pointer points to the snapshot device 2. If the snapshot is a read-only snapshot, the w0 and w1 devices of the snapshot device 2 also need to be modified to null pointers. Through the above process, the dependencies between snapshot devices at different time points are established.

图7与图6的快照创建过程类似,只是在四个指针指向时有所不同。ROW方式中,源设备的r0指针指向快照设备,快照设备不反指向源设备。在有多个快照设备时,ROW的快照链是由最新时间点的快照依次指向最老时间点快照,如图7所示,s1为最早创建的快照设备,其时间点最老,s2为最后创建的快照,其时间点最新。快照链由源设备依次指向s2,s1设备,与COW方式正好相反。Figure 7 is similar to the snapshot creation process in Figure 6, except that the four pointers are different. In the ROW mode, the r0 pointer of the source device points to the snapshot device, and the snapshot device does not point back to the source device. When there are multiple snapshot devices, the snapshot chain of ROW is from the snapshot at the latest point in time to the snapshot at the oldest point in time. As shown in Figure 7, s1 is the earliest snapshot device created, and its time point is the oldest, and s2 is the last The created snapshot has the latest time point. The snapshot chain is directed from the source device to the s2 and s1 devices in turn, which is just the opposite of the COW method.

在对通用快照系统中的数据进行读取时,可分为对源设备中数据的读取和对快照设备中数据的读取。When reading data in the general snapshot system, it can be divided into reading data in the source device and reading data in the snapshot device.

读取源设备中数据时,无论是COW模式还是ROW模式,它们在读取数据时的流程相同,包括以下步骤:When reading data in the source device, no matter it is in COW mode or ROW mode, the process of reading data is the same, including the following steps:

步骤A1、根据所要读取数据的地址在位图中查询相应的位,若该位的值为1,则直接在本地读取,并返回所读取的数据值,若该位的值为0,则执行下一步;Step A1. Query the corresponding bit in the bitmap according to the address of the data to be read. If the value of the bit is 1, read it locally and return the read data value. If the value of the bit is 0 , then go to the next step;

步骤A2、判断源设备中的数据是否存在相应的快照,判断算法为:如果r0指针指向的是物理设备,则不存在快照;如果是逻辑设备,则存在快照。若不存在快照,则返回全零数据,若存在快照,则根据快照链将读数据请求进行转发,进入快照数据的读取流程。Step A2. Determine whether there is a corresponding snapshot for the data in the source device. The determination algorithm is: if the r0 pointer points to a physical device, there is no snapshot; if it is a logical device, there is a snapshot. If there is no snapshot, all zero data will be returned. If there is a snapshot, the read data request will be forwarded according to the snapshot chain, and the snapshot data reading process will be entered.

在读取快照数据的过程中,根据快照实现技术的不同,在读取时存在着明显的差异,下面分别进行说明。In the process of reading snapshot data, depending on the snapshot implementation technology, there are obvious differences in reading, which are explained below.

在COW模式下,读取快照数据的过程如下:In COW mode, the process of reading snapshot data is as follows:

步骤B1、根据位图的值确定数据存放的物理设备;判断算法为:从快照链表的尾部向前遍历,如果在某一快照Sk上的位图值为1,则在其前一快照Sk-1的数据设备上读取数据,若位图值为0,则将读数据请求沿着快照链表转发到前一快照上,直至找到位图值为1的快照;Step B1, determine the physical device where the data is stored according to the value of the bitmap; the judgment algorithm is: traverse forward from the tail of the snapshot linked list, if the bitmap value on a certain snapshot S k is 1, then in the previous snapshot S k Read data on the k-1 data device, if the bitmap value is 0, then forward the read data request to the previous snapshot along the snapshot list until a snapshot with a bitmap value of 1 is found;

步骤B2、在快照链表的快照中没有找到位图值为1的快照,读数据请求到达源设备,若源设备的位图值为1时,在与源设备相邻快照的数据设备上读取数据,否则在源的数据设备上读取数据。本步骤的具体实现,可参见上文对图9的说明。Step B2. No snapshot with a bitmap value of 1 is found in the snapshots of the snapshot linked list, and the read data request reaches the source device. If the bitmap value of the source device is 1, read on the data device of the snapshot adjacent to the source device data, otherwise read the data on the source's data device. For the specific implementation of this step, refer to the description of FIG. 9 above.

在ROW模式下,读取快照数据的过程如下:In ROW mode, the process of reading snapshot data is as follows:

根据位图的值确定数据存放的物理设备,然后从数据所存放的物理设备上读取数据。在ROW模式下,确定数据存放位置的判断算法为:从快照链表的尾部向前遍历,若在某一快照Sk上的位图值为1,则在本地的数据设备上读取,并返回相应的数据,若位图值为0,则判断当前快照是否为快照链表中最老的快照,即是否是快照链表尾端的快照,若是,则返回全0,否则将读数据请求转发到快照链表中的前一快照中。本步骤的具体实现,可参见上文对图8的说明。Determine the physical device where the data is stored according to the value of the bitmap, and then read the data from the physical device where the data is stored. In ROW mode, the judgment algorithm for determining the data storage location is: traverse forward from the tail of the snapshot linked list, if the bitmap value on a certain snapshot S k is 1, read it on the local data device and return Corresponding data, if the bitmap value is 0, then judge whether the current snapshot is the oldest snapshot in the snapshot linked list, that is, whether it is the snapshot at the end of the snapshot linked list, if so, return all 0, otherwise, forward the read data request to the snapshot linked list In the previous snapshot in . For the specific implementation of this step, refer to the description of FIG. 8 above.

在对源进行写数据操作过程中,根据快照实现技术的不同,在写数据时也存在着差异,下面分别进行说明。In the process of writing data to the source, depending on the snapshot implementation technology, there are also differences when writing data, which will be explained separately below.

在COW模式下,写数据的流程如下:In COW mode, the process of writing data is as follows:

步骤a1、根据位图的值确定数据存放的物理设备;Step a1, determine the physical device where the data is stored according to the value of the bitmap;

步骤a2、根据步骤a1所确定的物理设备写入数据。Step a2, write data according to the physical device determined in step a1.

具体的实现方法为:如果位图值为1,则直接写入源的物理设备中;如果位图值为0,完成COW操作后再写入源的物理设备中。The specific implementation method is: if the value of the bitmap is 1, write it directly into the source physical device; if the value of the bitmap is 0, write it into the source physical device after completing the COW operation.

在ROW模式下,写数据的流程如下:In ROW mode, the process of writing data is as follows:

步骤b1、根据位图的值确定数据存放的物理设备;Step b1, determining the physical device where the data is stored according to the value of the bitmap;

步骤b2、根据步骤b1所确定的物理设备写入数据。Step b2, writing data according to the physical device determined in step b1.

具体的实现方法为:如果位图值为1,则直接写入源的物理设备中;如果位图值为0,进行数据块的数据合并后再写入源的物理设备中。The specific implementation method is: if the value of the bitmap is 1, it is directly written into the source physical device; if the value of the bitmap is 0, the data of the data block is merged and then written into the source physical device.

同样的,在通用快照系统中,对快照的删除也会由于快照技术的不同而存在着差异,下面分情况对快照的删除过程进行描述。Similarly, in the general snapshot system, there are differences in deletion of snapshots due to different snapshot technologies. The following describes the deletion process of snapshots in different situations.

在COW方式中,当存在多个时间快照时,为简化设计和实现,我们规定只能删除最老的时间点快照,避免数据迁移操作。In the COW method, when there are multiple time snapshots, in order to simplify the design and implementation, we stipulate that only the oldest point-in-time snapshot can be deleted to avoid data migration operations.

而ROW方式中,存在着删除新创建快照的需求,由图7的关系可以看出,不同时间点快照存在着依赖关系,同一个时间点的数据可能分布在不同的物理设备上,因此需要将数据进行合并。以图7为例,对删除快照设备时所触发的数据合并方法进行说明。In the ROW mode, there is a need to delete the newly created snapshot. From the relationship in Figure 7, it can be seen that snapshots at different time points have dependencies, and data at the same time point may be distributed on different physical devices. Therefore, it is necessary to The data is merged. Taking FIG. 7 as an example, the data merging method triggered when the snapshot device is deleted is described.

在图7中,S1与S2为紧邻的两个时间点的快照设备,假设要删除快照设备S1,具体的数据合并过程包括:In Figure 7, S1 and S2 are snapshot devices at two adjacent time points. Assuming that snapshot device S1 is to be deleted, the specific data merging process includes:

步骤10、依次读取快照设备S2中每个数据块在位图中的对应位;Step 10, sequentially read the corresponding bit of each data block in the bitmap in the snapshot device S2;

步骤20、将快照设备S2中的位图位与快照设备S1的相应位图位进行组合,可得到四种情况:Step 20. Combining the bitmap bits in the snapshot device S2 with the corresponding bitmap bits in the snapshot device S1, four situations can be obtained:

S2      S1S2 S1

a、0    0a.0 0

b、0    1b. 0 1

c、1    0c, 1 0

d、1    1d, 1 1

当S2的位图位为1时,表示有新数据写过,因此在数据合并时只需要将S2的位图位为1的数据块拷贝回S1的数据设备上,而无论S1的位图位是何值。这个拷贝过程称为数据回移操作。When the bitmap bit of S2 is 1, it means that new data has been written. Therefore, only the data block whose bitmap bit of S2 is 1 needs to be copied back to the data device of S1, regardless of the bitmap bit of S1. What is the value. This copying process is called a data move back operation.

步骤30、执行数据回移操作,由S2的数据设备中的数据拷贝到S1的数据设备。Step 30, perform a data move back operation, and copy the data in the data device of S2 to the data device of S1.

步骤40、迁移结束后,置S2的位图相应位为0;Step 40, after the migration is completed, set the corresponding bit of the bitmap of S2 to 0;

步骤50、如果所有数据块处理完,执行下一步;否则重新执行步骤10,继续处理下一个数据块。Step 50, if all data blocks have been processed, execute the next step; otherwise, re-execute step 10, and continue to process the next data block.

步骤60、对两个逻辑设备加锁,同时改变位图和r1指针的值,将两者的物理设备进行交换。Step 60, lock the two logical devices, change the value of the bitmap and r1 pointer at the same time, and exchange the two physical devices.

步骤70、释放被删除设备所占用的内存,物理设备等资源。Step 70, releasing resources such as memory and physical devices occupied by the deleted device.

最后所应说明的是,以上实施例仅用以说明本发明的技术方案而非限制。尽管参照实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,对本发明的技术方案进行修改或者等同替换,都不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than limit them. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent replacements to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all of them should be included in the scope of the present invention. within the scope of the claims.

Claims (17)

1、一种快照系统,包括设备管理工具集、快照实现模块以及物理设备;其特征在于,所述的快照实现模块包括用于数据查找和时间点管理的快照机制层,以及用于对所述的物理设备进行分配和回收管理的物理资源管理层;1. A snapshot system, comprising a device management tool set, a snapshot implementation module, and a physical device; it is characterized in that, the snapshot implementation module includes a snapshot mechanism layer for data search and point-in-time management, and is used for The physical resource management layer for allocation and recovery management of physical equipment; 所述的快照机制层中包含有至少一个快照组,所述快照组通过写时拷贝技术或写时重定向技术创建;所述快照组包括用于对应读操作时需要访问的物理设备r0,r1指针,以及用于对应写操作时需要访问的物理设备的w0、w1指针;在所述的快照组中,在一定的时间点有相应的快照设备,各个时间点的快照设备间采用链式结构进行组织;The snapshot mechanism layer includes at least one snapshot group, which is created by copy-on-write technology or redirection-on-write technology; the snapshot group includes physical devices r0 and r1 that need to be accessed during corresponding read operations Pointers, and w0 and w1 pointers used to correspond to physical devices that need to be accessed during write operations; in the snapshot group, there are corresponding snapshot devices at a certain point in time, and a chain structure is adopted between snapshot devices at each point in time to organize; 所述的物理资源管理层中包含有与所述的快照组对应的元数据设备与数据设备;其中,The physical resource management layer includes metadata devices and data devices corresponding to the snapshot group; wherein, 所述的设备管理工具集用于发布创建快照的命令,在所述命令中包括选择何种快照技术创建快照的信息;所述的快照实现模块中的快照机制层根据创建快照的命令创建一个源设备,将所述源设备的所有快照关系指针都指向该源设备的物理设备,然后在后续的时间点创建快照,并在快照集链表中插入所创建的快照;The device management tool set is used to issue a command to create a snapshot, and the command includes information about which snapshot technology to choose to create a snapshot; the snapshot mechanism layer in the snapshot implementation module creates a source according to the command to create a snapshot device, pointing all the snapshot relationship pointers of the source device to the physical device of the source device, then creating a snapshot at a subsequent point in time, and inserting the created snapshot into the snapshot set linked list; 当所述命令采用写时拷贝技术创建快照时,所述的快照集链表中插入所创建的快照包括将所述源设备的w0指针指向新创建的快照设备,将新创建的快照设备的r0指针指向所述的源设备,若所述快照集链表中还存在时间点更早的快照设备,则将与新创建的快照设备相比时间点更早且时间最接近的快照设备的r0指针指向新创建的快照设备;When the command uses copy-on-write technology to create a snapshot, inserting the created snapshot into the snapshot set linked list includes pointing the w0 pointer of the source device to the newly created snapshot device, and setting the r0 pointer of the newly created snapshot device Pointing to the source device, if there is a snapshot device with an earlier time point in the snapshot set linked list, the r0 pointer of the snapshot device with an earlier and closest time point than the newly created snapshot device points to the new Created snapshot device; 当所述命令采用写时重定向技术创建快照时,所述的在快照集链表中插入所创建的快照包括将所述源设备的r0指针指向新创建的快照设备,将所述新创建的快照设备的r0指针指向时间点更早且时间最接近的快照设备;若所述快照集链表中不存在时间点更早的快照设备,则所述新创建的快照设备的r0指针指向零设备。When the command uses redirection-on-write technology to create a snapshot, inserting the created snapshot into the snapshot set linked list includes pointing the r0 pointer of the source device to the newly created snapshot device, and inserting the newly created snapshot The r0 pointer of the device points to the snapshot device with an earlier time point and the closest time point; if there is no snapshot device with an earlier time point in the snapshot set linked list, the r0 pointer of the newly created snapshot device points to a zero device. 2、根据权利要求1所述的快照系统,其特征在于,所述元数据设备中存放元数据,所述的元数据用于指示数据的增量以及所述快照组的快照版本中的数据在所述数据设备上的存放位置;所述元数据采用位图或映射表的形式进行记录。2. The snapshot system according to claim 1, wherein metadata is stored in the metadata device, and the metadata is used to indicate the increment of data and the data in the snapshot version of the snapshot group. The storage location on the data device; the metadata is recorded in the form of a bitmap or a mapping table. 3、根据权利要求2所述的快照系统,其特征在于,所述位图采用多级的结构划分,上一级位图某一位的值为1用于表示对应的下一级位图中存在值为1的位,若为0,则表示对应的下一级位图中不存在值为1的位;在最低级的位图上,某一位的值为1用于表示对应数据块上的数据发生变化,若为0,则对应数据块上的数据不发生变化。3. The snapshot system according to claim 2, wherein the bitmap adopts a multi-level structure division, and the value of a certain bit of the upper-level bitmap is 1 to indicate the corresponding lower-level bitmap There is a bit with a value of 1, and if it is 0, it means that there is no bit with a value of 1 in the corresponding next-level bitmap; on the lowest-level bitmap, a bit with a value of 1 is used to indicate the corresponding data block The data on the block changes, if it is 0, the data on the corresponding data block does not change. 4、一种对权利要求1-3之一所述的快照系统的使用方法,包括以下步骤:4. A method for using the snapshot system according to any one of claims 1-3, comprising the following steps: 步骤1)、用户通过所述的设备管理工具集发布创建快照的命令,并在所述的命令中决定选择何种快照技术创建快照;Step 1), the user issues a command to create a snapshot through the device management tool set, and decides which snapshot technology to choose to create a snapshot in the command; 步骤2)、所述的快照实现模块中的快照机制层根据步骤1)中所选择的快照技术创建快照;Step 2), the snapshot mechanism layer in the snapshot implementation module creates a snapshot according to the snapshot technology selected in step 1); 步骤3)、根据用户的需求,对快照做相关的操作,所述的操作包括对快照的读、写以及删除。Step 3), perform relevant operations on the snapshot according to user requirements, and the operations include reading, writing and deleting the snapshot. 5、根据权利要求4所述的快照系统的使用方法,其特征在于,在所述的步骤2)中,所述的创建快照还包括下列步骤:5. The method for using the snapshot system according to claim 4, characterized in that, in said step 2), said creating a snapshot further includes the following steps: 步骤2-1-1)、创建一个源设备,将所述源设备的所有快照关系指针都指向源设备的物理设备;Step 2-1-1), create a source device, point all the snapshot relationship pointers of the source device to the physical device of the source device; 步骤2-1-2)、在后续的时间点创建快照,并在快照集链表中插入所创建的快照。Step 2-1-2), creating a snapshot at a subsequent point in time, and inserting the created snapshot into the snapshot set linked list. 6、根据权利要求5所述的快照系统的使用方法,其特征在于,若创建快照时采用写时拷贝技术,则所述的在快照集链表中插入所创建的快照时,将所述源设备的w0指针指向新创建的快照设备,将新创建的快照设备的r0指针指向所述的源设备,若所述快照集链表中还存在时间点更早的快照设备,则将与新创建的快照设备相比时间点更早且时间最接近的快照设备的r0指针指向新创建的快照设备。6. The method for using the snapshot system according to claim 5, wherein if the copy-on-write technology is used when creating the snapshot, when inserting the created snapshot into the snapshot set linked list, the source device The w0 pointer of the newly created snapshot device points to the newly created snapshot device, and the r0 pointer of the newly created snapshot device points to the source device. The r0 pointer of the snapshot device whose device is earlier than the time point and whose time is closest points to the newly created snapshot device. 7、根据权利要求5所述的快照系统的使用方法,其特征在于,若创建快照时采用写时重定向技术,则所述的在快照集链表中插入所创建的快照时,将所述源设备的r0指针指向新创建的快照设备,将所述新创建的快照设备的r0指针指向时间点更早且时间最接近的快照设备;若所述快照集链表中不存在时间点更早的快照设备,则所述新创建的快照设备的r0指针指向零设备。7. The method for using the snapshot system according to claim 5, wherein if the redirection-on-write technology is used when creating the snapshot, when inserting the created snapshot into the snapshot set linked list, the source The r0 pointer of the device points to the newly created snapshot device, and the r0 pointer of the newly created snapshot device points to the snapshot device with an earlier time point and the closest time point; if there is no snapshot with an earlier time point in the snapshot set linked list device, the r0 pointer of the newly created snapshot device points to the zero device. 8、根据权利要求4所述的快照系统的使用方法,其特征在于,在所述的步骤3)中,所述的读取快照中的数据包括对源设备中数据的读取和对快照设备中数据的读取。8. The method for using the snapshot system according to claim 4, characterized in that, in said step 3), said reading the data in the snapshot includes reading the data in the source device and reading the snapshot device Reading of data in. 9、根据权利要求8所述的快照系统的使用方法,其特征在于,所述的对源设备中数据的读取还包括以下步骤:9. The method for using the snapshot system according to claim 8, wherein the reading of the data in the source device further comprises the following steps: 步骤3-1-1)、根据所要读取数据的地址在所述位图中查询相应的位,若该位的值为1,则直接在本地读取,并返回所读取的数据值,若该位的值为0,则执行下一步;Step 3-1-1), query the corresponding bit in the bitmap according to the address of the data to be read, if the value of the bit is 1, then directly read locally, and return the read data value, If the value of this bit is 0, execute the next step; 步骤3-1-2)、判断源设备中的数据是否存在相应的快照,若不存在快照,则返回全零数据,若存在快照,则根据快照集链表将读数据请求进行转发,通过对快照数据的读取完成所述的数据读取过程。Step 3-1-2), determine whether there is a corresponding snapshot for the data in the source device, if there is no snapshot, then return all zero data, if there is a snapshot, forward the read data request according to the snapshot set linked list, pass the snapshot The data reading completes the data reading process. 10、根据权利要求9所述的快照系统的使用方法,其特征在于,所述的判断源设备中的数据是否存在相应的快照时,若所述源设备中的r0指针指向的是物理设备,则不存在快照;若所述源设备中的r0指针指向的是逻辑设备,则存在快照。10. The method for using the snapshot system according to claim 9, wherein when judging whether there is a corresponding snapshot for the data in the source device, if the r0 pointer in the source device points to a physical device, Then there is no snapshot; if the r0 pointer in the source device points to a logical device, then there is a snapshot. 11、根据权利要求8所述的快照系统的使用方法,其特征在于,当所述快照采用写时拷贝技术创建时,步骤3)还包括以下步骤,用于对该快照的数据读取:11. The method for using the snapshot system according to claim 8, wherein when the snapshot is created using the copy-on-write technology, step 3) further includes the following steps for reading data from the snapshot: 步骤3-2-1)、根据位图的值确定数据存放的物理设备,在确定过程中,从快照集链表的尾部向前遍历,如果在某一快照Sk上的位图值为1,则在其前一快照Sk-1的数据设备上读取数据,若位图值为0,则将读数据请求沿着快照集链表转发到前一快照上,直至找到位图值为1的快照;Step 3-2-1), determine the physical device where the data is stored according to the value of the bitmap, during the determination process, traverse forward from the tail of the snapshot set linked list, if the bitmap value on a certain snapshot S k is 1, Then read data on the data device of its previous snapshot S k-1 , if the bitmap value is 0, then forward the read data request to the previous snapshot along the snapshot set linked list until the bitmap value of 1 is found snapshot; 步骤3-2-2)、若在快照集链表的快照中没有找到位图值为1的快照,读数据请求到达源设备,若源设备的位图值为1时,在与源设备相邻快照的数据设备上读取数据,否则在源的数据设备上读取数据;Step 3-2-2), if no snapshot with a bitmap value of 1 is found in the snapshots of the snapshot set linked list, the read data request reaches the source device. If the bitmap value of the source device is 1, it is adjacent to the source device Read data on the data device of the snapshot, otherwise read data on the source data device; 当所述快照采用写时重定向技术创建时,步骤3)还包括以下步骤,用于对该快照的数据读取:When the snapshot is created using redirection-on-write technology, step 3) also includes the following steps for reading data from the snapshot: 首先根据位图的值确定数据存放的物理设备,然后从数据所存放的物理设备上读取数据;其中,在确定数据存放的物理设备时,从快照集链表的尾部向前遍历,若在某一快照Sk上的位图值为1,则在本地的数据设备上读取,并返回相应的数据,若位图值为0,则判断当前快照是否为快照集链表中最老的快照,即是否是快照链表尾端的快照,若是,则返回全0,否则将读数据请求转发到快照链表中的前一快照中。First, determine the physical device where the data is stored according to the value of the bitmap, and then read the data from the physical device where the data is stored; when determining the physical device where the data is stored, it traverses forward from the tail of the snapshot set linked list. A bitmap value on the snapshot S k is 1, then read on the local data device, and return corresponding data, if the bitmap value is 0, then judge whether the current snapshot is the oldest snapshot in the snapshot set linked list, That is, whether it is a snapshot at the end of the snapshot linked list, if so, return all 0, otherwise, forward the read data request to the previous snapshot in the snapshot linked list. 12、根据权利要求4所述的快照系统的使用方法,其特征在于,如果在快照中完成写数据操作,在所述的步骤3)中还包括以下步骤:12. The method for using the snapshot system according to claim 4, wherein if the data writing operation is completed in the snapshot, the step 3) further includes the following steps: 首先,根据位图的值确定数据存放的物理设备;然后在所确定的物理设备中写入数据。First, determine the physical device where the data is stored according to the value of the bitmap; then write data in the determined physical device. 13、根据权利要求12所述的快照系统的使用方法,其特征在于,当所述快照采用写时拷贝技术创建时,步骤3)还包括以下步骤,用于对快照数据的写:13. The method for using the snapshot system according to claim 12, wherein when the snapshot is created using the copy-on-write technology, step 3) further includes the following steps for writing the snapshot data: 对位图值进行判断,若位图值为1,则直接写入源的物理设备中;如果位图值为0,则在完成写时拷贝操作后再写入源的物理设备中。Judge the bitmap value, if the bitmap value is 1, write it directly into the source physical device; if the bitmap value is 0, write it into the source physical device after the copy-on-write operation is completed. 14、根据权利要求12所述的快照系统的使用方法,其特征在于,当所述快照采用写时重定向技术创建时,步骤3)还包括以下步骤,用于对快照数据的写:14. The method for using the snapshot system according to claim 12, wherein when the snapshot is created using redirection-on-write technology, step 3) further includes the following steps for writing the snapshot data: 对位图值进行判断,如果位图值为1,则直接写入源的物理设备中;如果位图值为0,进行数据块的数据合并后再写入源的物理设备中。The bitmap value is judged, if the bitmap value is 1, it is directly written into the source physical device; if the bitmap value is 0, the data of the data block is merged and then written into the source physical device. 15、根据权利要求4所述的快照系统的使用方法,其特征在于,在所述的步骤3)中,当所述快照采用写时拷贝技术时,在删除快照的过程中,只能删除时间点最早的快照。15. The method for using the snapshot system according to claim 4, characterized in that, in the step 3), when the snapshot adopts the copy-on-write technology, only time can be deleted in the process of deleting the snapshot Click on the oldest snapshot. 16、根据权利要求4所述的快照系统的使用方法,其特征在于,在所述的步骤3)中,当所述快照采用写时重定向技术时,在对所要删除的快照做删除操作前,对删除快照所要触发的数据进行合并。16. The method for using the snapshot system according to claim 4, characterized in that, in the step 3), when the snapshot adopts redirect-on-write technology, before performing the delete operation on the snapshot to be deleted , to merge the data to be triggered by deleting the snapshot. 17、根据权利要求16所述的快照系统的使用方法,其特征在于,所述的数据合并包括以下步骤:17. The method for using the snapshot system according to claim 16, characterized in that said data merging comprises the following steps: 步骤3-3-1)、依次读取快照设备S2中每个数据块在位图中的对应位;其中,S2是要删除的快照设备S1的相邻快照设备;Step 3-3-1), sequentially read the corresponding bit of each data block in the snapshot device S2 in the bitmap; wherein, S2 is the adjacent snapshot device of the snapshot device S1 to be deleted; 步骤3-3-2)、将快照设备S2中的位图位与快照设备S 1的相应位图位进行组合,可得到四种情况:Step 3-3-2), the bitmap bit in the snapshot device S2 is combined with the corresponding bitmap bit of the snapshot device S1, four situations can be obtained: S2          S1S2 S1 a、0        0a. 0 0 b、0        1b. 0 1 c、1        0c, 1 0 d、1        1d. 1 1 当S2的位图位为1时,表示有新数据写过,因此在数据合并时只需要将S2的位图位为1的数据块拷贝回S1的数据设备上;When the bitmap bit of S2 is 1, it means that new data has been written, so only the data block whose bitmap bit of S2 is 1 needs to be copied back to the data device of S1 during data merging; 步骤3-3-3)、执行数据回移操作,将S2的数据设备中的数据拷贝到S1的数据设备上;Step 3-3-3), execute the data move back operation, copy the data in the data device of S2 to the data device of S1; 步骤3-3-4)、数据回移结束后,置S2的位图相应位为0;Step 3-3-4), after the data transfer is completed, set the corresponding bit of the bitmap of S2 to be 0; 步骤3-3-5)、如果所有数据块处理完,结束数据合并操作,否则重新执行步骤3-3-1),继续处理下一个数据块。Step 3-3-5), if all data blocks have been processed, end the data merging operation, otherwise re-execute step 3-3-1), and continue to process the next data block.
CNB200710179711XA 2007-12-17 2007-12-17 A kind of snapshot system and using method thereof Expired - Fee Related CN100565530C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200710179711XA CN100565530C (en) 2007-12-17 2007-12-17 A kind of snapshot system and using method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200710179711XA CN100565530C (en) 2007-12-17 2007-12-17 A kind of snapshot system and using method thereof

Publications (2)

Publication Number Publication Date
CN101183383A CN101183383A (en) 2008-05-21
CN100565530C true CN100565530C (en) 2009-12-02

Family

ID=39448659

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200710179711XA Expired - Fee Related CN100565530C (en) 2007-12-17 2007-12-17 A kind of snapshot system and using method thereof

Country Status (1)

Country Link
CN (1) CN100565530C (en)

Families Citing this family (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8229972B2 (en) * 2009-08-28 2012-07-24 International Business Machines Corporation Extended data storage system
CN101661415B (en) * 2009-09-21 2012-07-11 中兴通讯股份有限公司 Method for memorizing snapshot data and system for memorizing snapshot
US20130159257A1 (en) * 2011-12-20 2013-06-20 Netapp, Inc. Systems, Method, and Computer Program Products Providing Sparse Snapshots
CN102609335B (en) * 2012-01-12 2014-07-02 浪潮(北京)电子信息产业有限公司 Device and method for protecting metadata by copy-on-write
CN103116533A (en) * 2012-05-28 2013-05-22 北京智网科技股份有限公司 Snapshot implementation method
CN102968381A (en) * 2012-11-19 2013-03-13 浪潮电子信息产业股份有限公司 Method for improving snapshot performance by using solid state disk
CN103729265B (en) * 2013-12-30 2017-01-04 华为技术有限公司 A kind of guard method storing data and device
CN103838647B (en) * 2014-02-17 2018-02-06 中国科学院计算技术研究所 A kind of method and system of the data mode conversion remapped based on snapshot
CN104169864B (en) * 2014-03-13 2017-03-29 华为技术有限公司 Redirected writing method and device
CN104156326A (en) * 2014-08-04 2014-11-19 浪潮(北京)电子信息产业有限公司 Method for achieving data consistency
CN104360914B (en) * 2014-10-22 2017-10-13 浪潮(北京)电子信息产业有限公司 Incremental snapshot method and apparatus
CN104484471B (en) * 2014-12-31 2017-09-15 天津南大通用数据技术股份有限公司 A kind of implementation method of high-performance data storage engines
CN105808449B (en) * 2014-12-31 2018-11-27 中国电信股份有限公司 A kind of virtual memory image method for edition management and system for virtual machine
US10257273B2 (en) 2015-07-31 2019-04-09 Netapp, Inc. Systems, methods and devices for RDMA read/write operations
US9952797B2 (en) 2015-07-31 2018-04-24 Netapp, Inc. Systems, methods and devices for addressing data blocks in mass storage filing systems
CN105138330B (en) * 2015-08-25 2018-11-13 浪潮(北京)电子信息产业有限公司 The processing method and processing unit of dygraphs Drawing Objects
CN106951375B (en) * 2016-01-06 2021-11-30 北京忆恒创源科技股份有限公司 Method and device for deleting snapshot volume in storage system
CN107179964A (en) * 2016-03-11 2017-09-19 中兴通讯股份有限公司 The reading/writing method and device of snapshot
CN106408178A (en) * 2016-09-05 2017-02-15 南京简睿捷软件开发有限公司 Multi-dimensional data snapshot-based product BOM management method and device
CN106569738B (en) * 2016-09-30 2019-11-29 华为技术有限公司 A kind of method and device for deleting cascade snapshot
CN106844597A (en) * 2017-01-14 2017-06-13 郑州云海信息技术有限公司 The method and its device of a kind of quick deletion dependent snapshot target volume
CN108460045B (en) * 2017-02-21 2022-11-18 中兴通讯股份有限公司 Snapshot processing method and distributed block storage system
CN106909514B (en) * 2017-03-01 2021-04-30 郑州云海信息技术有限公司 Method and device for positioning snapshot disk address
CN107423233B (en) * 2017-07-19 2020-09-25 杭州宏杉科技股份有限公司 Writable snapshot implementation method and device
CN107656703A (en) * 2017-09-28 2018-02-02 郑州云海信息技术有限公司 A kind of method and system of idle block inquiries
CN108647270A (en) * 2018-04-28 2018-10-12 尚谷科技(天津)有限公司 A method of the Data Migration based on fault-tolerant time daily record
CN109117308A (en) * 2018-07-27 2019-01-01 华为技术有限公司 The method and apparatus of snapshot processing
CN110781028B (en) * 2018-07-30 2023-04-11 阿里巴巴集团控股有限公司 Data backup method, data recovery method, data backup device, data recovery device and computing equipment
CN109063210B (en) * 2018-09-25 2022-07-08 郑州云海信息技术有限公司 Resource object query method, device, equipment and storage medium of storage system
CN109669818B (en) * 2018-12-20 2019-11-12 广州鼎甲计算机科技有限公司 Continuous data protection method and system without local cache
CN110688071A (en) * 2019-09-29 2020-01-14 上海英方软件股份有限公司 Data synchronization method and system for reducing data synchronization quantity
CN110795389B (en) * 2019-10-28 2022-09-30 深信服科技股份有限公司 Storage snapshot based copying method, user equipment, storage medium and device
CN113312309B (en) * 2020-02-26 2023-06-09 顺丰科技有限公司 Snapshot chain management method, device and storage medium
CN113468105B (en) * 2020-03-31 2025-01-07 阿里巴巴集团控股有限公司 Data structure of data snapshot, related data processing method, device and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1295292A (en) * 1999-11-05 2001-05-16 国际商业机器公司 Method and system for multi-language wide world web service device thereof
CN1314634A (en) * 2000-03-17 2001-09-26 索尼株式会社 File convertion method, file convertor and file display system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1295292A (en) * 1999-11-05 2001-05-16 国际商业机器公司 Method and system for multi-language wide world web service device thereof
CN1314634A (en) * 2000-03-17 2001-09-26 索尼株式会社 File convertion method, file convertor and file display system

Also Published As

Publication number Publication date
CN101183383A (en) 2008-05-21

Similar Documents

Publication Publication Date Title
CN100565530C (en) A kind of snapshot system and using method thereof
JP5000316B2 (en) Object-based data storage
US7363540B2 (en) Transaction-safe FAT file system improvements
US6651075B1 (en) Support for multiple temporal snapshots of same volume
US10120869B2 (en) Method and apparatus for fault-tolerant memory management
US6823436B2 (en) System for conserving metadata about data snapshots
CN102779180B (en) The operation processing method of data-storage system, data-storage system
CN105718217B (en) A kind of method and device of simplify configuration storage pool data sign processing
CN107391774B (en) Garbage Collection Method for Log File System Based on Data Deduplication
US7933938B2 (en) File storage system, file storing method and file searching method therein
CN110531940A (en) Video file processing method and processing device
CN109947363B (en) Data caching method of distributed storage system
JP2008015769A (en) Storage system and write distribution method
US7213116B2 (en) Method and apparatus for mirroring objects between storage systems
US20070061540A1 (en) Data storage system using segmentable virtual volumes
JP2005510780A (en) Sharing objects between computer systems
CN101639848A (en) Spatial data engine and method applying management spatial data thereof
CN106844584B (en) Metadata structure and its operation method, location method, segmentation method
CN107180092A (en) A kind of control method of file system, device and terminal
CN113377292B (en) A stand-alone storage engine
CN111007990B (en) Positioning method for quickly positioning data block references in snapshot system
US6629203B1 (en) Alternating shadow directories in pairs of storage spaces for data storage
KR100907477B1 (en) Apparatus and method for managing index information of data stored in flash memory
US20060085663A1 (en) Method for keeping snapshot image in a storage system
US10990486B2 (en) Data storage system with repair of mid-level mapping blocks of internal file system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: TIANJIN ZHONGKE BLUE WHALE INFORMATION TECHNOLOGY

Free format text: FORMER OWNER: INST. OF COMPUTING TECHN. ACADEMIA SINICA

Effective date: 20091127

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20091127

Address after: Tianjin Huayuan Industrial Park New Technology Industrial Park Development Road No. 6 6 Haitai green industry base building F 5 Gate No. 201

Patentee after: TIANJIN ZHONGKE BLUEWHALE INFORMATION TECHNOLOGY CO.,LTD.

Address before: No. 6 South Road, Zhongguancun Academy of Sciences, Beijing, Haidian District

Patentee before: Institute of Computing Technology, Chinese Academy of Sciences

ASS Succession or assignment of patent right

Owner name: BEIJING ZHONGKE BLUEWHALE INFORMATION TECHNOLOGY C

Effective date: 20140813

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20140813

Address after: 300384 Tianjin Huayuan Industrial Park New Technology Industrial Park Development Road No. 6 6 Haitai green industry base building F 5 Gate No. 201

Patentee after: TIANJIN ZHONGKE BLUEWHALE INFORMATION TECHNOLOGY CO.,LTD.

Patentee after: Beijing Zhongke blue whale Information Technology Co.,Ltd.

Address before: 300384 Tianjin Huayuan Industrial Park New Technology Industrial Park Development Road No. 6 6 Haitai green industry base building F 5 Gate No. 201

Patentee before: TIANJIN ZHONGKE BLUEWHALE INFORMATION TECHNOLOGY CO.,LTD.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20091202

Termination date: 20211217

CF01 Termination of patent right due to non-payment of annual fee