Fast data synchronization method in a kind of continuous data protection technology
Technical field
The invention belongs to technical field of data backup, fast data synchronization method in especially a kind of continuous data protection technology.
Background technology
Along with going deep into of informationization application, user generally strengthens the protection to data.The protection of data is normally realized by the method for data backup and date restoring; traditional timed backup method can not adapt to the needs of real-time guard far away; therefore, a lot of crucial application all adopts the realization of continuous data protection technology to the real-time guard of data and fast quick-recovery.Such as, patent documentation " a kind of data guard method of multiple time granularities " (application number 201110270306.5) gives a kind of method of continuous data protection, and its implementation is: when step 1, initialization by manufacturing side data syn-chronization in destination end mirrored storage region; Step 2, catch manufacturing side data write operation, and be recorded in destination end Variety storage region; Step 3, information in Variety storage region to be written in mirrored storage region.In the processing procedure of step 1; at present both at home and abroad manufacturer all need to suspend manufacturing side equipment should be used for carry out; along with the increase of amount of user data; the time of this time-out also can be more and more longer; crucial application is generally owing to adopting the application of continuous data protection method; this interruption will bring certain loss to user, and add user use complexity, some in particular cases user can not accept this interruption.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, fast data synchronization method in a kind of reasonable in design, real-time, continuous data protection technology that processing speed is fast and safe and reliable is provided.
The present invention solves its technical matters and takes following technical scheme to realize:
Fast data synchronization method in a kind of continuous data protection technology, comprises the following steps:
Step 1: set up all data blocks of disk partition and the corresponding relation of write operation state bitmap in manufacturing side equipment;
Step 2: synchronously process first: all data blocks of the disk partition of manufacturing side equipment is copied in the mirrored storage region of destination end;
Step 3: synchronous process of going forward one by one: the number calculating the data block that write operation occurs in disk partition in synchronizing process, if the number of change is lower than the threshold values of setting, the then front end applications of breaks in production end equipment, by the mirrored storage region of block copy to destination end that write operation occurs in manufacturing side disk partition; Otherwise by the mirrored storage region of block copy to destination end that write operation occurs in manufacturing side disk partition.
And described synchronous first process comprises the following steps:
(1) be 0 by the whole mark positions in write operation state bitmap, copy pointer pointed to first data block of disk partition;
(2) by the mirrored storage region of the block copy pointed by copy pointer to destination end;
(3) copy pointer is pointed to the next data block of disk partition;
(4) judge whether copy pointer exceedes last data block of disk partition, if not, then return step and (2) to circulate execution, otherwise complete and synchronously process first.
And described synchronous process of going forward one by one comprises following treatment step:
(1) calculating write operation state bitmap acceptance of the bid will position is the number of 1;
Judgement symbol position be 1 number whether be greater than the threshold values of setting, be perform step (3), otherwise perform step (8);
(3) copy pointer is pointed to the data block of first zone bit corresponding to 1 in write operation state bitmap;
(4) block copy copy pointer pointed to is to the mirrored storage region of destination end;
(5) be 0 by the mark position in write operation state bitmap corresponding to this data block;
(6) copy pointer is pointed to the data block of next zone bit corresponding to 1 in write operation state bitmap;
(7) do you judge that copy pointer is empty?, be perform step (1), otherwise perform step (4);
(8) suspend front end applications to the access of this disk partition;
(9) be that the block copy of 1 all correspondences is to mirrored storage region by all zone bits in current write operation state bitmap;
(10) open front end applications.
And described current write operation state bitmap is based upon in the internal memory of manufacturing side equipment.
Advantage of the present invention and good effect are:
The present invention utilizes write operation mode bit figure to be recorded in the data block changed in data synchronization process, one subsynchronous complete after, the data block changed is judged by bitmap, when the data block number changed is less, the time terminal front end applications can tolerated with user also completes the synchronous of delta data block fast, otherwise repeat synchronizing process, this synchronous method does not need the direct comparison carrying out data block, improves data synchronization efficiency.Server, desktop PC and the mobile device (data synchronization process such as notebook computer, panel computer and smart mobile phone can be widely used in.
Accompanying drawing explanation
Fig. 1 is the write operation mode bit graph structure of the present invention when initialization;
Fig. 2 is the write operation mode bit graph structure of the present invention when disk partition generation data write operation;
Fig. 3 is synchronous processing flow chart first of the present invention;
Fig. 4 is the synchronous processing flow chart that goes forward one by one of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is further described.
Fast data synchronization method in a kind of continuous data protection technology, comprises the following steps:
Step 1: set up all data blocks of disk partition and the corresponding relation of write operation state bitmap in the internal memory of manufacturing side equipment.
As shown in Figure 1; write operation state bitmap is stored in the internal memory of manufacturing side equipment; the corresponding manufacturing side equipment of each zone bit in write operation state bitmap needs to protect a data block in disk partition, and (size of data block can oneself define; this example is a data block with 32kbyte), there is one-to-one relationship in each zone bit namely in disk partition in each data block and write operation state bitmap.When original state, all zone bits in write operation state bitmap are 0, as shown in Figure 1.When certain data block generation data write operation in manufacturing side disk partition, be 1 by the mark position corresponding to this data block in write operation state bitmap, as shown in Figure 2.The data block of write operation can be there is in recording disc subregion by write operation state bitmap; Can judge that corresponding data in magnetic disk block is the need of backing up by the mark of inquiry write operation state bitmap.
Step 2: synchronous treatment step first: all data blocks of the disk partition of manufacturing side equipment is copied in the mirrored storage region of destination end;
As shown in Figure 3, synchronous process comprises the following steps first:
(1) write operation state bitmap initialization: be 0 by the whole mark positions in write operation state bitmap, points to first data block of disk partition by copy pointer (* duplicate_ptr points to the current data block copied);
(2) by the mirrored storage region of the block copy pointed by copy pointer (* duplicate_ptr) to destination end;
(3) copy pointer (* duplicate_ptr) is pointed to the next data block of disk partition;
(4) judge whether copy pointer (* duplicate_ptr) exceedes last data block of disk partition, if not, then return step and (2) to circulate execution, otherwise complete and synchronously process first.
Carrying out first in synchronous processing procedure, front end applications in manufacturing side equipment may carry out write operation to disk partition, when front end applications carries out write operation to the data block in disk partition, the zone bit in write operation state bitmap corresponding to this data block is set to 1.
Step 3: synchronous process of going forward one by one: the number calculating the data block (write operation state bitmap acceptance of the bid will position is the data block of the manufacturing side disk partition of 1) that write operation occurs in disk partition in synchronizing process, if the number of change is lower than the threshold values of setting, the then front end applications of breaks in production end equipment, the time can tolerated with user (several seconds to tens seconds) completes synchronous (by the mirrored storage region of block copy to destination end that write operation occurs in manufacturing side disk partition) of delta data block fast; Otherwise by the mirrored storage region of block copy to destination end that write operation occurs in manufacturing side disk partition.
As shown in Figure 4, synchronous process of going forward one by one comprises following treatment step:
(1) calculating write operation state bitmap acceptance of the bid will position is the number of 1;
Judgement symbol position be 1 number whether be greater than the threshold values of setting; Be perform step (3), otherwise perform step (8);
This threshold values can according to embody rule requirements set.When in a upper synchronous processing procedure, when there is the negligible amounts of data in magnetic disk block write operation, can brief interruption manufacturing side equipment front end applications and only perform low volume data block back-up job, this back-up job do not need cost the oversize time and this time can accept by user, then perform step (8) to data backup procedure (9), otherwise perform step (3) to step data backup procedure (7);
(3) copy pointer (* duplicate_ptr) is pointed to the data block of first zone bit corresponding to 1 in write operation state bitmap;
(4) block copy copy pointer (* duplicate_ptr) pointed to is to the mirrored storage region of destination end;
(5) be 0 by the mark position in write operation state bitmap corresponding to this data block;
(6) copy pointer (* duplicate_ptr) is pointed to the data block of next zone bit corresponding to 1 in write operation state bitmap;
(7) judge copy pointer (* duplicate_ptr) be whether empty (do not have the next one be set to 1 or to disk partition ending), be perform step (1), otherwise perform step (4);
(8) suspend the access (as by Windows VSS) of front end applications to this disk partition;
(9) be that the block copy of 1 all correspondences is to mirrored storage region by all zone bits in current write operation state bitmap;
(10) open front end applications.
The present invention goes for the sustainable protection method of off-line state equally, can unavailable as network time interim processing scheme, effectively reduce network traffics.Its processing procedure is: when network interruption, and the data block changed is marked in write operation state bitmap by the manufacturing side, when network recovery, skips synchronous subprocess first, completes the synchronous of data according to synchronizing process of going forward one by one.
It is emphasized that; embodiment of the present invention is illustrative; instead of it is determinate; therefore the present invention includes the embodiment be not limited to described in embodiment; every other embodiments drawn by those skilled in the art's technical scheme according to the present invention, belong to the scope of protection of the invention equally.