[go: up one dir, main page]

CN104965772A - Method and device for recovering files - Google Patents

Method and device for recovering files Download PDF

Info

Publication number
CN104965772A
CN104965772A CN201510455481.XA CN201510455481A CN104965772A CN 104965772 A CN104965772 A CN 104965772A CN 201510455481 A CN201510455481 A CN 201510455481A CN 104965772 A CN104965772 A CN 104965772A
Authority
CN
China
Prior art keywords
file
data
metadata
module
recovery
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.)
Pending
Application number
CN201510455481.XA
Other languages
Chinese (zh)
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510455481.XA priority Critical patent/CN104965772A/en
Publication of CN104965772A publication Critical patent/CN104965772A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

一种文件恢复方法,所述方法包括:选中要恢复的文件;恢复所述文件;所述文件恢复完毕,再恢复下一个文件。本发明的技术方案,按文件为单位进行数据恢复,避免了恢复大量数据时因为网络带宽不足造成的延时,有效提高数据恢复效率。

A file restoration method, the method includes: selecting a file to be restored; restoring the file; and restoring the next file after the restoration of the file. The technical scheme of the present invention restores data in units of files, avoids the time delay caused by insufficient network bandwidth when restoring a large amount of data, and effectively improves the efficiency of data restoration.

Description

一种文件恢复方法及装置A file recovery method and device

技术领域technical field

本发明涉及数据存储技术领域,尤其涉及一种文件恢复方法及装置。The invention relates to the technical field of data storage, in particular to a file recovery method and device.

背景技术Background technique

在Linux文件管理中,一个文件除了自身的数据之外,还有一个附属信息,即文件的元数据(metadata)。这个元数据用于记录文件的许多信息,比如文件大小,拥有人,所属的组,修改日期等等。元数据并不包含在文件的数据中,而是由操作系统维护的。事实上,这个所谓的元数据就包含在inode中。inode所占据的区域与数据块的区域不同。每个inode有一个唯一的整数编号(inode number)表示。In Linux file management, in addition to its own data, a file also has ancillary information, that is, file metadata. This metadata is used to record many information about the file, such as file size, owner, group it belongs to, modification date, etc. Metadata is not included in the file's data, but is maintained by the operating system. In fact, this so-called metadata is contained in the inode. The area occupied by inodes is different from the area of data blocks. Each inode is represented by a unique integer number (inode number).

在保存元数据,inode是“文件”从抽象到具体的关键。inode储存由一些指针,这些指针指向存储设备中的一些数据块,文件的内容就储存在这些数据块中。当Linux想要打开一个文件时,只需要找到文件对应的inode,然后沿着指针,将所有的数据块收集起来,就可以在内存中组成一个文件的数据了。In storing metadata, the inode is the key to the "file" from abstraction to concreteness. The inode storage consists of some pointers, which point to some data blocks in the storage device, and the contents of the file are stored in these data blocks. When Linux wants to open a file, it only needs to find the inode corresponding to the file, and then collect all the data blocks along the pointer to form the data of a file in memory.

当通过备份软件对需要保护的数据进行备份的时候,不仅需要备份文件数据本身,同时文件对应的元数据也需要备份。当数据丢失的时候,通过恢复文件元数据和数据本身来恢复文件数据及相关属性信息。When backing up data to be protected through backup software, not only the file data itself needs to be backed up, but also the metadata corresponding to the file needs to be backed up. When the data is lost, the file data and related attribute information are recovered by restoring the file metadata and the data itself.

现有技术是,当需要恢复的文件数量很多时,先批量恢复所有文件的元数据,再批量恢复所有文件的数据,众所周知,LAN环境下,网络带宽成为数据备份还原的瓶颈;由于数据量比较大和网络带宽的限制,数据传输需要较长的时间,总体看,导致整个数据恢复周期比较长。The prior art is that when there are a lot of files to be restored, the metadata of all the files are first restored in batches, and then the data of all the files are restored in batches. As we all know, in a LAN environment, network bandwidth becomes the bottleneck of data backup and restoration; Due to the limitation of large and network bandwidth, data transmission takes a long time. Overall, the entire data recovery cycle is relatively long.

发明内容Contents of the invention

为了解决上述问题,本发明提供了一种文件恢复方法,所述方法包括:In order to solve the above problems, the present invention provides a file recovery method, the method comprising:

选中要恢复的文件;Select the files to be restored;

恢复所述文件;restore said file;

所述文件恢复完毕,再恢复下一个文件。After the files are restored, the next file is restored.

可选地,Optionally,

所述恢复所述文件,包括:恢复所述文件的元数据;恢复所述文件的数据。The restoring the file includes: restoring metadata of the file; restoring data of the file.

可选地,所述恢复所述文件的数据之前,包括:查找到所述文件的元数据对应的文件的数据。Optionally, before restoring the data of the file, the method includes: finding the data of the file corresponding to the metadata of the file.

一种文件恢复装置,所述装置包括:A file recovery device, said device comprising:

文件管理模块,用于选中要恢复的文件;The file management module is used to select the files to be restored;

恢复模块;用于恢复所述文件;a restore module; for restoring said files;

所述文件恢复完毕,再恢复下一个文件。After the files are restored, the next file is restored.

可选地,所述恢复模块,用于恢复所述文件的元数据;恢复所述文件的数据。Optionally, the restoring module is configured to restore metadata of the file; restore data of the file.

可选地,还包括查找模块;用于在恢复模块恢复所述文件的数据之前,根据所述文件的元数据,查找到所述文件的元数据对应的文件的数据。Optionally, a search module is also included; used to find the data of the file corresponding to the metadata of the file according to the metadata of the file before the recovery module restores the data of the file.

本发明的技术方案,按文件为单位进行数据恢复,避免了恢复大量数据时因为网络带宽不足造成的延时,有效提高数据恢复效率。The technical scheme of the present invention restores data in units of files, avoids the time delay caused by insufficient network bandwidth when restoring a large amount of data, and effectively improves the efficiency of data restoration.

附图说明Description of drawings

图1为本发明的一种文件恢复方法的流程图;Fig. 1 is the flowchart of a kind of file restoration method of the present invention;

图2为本发明的一种文件恢复装置的结构图。Fig. 2 is a structural diagram of a file recovery device of the present invention.

具体实施方式Detailed ways

下面将结合附图及实施例对本发明的技术方案进行更详细的说明。The technical solution of the present invention will be described in more detail below with reference to the drawings and embodiments.

需要说明的是,如果不冲突,本发明实施例以及实施例中的各个特征可以相互结合,均在本发明的保护范围之内。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that, if there is no conflict, the embodiments of the present invention and various features in the embodiments can be combined with each other, and all are within the protection scope of the present invention. In addition, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

一种文件恢复方法,所述方法包括:A file recovery method, said method comprising:

选中要恢复的文件;Select the files to be restored;

恢复所述文件;restore said file;

所述文件恢复完毕,再恢复下一个文件。After the files are restored, the next file is restored.

可选地,Optionally,

所述恢复所述文件,包括:恢复所述文件的元数据;恢复所述文件的数据。The restoring the file includes: restoring metadata of the file; restoring data of the file.

可选地,所述恢复所述文件的数据之前,包括:查找到所述文件的元数据对应的文件的数据。Optionally, before restoring the data of the file, the method includes: finding the data of the file corresponding to the metadata of the file.

图1为本发明的一种文件恢复方法的流程图;Fig. 1 is the flowchart of a kind of file restoration method of the present invention;

步骤S01:选中要恢复的文件;Step S01: Select the file to be restored;

步骤S02:恢复所述文件;Step S02: restoring the file;

步骤S03:所述文件恢复完毕,再恢复下一个文件。Step S03: After the file is restored, the next file is restored.

本发明的技术方案,充分考虑到了网络带宽,以单个文件为单位进行恢复,而不是采用现有技术中,批量恢复大量文件的元数据,再批量恢复大量文件的数据的方法,从而避免了网络带宽不足引起的延时。The technical solution of the present invention fully considers the network bandwidth, and restores a single file as a unit, instead of using the prior art method of restoring metadata of a large number of files in batches, and then restoring data of a large number of files in batches, thereby avoiding network Delay caused by insufficient bandwidth.

以单个文件为单位进行恢复,比如,先恢复第一个文件,先恢复第一个文件的元数据;用查找算法查找到对应的数据,将元数据恢复后,再恢复对应的数据,第一个文件恢复结束。然后再恢复第二个文件,方法相同。依次恢复所有的文件。Restore with a single file as a unit, for example, restore the first file first, restore the metadata of the first file first; use the search algorithm to find the corresponding data, restore the metadata, and then restore the corresponding data, the first File recovery is complete. Then restore the second file in the same way. Restore all files in turn.

本发明的技术方案,当文件为大批量时,就能体现出优点。节省了带宽,提高了时间。The technical scheme of the present invention can show advantages when the files are in large batches. Saves bandwidth and improves time.

拆成以单个文件进行恢复,恢复完一个文件的元数据,再恢复这个文件的数据,然后再恢复下一个文件,一直到所有的文件恢复完毕。对于网络来讲,每一次通过的最大数据量只是单个文件的数据量。Split it into individual files for recovery, restore the metadata of a file, then restore the data of this file, and then restore the next file until all files are restored. For the network, the maximum amount of data per pass is only the data amount of a single file.

利用了网络带宽。从而提高了传输效率。Utilizes network bandwidth. Thus, the transmission efficiency is improved.

本发明的技术方案,充分考虑了网络带宽的因素,以单个文件为单位进行恢复,解决了现有技术由于网络带宽不足,延长数据恢复时间的问题。The technical solution of the present invention fully considers the factors of network bandwidth, recovers with a single file as a unit, and solves the problem of prolonging data recovery time due to insufficient network bandwidth in the prior art.

图2为本发明的一种文件恢复装置的结构图;Fig. 2 is a structural diagram of a file recovery device of the present invention;

包括文件管理模块201、恢复模块202、查找模块203;Including file management module 201, recovery module 202, search module 203;

查找模块203,用于查找与元数据对应的数据;恢复模块202,用于恢复元数据、数据;The search module 203 is used to find the data corresponding to the metadata; the recovery module 202 is used to recover the metadata and data;

对于单个文件,查找模块,根据元数据查找到对应的数据;找到之后,通知恢复模块,恢复模块对查找到的数据进行恢复;For a single file, the search module finds the corresponding data according to the metadata; after finding it, the recovery module is notified, and the recovery module recovers the found data;

上述查找的过程可以在恢复模块在恢复元数据之前,或者同时,或者之后,进行;The above search process can be performed before, at the same time, or after the restoration module restores the metadata;

以同时进行为例,For example, at the same time,

当恢复模块202对元数据进行恢复时,通知查找模块203进行查找;When the recovery module 202 recovers the metadata, notify the search module 203 to search;

查找模块203查找对应的数据,再通知给恢复模块202;The search module 203 searches for the corresponding data, and then notifies the recovery module 202;

文件管理模块201,用于管理文件群,包括将文件群内的文件进行排序,选择出每一次要恢复的文件;当一个文件恢复完成后,恢复模块202通知文件管理模块,该文件恢复完成;文件管理模块201通知恢复模块202,对下一个文件进行恢复。The file management module 201 is used to manage the file group, including sorting the files in the file group, and selecting each file to be restored; when a file is restored, the restoration module 202 notifies the file management module that the file restoration is completed; The file management module 201 notifies the restoration module 202 to restore the next file.

本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。Those skilled in the art can understand that all or part of the steps in the above method can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk, and the like. Optionally, all or part of the steps in the foregoing embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the foregoing embodiments may be implemented in the form of hardware, or may be implemented in the form of software function modules. The present invention is not limited to any specific combination of hardware and software.

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

Claims (6)

1. a file access pattern method, is characterized in that, described method comprises:
Choose the file that will recover;
Recover described file;
Described file access pattern is complete, then recovers next file.
2., as profit requires the method as described in 1, it is characterized in that
The described file of described recovery, comprising: the metadata recovering described file; Recover the data of described file.
3. method as claimed in claim 2, is characterized in that, before the data of the described file of described recovery, comprising: the data finding file corresponding to the metadata of described file.
4. a file restoring device, is characterized in that, described device comprises:
Document management module, for choosing the file that will recover;
Recover module; For recovering described file;
Described file access pattern is complete, then recovers next file.
5. device as claimed in claim 4, is characterized in that, described recovery module, for recovering the metadata of described file; Recover the data of described file.
6. device as claimed in claim 5, is characterized in that, also comprise and search module; For before the data recovering file described in module recovery, according to the metadata of described file, find the data of file corresponding to the metadata of described file.
CN201510455481.XA 2015-07-29 2015-07-29 Method and device for recovering files Pending CN104965772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510455481.XA CN104965772A (en) 2015-07-29 2015-07-29 Method and device for recovering files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510455481.XA CN104965772A (en) 2015-07-29 2015-07-29 Method and device for recovering files

Publications (1)

Publication Number Publication Date
CN104965772A true CN104965772A (en) 2015-10-07

Family

ID=54219807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510455481.XA Pending CN104965772A (en) 2015-07-29 2015-07-29 Method and device for recovering files

Country Status (1)

Country Link
CN (1) CN104965772A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002054241A1 (en) * 2000-12-29 2002-07-11 Chapararal Network Storage Inc. Recovering data from arrays of storage devices after certain failures
CN101814045A (en) * 2010-04-22 2010-08-25 华中科技大学 Data organization method for backup services
CN102737032A (en) * 2011-04-06 2012-10-17 腾讯科技(深圳)有限公司 Method and device for file recovery

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002054241A1 (en) * 2000-12-29 2002-07-11 Chapararal Network Storage Inc. Recovering data from arrays of storage devices after certain failures
CN101814045A (en) * 2010-04-22 2010-08-25 华中科技大学 Data organization method for backup services
CN102737032A (en) * 2011-04-06 2012-10-17 腾讯科技(深圳)有限公司 Method and device for file recovery

Similar Documents

Publication Publication Date Title
CA2901668C (en) Deduplication storage system with efficient reference updating and space reclamation
US8782011B2 (en) System and method for scalable reference management in a deduplication based storage system
AU2010347733B2 (en) Systems and methods for garbage collection in deduplicated data systems
US20170344433A1 (en) Apparatus and method for data migration
US8904125B1 (en) Systems and methods for creating reference-based synthetic backups
CN108255638B (en) Snapshot rollback method and device
US11385804B2 (en) Storing de-duplicated data with minimal reference counts
US20160139996A1 (en) Methods for providing unified storage for backup and disaster recovery and devices thereof
CN104199888A (en) Data recovery method and device for resilient file system
CN102799503B (en) Recover method applied to large quantity of small files
CN104461773A (en) A method for deduplication of virtual machine backup
CN108415794A (en) File backup method and file backup device
CN104965835B (en) A kind of file read/write method and device of distributed file system
RU2016124319A (en) METHOD AND DEVICE FOR RESTORING DEDUPLICATED DATA
CN107704208B (en) Method, device and medium for repairing metadata
CN104484402B (en) A kind of method and device of deleting duplicated data
WO2017067397A1 (en) Data recovery method and device
CN115543918A (en) File snapshot method, system, electronic equipment and storage medium
KR101780236B1 (en) Apparatus and method for file management of recovered file
CN106557383B (en) Data recovery method and device
CN110806953A (en) A backup method and device
US11809598B2 (en) Devices and methods for safe storage of media containing personal data and erasure of stored personal data
CN104965772A (en) Method and device for recovering files
CN106250264A (en) Data reconstruction method and system for distributed storage
US9740701B1 (en) Snapshot cauterization

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151007

RJ01 Rejection of invention patent application after publication