CN115480704A - Method, device and equipment for constructing data block group migration mapping table and storage medium - Google Patents

Method, device and equipment for constructing data block group migration mapping table and storage medium Download PDF

Info

Publication number
CN115480704A
CN115480704A CN202211151248.9A CN202211151248A CN115480704A CN 115480704 A CN115480704 A CN 115480704A CN 202211151248 A CN202211151248 A CN 202211151248A CN 115480704 A CN115480704 A CN 115480704A
Authority
CN
China
Prior art keywords
snapshot
data block
target
copy
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211151248.9A
Other languages
Chinese (zh)
Inventor
刘屹萌
宋贤广
吴瑞强
胡国玉
甄雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dawning Information Industry Beijing Co Ltd
Original Assignee
Dawning Information Industry Beijing 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 Dawning Information Industry Beijing Co Ltd filed Critical Dawning Information Industry Beijing Co Ltd
Priority to CN202211151248.9A priority Critical patent/CN115480704A/en
Publication of CN115480704A publication Critical patent/CN115480704A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/84Using snapshots, i.e. a logical point-in-time copy of the data

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a storage medium for constructing a data block group migration mapping table. The method comprises the following steps: acquiring a data block copy identifier of each data block in the data block group according to the migration instruction of the data block group; judging whether a target data block copy identification of the current processing data block exists in a copy identification mapping table, and if so, acquiring reference snapshot information from the copy identification mapping table; otherwise, acquiring quoted snapshot information according to the target data block copy identification and the hit result of the snapshot attribute of each snapshot in the snapshot set; and generating a data block group migration mapping table based on the snapshot index according to the referenced snapshot information matched with each data block copy identifier. According to the technical scheme of the embodiment of the invention, the reference result of the data block which is migrated previously is multiplexed by establishing and using the copy identification mapping table, so that the construction efficiency of the current data block group migration mapping table is improved, and the data migration efficiency is improved.

Description

Method, device and equipment for constructing data block group migration mapping table and storage medium
Technical Field
The present invention relates to the field of data backup technologies, and in particular, to a method, an apparatus, a device, and a storage medium for constructing a data block group migration mapping table.
Background
A snapshot technique is a fully available copy of a given data set that includes an image of the corresponding data at some point in time (the point in time at which the copy began). The snapshot may be a copy of the data it represents or a replica of the data.
In the prior art, a new snapshot and data blocks generated by the snapshot can be identified by a globally incremented copy identification recorded when the snapshot is created. When the data block migration is needed, the whole snapshot set can be traversed, the copy identification of each snapshot in the snapshot set is compared with the copy identification of the designated data block, the sequence of the designated data block and each snapshot is judged, the mapping relation between the data block and each snapshot is obtained, and then the subsequent migration is guided.
However, this method is equivalent to flat management of snapshots, and it is impossible to distinguish between two identities of a snapshot as a snapshot source and a snapshot according to a snapshot copy identifier, so that when a data block is referenced and positioned, mapping relationships between the data block and each snapshot must be determined by traversing all snapshot sources and snapshot copy identifiers, and when there are many snapshot layers, the efficiency of reference and positioning of the data block is low, which results in low efficiency of data block migration.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for constructing a data block group migration mapping table, which aim to solve the problem of low data block migration efficiency.
According to an aspect of the present invention, a method for constructing a data block group migration mapping table is provided, including:
acquiring a data block copy identifier of each data block in the data block group according to the migration instruction of the data block group;
sequentially taking different data block copy identifications as target data block copy identifications, and if the target data block copy identifications exist in a copy identification mapping table, acquiring target snapshot information matched with the target data block copy identifications from the copy identification mapping table;
if the target data block copy identification does not exist in the copy identification mapping table, acquiring target snapshot information matched with the target data block copy identification according to the target data block copy identification and a hit result of snapshot attributes of snapshots in a snapshot set;
and generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with each data block copy identifier.
Optionally, the snapshot attributes of the snapshot include: the system comprises a source copy identifier, a source version set identifier, a target copy identifier, a target version set identifier and a snapshot version set list taking a snapshot as a source;
and the data block copy identification of the data block is the same as the source copy identification of the snapshot generating the data block.
By adopting the technical scheme, the identity of the snapshot as a snapshot source is identified by setting a source copy identifier and a source version set identifier, the identity of the snapshot as the snapshot is identified by setting a target copy identifier and a target version set identifier, and the hierarchical division management of the snapshot is realized by distinguishing the two identities of the snapshot as a snapshot source and the snapshot; by storing the snapshot version set list taking the snapshot as the source in the memory of the snapshot, the snapshot source and the directly generated snapshot are managed in a centralized manner, so that all snapshots which refer to the specified data block can be searched in the snapshot set quickly. And recording the freshness of the version of the data block by setting a data block copy identifier for the data block.
Optionally, the obtaining, according to the hit result of the target data block copy identifier and the snapshot attribute of each snapshot in the snapshot set, target snapshot information matched with the target data block copy identifier includes:
if a first snapshot with a source copy identifier identical to the target data block copy identifier is searched in the snapshot set, taking the target copy identifier of the first snapshot as target snapshot information matched with the target data block copy identifier;
if a first snapshot with the same source copy identification and the same target data block copy identification does not exist in the snapshot set, searching a second snapshot with the same target copy identification and the same target data block copy identification, and acquiring a target version set identification of the second snapshot;
determining a snapshot source corresponding to the target version set identifier of the second snapshot, and traversing a snapshot version set list of the snapshot source by using a stack structure to obtain a snapshot set corresponding to the target data block copy identifier;
and taking the target copy identification of each snapshot in the snapshot set as target snapshot information matched with the target data block copy identification.
By adopting the technical scheme, the snapshot source for generating the data block can be found in the snapshot set only by using the data block copy identification of the data block by virtue of the snapshot attribute of the snapshot, and then other snapshots for referencing the data block can be quickly found according to the snapshot version set list stored in the memory by the snapshot source, so that the referencing result of the data block can be obtained without traversing all the snapshots in the snapshot set, and the positioning efficiency of the data block referencing the snapshot is improved.
Optionally, the traversing the snapshot version set list of the snapshot source by using the stack structure to obtain the snapshot set corresponding to the target data block copy identifier includes:
stacking the snapshot source;
the method comprises the steps of outbound a stack top snapshot and adding the stack top snapshot into a snapshot set;
according to a traversal operation function, traversing a snapshot version set list of the snapshot on the top of the stack, and stacking the snapshots of which the target copy identifications are greater than or equal to the target data block copy identifications;
and returning to execute the steps of exiting the stack top snapshot and adding the stack top snapshot into the snapshot set until the stack is empty, and obtaining the snapshot set corresponding to the target data block copy identifier.
By adopting the technical scheme, the snapshots which are determined to refer to the data blocks are sequentially stacked, the snapshots at the top of the stack are popped and the snapshot version set list of the snapshots is traversed, and other snapshots which are determined to refer to the data blocks are screened out from the snapshots.
Optionally, generating a data block group migration mapping table based on a snapshot index according to the target snapshot information matched with each data block copy identifier includes:
converting the target snapshot information matched with each data block copy identifier into the mapping relation between the data block index and the target snapshot information according to the mapping relation between the data block index and the data block copy identifier;
and generating a data block group migration mapping table based on the snapshot index according to the mapping relation between the data block index and the target snapshot information.
By adopting the technical scheme, because the data blocks are distinguished by using the data block indexes, a data block group migration mapping table based on the snapshot indexes is generated according to the data block group to be migrated so as to embody the mapping relation between the snapshot indexes referencing the migrated data blocks and the data block indexes of the migrated data blocks, and the data block mapping of the snapshots is conveniently guided.
Optionally, after obtaining target snapshot information matched with the target data block copy identifier according to a hit result of the target data block copy identifier and a snapshot attribute of each snapshot in a snapshot set, the method further includes:
and updating the copy identification mapping table according to the target snapshot information matched with the target data block copy identification.
By adopting the technical scheme, the reference snapshot information of the positioned current migrated data block is updated into the copy identification mapping table in the memory, so that the empirical data can be continuously accumulated in the construction process of the data block group mapping table, the empirical data of the data migration can be reused in the subsequent data block migration process, the construction process of the subsequent data block group migration mapping table is accelerated, and the migration efficiency of the subsequent data block group is improved.
Optionally, the method further includes:
according to a deletion instruction of a third snapshot, deleting a data block included in the third snapshot, reserving a snapshot attribute stored in a memory structure of the third snapshot, and deleting a target copy identifier of the third snapshot included in a copy identifier mapping table; and/or the presence of a gas in the gas,
after the fourth snapshot is newly established, determining a snapshot source for generating the fourth snapshot, searching a data item comprising a target copy identifier of the snapshot source in a copy identifier mapping table, and adding the target copy identifier of the fourth snapshot in the data item; and/or the presence of a gas in the atmosphere,
according to the instruction of rolling back to the fifth snapshot, deleting the data block included in the main volume, reserving the snapshot attribute stored in the memory structure of the main volume, and deleting the target copy identifier of the main volume included in the copy identifier mapping table; after the master volume is rolled back to the fifth snapshot, searching a data item comprising the target copy identification of the fifth snapshot in a copy identification mapping table, and adding the target copy identification of the master volume in the data item.
By adopting the technical scheme, the snapshot attribute of the snapshot can reflect the snapshot hierarchy and help to quickly locate the reference snapshot of the migrated data block, so that when certain snapshot data in the snapshot set needs to be deleted, only the data block included in the snapshot can be deleted, and the snapshot attribute of the snapshot is reserved, so that the reference location of other data blocks is not influenced. And simultaneously, synchronously deleting the target copy identification of the snapshot in the copy identification mapping table so as to ensure the correctness of the copy identification mapping table. When a new snapshot is generated, since the data block referenced by the snapshot source will be shared by the snapshot it generated, it is necessary to look up the data items including the target copy identification of the snapshot source in the copy identification mapping table, and add the target copy identification of the new snapshot in these data items. When the primary volume is rolled back to the specified snapshot, the primary volume equivalent to the original does not exist any more, and the primary volume is equivalent to a snapshot that has been sourced from the specified snapshot. Therefore, when the snapshot is rolled back, a main volume deleting process is required to be executed firstly, the reference information of the main volume in the copy identification mapping table is deleted, then the rolling back of the main volume is realized, the reference snapshot information in the copy identification mapping table is scanned, and the target copy identification of the main volume is added for the data item with the target copy identification of the appointed snapshot.
According to another aspect of the present invention, there is provided a device for constructing a data block group migration mapping table, including:
the acquisition module is used for acquiring the data block copy identification of each data block in the data block group according to the migration instruction of the data block group;
the table look-up module is used for sequentially taking different data block copy identifications as target data block copy identifications, and if the target data block copy identifications exist in a copy identification mapping table, target snapshot information matched with the target data block copy identifications is acquired from the copy identification mapping table;
the mapping module is used for acquiring target snapshot information matched with the target data block copy identifier according to the hit result of the target data block copy identifier and the snapshot attribute of each snapshot in a snapshot set if the target data block copy identifier does not exist in the copy identifier mapping table;
and the table building module is used for generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with each data block copy identifier.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the method for constructing a data chunk migration mapping table according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium, which stores computer instructions for causing a processor to implement the method for constructing a data chunk migration mapping table according to any embodiment of the present invention when executed.
According to the technical scheme of the embodiment of the invention, the data block copy identification of each data block in the data block group is firstly obtained according to the migration instruction of the data block group, then the copy identification mapping table generated by the positioning reference result of the previously migrated data block is accessed aiming at each data block copy identification, and if the copy identification mapping table comprises target snapshot information matched with the data block copy identification, the snapshot of the referenced data block is directly determined according to the copy identification mapping table; if the copy identification mapping table does not include target snapshot information matched with the data block copy identification, positioning and referencing operation is carried out on each snapshot in the snapshot set according to the data block copy identification, a snapshot referencing the data block is found, target snapshot information is obtained, and finally a data block group migration mapping table guiding each snapshot to carry out data block migration is generated according to the target snapshot information matched with the data block copy identification. The embodiment of the invention reuses the positioning reference result of the data block which is migrated previously by establishing and using the copy identification mapping table, accelerates the determination of the positioning reference result of the currently migrated data block, and improves the construction efficiency of the data block group migration mapping table, thereby improving the data migration efficiency and solving the problem of low data block migration efficiency.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for constructing a data chunk migration mapping table according to an embodiment of the present invention;
FIG. 2 is a diagram of a version relationship of snapshots in a snapshot set, as adapted according to an embodiment of the invention;
fig. 3 is a flowchart of a method for constructing a data chunk migration mapping table according to a second embodiment of the present invention;
FIG. 4 is a diagram of a snapshot version relationship to which the second embodiment of the present invention is adapted;
fig. 5 is a schematic structural diagram of a device for constructing a data chunk migration mapping table according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing the method for constructing a data block group migration mapping table according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a method for constructing a data block group migration mapping table according to an embodiment of the present invention, where this embodiment is applicable to a snapshot set with a large number of snapshot layers, and a data block group migration mapping table corresponding to a data block group to be migrated is quickly constructed to guide a situation of data block migration of each snapshot in the snapshot set.
As shown in fig. 1, the method includes:
s110, acquiring a data block copy identifier of each data block in the data block group according to the migration instruction of the data block group.
The data block group may be an array structure storing a plurality of data blocks to be migrated, where the data blocks to be migrated are data blocks included in any snapshot in the designated snapshot set. The snapshot set refers to a set of a main volume and its related snapshots or clones that have the same data sharing domain, and the main volume, the snapshots, and the clones in this embodiment may be collectively referred to as snapshots, each snapshot including a plurality of data blocks.
In this embodiment, in order to implement hierarchical management on snapshots in a snapshot set, when a new snapshot is generated, a snapshot attribute is configured for the newly generated snapshot and is stored in a memory. Wherein the snapshot attributes of the snapshot include: the system comprises a source copy identifier, a source version set identifier, a target copy identifier, a target version set identifier and a snapshot version set list taking a snapshot as a source.
It should be noted that, by setting a source copy identifier and a source version set identifier, an identity of a snapshot as a snapshot source is identified, by setting a target copy identifier and a target version set identifier, an identity of a snapshot as a snapshot is identified, and by distinguishing two identities of the snapshot as a snapshot source and the snapshot, hierarchical division management of the snapshot is realized; by storing the snapshot version set list taking the snapshot as the source in the memory of the snapshot, the snapshot source and the directly generated snapshot are managed in a centralized manner, so that all snapshots which refer to the specified data block can be searched in the snapshot set quickly.
Wherein, the snapshot version set represents a snapshot source and a set of all snapshots generated based on the snapshot source. Illustratively, as shown in fig. 2, snapshot-0, snapshot-1, and snapshot-7 in snapshot version set-1 are all generated by the same snapshot source, i.e., the primary volume, and snapshot-1 is used as the snapshot source to generate snapshot-2 and snapshot-3 in its lifecycle, which derives snapshot version set-2. In this embodiment, for each snapshot in the snapshot set, all snapshots generated by using the snapshot as a source need to be managed by using a structure such as a list in a memory structure of the snapshot set. Thus, when a structure is found for a given snapshot, all snapshots that originate from the snapshot can be found by traversing the snapshot version set list for that snapshot.
In this embodiment, in order to record the freshness of the version of the data block, when a new data block is generated, a data block attribute, that is, a data block copy identifier, is configured for the newly generated data block. And the data block copy identification of the data block is the same as the source copy identification of the snapshot generating the data block. Because the source copy identification of the snapshot increases with the generation of a new snapshot, the generation sequence of the data block and the snapshot can be recorded by taking the source copy identification of the snapshot generating the data block as the data block copy identification of the data block. Meanwhile, considering that the number of the data blocks is large relative to the snapshot, the embodiment can record the version of the data block only by configuring the data block copy identifier for the data block, and does not need to additionally configure other attributes for the data block, thereby greatly saving the space of a disk and a memory.
S120, sequentially using different data block copy identifications as target data block copy identifications, and if the target data block copy identifications exist in a copy identification mapping table, acquiring target snapshot information matched with the target data block copy identifications from the copy identification mapping table.
The copy identification mapping table is generated according to the reference snapshot information of the previously migrated data block and represents the mapping relationship between the copy identification of the data block of the previously migrated data block and the target copy identification of the reference snapshot.
In this embodiment, because each data block in the data block group needs to determine the referenced snapshot individually, one data block can be obtained from the data block group one by one as the current data block to be processed, and the data block copy identifier of the current data block is used as the target data block copy identifier. In order to fully reuse the empirical data of the previously migrated data block and improve the positioning speed of the snapshot referenced by the data block, a copy identifier mapping table in the memory may be accessed first, and whether the copy identifier mapping table includes a copy identifier of the target data block may be determined. Because the data block copy identifier does not change with the data migration, if the copy identifier mapping table includes the target data block copy identifier, it indicates that the target copy identifier of the data block reference snapshot matching the target data block copy identifier is recorded in the copy identifier mapping table. At this time, the target snapshot information matched with the target data block copy identifier may be directly obtained from the copy identifier mapping table.
S130, if the copy identification mapping table does not have the copy identification of the target data block, target snapshot information matched with the copy identification of the target data block is obtained according to the hit result of the copy identification of the target data block and the snapshot attribute of each snapshot in the snapshot set.
In this embodiment, when a data block corresponding to a target data block copy identifier is not migrated, the copy identifier mapping table may not include the target data block copy identifier, and may not record a target copy identifier of a data block reference snapshot matching the target data block copy identifier, so that reference snapshot information of a currently processed data block cannot be obtained by multiplexing empirical data of previous data block migration. At this time, the snapshot of the current processing data block may be searched and generated in the snapshot set according to the copy identifier of the target data block and the two sets of copy identifiers and version set identifiers of the snapshot. And then, through traversing the snapshot version set list of the snapshot, searching whether the snapshot in the snapshot generated by taking the snapshot as a source also refers to the current processing data block, and for the found reference snapshot, continuously traversing the snapshot version set list of the snapshot to search for the reference snapshot, and circulating the above processes, all snapshots referring to the current processing data block can be found, and further target snapshot information matched with the target data block copy identification can be obtained.
And S140, generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with the data block copy identifications.
In this embodiment, since the data blocks are distinguished by using the data block indexes, a data block group migration mapping table based on the snapshot index needs to be generated for the data block group to be migrated, so as to reflect the mapping relationship between the snapshot index referencing the migrated data block and the data block index of the migrated data block, and facilitate guidance of data block mapping on the snapshot.
It should be noted that, in this embodiment, by analyzing the past data block group migration process, it is recognized that the result generated by the data block group migration mapping has universality, relative stability and maintainability, and based on the above characteristics, if the corresponding data block group migration mapping table generated according to the past data block group migration mapping result is temporarily stored in the memory, the efficiency of subsequent data block migration can be accelerated. The universality means that a batch of data blocks possibly have the same data block copy identification, belong to the same version and can multiplex the same migration mapping result; the relative stability means that the copy identification of the data block does not change, the mapping relationship between the data block and the snapshot is also generally relatively stable, and the maintainability means that the stability of the data block group migration mapping result can be maintained only by updating a small amount when the volume set structure changes, such as the processes of generating a new snapshot, deleting a snapshot, rolling back a snapshot, and the like.
Optionally, generating a data block group migration mapping table based on a snapshot index according to target snapshot information matched with each data block copy identifier, including: converting the target snapshot information matched with the copy identifications of the data blocks into the mapping relation between the data block indexes and the target snapshot information according to the mapping relation between the data block indexes and the copy identifications of the data blocks; and generating a data block group migration mapping table based on the snapshot index according to the mapping relation between the data block index and the target snapshot information.
The data block index is used to identify each data block, and the mapping relationship between the data block index and the data block copy identifier may be established after the data block copy identifier of each data block in the data block group is obtained. The data block index and the data block copy identifier are necessary information in the mapping relationship, and the data block logical address is optional information, so that whether the data block logical address is added to the mapping relationship between the data block index and the data block copy identifier can be determined according to the configuration.
Watch 1
Data block indexing Data block logical address (optional) Data block copy identification
0 1000 2
1 1001 4
2 1001 2
3 1010 8
In this embodiment, after the target snapshot information matching the data block copy identifiers is obtained, the data block index and the target copy identifier of the snapshot referencing the data block may be associated according to the data block copy identifiers, and a mapping relationship between the data block index and the target snapshot information is established. For example, the target snapshot information corresponding to the data block copy identifier 2 is 1, 15, 1000, and the data block index corresponding to the data block copy identifier 2 includes 0 and 2, so that the target snapshot information corresponding to the data block index 0 is 1, 15, 1000; the target snapshot information corresponding to the data block index 2 is 1, 15, 1000. And then, according to the mapping relationship between the data block index and the target snapshot information, constructing a data block group migration mapping table using the target copy identifier of the snapshot as an index, for example, as shown in table two.
Watch two
Target copy identification of snapshots Data block list
1 0,1,2
10 1,3
15 0,1,2
10000 0,2
It should be noted that each entry in the data block list in table two represents one data block, or a group of data blocks with the same data block copy identifier, and corresponds to the data block index in table one. The table two is strongly related to the group of data blocks input by the table one, that is, the action range of the result given by the table two only aims at the group of data blocks input by the table one, and for the target snapshot information matched with the data block copy identification of the group of data blocks, the action range is the whole snapshot set, so that the method has strong guiding significance, and therefore, the target snapshot information matched with each data block copy identification can be stored for accelerating subsequent data migration.
According to the technical scheme of the embodiment of the invention, according to a migration instruction of a data block group, firstly, a data block copy identifier of each data block in the data block group is obtained, then, a copy identifier mapping table generated by a positioning reference result of a previously migrated data block is accessed aiming at each data block copy identifier, and if the copy identifier mapping table comprises target snapshot information matched with the data block copy identifier, a snapshot of the referenced data block is directly determined according to the copy identifier mapping table; and finally, generating a data block group migration mapping table for guiding each snapshot to carry out data block migration according to the target snapshot information matched with each data block copy identifier. According to the embodiment of the invention, the positioning reference result of the data block which is migrated previously is multiplexed by establishing and using the copy identification mapping table, so that the positioning reference result of the currently migrated data block is determined in an accelerated manner, and the construction efficiency of the data block group migration mapping table is improved, thereby improving the data migration efficiency and solving the problem of low data block migration efficiency.
Example two
Fig. 3 is a flowchart of a method for constructing a data block group migration mapping table according to a second embodiment of the present invention, and this embodiment further illustrates a specific step of obtaining target snapshot information matched with a target data block copy identifier according to a hit result of the target data block copy identifier and a snapshot attribute of each snapshot in a snapshot set, and a specific step of traversing a snapshot version set list of a snapshot source by using a stack structure. As shown in fig. 3, the method includes:
s310, creating a snapshot set, and setting snapshot attributes for snapshots in the snapshot set.
In this embodiment, the snapshot set may be formed according to a snapshot or a clone generated by using the primary volume as a source, or a snapshot or a clone generated by using the snapshot or the clone as a source. Thus, for each snapshot (primary volume, snapshot, or clone) in the snapshot set, the snapshot may be a snapshot generated according to a certain snapshot source, or a snapshot source that generates a certain snapshot, and has two identities of being a snapshot source and being a snapshot. Therefore, in order to implement hierarchical management on snapshots in a snapshot set and reduce the difficulty in locating data blocks, snapshot attributes are configured in a snapshot memory when each snapshot is generated. Wherein the snapshot attributes of the snapshot include: the system comprises a source copy identifier, a source version set identifier, a target copy identifier, a target version set identifier and a snapshot version set list taking a snapshot as a source.
Illustratively, a source copy identifier A1 and a source version set identifier B1 are configured for a primary volume, a mount point is provided in a primary volume memory, a snapshot version set list using the primary volume as a source is mounted, and the snapshot version set list initially includes only the primary volume. Taking the main volume as a snapshot source, after creating a snapshot 1, respectively assigning a source copy identifier A1 and a source version set identifier B1 of the snapshot source to a target copy identifier and a target version set identifier of the snapshot 1. And then sequentially selecting two elements A2 and A3 according to the sizes of the elements in the copy identification set, assigning the element A2 (A3) to a source copy identification of a snapshot source, and assigning the element A3 (A2) to a source copy identification of the snapshot 1. And selecting an element B2 in the version set identifier set according to the element size sequence, and assigning the element B2 to the source version set identifier of the snapshot 1. Providing a mount point in the memory of the snapshot 1, and mounting a snapshot version set list taking the snapshot 1 as a source, wherein the snapshot version set list only comprises the snapshot 1. The snapshot attribute of snapshot 1 is added to the snapshot version set list of the snapshot source. Wherein, the duplicate identification set and the version set identification set can be natural number sets larger than zero.
In this embodiment, on the basis of configuring the snapshot attribute, for a given snapshot, all snapshots generated using the given snapshot as a source may be found by traversing the snapshot version set list, and further, for the snapshots, all snapshots generated using each snapshot as a source may be obtained by traversing the snapshot version set list in each snapshot memory structure, and this loop recurses, which is equivalent to implementing a snapshot tree, that is, for the given snapshot, all the snapshots and a snapshot sub-tree generated by the given snapshot are obtained.
S320, acquiring the data block copy identification of each data block in the data block group according to the migration instruction of the data block group.
And the data block copy identification of the data block is the same as the source copy identification of the snapshot generating the data block. The data block copy identification for the data block, once generated, is unchanged.
S330, sequentially taking different data block copy identifications as target data block copy identifications, judging whether the target data block copy identifications exist in a copy identification mapping table, if so, executing S340, otherwise, executing S350.
For example, the copy identification mapping table may be as follows:
data block copy identification Target copy identification for reference snapshots
2 1,15,10000
4 1,10,15
8 10
In this embodiment, after the copy identifier mapping table is generated according to the empirical data of the migrated data block, the copy identifier mapping table may be resident in the memory without release, and a memory elimination mechanism such as Least Recently Used (LRU) is introduced to ensure that the memory occupancy is controllable.
S340, if the copy identifier mapping table has the target data block copy identifier, acquiring target snapshot information matched with the target data block copy identifier from the copy identifier mapping table, and executing the step S370.
In order to solve the problem that a snapshot set needs to be traversed each time a data block is located in the prior art, this embodiment provides a caching mechanism for a data block location result, where a location result of a previous migrated data block is cached in a copy identification mapping table, so that when a currently processed data block is located, it is first queried whether information that references a snapshot and is matched with the currently processed data block exists in the copy identification mapping table, if so, empirical data of the migrated data block is directly multiplexed, and when not, the currently processed data block is located.
S350, if the target data block copy identification does not exist in the copy identification mapping table, acquiring target snapshot information matched with the target data block copy identification according to the target data block copy identification and a hit result of snapshot attributes of snapshots in a snapshot set.
Optionally, the obtaining, according to the hit result of the target data block copy identifier and the snapshot attribute of each snapshot in the snapshot set, target snapshot information matched with the target data block copy identifier includes: if a first snapshot with a source copy identifier identical to the target data block copy identifier is searched in the snapshot set, taking the target copy identifier of the first snapshot as target snapshot information matched with the target data block copy identifier; if a first snapshot with the same source copy identification and the same target data block copy identification does not exist in the snapshot set, searching a second snapshot with the same target copy identification and the same target data block copy identification, and acquiring a target version set identification of the second snapshot; determining a snapshot source corresponding to the target version set identifier of the second snapshot, and traversing a snapshot version set list of the snapshot source by using a stack structure to obtain a snapshot set corresponding to the target data block copy identifier; and taking the target copy identification of each snapshot in the snapshot set as target snapshot information matched with the target data block copy identification.
In this embodiment, when a currently processed data block is located according to a target data block copy identifier, a first snapshot, in which whether a source copy identifier is the same as the target data block copy identifier, is searched in a snapshot set, if yes, the first snapshot is a snapshot that generates the data block and uniquely references the data block, at this time, the first snapshot monopolizes the currently processed data block, and the target copy identifier of the first snapshot may be used as target snapshot information matched with the target data block copy identifier.
If the first snapshot with the same source copy identification as the target data block copy identification does not exist in the snapshot set, the fact that other snapshots are generated in the snapshot generating the currently processed data block to cause the source copy identification of the current snapshot to change is shown. Therefore, after the second snapshot with the target copy identification identical to the target data block copy identification is searched, the snapshot source of the snapshot version set to which the second snapshot belongs can be found according to the target version set identification of the second snapshot. Traversing the snapshot version set list of the snapshot source by using a stack structure, screening some snapshots which refer to the currently processed data block from the snapshots generated by the snapshot source, further traversing the snapshot version set list of the snapshots by using the stack structure to screen the referenced snapshots, and circularly recursing the processes to finally obtain a snapshot set which refers to the currently processed data block. And taking the target copy identification of each snapshot in the snapshot set as target snapshot information matched with the target data block copy identification.
For example, as shown in the snapshot version relationship diagram shown in fig. 4, assuming that the target data block copy identifier is A8, since a snapshot 1 with the source copy identifier A8 is searched in the snapshot set, the snapshot 1 is a snapshot that only occupies the data block, and the target copy identifier A8 of the snapshot 1 is target snapshot information. Assuming that the target data block copy identifier is A2, because the snapshot with the source copy identifier equal to A2 cannot be searched in the snapshot set, the snapshot with the target copy identifier equal to A2 is searched in the snapshot set, and the snapshot 2 is found, and the snapshot source is determined to be snapshot 0 according to the target version set identifier B1 of the snapshot 2. And traversing the snapshot version set 1 of the snapshot 0 according to the stack structure, and finding the snapshot 2 of which the target copy identification is greater than or equal to the target data block copy identification A2. And continuing to traverse the snapshot version set 3 of the snapshot 2, searching the snapshot in which the data block is referenced, and finally determining that the snapshot referencing the data block comprises the snapshot 0 and the snapshot 2 because the snapshot 2 does not generate other snapshots. Thus, the target snapshot information that matches the target data block copy identification A2 includes X, A2. Wherein, snapshot 0 is used as the primary volume, and the target copy identifier and the target version set identifier thereof can be set to be special X.
By adopting the technical scheme, the snapshot source for generating the data block can be found in the snapshot set only by using the data block copy identification of the data block by virtue of the snapshot attribute of the snapshot, and then other snapshots for referencing the data block can be quickly found according to the snapshot version set list stored in the memory by the snapshot source, so that the referencing result of the data block can be obtained without traversing all the snapshots in the snapshot set, and the positioning efficiency of the data block referencing the snapshot is improved.
Optionally, the traversing, by using a stack structure, the snapshot version set list of the snapshot source to obtain a snapshot set corresponding to the target data block copy identifier includes: stacking the snapshot source; the method comprises the steps of outbound a stack top snapshot and adding the stack top snapshot into a snapshot set; according to a traversal operation function, traversing a snapshot version set list of the snapshot on the top of the stack, and stacking the snapshots of which the target copy identifications are greater than or equal to the target data block copy identifications; and returning to execute the steps of exiting the stack top snapshot and adding the stack top snapshot into the snapshot set until the stack is empty, and obtaining the snapshot set corresponding to the target data block copy identifier.
In this embodiment, the snapshots that are determined to refer to the data block are sequentially stacked, the snapshot at the top of the stack is popped and the snapshot version set list thereof is traversed, and then other snapshots that refer to the data block are selected from the snapshots.
And S360, updating the copy identifier mapping table according to the target snapshot information matched with the target data block copy identifier.
In this embodiment, after target snapshot information matched with the target data block copy identifier is obtained according to the target data block copy identifier and the hit result of the snapshot attribute of each snapshot in the snapshot set, a target data block copy identifier item may be added to the copy identifier mapping table, and target snapshot information is added to the reference snapshot target copy identifier item corresponding to the target data block copy identifier. By updating the reference snapshot information of the located current migrated data block into the copy identification mapping table in the memory, the empirical data can be continuously accumulated in the construction process of the data block group mapping table, so that the empirical data of the data migration can be reused in the subsequent data block migration process, the construction process of the subsequent data block group migration mapping table is accelerated, and the migration efficiency of the subsequent data block group is improved.
It should be noted that, because the copy identifier mapping table resides in the memory, when a member in the snapshot set changes, for example, a new snapshot is created, or a designated snapshot is deleted, or a snapshot is rolled back, the copy identifier needs to be maintained correspondingly, so as to ensure the correctness of the result.
Optionally, the method further includes: according to a deletion instruction of a third snapshot, deleting a data block included in the third snapshot, reserving a snapshot attribute stored in a memory structure of the third snapshot, and deleting a target copy identifier of the third snapshot included in a copy identifier mapping table; and/or the presence of a gas in the gas,
after a fourth snapshot is newly created, determining a snapshot source for generating the fourth snapshot, searching a data item comprising a target copy identifier of the snapshot source in a copy identifier mapping table, and adding the target copy identifier of the fourth snapshot in the data item; and/or the presence of a gas in the gas,
according to the instruction of rolling back to the fifth snapshot, deleting the data blocks included in the main volume, reserving the snapshot attribute stored in the memory structure of the main volume, and deleting the target copy identifier of the main volume included in the copy identifier mapping table; after the master volume is rolled back to the fifth snapshot, searching a data item comprising the target copy identification of the fifth snapshot in a copy identification mapping table, and adding the target copy identification of the master volume in the data item.
In this embodiment, because the snapshot attribute of the snapshot can reflect the snapshot hierarchy and help to quickly locate the reference snapshot of the migrated data block, when the third snapshot in the snapshot set is to be deleted, only the data block included in the third snapshot may be deleted, while other snapshots generated by taking the third snapshot as a source are not deleted, and the snapshot attribute stored in the memory structure of the third snapshot is to be saved, and correspondingly, a mount point for mounting the version set list of the third snapshot may also be saved, thereby ensuring that the reference location of the data block is not affected. Meanwhile, as the third snapshot is deleted without referring to any data block, the whole copy identification mapping table is traversed, each data block copy identification item is scanned one by one, and for a group of reference snapshot information corresponding to a certain data block copy identification, if a target copy identification of the currently deleted third snapshot exists, the target copy identification of the third snapshot in the item is deleted, so that the correctness of the copy identification mapping table is ensured. Wherein the third snapshot may be any snapshot to be deleted in the snapshot set.
In this embodiment, the fourth snapshot may be a new snapshot generated from any snapshot in the snapshot set. When a new snapshot is generated, since the data block referenced by the snapshot source is shared by the snapshot generated by the snapshot source, the referenced snapshot of the data block of the snapshot source changes, thereby affecting the correctness of the copy identification mapping table. Therefore, when a new snapshot is generated, data items including the target copy identification of the snapshot source can be searched in the target copy identification column of the reference snapshot of the copy identification mapping table, and the target copy identification of the new snapshot is added in the data items.
In this embodiment, when the primary volume is rolled back to the designated snapshot, the primary volume corresponding to the original does not exist any more, and the primary volume corresponds to a snapshot that has been created from the designated snapshot. Therefore, when an instruction of rolling back to the fifth snapshot is received and the primary volume is to be rolled back to the fifth snapshot, the original deletion process of the primary volume needs to be executed first, the data blocks included in the primary volume are deleted, the snapshot attributes stored in the memory structure of the primary volume are saved, the mount points used for mounting the version set list of the primary volume can be saved correspondingly, and then the target copy identifier of the primary volume is searched and deleted in the target copy identifier list of the reference snapshot of the copy identifier mapping table. And then rolling back the main volume to a fifth snapshot, namely copying a data block of the fifth snapshot into the main volume, scanning reference snapshot information in a copy identification mapping table, and adding a target copy identification of the main volume to the data item with the target copy identification of the fifth snapshot.
And S370, generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with the data block copy identifications.
In an optional embodiment, the target snapshot information matched with each data block copy identifier may be converted into a mapping relationship between the data block index and the target snapshot information according to the mapping relationship between the data block index and the data block copy identifier; and generating a data block group migration mapping table based on the snapshot index according to the mapping relation between the data block index and the target snapshot information.
In this embodiment, for the multi-level snapshot, a snapshot version set list is added to a memory structure of the snapshot, so that the snapshot source and a snapshot copy directly generated by the snapshot source are centrally managed, and functions of managing the multi-level snapshot, querying and traversing are realized by using a snapshot recursive traversal method based on a stack structure under the condition of small memory occupation. By introducing the copy identification mapping table, the reference mapping relation between the data block copy identification information and the snapshot is uniformly managed in the memory, so that the construction process of the prior data block group migration mapping table can guide the construction process of the subsequent data block group migration mapping table, and the overall efficiency of the migration work of the data block group is improved.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a device for constructing a data chunk migration mapping table according to a third embodiment of the present invention. As shown in fig. 5, the apparatus includes:
an obtaining module 510, configured to obtain, according to a migration instruction of a data block group, a data block copy identifier of each data block in the data block group;
a table look-up module 520, configured to sequentially use different data block copy identifiers as target data block copy identifiers, and if the target data block copy identifier exists in a copy identifier mapping table, obtain target snapshot information matched with the target data block copy identifier from the copy identifier mapping table;
a mapping module 530, configured to, if the copy identifier mapping table does not have the target data block copy identifier, obtain target snapshot information that matches the target data block copy identifier according to a hit result between the target data block copy identifier and a snapshot attribute of each snapshot in a snapshot set;
and the table building module 540 is configured to generate a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with each data block copy identifier.
According to the technical scheme of the embodiment of the invention, according to a migration instruction of a data block group, firstly, a data block copy identifier of each data block in the data block group is obtained, then, a copy identifier mapping table generated by a positioning reference result of a previously migrated data block is accessed aiming at the data block copy identifier of each data block, and if the copy identifier mapping table comprises target snapshot information matched with the data block copy identifier, a snapshot of the referenced data block is directly determined according to the copy identifier mapping table; if the copy identification mapping table does not include target snapshot information matched with the data block copy identification, positioning and referencing operation is carried out on each snapshot in the snapshot set according to the data block copy identification, a snapshot referencing the data block is found, target snapshot information is obtained, and finally a data block group migration mapping table guiding each snapshot to carry out data block migration is generated according to the target snapshot information matched with the data block copy identification. The embodiment of the invention reuses the positioning reference result of the data block which is migrated previously by establishing and using the copy identification mapping table, accelerates the determination of the positioning reference result of the currently migrated data block, and improves the construction efficiency of the data block group migration mapping table, thereby improving the data migration efficiency and solving the problem of low data block migration efficiency.
Optionally, the snapshot attributes of the snapshot include: the system comprises a source copy identifier, a source version set identifier, a target copy identifier, a target version set identifier and a snapshot version set list taking a snapshot as a source;
and the data block copy identification of the data block is the same as the source copy identification of the snapshot generating the data block.
Optionally, the mapping module 530 includes:
the first searching unit is used for taking a target copy identifier of a first snapshot as target snapshot information matched with the target data block copy identifier if the first snapshot with the same source copy identifier and the target data block copy identifier is searched in a snapshot set;
the second searching unit is used for searching a second snapshot with a target copy identifier identical to the target data block copy identifier and acquiring a target version set identifier of the second snapshot if the first snapshot with the source copy identifier identical to the target data block copy identifier does not exist in the snapshot set;
a traversal unit, configured to determine a snapshot source corresponding to the target version set identifier of the second snapshot, and traverse a snapshot version set list of the snapshot source by using a stack structure to obtain a snapshot set corresponding to the target data block copy identifier;
and the mapping unit is used for taking the target copy identification of each snapshot in the snapshot set as target snapshot information matched with the target data block copy identification.
Optionally, the traversal unit is configured to:
stacking the snapshot source;
the method comprises the steps of outbound a stack top snapshot and adding the stack top snapshot into a snapshot set;
according to a traversal operation function, traversing a snapshot version set list of the snapshot on the top of the stack, and pushing the snapshot of which the target copy identification is greater than or equal to the target data block copy identification into the stack;
and returning to the step of exiting the stack top snapshot and adding the stack top snapshot into the snapshot set until the stack is empty, and obtaining the snapshot set corresponding to the copy identifier of the target data block.
Optionally, the table building module 540 is configured to:
converting the target snapshot information matched with the copy identifications of the data blocks into the mapping relation between the data block indexes and the target snapshot information according to the mapping relation between the data block indexes and the copy identifications of the data blocks;
and generating a data block group migration mapping table based on the snapshot index according to the mapping relation between the data block index and the target snapshot information.
Optionally, the method further includes: and the updating module is used for updating the copy identifier mapping table according to the target snapshot information matched with the target data block copy identifier after acquiring the target snapshot information matched with the target data block copy identifier according to the hit result of the target data block copy identifier and the snapshot attribute of each snapshot in the snapshot set.
Optionally, the method further includes:
a deleting module, configured to delete a data block included in a third snapshot according to a deletion instruction of the third snapshot, retain a snapshot attribute stored in a memory structure of the third snapshot, and delete a snapshot attribute of the third snapshot included in a copy identification mapping table; and/or the presence of a gas in the atmosphere,
after a fourth snapshot is newly created, determining a snapshot source for generating the fourth snapshot, searching a data item comprising a target copy identifier of the snapshot source in a copy identifier mapping table, and adding the target copy identifier of the fourth snapshot in the data item; and/or the presence of a gas in the atmosphere,
according to the instruction of rolling back to the fifth snapshot, deleting the data blocks included in the main volume, reserving the snapshot attribute stored in the memory structure of the main volume, and deleting the target copy identifier of the main volume included in the copy identifier mapping table; after the master volume is rolled back to the fifth snapshot, searching a data item comprising the target copy identification of the fifth snapshot in a copy identification mapping table, and adding the target copy identification of the master volume in the data item.
The device for constructing the data block group migration mapping table provided by the embodiment of the invention can execute the method for constructing the data block group migration mapping table provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 6 illustrates a schematic structural diagram of an electronic device 10 that may be used to implement an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the above-described methods and processes, such as the construction method of the data block group migration mapping table.
In some embodiments, the method for constructing the data chunk migration mapping table may be implemented as a computer program that is tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the above-described method for constructing the data block group migration mapping table may be executed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method for constructing the data block group migration mapping table by any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for constructing a data block group migration mapping table is characterized by comprising the following steps:
acquiring a data block copy identifier of each data block in the data block group according to the migration instruction of the data block group;
sequentially taking different data block copy identifications as target data block copy identifications, and if the target data block copy identifications exist in a copy identification mapping table, acquiring target snapshot information matched with the target data block copy identifications from the copy identification mapping table;
if the target data block copy identification does not exist in the copy identification mapping table, acquiring target snapshot information matched with the target data block copy identification according to the target data block copy identification and a hit result of snapshot attributes of snapshots in a snapshot set;
and generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with the data block copy identifications.
2. The method of claim 1,
the snapshot attributes of the snapshot include: the system comprises a source copy identifier, a source version set identifier, a target copy identifier, a target version set identifier and a snapshot version set list taking a snapshot as a source;
and the data block copy identification of the data block is the same as the source copy identification of the snapshot generating the data block.
3. The method according to claim 2, wherein the obtaining target snapshot information matching the target data block copy identifier according to the hit result of the target data block copy identifier and the snapshot attribute of each snapshot in the snapshot set comprises:
if a first snapshot with a source copy identifier identical to the target data block copy identifier is searched in the snapshot set, taking the target copy identifier of the first snapshot as target snapshot information matched with the target data block copy identifier;
if a first snapshot with the same source copy identification and the same target data block copy identification does not exist in the snapshot set, searching a second snapshot with the same target copy identification and the same target data block copy identification, and acquiring a target version set identification of the second snapshot;
determining a snapshot source corresponding to the target version set identifier of the second snapshot, and traversing a snapshot version set list of the snapshot source by using a stack structure to obtain a snapshot set corresponding to the target data block copy identifier;
and taking the target copy identification of each snapshot in the snapshot set as target snapshot information matched with the target data block copy identification.
4. The method of claim 3, wherein traversing the snapshot version set list of the snapshot source using a stack structure to obtain the snapshot set corresponding to the target data block copy identifier comprises:
stacking the snapshot source;
the stack top snapshot is outbound, and the stack top snapshot is added into a snapshot set;
according to a traversal operation function, traversing a snapshot version set list of the snapshot on the top of the stack, and pushing the snapshot of which the target copy identification is greater than or equal to the target data block copy identification into the stack;
and returning to the step of exiting the stack top snapshot and adding the stack top snapshot into the snapshot set until the stack is empty, and obtaining the snapshot set corresponding to the copy identifier of the target data block.
5. The method of claim 1, wherein generating a snapshot index-based data block group migration mapping table according to the target snapshot information matching with each data block copy identifier comprises:
converting the target snapshot information matched with the copy identifications of the data blocks into the mapping relation between the data block indexes and the target snapshot information according to the mapping relation between the data block indexes and the copy identifications of the data blocks;
and generating a data block group migration mapping table based on the snapshot index according to the mapping relation between the data block index and the target snapshot information.
6. The method according to claim 1, further comprising, after obtaining target snapshot information matching the target data block copy identifier according to a hit result of the target data block copy identifier and a snapshot attribute of each snapshot in a snapshot set:
and updating the copy identification mapping table according to the target snapshot information matched with the target data block copy identification.
7. The method of claim 1, further comprising:
according to a deletion instruction of a third snapshot, deleting a data block included in the third snapshot, reserving a snapshot attribute stored in a memory structure of the third snapshot, and deleting a target copy identifier of the third snapshot included in a copy identifier mapping table; and/or the presence of a gas in the atmosphere,
after a fourth snapshot is newly created, determining a snapshot source for generating the fourth snapshot, searching a data item comprising a target copy identifier of the snapshot source in a copy identifier mapping table, and adding the target copy identifier of the fourth snapshot in the data item; and/or the presence of a gas in the gas,
according to the instruction of rolling back to the fifth snapshot, deleting the data block included in the main volume, reserving the snapshot attribute stored in the memory structure of the main volume, and deleting the target copy identifier of the main volume included in the copy identifier mapping table; after the master volume is rolled back to the fifth snapshot, searching a data item comprising the target copy identification of the fifth snapshot in a copy identification mapping table, and adding the target copy identification of the master volume in the data item.
8. An apparatus for constructing a mapping table for migrating a group of data blocks, comprising:
the acquisition module is used for acquiring the data block copy identification of each data block in the data block group according to the migration instruction of the data block group;
the table look-up module is used for sequentially taking different data block copy identifications as target data block copy identifications, and if the target data block copy identifications exist in a copy identification mapping table, target snapshot information matched with the target data block copy identifications is acquired from the copy identification mapping table;
the mapping module is used for acquiring target snapshot information matched with the target data block copy identifier according to the target data block copy identifier and a hit result of snapshot attributes of each snapshot in a snapshot set if the target data block copy identifier does not exist in the copy identifier mapping table;
and the table building module is used for generating a data block group migration mapping table based on the snapshot index according to the target snapshot information matched with the data block copy identifications.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of constructing a data chunk migration map of any of claims 1-7.
10. A computer-readable storage medium, storing computer instructions for causing a processor to implement the method for constructing a data chunk migration mapping table according to any one of claims 1 to 7 when executed.
CN202211151248.9A 2022-09-21 2022-09-21 Method, device and equipment for constructing data block group migration mapping table and storage medium Pending CN115480704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211151248.9A CN115480704A (en) 2022-09-21 2022-09-21 Method, device and equipment for constructing data block group migration mapping table and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211151248.9A CN115480704A (en) 2022-09-21 2022-09-21 Method, device and equipment for constructing data block group migration mapping table and storage medium

Publications (1)

Publication Number Publication Date
CN115480704A true CN115480704A (en) 2022-12-16

Family

ID=84392742

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211151248.9A Pending CN115480704A (en) 2022-09-21 2022-09-21 Method, device and equipment for constructing data block group migration mapping table and storage medium

Country Status (1)

Country Link
CN (1) CN115480704A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860486A (en) * 2021-02-03 2021-05-28 深圳市木浪云数据有限公司 Method and device for creating data copy

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860486A (en) * 2021-02-03 2021-05-28 深圳市木浪云数据有限公司 Method and device for creating data copy

Similar Documents

Publication Publication Date Title
US8793227B2 (en) Storage system for eliminating duplicated data
CN111247518B (en) Method and system for database sharding
CN108614837B (en) File storage and retrieval method and device
CN114116613A (en) Metadata query method, equipment and storage medium based on distributed file system
US9235613B2 (en) Flexible partitioning of data
CN110737682A (en) cache operation method, device, storage medium and electronic equipment
CN109657174A (en) Method and apparatus for more new data
CN111857539B (en) Method, apparatus and computer readable medium for managing a storage system
US20190362016A1 (en) Frequent pattern analysis for distributed systems
CN111917834A (en) Data synchronization method and device, storage medium and computer equipment
US10332569B2 (en) System and method for dynamic caching
CN112416456A (en) Configuration file processing method, device, equipment, storage medium and system
CN115480704A (en) Method, device and equipment for constructing data block group migration mapping table and storage medium
CN111046106A (en) Cache data synchronization method, device, equipment and medium
CN112650692A (en) Heap memory allocation method, device and storage medium
CN102724301B (en) Cloud database system and method and equipment for reading and writing cloud data
US11947490B2 (en) Index generation and use with indeterminate ingestion patterns
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN114610719A (en) Cross-cluster data processing method and device, electronic equipment and storage medium
US20220365905A1 (en) Metadata processing method and apparatus, and a computer-readable storage medium
CN114579059A (en) File data migration method, device, equipment and storage medium
CN113051244A (en) Data access method and device, and data acquisition method and device
CN112860811A (en) Method and device for determining data blood relationship, electronic equipment and storage medium
US10353920B2 (en) Efficient mirror data re-sync
CN114650222B (en) Parameter configuration method, device, electronic equipment and storage medium

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