Embodiment
Accompanying drawing 1 is for to realize based on snapshot mode the principle schematic that LUN copies at present.Wherein, source object logic is for being arranged in the source book (P-Vol of main array (Primary Site), Primary Volume), target logic object for be arranged in from array (Secondary Site) from volume (S-Vol, Secondary Volume).The basic procedure that LUN copies is: preparing to start to carry out LUN while copying, on main array, create a snapped volume (SnapVol), in whole LUN reproduction process, can continue source book to carry out the operation of the Update Tables such as write operation, provide the data trnascription of source book in certain time by snapped volume; Then by main array with from the communication link between array, the data trnascription of preserving is copied to from volume, thereby complete LUN reproduction process successively on snapped volume.
LUN reproduction technology based on snapshot all will create snapped volume at every turn in the time the data of source book being copied on main array, need to take storage resources.In addition, please refer to shown in accompanying drawing 2, if in reproduction process, main frame sends the write request for the data block of master file being carried out to write operation to main array, needs to carry out following processing: (1) is read this data block in master file and revised previous content (COWRead1) according to write request; (2) content reading is write to snapped volume (COW Write2); (3) main frame writes fresh content (Vol Write3) in master file in this data block; (4) from snapped volume, read the content (LunCopy Read1) before amendment; (5) content before the amendment of reading is write to S-Vol (LunCopy Write2) from snapped volume.Wherein, between step (3) and step (4) (5) without sequencing relation.Visible on main array except write fresh content in data block corresponding to write request, revise outside data block corresponding to write request, also need to carry out 2 write operations and 2 read operations.Because can expending system, read-write operation repeatedly processes resource, therefore using snapshot mode to carry out in process that LUN copies, within a short period of time is while carrying out repeatedly write operation to master file, response delay can rapid growth, source book being carried out to also can reduce the concurrent number of read-write operation and bandwidth when repeatedly LUN copies.
The embodiment of the present invention propose by bitmap mode store each data block in the object logic of source corresponding whether be copied to the status information in object object logic, instead of preserve the data trnascription of source object logic by snapped volume, save the step of setting up snapped volume, thereby saved storage space.In order to carry out write operation to source object logic in reproduction process, the embodiment of the present invention and then proposition are distinguished in storage replication process by two bitmaps, the status information whether being modified corresponding to each data block in the status information that whether what in the object logic of source, each data block was corresponding be copied in object object logic and reproduction process in the object logic of source, according to these two bitmaps directly by the block copy in the object logic of source in object object logic, avoid snapped volume to carry out repeatedly read-write operation, reduced and processed load.
Below in conjunction with each accompanying drawing, embodiment of the present invention technical scheme main realized to principle, embodiment and the beneficial effect that should be able to reach is explained in detail.
As shown in Figure 3, to realize principle process as follows for the embodiment of the present invention main:
Step 10, while copying initialization, obtains difference bitmap, and whether described difference bitmap has been copied to the status information in object object logic for storing the each data block of source object logic;
Step 20, after starting to copy, whether monitoring receives the write request of data block in the object logic of amendment source, if do not receive write request, execution step 30~step 50:
Step 30, according to difference bitmap, when determining existence and not being copied to the data block in object object logic, enter step 40, otherwise processing finishes;
Step 40, by not being copied to block copy in the source object logic of object object logic in object object logic, enters step 50;
Step 50, in difference bitmap by state information updating corresponding this data block for being copied in object object logic.
The concrete storage mode of difference bitmap includes but not limited to following several:
Mode one: only store the mark that not yet copies to the data block object object logic from source object logic in difference bitmap, do not store the mark that copies to the data block object object logic from source object logic; In step 50, after data block has been copied to object object logic, in difference bitmap, state corresponding this data block is updated to and is copied in object object logic, be specially: the mark of deleting this data block in difference bitmap;
Mode two: the first status indicator that not yet copies to the data block object object logic from source object logic is set in difference bitmap, and copy to the second status indicator of the data block object object logic from source object logic, it is that 1, the second status indicator is 0 that the first status indicator is for example set; In step 50, after data block has been copied to object object logic, in difference bitmap, state corresponding this data block is updated to and is copied in object object logic, be specially: in difference bitmap, the first status indicator of this data block is updated to the second status indicator.
Consider and in practical application, same source object logic is copied to process that the LUN of same object object logic copies normally carries out repeatedly, while amendment for the data block in source object logic between twice reproduction process, no longer this unmodified data block of repeat replication, and can be supported in the write operation in reproduction process, source object logic being carried out, on the basis of scheme shown in accompanying drawing 3, can also improve as follows:
First, increase the variation bitmap of the status information whether being modified for each data block of storage replication process source object logic;
With difference bitmap similarly, change the concrete storage mode of bitmap and include but not limited to following several:
Mode one: in the mark that changes in bitmap the data block in the source object logic being modified in storage replication process only, the mark of the data block in the source object logic not being modified in storage replication process; Changing in bitmap the state information updating of data block as being modified, be specially: the mark of the data block comprising increase write request in variation bitmap in;
Mode two: the third state mark of the data block in the source object logic being modified in reproduction process being set in variation bitmap, the 4th status indicator of the data block in the source object logic not being modified in reproduction process is set, for example the third state can be set when actual storage and be designated 1, the 4th status indicator is 0, changing in bitmap the state information updating of data block as being modified, be specially: in bitmap, the status indicator of this data block is updated to the third state and identifies changing.
Secondly, in the flow process shown in accompanying drawing 3, in the time that monitoring receives write request, the status information whether data block that will revise according to this write request in difference bitmap has now been copied in object object logic is carried out different treatment schemees, and in bitmap, upgrades the status information whether data block that this write request revises is modified changing.
Accompanying drawing 4 has provided the process flow diagram of the processing procedure that improved LUN copies, in this embodiment, and difference bitmap and change bitmap and all adopt the storage mode in mode one separately:
Whether step 400, according to existing variation bitmap and difference bitmap to determine whether, for first same source object logic being copied to same object object logic, if enter step 401, otherwise to enter step 402;
Concrete, in the time there is not variation bitmap and difference bitmap, be defined as first same source object logic being copied to same object object logic; Otherwise, in the time there is variation bitmap and difference bitmap, determine and not first same source object logic copied in same object object logic.
Step 401, creates difference bitmap and changes bitmap, and alternatively, content creating is empty difference bitmap and changes bitmap, enters step 403;
Step 403, in the difference bitmap creating in step 401, in the object logic of source, state corresponding to each data block is set to not be copied in object object logic, enters step 404;
In the time that difference bitmap adopts the storage mode of mode one, in the object logic of source, state corresponding to each data block is set to not be copied to and in object object logic, is specially the mark that increases each data block in the object logic of source in the difference bitmap creating in step 401.
Step 402, the status information that a front LUN is copied to the difference bitmap that copies as this of status information in the variation bitmap while finishing, enters step 404;
For example can be by the mode of data Replica, last LUN is copied in the storage space that changes the difference bitmap that the content replication of bitmap copies to this while finishing, alternatively, after a front LUN copies the content of the difference bitmap that the content of variation bitmap while finishing copies as this, also do not start in the situation of reproduction process, to change in bitmap state information updating corresponding to each data block in the object logic of source for not being modified, in the time of storage mode in employing mode one, be specially and empty variation bitmap, can reduce like this repeated workload in upper once LUN reproduction process, copy only need to be by the block copy of being revised by write request in source object logic in this reproduction process in target logic object next time.
Step 404, according to difference bitmap, determines in the object logic of source whether have the data block not being copied in object object logic, if so, enter step 405, otherwise processing finishes;
When difference bitmap adopts the storage mode in mode one, this step is to judge whether the content of difference bitmap is empty, if the content of difference bitmap is empty, does not have the data block not being copied in object object logic; If, there is the data block not being copied in object object logic in the content of difference bitmap and be empty.
Step 405, there is the data block not being copied in object object logic in the object logic of source time, whether monitoring receives the write request of the data block for revising source object logic, if monitored results is for receiving write request, enters step 406; Otherwise enter step 411;
Step 406, identify the state of corresponding data block according to the data block comprising in this write request in difference bitmap, determine that the data block comprising in this write request identifies corresponding data block and whether has been copied in object object logic, if the data block comprising in this write request identifies corresponding data block and is not copied in object object logic, enter step 407, otherwise, if the data block comprising in this write request identifies corresponding data block and has been copied in object object logic, enter step 409;
Step 407, in object object logic, enters step 408 and step 409 by the block copy of the mark correspondence of the data block comprising in this write request in the object logic of source;
Step 408 is updated to the state of the data block of the mark correspondence of the data block comprising in this write request to be copied in object object logic in difference bitmap;
When the dystopy of being on duty figure adopts the storage mode in mode one, in difference bitmap, delete the mark of the data block comprising in this write request;
Step 409, revises the data block of the mark correspondence of the data block comprising in this write request according to this write request, enter step 410;
Step 410, the state of the data block of the mark correspondence of the data block comprising in this write request in variation bitmap is set to be modified;
In the time changing bitmap and adopt the storage mode in mode one, in the mark that changes the data block comprising in increasing this write request in bitmap;
Step 408 and step 410 are returned to step 404 after finishing;
Step 411, according to difference bitmap, in object object logic, and enters step 412 by the block copy that is not copied to object object logic in the object logic of source;
Step 412 is updated to the state of this data block to be copied in object object logic in difference bitmap, enters step 404;
When the dystopy of being on duty figure adopts the storage mode in mode one, in difference bitmap, delete the mark of this data block.
The all data blocks that record in difference bitmap being identified to block copy in corresponding source logic to after target logic object, preserve the content that changes bitmap, this LUN copies end, waits for that LUN copies next time.
It should be noted that, the first treatment scheme that step 405, step 411 and step 412 form, two treatment schemees that step 405-step 410 forms, while not receiving write request, carry out the first treatment scheme, in the time receiving write request, carries out the second treatment scheme.
Adopt the scheme that provides of accompanying drawing 4, without all set up snapped volume in the time copying at every turn, thereby to save storage resources and processed resource when same source object logic is copied to same object object logic repeated multiple times, in addition, in a reproduction process, in the time receiving the write request of data block in the object logic of amendment source, if according to difference bitmap, determine that data block that write request will be revised (has for example been copied in object object logic, the data block that this write request will be revised should be copied in target logic object in this copies, and be copied in target logic object, or the data block that this write request will be revised copies in target logic object without in copying at this), while so now needing the operation carried out only just according to data block corresponding in the target logic object of write request amendment source changing the mark that records the data block that write request will revise in bitmap, can not cause the read-write operation to snapped volume, thereby save processing resource, for example, even the data block that write request will be revised (is not yet copied in object object logic, the data block that this write request will be revised should be copied in target logic object in this copies, but be not yet copied in target logic object while receiving this write request) situation under, also only need to carry out again once the block copy before write request amendment to the processing in target logic object, compared with prior art also at least can save a read operation and the write operation that need to carry out snapped volume, can save equally processing resource.
Below will be according to foregoing invention principle of the present invention, introduce in detail an embodiment the main principle that realizes of the inventive method is explained in detail and is illustrated.
Accompanying drawing 5a is difference bitmap A and the structural representation that changes bitmap B, and supposing all has 16 data blocks in source object logic and object object logic, and the mark of data block is respectively 0~15.For intuitively for simplicity, the mark of each data block corresponding difference bitmap A and change little lattice in bitmap B respectively, the numeral in little lattice is corresponding data block mark.If little lattice are wherein filled by shade, while showing the storage mode in employing mode one, in difference bitmap A or variation bitmap B, store the mark of the data block that these little lattice are corresponding.
Accompanying drawing 5b is for by repeated multiple times when same source object logic is copied to same object object logic, the wherein schematic diagram of a LUN reproduction process.The little lattice of being filled by shade in difference bitmap A represent that the data block of its corresponding mark not yet copies to object object logic from source object logic; The little lattice of not filled by shade represent that the data block of its corresponding mark copies to object object logic from source object logic.The data block of little lattice representative corresponding mark in this reproduction process of being filled by shade in the variation bitmap B that this copies is revised by write request.Certainly, in the time that reality is implemented, when storage mode in difference bitmap use-pattern one, bitmap A can be for to store in the mode of array the mark that not yet copies to the data block object object logic from source object logic; Or when storage mode in difference bitmap use-pattern two, bitmap A can store the status indicator of 16 data blocks with 2 byte 16bit, store the status indicator of a corresponding data block with each bit wherein, in the time that a bit position corresponding to data block is set to 1, illustrate that this data block not yet copies to object object logic from source object logic, while being set to 0, illustrate that this data block copies to object object logic from source object logic.The embodiment of bitmap B is also similar, will not enumerate difference bitmap here and changes all possible embodiment of bitmap.
Supposing that this copies is not first this source object logic to be copied to this object object logic, therefore by the front difference bitmap that copies to this of variation bitmap content replication once copying while finishing, before once copy finish time variation bitmap as shown in the variation bitmap B ' in accompanying drawing 5b, the difference bitmap that this copies is as shown in the difference bitmap A in accompanying drawing 5b, be that this starts LUN while copying, in the object logic of source, mark is respectively 0,11,12,15 data block and is not also copied in object object logic.In the variation bitmap that this copies, status information corresponding to each data block is for not being modified, as shown in the variation bitmap B in accompanying drawing 5b.
After starting to copy, whether the storage system at object logic place, source receives write request with the read-write cycle monitoring of setting, suppose that first read-write cycle receives the data block that comprises and is designated 4, be designated the first write request of 4 data block for revising source object logic, judge and not yet complete the data block copying and do not comprise the data block that is designated 4 according to difference bitmap, the data block that is 4 according to the first write request modified logo, and be set to be modified at the state that changes data block in bitmap and be designated 4 data block, now difference bitmap A and variation bitmap B are as shown in accompanying drawing 5c.Visible, the data block that will revise in write request is without copy to target logic object in copying at this in the situation that, only need to revise according to write request the data block of source object logic, save the block copy in the object logic of source to the required read-write operation of object object logic.
Suppose that second read-write cycle receives the data block comprising and be designated 11, the second write request of the data block that is 11 for modified logo, judge not yet to complete according to difference bitmap and in the data block copying, comprise the data block that is designated 11, first will be designated 11 block copy in target logic object, the state that in the difference bitmap A copying at this again, data block is designated 11 data block is set to be copied in object object logic, then according to being designated 11 data block in the second write request amendment source object logic, and be set to be modified at the state that changes data block in bitmap and be designated 11 data block, now difference bitmap A and variation bitmap B are as shown in accompanying drawing 5d.
Suppose not receive other write request in subsequent reads write cycle time, the each data block comprising in difference bitmap A in accompanying drawing 5d is identified to corresponding data block, be designated 0,12,15 block copy in target logic object.
This LUN copies while end, and difference bitmap and variation bitmap are as shown in accompanying drawing 5e.
When once LUN copies on carrying out, using the variation bitmap in accompanying drawing 5e as the difference bitmap copying next time, carry out same treatment step, here repeat no more.
In the specific implementation, can carry out store discrepancy bitmap and change bitmap with the storage space of two appointments respectively, repeated multiple times when same source object logic is copied to same object object logic, copy each time when initial, the front memory address that once copies the variation bitmap while finishing is copied to the memory address of the difference bitmap when initial as this, the more front memory address that once copies the difference bitmap while finishing is copied to the memory address of the variation bitmap when initial as this.
Accompanying drawing 3, accompanying drawing 4 and accompanying drawing 5a~accompanying drawing 5e are taking a target logic object as example, introduce data copy solution that the embodiment of the present invention provides, this scheme is equally applicable to the scene to multiple target logic objects by the data Replica in a source object logic shown in accompanying drawing 5f, source object logic and target logic object can be arranged in same memory device, also can be arranged in different memory devices, under these scenes, being respectively every pair of source object logic and target logic object arranges difference bitmap and changes bitmap, for every pair of source object logic and target logic object, concrete reproduction process and accompanying drawing 3, the scheme that accompanying drawing 4 and accompanying drawing 5a~accompanying drawing 5e provide is similar, here repeat no longer one by one.
Correspondingly, the embodiment of the present invention also provides a kind of reproducing unit of object logic data, and as shown in Figure 6, this device comprises acquiring unit 601, monitoring unit 602, the first judging unit 603, copied cells 604, the first updating block 605, specific as follows:
Acquiring unit 601, for obtaining difference bitmap, whether described difference bitmap has been copied to the status information in object object logic for storing source object logic data block;
Monitoring unit 602, for obtaining after difference bitmap at acquiring unit 601, whether monitoring receives the write request of data block in the object logic of amendment source;
The first judging unit 603, for being while not receiving write request in monitoring unit 602 monitored results, determining and in the object logic of source, is not copied to the data block in object object logic according to difference bitmap;
Copied cells 604, for determining block copy to object object logic by the first judging unit 603;
The first updating block 605, for copied cells 604 by block copy after object object logic, upgrade the status information of this data block in difference bitmap.
Alternatively, the reproducing unit of accompanying drawing 6 also comprises the second judging unit 606, the first trigger element 607, the second trigger element 608, amendment unit 609, the second updating block 610, specific as follows:
The second judging unit 606, for being while receiving write request in monitoring unit 602 monitored results, according to difference bitmap, determines that the data block comprising in this write request identifies corresponding data block and whether has been copied in object object logic;
The first trigger element 607, identify corresponding data block and be not copied in object object logic if determine for the second judging unit 606 data block that this write request comprises, trigger copied cells 604 by the block copy of the mark correspondence of the data block comprising in this write request in object object logic;
The second trigger element 608, after the block copy of mark correspondence that triggers the data block that copied cells 604 comprises this write request at the first trigger element 607 is in object object logic, trigger the first updating block 605 by the state information updating of this data block in difference bitmap for being copied in object object logic;
Amendment unit 609, if for the second judging unit 606 determine data block that this write request comprises identify corresponding data block be copied in object object logic or the second trigger element 608 triggered the first updating block 605 by the state information updating of this data block in difference bitmap for being copied in object object logic, revise the data block of the mark correspondence of the data block comprising in this write request according to write request;
The second updating block 610, for after amendment unit 609 Update Table pieces, to change in bitmap the state information updating of this data block as being modified, described variation bitmap is used for the status information whether data block in the object logic of storage replication process source is modified.
Alternatively, please refer to accompanying drawing 7, the acquiring unit 601 in accompanying drawing 6 specifically comprises:
Judging unit 701, for determining that this copies whether for first source object logic being copied to object object logic;
First determines subelement 702, copy not when just source object logic copies to object object logic first for determine this in judgment sub-unit 701, using the front status information changing while once copying end in the difference bitmap that the status information in bitmap copies as this;
Create subelement 703, copy as while first source object logic being copied to object object logic for determine this in judgment sub-unit 701, content creating is empty difference bitmap and changes bitmap;
Second determines subelement 704, and the status information of the source object logic data block of the difference bitmap creating for establishment subelement 703 is set to not be copied in object object logic.
The function of the reproducing unit of the object logic data shown in accompanying drawing 6, accompanying drawing 7 can be integrated in the memory device at object logic place, source, also can be arranged in the autonomous device being connected with the memory device at object logic place, source.
It should be noted that: although the embodiment of the present invention is introduced data copy method as an example of object logic example, but the scope of application of the method is not merely object logic, can also be applicable to other memory devices, for example the data Replica process between disk array.
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method is can carry out the hardware that instruction is relevant by program to complete, this program can be stored in a computer read/write memory medium, as: ROM/RAM, magnetic disc, CD etc.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if these amendments of the present invention and within modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.