Embodiment
Accompanying drawing 1 is for to realize the principle schematic that LUN duplicates based on the snapshot mode at present.Wherein, the source object logic is for being arranged in the source book (P-Vol, Primary Volume) of main array (Primary Site), the target logic object for be arranged in from array (Secondary Site) from volume (S-Vol, Secondary Volume).The basic procedure that LUN duplicates is: when preparing to begin to carry out LUN and duplicate, on main array, create a snapped volume (SnapVol), in whole LUN reproduction process, can continue source book is carried out the operation of modification data such as write operation, provide the data trnascription of source book in certain time by snapped volume; By main array with from the communication link between the array, the data trnascription of preserving on the snapped volume is copied to from volume, thereby finish LUN reproduction process successively then.
LUN reproduction technology based on snapshot all will be created snapped volume at every turn on main array when the data of source book being duplicated, need take storage resources.In addition, please refer to shown in the accompanying drawing 2, if in reproduction process, main frame sends the write request that is used for the data block of master file is carried out write operation to main array, then needs to carry out following processing: (1) reads the content (COWRead1) before this data block is revised according to write request in the master file; (2) content that reads is write snapped volume (COW Write2); (3) main frame writes fresh content (Vol Write3) in this data block in master file; (4) from snapped volume, read the preceding content (LunCopy Read1) of modification; (5) content before the modification that will read from snapped volume writes S-Vol (LunCopy Write2).Wherein, no sequencing relation between step (3) and the step (4) (5).As seen on the main array except in the data block of write request correspondence, writing fresh content, promptly revise outside the data block of write request correspondence, also need to carry out 2 write operations and 2 read operations.Because repeatedly read-write operation can expend the system handles resource, therefore using the snapshot mode to carry out in the process that LUN duplicates, within a short period of time is when carrying out repeatedly write operation to master file, response delay can increase fast, source book is being carried out also can reduce concurrent number of read-write operation and bandwidth when repeatedly LUN duplicates.
The embodiment of the invention proposes to store by the bitmap mode the status information in the purpose object logic of whether being copied to of each data block correspondence in the object logic of source, rather than 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 in reproduction process, to carry out write operation to the source object logic, the embodiment of the invention and then proposition come in the difference storage replication process by two bitmaps, the status information that whether is modified that whether has been copied to each the data block correspondence in the object logic of source in status information in the purpose object logic and the reproduction process of each data block correspondence in the object logic of source, according to these two bitmaps directly with the block copy in the object logic of source in the purpose object logic, avoided snapped volume is carried out repeatedly read-write operation, reduced and handled load.
Be explained in detail to the main realization principle of embodiment of the invention technical scheme, embodiment and to the beneficial effect that should be able to reach below in conjunction with each accompanying drawing.
As shown in Figure 3, the main realization principle process of the embodiment of the invention is as follows:
Step 10 when duplicating initialization, is obtained the difference bitmap, and described difference bitmap is used for storing each data block of source object logic and whether has been copied to status information in the purpose object logic;
Step 20, after beginning to duplicate, whether monitoring receives the write request of data block in the object logic of modification source, if do not receive write request, execution in step 30~step 50:
Step 30 according to the difference bitmap, when determining existence and not being copied to data block in the purpose object logic, enter step 40, otherwise processing finishes;
Step 40 with not being copied to block copy in the source object logic of purpose object logic in the purpose object logic, enters step 50;
Step 50, in the difference bitmap with the state information updating of this data block correspondence for being copied in the purpose object logic.
The concrete storage mode of difference bitmap includes but not limited to following several:
Mode one: in the difference bitmap, only store the sign that does not copy to the data block the purpose object logic as yet, do not store the sign that copies to the data block the purpose object logic from the source object logic from the source object logic; In step 50, after data block has been copied to the purpose object logic, in the difference bitmap, the state of this data block correspondence is updated to and is copied in the purpose object logic, be specially: the sign of this data block of deletion in the difference bitmap;
Mode two: first status indicator that does not copy to the data block the purpose object logic as yet from the source object logic is set in the difference bitmap, and second status indicator that copies to the data block the purpose object logic from the source object logic, it is that 1, the second status indicator is 0 that first status indicator for example is set; In step 50, after data block has been copied to the purpose object logic, in the difference bitmap state of this data block correspondence is updated to and is copied in the purpose object logic, be specially: first status indicator with this data block in the difference bitmap is updated to second status indicator.
Consider that process that the LUN that in the practical application same source object logic copied to same purpose object logic duplicates is normally carried out repeatedly, when revising for the data block in the source object logic between twice reproduction process, this unmodified data block of repeat replication no longer, and can be supported in the write operation that in the reproduction process source object logic is carried out, on the basis of scheme shown in the accompanying drawing 3, can also carry out following improvement:
At first, increase the variation bitmap of the status information whether each data block be used for storage replication process source object logic be modified;
With the difference bitmap similarly, the concrete storage mode that changes bitmap includes but not limited to following several:
Mode one: the sign of the data block in the source object logic that in changing bitmap, only is modified in the storage replication process, the not sign of the data block in the source object logic that is not modified in the storage replication process; In changing bitmap with the state information updating of data block for being modified, be specially: the sign of the data block that in changing bitmap, comprises in the increase write request;
Mode two: the third state sign that the data block in the source object logic that is modified in the reproduction process is set in changing bitmap, the four condition sign of the data block in the source object logic that is not modified in the reproduction process is set, for example the third state can be set during actual storage and be designated 1, four condition is designated 0, in changing bitmap with the state information updating of data block for being modified, be specially: in changing bitmap, the status indicator of this data block is updated to the third state and identifies.
Secondly, in the flow process shown in the accompanying drawing 3, when monitoring receives write request, the status information whether data block that will revise according to this write request in this moment difference bitmap has been copied in the purpose object logic is carried out different treatment schemees, and upgrades the status information whether data block that this write request revises is modified in changing bitmap.
Accompanying drawing 4 has provided the process flow diagram of the processing procedure that improved LUN duplicates, in this embodiment, and difference bitmap and change bitmap and all adopt storage mode in the mode one separately:
Whether step 400 is according to existing variation bitmap and difference bitmap to determine whether if enter step 401, otherwise to enter step 402 for first same source object logic being copied to same purpose object logic;
Concrete, when not having variation bitmap and difference bitmap, be defined as first same source object logic being copied to same purpose object logic; Otherwise, when having variation bitmap and difference bitmap, determine not to be first same source object logic to be copied in the same purpose object logic.
Step 401 is created the difference bitmap and is changed bitmap, and alternatively, content creating is empty difference bitmap and changes bitmap, enters step 403;
Step 403, the state of each data block correspondence is set to not be copied in the purpose object logic in the object logic of source in the difference bitmap that step 401 is created, and enters step 404;
When the difference bitmap adopted the storage mode of mode one, the state of each data block correspondence was set to not be copied to and is specially the sign that increases each data block in the object logic of source in the difference bitmap that step 401 is created in the purpose object logic in the object logic of source.
Step 402, the status information in the variation bitmap when a preceding LUN is duplicated end enters step 404 as the status information of this difference bitmap that duplicates;
The mode that can duplicate by data is for example duplicated last LUN in the storage space of the difference bitmap that the content replication that changes bitmap when finishing duplicates to this; Alternatively, after the content of content as this difference bitmap that duplicates of the variation bitmap when a preceding LUN is duplicated end, also do not begin under the situation of reproduction process, to change in the bitmap in the object logic of source the state information updating of each data block correspondence for not being modified, when the storage mode in the employing mode one, be specially and empty the variation bitmap, can reduce the repeated workload in LUN reproduction process next time like this, only promptly duplicate next time and the block copy of being revised by write request in the source object logic in this reproduction process need be got final product in the target logic object.
Step 404 according to the difference bitmap, determines whether there is the data block that is not copied in the purpose object logic in the object logic of source, if enter step 405, otherwise processing finishes;
When the difference bitmap adopted storage mode in the mode one, if the content of difference bitmap is a sky, then there was not the data block that is not copied in the purpose object logic for whether the content of judging the difference bitmap is empty in this step; If the content of difference bitmap and be empty, then existence is not copied to the data block in the purpose object logic.
Step 405, when having the data block be not copied in the purpose object logic in the object logic of source, whether monitoring receives the write request of the data block that is used for revising the source object logic, if monitored results for receiving write request, enters step 406; Otherwise enter step 411;
Step 406, state according to the corresponding data block of the data block sign that comprises in this write request in the difference bitmap, determine whether the corresponding data block of data block sign that comprises in this write request has been copied in the purpose object logic, if the corresponding data block of the data block that comprises in this write request sign is not copied in the purpose object logic, then enter step 407, otherwise, if the corresponding data block of the data block that comprises in this write request sign has been copied in the purpose object logic, enter step 409;
Step 407 in the purpose object logic, enters step 408 and step 409 with the block copy of the sign correspondence of the data block that comprises in this write request in the object logic of source;
Step 408 is updated to the state of the data block of the sign correspondence of the data block that comprises in this write request in the difference bitmap and is copied in the purpose object logic;
When the dystopy of being on duty figure adopts storage mode in the mode one, the sign of the data block that in the difference bitmap, comprises in this write request of deletion;
Step 409 is revised the data block of the sign correspondence of the data block that comprises in this write request according to this write request, enters step 410;
Step 410, the state of the data block of the sign correspondence of the data block that comprises in this write request in changing bitmap is set to be modified;
When the storage mode in the variation bitmap employing mode one, in changing bitmap, increase the sign of the data block that comprises in this write request;
Step 408 and step 410 are returned step 404 after finishing;
Step 411 according to the difference bitmap, in the purpose object logic, and enters step 412 with the block copy that is not copied to the purpose object logic in the object logic of source;
Step 412 is updated to the state of this data block in the difference bitmap and is copied in the purpose object logic, enters step 404;
When the dystopy of being on duty figure adopts storage mode in the mode one, the sign of this data block of deletion in the difference bitmap.
Block copy in the source logic of all data block sign correspondences that write down in the difference bitmap is arrived after the target logic object, preserves the content that changes bitmap, and this LUN duplicates end, waits for that LUN duplicates next time.
Need to prove that two treatment schemees that first treatment scheme that step 405, step 411 and step 412 constitute, step 405-step 410 constitute when not receiving write request, are carried out first treatment scheme, when receiving write request, carry out second treatment scheme.
Adopt scheme that accompanying drawing 4 provides when repeated multiple times copies to same source object logic same purpose object logic, need not when duplicating, all to set up snapped volume at every turn, thereby saved storage resources and handled resource; In addition, in a reproduction process, in receiving modification source object logic during the write request of data block, if according to the difference bitmap, determine that data block that write request will be revised (for example has been copied in the purpose object logic, the data block that this write request will be revised should be copied in this duplicates in the target logic object, and be copied in the target logic object, perhaps the data block that will revise of this write request need not to copy in the target logic object in this duplicates), the operation that needs this moment so to carry out only is the sign of the data block that the record write request will be revised in changing bitmap when revising data block corresponding in the target logic object of source according to write request, can not cause read-write operation, thereby save the processing resource snapped volume; Even the data block that write request will be revised (for example is not copied in the purpose object logic as yet, the data block that this write request will be revised should be copied in this duplicates in the target logic object, but receiving this write request fashion is not copied in the target logic object) situation under, also only need to carry out again the processing of block copy in the target logic object before once write request being revised, compared with prior art also can save a read operation and the write operation that to carry out snapped volume at least, can save the processing resource equally.
To introduce an embodiment in detail and come the main realization principle of the inventive method is explained in detail and illustrates according to foregoing invention principle of the present invention below.
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 the purpose object logic, and the sign of data block is respectively 0~15.For intuitively for simplicity, the sign of each data block is corresponding difference bitmap A and change little lattice among the bitmap B respectively, and the numeral in the little lattice is corresponding data block sign.If little lattice are wherein filled by shade, when then showing the storage mode in the employing mode one, store the sign of the data block of this little lattice correspondence among difference bitmap A or the variation bitmap B.
Accompanying drawing 5b when repeated multiple times is copied to same purpose object logic with same source object logic, the synoptic diagram of a LUN reproduction process wherein.On behalf of the data block of its corresponding sign, the little lattice of being filled by shade among the difference bitmap A do not copy to the purpose object logic from the source object logic as yet; On behalf of the data block of its corresponding sign, the little lattice of being filled by shade copy to the purpose object logic from the source object logic.The data block of little lattice representative corresponding sign in this reproduction process of being filled by shade among the variation bitmap B that this duplicates is revised by write request.Certainly when reality is implemented, during storage mode in the difference bitmap use-pattern one, bitmap A can be for storing the sign that does not copy to the data block the purpose object logic as yet from the source object logic in the mode of array; Perhaps during the storage mode in the 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, illustrate that when the bit position of a data block correspondence is put 1 this data block does not copy to the purpose object logic from the source object logic as yet, quilt is put illustrated that this data block copied to the purpose object logic from the source object logic at 0 o'clock.The embodiment of bitmap B is also similar, enumerates the difference bitmap here no longer one by one and changes all possible embodiment of bitmap.
Supposing that this duplicates is not first this source object logic to be copied to this purpose object logic, therefore in the difference bitmap that the variation bitmap content replication in the time of will precedingly once duplicating end is duplicated to this, before once duplicate variation bitmap when finishing shown in the variation bitmap B ' among the accompanying drawing 5b, the difference bitmap that this duplicates is shown in the difference bitmap A among the accompanying drawing 5b, be that this begins LUN when duplicating, sign is respectively 0,11,12,15 data block and also is not copied in the purpose object logic in the object logic of source.The status information of each data block correspondence is for not being modified, shown in the variation bitmap B among the accompanying drawing 5b in the variation bitmap that this duplicates.
After beginning to duplicate, 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 used for revising first write request that the source object logic is designated 4 data block, judge according to the difference bitmap and not finish the data block of duplicating as yet and do not comprise and be designated 4 data block, it then is 4 data block according to the first write request modified logo, and the state that data block is designated 4 data block in changing bitmap is set to be modified, this moment difference bitmap A and change bitmap B shown in accompanying drawing 5c.As seen, need not in this duplicates, to copy under the situation of target logic object in the data block that write request will be revised, only need get final product, saved the required read-write operation of purpose object logic is arrived in the block copy in the object logic of source according to the data block that write request is revised the source object logic.
Suppose that second read-write cycle receives the data block that comprises and be designated 11, be used for modified logo and be second write request of 11 data block, judge not finish as yet to comprise in the data block of duplicating according to the difference bitmap and be designated 11 data block, then at first will be designated 11 block copy in the target logic object, the state that data block is designated 11 data block in the difference bitmap A that this duplicates is set to be copied in the purpose object logic again, revise in the object logic of source according to second write request then and be designated 11 data block, and the state that data block is designated 11 data block in changing bitmap is set to be modified, this moment difference bitmap A and change bitmap B shown in accompanying drawing 5d.
Suppose in the subsequent reads write cycle time, not receive other write request,, promptly be designated 0,12,15 block copy in the target logic object then with the corresponding data block of each data block sign that comprises among the difference bitmap A among the accompanying drawing 5d.
This LUN duplicates when finishing, and difference bitmap and variation bitmap are shown in accompanying drawing 5e.
When carrying out that LUN duplicates next time, the variation bitmap among the accompanying drawing 5e as the difference bitmap that duplicates next time, is carried out same treatment step, here repeat no more.
In the specific implementation, can be respectively come the store discrepancy bitmap and change bitmap with the storage space of two appointments, when repeated multiple times copies to same source object logic same purpose object logic, duplicate each time when initial, preceding memory address of once duplicating the variation bitmap when finishing is duplicated the memory address of the difference bitmap when initial as this, and the memory address of the difference bitmap in the time of will precedingly once duplicating end is again duplicated 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 to be example with a target logic object, introduce data copy solution that the embodiment of the invention provides, this scheme is equally applicable to the scene that the data with in the source object logic shown in the accompanying drawing 5f copy to a plurality of target logic objects, source object logic and target logic object can be arranged in the same memory device, also can be arranged in the different memory devices, under these scenes, being respectively every pair of source object logic and target logic object is provided with the difference bitmap and changes bitmap, for every pair of source object logic and target logic object, concrete reproduction process and accompanying drawing 3, accompanying drawing 4 and the scheme that accompanying drawing 5a~accompanying drawing 5e provides are similar, here give unnecessary details no longer one by one.
Correspondingly, the embodiment of the 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, first judging unit 603, copied cells 604, first updating block 605, and is specific as follows:
Acquiring unit 601 is used to obtain the difference bitmap, and described difference bitmap is used for storing source object logic data block and whether has been copied to status information in the purpose object logic;
Monitoring unit 602 is used for after acquiring unit 601 obtains the difference bitmap, and whether monitoring receives the write request of data block in the object logic of modification source;
First judging unit 603, being used in monitoring unit 602 monitored results is when not receiving write request, determines not to be copied in the object logic of source data block in the purpose object logic according to the difference bitmap;
Copied cells 604 is used for first judging unit 603 is determined block copy to the purpose object logic;
First updating block 605, be used for copied cells 604 with block copy behind the purpose object logic, upgrade the status information of this data block in the difference bitmap.
Alternatively, the reproducing unit of accompanying drawing 6 also comprises second judging unit 606, first trigger element 607, second trigger element 608, revises unit 609, second updating block 610, and is specific as follows:
Second judging unit 606, being used in monitoring unit 602 monitored results is when receiving write request, according to the difference bitmap, determines whether the corresponding data block of data block sign that comprises in this write request has been copied in the purpose object logic;
First trigger element 607, be used for if second judging unit 606 is determined the corresponding data block of data block sign that this write request comprises not to be copied in the purpose object logic, trigger copied cells 604 with the block copy of the sign correspondence of the data block that comprises in this write request in the purpose object logic;
Second trigger element 608, be used for after the block copy of sign correspondence that first trigger element 607 triggers the data block that copied cellses 604 comprise this write request is in the purpose object logic, trigger first updating block 605 with the state information updating of this data block in the difference bitmap for being copied in the purpose object logic;
Revise unit 609, be used for if second judging unit 606 determine the corresponding data block of data block sign that this write request comprises be copied in the purpose object logic or second trigger element 608 triggered first updating block 605 with the state information updating of this data block in the difference bitmap for being copied in the purpose object logic, revise the data block of the sign correspondence of the data block that comprises in this write request according to write request;
Second updating block 610, be used for after revising unit 609 modification data blocks, to change in the bitmap state information updating with this data block for 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 the accompanying drawing 6 specifically comprises:
Judging unit 701 is used for determining that this duplicates whether for first the source object logic being copied to the purpose object logic;
First determines subelement 702, being used for determining in judgment sub-unit 701 that this duplicates not is when just the source object logic copies to the purpose object logic first, with the preceding status information that changes when finishing in the bitmap of once duplicating as the status information in this difference bitmap that duplicates;
Create subelement 703, be used for determining this in judgment sub-unit 701 and copy as when first the source object logic being copied to the purpose object logic, content creating be empty difference bitmap and variation bitmap;
Second determines subelement 704, and the status information that is used for creating the source object logic data block of the difference bitmap that subelement 703 creates is set to not be copied in the purpose object logic.
The function of the reproducing unit of the object logic data shown in accompanying drawing 6, the accompanying drawing 7 can be integrated in the memory device at object logic place, source, also can be arranged in the autonomous device that is connected with the memory device at object logic place, source.
Need to prove: introduce data copy method though the embodiment of the invention is example with the object logic, but the scope of application of this method not merely is object logic, can also be applicable to other memory devices, for example the data reproduction process between the disk array.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, this program can be stored in the 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 to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.