硬盘数据保护与恢复方法

07-07-2004 дата публикации
Номер:
CN0001156763C
Контакты:
Номер заявки: 30-77-0111
Дата заявки: 29-04-2001

[1]

Technical Field

[2]

The present invention relates to computer data protection and recovery method, and in particular relates to a hard disk data backup and restore method.

[3]

Background Art

[4]

With the development of the information industry, more evident safety problem, is mainly divided into two aspects the safety problem, one is the leakage of the information, one is the destruction of the information, for the computer user, the latter still significant, many people with HiV also haunt CIH, because not only their computer is damaged, the more important thing is stored in the computer hard disk of a few months, years the accumulated shimoji data are lost, the information technology industry to develop more of the Company, more secure hard disk data protection product.

[5]

In order to protect the hard disk to a variety of method to backup data of a hard disk, the existing method for protecting hard disk data in the hard disk is a regular structure and the important data to a floppy disk for backup, once the hard disk the data is destroyed with the floppy disk to be restored again, this kind of method has the following disadvantages, first of all data backup work is not convenient, relatively large hard disk the need for many floppy disk, second backup to the floppy disk takes a lot of time, then the method needs to be operated manually so that the timing backup is not practical, so it is possible to realize the function of timing the backup, the backup data is therefore greatly discounted real-time and effectiveness. On the market at present there is also a hard disk data protection product, in other words hard disk protection card, it is a card with memory, to a slot of the computer, and the need to install a corresponding software. The basic principle is that the hard disk of the important data backup onto the card, necessary, to restore the data from the card to the hard disk, the purpose of protecting the hard disk data. The shortcoming of this method is the need for hardware resources, need specialized personnel to install, flexibility is poor, especially now hard disk increasingly large, many cases is very difficult to retain all the important data. On the market today there is also another type of hard disk data protection product, that is, the software protection, the basic principle is that the hard disk on an operating system independent partitions cannot be identified, the important data is stored in the hard disk in the subregion, necessary, the data read out from the partition, to be restored to the due position, thereby achieving the purpose of protecting hard disk data. The method entails establishing an independent partitions, therefore the need to pre-install the software installation system, or special tools after the shrinkage of the other partitions, for independent partitions, needs a professional operating, ease of use is poor. Therefore, the needs of the market a flexible, easy to use the hard disk data protection products.

[6]

Content of the invention

[7]

The purpose of this invention is to provide a method for protecting hard disk data, current operating system in the hard disk region can be recognized on the backup data in need of protection.

[8]

Another purpose of this invention is to provide a hard disk data recovery method, the backup hard disk data to search and recovery.

[9]

The hard disk of the present invention method for protecting data, comprising the steps of : (1) read the data to be protected ; (2) according to a size of the sector storing said read data in a frame format, in each frame characteristic mark is provided with a 1st, the characteristic mark 1st comprising a backup flag, indicating that the sector is a backup data frame ; (3) repeat the above-mentioned (1) (2) steps, until the finished all to store the data, in order to form a plurality of data frame ; (4) the plurality of data frames may be stored in the identification of the current operating system in the hard disk partition, form a backup file.

[10]

The invention the hard disk data recovery method, comprising the steps of : (1) one by one to read the data in the sector of the hard disk ; (2) for each sector data, check whether it contains the predetermined characteristic mark 1st, wherein characteristic mark the 1st comprising a backup flag, indicating that the sector is a backup data frame ; (3) if the characteristic mark 1st, the sector data is data of the backup file, in accordance with the characteristic mark 1st storing the unallocated area ; (4) if not containing the characteristic mark 1st, a sector reads data ; (5) repeat the above steps (1) to (4), until the finished all backup data, to identify all 1st with a predetermined part of the backup data of the characteristic mark, carry on the hard disk data recovery.

[11]

By adopting the method of the present invention the important data on the hard disk to regularly stored in the operating system on the hard disk partition is used at present, is all the operations are the normal operation of the operating system to use, without any risk. The system cannot be started, or even cannot be identified under the condition of the hard disk partitions, is restored from the hard disk drive before the data of the backup. Moreover, this kind of recovery can also be security fallbacks, can choose different restoring the backup data. Therefore, it is more safe.

[12]

Description of drawings

[13]

By reference to the following Figures, detailed description of this invention.

[14]

Figure 1 is flow chart of the hard disk data backup method of the invention;

[15]

Figure 2A, 2B is used in the present invention for the backup data of the picture frame format;

[16]

Figure 3 is a single hard disk data backup flowchart of in accordance with the present invention;

[17]

Figure 4 is flow chart of the invention the hard disk data recovery method;

[18]

Figure 5 is graph of frame buffer in fig. 4 in the hard disk of the use of the data recovery process.

[19]

Mode of execution

[20]

Figure 1 is flow chart of the hard disk data backup method of the invention. In step 1001, the hard disk data backup start; in step 1002, the data of the read to be protected; in a step 1003, a characteristic mark with 1st of the frame, the frame format of the detailed description below; in a step 1004, to judge whether to read all the data, if not completed, returning to step 1002, to continue to read the data, such as finished, go to step 1005, can identify the current operating system in the hard disk partition, the whole to protect data forming a backup file, and storage, then to step 1006, the end of data backup of the hard disk. Furthermore, in a frame of the backup file (or frame 1st) 2nd characteristic mark can be set in, the characteristic mark the 2nd in the following detailed description.

[21]

In the hard disk data backup process, can also establish a restoration of the hard disk used for cancelling the document, the document is a valid data is empty document of the characteristic mark with 1st, the before-write hard disk is restored, the data backup to the document. If the user data recovery after the hard disk, do not want the result of the restoration, the document data can be restored to the hard disk before the data state of the data recovery.

[22]

As shown in Figure 2A shown, frames of the invention are as follows, for each frame size is 5   12 byte, the front of each frame 496 bytes store effective data, after this byte, 1st characteristic mark is put, in other words, a 1st 4 byte storage frame number, from the frame 1 to begin, the last frame of the highest digit is 1, a 2nd 4 byte storage backup time information, a 3rd 4 byte storing the checksum frame backup (front 504 byte), a 4th 4 byte is used for storing a 1st or 2nd sign of the backup. Through this structure can ensure that a frame is complete in a sector, the hard disk can directly search to find a backup data.

[23]

Furthermore, in the whole backup stored in a frame as the whole information of the backup characteristic mark 2nd, the frame structure as shown of 2B is shown in:

[24]

1st a 4 byte stored version number; a 2nd 4 byte store the whole backup effective length of the data; a 3rd 4 byte number of the hard disk storage system; a 4th 4 byte storing the backup of the total number of frames, then the 8 bytes to store the physical parameters of a 1st hard disk, to 8 byte as the unit storing each of the physical parameters of the hard disk. The characteristic mark of the backup as a whole can also be placed in the last frame of the backup file.

[25]

Figure 3 is a single hard disk data backup flowchart of the application of the invention;

[26]

First, in step 3001, starting the hard disk backup, in the step 3002, reading hard disk MBR (master boot sector) data, in step 3003, to judge the data is correct, if not correct, in the step 3004 exit, otherwise, in step 3005, the data is compressed, and each sector data is stored into the frame of a characteristic mark, the current operating system identification hard disk area formed in a backup file, in step 3006, a partition table entry is read, in step 3007, effectively judge whether the partition table entry, such as invalid, in step 3008 end, such as effective, in step 3009, judging the partitioning is main partitions also is the extended partition, if is the extended partition, in step 3011, BOOTSECTOR reading extended partition (boot sector), return to step 3005, otherwise, in step 3010 in, the subregion according to the division-type backup of the important data, is returned to step 3005.

[27]

Figure 4 is flow chart of data recovery method for protecting hard disk.

[28]

Hard disk recovery method is mainly divided into two parts, first of all the search for hard disk backup data, and then resume hard disk data. In step 4001 in, starting the hard disk recovery process, in step 4002 in, reading hard disk physical sector data, if the sector finally 4 bytes is the same as the value of the sign with the backup, the preceding 504 bytes according to the word sum, if and is equal to the check and the frame is the data of the backup data. After a data frame is found, in step 4003 in, frame sequence number of the backup and backup with reference to the time information, the frame will be stored in physical sector numbers in the corresponding frame buffer, the state map displayed in frame buffer 5 in. Identifying sequentially each of the backup data frame. In step 4004, judging whether all have been found all frames of the backup, if not return to step 4002, continue to look for, if it is, to step 4005. In step 4005, compared with the version number of the backup version number of the recovery routine, if the recovery tool backup version number is higher than or equal to the version number, then go to step 4006, otherwise, prompt the user to a higher version of the hard disk for recovery tool recovery, and exit. In step 4006, reading the current computer hard disk parameter and the parameter is compared to the hard disk of the backup, judges whether or not a parameter match, if there is no match, then to step 4007, exit, if there is a match, executing step 4008, scheduled write the recovery of the order of of the hard disk, in the process, if the hard disk capacity is the same, at the time of check-in data, read data of one sector of the hard disk, and the sector of the backup data is compared, with only one if the same as the data of the hard disk, it is judged that the data is the data backup of the hard disk. In step 4009, calculate total data length, judging whether the backup as a whole is equal to the effective data length, if unequal, note data is not correct, withdraw from the recovery, if equal resume executing step 4010.

[29]

In step 4010 in, according to in step 4003 the reading of the information stored in each frame of the backup of the data decompression, in step 4011 in, determining whether the physical sector numbers 0, if it is not 0, in step 4013 in, the data is stored into the corresponding the corresponding physical sector of the hard disk (decompressed data is according to the physical sector number, the number of sectors, sector content storage), at the same time according to the backup method for the write before the sector to be written before the contents of the backup, restore write cancellation document of the hard disk. If the physical sector number is 0, then in step 4012 to be written in the setting below hard disk number , in write the data to the hard disk. In step 4014 in, to judge whether the end of the backup data file, if not ended, returning to step 4010 in, to continue to read the next backup data, if the file end, the end of the recovery process.

[30]

Figure 5 is graph of frame buffer in fig. 4 use in recovering the hard disk data. Sorted sequentially in which the Serial number of the physical sector numbers of the frame, used for the restoration.

[31]

In the process of the hard disk the restoration, can also be first judge whether there is a cancellation of the recovered documents exist, if there is, first the document for the resumption of the previous cancellation. Furthermore, using the selected backup, restore data.

[32]

Protecting hard disk data of this invention is flexible and convenient and recovery method, the arbitrary size of the hard disk support, there is no need to worry about too much of the hard disk. And is convenient to be installed, there is no need of professional personnel, ordinary users can be used according to the description. Can support multiple important data backup, chronic damage to the data, to obtain better protection function. When the resumption of the data, can be safely fallbacks, will not cause the secondary damage to the hard disk. Backup of data stored in a compressed format, can be transferred in the mobile medium, more security. Support a plurality of operating system platforms, support a plurality of file system. Can support FAT12, FAT16, FAT32, NTFS 3.51, NTFS4, NTFS5 file system format such as, at present these format is the format used by the vast majority of users, but the invention is not limited to this, but also can support other file system.



[33]

A method for protecting and restoring data on hard disk is disclosed. Said data protection includes such steps as reading the data to be protected, storing the data by frames, setting up the first flag for each frame, creating multiple frames, and storing them in the partitions of hard disks, which are recognizable to current operating system, to create a stand-by file. Said data restoration includes reading the data from hard disk sector by sector, checking its first flag, if there is, determining that the data in the sector is the data of stand-by file, storing the sector number, reading all the stand-by data, and restoring hard disk data.



1. A hard disk data protection method, comprising the steps of:

(1) read the data must be protected;

(2) according to a size of the sector storing said read data in a frame format, in each frame characteristic mark is provided with a 1st, the characteristic mark 1st comprising a backup flag, indicating that the sector is a backup data frame;

(3) repeat the above-mentioned (1) (2) steps, until the finished all to protect the data, in order to form a plurality of data frames;

(4) the plurality of data frames may be stored in the identification of the current operating system in the hard disk partition, form a backup file.

2. Method according to Claim 1, wherein the backup file in the storage of a frame of the characteristic mark 2nd, wherein the characteristic mark the 2nd: version number, the entire backup effective length of the data, the number of the backup total frame , the number of the hard disk, the physical parameters of the hard disk.

3. Method according to Claim 1, wherein the executing step (2) before, the protection of the read compressed data.

4. Method according to Claim 1, further comprising the steps of (5), the establishment of a cancellation file of the hard disk, is used in the recovery process, in accordance with need, cancel the hard disk data has been restored, the data is restored to the state before the restoration.

5. Method according to Claim 1, wherein the frame size is 512 bytes.

6. Method according to Claim 5, wherein the stated 1st characteristic marking also includes: frame sequence number; backup time information; and checking of the backup.

7. Method according to Claim 6, wherein the characteristic mark the 1st the rear of the frame 16 in a byte.

8. Method according to Claim 2, wherein stored in the characteristic mark the 2nd and the 1st frame of the backup file.

9. Method according to Claim 2, wherein the 2nd stored in the characteristic mark the last frame of the backup file.

10. A hard disk data recovery method, comprising the steps of:

(1) one by one to read the data in the sector of the hard disk;

(2) for each sector data, check whether it contains the predetermined characteristic mark 1st, wherein characteristic mark the 1st comprising a backup flag, indicating that the sector is a backup data frame;

(3) if the characteristic mark 1st, the sector data is data of the backup file, storing the characteristic mark in accordance with the 1st a sector number;

(4) if not containing the characteristic mark 1st, reads a sector data;

(5) repeat the above steps (1) to (4), until the finished all backup data, to identify all 1st with a predetermined part of the backup data of the characteristic mark, then hard disk data recovery.

11. Method according to Claim 10, wherein step (5) further comprises: using a predetermined characteristic mark the 2nd carry on the hard disk data recovery, wherein the characteristic mark the 2nd: version number, the entire backup effective length of the data, the number of the backup total frame , the number of the hard disk, the physical parameters of the hard disk.

12. Method according to Claim 10, wherein said sector is 512 bytes.

13. Method according to Claim 10, wherein said step (3) further comprises: if the sector finally 4 byte with the value of the characteristic mark 1st of backup in the same sign, further the preceding 504 byte sum, if and equal to the characteristic mark 1st of backup in the checksum, the sector data is backup data frame.

14. Method according to Claim 13, further including: in accordance with the characteristic mark 1st and backup time frame sequence number in the information storage of the physical sector numbers of the sector.

15. Method according to Claim 10, wherein the implementation of the steps (1) to implement before: judge whether there is a cancellation of the hard disk the recovered documents exist, if there is, cancellation of the document for a time on the hard disk data recovery, and then carry on the hard disk data recovery.

16. Method according to Claim 11, wherein further comprises:

Read (the 5 [...]) in 2nd version number of the characteristic mark, if recovery tool backup version number is higher than or equal to the version number, to data recovery, otherwise exit;

(The 5 [...]) reading the current hard disk parameter, judging whether the characteristic mark 2nd in the hard disk of the backup parameters match, if hard disk parameter matching, the sequence of scheduled resumption of the hard disk;

(The 5 [...]) calculate total data length, judging whether the characteristic mark 2nd the entire backup effective data length is equal to, if equal to, if not withdraw from the recovery;

(The 5 [...]")frame information reading of the buffer memory in each of the backup data stored in the corresponding compressed and demodulating the data of the corresponding physical sector of the hard disk, the write before at the same time according to the backup method to write the sector before the contents of the backup.

17. Method according to Claim 16, wherein the steps in (the 5 [...]), the scheduled hard disk recovery sequence comprises: frame read the information of the buffer memory in each of the backup data and compressed, the backup data of the sector corresponding to the hard disk of the hard disk the data scheduled to the comparison of recovery sequence.

18. Method according to Claim 16, wherein in the step (the 5 [...]")in, when the user is reading of the 0 time, the next write data to the hard disk.