[go: up one dir, main page]

CN107526656B - A kind of cloud recovery method and device - Google Patents

A kind of cloud recovery method and device Download PDF

Info

Publication number
CN107526656B
CN107526656B CN201710772413.5A CN201710772413A CN107526656B CN 107526656 B CN107526656 B CN 107526656B CN 201710772413 A CN201710772413 A CN 201710772413A CN 107526656 B CN107526656 B CN 107526656B
Authority
CN
China
Prior art keywords
snapshot
volume
version
restored
snapshot version
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.)
Active
Application number
CN201710772413.5A
Other languages
Chinese (zh)
Other versions
CN107526656A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201710772413.5A priority Critical patent/CN107526656B/en
Publication of CN107526656A publication Critical patent/CN107526656A/en
Application granted granted Critical
Publication of CN107526656B publication Critical patent/CN107526656B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

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

Abstract

本发明实施例公开了一种云复原方法及装置。其中,方法包括根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本;当判定待复原快照版本为当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系;根据目标快照卷与映射关系,从本地存储系统中获取复原数据,以实现快照版本的复原;其中,目标快照卷为第一快照卷或第二快照卷,第一快照卷、第二快照卷交替进行数据的读写,用于记录本地存储系统在云端进行存储时的快照信息。本申请的技术方案避免了从云端获取数据,大大的缩减了数据获取的时间,从而提高云复原的速率,还可降低云下载的成本。

Figure 201710772413

The embodiment of the present invention discloses a cloud restoration method and device. The method includes determining whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the acquired snapshot version information to be restored; when it is determined that the snapshot version to be restored is the previous snapshot version of the current snapshot version, according to the restoration time in Obtain the target snapshot volume and the corresponding mapping relationship at the corresponding moment in the local storage system; obtain the restoration data from the local storage system according to the target snapshot volume and the mapping relationship, so as to realize the restoration of the snapshot version; wherein, the target snapshot volume is the first snapshot Volume or the second snapshot volume, the first snapshot volume and the second snapshot volume alternately read and write data, and are used to record snapshot information when the local storage system stores in the cloud. The technical solution of the present application avoids acquiring data from the cloud, greatly reducing the time for data acquisition, thereby increasing the rate of cloud restoration, and reducing the cost of cloud download.

Figure 201710772413

Description

一种云复原方法及装置A kind of cloud recovery method and device

技术领域technical field

本发明实施例涉及存储技术领域,特别是涉及一种云复原方法及装置。Embodiments of the present invention relate to the field of storage technologies, and in particular, to a cloud restoration method and apparatus.

背景技术Background technique

随着大数据、云技术的迅猛发展,具有海量、安全、低成本及高可靠性的云存储技术应用而生,并得到了快速的发展。With the rapid development of big data and cloud technology, cloud storage technology with mass, security, low cost and high reliability has been applied and developed rapidly.

云存储技术可使用户在互联网的任何位置存储数据或者访问数据,而无需电源、场地、大量本地存储空间等这些硬件环境,节约了管理成本,使所想即所得变成可能。云存储从功能特性上包括云备份、云缓存、云镜像、云分层等,其中,云备份为将本地数据通过快照技术备份在云端,可使数据出错时回滚在本地,使得数据持续可用,保证整个系统的稳定性与可靠性。Cloud storage technology enables users to store data or access data anywhere on the Internet without the need for hardware environments such as power supply, venue, and a large amount of local storage space, saving management costs and making it possible to get what you want. Cloud storage includes cloud backup, cloud cache, cloud mirroring, cloud tiering, etc., among which, cloud backup is to back up local data in the cloud through snapshot technology, so that data can be rolled back to the local if there is an error, so that the data can be continuously available. , to ensure the stability and reliability of the entire system.

现有技术中,在进行云复原时,不论为最早的快照版本还是次新版本的快照,都需要直接从云端获取复原目标快照数据,然后拷贝在本地原卷上。直接从云端获取数据,不仅数据的获取速度受限于网络带宽或者云下载速度,导致复原速度较低,且还会增加云下载的成本。In the prior art, during cloud restoration, whether it is the earliest snapshot version or the snapshot of the next newest version, the restoration target snapshot data needs to be directly obtained from the cloud, and then copied to the local original volume. Obtaining data directly from the cloud not only limits the speed of data acquisition due to network bandwidth or cloud download speed, resulting in low recovery speed, but also increases the cost of cloud download.

发明内容SUMMARY OF THE INVENTION

本发明实施例的目的是提供一种云复原方法及装置,以提高云复原的速率。The purpose of the embodiments of the present invention is to provide a cloud restoration method and apparatus, so as to improve the speed of cloud restoration.

为解决上述技术问题,本发明实施例提供以下技术方案:In order to solve the above-mentioned technical problems, the embodiments of the present invention provide the following technical solutions:

本发明实施例一方面提供了一种云复原方法,包括:One aspect of the embodiments of the present invention provides a cloud restoration method, including:

根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本;According to the obtained snapshot version information to be restored, determine whether the snapshot version to be restored is the previous snapshot version of the current snapshot version;

当判定待复原快照版本为所述当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系;When it is determined that the snapshot version to be restored is the last snapshot version of the current snapshot version, obtain the target snapshot volume and the corresponding mapping relationship at the corresponding moment in the local storage system according to the restoration time;

根据所述目标快照卷与所述映射关系,从所述本地存储系统中获取复原数据,以实现快照版本的复原;Acquire restoration data from the local storage system according to the target snapshot volume and the mapping relationship, so as to restore the snapshot version;

其中,所述目标快照卷为第一快照卷或第二快照卷,所述本地存储系统中包含第一快照卷、第二快照卷、第一映射及第二映射,用于记录本地存储系统在云端进行存储时的快照信息,所述第一快照卷、所述第二快照卷交替进行数据的读写,所述第一映射为所述第一快照卷与原卷的映射关系,所述第二映射为所述第二快照卷与所述原卷的映射关系。Wherein, the target snapshot volume is a first snapshot volume or a second snapshot volume, and the local storage system includes a first snapshot volume, a second snapshot volume, a first mapping and a second mapping, which are used to record the local storage system in Snapshot information when the cloud performs storage, the first snapshot volume and the second snapshot volume alternately read and write data, the first mapping is the mapping relationship between the first snapshot volume and the original volume, and the first snapshot volume is the mapping relationship between the first snapshot volume and the original volume. The second mapping is the mapping relationship between the second snapshot volume and the original volume.

可选的,所述根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本包括:Optionally, determining whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the obtained snapshot version information to be restored includes:

根据获取的待复原快照版本的复原时间与当前快照版本的时间,判断所述待复原快照版本是否为所述当前快照版本的上一个快照版本。According to the acquired restoration time of the snapshot version to be restored and the time of the current snapshot version, it is determined whether the snapshot version to be restored is the last snapshot version of the current snapshot version.

可选的,所述根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本包括:Optionally, determining whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the obtained snapshot version information to be restored includes:

根据获取的待复原快照版本的复原版本标识号与当前快照版本的版本标识号,判断所述待复原快照版本是否为所述当前快照版本的上一个快照版本。According to the acquired restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version, it is determined whether the snapshot version to be restored is the last snapshot version of the current snapshot version.

本发明实施例另一方面提供了一种云复原装置,包括:Another aspect of the embodiments of the present invention provides a cloud restoration device, including:

判断模块,用于根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本;The judgment module is used for judging whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the obtained snapshot version information to be restored;

获取模块,用于当判定待复原快照版本为所述当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系;所述目标快照卷为第一快照卷或第二快照卷,所述本地存储系统中包含第一快照卷、第二快照卷、第一映射及第二映射,用于记录本地存储系统在云端进行存储时的快照信息,所述第一快照卷、所述第二快照卷交替进行数据的读写,所述第一映射为所述第一快照卷与原卷的映射关系,所述第二映射为所述第二快照卷与所述原卷的映射关系;an obtaining module, configured to obtain the target snapshot volume and the corresponding mapping relationship at the corresponding moment in the local storage system according to the restoration time when it is determined that the snapshot version to be restored is the last snapshot version of the current snapshot version; the target snapshot volume It is the first snapshot volume or the second snapshot volume, and the local storage system includes the first snapshot volume, the second snapshot volume, the first mapping and the second mapping, which are used to record the snapshot information when the local storage system stores in the cloud , the first snapshot volume and the second snapshot volume alternately read and write data, the first mapping is the mapping relationship between the first snapshot volume and the original volume, and the second mapping is the second the mapping relationship between the snapshot volume and the original volume;

复原模块,用于根据所述目标快照卷与所述映射关系,从所述本地存储系统中获取复原数据,以实现快照版本的复原。The restoration module is configured to obtain restoration data from the local storage system according to the target snapshot volume and the mapping relationship, so as to realize restoration of the snapshot version.

可选的,所述判断模块为根据获取的待复原快照版本的复原时间与当前快照版本的时间,判断所述待复原快照版本是否为所述当前快照版本的上一个快照版本的模块。Optionally, the judging module is a module for judging whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the obtained restoration time of the snapshot version to be restored and the time of the current snapshot version.

可选的,所述判断模块为根据获取的待复原快照版本的复原版本标识号与当前快照版本的版本标识号,判断所述待复原快照版本是否为所述当前快照版本的上一个快照版本的模块。Optionally, the judging module is to judge whether the snapshot version to be restored is the previous snapshot version of the current snapshot version according to the obtained restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version. module.

本发明实施例提供了一种云复原方法,根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本;当判定待复原快照版本为当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系;根据目标快照卷与映射关系,从本地存储系统中获取复原数据,以实现快照版本的复原;其中,目标快照卷为第一快照卷或第二快照卷,第一快照卷、第二快照卷交替进行数据的读写,用于记录本地存储系统在云端进行存储时的快照信息。The embodiment of the present invention provides a cloud restoration method, according to the acquired snapshot version information to be restored, it is judged whether the snapshot version to be restored is the previous snapshot version of the current snapshot version; when it is determined that the snapshot version to be restored is the previous snapshot version of the current snapshot version When the snapshot version is used, the target snapshot volume and the corresponding mapping relationship at the corresponding moment are obtained in the local storage system according to the restoration time; according to the target snapshot volume and the mapping relationship, the restoration data is obtained from the local storage system to realize the restoration of the snapshot version; , the target snapshot volume is the first snapshot volume or the second snapshot volume, and the first snapshot volume and the second snapshot volume alternately perform data reading and writing, and are used to record snapshot information when the local storage system stores in the cloud.

本申请提供的技术方案的优点在于,基于云备份时两个映射和两个快照卷交替工作的特性下,由于本地存储系统保存两份快照卷,分别为最新和次新时刻,当待复原的快照版本为次新版本时,也就是当前快照版本的上一个版本,可从本地存储系统直接拷贝数据,进行复原,避免了从云端获取数据,大大的缩减了数据获取的时间,从而提高云复原的速率,还可降低云下载的成本。The advantage of the technical solution provided by the present application is that, based on the feature that two mappings and two snapshot volumes work alternately during cloud backup, since the local storage system saves two snapshot volumes, which are the latest and the next time respectively, when the to-be-restored snapshot volume is stored When the snapshot version is the next latest version, that is, the previous version of the current snapshot version, data can be copied directly from the local storage system and restored, avoiding the need to obtain data from the cloud and greatly reducing the time for data acquisition, thereby improving cloud recovery. It also reduces the cost of cloud downloads.

此外,本发明实施例还针对云复原方法提供了相应的实现装置,进一步使得所述方法更具有实用性,所述装置具有相应的优点。In addition, the embodiment of the present invention also provides a corresponding implementation device for the cloud restoration method, which further makes the method more practical, and the device has corresponding advantages.

附图说明Description of drawings

为了更清楚的说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following will briefly introduce the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only For some embodiments of the present invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例提供的一种云复原方法的流程示意图;1 is a schematic flowchart of a cloud restoration method according to an embodiment of the present invention;

图2为本发明实施例提供的一种本地存储系统快照卷的建立示意图;2 is a schematic diagram of establishing a snapshot volume of a local storage system according to an embodiment of the present invention;

图3为本发明实施例提供的一种云存储的快照方法的原理示意图;3 is a schematic diagram of the principle of a cloud storage snapshot method according to an embodiment of the present invention;

图4为本发明实施例提供的云复原装置的一种具体实施方式结构图。FIG. 4 is a structural diagram of a specific implementation manner of a cloud restoration apparatus provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定的顺序。此外术语“包括”和“具有”以及他们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可包括没有列出的步骤或单元。The terms "first", "second", "third", "fourth", etc. in the description and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. . Furthermore, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or elements is not limited to the listed steps or elements, but may include unlisted steps or elements.

在介绍了本发明实施例的技术方案后,下面详细的说明本申请的各种非限制性实施方式。After introducing the technical solutions of the embodiments of the present invention, various non-limiting implementations of the present application are described in detail below.

首先参见图1,图1为本发明实施例提供的一种云复原方法的流程示意图,本发明实施例可包括以下内容:Referring first to FIG. 1, FIG. 1 is a schematic flowchart of a cloud restoration method provided by an embodiment of the present invention. The embodiment of the present invention may include the following contents:

S101:根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本。S101: According to the acquired snapshot version information to be restored, determine whether the snapshot version to be restored is a previous snapshot version of the current snapshot version.

待复原快照版本信息可包括待复原快照版本的时间与待复原快照版本的版本号,当然,也可包括快照时的其他信息,这均不影响本申请的实现。The snapshot version information to be restored may include the time of the snapshot version to be restored and the version number of the snapshot version to be restored. Of course, it may also include other information at the time of the snapshot, which does not affect the implementation of the present application.

根据获取的待复原快照版本的复原时间与当前快照版本的时间,判断待复原快照版本是否为当前快照版本的上一个快照版本。According to the obtained restoration time of the snapshot version to be restored and the time of the current snapshot version, it is determined whether the snapshot version to be restored is the previous snapshot version of the current snapshot version.

根据获取的待复原快照版本的复原版本标识号与当前快照版本的版本标识号,判断待复原快照版本是否为当前快照版本的上一个快照版本。According to the acquired restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version, it is determined whether the snapshot version to be restored is the previous snapshot version of the current snapshot version.

上一个快照版本卷即为当前快照版本的前一次快照版本,待复原快照版本的时间为该快照版本进行快照的时间(即复原时间),例如,原卷v分别在t0、t1、t2、t3、t4进行了4次快照,当进行第5次快照时,它的上一个快照版本即为t4时刻对应的快照,即t0为t1上一个快照版本,t2为t3上一个快照版本,t3为t4上一个快照版本。The last snapshot version volume is the previous snapshot version of the current snapshot version, and the time of the snapshot version to be restored is the time when the snapshot version is snapshotted (ie, the restoration time). For example, the original volume v is at t 0 , t 1 , and t respectively. 2 , t 3 , t 4 have taken 4 snapshots, when the fifth snapshot is taken, its last snapshot version is the snapshot corresponding to t 4 , that is, t 0 is the last snapshot version of t 1 , and t 2 is t3 is the last snapshot version, t3 is the last snapshot version of t4 .

每个快照版本都具有唯一的一个标识号,一般可标识号的生成按照快照的先后顺序进行命名,故可通过快照复原时间与当前版本时间对比,确定是不是上一个版本,当然也可通过版本号的比对来判断,例如当前快照版本的版本号为v1.2.2,而待复原快照版本的版本号可为v1.2.1,那么可确定待复原快照版本为当前快照版本的前一个快照版本,即为次新快照。Each snapshot version has a unique identification number. Generally, the generation of the identification number is named according to the sequence of snapshots. Therefore, the snapshot restoration time can be compared with the current version time to determine whether it is the previous version. Of course, it can also be determined by the version For example, the version number of the current snapshot version is v1.2.2, and the version number of the snapshot version to be restored can be v1.2.1, then it can be determined that the snapshot version to be restored is the previous snapshot version of the current snapshot version. This is the next new snapshot.

S102:当判定待复原快照版本为当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系。S102: When it is determined that the snapshot version to be restored is the previous snapshot version of the current snapshot version, obtain the target snapshot volume and the corresponding mapping relationship at the corresponding moment in the local storage system according to the restoration time.

S103:根据目标快照卷与映射关系,从本地存储系统中获取复原数据,以实现快照版本的复原。S103: Acquire restoration data from the local storage system according to the target snapshot volume and the mapping relationship, so as to realize restoration of the snapshot version.

目标快照卷为第一快照卷或第二快照卷,本地存储系统中包含第一快照卷、第二快照卷、第一映射及第二映射,用于记录本地存储系统在云端进行存储时的快照信息,第一快照卷、第二快照卷交替进行数据的读写,第一映射为第一快照卷与原卷的映射关系,第二映射为第二快照卷与原卷的映射关系。The target snapshot volume is the first snapshot volume or the second snapshot volume, and the local storage system includes the first snapshot volume, the second snapshot volume, the first mapping, and the second mapping, which are used to record snapshots when the local storage system stores in the cloud The first snapshot volume and the second snapshot volume alternately read and write data, the first mapping is the mapping relationship between the first snapshot volume and the original volume, and the second mapping is the mapping relationship between the second snapshot volume and the original volume.

相应的映射关系为目标快照卷与原卷的映射关系,例如,当目标快照卷为第一快照卷,相应的映射关系为第一映射。The corresponding mapping relationship is the mapping relationship between the target snapshot volume and the original volume. For example, when the target snapshot volume is the first snapshot volume, the corresponding mapping relationship is the first mapping.

当检测到原卷云使能时,也就是本地存储系统中的原卷转化为云卷时,预先在本地存储系统创建第一快照卷、第二快照卷、第一映射、第二映射,第一映射为第一快照卷与原卷的映射关系,第二映射为第二快照卷与原卷的映射关系,映射可利用位图进行表示。例如图2所示,本地存储系统的原卷V有四块数据,v转化成云卷时,本地存储系统自动生成两个新的自精简卷,即第一快照卷FCA、第二快照卷FCB,以及原卷对应到这两个快照卷的映射fcmapA、fcmapB。When it is detected that the original volume cloud is enabled, that is, when the original volume in the local storage system is converted into a cloud volume, the first snapshot volume, the second snapshot volume, the first mapping, and the second mapping are created in the local storage system in advance. The first mapping is the mapping relationship between the first snapshot volume and the original volume, and the second mapping is the mapping relationship between the second snapshot volume and the original volume, and the mapping can be represented by a bitmap. For example, as shown in Figure 2, the original volume V of the local storage system has four pieces of data. When v is converted into a cloud volume, the local storage system automatically generates two new self-reducing volumes, namely the first snapshot volume FCA and the second snapshot volume FCB , and the mapping fcmapA and fcmapB of the original volume corresponding to the two snapshot volumes.

在原卷进行云存储时,需要通过快照操作,原卷进行第一次快照时,为全量拷贝,第二次至以后的每次都是进行增量拷贝,在进行快照时,第一快照卷和第二快照卷、第一映射与第二映射交替工作,举例来说,t0时,初始化卷FCA、fcmapA为0000、fcmapB为1111,云端t0时刻数据为原卷的全量拷贝,从卷FCA读取实际数据,从哪个块读取决于fcmapB中1的位置。t0到t1间,有主机IO时,执行COW,fcmapA将COW块变为1,卷FCA记录COW旧数据。t1时,初始化卷FCB、fcmapB为0000,fcmapA不变。云端t1时刻数据为t0到t1的增量数据,数据从卷FCB读,读哪个位置为fcmapA中1的位置。t2时,交替回来,初始化卷FCA、fcmapA为0000,fcmapB不变。云端t2时刻数据为t1到t2的增量数据,数据从卷FCA读,读哪个位置为fcmapB中1的位置。依次类推。When the original volume is used for cloud storage, a snapshot operation is required. The first snapshot of the original volume is a full copy, and the second and subsequent times are incremental copies. When a snapshot is taken, the first snapshot volume and the The second snapshot volume, the first mapping and the second mapping work alternately. For example, at t 0 , the initialized volume FCA, fcmapA is 0000, fcmapB is 1111, and the cloud data at time t 0 is a full copy of the original volume, from the volume FCA The actual data is read, which block to read from depends on the position of the 1 in fcmapB. From t 0 to t 1 , when there is host IO, COW is executed, fcmapA changes the COW block to 1, and the volume FCA records the COW old data. At t 1 , the initialized volumes FCB and fcmapB are 0000, and fcmapA remains unchanged. At time t1 in the cloud, the data is incremental data from t 0 to t 1. The data is read from the volume FCB, and which position is read is the position of 1 in fcmapA. At t 2 , alternately come back, initialize volumes FCA and fcmapA to 0000, and fcmapB remains unchanged. The data at time t 2 in the cloud is the incremental data from t 1 to t 2. The data is read from the volume FCA, and which position is read is the position of 1 in fcmapB. And so on.

本地存储系统中包括的两个快照卷,分别为最新时刻的快照版本及次新时刻的快照版本,故,在复原次新时刻的快照版本,可直接从次新版本对应的快照卷及对应的关系读取复原数据。The two snapshot volumes included in the local storage system are the snapshot version at the latest moment and the snapshot version at the next new moment. Relational reads restore data.

举例来说,当前快照版本的数据从卷FCA读取,则次新版本的对应的目标快照卷为卷FCB,那么就可以根据卷FCB及fcmapB来获取复原数据。For example, the data of the current snapshot version is read from the volume FCA, and the corresponding target snapshot volume of the next new version is the volume FCB, then the recovery data can be obtained according to the volume FCB and fcmapB.

在本发明实施例提供的技术方案中,基于云备份时两个映射和两个快照卷交替工作的特性下,由于本地存储系统保存两份快照卷,分别为最新和次新时刻,当待复原的快照版本为次新版本时,也就是当前快照版本的上一个版本,可从本地存储系统直接拷贝数据,进行复原,避免了从云端获取数据,大大的缩减了数据获取的时间,从而提高云复原的速率,还可降低云下载的成本。In the technical solution provided by the embodiment of the present invention, based on the feature that two mappings and two snapshot volumes work alternately during cloud backup, since the local storage system saves two snapshot volumes, which are respectively the latest and the next time, when the backup is to be restored When the snapshot version is the next latest version, that is, the previous version of the current snapshot version, data can be copied directly from the local storage system and restored, avoiding the need to obtain data from the cloud, greatly reducing the time for data acquisition, thereby improving cloud The recovery rate can also reduce the cost of cloud downloads.

为了使本领域技术人员更加了解本申请提供的技术方案,本申请以具体实例阐述本申请的技术方案,请参阅图3,具体可包括:In order to make those skilled in the art better understand the technical solutions provided by the application, the application illustrates the technical solutions of the application with specific examples, please refer to FIG. 3 , which may specifically include:

t0时刻创建快照g1,初始化fcmapA和FCA;t1时刻创建快照g2,初始化fcmapB和FCB;t1到t2间,主机io对原卷v第一块有写入(图中填充黑色的数据块),fcmapB变为1000,FCB中第一个块存入COW的旧数据。t2时刻,原卷v数据为白白黑白(数据块的颜色),创建第三次云快照,交替地触发初始化fcmapA为0000,FCA数据为空。下面开始增量拷贝数据至云端,由于fcmapB为1000,因此第一块数据需要拷贝到云端g3的第一块位置。由于fcmapA为0000,因此数据从原卷v读取,也就是刚刚t1到t2之间,主机写入的第一块数据,即增量数据。拷贝到云端后,g3置为3121,表明第一块数据存放在g3上,第二、四块数据存放在g1上,第三块数据存放在g2上。Snapshot g 1 is created at time t 0 , fcmapA and FCA are initialized; snapshot g 2 is created at time t 1 , fcmapB and FCB are initialized; between t 1 and t 2 , host io writes to the first block of original volume v (black in the figure). data block), fcmapB becomes 1000, and the first block in FCB stores the old data of COW. At time t2 , the data of the original volume v is white, white and black (the color of the data block), and the third cloud snapshot is created, which alternately triggers the initialization of fcmapA to 0000 and the FCA data to be empty. Next, start incrementally copying data to the cloud. Since fcmapB is 1000, the first piece of data needs to be copied to the first piece of cloud g3. Since fcmapA is 0000, the data is read from the original volume v, that is, the first block of data written by the host between t 1 and t 2 , that is, incremental data. After copying to the cloud, g 3 is set to 3121, indicating that the first piece of data is stored on g 3 , the second and fourth pieces of data are stored on g 1 , and the third piece of data is stored on g 2 .

最新快照数据(即g3)指向FCA,次新快照数据(即g2)指向FCB。若复原到g2,则从本地读取FCB、fcmapB即可。由于fcmapB为1000,则第一块数据从FCB读取拷贝到原卷v,其他块在原卷v上,无需复原。复原后原卷v数据为白白黑白,符合创建g2时t1时刻数据。The latest snapshot data (ie g 3 ) points to the FCA, and the next new snapshot data (ie g 2 ) points to the FCB. To restore to g 2 , FCB and fcmapB can be read locally. Since fcmapB is 1000, the first block of data is read and copied from the FCB to the original volume v, and the other blocks are on the original volume v and do not need to be restored. After restoration, the data of the original volume v is white and white, which is consistent with the data at time t 1 when g 2 was created.

本申请结合云备份中两个fcmap和两个快照卷交替工作特性,提出了一种快速云复原方法,由于本地保存两份快照卷,分别是最新和次新时刻的,如果复原目标快照是次新,则直接从本地获取数据进行拷贝复原,而不从云端获取。提高了复原速度,减少了云下载成本。This application proposes a fast cloud recovery method based on the alternate working characteristics of two fcmaps and two snapshot volumes in cloud backup. Since two snapshot volumes are stored locally, they are the latest and the next time respectively. If the restoration target snapshot is the second time If it is new, the data is obtained directly from the local for copy and restoration, rather than from the cloud. Improved recovery speed and reduced cloud download costs.

本发明实施例还针对云复原方法提供了相应的实现装置,进一步使得所述方法更具有实用性。下面对本发明实施例提供的云复原装置进行介绍,下文描述的云复原方法装置与上文描述的云复原方法可相互对应参照。The embodiment of the present invention also provides a corresponding implementation device for the cloud restoration method, which further makes the method more practical. The following describes the cloud restoration apparatus provided by the embodiments of the present invention, and the cloud restoration method apparatus described below and the cloud restoration method described above may refer to each other correspondingly.

参见图4,图4为本发明实施例提供的云复原装置在一种具体实施方式下的结构图,该装置可包括:Referring to FIG. 4, FIG. 4 is a structural diagram of a cloud restoration apparatus provided in an embodiment of the present invention under a specific implementation manner, and the apparatus may include:

判断模块401,用于根据获取的待复原快照版本信息,判断待复原快照版本是否为当前快照版本的上一个快照版本。The judgment module 401 is configured to judge whether the snapshot version to be restored is the last snapshot version of the current snapshot version according to the obtained snapshot version information to be restored.

获取模块402,用于当判定待复原快照版本为当前快照版本的上一个快照版本时,根据复原时间在本地存储系统中获取对应时刻的目标快照卷与相应的映射关系;目标快照卷为第一快照卷或第二快照卷,本地存储系统中包含第一快照卷、第二快照卷、第一映射及第二映射,用于记录本地存储系统在云端进行存储时的快照信息,第一快照卷、第二快照卷交替进行数据的读写,第一映射为第一快照卷与原卷的映射关系,第二映射为第二快照卷与原卷的映射关系。The obtaining module 402 is used to obtain the target snapshot volume and the corresponding mapping relationship at the corresponding moment in the local storage system according to the restoration time when it is determined that the snapshot version to be restored is the previous snapshot version of the current snapshot version; the target snapshot volume is the first A snapshot volume or a second snapshot volume. The local storage system includes a first snapshot volume, a second snapshot volume, a first map, and a second map, which are used to record snapshot information when the local storage system stores in the cloud. The first snapshot volume . The second snapshot volume alternately reads and writes data, the first mapping is the mapping relationship between the first snapshot volume and the original volume, and the second mapping is the mapping relationship between the second snapshot volume and the original volume.

复原模块403,用于根据目标快照卷与映射关系,从本地存储系统中获取复原数据,以实现快照版本的复原。The restoration module 403 is configured to obtain restoration data from the local storage system according to the target snapshot volume and the mapping relationship, so as to realize restoration of the snapshot version.

可选的,在本实施例的一些实施方式中,所述判断模块401可为根据获取的待复原快照版本的复原时间与当前快照版本的时间,判断待复原快照版本是否为当前快照版本的上一个快照版本的模块。Optionally, in some implementations of this embodiment, the judging module 401 may determine whether the snapshot version to be restored is an upper version of the current snapshot version according to the obtained restoration time of the snapshot version to be restored and the time of the current snapshot version. A snapshot version of the module.

在另一些实施方式中,所述判断模块401还可为根据获取的待复原快照版本的复原版本标识号与当前快照版本的版本标识号,判断待复原快照版本是否为当前快照版本的上一个快照版本的模块。In some other implementations, the judging module 401 may further determine whether the snapshot version to be restored is the previous snapshot of the current snapshot version according to the obtained restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version version of the module.

本发明实施例所述云复原装置的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。The functions of each functional module of the cloud restoration device according to the embodiment of the present invention may be specifically implemented according to the methods in the foregoing method embodiments, and the specific implementation process may refer to the relevant descriptions of the foregoing method embodiments, which will not be repeated here.

由上可知,本发明实施例基于云备份时两个映射和两个快照卷交替工作的特性下,由于本地存储系统保存两份快照卷,分别为最新和次新时刻,当待复原的快照版本为次新版本时,也就是当前快照版本的上一个版本,可从本地存储系统直接拷贝数据,进行复原,避免了从云端获取数据,大大的缩减了数据获取的时间,从而提高云复原的速率,还可降低云下载的成本。As can be seen from the above, the embodiment of the present invention is based on the characteristics of two mappings and two snapshot volumes working alternately during cloud backup. Since the local storage system saves two snapshot volumes, which are the latest and the next latest time respectively, when the snapshot version to be restored is restored. When it is the next version, that is, the previous version of the current snapshot version, data can be copied directly from the local storage system and restored, avoiding the need to obtain data from the cloud, greatly reducing the time for data acquisition, thereby improving the speed of cloud restoration. , but also reduces the cost of cloud downloads.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments may be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

以上对本发明所提供的一种云复原方法以及装置进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The cloud restoration method and device provided by the present invention are described above in detail. The principles and implementations of the present invention are described herein by using specific examples, and the descriptions of the above embodiments are only used to help understand the method and the core idea of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims (6)

1. A cloud restoration method, comprising:
judging whether the snapshot version to be restored is the previous snapshot version of the current snapshot version or not according to the acquired snapshot version information to be restored;
when the snapshot version to be restored is judged to be the last snapshot version of the current snapshot version, acquiring a target snapshot volume and a corresponding mapping relation at the corresponding moment in a local storage system according to the restoration time;
according to the mapping relation between the target snapshot volume and the target snapshot volume, recovery data is obtained from the local storage system, so that recovery of a snapshot version is achieved;
the target snapshot volume is a first snapshot volume or a second snapshot volume, the local storage system comprises a first snapshot volume, a second snapshot volume, a first mapping and a second mapping, and is used for recording snapshot information of the local storage system during storage in a cloud, the first snapshot volume and the second snapshot volume alternately read and write data, the first mapping is a mapping relation between the first snapshot volume and an original volume, and the second mapping is a mapping relation between the second snapshot volume and the original volume; the first snapshot volume and the second snapshot volume are respectively a snapshot version at the latest moment and a snapshot version at the next latest moment; the alternating reading and writing of data by the first snapshot volume and the second snapshot volume comprises:
the primary volume carries out the first snapshot and is a full copy, and each time from the second snapshot to the later is an incremental copy; the mapping of two snapshot volumes corresponding to the original volume is fcmapA and fcmapB, and the mapping is expressed by a bitmap;
at t0, initializing volumes FCA, fcmapA to 0000, fcmapB to 1111, and reading actual data from the volumes FCA, wherein the data at the cloud time t0 is full copy of the original volumes; executing COW when a host IO exists between t0 and t1, wherein the fcapa changes a COW block into 1, and the volume FCA records old COW data; at t1, initializing a volume FCB, wherein fcmapB is 0000, fcmapA is unchanged, data at the cloud time t1 is incremental data from t0 to t1, and the data is read from the volume FCB; at t2, the process alternates back to initialize the volume FCA, the fcmapA is 0000, and the fcmapB is unchanged.
2. The cloud restoration method according to claim 1, wherein the determining, according to the obtained to-be-restored snapshot version information, whether the to-be-restored snapshot version is a previous snapshot version of the current snapshot version includes:
and judging whether the snapshot version to be restored is the previous snapshot version of the current snapshot version or not according to the restoration time of the acquired snapshot version to be restored and the time of the current snapshot version.
3. The cloud restoration method according to claim 1, wherein the determining, according to the obtained to-be-restored snapshot version information, whether the to-be-restored snapshot version is a previous snapshot version of the current snapshot version includes:
and judging whether the snapshot version to be restored is the last snapshot version of the current snapshot version or not according to the acquired restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version.
4. A cloud restoration device, comprising:
the judging module is used for judging whether the snapshot version to be restored is the previous snapshot version of the current snapshot version or not according to the acquired snapshot version to be restored information;
the acquisition module is used for acquiring a target snapshot volume and a corresponding mapping relation at a corresponding moment in the local storage system according to the restoration time when the snapshot version to be restored is judged to be the previous snapshot version of the current snapshot version; the target snapshot volume is a first snapshot volume or a second snapshot volume, the local storage system comprises a first snapshot volume, a second snapshot volume, a first mapping and a second mapping, and is used for recording snapshot information when the local storage system stores in a cloud, the first snapshot volume and the second snapshot volume alternately read and write data, the first mapping is a mapping relation between the first snapshot volume and an original volume, and the second mapping is a mapping relation between the second snapshot volume and the original volume; the first snapshot volume and the second snapshot volume are respectively a snapshot version at the latest moment and a snapshot version at the next latest moment; the alternating reading and writing of data by the first snapshot volume and the second snapshot volume comprises:
the primary volume carries out the first snapshot and is a full copy, and each time from the second snapshot to the later is an incremental copy; the mapping of two snapshot volumes corresponding to the original volume is fcmapA and fcmapB, and the mapping is expressed by a bitmap;
at t0, initializing volumes FCA, fcmapA to 0000, fcmapB to 1111, and reading actual data from the volumes FCA, wherein the data at the cloud time t0 is full copy of the original volumes; executing COW when a host IO exists between t0 and t1, wherein the fcapa changes a COW block into 1, and the volume FCA records old COW data; at t1, initializing a volume FCB, wherein fcmapB is 0000, fcmapA is unchanged, data at the cloud time t1 is incremental data from t0 to t1, and the data is read from the volume FCB; t2, alternately returning, initializing the volume FCA, the fcmapA to 0000, and the fcmapB to be unchanged;
and the restoration module is used for acquiring restoration data from the local storage system according to the mapping relation between the target snapshot volume and the target snapshot volume so as to realize restoration of the snapshot version.
5. The cloud restoration device according to claim 4, wherein the determining module is a module that determines whether the snapshot version to be restored is a previous snapshot version of the current snapshot version according to the acquired restoration time of the snapshot version to be restored and the time of the current snapshot version.
6. The cloud restoration device according to claim 4, wherein the determining module is a module that determines whether the snapshot version to be restored is a previous snapshot version of the current snapshot version according to the acquired restoration version identification number of the snapshot version to be restored and the version identification number of the current snapshot version.
CN201710772413.5A 2017-08-31 2017-08-31 A kind of cloud recovery method and device Active CN107526656B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710772413.5A CN107526656B (en) 2017-08-31 2017-08-31 A kind of cloud recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710772413.5A CN107526656B (en) 2017-08-31 2017-08-31 A kind of cloud recovery method and device

Publications (2)

Publication Number Publication Date
CN107526656A CN107526656A (en) 2017-12-29
CN107526656B true CN107526656B (en) 2020-11-20

Family

ID=60683004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710772413.5A Active CN107526656B (en) 2017-08-31 2017-08-31 A kind of cloud recovery method and device

Country Status (1)

Country Link
CN (1) CN107526656B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109739688B (en) * 2018-12-18 2021-01-26 杭州宏杉科技股份有限公司 Snapshot resource space management method, device, and electronic device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030220929A1 (en) * 2002-01-22 2003-11-27 Columbia Data Products, Inc. Managing finite data storage utilizing preservation weights
US6993539B2 (en) * 2002-03-19 2006-01-31 Network Appliance, Inc. System and method for determining changes in two snapshots and for transmitting changes to destination snapshot
CN1331063C (en) * 2003-06-10 2007-08-08 联想(北京)有限公司 On-line data backup method based on data volume snapshot
US20060106893A1 (en) * 2004-11-02 2006-05-18 Rodger Daniels Incremental backup operations in storage networks
JP4800031B2 (en) * 2005-12-28 2011-10-26 株式会社日立製作所 Storage system and snapshot management method
GB2495079A (en) * 2011-09-23 2013-04-03 Hybrid Logic Ltd Live migration of applications and file systems in a distributed system
CN103019888B (en) * 2012-12-21 2016-03-30 华为技术有限公司 Backup method and device
CN106371763A (en) * 2016-08-23 2017-02-01 浪潮(北京)电子信息产业有限公司 Snapshot storage method and apparatus, disk and computer
CN106909514B (en) * 2017-03-01 2021-04-30 郑州云海信息技术有限公司 Method and device for positioning snapshot disk address

Also Published As

Publication number Publication date
CN107526656A (en) 2017-12-29

Similar Documents

Publication Publication Date Title
US9348827B1 (en) File-based snapshots for block-based backups
US11907078B2 (en) Data backup method, apparatus, and system
US10108501B2 (en) Terminal backup and recovery method
CN105988895B (en) Snapshot processing method and device
CN110188068B (en) Volume-level backup method and device for guaranteeing consistency of file system data
CN107577558B (en) Cloud storage snapshot method and device
US11243850B2 (en) Image recovery from volume image files
CN101206595A (en) Method for disk snapshot by snapshot pointer
CN106484313A (en) Data message backup method, data back up method and device
US8966207B1 (en) Virtual defragmentation of a storage
JP4419884B2 (en) Data replication apparatus, method, program, and storage system
CN109416617A (en) Duplication between heterogeneous storage system
CN107526656B (en) A kind of cloud recovery method and device
CN107357928A (en) A kind of method and system for realizing storage snapshot
CN106909514B (en) Method and device for positioning snapshot disk address
CN111858173A (en) A data recovery method, apparatus, device and medium
CN107704208A (en) A kind of restorative procedure of metadata, device and medium
CN107391312A (en) Data cloud backup method and system
CN111090549A (en) Volume CBT drive-based method for incrementally migrating volume-level data back to original machine
CN115061856B (en) Block-based persistent volume backup method, system, storage medium and recovery method thereof
CN111399774B (en) Data processing method and device based on snapshot under distributed storage system
US10268411B1 (en) Policy and heuristic based conversion of write-optimized virtual disk format into read-optimized virtual disk format
CN109284237B (en) Method and system for garbage collection in all-flash storage array
CN113868018A (en) A data preservation method and device and a data recovery method
CN107368393B (en) Method and device for storing snapshot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201102

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant