CN100428196C - A method for fast recovery of computer system - Google Patents
A method for fast recovery of computer system Download PDFInfo
- Publication number
- CN100428196C CN100428196C CNB2006101655877A CN200610165587A CN100428196C CN 100428196 C CN100428196 C CN 100428196C CN B2006101655877 A CNB2006101655877 A CN B2006101655877A CN 200610165587 A CN200610165587 A CN 200610165587A CN 100428196 C CN100428196 C CN 100428196C
- Authority
- CN
- China
- Prior art keywords
- virtual
- block
- mapping
- sector
- algorithm
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明属于计算机存储系统结构技术领域,其特征在于:它将存储设备虚拟化,利用映射技术为系统提供一种虚拟的存储视图,系统对存储设备的所有操作均在该虚拟视图上进行,在去掉虚拟视图后,系统还原为真实视图,从而实现系统的快速还原。它含有:虚拟设备控制程序⑦:该模块是用户和存储设备虚拟层⑥的接口,用户可通过该模块控制和设置系统还原的其它功能模块。存储设备虚拟层⑥:该模块由物理存储设备的虚拟驱动程序②、虚拟映射算法③和虚拟存储设备抽象层④三个子模块组成,该模块通过子模块物理存储设备的虚拟驱动程序②访问物理设备,通过子模块虚拟存储设备抽象层④向文件系统提供“合成”的虚拟存储视图。它在保护和还原系统时,不涉及数据的备份和恢复操作。
The invention belongs to the technical field of computer storage system structure, and is characterized in that it virtualizes storage devices and provides a virtual storage view for the system by using mapping technology. All operations of the system on storage devices are carried out on the virtual view. After the virtual view is removed, the system restores to the real view, thereby realizing the rapid restoration of the system. It contains: Virtual device control program ⑦: This module is the interface between the user and the storage device virtual layer ⑥, through which the user can control and set other functional modules of the system restoration. Storage device virtualization layer ⑥: This module is composed of three sub-modules: virtual driver ② of physical storage device, virtual mapping algorithm ③ and abstraction layer ④ of virtual storage device. This module accesses physical device through the virtual driver ② of sub-module physical storage device , provides a "synthetic" virtual storage view to the file system through the sub-module virtual storage device abstraction layer ④. When it protects and restores the system, it does not involve data backup and recovery operations.
Description
技术领域 technical field
计算机系统快速还原的方法属于计算机存储系统结构技术领域。A method for quickly restoring a computer system belongs to the technical field of computer storage system structures.
背景技术 Background technique
随着计算机硬件稳定性的逐渐提高,计算机故障越来越多地表现为软故障,即由软件引起的各种故障。这些软故障一般是由有害代码攻击、误操作或软件不兼容等引起的。随着网络应用的普及,有害代码攻击已经成为引起软故障的主要来源,严重影响计算机的使用。尽管人们在计算机安全方面投入了大量的研发工作,但任何一个计算机系统都存在漏洞及崩溃的可能,人们不可能堵住所有的计算机漏洞或完全避免错误操作。事实上,由于人为错误等各种不可避免的因素,绝对安全的系统在现实中是不存在的,因此,在计算机系统崩溃的情况下,如何快速恢复系统到可工作状态是一个非常有用的方法。With the gradual improvement of the stability of computer hardware, computer failures are increasingly manifested as soft failures, that is, various failures caused by software. These soft failures are generally caused by harmful code attacks, misoperation or software incompatibility. With the popularity of network applications, harmful code attacks have become the main source of soft faults, seriously affecting the use of computers. Although people have invested a lot of research and development work in computer security, any computer system has loopholes and the possibility of collapse, and it is impossible for people to block all computer loopholes or completely avoid wrong operations. In fact, due to various unavoidable factors such as human error, an absolutely safe system does not exist in reality. Therefore, in the case of a computer system crash, how to quickly restore the system to a working state is a very useful method .
在许多应用软件中,撤销操作已经成为必不可少的功能,如排版软件、数据库软件等,均具有撤销操作,该功能为用户恢复错误操作提供了极大的方便。如同应用软件中的撤销操作一样,系统还原是一种作用于整个计算机系统的撤销操作,它不仅能够恢复应用软件对系统引起的各种变化,同时能够恢复操作系统对系统引起的变化,它是一种能够恢复计算机系统到以前特定状态的方法。In many application software, undo operation has become an indispensable function, such as typesetting software, database software, etc., all have undo operation, which provides great convenience for users to restore wrong operations. Like the undo operation in application software, system restore is an undo operation that acts on the entire computer system. It can not only restore various changes caused by application software to the system, but also restore the changes caused by the operating system to the system. It is A method capable of restoring a computer system to a previous specified state.
在系统还原中,一般涉及数据的备份和恢复操作,这些备份数据不仅要占用大量的磁盘空间,而且无论是备份操作还是恢复操作,均需要较长的时间,在数据量越来越大的情况下,这种方式越来越不适应快速恢复系统的要求。In system restoration, it generally involves data backup and recovery operations. These backup data not only occupy a large amount of disk space, but also take a long time for both backup and recovery operations. When the amount of data is increasing Under the circumstances, this method is more and more unsuitable for the requirements of the fast recovery system.
本项发明是一种快速恢复计算机系统到特定状态的系统还原方法,该方法利用数据映射技术来实现系统的保护和快速还原,由于该方法不涉及数据的备份和恢复操作,因而不仅占用的系统资源小,而且恢复系统的速度非常快。The present invention is a system restoration method for quickly restoring a computer system to a specific state. The method utilizes data mapping technology to realize system protection and fast restoration. Since the method does not involve data backup and restoration operations, it not only occupies the system The resources are small, and the speed of restoring the system is very fast.
发明内容 Contents of the invention
本发明的目的在于提供一种在系统遭到破坏或用户需要的情况下快速把计算机系统恢复到特定状态的还原方法。The purpose of the present invention is to provide a restoration method for quickly restoring the computer system to a specific state when the system is damaged or the user needs it.
本发明的特征在于该方法是在计算机系统中依次按以下步骤实现的:The present invention is characterized in that the method is implemented in the computer system according to the following steps:
步骤(1)按以下步骤把计算机系统拥有的存储空间动态地分成两个区域,所有已分配的空间组成系统存储区域,所有未分配的空间组成临时存储区域,所述系统存储区域含有禁止外部操作对其进行直接修改而被保护起来的待还原的目标数据,在临时存储区域存储的是对该目标数据进行过包括增加、删除、修改在内的修改操作的目标数据的映射数据,同时把所述系统存储区域内的和临时存储区域内的数据通过包括虚拟读算法、虚拟写算法在内的映射算法进行合成处理;Step (1) Dynamically divide the storage space owned by the computer system into two areas according to the following steps, all allocated space forms a system storage area, and all unallocated space forms a temporary storage area, and the system storage area contains prohibited external operations. For the target data to be restored that is protected by direct modification, the mapping data of the target data that has undergone modification operations including adding, deleting, and modifying the target data is stored in the temporary storage area. The data in the system storage area and the temporary storage area are synthesized and processed through the mapping algorithm including the virtual read algorithm and the virtual write algorithm;
步骤(1.1)把硬盘以其基本存储单位扇区为单位,照逻辑块块地址LBA进行线性编址后的硬盘扇区地址表示为:0,1,2,...,MaxLBA,其中的MaxLBA表示硬盘的总扇区数减1;In step (1.1), take the hard disk as its basic storage unit sector and perform linear addressing according to the logical block address LBA to represent the hard disk sector address as: 0, 1, 2, ..., MaxLBA, where MaxLBA Indicates the total number of sectors of the
步骤(1.2)以2的N(N=1,2,3…)次方个扇区作为一个基本单位,称为BLOCK块,把整个硬盘分成[MaxLBA/2N]+1个BLOCK;Step (1.2) uses 2 to the N (N=1, 2, 3...) sectors as a basic unit, which is called a BLOCK block, and divides the entire hard disk into [MaxLBA/2 N ]+1 BLOCK;
步骤(1.3)每个BLOCK用两个数DAT和MAP表示:DAT由2位组成,表示BLOCK所处的四种状态是:空闲、修改、受保护和映射状态,其中00表示此BLOCK块空闲,属于临时存储区域;01表示此BLOCK块原为空闲块,现已作过修改,属于临时存储区域;10表示此BLOCK块是受保护块,属于系统存储区域;11表示此BLOCK块已被映射,说明该块原为受保护块并且被“修改”,对该块的读写操作均需根据MAP中的地址指针来重定位;当N=5时,MAP由64位组成,其中32位表示BLOCK块中每个扇区的映射状态,其值为1表示该扇区已映射,否则为未映射,MAP中的其它位表示该映射对应的映射地址,若该块未映射,则为0,映射地址用pMAP表示,所述映射是指把系统存储区中受保护以便在系统还原时需要还原的数据映射到临时存储区域经过修改操作后保存在该临时区域中,这些经过映射保存在临时区域中的数据称为映射数据,映射地址pMAP表示每个BLOCK块在临时存储区域中对应的映射地址,而pBLOCK表示所述每个BLOCK在系统存储区域中的实际块地址;Step (1.3) Each BLOCK is represented by two numbers DAT and MAP: DAT is composed of 2 bits, indicating that the four states of the BLOCK are: idle, modified, protected and mapped, wherein 00 indicates that the BLOCK block is idle, Belongs to the temporary storage area; 01 indicates that the BLOCK block was originally a free block, which has been modified and belongs to the temporary storage area; 10 indicates that the BLOCK block is a protected block and belongs to the system storage area; 11 indicates that the BLOCK block has been mapped. Indicates that the block was originally a protected block and was "modified". The read and write operations on this block need to be relocated according to the address pointer in the MAP; when N=5, the MAP consists of 64 bits, of which 32 bits represent BLOCK Mapping status of each sector in the block, its value is 1, indicating that the sector has been mapped, otherwise it is unmapped, other bits in MAP indicate the mapping address corresponding to the mapping, if the block is not mapped, it is 0, mapping The address is represented by pMAP. The mapping refers to mapping the data that is protected in the system storage area so that it needs to be restored when the system is restored to the temporary storage area and saved in the temporary area after the modification operation. These are stored in the temporary area after mapping The data is called mapping data, the mapping address pMAP represents the corresponding mapping address of each BLOCK block in the temporary storage area, and pBLOCK represents the actual block address of each BLOCK in the system storage area;
步骤(1.4)构造块分配表BAT和映射索引表MIT:Step (1.4) Construct block allocation table BAT and mapping index table MIT:
BAT表由表示所有各个BLOCK状态的DAT组成的数据构成,表示每个BLOCK块所处的状态;The BAT table is composed of data composed of DAT representing the state of each BLOCK, indicating the state of each BLOCK block;
MIT表由所有表示各个BLOCK映射地址和映射状态的MAP组成的数据构成,表示每个BLOCK块及其内每个扇区的映射状态;The MIT table is composed of data composed of all MAPs representing the mapping address and mapping status of each BLOCK, indicating the mapping status of each BLOCK block and each sector within it;
步骤(2)在所述计算机系统中设置以下模块:设在用户界面的虚拟设备控制程序模块,是用户和存储设备虚拟层模块的接口,用户通过该模块控制和设置系统还原用的其它模块;Step (2) the following modules are set in the computer system: the virtual device control program module located on the user interface is the interface between the user and the storage device virtual layer module, and the user controls and sets other modules for system restoration through this module;
存储设备虚拟层模块,与文件系统系统互连,而该文件系统又与所述虚拟设备控制程序模块互连,所述存储设备虚拟层模块设在存储设备虚拟层,包括:三个依次互连的虚拟存储设备抽象层、虚拟映射算法以及物理存储设备的虚拟驱动程序共三个子模块,其中:虚拟驱动程序子模块访问物理存储设备,虚拟映射算法子模块设有:虚拟写操作算法、虚拟读操作算法、映射数据提交算法以及系统还原算法,该虚拟映射算法子模块通过虚拟驱动程序对物理存储设备进行读写操作,把系统存储区域中受保护待还原的原数据和临时存储区域的映射数据合成虚拟存储视图,再通过虚拟存储设备抽象层子模块向文件系统提供该虚拟存储视图;The storage device virtual layer module is interconnected with the file system system, and the file system is interconnected with the virtual device control program module, and the storage device virtual layer module is set in the storage device virtual layer, including: three sequentially interconnected The virtual storage device abstraction layer, the virtual mapping algorithm and the virtual driver of the physical storage device have three sub-modules, among which: the virtual driver sub-module accesses the physical storage device, and the virtual mapping algorithm sub-module is equipped with: virtual write operation algorithm, virtual read Operation algorithm, mapping data submission algorithm and system restoration algorithm, the virtual mapping algorithm sub-module reads and writes the physical storage device through the virtual driver, and converts the original data to be restored in the system storage area and the mapping data in the temporary storage area Synthesize the virtual storage view, and then provide the virtual storage view to the file system through the virtual storage device abstraction layer sub-module;
步骤(3)建立BAT和MIT表的初始状态:Step (3) establishes the initial state of BAT and MIT tables:
BAT表的初始状态由保护程序在安装时通过扫描文件系统的文件分配表建立该BAT表中每一项的初始状态,BAT表中每一项的初始状态只有空闲和保护两种状态,MIT表的初值均为0;The initial state of the BAT table is established by the protection program during installation by scanning the file allocation table of the file system to establish the initial state of each item in the BAT table. The initial state of each item in the BAT table is only idle and protected. The MIT table The initial value is 0;
步骤(4)按以下步骤用虚拟写操作算法拦截系统对硬盘的所有写操作,再作相应的映射变换,实现对系统的动态保护:Step (4) Use the virtual write operation algorithm to intercept all write operations of the system to the hard disk according to the following steps, and then perform corresponding mapping transformations to realize dynamic protection of the system:
步骤(4.1)存储设备虚拟层中的虚拟映射算法子模块得到硬盘上要写扇区的逻辑块地址LBA;Step (4.1) the virtual mapping algorithm submodule in the virtual layer of the storage device obtains the logical block address LBA of the sector to be written on the hard disk;
步骤(4.2)虚拟映射算法子模块按下式计算要写扇区所在的BLOCK块的实际块地址pBLOCK和该扇区在BLOCK块中的偏移量Offset,其中Offset表示该扇区是BLOCK块中的第几个扇区,公式中“/”表示整除运算,“MOD”表示模运算:Step (4.2) The virtual mapping algorithm sub-module calculates the actual block address pBLOCK of the BLOCK block where the sector to be written is located and the offset offset of the sector in the BLOCK block according to the following formula, wherein Offset indicates that the sector is in the BLOCK block In the formula, "/" means integer division operation, and "MOD" means modulo operation:
在BLOCK块的扇区为32的条件下,LBA表示逻辑块地址,Under the condition that the sector of the BLOCK block is 32, LBA represents the logical block address,
pBLOCK=LBA/32,pBLOCK=LBA/32,
Offset=LBA MOD 32,Offset = LBA MOD 32,
步骤(4.3)根据pBLOCK和Offset在BAT表中查得该扇区所在的BLOCK块的状态;Step (4.3) finds the state of the BLOCK block where this sector is located in the BAT table according to pBLOCK and Offset;
步骤(4.4)判断该块是否为保护状态:Step (4.4) judges whether this block is protected state:
若为保护状态,在临时存储区域查找空闲的BLOCK块,If it is in the protected state, search for free BLOCK blocks in the temporary storage area,
A.若找到,便依次执行以下步骤:A. If found, perform the following steps in sequence:
步骤(4.4.1)步骤(4.3)所述的原BLOCK块的状态改为映射状态;The state of the original BLOCK block described in the step (4.4.1) step (4.3) is changed into a mapping state;
步骤(4.4.2)找到的空闲BLOCK块的状态改为保护状态;The state of the free BLOCK block that step (4.4.2) finds is changed into protected state;
步骤(4.4.3)把找到的空闲BLOCK块的地址pFREE值放入原BLOCK块在MIT表中对应的映射地址pMAP中,并把该扇区在MIT表中的对应位置1;Step (4.4.3) put the address pFREE value of the found free BLOCK block into the corresponding mapping address pMAP of the original BLOCK block in the MIT table, and set the corresponding position of the sector in the MIT table to 1;
步骤(4.4.4)计算该扇区在MIT表中的具体映射地址MapLBA=pFREE*32+Offset,转入步骤(4.6);Step (4.4.4) calculates the concrete mapping address MapLBA=pFREE*32+Offset of this sector in the MIT table, changes over to step (4.6);
B.若未找到空闲的BLOCK块,便把返回状态设置为磁盘满,转入步骤(4.7)B. If no free BLOCK block is found, the return status is set to disk full, and then go to step (4.7)
步骤(4.5)若为非保护状态,则判断步骤(4.3)所述的BLOCK块是否为空闲状态:If step (4.5) is non-protected state, then judge whether the BLOCK block described in step (4.3) is idle state:
若为空闲状态,则把BAT表中该BLOCK块的状态改为修改状态,令MapLBA=LBA,再转入步骤(4.6);If it is idle state, then change the state of this BLOCK block in the BAT table into the modified state, make MapLBA=LBA, then change to step (4.6);
若为非空闲状态,则判断是否为修改状态;If it is not in the idle state, it is judged whether it is in the modified state;
若为修改状态,令MapLBA=LBA,再转入步骤(4.6);If it is the modified state, make MapLBA=LBA, then turn to step (4.6);
若为映射状态,则在MIT表中得到该BLOCK块的映射地址pMAP,且把该扇区在MIT表中的对应位置1,接着计算该扇区的映射地址MapLBA=pMAP*32+Offset,并转入步骤(4.6);If it is a mapping state, then the mapping address pMAP of the BLOCK block is obtained in the MIT table, and the corresponding position of the sector in the MIT table is 1, then the mapping address MapLBA=pMAP*32+Offset of the sector is calculated, and Go to step (4.6);
步骤(4.6)把所得到的MapLBA作为物理地址传递到物理存储设备的虚拟驱动程序,再通过硬盘驱动程序写入相应的扇区;Step (4.6) transfers the obtained MapLBA to the virtual driver of the physical storage device as a physical address, and then writes the corresponding sector by the hard disk driver;
步骤(4.7)返回写操作状态;Step (4.7) returns the write operation state;
步骤(5)按以下步骤用虚拟读操作算法拦截系统对硬盘的所有读操作,并读出数据:Step (5) Use the virtual read operation algorithm to intercept all read operations of the system to the hard disk according to the following steps, and read out the data:
步骤(5.1)存储设备虚拟层得到要读扇区所在的BLOCK块的地址pBLOCK和偏移量Offset,其中pBLOCK和Offset的计算方法同步骤(4.2);Step (5.1) the virtual layer of the storage device obtains the address pBLOCK and offset Offset of the BLOCK block where the sector to be read is located, wherein the calculation method of pBLOCK and Offset is the same as step (4.2);
步骤(5.2)根据pBLOCK和Offset在BAT表中查该扇区所在BLOCK块的状态是否处于映射状态;Step (5.2) check whether the state of the BLOCK block where the sector is located is in the mapping state according to pBLOCK and Offset in the BAT table;
步骤(5.3)若该BLOCK块处于映射状态,按以下步骤依次执行:Step (5.3) If the BLOCK block is in the mapping state, perform the following steps in sequence:
步骤(5.3.1)根据pBLOCK在MIT表中的对应项查该扇区的状态位;Step (5.3.1) checks the state position of this sector according to the corresponding item of pBLOCK in the MIT table;
步骤(5.3.2)若该扇区已映射,则:Step (5.3.2) If the sector has been mapped, then:
在MIT表中的对应项得到该块的映射地址pMAP,并计算该扇区的映射地址MapLBA=pMAP*32+Offset,接着执行步骤(5.5);The corresponding entry in the MIT table obtains the mapping address pMAP of this block, and calculates the mapping address MapLBA=pMAP*32+Offset of this sector, then executes step (5.5);
步骤(5.3.3)若该扇区未映射,令MapLBA=LBA,直接转步骤(5.5);Step (5.3.3) if this sector is not mapped, make MapLBA=LBA, directly go to step (5.5);
步骤(5.4)若该BLOCK块处于未映射状态,则MapLBA=LBA,接着执行步骤(5.5);Step (5.4) If the BLOCK block is in an unmapped state, then MapLBA=LBA, then perform step (5.5);
步骤(5.5)把MapLBA作为物理地址传递到物理存储设备的虚拟驱动程序,再通过硬盘驱动程序读取相应扇区,再返回读操作状态;Step (5.5) transfers MapLBA to the virtual driver program of physical storage device as physical address, then reads corresponding sector by hard disk driver program, returns read operation state again;
步骤(6).按以下步骤用映射数据提交算法,把临时存储区域中的数据合并到系统存储区域:Step (6). Use the mapping data submission algorithm according to the following steps to merge the data in the temporary storage area into the system storage area:
步骤(6.1)扫描硬盘的第一个BLOCK块;Step (6.1) scans the first BLOCK block of the hard disk;
步骤(6.2)在BAT表中查该BLOCK块的状态;Step (6.2) checks the state of this BLOCK block in BAT table;
步骤(6.3)若为映射状态,按以下步骤执行:Step (6.3) If it is in the mapping state, follow the steps below:
步骤(6.3.1)在MIT表的对应项查该BLOCK块的每个扇区的状态位,判断该扇区是否已映射;Step (6.3.1) checks the status bit of each sector of the BLOCK block in the corresponding item of the MIT table, and judges whether the sector has been mapped;
步骤(6.3.2)若已映射,根据该扇区的映射地址把临时存储区域中相对应映射块内对应扇区的数据拷贝到步骤(6.3.1)中所选的扇区内;若未映射,则执行步骤(6.3.3);If step (6.3.2) is mapped, copy the data of the corresponding sector in the corresponding mapping block in the temporary storage area to the sector selected in the step (6.3.1) according to the mapping address of the sector; if not mapping, then perform step (6.3.3);
步骤(6.3.3)判断步骤(6.2)中所选BLOCK中的所有扇区是否都已检查完毕,若未检查完毕,继续执行步骤(6.3.1),否则,执行步骤(6.4);Step (6.3.3) judges whether all sectors in the selected BLOCK in step (6.2) have been checked, if not checked, continue to perform step (6.3.1), otherwise, perform step (6.4);
步骤(6.4)判断硬盘中所有的BLOCK块是否已扫描完毕,若未扫描完毕,则扫描硬盘中下一个BLOCK块,然后转步骤(6.2),否则转步骤(7)Step (6.4) judges whether all BLOCK blocks in the hard disk have been scanned, if not, scan the next BLOCK block in the hard disk, and then go to step (6.2), otherwise go to step (7)
步骤(7)按以下步骤用数据还原算法,把临时存储区域中的数据丢弃:Step (7) discards the data in the temporary storage area with the data restoration algorithm according to the following steps:
步骤(7.1)把BAT表和MIT表清为0;Step (7.1) clears BAT table and MIT table to 0;
步骤(7.2)重新扫描磁盘,构造新的BAT表,数据提交或还原完毕。Step (7.2) rescans the disk, constructs a new BAT table, and completes data submission or restoration.
本发明是一种系统还原方法,用于在系统遭到破坏或用户需要等情况下快速恢复系统到特定状态。该方法利用映射技术为计算机系统提供一种虚拟的存储视图,系统对存储设备的所有操作均在该虚拟视图上进行,在去掉虚拟视图后,系统还原为真实视图,从而实现系统的快速还原。本发明的主要特点如下:The invention is a method for restoring the system, which is used for quickly recovering the system to a specific state when the system is damaged or required by users. The method uses mapping technology to provide a virtual storage view for the computer system. All the operations of the system on the storage device are carried out on the virtual view. Main features of the present invention are as follows:
1.保护能力强1. Strong protection ability
本发明是一种基于存储设备的系统保护,它位于文件系统之下,不仅能对透过文件系统的破坏操作提供保护,而且能在系统无法启动的情况下恢复系统。The invention is a kind of system protection based on the storage device, which is located under the file system, not only can protect the damage operation through the file system, but also can restore the system when the system cannot be started.
2.应用范围广2. Wide range of applications
该方法可以应用于各种存储设备和操作系统,它不仅可用于各种PC机和服务器,而且还可广泛应用于各种终端设备,如手机、ATM机等具有存储设备的各种系统。该方法不仅能够以纯硬件方式实现,而且还能够以纯软件或软硬件联合方式进行实现。The method can be applied to various storage devices and operating systems, not only to various PCs and servers, but also to various terminal devices, such as mobile phones, ATMs and other systems with storage devices. The method can be implemented not only in pure hardware, but also in pure software or a combination of software and hardware.
3.还原速度快3. Fast restoration speed
和现有的还原方法不同,该方法对系统的保护是通过映射方式实现的,在保护和还原系统时,不涉及数据的备份和恢复操作,因此还原速度快。例如,恢复一块容量为60G的硬盘数据,所需时间仅为十几秒。Different from the existing restore method, the method protects the system through mapping. When protecting and restoring the system, it does not involve data backup and restore operations, so the restore speed is fast. For example, the time required to restore data on a hard disk with a capacity of 60G is only ten seconds.
4.额外占用空间小4. Small additional space
本方法不备份原始数据,其额外占用的储存空间主要是控制表所占的存储空间,本方法额外占用的磁盘空间约占整个磁盘空间的比例约是0.05%。This method does not back up the original data, and the additional storage space it occupies is mainly the storage space occupied by the control table. The additional disk space occupied by this method accounts for about 0.05% of the entire disk space.
5.对系统性能影响小5. Little impact on system performance
和现有的系统还原方法相比,由于本方法不涉及数据备份操作,其主要操作是查表操作,由理论分析和实验结果可知,它对系统性能的影响比较小。Compared with the existing system restoration method, since this method does not involve data backup operation, its main operation is table look-up operation. It can be seen from theoretical analysis and experimental results that it has relatively little impact on system performance.
附图说明 Description of drawings
图1.本发明方法的实现本原理图,在该图中,“系统存储”中的数据表示受保护的数据,也就是在还原时需要恢复的数据;“临时存储”中的数据是存放映射数据的区域,本发明对系统存储数据的增加、删除、修改等修改操作均映射在临时存储区中;“合成视图”表示经过本发明给出的算法处理后,系统“看到”的虚拟视图;“文件视图”表示文件系统将“合成视图”以文件的方式表达后所呈现出的视图。Fig. 1. The principle diagram of the realization of the method of the present invention, in this figure, the data in the "system storage" represents protected data, that is, the data that needs to be restored when restoring; the data in the "temporary storage" is to store the mapping In the area of data, the modification operations such as addition, deletion, and modification of system storage data in the present invention are all mapped in the temporary storage area; "synthetic view" means the virtual view that the system "sees" after being processed by the algorithm provided by the present invention ; "file view" means the view presented by the file system after expressing the "synthetic view" in the form of a file.
图2.对应于一个BLOCK的DAT和MAP的状态转换,图中的“直接写入”指系统要写入的扇区位于本DAT和MAP所表示的BLOCK块中。“映射写入”指系统要写入的扇区所位于的BLOCK块受保护,也即该BLOCK块对应的DAT的状态为保护状态。Figure 2. The state transition of DAT and MAP corresponding to a BLOCK. The "direct write" in the figure means that the sector to be written by the system is located in the BLOCK block represented by this DAT and MAP. "Mapping write" means that the BLOCK block where the sector to be written by the system is located is protected, that is, the state of the DAT corresponding to the BLOCK block is protected.
图3.虚拟写操作算法,该图给出了虚拟写操作的详细算法。Figure 3. Virtual write operation algorithm, which shows the detailed algorithm of virtual write operation.
图4.虚拟读操作算法,该图给出了虚拟读操作的详细算法。Figure 4. Virtual read operation algorithm, which shows the detailed algorithm of virtual read operation.
图5.映射数据提交算法,该图给出了数据提交算法。Figure 5. Mapping the data submission algorithm, which shows the data submission algorithm.
图6.还原算法,该图给出了系统还原的算法。Figure 6. Restore algorithm, which shows the algorithm of system restore.
图7.系统还原方法的纯软件实现架构,该图中黑体部分是本发明方法的相关模块。其它部分是系统模块。存储设备虚拟层⑥由物理存储设备的虚拟驱动程序②、虚拟映射算法③和虚拟存储设备抽象层④三个子模块组成,存储设备虚拟层⑥通过物理存储设备的虚拟驱动程序②子模块访问物理设备,存储设备虚拟层⑥通过虚拟存储设备抽象层④子模块向文件系统提供“合成”的虚拟存储视图。虚拟设备控制程序⑦是用户控制界面程序,用户可通过该模块控制和设置系统还原的其它功能模块。Fig. 7. The pure software implementation architecture of the system restoration method, in which the parts in bold are related modules of the method of the present invention. The other parts are system modules. The storage
图8.系统还原方法的纯硬件实现架构,该图将图7中的存储设备虚拟层⑥以单一的模块存储设备虚拟映射算法及接口⑥进行实现。Fig. 8. The pure hardware implementation architecture of the system restoration method. In this figure, the storage
图9.系统还原方法的软硬件联合实现架构,图中位于计算机系统BIOS或EFI中的映射算法⑧是通过硬件方式实现的,其它模块用软件实现,并且各个功能模块同图7中的功能模块。Fig. 9. The combined software and hardware implementation architecture of the system restoration method, the
图10(a-d).系统还原对存储设备性能影响的实验结果,图中表示存在系统还原情况下的实验结果,表示没有系统还原情况下的实验结果,图(a-d)中Iometer的读写块大小分别为1K、4K、8K和16K。Figure 10(ad). The experimental results of system restoration on the performance of storage devices, in the figure Indicates the experimental results in the presence of system restore, Indicates the experimental results without system restoration. The read and write block sizes of Iometer in (ad) are 1K, 4K, 8K and 16K respectively.
具体实施方式 Detailed ways
本发明将存储设备虚拟化,利用映射技术为系统提供一种虚拟的存储视图,系统对存储设备的所有操作均在该虚拟视图上进行,在去掉虚拟视图后,系统还原为真实视图,从而实现系统的快速还原。它含有:The present invention virtualizes the storage device and uses mapping technology to provide a virtual storage view for the system. All operations of the system on the storage device are performed on the virtual view. After the virtual view is removed, the system restores to the real view, thereby realizing Quick restore of the system. It contains:
虚拟设备控制程序⑦:该模块是用户和存储设备虚拟层⑥的接口,用户可通过该模块控制和设置系统还原的其它功能模块。Virtual device control program ⑦: This module is the interface between the user and the storage device
存储设备虚拟层⑥:该模块由物理存储设备的虚拟驱动程序②、虚拟映射算法③和虚拟存储设备抽象层④三个子模块组成,该模块通过子模块物理存储设备的虚拟驱动程序②访问物理设备,通过子模块虚拟存储设备抽象层④向文件系统提供“合成”的虚拟存储视图。Storage device virtualization layer ⑥: This module consists of three sub-modules: virtual driver of
本发明将系统拥有的存储空间分成两个区域:所有已分配的空间组成系统存储区域,所有未分配的空间,也就是空闲空间组成临时存储区域。同时将待还原的目标数据“保护”起来,禁止外部操作对其进行直接修改,将所有对目标数据的修改操作映射到临时存储区域,并通过给出的虚拟读操作算法和虚拟写操作算法将原数据和映射数据进行“合成”处理,从而达到“修改”的目的,其实现原理见附图1。在图1中,“系统存储”中的数据表示受保护的数据,也就是在还原时需要还原的数据,对系统存储数据的修改操作(包括增加、删除、修改等)均映射在临时存储区中,通过“合成”处理,为文件系统提供一个虚拟视图,在文件系统看来,所有的修改操作均成功完成了,这样,在“只读”的系统存储区就能够被执行“写”操作了。从上述原理中可以看出,只要去掉“合成”操作,就可实现系统还原,由于不涉及额外的备份数据和恢复数据操作,本发明不仅对系统性能影响比较小,而且还原速度非常快。如果用户想将修改操作提交到系统存储区域,则只需按照本发明给出的映射数据提交算法即可将临时存储区域的数据合并到系统存储区域。The invention divides the storage space owned by the system into two areas: all the allocated space forms the system storage area, and all the unallocated space, that is, the free space forms the temporary storage area. At the same time, the target data to be restored is "protected", prohibiting external operations from directly modifying it, and mapping all modification operations to the target data to the temporary storage area, and through the given virtual read operation algorithm and virtual write operation algorithm. The original data and the mapped data are "synthesized" to achieve the purpose of "modification". See Figure 1 for the principle of implementation. In Figure 1, the data in "system storage" represents the protected data, that is, the data that needs to be restored when restoring, and the modification operations (including adding, deleting, modifying, etc.) to the system stored data are mapped in the temporary storage area In the process of "synthesis", a virtual view is provided for the file system. From the perspective of the file system, all modification operations have been successfully completed, so that "write" operations can be performed in the "read-only" system storage area up. It can be seen from the above principles that as long as the "synthesis" operation is removed, system restoration can be realized. Since no additional backup data and data recovery operations are involved, the present invention not only has relatively little impact on system performance, but also has a very fast restoration speed. If the user wants to submit the modification operation to the system storage area, the data in the temporary storage area can be merged into the system storage area only by following the mapping data submission algorithm provided by the present invention.
在下面的叙述中,为论述方便,选用硬盘作为具体的存储设备,对其它类型的存储设备,本发明提出的方法同样适用,只是存储设备的基本存储单位由具体的存储设备确定。In the following description, for the convenience of discussion, the hard disk is selected as the specific storage device. For other types of storage devices, the method proposed by the present invention is also applicable, but the basic storage unit of the storage device is determined by the specific storage device.
将硬盘以其基本存储单位扇区为单位,按照逻辑块地址LBA(Logical Block Area)方式进行线性编址,编址后的硬盘扇区地址表示为:0,1,2.…,MaxLBA,其中的MaxLBA表示硬盘的总扇区数减1,然后以32个(该值可变,但最好为2的N(N=1,2,3…)次方,以便和目前操作系统中簇的分配情况相匹配)扇区作为一个基本单元,称为一个BLOCK块,将整个硬盘划分成[MaxLBA/32]+1个BLOCK块。每个BLOCK用两个数来表示,分别称为DAT和MAP。每个BLOCK对应的DAT由2位组成,用来表示BLOCK所处的四种状态:空闲、修改、受保护和映射状态。每个MAP由64位(该数应随着BLOCK块大小的改变作相应的调整)组成,用来存放该BLOCK块的映射地址和BLOCK块中每个扇区的映射状态,其中32位表示BLOCK块中每个扇区的映射状态,某位为1表示该扇区已映射,否则为未映射,MAP中的其它位用来表示该BLOCK块对应的映射地址(如果该块没有映射则为0),称其为pMAP。由所有表示BLOCK状态的DAT组成的数据称为块分配表BAT(Block Allocation Table),由所有表示BLOCK映射地址和扇区映射状态的MAP组成的数据称为映射索引表MIT(Mapping Index Table)。硬盘上的每个BLOCK,在BAT表和MIT表中各有一个DAT和MAP数和其一一对应,它们三者之间是一一映射关系。The hard disk is linearly addressed according to the logical block address LBA (Logical Block Area) based on its basic storage unit sector. The address of the hard disk sector after addressing is expressed as: 0, 1, 2..., MaxLBA, where The MaxLBA indicates that the total number of sectors of the hard disk is reduced by 1, and then 32 (this value is variable, but it is best to be 2 to the N (N=1, 2, 3...) power, so as to be consistent with the number of clusters in the current operating system As a basic unit, a sector is called a BLOCK block, which divides the entire hard disk into [MaxLBA/32]+1 BLOCK blocks. Each BLOCK is represented by two numbers, called DAT and MAP respectively. The DAT corresponding to each BLOCK consists of 2 bits, which are used to indicate the four states of the BLOCK: idle, modified, protected and mapped. Each MAP consists of 64 bits (the number should be adjusted accordingly as the size of the BLOCK block changes), and is used to store the mapping address of the BLOCK block and the mapping status of each sector in the BLOCK block, of which 32 bits represent BLOCK The mapping status of each sector in the block, a certain bit is 1 to indicate that the sector has been mapped, otherwise it is unmapped, and other bits in the MAP are used to indicate the corresponding mapping address of the BLOCK block (0 if the block is not mapped ), called pMAP. The data composed of all DATs representing the BLOCK state is called the Block Allocation Table BAT (Block Allocation Table), and the data composed of all the MAPs representing the BLOCK mapping address and sector mapping state is called the Mapping Index Table MIT (Mapping Index Table). Each BLOCK on the hard disk has a DAT and a MAP number in the BAT table and the MIT table, and there is a one-to-one correspondence between them, and there is a one-to-one mapping relationship between them.
保护算法是根据BAT和MIT表的数据来对硬盘的扇区地址进行映射变换,特别是BAT表,它记录着BLOCK块所处的状态,决定着映射变换的各种操作。对于BAT表中表示BLOCK块的每个数据DAT,表示的四种状态是:The protection algorithm is based on the data of the BAT and MIT tables to map the sector addresses of the hard disk, especially the BAT table, which records the state of the BLOCK block and determines various operations of the mapping transformation. For each data DAT representing a BLOCK block in the BAT table, the four states represented are:
00表示此BLOCK块空闲,属于临时存储区域。 00 means that this BLOCK block is free and belongs to the temporary storage area.
01表示此BLOCK块原为空闲块,现已作过修改,属于临时存储区域。 01 means that this BLOCK block was originally a free block, which has been modified and belongs to the temporary storage area.
10表示此BLOCK块是受保护块,属于系统存储区域。 10 indicates that this BLOCK block is a protected block and belongs to the system storage area.
11表示此BLOCK块已被映射,说明该块原为受保护块并且被“修改”,对该块的读写操作均需根据MAP中的地址指针来重定位。 11 indicates that the BLOCK block has been mapped, indicating that the block was originally a protected block and was "modified", and the read and write operations on the block need to be relocated according to the address pointer in the MAP.
表示某个BLOCK块的DAT和MAP的状态变换如附图2所示,图中的“直接写入”指应用程序或操作系统要写入的扇区位于本DAT或MAP所表示的BLOCK块中。空闲状态到保护状态转换中的“映射写入”指应用程序或操作系统要写入的扇区所位于的BLOCK块受保护,也即该BLOCK块对应的DAT的状态为保护状态,在这种情况下,写操作算法在硬盘上搜索空闲的BLOCK块,然后将原BLOCK块对应的DAT的状态设置为映射状态,将找到的空闲BLOCK块对应的DAT设置为保护状态,然后将搜索到的空闲BLOCK块的起始LBA值写入对应的MAP中的pMAP中,并将MAP中和写入扇区位置对应的位置1。The state transition of DAT and MAP representing a certain BLOCK block is shown in Figure 2. The "direct write" in the figure means that the sector to be written by the application program or operating system is located in the BLOCK block represented by this DAT or MAP . The "mapping write" in the transition from idle state to protected state means that the BLOCK block where the sector to be written by the application program or operating system is located is protected, that is, the state of the DAT corresponding to the BLOCK block is in the protected state. In this case, the write operation algorithm searches for free BLOCK blocks on the hard disk, then sets the state of the DAT corresponding to the original BLOCK block to the mapping state, sets the DAT corresponding to the found free BLOCK block to the protection state, and then sets The starting LBA value of the BLOCK block is written into the pMAP in the corresponding MAP, and the position corresponding to the sector position in the MAP is set to 1.
虽然对存储设备的操作有多种操作方式,但从本质上来看,都属于“读”操作和“写”操作范围,因此,为了实现虚拟磁盘操作,只需实现虚拟读操作和虚拟写操作即可。为表达方便,下述算法仅以处理一个扇区为例,如需处理多个扇区,只需重复该算法即可。在下述算法描述中,Offset表示某扇区在块中的偏移量,也即该扇区是BLOCK块中的第几个扇区;pBLOCK表示每个BLOCK块对应的实际块地址;pMAP表示BLOCK块对应的映射地址;MapLBA表示扇区映射后的逻辑地址;pFREE表示空闲块的块地址,公式中“/”表示整除运算,“MOD”表示模运算。Although there are many ways to operate storage devices, they all belong to the scope of "read" and "write" operations in essence. Therefore, in order to realize virtual disk operations, it is only necessary to implement virtual read operations and virtual write operations. Can. For the convenience of expression, the following algorithm only takes processing one sector as an example. If multiple sectors need to be processed, just repeat the algorithm. In the following algorithm description, Offset indicates the offset of a certain sector in the block, that is, which sector is the sector in the BLOCK block; pBLOCK indicates the actual block address corresponding to each BLOCK block; pMAP indicates BLOCK Mapping address corresponding to the block; MapLBA indicates the logical address after sector mapping; pFREE indicates the block address of the free block, "/" in the formula indicates integer division operation, and "MOD" indicates modulo operation.
虚拟写操作算法:本方法拦截系统对存储设备的所有写操作,然后按照给出的算法作相应的映射变换,从而实现对系统的动态保护,该算法的具体描述见附图3.Virtual write operation algorithm: This method intercepts all write operations of the system to the storage device, and then performs corresponding mapping transformation according to the given algorithm, so as to realize the dynamic protection of the system. The specific description of the algorithm is shown in Figure 3.
虚拟读操作算法:本方法拦截系统对存储设备的所有读操作,然后按照给出的算法完成数据的读操作,该算法的具体描述见附图4.Virtual read operation algorithm: This method intercepts all read operations of the storage device by the system, and then completes the data read operation according to the given algorithm. The specific description of the algorithm is shown in Figure 4.
映射数据提交算法:在进行系统恢复时,为了能够还原系统到当前状态,需要将保存在临时存储区中的数据提交到系统存储区域。从而使临时存储区域中的数据合并到系统存储区域。由于数据提交操作涉及到所有映射数据的复制操作,因此提交数据所需时间和提交的数据量有关。提交算法的具体描述见附图5.Mapped data submission algorithm: During system recovery, in order to restore the system to the current state, the data stored in the temporary storage area needs to be submitted to the system storage area. Thus, the data in the temporary storage area is merged into the system storage area. Since the data submission operation involves the copy operation of all mapping data, the time required to submit the data is related to the amount of submitted data. For a detailed description of the submission algorithm, see Figure 5.
系统还原算法:由于将所有对存储设备的写操作均作了虚拟处理,因此在需要还原时,只要去掉“合成”操作即可恢复系统所有被“修改”的数据。从虚拟读写算法中我们知道,所有“合成”操作均按照BAT和MIT表中的数据进行处理的,因此,只要将BAT和MIT表中的数据清0就可达到还原系统的目的。由于在还原时不涉及被“修改”数据的恢复操作(如拷贝等),系统还原所需的时间是将BAT和MIT清0以及重建BAT表的时间,因此还原的速度非常快。事实上,本发明采用的原理决定了它还存在一种隐含的还原方式:自恢复还原方式。在系统还原程序自身遭到攻击,导致系统崩溃等情况下,当系统再次启动时,由于存储设备虚拟层的失效,“合成”操作不再存在,系统自动会还原到上次提交时的状态。附图6给出了具体的还原算法。System restoration algorithm: Since all write operations to the storage device are virtualized, all "modified" data in the system can be restored by removing the "synthetic" operation when restoration is required. We know from the virtual reading and writing algorithm that all "synthetic" operations are processed according to the data in the BAT and MIT tables. Therefore, as long as the data in the BAT and MIT tables are cleared to 0, the purpose of restoring the system can be achieved. Since the recovery operation (such as copying, etc.) of "modified" data is not involved in the restoration, the time required for system restoration is the time for clearing BAT and MIT and rebuilding the BAT table, so the restoration speed is very fast. In fact, the principle adopted by the present invention determines that it also has an implicit restoration mode: self-recovery restoration mode. When the system restore program itself is attacked and the system crashes, when the system restarts, due to the failure of the virtual layer of the storage device, the "synthesis" operation no longer exists, and the system will automatically restore to the state at the time of the last submission. Accompanying drawing 6 has given the specific restoration algorithm.
要实现上述算法,很重要的一步是建立BAT和MIT表的初始状态。BAT表的初始状态由保护程序在安装时通过扫描文件系统的分配表建立,如对于FAT16、FAT32类型的文件系统,通过扫描相应的FAT表来获得当前的磁盘分配状态;对于NTFS文件系统,可以通过扫描位图文件得到当前的磁盘分配状态等。BAT表中每一项的初始状态只有空闲和保护两种状态,MIT表的初值均为0。To implement the above algorithm, a very important step is to establish the initial state of the BAT and MIT tables. The initial state of the BAT table is established by the protection program by scanning the allocation table of the file system during installation. For example, for FAT16 and FAT32 type file systems, the current disk allocation state can be obtained by scanning the corresponding FAT table; for the NTFS file system, you can Get the current disk allocation status, etc. by scanning the bitmap file. The initial state of each item in the BAT table is only idle and protected, and the initial value of the MIT table is 0.
上述算法既可以用纯硬件的方式实现,也可以用纯软件的方式实现,或者软硬件相结合的方式进行实现。The above algorithm can be implemented in a pure hardware manner, or in a pure software manner, or in a combination of software and hardware.
在纯软件的实现方式中,需根据计算机系统所安装的操作系统进行具体的分析。所依赖的架构如附图7所示。只要保证在计算机系统的启动和运行过程中,所有的存储设备操作均在本发明提出的虚拟读写算法控制下即可。In the implementation of pure software, specific analysis needs to be carried out according to the operating system installed in the computer system. The dependent architecture is shown in Figure 7. As long as it is ensured that during the startup and operation of the computer system, all storage device operations are under the control of the virtual read-write algorithm proposed by the present invention.
在纯硬件实现方式中,将附图7中的存储设备虚拟层⑥以单一的模块形式进行实现,具体架构见附图8,其中映射算法采用第本发明所给出的算法,其中接口主要为位于软件层的虚拟设备控制程序⑦提供对存储设备虚拟层⑥的控制能力,如停止或启动虚拟等。In the pure hardware implementation mode, the storage device
在软硬件联合实现方式中,将虚拟映射算法分别在两个层次进行实现,在计算机系统的基本输入输出系统BIOS中实现虚拟映射算法⑧,如果计算机系统所安装的操作系统对存储设备的所有操作均通过BIOS进行,那么上层软件不再需要实现虚拟映射算法,只需提供对虚拟映射算法⑧的虚拟设备控制程序⑦即可实现系统还原;反之,如果操作系统在启动时通过BIOS对存储设备进行操作,而启动后通过操作系统自带的驱动程序对存储设备进行操作,则本发明不仅要在BIOS实现虚拟映射算法⑧,而且也需按照附图9给出的架构实现存储设备虚拟层⑥。例如,在安装有Windows或Linux/Unix的系统上实现本发明提出的软硬件联合方式实现系统还原,则必须同时实现⑥和⑧;如果在装有DOS操作系统的系统上实现本发明提出的软硬件联合方式实现系统还原,则不必实现⑥。In the combination of software and hardware, the virtual mapping algorithm is implemented at two levels, and the
本算法额外占用的储存空间主要是BAT表和MIT表所占的存储空间,由于实现本算法的程序所占的存储空间很小,在以下的分析中,均忽略不计。在下面的计算中,每个扇区按512字节进行计算,每个BLOCK块的大小按32个扇区计算。The additional storage space occupied by this algorithm is mainly the storage space occupied by the BAT table and the MIT table. Since the storage space occupied by the program implementing this algorithm is very small, it is ignored in the following analysis. In the calculation below, each sector is calculated as 512 bytes, and the size of each BLOCK is calculated as 32 sectors.
1)BAT表占用的空间1) The space occupied by the BAT table
因BAT表中每2位表示一个BLOCK,所以一个扇区可表示512*8/2=2048个BLOCK,也就是可以表示2048*32=65536个扇区,因此,BAT表占用的磁盘空间占整个磁盘空间的比例是1/65536=0.0015%。Because every 2 bits in the BAT table represent a BLOCK, one sector can represent 512*8/2=2048 BLOCKs, that is, it can represent 2048*32=65536 sectors. Therefore, the disk space occupied by the BAT table occupies the entire The ratio of disk space is 1/65536=0.0015%.
2)MIT表占用的空间2) The space occupied by the MIT table
因MIT表中每64位表示一个BLOCK,所以一个扇区可表示512*8/64=64个BLOCK,也就是可以表示64*32=2048个扇区,因此,MIT表占用的磁盘空间占整个磁盘空间的比例是1/2048=0.0488%。Because every 64 bits in the MIT table represents a BLOCK, so a sector can represent 512*8/64=64 BLOCKs, that is, it can represent 64*32=2048 sectors, therefore, the disk space occupied by the MIT table occupies the entire The ratio of disk space is 1/2048=0.0488%.
综合1)和2)知本算法额外占用的磁盘空间约占整个磁盘空间的比例是0.0015%+0.0488%=0.0503%。Combining 1) and 2) the additional disk space occupied by the Zhiben algorithm accounts for about 0.0015%+0.0488%=0.0503% of the entire disk space.
本算法额外占用的系统资源主要包括内存和CPU的占用,其中对CPU时间的占用,主要集中在查找BAT和MIT表的时间上;对于内存的占用,本算法需常驻内存的部分,根据用C语言已经实现的程序看,约需6K,但为了加快对BAT和MIT表的查找速度,需在内存保留一定的空间,用于存放最近常用的BAT和MIT表数据,使读写磁盘上的BAT和MIT表的次数降到最低程度。该空间越大,可存放最近使用的BAT表和MIT表的数据越多,查找的速度越快,对CPU的占用越少,但保护程序占用的内存越多,系统可用的内存越小,因此,存在一个最佳值的问题,根据实际试验结果,分配的内存空间占磁盘空间的比例为3/%%%时(60G的硬盘,需分配180K的内存用于缓冲BAT表和MIT表)保护程序对系统性能的影响已降低到很小的程度,再加大缓冲区,效果已不明显。The additional system resources occupied by this algorithm mainly include the occupation of memory and CPU, among which the occupation of CPU time is mainly concentrated on the time of searching BAT and MIT tables; as for the occupation of memory, the part of this algorithm that needs to reside in memory depends on the usage The program that has been implemented in C language needs about 6K, but in order to speed up the search for BAT and MIT tables, a certain amount of space needs to be reserved in the memory to store the recently commonly used BAT and MIT table data, so that the data on the disk can be read and written. The number of BAT and MIT tables is minimized. The larger the space, the more data that can be stored in the recently used BAT table and MIT table, the faster the search speed, and the less CPU usage, but the more memory the protection program takes up, the smaller the available memory for the system, so , there is an optimal value problem. According to the actual test results, when the allocated memory space accounts for 3/%%% of the disk space (60G hard disk, 180K memory needs to be allocated for buffering BAT table and MIT table) protection The impact of the program on system performance has been reduced to a very small degree, and the effect of increasing the buffer is no longer obvious.
为了验证本发明实际效果和对系统性能的影响,我们用纯软件方式在Windows上进行了实现,并对本发明的功能和性能分别进行了测试,其中功能测试中的各种破坏操作主要通过编程实现,性能测试采用标准测试程序Iometer。测试环境为:1.2GHz Intel Celeron CPU,256Mbytes内存,Windows 2000和60G Seagate IDE硬盘(ST360021),功能测试结果如表1所示,性能测试结果如附图10(a-d)所示。In order to verify the actual effect of the present invention and the impact on system performance, we have implemented it on Windows with pure software, and tested the functions and performance of the present invention respectively, wherein various destructive operations in the function test are mainly realized by programming , The performance test adopts the standard test program Iometer. The test environment is: 1.2GHz Intel Celeron CPU, 256Mbytes memory, Windows 2000 and 60G Seagate IDE hard disk (ST360021). The functional test results are shown in Table 1, and the performance test results are shown in Figure 10(a-d).
表1.系统还原功能的测试结果Table 1. Test results of system restore function
由于本发明方法主要影响磁盘的读写操作,因此在性能测试中,采用相同的测试环境和相同的参数配置,分别测试在安装和未安装利用本发明开发的系统还原软件的情况下磁盘的吞吐量。对磁盘的读写方式分别采用了顺序读(%随机操作=0,%读操作=100)、顺序写(%随机操作=0,%读操作=0)、随机读写(0<%随机操作<100),其中“随机操作%”指读写操作的随机概率,“读操作%”指读操作所占的比例。附图10(a-d)给出的分别是在Iometer的读写块大小为1K、4K、8K和16K的情况下的测试结果。Because the method of the present invention mainly affects the read and write operations of the disk, in the performance test, the same test environment and the same parameter configuration are used to test the throughput of the disk under the situation of installing and not installing the system restoration software developed by the present invention respectively quantity. The read and write methods for the disk adopt sequential read (% random operation = 0, % read operation = 100), sequential write (% random operation = 0, % read operation = 0), random read and write (0<% random operation <100), where "random operation%" refers to the random probability of read and write operations, and "read operation%" refers to the proportion of read operations. Figures 10(a-d) show the test results when the read/write block sizes of the Iometer are 1K, 4K, 8K and 16K, respectively.
从图中可以看出,在顺序读写的情况下(%随机操作=0),本方法对磁盘吞吐量有一定的影响,但随着读写随机性的增大,本方法对磁盘吞吐量的影响逐渐降低,继而还对提高吞吐量有一定的帮助。从理论上来说,由于本方法需要额外的查表操作,因此对磁盘的吞吐量肯定有影响,但考虑到磁盘的连续读写速度要远远快于非连续读写速度,因本方法可以将系统对磁盘的随机写操作在映射时形成连续的块,这从一定程度上提高了系统的读写速度,因而出现了图中异常的结果。It can be seen from the figure that in the case of sequential read and write (% random operation = 0), this method has a certain impact on disk throughput, but with the increase of read and write randomness, this method has a certain impact on disk throughput. The impact gradually decreases, and then it also helps to improve throughput. Theoretically speaking, since this method requires additional table lookup operations, it will definitely affect the throughput of the disk. However, considering that the continuous read and write speed of the disk is much faster than the discontinuous read and write speed, this method can The system's random write operation to the disk forms continuous blocks during mapping, which improves the read and write speed of the system to a certain extent, so the abnormal result in the figure appears.
从以上的分析和在Windows上的实际试验结果看,本发明提出的系统还原方法总体占用的系统资源比较少,且对系统整体性能的影响比较小。From the above analysis and the actual test results on Windows, the system restoration method proposed by the present invention generally occupies less system resources and has less impact on the overall performance of the system.
Claims (3)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2006101655877A CN100428196C (en) | 2006-12-22 | 2006-12-22 | A method for fast recovery of computer system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2006101655877A CN100428196C (en) | 2006-12-22 | 2006-12-22 | A method for fast recovery of computer system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101004703A CN101004703A (en) | 2007-07-25 |
| CN100428196C true CN100428196C (en) | 2008-10-22 |
Family
ID=38703870
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2006101655877A Expired - Fee Related CN100428196C (en) | 2006-12-22 | 2006-12-22 | A method for fast recovery of computer system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN100428196C (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101576834B (en) * | 2009-05-08 | 2012-05-30 | 西安蓝海本立信息科技有限公司 | Continuous data protection system and method for establishing data view based on timestamp |
| CN102096614A (en) * | 2011-01-24 | 2011-06-15 | 上海银杏界信息科技有限公司 | Data restoration method of application system |
| US9727570B2 (en) * | 2011-06-03 | 2017-08-08 | Apple Inc. | Mount-time unmapping of unused logical addresses in non-volatile memory systems |
| CN107209683B (en) * | 2015-01-30 | 2021-01-22 | 惠普发展公司有限责任合伙企业 | Backup image restore |
| CN106998468B (en) * | 2017-04-25 | 2018-11-16 | 郑州云海信息技术有限公司 | A kind of method and system of Performance Testing of Video Server |
| CN111125710B (en) * | 2019-11-29 | 2022-06-28 | 联想(北京)有限公司 | Information processing method and device, electronic equipment and storage medium |
| CN114047728B (en) * | 2021-10-27 | 2024-06-28 | 国核自仪系统工程有限公司 | Data synchronization method based on secure bus |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1338751A (en) * | 2001-07-05 | 2002-03-06 | 刘海全 | Hard disk data protection method for computer |
| US20020101424A1 (en) * | 2000-12-22 | 2002-08-01 | Bin Yuan | Method of testing graphic accelerator in DOS mode |
-
2006
- 2006-12-22 CN CNB2006101655877A patent/CN100428196C/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20020101424A1 (en) * | 2000-12-22 | 2002-08-01 | Bin Yuan | Method of testing graphic accelerator in DOS mode |
| CN1338751A (en) * | 2001-07-05 | 2002-03-06 | 刘海全 | Hard disk data protection method for computer |
Non-Patent Citations (4)
| Title |
|---|
| 硬盘还原保护技术分析与实现. 童长仁,许菱,罗家国.南方冶金学院学报,第26卷第4期. 2005 |
| 硬盘还原保护技术分析与实现. 童长仁,许菱,罗家国.南方冶金学院学报,第26卷第4期. 2005 * |
| 还原卡原理分析. 陈鹏宇.四川理工学院学报(自然科学版),第18卷第3期. 2005 |
| 还原卡原理分析. 陈鹏宇.四川理工学院学报(自然科学版),第18卷第3期. 2005 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101004703A (en) | 2007-07-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN100428196C (en) | A method for fast recovery of computer system | |
| US8103847B2 (en) | Storage virtual containers | |
| JP6050262B2 (en) | Virtual disk storage technology | |
| US9779033B2 (en) | Memory management device and non-transitory computer readable storage medium | |
| KR102275563B1 (en) | Host-managed non-volatile memory | |
| CN108139902A (en) | Method and apparatus for providing hybrid mode access to SSD drives | |
| CN110737395B (en) | I/O management method, electronic device, and computer-readable storage medium | |
| CN113722131A (en) | Method and system for facilitating fast crash recovery in a storage device | |
| US20160041917A1 (en) | System and method for mirroring a volatile memory of a computer system | |
| US11573710B2 (en) | Protection domains for files at file-level or page-level | |
| US11210024B2 (en) | Optimizing read-modify-write operations to a storage device by writing a copy of the write data to a shadow block | |
| KR102102248B1 (en) | Method for testing performance of solid state drivce emulator | |
| US12298907B2 (en) | Systems and methods for a redundant array of independent disks (RAID) using a RAID circuit in cache coherent interconnect storage devices | |
| Zhang et al. | Removing the costs and retaining the benefits of flash-based SSD virtualization with FSDV | |
| US9766990B1 (en) | Checkpoint block storage device | |
| US12189574B2 (en) | Two-level logical to physical mapping mechanism in a log-structured file system | |
| US11880584B2 (en) | Reverse range lookup on a unified logical map data structure of snapshots | |
| Yuan et al. | Comprehensive evaluation of file systems robustness with SPIN model checking | |
| WO2024108939A1 (en) | Multi-level mapping framework and data operation request processing method and system | |
| US11928497B2 (en) | Implementing erasure coding with persistent memory | |
| US11797214B2 (en) | Micro-batching metadata updates to reduce transaction journal overhead during snapshot deletion | |
| US20230221864A1 (en) | Efficient inline block-level deduplication using a bloom filter and a small in-memory deduplication hash table | |
| US20170351447A1 (en) | Data protection implementation for block storage devices | |
| US11748300B2 (en) | Reverse deletion of a chain of snapshots | |
| US12105972B2 (en) | Storage system and storage control method of data deduplication between virtual devices |
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 | ||
| C17 | Cessation of patent right | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20081022 Termination date: 20100122 |