[go: up one dir, main page]

CN100437504C - Hard disk data backup system and method - Google Patents

Hard disk data backup system and method Download PDF

Info

Publication number
CN100437504C
CN100437504C CNB2006100731394A CN200610073139A CN100437504C CN 100437504 C CN100437504 C CN 100437504C CN B2006100731394 A CNB2006100731394 A CN B2006100731394A CN 200610073139 A CN200610073139 A CN 200610073139A CN 100437504 C CN100437504 C CN 100437504C
Authority
CN
China
Prior art keywords
archives
data
backup
file
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2006100731394A
Other languages
Chinese (zh)
Other versions
CN101051283A (en
Inventor
周宏亮
张玥
陈玄同
刘文涵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ivalley Holding Co Ltd
Original Assignee
Inventec Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Corp filed Critical Inventec Corp
Priority to CNB2006100731394A priority Critical patent/CN100437504C/en
Publication of CN101051283A publication Critical patent/CN101051283A/en
Application granted granted Critical
Publication of CN100437504C publication Critical patent/CN100437504C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A hard disk data backup system and method are used for backing up hard disk data of a computer system into a mirror image file. The invention reads the file system of the hard disk data to the memory of the computer system before backup, automatically checks the logic error existing in the file system of the hard disk data, correspondingly repairs the detected logic error of the file system in the memory, and finally backs up the hard disk data containing the correct file system to the mirror image file. The hard disk data backup system and the hard disk data backup method can detect and repair the logic errors possibly existing in the file system in real time in the backup process, not only ensure the normal operation of the backup operation, but also simplify the steps and the process of the backup operation and reduce the consumption of system resources in the backup process.

Description

硬盘数据备份系统及方法 Hard disk data backup system and method

技术领域 technical field

本发明涉及一种计算机数据的信息安全技术,特别是有关于一种实现计算机系统数据备份的系统及方法。The invention relates to a computer data information security technology, in particular to a system and method for realizing computer system data backup.

背景技术 Background technique

近年来,计算机由于其方便有效的特性而常常被应用于储存、处理一些重要事务,在人们日常生活和工作中处于越来越重要的地位。当前许多计算机用户所面临的一个重要问题就是由于操作系统或者硬盘驱动损坏带来的计算机数据遗失。增强对用户数据的保护具有非常重要的意义,因此,有效的硬盘数据备份和恢复也成为计算机用户关注的焦点。In recent years, due to its convenient and effective features, computers are often used to store and process some important affairs, and they are playing an increasingly important role in people's daily life and work. A major problem faced by many computer users today is the loss of computer data due to damage to the operating system or hard drive. It is very important to enhance the protection of user data. Therefore, effective hard disk data backup and recovery has also become the focus of attention of computer users.

目前已存在多种用于保护计算机操作系统信息的备份方法,但是公知技术中硬盘数据备份方法在备份文件系统时,通常要求存在于硬盘上的档案系统是正确的,即档案系统中不应当包含任何的逻辑错误等。否则在备份过程中,会由于档案系统存在的逻辑错误而造成备份过程出错而退出。例如档案系统的逻辑错误可能是某个档案在属性记录中的档案长度小于实际档案长度,因此公知技术的备份方法在按照属性中的档案长度分配内存以存放实际档案数据时,会造成数据缓冲区的溢出,进而导致备份过程的异常退出。At present, there are many backup methods for protecting computer operating system information, but the hard disk data backup method in the known technology usually requires that the file system on the hard disk is correct when backing up the file system, that is, the file system should not contain Any logic errors etc. Otherwise, during the backup process, the backup process will exit due to a logical error in the file system. For example, the logical error of the file system may be that the file length of a certain file in the attribute record is smaller than the actual file length, so the backup method of the known technology will cause a data buffer when allocating memory according to the file length in the attribute to store the actual file data. The overflow, which in turn leads to the abnormal exit of the backup process.

在档案系统含有逻辑错误的情况下,一般采取的措施是使用相应档案系统的检测、修复工具对其中的逻辑错误进行修正,直至所有的逻辑错误全部消除之后,才能进行正常的硬盘数据备份。When the file system contains logical errors, the general measure is to use the detection and repair tools of the corresponding file system to correct the logical errors. Only after all the logical errors are eliminated can normal hard disk data backup be performed.

因此,公知技术的备份做法仍然存有诸多缺陷,特别是在事先不清楚所备份的档案系统存在逻辑错误时,需要另外调用专门的检测修复工具进行修复。通常备份过程为″备份→出错→检测修复→再备份″的步骤,因此备份操作不仅繁琐复杂,还增加了系统资源的消耗。此外,备份过程出错而非正常退出会对硬盘数据造成意外破坏。Therefore, the backup method of the known technology still has many defects, especially when it is not clear in advance that there is a logical error in the file system backed up, it is necessary to call a special detection and repair tool to repair it in addition. Usually the backup process is the steps of "backup → error → detection and repair → backup again", so the backup operation is not only tedious and complicated, but also increases the consumption of system resources. Also, a backup process that goes wrong instead of exiting normally can cause accidental corruption of hard drive data.

发明内容 Contents of the invention

为了解决上述公知技术中的问题与缺陷,本发明的目的在于提供一种硬盘数据备份系统及方法,可以在备份过程中自动检测和修复档案系统错误,利用解决公知技术所存在的缺点及局限。In order to solve the problems and defects in the above-mentioned known technologies, the purpose of the present invention is to provide a hard disk data backup system and method, which can automatically detect and repair file system errors during the backup process, and solve the shortcomings and limitations of the known technologies.

本发明所提供的硬盘数据备份系统,用以将计算机系统的硬盘数据备份至一镜像档案中,此系统包含有检测模块、修复模块以及备份模块;于此,检测模块系用以在备份之前读取硬盘数据的档案系统至计算机系统的内存中,以检查硬盘数据的档案系统中存在的逻辑错误;修复模块用以于内存中修复档案系统的逻辑错误,以得到正确的档案系统;备份模块则用以将包含正确档案系统的硬盘数据备份至镜像档案中。The hard disk data backup system provided by the present invention is used for backing up the hard disk data of the computer system into a mirror image file. This system includes a detection module, a repair module and a backup module; here, the detection module is used for reading before backup Take the file system of the hard disk data to the memory of the computer system to check the logic errors in the file system of the hard disk data; the repair module is used to repair the logic errors of the file system in the memory to obtain a correct file system; the backup module is It is used to back up the hard disk data containing the correct file system to the image file.

依照本发明的硬盘数据备份系统,其中检测模块更包含有原数据检测模块与档案目录检测模块。原数据检测模块用以比对档案系统的原数据的实际信息与原数据的属性信息,以检测原数据是否存在逻辑错误;档案目录检测模块用以比对档案系统的档案或目录的实际信息与档案或目录的属性信息,以检测档案或目录是否存在逻辑错误。此外,依照具有上述特征的本发明的硬盘数据备份系统,其中修复模块更包含有:原数据修复模块,用以在档案系统的原数据的实际信息与原数据的属性信息不一致时,在内存中修正原数据的属性信息;以及档案目录修复模块,用以在档案系统的档案或目录的实际信息与档案或目录的属性信息不一致时,在内存中修正档案或目录的属性信息。According to the hard disk data backup system of the present invention, the detection module further includes a raw data detection module and a file directory detection module. The original data detection module is used to compare the actual information of the original data of the file system with the attribute information of the original data to detect whether there is a logic error in the original data; the file directory detection module is used to compare the actual information and Attribute information of files or directories to detect logical errors in files or directories. In addition, according to the hard disk data backup system of the present invention having the above-mentioned features, the repair module further includes: an original data repair module, which is used to restore the original data in the memory when the actual information of the original data in the file system is inconsistent with the attribute information of the original data. Correcting the attribute information of the original data; and the file directory repair module, used for correcting the attribute information of the file or directory in memory when the actual information of the file or directory in the file system is inconsistent with the attribute information of the file or directory.

此外,本发明还提供了一种硬盘数据备份方法,包含以下步骤:In addition, the present invention also provides a hard disk data backup method, comprising the following steps:

读取硬盘数据的档案系统至计算机系统的内存中;Read the file system of the hard disk data into the memory of the computer system;

在内存中检测档案系统中存在的逻辑错误;Detect logical errors in the file system in memory;

在内存中修复档案系统的逻辑错误;以及Fix file system logic errors in memory; and

备份包含修复后的档案系统的硬盘数据至镜像档案中。Back up the hard disk data containing the repaired file system to the image file.

依照本发明的硬盘数据备份方法,在内存中检测档案系统中存在的逻辑错误的步骤与在内存中修复档案系统的逻辑错误的步骤,更包含有下列步骤:比对档案系统的原数据的实际信息与其属性信息;判断原数据的实际信息与其属性信息是否一致;以及若不一致,则修正原数据的属性数据与其实际数据一致。其中,在判断该原数据的实际信息与其属性信息是否一致的步骤中,若为一致时,更包含有下列步骤:获取原数据的分区大小及起始位置,并与原数据中对应的记录信息比对;计算原数据的位图大小及起始位置,并与原数据中对应的记录信息比对;计算原数据的根节点的起始位置,并与原数据中对应的记录信息比对;以及计算原数据的其它属性信息,并与原数据中对应的记录信息比对。According to the hard disk data backup method of the present invention, the steps of detecting logical errors in the file system in the memory and repairing the logical errors of the file system in the memory further include the following steps: comparing the actual data of the original data of the file system information and its attribute information; determine whether the actual information of the original data is consistent with its attribute information; and if not, correct the attribute data of the original data to be consistent with its actual data. Among them, in the step of judging whether the actual information of the original data is consistent with its attribute information, if they are consistent, the following steps are further included: obtaining the partition size and starting position of the original data, and matching the corresponding record information in the original data Comparison; calculate the bitmap size and starting position of the original data, and compare it with the corresponding record information in the original data; calculate the starting position of the root node of the original data, and compare it with the corresponding record information in the original data; And calculate other attribute information of the original data, and compare with the corresponding record information in the original data.

依照本发明的硬盘数据备份方法,在内存中检测档案系统中存在的逻辑错误的步骤与在内存中修复档案系统的逻辑错误的步骤中,更包含有下列步骤:比对档案系统的档案或目录的实际信息与其属性信息;判断档案或目录的实际信息与其属性信息是否一致;以及若不一致,则修正档案或目录的属性数据与其实际数据一致。其中比对档案系统的档案或目录的实际信息与其属性信息的步骤更包含有下列步骤:判断档案系统的档案类型;若档案类型为一普通档案,则比对普通档案的实际长度与其属性长度;以及若档案类型为一目录档案,则比对目录档案的档案及子目录数的实际信息与其目录属性信息。本发明在备份的过程中插入了档案系统的逻辑错误的检测和修复机制,可在备份的过程中进行错误的检测和修复,并且随着备份的过程逐步实现,避免由于备份过程的可能存在的出错而导致备份中断,进而简化了公知备份技术的操作步骤和过程,减少了对备份过程的影响和系统资源的消耗。According to the hard disk data backup method of the present invention, the steps of detecting logical errors in the file system in the memory and repairing the logical errors of the file system in the memory further include the following steps: comparing the files or directories of the file system The actual information of the file or directory and its attribute information; determine whether the actual information of the file or directory is consistent with its attribute information; and if not, correct the attribute data of the file or directory to be consistent with its actual data. Wherein the step of comparing the actual information of the file or directory of the file system and its attribute information further includes the following steps: judging the file type of the file system; if the file type is an ordinary file, comparing the actual length of the ordinary file and its attribute length; And if the file type is a directory file, compare the actual information of the number of files and subdirectories of the directory file with the directory attribute information. The present invention inserts the detection and repair mechanism of the logic error of the file system in the process of backup, which can detect and repair the error in the process of backup, and realize it step by step along with the process of backup, avoiding possible errors due to the backup process. The backup is interrupted due to an error, thereby simplifying the operation steps and process of the known backup technology, reducing the impact on the backup process and the consumption of system resources.

此外,本发明对档案系统的逻辑错误的检测和修复系在计算机内存中完成的,进而避免了对硬盘上数据的意外破坏。In addition, the invention detects and repairs the logical errors of the file system in the computer memory, thereby avoiding accidental destruction of data on the hard disk.

附图说明 Description of drawings

图1为本发明的硬盘数据备份系统的系统方块图;Fig. 1 is the system block diagram of hard disk data backup system of the present invention;

图2为本发明的硬盘数据备份方法的步骤流程图;Fig. 2 is the flow chart of steps of the hard disk data backup method of the present invention;

图3与图4为档案系统的原数据的检测、修复及备份步骤流程图;Fig. 3 and Fig. 4 are the detection, restoration and backup step flowchart of the original data of the file system;

图5为档案系统的档案/目录备份步骤流程图;以及Fig. 5 is a flow chart of the file/directory backup steps of the file system; and

图6与图7为档案系统的档案/目录的检测及修复步骤流程图。FIG. 6 and FIG. 7 are flow charts of detecting and repairing steps of files/directories of the file system.

其中,附图标记:Among them, reference signs:

10计算机硬盘           20数据备份系统10Computer hard disk 20Data backup system

21检测模块             211原数据检测模块21 detection module 211 raw data detection module

212档案目录检测模块    22修复模块212 File directory detection module 22 Repair module

221原数据修复模块      222档案目录修复模块221 Original data repair module 222 File directory repair module

23备份模块             231原数据备份模块23 backup module 231 original data backup module

232档案目录备份模块    30镜像档案232 file directory backup module 30 mirror file

具体实施方式 Detailed ways

配合附图对最佳实施例详细说明如下。The preferred embodiment is described in detail as follows in conjunction with the accompanying drawings.

请参考图1,图中表示了本发明的硬盘数据备份系统的系统方块图,包含有计算机硬盘10、数据备份系统20与镜像档案30,以将计算机硬盘10中包含的各种数据备份至镜像档案30中。其中如图所示,数据备份系统20包含有检测模块21、修复模块22以及备份模块23。检测模块21又包括原数据检测模块211与档案目录检测模块212,修复模块22则包括原数据修复模块221与档案目录修复模块222,以及备份模块23包含有原数据备份模块231及档案目录备份模块232。Please refer to FIG. 1 , which shows a system block diagram of the hard disk data backup system of the present invention, including a computer hard disk 10, a data backup system 20 and an image file 30, so as to back up various data contained in the computer hard disk 10 to the image. File 30. As shown in the figure, the data backup system 20 includes a detection module 21 , a repair module 22 and a backup module 23 . The detection module 21 includes an original data detection module 211 and a file directory detection module 212, the repair module 22 includes an original data recovery module 221 and a file directory recovery module 222, and the backup module 23 includes an original data backup module 231 and a file directory backup module 232.

在备份计算机硬盘10的操作系统或者各种数据至镜像档案30之前,首先将计算机硬盘10上对应档案系统读取至计算机系统内存中,并透过本发明的检测模块21,即其中的原数据检测模块211与档案目录检测模块212在内存中对计算机硬盘10上的档案系统进行检测,以判断档案系统中是否存在逻辑错误。在存在逻辑错误时,则调用本发明的修复模块22,即其中的原数据修复模块221及档案目录修复模块222在内存中对相应的逻辑错误进行修正,以保证档案系统的备份过程正常进行。备份模块23用以将包含正确档案系统的硬盘数据备份至镜像档案30中,从而在计算机系统出现故障造成数据遗失时,可透过相应的恢复操作进行数据恢复。Before backing up the operating system of the computer hard disk 10 or various data to the image file 30, first read the corresponding file system on the computer hard disk 10 into the computer system memory, and pass through the detection module 21 of the present invention, that is, the original data therein The detection module 211 and the file directory detection module 212 detect the file system on the computer hard disk 10 in the internal memory to determine whether there is a logic error in the file system. When there is a logic error, then call the repair module 22 of the present invention, that is, the original data repair module 221 and the file directory repair module 222 correct the corresponding logic error in the memory, so as to ensure that the backup process of the file system is carried out normally. The backup module 23 is used to back up the hard disk data containing the correct file system to the image file 30, so that when the computer system fails and the data is lost, the data can be recovered through corresponding recovery operations.

通常,档案系统包含有原数据与目录、档案数据,原数据系指描述组成档案系统结构的数据,例如分区大小、每个数据区块的扇区数目等;此外档案系统中还包括目录和相应档案数据。因此,在备份文件系统时,需要将原数据与目录、档案数据备份下来。但是档案系统会由于计算机系统突然断电等原因造成逻辑错误的出现:例如某一个档案c:\windows\aa.bin由于在写操作时突然被中断,实际的档案长度要比记录在档案属性中的长度要大;同时,在c:\windows目录中还在进行创建档案的操作,一个名字为bb.bin的档被创建,但是由于操作突然中断,导致在windows目录属性中并未对档案和子目录的数量进行加1操作。Usually, the file system includes original data, directories, and file data. The original data refers to the data that describes the structure of the file system, such as the size of the partition, the number of sectors for each data block, etc.; in addition, the file system also includes directories and corresponding files. Archive data. Therefore, when backing up the file system, it is necessary to back up the original data, directories, and archive data. But the file system will cause logical errors due to sudden power failure of the computer system and other reasons: for example, a certain file c:\windows\aa.bin is suddenly interrupted during the writing operation, the actual file length is longer than that recorded in the file properties At the same time, the operation of creating a file in the c:\windows directory is still in progress, and a file named bb.bin is created, but due to the sudden interruption of the operation, the file and sub- The number of directories is incremented by 1.

下面将详细说明原数据检测模块211、原数据修复模块221、档案目录检测模块212、档案目录修复模块222及原数据备份模块231和档案目录备份模块232的相应功能。The corresponding functions of the original data detection module 211, the original data restoration module 221, the file directory detection module 212, the file directory restoration module 222, the original data backup module 231 and the file directory backup module 232 will be described in detail below.

由上文可知,备份模块23包含有原数据备份模块231和档案目录备份模块232。原数据备份模块231依照备份的档案系统得到指定分区的位置和大小,并根据分区指定位置的数据得到档案系统的类型,进而获得原数据的位置和大小。在读取原数据至计算机内存之后,原数据备份模块231首先调用原数据检测模块211对内存中的原数据进行检测,原数据检测模块211依照获得的实际原数据信息,例如分区大小和起始位置,位图的大小和起始位置,根节点起始位置以及其它属性信息等,与其中记录的相应属性信息进行比对,以检测原数据是否存在逻辑错误。如果不一致,则调用原数据修复模块221修正原数据中记录的属性信息,以保持和实际获得或计算的信息一致。最后,原数据备份模块231则可以将修正后的原数据备份至镜像档案30中。It can be seen from the above that the backup module 23 includes the original data backup module 231 and the file directory backup module 232 . The original data backup module 231 obtains the location and size of the specified partition according to the backup file system, and obtains the type of the file system according to the data in the specified location of the partition, and then obtains the location and size of the original data. After reading the original data to the computer memory, the original data backup module 231 first calls the original data detection module 211 to detect the original data in the memory, and the original data detection module 211 according to the obtained actual original data information, such as partition size and initial Position, the size and starting position of the bitmap, the starting position of the root node and other attribute information, etc., are compared with the corresponding attribute information recorded in it to detect whether there is a logic error in the original data. If not, call the original data repair module 221 to correct the attribute information recorded in the original data, so as to keep consistent with the actually obtained or calculated information. Finally, the original data backup module 231 can back up the corrected original data to the image file 30 .

档案目录备份模块232在备份过程中,则依照档案系统的超级区块信息,得到根目录的位置,并以此为起点搜寻整个档案系统,并在备份过程中备份搜寻到的每个档案和目录。在备份文件和目录时,档案目录备份模块232首先提取目录中的数据和目录档案至计算机内存中,随后调用档案目录检测模块212对其实际获得的档案或目录信息与记录在档案或目录属性中的相应信息进行比对,以检测其中是否存在不一致的问题。如果不一致,则档案目录修复模块222修正档案或目录的属性信息与实际信息一致,以消除其中存在的逻辑错误。此时,档案目录备份模块232用以将修正后的档案或目录信息备份至镜像档案30中。当然,备份模块23还可以将计算机硬盘中除档案系统之外的其它类型的数据或系统备份至镜像档案30中。During the backup process, the file directory backup module 232 obtains the location of the root directory according to the superblock information of the file system, and uses this as a starting point to search the entire file system, and backs up each file and directory found during the backup process. . When backing up files and directories, the file directory backup module 232 first extracts the data and directory files in the directory to the computer memory, and then calls the file directory detection module 212 to compare the actual obtained file or directory information and records in the file or directory attributes. The corresponding information is compared to detect whether there is any inconsistency. If not, then the archive directory repair module 222 corrects the attribute information of the archive or directory to be consistent with the actual information, so as to eliminate the logic error existing therein. At this time, the file directory backup module 232 is used for backing up the modified file or directory information to the image file 30 . Of course, the backup module 23 can also back up other types of data or systems in the computer hard disk except the file system to the image file 30 .

本发明的硬盘数据备份系统在备份过程中,会首先透过原数据检测模块211与档案目录检测模块212对计算机硬盘10上的档案系统进行检测。对于没有逻辑错误的目录和档案,会在检测后利用备份模块23将目录和档案的数据备份至镜像档案30中。对于上述计算机系统突然断电等原因造成的逻辑错误的实施例,在备份到windows目录时,例如实际的档案和子目录数是2649,而在windows的目录属性中记录的是2648(这是由于bb.bin档案被创建后,在记录到windows目录属性中之前突然断电造成的)。在对windows目录备份前,首先利用档案目录检测模块212对windwos目录进行整合性检测,进而发现上述的这种逻辑错误。因此,透过档案目录修复模块222对此逻辑错误进行修正,也就是将windows目录属性中的记录修改为2649后,再透过备份模块23备份windows目录的数据。During the backup process, the hard disk data backup system of the present invention will firstly detect the file system on the computer hard disk 10 through the original data detection module 211 and the file directory detection module 212 . For directories and files without logical errors, the backup module 23 will be used to back up the data of the directories and files to the mirror file 30 after detection. For the embodiments of logic errors caused by reasons such as the sudden power failure of the above-mentioned computer system, when backing up to the windows directory, for example, the actual file and subdirectory number are 2649, and what is recorded in the directory attribute of windows is 2648 (this is due to bb After the .bin file is created, it is caused by a sudden power failure before it is recorded in the windows directory properties). Before backing up the windows directory, first use the file directory detection module 212 to perform integrity detection on the windows directory, and then find the above logic error. Therefore, the logic error is corrected through the file directory repair module 222, that is, after the record in the windows directory attribute is modified to 2649, the data of the windows directory is backed up through the backup module 23.

下面请参考图2,此图为本发明的硬盘数据备份方法的步骤流程图。如图所示,本发明的硬盘数据备份方法包含以下步骤:Please refer to FIG. 2 below, which is a flow chart of the steps of the hard disk data backup method of the present invention. As shown in the figure, the hard disk data backup method of the present invention comprises the following steps:

步骤S201,首先读取硬盘数据的档案系统至计算机系统的内存中;Step S201, first read the file system of the hard disk data into the memory of the computer system;

步骤S202,然后在内存中检测档案系统中是否存在逻辑错误;Step S202, then detect whether there is a logical error in the file system in the memory;

步骤S203,如果存在逻辑错误,则对其进行修复;Step S203, if there is a logic error, it is repaired;

步骤S204,最后备份包含修复后的档案系统的硬盘数据至镜像档案中。Step S204, finally backing up the hard disk data containing the repaired file system to the image file.

现在将结合图3、图4、图5、图6与图7对档案系统的检测、修复及备份步骤进行详细描述。Now, the steps of detecting, repairing and backing up the file system will be described in detail with reference to FIG. 3 , FIG. 4 , FIG. 5 , FIG. 6 and FIG. 7 .

请参考图3与图4,为针对档案系统的原数据的检测、修复及备份步骤流程图。如图3所示,包括以下步骤:Please refer to FIG. 3 and FIG. 4 , which are flow charts of steps for detecting, restoring and backing up the original data of the file system. As shown in Figure 3, the following steps are included:

步骤S301,首先得到指定分区的位置与大小;Step S301, first obtain the location and size of the specified partition;

步骤S302,依照分区指定位置的数据得到档案系统的类型;Step S302, obtaining the type of the file system according to the data at the designated location of the partition;

步骤S303,接着针对档案系统的类型获得原数据的位置和大小;Step S303, then obtain the location and size of the original data according to the type of the file system;

步骤S304,将原数据读入计算机内存中;Step S304, read the original data into the computer memory;

步骤S305,从计算机内存中获得原数据信息;Step S305, obtaining original data information from computer memory;

步骤S306,从而可得到关于原数据的分区大小和起始位置的实际信息,与记录的对应原数据属性信息比对;Step S306, so that the actual information about the partition size and starting position of the original data can be obtained, and compared with the recorded corresponding original data attribute information;

步骤S207,进而判断两者是否一致;Step S207, further judging whether the two are consistent;

步骤S308,如果不一致,表示存在逻辑错误,则前进至步骤S308,修正原数据中的记录信息与获得的信息一致;Step S308, if inconsistent, it means that there is a logical error, then proceed to step S308, and correct the record information in the original data to be consistent with the obtained information;

步骤S309,否则,表示关于分区大小和起始位置正确,则计算原数据中位图大小和起始位置信息,并和原数据中对应记录的属性信息进行比对。这里符号A表示原数据的检测、修复及备份步骤的后续步骤。Step S309, otherwise, it means that the partition size and starting position are correct, then calculate the bitmap size and starting position information in the original data, and compare with the attribute information of the corresponding record in the original data. Here, the symbol A represents the subsequent steps of the detection, restoration and backup steps of the original data.

在图4中,接上述步骤,包括:In Figure 4, following the above steps, including:

步骤S310,判断位图的大小、起始位置是否与记录的信息一致;Step S310, judging whether the size and starting position of the bitmap are consistent with the recorded information;

步骤S311,如果不一致,则在内存中修正原数据中记录的对应信息与计算的信息一致;Step S311, if not consistent, correct the corresponding information recorded in the original data in the memory to be consistent with the calculated information;

步骤S312,否则,接着计算根节点起始位置,并和原数据的对应记录的信息进行比对;Step S312, otherwise, then calculate the starting position of the root node, and compare it with the information of the corresponding record of the original data;

步骤S313,接着判断两者是否一致;Step S313, then judge whether the two are consistent;

步骤S314,如果不一致,则在内存中修正原数据中记录的对应信息与计算的信息一致;Step S314, if not consistent, correct the corresponding information recorded in the original data in the memory to be consistent with the calculated information;

步骤S315,否则,计算原数据中的其它属性信息,并和其对应的记录信息进行比对;Step S315, otherwise, calculate other attribute information in the original data, and compare it with the corresponding record information;

步骤S316,以判断上述信息是否一致;Step S316, to determine whether the above information is consistent;

步骤S317,如果不一致,则前进至步骤S317于内存进行修正,以符合计算得到的实际信息;Step S317, if not consistent, proceed to step S317 for correction in the memory to conform to the calculated actual information;

步骤S318,否则,表示备份的原数据中无任何逻辑错误,则直接前进至步骤S318,将内存中的原数据备份至镜像档案中。对于存在逻辑错误的原数据,则在步骤S308、步骤S311、步骤S314及步骤S317相应修正之后,再备份至镜像档案中。Step S318, otherwise, it means that there is no logical error in the backed up original data, then directly proceed to step S318, and back up the original data in the internal memory to the image file. For the original data with logical errors, it is backed up to the mirror image file after corresponding corrections in steps S308, S311, S314 and S317.

图5为档案系统的档案/目录备份步骤流程图,在备份过程中,将以根目录为起点逐步读取整个档案系统,并进行相应的档案和目录的备份。如图所示,包括以下步骤:Figure 5 is a flow chart of the file/directory backup steps of the file system. During the backup process, the entire file system will be read gradually starting from the root directory, and the corresponding files and directories will be backed up. As shown in the figure, the following steps are included:

步骤S501,首先读取档案系统的超级区块,获得根目录的位置;Step S501, first read the super block of the file system to obtain the location of the root directory;

步骤S502,然后提取根目录中的数据和目录档案至计算机内存中;Step S502, then extract the data and directory files in the root directory to the computer memory;

步骤S503,并对内存中的档案和目录的逻辑错误进行检测及修复;Step S503, and detect and repair the logical errors of the files and directories in the internal memory;

步骤S504,接着,备份修复后的正确档案和目录至镜像档案中;Step S504, then, back up the repaired correct file and directory to the image file;

步骤S505,在对根目录执行上述操作之后,列举此目录下的每个子目录;Step S505, after performing the above operations on the root directory, enumerate each subdirectory under this directory;

步骤S506,并判断此目录下是否存在子目录,如果没有子目录,则结束;否则,转至步骤S502,对每个子目录执行步骤S502至步骤S505的操作,直至搜寻到所有的档案系统目录。Step S506, and judge whether there is a subdirectory under this directory, if there is no subdirectory, then end; otherwise, go to step S502, perform the operation from step S502 to step S505 for each subdirectory, until all file system directories are searched.

下面将结合图6至图7对档案系统的档案或目录的具体检测及修复步骤详细说明,图6与图7为档案系统的档案/目录的检测及修复步骤流程图。The specific detection and repair steps of files or directories in the file system will be described in detail below with reference to FIGS. 6 to 7 . FIG. 6 and FIG. 7 are flowcharts of the detection and repair steps of files/directories in the file system.

如图6所示,包括以下步骤:As shown in Figure 6, the following steps are included:

步骤S601,首先对档案类型进行判断,以区别普通档案和目录档案;Step S601, first judge the file type to distinguish between ordinary files and directory files;

步骤S602,对于目录档案,则检测它实际所包含的档案和子目录数;Step S602, for the directory file, then detect the number of files and subdirectories it actually contains;

步骤S603,并将上述实际数量与记录在目录属性中的数量相比较;Step S603, and compare the above-mentioned actual quantity with the quantity recorded in the directory attribute;

步骤S604,判断两者是否一致;Step S604, judging whether the two are consistent;

步骤S605,若不一致,则在内存中进行修正目录属性的数量,使其与实际数量一致;Step S605, if inconsistent, correct the number of directory attributes in the memory to make it consistent with the actual number;

否则,表示不存在逻辑错误,则结束。Otherwise, it means that there is no logic error, then end.

如果为普通档案,则转到步骤S606,这里符号B表示自步骤406的后续步骤,包括:If it is an ordinary file, then go to step S606, where symbol B represents subsequent steps from step 406, including:

步骤S606,对于普通档案,则得到档案的实际长度,并和档案属性长度进行比对;Step S606, for ordinary files, the actual length of the file is obtained, and compared with the file attribute length;

步骤S607,判断两者是否一致;Step S607, judging whether the two are consistent;

步骤S608,如果不一致,则在内存中修正档案属性中记录的档案长度与实际长度一致;Step S608, if inconsistent, correct the file length recorded in the file attribute in the memory to be consistent with the actual length;

否则结束。Otherwise end.

通过这种“检测→修复→备份”的方法,使备份到镜像档案中的系统不再包含任何逻辑错误,保证了镜像档案中数据的正确性和完整性,而且备份过程不会再因为档案系统的逻辑错误而意外退出。Through this "detection→repair→backup" method, the system backed up to the mirror file no longer contains any logic errors, ensuring the correctness and integrity of the data in the mirror file, and the backup process will no longer be caused by the file system. exited unexpectedly due to a logic error.

当然,本发明还可有其它多种实施例,在不背离本发明精神及其实质的情况下,熟悉本领域的普通技术人员当可根据本发明做出各种相应的改变和变形,但这些相应的改变和变形都应属于本发明所附的权利要求的保护范围。Certainly, the present invention also can have other various embodiments, without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and deformations according to the present invention, but these Corresponding changes and deformations should belong to the scope of protection of the appended claims of the present invention.

Claims (8)

1. hard disc data backup system in hard disc data backup to the mirror image archives with a computer system, is characterized in that this system includes:
One detection module, in order to the archives economy that before backup, reads this hard disc data to the internal memory of this computer system, with the logic error that exists in the archives economy of checking this hard disc data;
One repairs module, is used to repair in this internal memory the logic error of this archives economy, to obtain a correct archives economy; And
One backup module, in order to the hard disc data backup that will comprise this correct archives economy to these mirror image archives.
2. hard disc data backup system according to claim 1 is characterized in that, this detection module more includes:
Whether one former data detection module in order to the actual information of the former data of comparing this archives economy and the attribute information of this former data, exists logic error with these former data of detection; And
One archives catalog detection module, whether archives or the actual information of catalogue and the attribute information of this archives or catalogue in order to compare this archives economy exist logic error to detect these archives or catalogue.
3. hard disc data backup system according to claim 1 is characterized in that, this reparation module includes:
One former data repair module, in order to when the actual information of the former data of this archives economy is inconsistent with the attribute information of this former data, the attribute information of these former data of correction in this internal memory; And
One archives catalog is repaired module, in order to when the actual information of the archives of this archives economy or catalogue is inconsistent with the attribute information of this archives or catalogue, and the attribute information of these archives of correction or catalogue in this internal memory.
4. hard disk data backup method, in hard disc data backup to the mirror image archives with a computer system, this method includes the following step:
Step 41, the archives economy that reads this hard disc data is to the internal memory of this computer system;
Step 42 detects the logic error that exists in this archives economy in this internal memory;
Step 43, the logic error of in this internal memory, repairing this archives economy; And
Step 44, backup comprise the hard disc data of this archives economy after the reparation to these mirror image archives.
5. hard disk data backup method according to claim 4 is characterized in that, step 42 more includes the following step with step 43:
Step 51 is compared actual information and its attribute information of the former data of this archives economy;
Step 52 judges whether the actual information of these former data is consistent with its attribute information; And
Step 53 as if inconsistent, is then revised the attribute data data consistent actual with it of these former data.
6. hard disk data backup method according to claim 4 is characterized in that, step 42 more includes the following step with step 43:
Step 61 is compared the archives of this archives economy or actual information and its attribute information of catalogue;
Step 62 judges whether the actual information of these archives or catalogue is consistent with its attribute information; And
Step 63 as if inconsistent, is then revised the attribute data data consistent actual with it of these archives or catalogue.
7. whether consistent hard disk data backup method according to claim 5 is characterized in that, in this actual information of judging these former data and its attribute information step, if when consistent, more include the following step:
Step 71 is obtained the partition size and the reference position of these former data, and with these former data in corresponding recorded information comparison;
Step 72 is calculated the bitmap size and the reference position of these former data, and with these former data in corresponding recorded information comparison;
Step 73 is calculated the reference position of the root node of these former data, and with these former data in corresponding recorded information comparison; And
Step 74 is calculated other attribute informations of this former data, and with these former data in corresponding recorded information comparison.
8. hard disk data backup method according to claim 6 is characterized in that, this is compared the archives of this archives economy or the actual information of catalogue and the step of its attribute information and more includes the following step:
Step 81 is judged the file type of this archives economy;
Step 82 if this file type is common archives, is then compared physical length and its attribute length of these common archives; And
Step 83 if this file type is a directory file, is then compared actual information and its directory attribute information of the archives and the sub-directory number of this directory file.
CNB2006100731394A 2006-04-06 2006-04-06 Hard disk data backup system and method Active CN100437504C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100731394A CN100437504C (en) 2006-04-06 2006-04-06 Hard disk data backup system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100731394A CN100437504C (en) 2006-04-06 2006-04-06 Hard disk data backup system and method

Publications (2)

Publication Number Publication Date
CN101051283A CN101051283A (en) 2007-10-10
CN100437504C true CN100437504C (en) 2008-11-26

Family

ID=38782705

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100731394A Active CN100437504C (en) 2006-04-06 2006-04-06 Hard disk data backup system and method

Country Status (1)

Country Link
CN (1) CN100437504C (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8201019B2 (en) 2009-04-28 2012-06-12 International Business Machines Corporation Data storage device in-situ self test, repair, and recovery
JP5409159B2 (en) * 2009-07-23 2014-02-05 キヤノン株式会社 Information processing apparatus, information processing apparatus control method, and program
CN101833489B (en) * 2010-05-06 2013-04-10 北京邮电大学 Method for file real-time monitoring and intelligent backup
CN102880522B (en) * 2012-09-21 2014-12-31 中国人民解放军国防科学技术大学 Hardware fault-oriented method and device for correcting faults in key files of system
CN103064759B (en) * 2012-12-18 2016-02-03 华为技术有限公司 The method of data restore and device
CN103678517B (en) * 2013-11-27 2017-01-18 华为技术有限公司 Method for fixing logical errors of hard disk and controller
CN105893879A (en) * 2016-03-30 2016-08-24 苏州美天网络科技有限公司 Encryption backup method for hard disk data
CN108762992B (en) * 2018-04-20 2021-10-08 平安科技(深圳)有限公司 Main/standby switching method and device, computer equipment and storage medium
CN115983306B (en) * 2022-12-09 2023-09-15 江苏稻源科技集团有限公司 RFID card writing method with error correction capability

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469573A (en) * 1993-02-26 1995-11-21 Sytron Corporation Disk operating system backup and recovery system
WO1998020419A1 (en) * 1996-11-08 1998-05-14 Vinca Corporation System and method for maintaining a logically consistent backup using minimal data transfer
CN1408084A (en) * 2000-03-01 2003-04-02 电脑联合想象公司 Method and system for updating an archive of a computer file
CN1501252A (en) * 2002-11-19 2004-06-02 英业达股份有限公司 Automatic repair method and system for basic input and output system
CN1567262A (en) * 2003-06-10 2005-01-19 联想(北京)有限公司 On-line data backup method based on data volume snapshot

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469573A (en) * 1993-02-26 1995-11-21 Sytron Corporation Disk operating system backup and recovery system
WO1998020419A1 (en) * 1996-11-08 1998-05-14 Vinca Corporation System and method for maintaining a logically consistent backup using minimal data transfer
CN1408084A (en) * 2000-03-01 2003-04-02 电脑联合想象公司 Method and system for updating an archive of a computer file
CN1501252A (en) * 2002-11-19 2004-06-02 英业达股份有限公司 Automatic repair method and system for basic input and output system
CN1567262A (en) * 2003-06-10 2005-01-19 联想(北京)有限公司 On-line data backup method based on data volume snapshot

Also Published As

Publication number Publication date
CN101051283A (en) 2007-10-10

Similar Documents

Publication Publication Date Title
CN100437504C (en) Hard disk data backup system and method
US7640412B2 (en) Techniques for improving the reliability of file systems
US7310654B2 (en) Method and system for providing image incremental and disaster recovery
US7793166B2 (en) Methods and systems for recovering meta-data in a cache memory after a corruption event
US7509544B2 (en) Data repair and synchronization method of dual flash read only memory
CN110399247B (en) A data recovery method, apparatus, device and computer-readable storage medium
JP5244124B2 (en) Recovering from file transfer failure between host and data storage device
US20090172478A1 (en) Information Processing Apparatus, Backup Device and Information Processing Method
JP5386111B2 (en) File system recording method
CN106227625B (en) A kind of restoration methods and system of the flash data damaged by power down
US7487385B2 (en) Apparatus and method for recovering destroyed data volumes
US20150186211A1 (en) Method, device and operating system for processing and using burn data of nand flash
CN105045685A (en) Backup method and apparatus for cached data and recovery method and apparatus for cached data
CN1277209C (en) Hard disk data control method
CN103339615B (en) storage system and information processing method
CN101196839A (en) Data repair and synchronization method for dual flash read-only memory
CN106528349B (en) A kind of date storage method and device
CN104598328A (en) File system repair method, device and system
US20080155319A1 (en) Methods and systems for managing removable media
US20030037279A1 (en) HDD data backup and recovery method
CN103902227A (en) Appending write and sharing read supporting file storage method
WO2010011217A1 (en) Data storage method, apparatus and system for interrupted write recovery
CN101201766A (en) Equipment information repair system and method
CN101118506A (en) Backup and recovery method for file system
CN111601062B (en) Storage security fault-tolerant method and system for vehicle-mounted monitoring video

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: I VALLEY HOLDINGS CO., LTD.

Free format text: FORMER OWNER: YINGYEDA CO., LTD., TAIWAN

Effective date: 20150730

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20150730

Address after: Cayman Islands, George Town

Patentee after: IValley Holding Co., Ltd.

Address before: Taipei City, Taiwan, China

Patentee before: Inventec Corporation