Summary of the invention
The embodiment of the invention provides a kind of square law devices of image file duplication, avoid the mirror image based on traditional snapshot
The problem of influence of the file replication technique to upper-layer service, the delay of increase write operation or upper-layer service response time.
In a first aspect, the embodiment of the present application provides a kind of method of image file duplication, the method is applied to the standby system of calamity
The production center in system, the disaster recovery and backup systems further include Disaster Preparation Center, and the production center is by network as unit of data block
Image file replicate data is sent to Disaster Preparation Center, which comprises
When image file in the production center carries out image file duplication to Disaster Preparation Center, current image file is obtained
The target position information of the data block of duplication;
If receiving the write request to the image file, and the corresponding numerical value in position that the write request starts is greater than institute
The corresponding numerical value in target position is stated, then directly executes the write request, if the corresponding numerical value in position that the write request terminates is small
In the corresponding numerical value in the target position, then the write request is executed, and the write request is recorded in writing of pre-establishing and is asked
It asks in log;
When image file in the production center carries out image file duplication completion to Disaster Preparation Center, by the write request
The data of log are transferred to the Disaster Preparation Center, and form effective snapshot of image file duplication.
Optionally, the method also includes:
If the corresponding numerical value in the position that the write request starts is less than the corresponding numerical value in the target position, and described write is asked
The corresponding numerical value in the position of end is asked to be greater than the corresponding numerical value in the target position, then to greater than the corresponding number in the target position
The data block of value executes the write request;The write request is executed to the data block for being less than the corresponding numerical value in the target position,
And the write request is recorded in the write request log pre-established.
Optionally, after described receive to the write request of the image file, the method also includes:
Lock the corresponding numerical variable in the target position;
When in the position that the write request starts, corresponding numerical value is greater than the corresponding numerical value in the target position, directly execution
After the write request, the corresponding numerical variable in the target position is unlocked;
When in the position that the write request terminates, corresponding numerical value is less than the corresponding numerical value in the target position, described in execution
Before write request, the corresponding numerical variable in the target position is unlocked.
Optionally, the method also includes:
When the data by write request log are transferred to the Disaster Preparation Center, continue the note of write request log
Record, the data of the write request log saved before starting the data by write request log and being transferred to the Disaster Preparation Center
When being transmitted, the write request daily record data saved after the data transmission for starting write request log is sent.
Second aspect, the application provide a kind of method of image file duplication, and the method is applied in disaster recovery and backup systems
Disaster Preparation Center, the disaster recovery and backup systems further include the production center, and the Disaster Preparation Center receives life by network as unit of data block
Production center carries out the data that image file duplication is sent, which comprises
Receive the image file data block that the production center is sent;
In the image file that image file data block write-in is pre-created;
When the image file replicates completion, the write request daily record data that the production center is sent is received;
According to the write request daily record data, write request operation is executed in the image file, resets write request log.
Optionally, described according to write request daily record data, write request operation is executed in the image file, comprising:
Successively obtain each write request operation data in the write request daily record data;
In the image file, the corresponding write request operation of each write request operation data is executed.
Optionally, the method also includes:
After receiving the write request daily record data that the production center is sent, continue to what the production center was sent
Iteration daily record data.
The third aspect, the application provide a kind of device of image file duplication, and described device is applied in disaster recovery and backup systems
The production center, the disaster recovery and backup systems further include Disaster Preparation Center, and the production center is standby to calamity as unit of data block by network
Center sends image file replicate data, and described device includes:
Acquiring unit obtains when carrying out image file duplication to Disaster Preparation Center for the image file in the production center
Take the target position information of the data block of current image file duplication;
Write request processing unit, if for receiving the write request to the image file, and the write request starts
The corresponding numerical value in position is greater than the corresponding numerical value in the target position, then the write request is directly executed, if the write request knot
The corresponding numerical value in the position of beam is less than the corresponding numerical value in the target position, then executes the write request, and by the write request
It is recorded in the write request log pre-established;
Log transmission unit carries out image file to Disaster Preparation Center for the image file in the production center and has replicated
The data of the write request log are transferred to the Disaster Preparation Center by Cheng Shi, and form the effective fast of an image file duplication
According to.
Optionally, the write request processing unit is also used to:
If the corresponding numerical value in the position that the write request starts is less than the corresponding numerical value in the target position, and described write is asked
The corresponding numerical value in the position of end is asked to be greater than the corresponding numerical value in the target position, then to greater than the corresponding number in the target position
The data block of value executes the write request;The write request is executed to the data block for being less than the corresponding numerical value in the target position,
And the write request is recorded in the write request log pre-established.
Optionally, described device further includes locking unit, and the locking unit is used for:
After described receive to the write request of the image file, locks the corresponding numerical value in the target position and become
Amount;
When in the position that the write request starts, corresponding numerical value is greater than the corresponding numerical value in the target position, directly execution
After the write request, the corresponding numerical variable in the target position is unlocked;
When in the position that the write request terminates, corresponding numerical value is less than the corresponding numerical value in the target position, described in execution
Before write request, the corresponding numerical variable in the target position is unlocked.
Optionally, the write request processing unit is also used to that the data of the write request log are transferred to the calamity is standby
When center, continue the record of write request log;
The log transmission unit is also used to starting the data of the write request log being transferred to the Disaster Preparation Center
The data of the write request log saved are transmitted before when, the data transmission preservation later for starting write request log is sent
Write request daily record data.
Fourth aspect, the application also provide a kind of device of image file duplication, and described device is applied in disaster recovery and backup systems
Disaster Preparation Center, the disaster recovery and backup systems further include the production center, and the Disaster Preparation Center is received as unit of data block by network
The production center carries out the data that image file duplication is sent, and described device includes:
Image file receiving unit, the image file data block sent for receiving the production center;
Writing unit, for the image file data block to be written in the image file being pre-created;
Log receiving unit is asked for when the image file replicates completion, receiving the writing for production center transmission
Seek daily record data;
Execution unit, for executing write request operation, weight in the image file according to the write request daily record data
Put write request log.
Optionally, the execution unit is specifically used for:
Successively obtain each write request operation data in the write request daily record data;
In the image file, the corresponding write request operation of each write request operation data is executed.
Optionally, the log receiving unit be also used to receive write request daily record data that the production center is sent it
Afterwards, the iteration daily record data that the production center is sent is continued to.
As can be seen from the above technical solutions, the embodiment of the present invention has the advantage that
The read-write requests of the production center of the embodiment of the present invention operate normally, and Disaster Preparation Center is also that normal sequence reads mirror image text
Number of packages evidence passes through the position number corresponding with the target position for the data block that current image file replicates for the write request that judgement obtains
The relationship of value judges whether to need to record corresponding write request into write request log, and image file has been copied over
New write request is charged to write request log by (containing what is replicated) region;Equal image files duplication is completed, then write asking
It asks daily record reproduction to Disaster Preparation Center, just forms primary complete image file duplication in this way.The embodiment of the present invention is in image file
It requests operation to influence upper layer I/O in reproduction process extremely low, only to the write request in replicated region, carries out write request day
Will record;Simultaneously as only carrying out write request log recording to replicated region, reduce last operation close to half
Daily record reproduction operation, improves the efficiency of image file duplication, while maintaining effective snapshot of image file duplication.
Description and claims of this specification and the (if present)s such as term " first " in above-mentioned attached drawing, " second "
It is to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that the number used in this way
According to being interchangeable under appropriate circumstances, so as to the embodiments described herein can in addition to the content for illustrating or describing herein with
Outer sequence is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover non-exclusive packet
Contain, for example, what the process, method, system, product or equipment for containing a series of steps or units were not necessarily limited to be clearly listed
Those step or units, but may include be not clearly listed or it is intrinsic for these process, methods, product or equipment
Other step or units.
The technology being partially related in the embodiment of the present invention is simply introduced first below.
Super fusion all-in-one machine: the basic components such as virtual management software, virtual memory, virtual network are fused together,
Using the IT infrastructure portion of the softwares such as 86 server hardware of standard x carrying virtual management software, virtual memory, virtual network
Part.Storage uses distributed storage framework, needs first to set up cluster before use, the physical disk of all all-in-one machines is empty in cluster
Intend into memory resource pool, then provides storage service to virtual management software.Wherein crucial technology has Hypervisor, i.e., empty
Quasi-ization management program, computer that can be virtual by the computer simulation Cheng Duotai of a physics, and in the environment of virtualization
The software of face operation operating system.By virtual management software, virtual machine can be allowed to share same physical computer, but right
For virtual machine, it operates in virtual management software and simulates inside the hardware system come, as oneself having monopolized entire meter
Calculation machine is the same.It needs to expend during deployment greatly to sum up, super fusion all-in-one machine helps enterprise to reduce IT infrastructure
The deployment of the innovation and applications in enterprise such as " manual labor " for measuring time and resource is also cloud platform, data analysis system provide
The solution that deployment is easier, extension is smoother.
Data calamity is standby: data calamity is data disaster backup for full name, is referred to prevent operation error or the system failure
Lead to loss of data, and by total system or partial data set, other storages, which are copied to, from the hard disk or array of applied host machine is situated between
The process of matter.Data calamity is standby at this stage mainly uses three center disaster recovery solution of two places, and two places refer to that same city, strange land, three centers are
Refer to the production center, with city disaster recovery center, long-distance disaster center.Wherein refer to the double centers in city and establishes two in same city or neighbouring city
A data center that can independently undertake critical system operation, double centers have substantially equivalent traffic handing capacity and pass through high speed
Link real-time synchronization data can share the operation of business and management system, and changeable operation under even in everyday situations simultaneously;Disaster feelings
The standby emergency switching of calamity can be carried out under condition in the case where not losing data substantially, keeps business continuity operation.With strange land calamity for mould
Formula compares, with the double centers in city with cost of investment is low, construction speed is fast, operation management is relatively easy, reliability is more high excellent
Point.Strange land Disaster Preparation Center, which refers to, establishes the Disaster Preparation Center of a backup in the city in strange land, is used for bicentric data backup, when
When double centers the reasons such as natural calamity occur and break down, strange land Disaster Preparation Center can carry out the extensive of business with Backup Data
It is multiple, to be finally reached the purpose of system is highly reliable, the high continuity of business, data High Availabitity.
Disaster tolerance system: for IT, the ring of various disasters can be exactly dealt with for one that computer information system provides
Border.When computer system by the irresistible natural disaster such as such as fire, floods, earthquake, war and computer crime,
When the human-made disasters such as computer virus, power down, network/communication failure, hardware/software mistake and manual operation mistake, disaster tolerance system
System will guarantee the safety (data disaster tolerance) of user data, even, a more perfect disaster tolerance system, moreover it is possible to provide uninterrupted
Application service (apply disaster tolerance).It can be said that disaster tolerance system is the standby highest level of data calamity.
Store snapshot: about a completely available copy of specified data acquisition system, which includes corresponding data at some
The image at time point (time point that copy starts).Snapshot can be a copy of the data represented by it, be also possible to count
According to a duplicate.The effect of snapshot is mainly able to carry out online data backup and restores.When storage equipment is applied
Quick data recovery can be carried out when failure or file corruption, and data are restored to the state at some available time point.Fastly
According to another effect be for storage user provide another data access channel, when former data carry out application on site processing
When, the accessible snapshot data of user can also carry out the work such as testing using snapshot.Existing snapshot mainly has Copy on write
Two kinds are redirected with IO.
Image file duplication: in super fusion all-in-one machine, image file duplication is by the virtual machine image text of the production center
Part copies to the information storing process of Disaster Preparation Center, to achieve the purpose that data catastrophic failure-tolerant backup and improve data reliability.In order to
Influence of the image file duplication to super fusion all-in-one machine business is eliminated, in image file reproduction process, the production center uses fast
The continuous service of its business is ensured according to technology, and super fusion integrated machine system business is normally transported to reduce image file duplication
Capable influence.
Particular content in the embodiment of the present invention is described below.
As shown in Figure 1, the embodiment of the present invention is applied to disaster recovery and backup systems, which includes the production center and at least one
Disaster Preparation Center, the production center send image file replicate data to Disaster Preparation Center as unit of data block by network, wherein mirror
As file replicate basic unit be data block, size can be adjusted voluntarily as the case may be, for example, 2MB, bandwidth provide
In the case that source meets, 5M, 10M, 50M etc. can also be.
Referring to Fig. 2, method one embodiment that image file replicates in the embodiment of the present invention includes:
201, when the image file in the production center carries out image file duplication to Disaster Preparation Center, current mirror image is obtained
The target position information of the data block of file duplication;
If 202, receiving the write request to the image file, and the corresponding numerical value in position that the write request starts is big
In the corresponding numerical value in the target position, then the write request is directly executed, if the corresponding number in position that the write request terminates
Value is less than the corresponding numerical value in the target position, then executes the write request, and the write request is recorded in and is pre-established
In write request log;
203, it when the image file in the production center carries out image file duplication completion to Disaster Preparation Center, is write described
The data of Request Log are transferred to the Disaster Preparation Center, and form effective snapshot of image file duplication.
The read-write requests of the production center of the embodiment of the present invention operate normally, and Disaster Preparation Center is also that normal sequence reads mirror image text
Number of packages evidence passes through the position number corresponding with the target position for the data block that current image file replicates for the write request that judgement obtains
The relationship of value judges whether to need to record corresponding write request into write request log, and image file has been copied over
New write request is charged to write request log by (containing what is replicated) region;Equal image files duplication is completed, then write asking
It asks daily record reproduction to Disaster Preparation Center, just forms primary complete image file duplication in this way.The embodiment of the present invention is in image file
Hardly I/O request operation in upper layer is impacted in reproduction process, only to the write request in replicated region, carries out one
Secondary write request log recording;Simultaneously as only carrying out write request log recording to replicated region, reduce last operation
Daily record reproduction close to half operates.
And the snapshot point that image file replicates in the embodiment of the present invention has been deferred to image file end of transmission
Time point, and the snapshot point of traditional image file duplication is the time point that image file transmission starts.It ensure that image file
The timeliness of duplication improves the efficiency of image file duplication.
Optionally, the method also includes:
If the corresponding numerical value in the position that the write request starts is less than the corresponding numerical value in the target position, and described write is asked
The corresponding numerical value in the position of end is asked to be greater than the corresponding numerical value in the target position, then to greater than the corresponding number in the target position
The data block of value executes the write request;The write request is executed to the data block for being less than the corresponding numerical value in the target position,
And the write request is recorded in the write request log pre-established.
As shown in figure 3, the position of identification data block is the target position of the data block of current image file duplication.It is asked if writing
Ask before the target position that (embodiment of the present invention judged by data block location, such as the position that write request starts
The comparison of corresponding with target position numerical value, the numerical value can be the number of data block, such as 1,2,3 ..., from small to large, data
The position of block 1 is before the position of data block 2), the write request is directly executed, if the position that the write request terminates is corresponding
Numerical value is less than the corresponding numerical value in the target position, then executes the write request, and the write request is recorded in and is pre-established
Write request log in.If the corresponding numerical value in the position that the write request starts is less than the corresponding numerical value in the target position, and
The corresponding numerical value in the position that the write request terminates is greater than the corresponding numerical value in the target position, then to greater than the target position
The data block of corresponding numerical value executes the write request;To described in the data block execution less than the corresponding numerical value in the target position
Write request, and the write request is recorded in the write request log pre-established.
Optionally, after described receive to the write request of the image file, the method also includes:
Lock the corresponding numerical variable in the target position;
When in the position that the write request starts, corresponding numerical value is greater than the corresponding numerical value in the target position, directly execution
After the write request, the corresponding numerical variable in the target position is unlocked;
When in the position that the write request terminates, corresponding numerical value is less than the corresponding numerical value in the target position, described in execution
Before write request, the corresponding numerical variable in the target position is unlocked.
Specifically, target position is set as variable CUR, the write request of the production center then presses region division progress, this when
It waits and first locks variable CUR:
If the initial position of write request is greater than CUR, write request is normally executed, CUR is then unlocked.
If the end position of write request is less than CUR, CUR is unlocked, write request is executed, write request data is charged into write request day
Will.
If write request range spans CUR, write request is split into two parts according to the position CUR, for being greater than the region CUR
Write request executes write request, unlocks CUR;For being less than the write request in the region CUR, CUR is unlocked, executes write request, and will write and ask
Data are asked to charge to write request log.
Optionally, the method also includes:
When the data by the write request log are transferred to the Disaster Preparation Center, continue write request log
Record, the write request log saved before starting the data by the write request log and being transferred to the Disaster Preparation Center
Data when being transmitted, send the write request daily record data saved after the data transmission for starting write request log.
The embodiment of the present invention can be the synchronization replication mode of disaster recovery and backup systems, be also possible to asynchronous replication mode, as Fig. 4,
Shown in Fig. 5, synchronous duplication also needs to wait for the long-range of Disaster Preparation Center after the completion of referring to the writing and do request operation of each production center
It is just discharged after the completion of duplication.Fig. 4 illustrates the synchronous duplication disaster tolerance time shaft figure of data based on image file duplication,
Middle time point t2 is the practical Snapshot time point of the mirror image, and t3 is the time point that data start synchronous duplication, multiple to iteration log
System terminates, so that it may open the synchronization copy function of disaster recovery and backup systems, i.e., it is the operation of write request each time of the production center is all synchronous
To Disaster Preparation Center.
Certainly, image file duplication can also be easy to turn to the asynchronous replication mode of disaster recovery and backup systems, and asynchronous replication is
Referring to and operates the write request of the production center, Disaster Preparation Center is copied in a manner of running background, and each write request normally discharges,
Without waiting for the completion of remote copy.As shown in figure 5, this patent only needs to terminate daily record reproduction here, that is, complete primary
Complete image file duplication, then circulation carries out log recording and duplication, completes the calamity of asynchronous replication for function.
Furthermore, it is noted that operations such as special write requests, such as file renaming, deletion, creation in the embodiment of the present invention
It is not applicable, traditional file read-write data block operation is only used only.
The embodiment of the method for the image file duplication of the other side in the embodiment of the present invention is described below.
Referring to Fig. 6, for another embodiment schematic diagram of image file duplication in the embodiment of the present invention, this method application
Disaster Preparation Center in disaster recovery and backup systems, the disaster recovery and backup systems further include the production center, and the Disaster Preparation Center is by network with data
Block is the data that unit receives that the production center carries out image file duplication transmission, which comprises
601, the image file data block that the production center is sent is received;
602, in the image file that image file data block write-in is pre-created;
603, when the image file replicates completion, the write request daily record data that the production center is sent is received;
604, according to the write request daily record data, write request operation is executed in the image file, resets write request
Log.
Optionally, according to the write request daily record data, write request operation is executed in the image file, comprising:
Successively obtain each write request operation data in the write request daily record data;
In the image file, the corresponding write request operation of each write request operation data is executed.
Optionally, the method also includes:
After receiving the write request daily record data that the production center is sent, continue to what the production center was sent
Iteration daily record data.
The embodiment for the device that image file replicates in the embodiment of the present invention is described below.
Referring to Fig. 7, for one embodiment schematic diagram of the device of image file duplication in the embodiment of the present invention, the device
Applied to the production center in disaster recovery and backup systems, the disaster recovery and backup systems further include Disaster Preparation Center, the production center by network with
Data block is unit to Disaster Preparation Center's transmission image file replicate data, and described device includes:
Acquiring unit 701, when carrying out image file duplication to Disaster Preparation Center for the image file in the production center,
Obtain the target position information of the data block of current image file duplication;
Write request processing unit 702, if for receiving the write request to the image file, and the write request starts
The corresponding numerical value in position be greater than the corresponding numerical value in the target position, then the write request is directly executed, if the write request
The corresponding numerical value in the position of end is less than the corresponding numerical value in the target position, then executes the write request, and described write is asked
It asks and is recorded in the write request log pre-established;
Log transmission unit 703 carries out image file to Disaster Preparation Center for the image file in the production center and answers
When system is completed, the data of the write request log are transferred to the Disaster Preparation Center, and form having for an image file duplication
Imitate snapshot.
Optionally, the write request processing unit 702 is also used to:
If the corresponding numerical value in the position that the write request starts is less than the corresponding numerical value in the target position, and described write is asked
The corresponding numerical value in the position of end is asked to be greater than the corresponding numerical value in the target position, then to greater than the corresponding number in the target position
The data block of value executes the write request;The write request is executed to the data block for being less than the corresponding numerical value in the target position,
And the write request is recorded in the write request log pre-established.
Optionally, described device further includes locking unit 704, and the locking unit 704 is used for:
After described receive to the write request of the image file, locks the corresponding numerical value in the target position and become
Amount;
When in the position that the write request starts, corresponding numerical value is greater than the corresponding numerical value in the target position, directly execution
After the write request, the corresponding numerical variable in the target position is unlocked;
When in the position that the write request terminates, corresponding numerical value is less than the corresponding numerical value in the target position, described in execution
Before write request, the corresponding numerical variable in the target position is unlocked.
Optionally, the write request processing unit 702 be also used to the data of the write request log are transferred to it is described
When Disaster Preparation Center, continue the record of write request log;
The log transmission unit 703 is also used to starting for the data of the write request log to be transferred to the calamity in
When the data of the write request log saved before the heart are transmitted, the data transmission for sending beginning write request log saves later
Write request daily record data.
Referring to Fig. 8, for another embodiment schematic diagram of the device of image file duplication in the embodiment of the present invention, the dress
The Disaster Preparation Center being applied in disaster recovery and backup systems is set, the disaster recovery and backup systems further include the production center, and the Disaster Preparation Center passes through network
The production center is received as unit of data block and carries out the data that image file duplication is sent, and described device includes:
Image file receiving unit 801, the image file data block sent for receiving the production center;
Writing unit 802, for the image file data block to be written in the image file being pre-created;
Log receiving unit 803, for receiving writing for the production center transmission when the image file replicates completion
Request Log data;
Execution unit 804, for executing write request behaviour in the image file according to the write request daily record data
Make, resets write request log.
Optionally, the execution unit 804 is specifically used for:
Successively obtain each write request operation data in the write request daily record data;
In the image file, the corresponding write request operation of each write request operation data is executed.
Optionally, the log receiving unit 803 is also used in the write request log number for receiving the production center transmission
The iteration daily record data sent according to the production center later, is continued to.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.