Dynamic restoring system of whole hard disk multiple spot and method thereof
Technical field
The present invention is relevant for a kind of numerical data restoring system and method, particularly relevant for dynamic restoring system of a kind of whole hard disk multiple spot and method thereof.
Background technology
Along with the quick progress of contemporary electronic technology, no matter be that hardware product or software product are all constantly weeded out the old and bring forth the new.In enterprise and personal computer user now, the current considerable ring of can saying so of Internet, for needs often online seek information or carry out information interchange person for, the defence hacker is particularly important with the invasion of virus.Therefore, if can cut apart working environment and online environment, the feasibility of being attacked in the time of then can greatly reducing online.In addition, because the development of software engineering now, numerous plug-in programs can't be dealt with and manage to traditional operating system still effectively, make traditional operating system often because of installing and removing too much plug-in program, and cause the reduction significantly of system effectiveness, even cause, and the disorder of initiating system when the conflicting state of machine or system.Therefore, the technology of system reducing or isolation is subjected to the attention of certain degree gradually.The technology of applied restoring system is based on disk file maintenance technology in the market.Preservation technology about the disk data can be divided into following several sorting technique:
One, magnetic track level and file-level are preserved technology: magnetic track level preservation technology is meant the data of analyzing required preservation and backs up its shared magnetic track that the file-level technology of preserving then is meant data respective file or the file that backup institute desire is preserved.The advantage that the magnetic track level is preserved technology is the data that can preserve various forms, and is not only file or folder, should use magnetic track level preservation technology as need backup DISK to Image, yet the preservation unit of this technology minimum is a cut section.Relatively, the advantage that shelves level (file-level) is preserved technology then is to be that unit carries out preservation work with archives or information kit, and it preserves technology compared to the magnetic track level, and the preservation unit of this technology can be as small as single archives size; It is much lower that the execution usefulness of shelves level preservation technology is compared the magnetic track level.
Two, static allocation and dynamic assignment backup space method: the backup space apportion design can be restored the whole magnetic disk state, it preserves into a restoration point by preserving restoration point with a disk, but when preserving restoration point, need extra disk space, therefore when distributing disk space, can divide into two kinds of backup space methods such as static allocation and dynamic assignment.Distributing backup space when static allocation backup space method is meant and installs in system, generally is that the form with the hidden partition area exists.Relatively, dynamic assignment backup space method is meant that system does not allocate backup space in advance when installing, but in the process of executive system, carry out the backup space assignment real-time dynamicly, wherein, the advantage of dynamic assignment backup space method is to be to use how many resources then to distribute how many backup spaces, this method can not cause the waste of hard drive space comparatively speaking, and is beneficial to expansion.
Three, single cut section hard disk protection and whole hard disk resist technology: but this classification is the resist technology of distinguishing at the scope of backup information.Single cut section hard disk protection technology be meant since fail the breakthrough program when carrying out to the restriction of key links such as usefulness and hard drive space, only can back up the technology of a cut section, this cut section is the sector at operating system place usually.The whole hard disk resist technology then is the technology that can back up one or more cut sections, and it also can back up DISK to Image.
Four, single-point backup and multi-point backup technology: promptly make technology and distinguish with single restoration point or a plurality of restoration point.At present, most reduction technique still adopts the single-point redundancy technique, that is can only preserve a single state of disk, and in the future only can be according to this a single state recovery Disk State at that time.
Five, permanent type and many restoration points of disposal type technology: this kind technical classification is distinguished at many restoration points technology.Many restoration points of disposal type technology is meant when recovering restoration point, abandons the data that time-histories is positioned at this restoration point all the other restoration points afterwards.Relatively, many restoration points of permanent type technology then can not abandoned the data of restoration point thereafter when recovering restoration point, therefore can switch back and forth between arbitrary restoration point, and if no longer need certain restoration point, then it optionally can be deleted.But because the restriction of conventional art, most many restoration points technology still adopts many restoration points of disposal type technology at present.
Traditionally, the reduction technique of having developed can will be described as follows approximately according to aforementioned: 1, GOBACK, and it has used shelves level permanent type multi-point backup method, because of it is the shelves levels, so usefulness is not high; 2, Promagic, it has used magnetic track level disposal type multi-point backup method, and only has the effect of the single cut section of backup; 3, the virtual reduction of eastern stone, it has also used magnetic track level disposal type multi-point backup method, it also fails to carry out the effect of many restoration points of permanent type method as Promagic, and it has adopted static allocation backup space method, promptly need allocate sector in advance as backup space, because of the user can see this cut section, and cause the imprecision defective in the system design, so easily by hacker on the network or virus attack.In addition, except above-mentioned traditional multi-point backup technology, other method of reducing all can only be carried out the work of single-point backup.
And the above-mentioned conventional art that is applied to comprises traditional multi-point backup technology, neitherly is enough to be applied on the field demands such as virtual machine, software isolation.
Summary of the invention
In view of above-mentioned shortcoming of the prior art, the invention provides a kind of restoring system and method thereof can be in order to solve the purpose that above-mentioned conventional art fails to reach.
The dynamic restoring system of whole hard disk multiple spot of the present invention comprises:
One has the kernel program of specific program code, and this kernel program can be intercepted and captured the I/O signal of disk to carry out a revision program, revises one first read write command by this to produce a second reading write command;
One core data, this kernel program is found out corresponding this core data and is revised this first read write command by this specific program code and becomes this second reading write command, and store the change part of this core data simultaneously, and this kernel program simulates the data on hard disc environment of restoration point according to this core data, wherein, this core data has a summary journal table to write down the total information of all restoration points, and the operation that is controlled at by this under any restoration point can not have influence on other restoration point, and this summary journal table more comprises:
At least one group of read-write record sheet, this at least one group read-write record sheet is in order to form at least one restoration point;
One blotter table, this blotter table are worked as the front disk data in order to execution dynamic access function with record and are write situation.
Described kernel program can be carried out a disk analysis program with mark sector state.
Described at least one group of read-write record sheet more comprises a Disk State table to write down the sector state of each restoration point.
The sector state that described Disk State table is write down more comprises the numerical data shared sector of at least one used area with each restoration point in the mark disk, at least one reserved area is with the shared sector of this core data of mark, the corresponding sector of the numerical data that at least one temporary area has just write with mark, at least one free area is with mark no data sector.
Described at least one group of read-write record sheet more comprises a read-write mapping table needs the alternate sector with record reflection relation.
The dynamic method of reducing of whole hard disk multiple spot provided by the invention comprises the following steps:
One restoring system with a kernel program is provided;
Carry out the quantity of a pre-set programs with the decision restoration point;
Carry out a disk analysis program to resolve the environmental structure and the state thereof of hard disk at that time by this kernel program;
Produce and set up one have at least one read-write record sheet with one in order to the core data of the blotter table of execution dynamic access function to form at least one restoration point, at least one group of this read-write record sheet more comprises one needs the read-write mapping table of the reflection relation of alternate sector in order to the Disk State table of the sector state that writes down each restoration point and in order to record, wherein, the sector state that the Disk State table is write down more comprises the numerical data shared sector of at least one used area with each restoration point in the mark disk, at least one reserved area is with the shared sector of this core data of mark, and the corresponding sector of the numerical data that at least one temporary area has just write with mark and at least one free area are with mark no data sector;
This kernel program is intercepted and captured one first read write command and is become a second reading write command to carry out a revision program and to insert a specific program code, to find out corresponding core data simultaneously and revise this first read write command by this;
Surrender this second reading write command to carry out the reading and writing data program of essence by this kernel program.
According to said method of the present invention, more comprise an answer program to reply the Status of Backups of previous data on hard disc, this answer program accesses the record of at least one group of this read-write record sheet in the restoration point to simulate the data on hard disc environment of this restoration point according to this group read-write record sheet by this kernel program.
According to said method of the present invention, more comprise a write-in program:
Judge that data writes the sector and whether is positioned at a protected location, wherein, this protected location is meant the zone that before has been saved into restoration point;
If in this protected location, then directly do not carry out this write-in program;
If in this protected location, then judge the sector state;
When sector mark is used area or reserved area, then search the record of the read-write mapping table in this blotter table;
If this read-write mapping table has record then to write in recording address and finishes this write-in program;
If this read-write mapping table no record then according to free area suitable in the searching algorithm search disk writing data and to upgrade the sevtor address that writes of this read-write record sheet in this blotter table, and in this interim state table, be this reserved area with this sector mark;
When sector mark is not used area or reserved area, judge then whether write the sector is this free area;
When sector mark is this free area, then directly carry out this write-in program, and this sector of mark is a temporary area in this blotter table, upgrade this read-write record sheet simultaneously;
When sector mark is temporary area, then directly carry out this write-in program.
According to said method of the present invention, more comprise a fetch program:
Judge whether this sector is positioned at this protected location;
If not in this protected location, then directly carry out this fetch program;
If in this protected location, then judge the sector state according to this Disk State table;
If free area or temporary area then directly carry out this fetch program;
If used area or reserved area then check this blotter table whether record is arranged;
If this blotter table has record, then carry out this fetch program from recording address;
If this blotter table no record then checks current read-write record sheet that no record is arranged;
If current read-write record sheet has record, then carry out this fetch program from recording address;
If at least one group should be read and write record sheet and this all no record of blotter table, then directly carry out this fetch program.
The dynamic restoring system of whole hard disk multiple spot of the present invention is used magnetic track level dynamic assignment backup space technology to protect the numerical data of at least one cut section or DISK to Image; and the present invention can write down the data state of DISK to Image at different times with minimum hard drive space, and switches the data state back and forth to carry out application such as preservation data course, many environmental simulations between each period according to user's demand.In addition, the efficient when the present invention also can promote effectively and carry out, and backup information course intactly.Therefore, the present invention can integrate single-point and multi-point backup technology, also integrates whole hard disk and disposal type multi-point backup technology.
Description of drawings
It in Figure 1 shows that according to a preferred embodiment of the present invention the read-write record sheet structure of preserving disk operating;
The state of represented a kind of disk in the state table in Figure 2 shows that according to a preferred embodiment of the present invention;
Data in magnetic disk writes process flow diagram in Figure 3 shows that according to a preferred embodiment of the present invention;
Data in magnetic disk reads process flow diagram in Figure 4 shows that according to a preferred embodiment of the present invention;
The synoptic diagram of restoration point changeover program in Figure 5 shows that according to a preferred embodiment of the present invention.
Embodiment
Consult Fig. 1 and shown in Figure 2, in one embodiment of this invention, at first provide one to have the restoring system of a kernel program to be installed in the job platform.When restoring system installation of the present invention, user's interface is at first carried out the quantity of a pre-set programs with the decision restoration point.After finishing pre-set programs, kernel program carries out a disk analysis program to resolve the environmental structure and the state thereof of hard disk at that time, and on hard disk, produce and set up one and have the core data of at least one group of read-write record sheet, preserving disk state by this reads and writes in the record sheet to form at least one restoration point at least one group, wherein, above-mentioned core data more comprises one group of blotter table to carry out the dynamic access function, and by this at any time record write situation when the front disk data, that is the data of the blotter table before saving as restoration point is that renewable state is to reply original system environments at any time.At least one group of above-mentioned read-write record sheet more comprises a Disk State table and a read-write mapping table, and wherein, the read-write mapping table is in order to write down the reflection relation that needs the alternate sector, and the Disk State table is then in order to write down the state of each sector in each restoration point.After above-mentioned disk analysis program is finished, four kinds of state areas be distinguished and be recorded as to restoring system can with the sector state according to the Disk State table: the used area, the reserved area, temporary area and free area, wherein, the shared sector of the numerical data of each restoration point is marked as the used area in the disk, the shared sector of core data then is marked as the reserved area, that is, the sector that the data of read-write record sheets such as Disk State table and read-write mapping table is deposited, and the corresponding sector of the numerical data that has just write behind time computer starting then is marked as temporary area, does not have the sector of data then to be marked as the free area in all the other disks.In addition, above-mentioned reflection relation is because of used area and the reserved area of can't writing direct, and other sector so the data of used area and reserved area that will write is videoed again, the address of each sector of videoing again promptly are recorded in the read-write mapping table.
In the present embodiment, when operating system receives one first read write command when carrying out a data reading-writing program, kernel program can carry out a revision program to revise first read write command and to produce a second reading write command.Above-mentioned revision program is as follows: kernel program is is at first intercepted and captured the I/O signal of disk and is obtained control to disk read-write, by this, any I/O operation to disk all will be in advance through the processing of kernel program; Then, kernel program inserts a specific program code and becomes the second reading write command to find out corresponding core data and to revise first read write command by this, and stores the change part of corresponding core data simultaneously; Afterwards, kernel program is surrendered the second reading write command to carry out the reading and writing data program of essence.After the data reading-writing program was finished, when desire was replied the Status of Backups of previous data on hard disc, kernel program can access the record of the read-write record sheet in the restoration point, so that kernel program simulates the data on hard disc environment of this restoration point according to the read-write record sheet.
With reference to shown in Figure 3, in the present embodiment, the data write-in program of present embodiment is as follows: judge that at first data writes the sector and whether is in the protected location, if then directly do not carry out the data write-in program in the protected location, wherein, the protected location is meant the zone that before has been saved into restoration point; If data writes the sector in the protected location, then handle: when sector mark is used area or reserved area according to the sector state in the sector state table, owing to can not cover the data of this sector, therefore need to search earlier the record of read-write mapping table in the blotter table, if the read-write mapping table has record, then in recording address, write and finish the data write-in program, if read-write mapping table no record, then search earlier free area suitable in the disk writing data and to upgrade the sevtor address that writes of the read-write record sheet in the blotter table, and in interim state table, be the reserved area this sector mark according to a searching algorithm; When sector mark is not used area or reserved area, judge earlier then whether write the sector is the free area: when sector mark is idle condition, then directly carry out write-in program, and this sector of mark is a temporary area in the blotter table, upgrades the read-write record sheet simultaneously; When sector mark is temporary area, then directly carries out write-in program, and do not upgrade any record sheet.
With reference to shown in Figure 4, the data fetch program of present embodiment is as follows: judge at first whether this sector is in the protected location, if not in the protected location, then directly carry out the fetch program; If in the protected location then according to the sector state processing that is indicated in the state table: if free area or temporary area then directly carry out the fetch program; If used area or reserved area then check the blotter table whether record is arranged,,, there is record then to carry out the fetch program from recording address if no record then checks current read-write record sheet that no record is arranged if there is record then to carry out the fetch program from recording address; If at least one group is read and write record sheet and all no records of blotter table, then directly carries out the fetch program.
With reference to shown in Figure 5, in the present embodiment, the restoration point changeover program is as described below: at first remove the record of blotter table, and cover the state table of blotter table with the state table of purpose restoration point, thereby the disk datum recover is arrived the state of purpose restoration point.If will preserve restoration point, the interim state of then revising in the interim state table is a seizure condition, and the record with current read-write record sheet merges to the blotter table then.Then, select a untapped state table and a read-write record sheet as new current read-write record sheet, and, empty the image rec of blotter table simultaneously duplicating the new read-write record sheet of being recorded to of blotter table.The keeper of institute is the information of new restoration point in the new current read-write record sheet.If desire deletion restoration point, the read-write record sheet that mark need be deleted is a unused state, and removes whole records wherein.As mentioned above, suppose that Fig. 5 A is depicted as the original state of disk, its data are abc, and c is revised as d, save as a restoration point then, and shown in Fig. 5 B, the data that at this moment obtains is abd.On this basis b is revised as e, preserves a restoration point again, shown in Fig. 5 C, the data that at this moment obtains is aed.Selection resets into original state with disk, and will empty interim mapping table this moment, and the data of reading has become abc naturally again.On this basis b be revised as f, c is revised as g, preserves a restoration point again.According to the read-write algorithm, original address 9,10 as reflection is not covered, but the address 8,7 of videoing again, shown in Fig. 5 D, the data that obtains is afg.When at this moment switching to restoration point 2,, can obtain data aed by the mapping table of restoration point 2.When switching to restoration point 1, then can obtain data abd.Each data of preserving can not lost.So as can be known with above stated specification, the present invention becomes the technology of a plurality of restoration points for a kind of file maintenance with disk top or whole cut sections, it has tackled the disk read-write operation, and dynamically stores kernel program and read-write record sheet in disk, has realized the multi-point backup of disk data.In addition, the present invention is also anxious by total letter of all restoration points of summary journal table record, and the operation that is controlled at by this under any restoration point can not have influence on other restoration point.
As mentioned above, in an embodiment of the present invention, the dynamic reducing process of whole hard disk permanent type multiple spot of the present invention has replaced traditional data reducing method.Advantage of the present invention is as follows: 1. the present invention is a multipoint restoring technology: it can solve because of the improper management that produces that uses a computer, safeguard the problem of aspect, and computing machine is in again under the self-righting state in start back, also can prevent the malice invasion and attack of computer virus, and many restoration points of tool uniqueness are set to preserve a plurality of Disk States; 2. the present invention can be applicable on the virtual system: it can use same computing machine or under the situation of different system work in many people, set up the multiple environment that does not conflict each other according to different demands, be unlikely to the leakage data or destroy, lose, delete capsule information because of converting system.Certainly, the present invention also can be used in any numerical data method of reducing except being applied on the dynamic method of reducing of multiple spot.And, the dynamic reduction technique of whole hard disk permanent type multiple spot that the present invention is reached by the dynamic assignment method of hiding so far yet development be used in about numerical data reduction backup aspect.
The above; only for the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, and anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement, all should be encompassed in protection scope of the present invention in.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claims.