CN103729265B - Protection method and apparatus for storing data - Google Patents

Protection method and apparatus for storing data Download PDF

Info

Publication number
CN103729265B
CN103729265B CN 201310744238 CN201310744238A CN103729265B CN 103729265 B CN103729265 B CN 103729265B CN 201310744238 CN201310744238 CN 201310744238 CN 201310744238 A CN201310744238 A CN 201310744238A CN 103729265 B CN103729265 B CN 103729265B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
snapshot
read
file
level
row
Prior art date
Application number
CN 201310744238
Other languages
Chinese (zh)
Other versions
CN103729265A (en )
Inventor
庞洪福
Original Assignee
华为技术有限公司
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
Grant date

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30067File systems; File servers
    • G06F17/3007File system administration
    • G06F17/30088Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion

Abstract

本发明公开了一种存储数据的保护方法及装置,属于网络连接存储领域。 The present invention discloses a method and apparatus for storing protected data, belonging to a network connected storage. 所述方法包括:接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性;根据所述属性设置指令设置所述文件的文件快照级别属性;接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数;根据所述快照创建指令为所述文件系统创建采用写时重定向ROW技术的ROW只读快照,所述ROW只读快照的只读快照级别属性根据所述文件快照级别属性参数设置。 The method comprising: receiving a command property, the property instruction request snapshot files in the file system level property file; set according to the attribute of the file snapshot file level attribute setting instruction; receiving the snapshot creation instruction, the a snapshot creation instruction carried in need of protection level snapshot file attribute parameter; ROW system creates the file read-only snapshot technology redirection ROW when using the snapshot creation instruction to write according to the read-only read-only snapshot ROW snapshot set according to the file attribute-level snapshot parameter level attribute. 本发明对该文件快照级别属性进行设置,并在对系统文件创建只读快照时指定该只读快照需要保护的文件的快照级别,根据应用场景决定该为文件系统的哪些文件创建快照,控制快照的使用空间,降低只读快照占用的文件系统的空间。 The present invention will be set if the snapshot file level attributes, and specify the file read-only snapshot of a snapshot in need of protection level when you create a read-only snapshot of the file system, the file system decide which files to create a snapshot scene depending on the application, control snapshots use of space, reduce the space occupied by read-only snapshot of the file system.

Description

一种存储数据的保护方法及装置 Protection method and apparatus for storing data

技术领域 FIELD

[0001]本发明涉及网络连接存储领域,特别涉及一种存储数据的保护方法及装置。 [0001] The present invention relates to a network-attached storage, and more particularly relates to a protection method and apparatus for storing data.

背景技术 Background technique

[0002]在NAS(Network Attached Storage,网络连接存储)领域,对FS(File System,文件系统)整体创建采用ROW(Redirect-on-write,写时重定向)技术的ROW只读快照是实现存储数据保护的主流技术。 [0002] In the NAS (Network Attached Storage, Network Attached Storage) area of ​​FS (File System, the file system) as a whole created using ROW (Redirect-on-write, write redirection) ROW read-only snapshot technology to achieve storage mainstream technology for data protection. FS的ROW只读快照直接保护FS的写前数据块,S卩ROW只读快照将占用分配给FS的可用空间。 FS, FS direct protection ROW read-only snapshot of the data blocks before writing, S Jie ROW read-only snapshot will take up available space allocated to FS. 目前对FS创建ROW只读快照的技术都是针对FS整体,当对FS频繁修改后,ROW只读快照会占据FS大量空间。 ROW is currently read-only snapshot technology to create the FS are for the whole FS, when frequent changes to the FS, FS ROW read-only snapshot will occupy a lot of space. 例如一个总可用空间为1 OMB的FS,写入一个17.94MB的文件I,创建一个ROW只读快照,然后覆盖写入前面的文件I,如此反复4次,ROW只读快照累积独占空间将达到53.89MB,而原FS的可用空间降到28.1MB。 For example, a total available space for 1 OMB's FS, I write a 17.94MB file, creating a read-only snapshot ROW, and then overwrite the previous file I, so repeated four times, ROW read-only snapshot space will reach a cumulative exclusive 53.89MB, and the original FS available space down to 28.1MB. 当再向该FS写入一个37MB的文件时,就会出现FS空间不足、不能写入的错误。 When writing a 37MB file again in the FS, FS insufficient space, errors can not be written will appear. 因此需要一种存储数据的保护方法,以解决ROW只读快照占用源文件系统过多空间的缺陷。 Hence the need to protect a method of storing data, in order to address the deficiencies ROW too much space occupied by the source file system read-only snapshot.

[0003]现有技术提出了几种降低只读快照占用空间的存储数据的保护方法:方法一、配置FS ROW只读快照预留,但ROW只读快照空间可超这个预留;方法二、配置FS自动扩容;方法三、配置FS自动删除ROW只读快照。 [0003] The prior art proposes several methods of reducing protected space read-only snapshot of the stored data: a method configured to reserve the FS ROW read-only snapshot, but read-only snapshot ROW over this space reservation; Method II. (FS) automatic expansion; method three, FS configuration automatically deleted ROW read-only snapshot.

[0004] 现有技术至少存在以下问题: [0004] The prior art has at least the following problems:

[0005] ROW只读快照占用大量FS可用空间,导致FS不可用,直接影响位于关键路径的FS的重要业务;针对上述问题的措施,不能从根本上解决ROW只读快照大量占用FS可用空间的问题。 [0005] ROW read-only snapshot take up a lot of free space FS, FS lead to unusable, located directly affect the important business of FS critical path; measures against the above problem, not solve ROW read-only snapshot of available space FS-intensive fundamentally problem.

发明内容 SUMMARY

[0006]本发明提供了一种存储数据的保护方法及装置,技术方案如下。 [0006] The present invention provides a protection method and apparatus for storing data, the following technical solution.

[0007]第一方面,提供了存储数据的保护方法,所述方法包括:接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性;根据所述属性设置指令设置所述文件的文件快照级别属性;接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数;根据所述快照创建指令为所述文件系统创建ROW只读快照,所述ROW只读快照的只读快照级别属性根据所述文件快照级别属性参数设置;在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 [0007] In a first aspect, there is provided a method of storing data protection, the method comprising: receiving a command property, the property instruction request snapshot files in the file system level property file; settings according to the attribute setting instruction snapshot file level attributes of said file; receiving a snapshot creation instruction to create a snapshot file snapshot level attribute parameters required to carry the protected file command; ROW create read-only snapshot of the snapshot creation instruction according to the file system, the ROW read-only snapshot of the read-only snapshot according to the file attribute-level snapshot parameter level attribute set; when changes to the specified file, determine whether the specified file attributes ROW level of snapshots created read-only snapshot of the read-only snapshot level attributes match, and the match ROW specified file when the read-only snapshot has been created according to pre-write protection.

[0008]结合第一方面,在第一方面的第一种可能的实现方式中,根据所述快照创建指令为所述文件系统创建只读快照,包括:通过与所述文件系统共享根的方式创建所述ROW只读快照;根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性;根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 [0008] with the first aspect, the first possible implementation manner of the first aspect, the read-only snapshot of the file system is created according to the snapshot creation instruction, comprising: a shared file system root of the manner creating the ROW read-only snapshot; snapshot file according to the ROW-level read-only attribute is set to the read-only snapshot of the snapshot level attribute; settings system snapshot of the file system in accordance with the read-only snapshot level attribute level attribute.

[0009]结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述系统快照级别属性包括快照级别-逻辑时间点对的集合,其中所述快照级别表示所述ROW只读快照保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点;所述只读快照级别属性包括快照级另U-逻辑时间点对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 [0009] with the first aspect or the first possible implementation of the first aspect, a second possible implementation manner of the first aspect, the system comprises a snapshot snapshot level attribute level - a set of logical point wherein said level indicates the level of snapshots, the snapshot ROW read-only snapshot of the protected file, the logical point represents a point in time to create a logical read-only snapshot of the ROW; read-only snapshot of the snapshot level attribute comprises another level U - a collection of logical time point, wherein the level represents a snapshot of a snapshot of the level of protection required documents, the logical point means creating a logical point of time read-only snapshot of the ROW.

[0010]结合第一方面,在第一方面的第三种可能的实现方式中,所述快照创建指令还携带快照名称;所述根据所述快照创建指令为所述文件系统创建只读快照之后,还包括:根据所述快照名称命名所述ROW只读快照。 After the snapshot creation instruction according to the read-only snapshot of the file system is created; [0010] with the first aspect, in a first aspect a third possible implementation, the snapshot creation instruction further carries snapshot name further comprising: a name based on the read-only snapshot of the snapshot ROW name.

[0011]结合第一方面的第二种可能的实现方式,在第一方面的第四种可能的实现方式中,所述根据所述快照创建指令为所述文件系统创建只读快照之后,还包括:接收访问所述ROW只读快照的请求;输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性的快照级别的值相等的文件。 The second [0011] connection with the first aspect possible implementation manner, a fourth possible implementation manner of the first aspect, the snapshot creation instruction according to the following read-only snapshot of the file system is created, also comprising: receiving an access request of the read-only snapshot ROW; equal levels of the output file snapshot of the snapshot level attribute read-only snapshot of the ROW level attribute value of the read-only snapshot file.

[0012]结合第一方面的第二种可能的实现方式,在第一方面的第五种可能的实现方式中,所述在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护,包括:接收所述指定文件的修改数据;根据所述修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置;判断已创建的所述文件系统的只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的只读快照;若存在,保留所述指定文件修改前的旧数据,并将所述ROW只读快照的根指向所述指定文件的旧数据;否则,删除所述指定文件修改前的旧数据。 The second [0012] connection with the first aspect possible implementation manner, a fifth possible implementation manner of the first aspect, when the specified file to modify, determine whether the specified file attribute-level snapshot ROW has been created with the read-only snapshot of the read-only snapshot level attributes match, and read-only snapshot of the specified file before the write protection according to the ROW have been created in matching, comprising: receiving the modification of the specified file transactions; save new data according to the modification of the data of the specified file to the specified data file is modified, and writes to the new disk location; read-only snapshot of the file system has been created in the determination whether there equal to the value read-only snapshot of the snapshot file level attribute read-only snapshot of a snapshot of the level of the level attribute specified file; if present, to retain the old data before the modification of the specified file, and the read-only snapshot ROW root points to the old data specified file; otherwise, delete the old data before the specified file modifications.

[0013]第二方面,提供了 一种存储数据的保护装置,所述装置包括:接收单元,用于接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性,,以及用于接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数;设置单元,用于根据所述接收单元接收的属性设置指令设置所述文件的文件快照级别属性;快照创建单元,用于根据所述接收单元接收的快照创建指令为所述文件系统创建只读快照,根据所述文件快照级别属性参数设置所述ROW只读快照的只读快照级别属性;文件保护单元,用于在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 [0013] In a second aspect, there is provided protection apparatus for storing data, the apparatus comprising: receiving means for receiving attribute setting instruction, the property instruction request snapshot file system file-level property file ,, and means for receiving a snapshot creation instruction to create a snapshot file snapshot level attribute parameters required to carry the protected file command; setting unit for setting the attribute of the file according to the setting instruction receiving unit receives the snapshot file-level properties ; snapshot creation unit for creating an instruction received by the receiving unit is a snapshot of the file system to create read-only snapshot, the snapshot file according to the parameter level attribute read-only snapshot of the read-only snapshot ROW level attribute; file protection unit, when used to modify a specified file, determine whether the specified file attributes ROW level of snapshots created read-only snapshot of the read-only snapshot level attributes match, and based on the created when matched ROW read-only snapshot of the specified file before the write protection.

[0014]结合第二方面,在第二方面的第一种可能的实现方式中,所述快照创建单元包括:创建模块,用于通过与所述文件系统共享根的方式创建所述ROW只读快照;设置模块,用于在所述创建模块创建所述ROW只读快照之后,根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性,以及根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 [0014] combination with the second aspect, the first possible implementation of the second aspect, said snapshot creation unit comprises: creating means for creating the ROW read-only shared by the file system root way snapshot; setting module, after the creation module for creating the ROW read-only snapshot, the snapshot level according to the file attribute is set to read-only snapshot of the read-only snapshot ROW level attribute level and in accordance with the read-only snapshot property system snapshot of the file system level attributes.

[0015]结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述记录模块,还用于将所述系统快照级别属性记录为包括快照级另Ij-逻辑时间点对的集合,其中所述快照级别表示所述ROW只读快照保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点;将所述只读快照级别属性记录为包括快照级别-逻辑时间点对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 [0015] The first possible implementation of the second aspect, the second aspect of the second possible implementation, the recording module, said system further configured to include a snapshot of a snapshot recording level attribute level set logic level snapshot of another IJ-time point, wherein the level represents a snapshot of the ROW read-only snapshot of the protected file, the logical point represents a point in time to create a logical read-only snapshot of the ROW; the level attribute record read-only snapshot of the snapshot level comprising - a collection of logical point pairs, wherein the level represents a snapshot of the snapshot files requiring protection level, the logical point represents a point in time to create a logical read-only snapshot of the ROW.

[0016]结合第二方面,在第二方面的第三种可能的实现方式中,所述接收单元,还用于接收携带快照名称的快照创建指令;所述创建模块,还用于根据所述接收单元接收的快照创建指令中携带的快照名称命名所述ROW只读快照。 [0016] combination with the second aspect, the second aspect of the third possible implementation manner, the receiving unit is further configured to receive a snapshot of carrying the name of the snapshot creation instruction; the creating module is further configured according to the the receiving unit receives the snapshot creation instruction carries snapshot named after the read-only snapshot ROW.

[0017]结合第二方面的第二种可能的实现方式,在第二方面的第四种可能的实现方式中,所述接收单元,还用于在所述快照创建单元创建所述ROW只读快照之后,接收所述用户访问所述ROW只读快照的请求;所述装置还包括:输出单元,用于根据所述接收单元接收的请求输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性中的快照级别的值相等的文件。 [0017] combination with the second possible implementation of the second aspect, a fourth possible implementation manner of the second aspect, the receiving unit is further configured to snapshot creation unit creates the read only the ROW after the snapshot, the user accesses the ROW receiving read-only snapshot request; said apparatus further comprising: an output unit for receiving the output value and the ROW snapshot file request receiving unit level attribute read-only snapshot equal to the value of the file-level snapshots of read-only snapshot level properties.

[0018]结合第二方面、第二方面的第一种、第二种、第三种或第四种可能的实现方式,在第二方面第五种可能的实现方式中,所述接收单元,还用于接收所述文件系统中指定文件的修改数据;所述装置还包括:修改模块,用于根据所述接收单元接收的修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置;判断模块,用于在所述修改模块将修改后的所述指定文件的新数据保存到新的磁盘位置之后,判断已创建的所述文件系统的只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的只读快照;根模块,用于在所述判断模块判断存只读快照级别属性与所述指定文件的文件快照级别属性相匹配的ROW只读快照时,将所述ROW只读快照的根指向所述指定文件的旧数据;删除模块,用 [0018] combination with the second aspect, the first, second, third or fourth possible implementation of the second aspect, in the fifth possible implementation of the second aspect, the receiving unit, the modification module for modifying the data file specified by the receiving unit receives the data modification, and the modification: the apparatus further comprises; further for receiving said modified data file specified in the file system save the new data to the new file specified disk location; determining module, configured to modify the file system after the new data file after the specified module save the changes to a new disk location, determination has been created equal to the value read-only snapshot of the snapshot file snapshot level attribute value and the level of the read-only snapshot of the specified file, if there are read-only snapshot level attribute; root module, the judging module determines that the read-only snapshot memory when the snapshot file level attributes of the specified file attribute level matches the read-only snapshot ROW, the ROW read-only snapshot of the data of the specified point to the old root file; deleting module, with 在所述判断模块判断不存只读快照级别属性与所述指定文件的文件快照级别属性相匹配的只读快照时,删除所述指定文件修改前的旧数据。 When the determination module determines that the read-only snapshot does not exist with the designated level attribute file matches the snapshot level attribute read-only snapshot delete the old data before the specified file modifications.

[0019]本发明实施例提供的技术方案可以通过增加文件的文件快照级别属性,对该文件快照级别属性进行设置,可以将不同的文件设置成不同的快照级别,同时在对系统文件创建ROW只读快照时指定该ROW只读快照需要保护的文件的快照级别,让ROW只读快照只保护那些需要保护的重要文件,能够有效降低ROW只读快照对FS空间的占用。 [0019] Technical solutions provided by the embodiments of the present invention, the snapshot file provided by increasing the level attribute file snapshot level attribute can be set different snapshot files into different levels, while creating only file system ROW the designated ROW read snapshot read-only snapshot of a snapshot of the level of protection required documents, let ROW read-only snapshot protects only those who need to protect important documents, can effectively reduce the ROW read-only snapshot of the FS occupied space.

附图说明 BRIEF DESCRIPTION

[0020]为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,还可以根据这些附图获得其他的附图。 [0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, as briefly described in the introduction to the accompanying drawings required for use in describing the embodiments. Apparently, the drawings in the following description are only some of the present invention. Example embodiments may also obtain other drawings based on these drawings.

[0021 ]图1是本发明实施例一提供的存储数据的保护方法流程图; [0021] FIG. 1 is a flowchart of the protection method of storing data according to a first embodiment of the present invention;

[0022]图2是本发明实施例二提供的存储数据的保护方法流程图; [0022] FIG 2 is a flowchart of the protection method of storing data according to a second embodiment of the present invention;

[0023]图3是本发明实施例二的fsl的文件的快照级别属性示意图; [0023] FIG. 3 is a schematic diagram of snapshot attribute file fsl level according to a second embodiment of the present invention;

[0024]图4是本发明实施例二为fsl创建指定快照级别的ROW只读快照示意图; [0024] FIG. 4 is a according to a second embodiment of the present invention is to create a specified snapshot fsl level schematic ROW read-only snapshot;

[0025]图5是本发明实施例二中修改不被快照保护的filel的示意图; [0025] FIG. 5 is a schematic diagram filel snapshots are not protected modified embodiment of the present invention in two embodiments;

[0026]图6是本发明实施例二中修改被快照保护的file2的示意图; [0026] FIG. 6 is a schematic diagram file2 are two snapshots of protected modified embodiment of the embodiment of the present invention;

[0027]图7是本发明实施例三提供的存储数据的保护方法流程图; [0027] FIG. 7 is a flowchart of the protection method of storing data according to a third embodiment of the present invention;

[0028]图8是本发明实施例三中创建多个只读快照的示意图; [0028] FIG. 8 is a schematic view of a plurality of read-only snapshot created according to a third embodiment of the present invention;

[0029]图9是本发明实施例四提供的一种存储数据的保护装置的结构示意图; [0029] FIG. 9 is a schematic diagram of the structure of a protection device for storing data according to a fourth embodiment of the present invention;

[0030]图10是本发明实施例五提供的一种存储数据的保护装置的结构示意图。 [0030] FIG. 10 is a schematic structure of a protection device for storing data according to a fifth embodiment of the present invention.

具体实施方式 detailed description

[0031]本发明的发明人在降低只读快照占用FS过多空间的研究过程中发现,在FS中并不是所有文件都值得用其只读快照保护起来,因此如果控制FS的只读快照选择性的保护FS中的重要文件,便可以解决只读快照大量占用FS可用空间的问题,进而让位于关键路径的FS业务尽量可用。 [0031] The present inventors have found that reducing the study read-only snapshot FS take up too much space, not all files are worth the read-only snapshot with its protected and therefore read-only snapshot selection If the control of FS in the FS FS in the protection of important files, you can solve the problem FS-intensive read-only snapshot of available space, thereby allowing the FS is located in the critical path of business as much as possible available.

[0032]为了实现对只读快照的保护对象进行控制,本发明对FS的所有文件(包括目录)增加一个属性:文件快照级别属性,该属性也可以由用户设置;为创建FS只读快照的指令增加一个选项:文件快照级别属性参数,创建的这个FS只读快照将只保护FS中设置了与该文件快照级别属性参数匹配的文件快照级别属性的文件,即该文件快照级别属性的值与该文件快照级别属性参数的值相同;为FS新增系统快照级别属性;为只读快照新增只读快照级别属性。 [0032] In order to achieve the object of the read-only snapshot protection control, all the files of the present invention, the FS (including directory) adding an attribute: snapshot of the file-level attribute, which may be provided by a user; to create a read-only snapshot of FS instructions add an option: the snapshot file level attributes parameters, create read-only snapshot of the FS will only protect the FS set up match with the file-level snapshot snapshot file attribute parameter level attribute file, that is the value of the property and file-level snapshots the same value of the parameter level attribute file snapshot; FS new system for the snapshot level attribute; read-only snapshot is a read-only snapshot new level attributes.

[0033]为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。 [0033] To make the objectives, technical solutions, and advantages of the present invention will become apparent in conjunction with the accompanying drawings of the following embodiments of the present invention will be described in further detail.

[0034] 实施例一 [0034] Example a

[0035]本实施例提供一种存储数据的保护方法,请参阅图1,方法流程包括: [0035] The present embodiment provides a method of storing data protection, see FIG. 1, flow of the method comprising:

[0036] 101、接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性; [0036] 101 receives the attribute setting command, setting the property instruction request is provided a file system file-level snapshot of attributes;

[0037] 102、根据所述属性设置指令设置所述文件的文件快照级别属性; [0037] 102, the setting file according to the attribute setting instruction-level snapshot file attributes;

[0038] 103、接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数; [0038] 103, receiving the snapshot creation instruction, a snapshot of the snapshot creation file level attribute parameters required to carry the protected file command;

[0039] 104、根据所述快照创建指令为所述文件系统创建只读快照,所述ROW只读快照的只读快照级别属性根据所述文件快照级别属性参数设置; [0039] 104, read-only snapshot of the file system to create, read-only snapshot of the read-only snapshot ROW level attribute is set according to the file attribute-level snapshot of the snapshot creation instruction according to the parameter to;

[0040] 105、在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 [0040] 105, when changes are made to the specified file, determine whether the specified file attributes ROW level of snapshots created read-only snapshot of the read-only snapshot level attributes match, and when a match has been created in accordance with the ROW read-only snapshot of the specified file before the write protection.

[0041 ]具体的,所述的写前保护是指对所述指定文件修改前的数据进行映像或保留。 [0041] Specifically, prior to the write protection refers to the data before modification for the specified file or image retention.

[0042]进一步的,所述根据所述快照创建指令为所述文件系统创建只读快照,包括: [0042] Further, the read-only snapshot of the file system is created, comprising the snapshot creation instruction according to:

[0043]通过与所述文件系统共享根的方式创建所述ROW只读快照; [0043] The ROW creating read-only snapshot of the file system by sharing manner root;

[0044]根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性; [0044] Set the ROW read-only snapshot of the read-only snapshot level attribute according to the file attribute-level snapshot;

[0045]根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 [0045] The provided system snapshot of the file system in accordance with the read-only snapshot level attribute level attribute.

[0046]具体的,文件系统或只读快照的根是一个磁盘地址,通过这个地址,可以访问到文件系统或ROW只读快照的所有目录、文件数据;由于文件系统或只读快照的目录、文件都被抽象成一个个的Objects (对象),所有这些Objects组成文件系统或只读快照的Objset (对象集),Objset以树的形式组织,树有一个013」86丨1?001:(树根)地址,通过这个013」86丨Root可以访问到文件系统/只读快照的所有Objects,所以文件系统或只读快照根又叫ObjsetRoot0 [0046] Specifically, the root file system is a snapshot, or read-only disk address, by the address, to access all directories, files or system data file read-only snapshot of the ROW; because the directory read-only snapshot of a file system or, files are abstracted into a number of objects (objects), all of which make up objects or read-only file system snapshot Objset (set of objects), Objset organized in a tree, the tree has a 013 "86 Shu 1? 001 trees :( root) address, you can access the file system through the 013 "86 Shu root / read-only snapshot of all Objects, so the file system or read-only snapshot root called ObjsetRoot0

[0047]通过与所述文件系统共享根的方式创建所述ROW只读快照,是指创建ROW只读快照时,将ROW只读快照的根指向文件系统的根。 [0047] By creating the ROW shared read-only snapshot of the file system root mode, it means when the read-only snapshot created ROW, the ROW read-only snapshot root to the root of the file system. 在ROW只读快照创建时,由于尚未对文件系统中的文件进行修改,而ROW只读快照直接保护FS的写前数据(即修改前的数据),因此,此时ROW只读快照的根指向文件系统的根。 When ROW read-only snapshot creation, yet due to file system file is modified, and direct protection ROW read-only snapshot data before writing the FS (ie data before modification), therefore, at this time point ROW read-only snapshot root root file system.

[0048]进一步的,所述系统快照级别属性及所述只读快照级别属性包括[快照级别-逻辑时间点]对的集合,其中所述快照级别表示所述ROW只读快照保护的文件的快照级别,逻辑时间点表示创建所述ROW只读快照的逻辑时间点; A set of snapshots, wherein said level indicates the ROW snapshot read-only snapshot of the protected file - [0048] Further, the system and the snapshot level attribute read-only snapshot of the level attribute comprising [time snapshots logic level] level, logical point represents a point in time to create a logical read-only snapshot of the ROW;

[0049]所述只读快照级别属性包括[快照级别-逻辑时间点]对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 [0049] The read-only snapshot level attribute comprising [Snapshot Level - logical point] of the set, wherein the snapshot of the snapshot level indicates the level of protection required files, create a logical point represents read-only snapshot of the ROW the logical point in time.

[0050]进一步的,所述快照创建指令还携带快照名称; [0050] Further, the snapshot creation instruction further carries the name of the snapshot;

[0051]所述根据所述快照创建指令为所述文件系统创建只读快照之后,还包括: After [0051] the basis of the snapshot creation instruction to create read-only snapshot of the file system, further comprising:

[0052]根据所述快照名称命名所述ROW只读快照。 [0052] The naming of the ROW read-only snapshot of the snapshot name.

[0053]进一步的,所述根据所述快照创建指令为所述文件系统创建只读快照之后,还包括: After [0053] Further, the read-only snapshot of the file system is created according to the snapshot creation instruction, further comprising:

[0054]接收访问所述ROW只读快照的请求; [0054] receiving an access request to the read-only snapshot ROW;

[0055]输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性的快照级别的值相等的文件。 [0055] snapshot file level value equal to the value of the snapshot file ROW output level attribute read-only snapshot of the read-only snapshot level attribute.

[0056]进一步的,所述在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护,包括: [0056] Further, when the specified file to modify, determine whether the specified file and the snapshot level attribute ROW created read-only snapshot of the read-only snapshot level attributes match, and when a match according to the ROW read-only snapshot has been created for the specified file before the write protection, including:

[0057]接收所述文件系统中指定文件的修改数据; [0057] receiving the modified data file specified in the file system;

[0058]判断已创建的所述文件系统的只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的只读快照; Equal to the value of the read-only snapshot read-only snapshot of the file system [0058] Analyzing the created, whether there is a read-only snapshot of the snapshot file level attribute level attribute value and the level snapshot of the specified file;

[0059]若存在,保留所述指定文件修改前的旧数据,并将所述ROW只读快照的根指向所述指定文件的旧数据;否则,删除所述指定文件修改前的旧数据。 [0059] If present, the old data before the specified file modification, and the ROW read-only snapshot of the specified point to the root of the old file data; otherwise, delete the old data before the specified file modification.

[0060]本实施例提供的存储数据的保护方法,通过增加文件的文件快照级别属性,对该文件快照级别属性进行设置,可以将不同的文件设置成不同的快照级别,同时在对系统文件创建ROW只读快照时指定该ROW只读快照需要保护的文件的快照级别,从而让ROW只读快照只保护那些需要保护的重要文件,也可让用户参与到ROW只读快照的控制,由用户根据应用场景去决定该为FS的哪些文件创建快照,尽可能控制快照的使用空间,降低ROW只读快照占用的FS的空间,使位于关键路径的FS尽可能可用,提升产品的竞争力。 [0060] The present method for protecting stored data according to the embodiment, by increasing the level attribute file snapshot, the snapshot of the file-level properties are set, different files may be set to a different level of snapshots, creation of the system while the file when the designated ROW ROW read-only snapshot read-only snapshot of a snapshot of the level of protection required documents, so that ROW read-only snapshot protects only those who need to protect important documents, but also allows users to participate in the ROW read-only snapshot of control, according to the user scenarios to decide which files to create a snapshot of FS, control the use of space as a snapshot, reducing the space occupied by the FS ROW read-only snapshot of the FS is located in the critical path as possible available to enhance the competitiveness of their products.

[0061 ] 实施例二 [0061] Second Embodiment

[0062]本实施例提供一种存储数据的保护方法,该方法以ROW只读快照为例进行说明。 Protection Method [0062] The present embodiment provides a data storage, read-only snapshot of the ROW method as an example. 请参阅图2,方法流程包括: Refer to Figure 2, the flow of the method include:

[0063 ] 201、接收用户输入的请求将fs I中的文件2 (fi I e 2 )的文件快照级别属性的值设置为I的属性设置指令。 [0063] 201, receiving user input requesting the value FS file I 2 (fi I ​​e 2) of the snapshot file is I level attribute property setting instruction.

[0064] 具体的,fsl中的文件l(filel)、file2均设有文件快照级别属性:sanpLevel。 [0064] Specifically, fsl file l (filel), file2 has snapshot file level attributes: sanpLevel.

[0065] sanpLevel:文件的快照级别,默认为未设置(none)。 [0065] sanpLevel: Snapshot level file, the default is not set (none).

[0066] 202、根据该属性设置指令将file2的文件快照级别属性的值设置为I。 [0066] 202, in accordance with the instruction value of the property of the snapshot file file2 level attribute is I.

[0067]具体的,根据该属性设置指令完成对file2的文件快照级别属性的设置之后,fsl的文件的快照级别属性示意图,请参阅图3。 After [0067] Specifically, the complete set of snapshot files file2 level attribute according to the attribute set command, the snapshot level schematic fsl file attribute, see Figure 3.

[0068]文件系统f s I设有四个与ROW只读快照相关的属性: [0068] f s I with the file system attributes associated with four read-only snapshot of the ROW:

[0069] prevSnap(前一决照):指向FS的前一个ROW只读快照; [0069] prevSnap (according to the previous decision): point FS previous ROW read-only snapshot;

[°07°] nextSnap(下一1决照):指向FS的下一个ROW只读快照; [° 07 °] nextSnap (next decision as 1): FS points to the next read-only snapshot ROW;

[0071 ] snapLevels系统快照级别:包含一个[key-value]对即[快照级别-逻辑时间点]对的集合,key为只读快照要保护的文件的快照级别,value为创建只读快照的逻辑时间点,未创建ROW只读快照时默认为[none]; [0071] snapLevels system snapshot level: comprising a [key-value] of i.e. [Snapshot Level - logical point] snapshot of the level set, key read-only snapshot of the file to be protected, value for creating read-only snapshot logic The default time point, ROW read-only snapshot was not created for the [none];

[0072] FS Root(FS的根):指向fsl所有文件数据的根。 [0072] FS Root (the root FS): fsl all pointing to the root of the file data.

[0073]由于用户选择将file2的文件快照级别属性的值设置为I,因此本步骤完成用户的属性设置指令之后fiIe2的SanpLevel=I,f ilel的sanpLevel=none。 [0073] Since the user selects the value of the snapshot file file2 level attribute is I, so this step is completed after fiIe2 user attribute setting command SanpLevel = I, f ilel the sanpLevel = none.

[0074] 203、接收用户输入的为fs I创建名称为snap I的只保护sanpLe ve I的值设置为I的文件的快照创建指令。 [0074] 203, create a name for SNAP I protect only the value of sanpLe ve I I for the snapshot creation instruction file receiving user input to fs I.

[0075]具体的,该快照创建指令可采用如下格式: [0075] Specifically, the snapshot creation instruction may take the following format:

[0076] Snapshot create fslsnapIsnapLeve1=1 [0076] Snapshot create fslsnapIsnapLeve1 = 1

[0077] 具体的,Snapshot create:表示创建快照; [0077] Specifically, Snapshot create: create a snapshot representation;

[0078] fsl:表示给文件系统fsl创建快照; [0078] fsl: fsl representation to the file system to create a snapshot;

[0079] snap 1:表示快照的名字是snap I ; [0079] snap 1: represents the name of the snapshot that snap I;

[0080] SnapLevel=1:表示只给文件系统中设置了级别为I的文件创建快照,即只保护文件快照级别属性值为I的文件。 [0080] SnapLevel = 1: indicates the file system is provided only to the level I create a snapshot file, that is, only the snapshot file level protection attribute value of I.

[0081 ] 204、根据该快照创建指令创建名为snapl的ROW只读快照。 [0081] 204, create command to create a read-only snapshot of ROW named snapl according to the snapshot.

[0082]具体的,本步骤创建名为snapl的ROW只读快照,并使该快照共享文件系统的根。 [0082] Specifically, the present step called snapl create read-only snapshot of the ROW, and the root of the shared file system snapshot. 为fsl创建指定快照级别的ROW只读快照示意图,请参阅图4。 Create a snapshot of the specified level of read-only snapshot fsl ROW schematic, see Figure 4.

[0083] 创建完成后,fsl及snapl的相关属性设置如下: [0083] Once created, the relevant property is set fsl and snapl as follows:

[0084] fsl的snapLevels设置了一个key-value对:“1-10”,表示文件系统fsl在逻辑时间点为10的时候创建了一个只保护文件快照级别属性值为I的文件(即表示创建了一个快照级别为I的ROW只读快照); [0084] The snapLevels fsl provided a key-value pairs: "1-10", fsl is the file system when a file 10 creates a snapshot file only protection level attribute value I is in a logical point of time (i.e., represents the creation a snapshot of the level I ROW read-only snapshot);

[0085] snapl的snapLevels设置了一个key-value对:“1-10”,表示创建该snapl的逻辑时间点为10,其只保护逻辑时间点10之前的,文件快照级别属性值为I的文件。 [0085] snapl of snapLevels provided a key-value pairs: "1 to 10" indicating the snapl create logical point of 10, which protects only, the file I snapshot file level attribute value before logical point 10 .

[0086] fsl的prevSnap指向快照snapl ; sanpl的nextSnap指向fsl ; [0086] fsl the snapshot point prevSnap snapl; sanpl nextSnap point of FSL;

[0087] sanpl的Snap Root快照的根直接共享文件系统fsl的根:FS Root。 [0087] Snap Root root snapshot sanpl directly shared root file system fsl of: FS Root.

[0088] 具体的,如果此时收到用户访问snap I的请求,将过滤掉与sanp I的snapLeve I s的不匹配的文件,而输出与所述ROW只读快照的快照级别匹配的文件,S卩ROW只读快照只输出snapLeve I的值与自身的snapLeve I s的快照级别key的取值相同的文件。 [0088] Specifically, if the request is received at this time the user visits snap I will be filtered out of the file does not match the sanp I snapLeve I s, and the output of the read-only snapshot of the snapshot ROW level matching files, Jie ROW value S output snapLeve I only read-only snapshot with the snapshot level key value itself snapLeve I s of the same file.

[0089] 205、接收对filel进行修改的修改数据; [0089] 205, receiving the modification data to modify filel;

[0090] 206、根据该修改数据修改filel的数据,将修改后的filel的新数据保存到新的磁盘位置; [0090] 206, modify the data based on the modified data filel, save the new data to the modified filel new disk location;

[0091 ] 207、判断snapl 的snapLevels与filel 的snapLevel与不匹配,删除filel 的旧数据。 [0091] 207, the judgment snapl snapLevels and filel of snapLevel does not match, delete the old data filel.

[0092] 具体的,判断snap I的snapLeveIs与fi I e I的snapLevel是否匹配,主要根据snapLevel的值与snapLevels的key的值是否相等,若相等则判断两者匹配,否则判断两者不匹配。 [0092] Specifically, the determination of snapLevel snapLeveIs snap I fi I e I and matches, based primarily on the value of key values ​​of snapLevel snapLevels are equal, it is determined if both are equal match or mismatch is determined both. 本实施例中filel的snapLe ve I值为none,snap I的snapLeve I s的key值为I,两者不匹配。 snapLe ve filel in Example I of the present embodiment is none, snapLeve I s is the value of key SNAP I I, it does not match.

[0093]具体的,修改不被快照保护的filel的示意图,请参阅图5,图中“X”表示数据被删除。 [0093] Specifically, the modification is not protected filel schematic snapshots, see FIG. 5, FIG. "X" represents the data is deleted. 修改filel之后,遵循ROW原则,filel的新数据总是写到新的磁盘位置;而filel的旧数据因为filel的snapLevel=none而不被snapl保护,将被直接删除;此时fsl的根指向f ilel的新数据及fi I e2的数据,而snap I的根则指向fi I e2的数据。 After modifying filel, follow the principle of ROW, filel new data is always written to the new disk location; and filel old data because filel of snapLevel = none without being snapl protection, will be deleted; fsl root at this time point f ilel new data and data fi I e2, and fi I e2 data points to the root of the snap I. 本步骤中,fi I e I的旧数据被删除,将不再占用文件系统fsl的可用空间,从而降低了ROW只读快照对源FS可用空间的占用。 In this step, the old data fi I e I is deleted, the file system does not occupy the space available fsl, thereby reducing the occupancy of the read-only snapshot ROW source FS available space.

[0094] 208、接收对file2进行修改的修改数据; [0094] 208, receiving the modification data to modify file2;

[0095] 209、根据该修改数据修改file2的数据,将修改后的file2的新数据保存到新的磁盘位置; [0095] 209, modify the data based on the modified data file2, file2 saving new data after writes to the new disk location;

[0096] 210、判断snapl 的snapLeve Isl与file2 的snapLeve匹配,保留file2 的旧数据。 [0096] 210, and determines snapLeve Isl file2 snapl of snapLeve matching, retention file2 old data.

[0097]具体的,修改被快照保护的f ile2的示意图,请参阅图6。 [0097] Specifically, a schematic diagram is a snapshot f ile2 protected modified, see Figure 6. 遵循ROW原则,f ile2的新数据总是写到新的磁盘位置;而fi I e2的旧数据因为fi I e2的snapLeve I=I而被snap I保护,不会被删除。 Follow ROW principle, f ile2 new data is always written to the new disk location; and fi I e2 old data because fi I e2 of snapLeve I = I snap I have been protected will not be deleted. 此时,fsl的根指向f ilel的新数据与fi I e2的新数据,而snap I的根则指向file2的旧数据。 In this case, point to the new root FSL f ilel data with new data fi I e2, which points to the root of the snap I file2 the old data.

[0098]具体的,本实施例的执行主体可以是存储管理系统。 [0098] Specifically, the execution subject of the present embodiment may be a storage management system.

[0099]本实施例提供的存储数据的保护方法,为文件系统中的文件增加了文件快照级别属性,由用户通过对文件快照级别属性进行设置,将不同的文件设置成不同的快照级别,同时用户可以在对系统文件创建ROW只读快照时指定需要保护的文件的快照级别,当对文件进行修改后,根据是否存在只读快照级别属性与被修改的文件的文件快照级别属性匹配的ROW只读快照确定是否对该文件进行快照保护,如果存在则保留该文件修改前的旧数据,否则删除该文件修改前的旧数据,从而让用户参与到ROW只读快照的控制,由用户根据应用场景去决定该为FS的哪些文件创建快照,尽可能控制快照的使用空间,降低只读快照占用的FS的空间,使位于关键路径的FS尽可能可用,提升产品的竞争力。 [0099] The present method for protecting stored data according to an embodiment, the file system in a file that a file snapshot level attribute file snapshot level attributes set by the user, the setting of different files into different snapshots levels while the user can specify the need to protect files when creating ROW read-only snapshot of the file system level snapshots, when the file changes, according to a snapshot of the existence of the file read-only snapshot of the file level attributes are modified in the level properties only match ROW read snapshot determine whether the file is a snapshot of protection, if there is old data before modifying the file is retained, or delete the old data before the file is modified to allow users to participate in read-only snapshot ROW controlled by the user depending on the application scenario to decide which files to create a snapshot of the FS is possible to control the use of space snapshot, reducing the space occupied by the read-only snapshot of FS, FS is located in the critical path as possible available to enhance the competitiveness of their products.

[0100] 实施例三 [0100] Example three

[0101]本实施例提供了一种存储数据的保护方法。 [0101] The present embodiment provides a method of storing data protection. 本实施例中文件系统fsl包含多个文件,文件名依次为filel、file2"_fi le6,该多个文件的文件快照级别属性默认为snapLevel=none。请参阅图7,方法流程包括: The file system of the present embodiment comprises a plurality of fsl file, the file name followed filel, file2 "_fi le6, the plurality of the file attribute-level snapshot file default snapLevel = none see Figure 7, flow of the method comprising:

[0102] 701、接收用户输入的将文件系统fsl中的文件file2、file5的文件快照级别属性的值设置为I的属性设置指令。 [0102] 701, the file system file file2 fsl receiving user input, the values ​​of the snapshot file provided file5 level attribute is an attribute setting instruction I.

[0103] 702、根据该属性设置指令将file2、file5的文件快照级别属性设置为snapLvel = [0103] 702, in accordance with the property setting instruction file2, file5 snapshot file attribute is set to level snapLvel =

1 1

[0104] 703、接收用户输入的携带SnapLevel = I的快照创建指令,该快照创建指令要求创建一个快照级别为I,名称为sanpl的ROW只读快照。 [0104] 703, receiving user input SnapLevel = I carries a snapshot creation instruction, the snapshot creation instruction to create a snapshot of the level required for the I, entitled ROW sanpl the read-only snapshot.

[0105] 704、在逻辑时间点为1时,创建名为snap I的快照级别为I的ROW只读快照。 [0105] 704, 1, to create a level snapshot is called snap I I ROW read-only snapshot of a logical point of time.

[0106] 705、接收用户输入的将文件系统fsl中的文件file3、file4的文件快照级别属性的值设置为2的属性设置指令。 [0106] 705, the file system receiving user input fsl file file3, set the value of the snapshot file file4 level attribute to the attribute setting instruction 2. [0Ί07] 706、根据该属性设置指令将file3、fi le4的文件快照级别属性设置为snapLevel =2。 [0Ί07] 706, in accordance with the property setting instruction file3, fi le4 snapshot file attribute is set to level snapLevel = 2.

[0108] 707、接收用户输入的携带snapLevel=2的快照创建指令,该快照创建指令要求创建一个快照级别为2,名称为sanp2的快照。 [0108] 707, receiving user input 2 carries snapLevel = snapshot creation instruction, the snapshot creation instruction to create a snapshot in claim 2 level, entitled sanp2 snapshot.

[0109] 708、在逻辑时间点为20时,创建名为snap2的快照级别为2的ROW只读快照。 [0109] 708, to create a level snapshot is named snap2 2 ROW read-only snapshot of the logical point in time is 20:00.

[0110]具体的,请参阅图7,创建完成后,fsl的系统快照级别属性snapLevels记录为:[1-10,2-20],表示在逻辑时间点为10的时候创建了一个快照级别为I的Row只读快照,在逻辑时间点为20的时候创建了一个快照级别为2的Row只读快照;snapl的只读快照级别属性snaLevels记录为:[1-10],表示该只读快照的只保护快照级别为I的文件,其保护逻辑时间点10之前的数据;snap2的只读快照级别属性snapLevels记录为:[2_20],表示该只读快照的只保护快照级别为2的文件,其保护逻辑时间点20之前的数据。 [0110] Specifically, see Figure 7, is created, the system records the snapshot level attribute snapLevels fsl as: [1-10,2-20], represents a logical point of time when 10 creates a snapshot level Row I is a read-only snapshot of the logical point of time when 20 creates a snapshot of the level of Row 2 read-only snapshot; read-only snapshot record level attribute snaLevels snapl as: [1-10], which represents a read-only snapshot protect only a snapshot of a file level I, which protection logic 10 before time point data; read-only snapshot of the level attribute as snap2 snapLevels recorded as: [2_20], indicating that the read-only snapshot of the snapshot level file protection only 2, which point protection logic 20 prior to the time data. sanpl、sanp2与fsl共享根。 sanpl, sanp2 and fsl shared roots. 而,文件系统fsl的文件filel、file6由于其文件快照级别为none,将不被任何ROW只读快照保护。 The file system fsl file filel, file6 because of its file-level snapshots to none, will not be read-only snapshot protection of any ROW.

[0111]具体的,对snapl、snap2的访问及修改fsl的文件时,对各文件的处理方法与前述实施例相同此处不再赘述。 [0111] Specifically, for snapl, when snap2 access and modify files fsl, embodiment here is the same embodiment of the processing method of the files with the omitted.

[0112]本实施例提供的存储数据的保护方法,为文件系统中的文件增加了文件快照级别属性,由用户通过对文件快照级别属性进行设置,将不同的文件设置成不同的快照级别,同时用户可以在对系统文件创建只读快照时指定需要保护的文件的快照级别,因此在对文件系统的文件进行修改时,ROW只读快照只保护用户指定的文件,对于未指定的文件将不进行ROW只读快照保护,能够有效地节省文件系统的空间。 [0112] The present method for protecting stored data according to the embodiment, that a file snapshot level attributes for the file in the file system, by the user through the file snapshot level attribute set, set different files into different snapshots levels while the user can specify the need to protect the file when you create a read-only snapshot of the file system level snapshots, so when the file system is modified, ROW read-only snapshot protects only the user-specified file, for unspecified file will not be ROW read-only snapshot protection, can effectively save space in the file system.

[0113]实施例四 [0113] Fourth Embodiment

[0114]参见图9,本实施例提供了一种存储数据的保护装置,该装置包括: [0114] Referring to Figure 9, the present embodiment provides a protection device for storing data, the apparatus comprising:

[0115]接收单元901,用于属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性; [0115] The receiving unit 901, an attribute setting instruction, the property instruction request is provided a file system file-level snapshot of attributes;

[0116]设置单元902,用于根据所述接收单元901接收的属性设置指令设置所述文件的文件快照级别属性; [0116] setting unit 902 for setting the file attribute setting unit 901 according to an instruction received by the receiving level of the snapshot file attributes;

[0117]所述接收单元901,还用于接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数; [0117] The receiving unit 901 is further configured to receive a snapshot creation command, a snapshot of the snapshot creation file level attribute parameters required to carry the protected file command;

[0118]快照创建单元903,用于根据所述接收单元901接收的快照创建指令为所述文件系统创建指定快照级别的ROW只读快照,根据所述文件快照级别属性参数设置所述ROW只读快照的只读快照级别属性; [0118] snapshot creation unit 903 for creating an instruction by the receiving unit 901 receives the snapshot of the file system to create the specified ROW read-only snapshot of the snapshot level, according to the file read-only snapshot of the parameter level attribute ROW read-only snapshot level attribute snapshot;

[0119]文件保护单元904,用于在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 [0119] file protection unit 904, when changes for the specified file, determine whether the specified file attributes ROW level of snapshots created read-only snapshot of the read-only snapshot level attributes match, a match and in accordance with read-only snapshot of the ROW have been created to protect the specified file before writing.

进一步的,所述快照创建单元903包括: Further, the snapshot creation unit 903 comprises:

[0121]创建模块,用于通过与所述文件系统共享根的方式创建所述ROW只读快照; [0121] creation module for creating the ROW read-only snapshot of the file system by sharing manner root;

[0122]设置模块,用于在所述创建模块创建所述ROW只读快照之后,根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性,以及根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 [0122] module is provided, after the creation module for creating the ROW read-only snapshot, the snapshot level according to the file attribute is set to read-only snapshot of the read-only snapshot ROW level attribute, and based on the read-only snapshot level attribute property system snapshot of the file system level.

[0123]进一步的,所述记录模块,还用于将所述系统快照级别属性记录为包括[快照级另IJ-逻辑时间点]对的集合,其中所述快照级别表示创建的所述ROW只读快照保护的文件的快照级别的快照级别,逻辑时间点表示创建所述ROW只读快照的逻辑时间点;将所述只读快照级别属性记录为包括[快照级别-逻辑时间点]对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 [0123] Further, the recording module, said system further configured to record to the snapshot level attribute comprising [snapshot another IJ-level logical point] of the set, wherein the level represents the creation of the snapshot only the ROW snapshot of the snapshot read level snapshot of the file level protection, logical point represents a point in time to create a logical read-only snapshot of the ROW; the attribute is recorded as read-only snapshot level comprises [snapshot level - logical point] of the set of wherein the level of snapshots, expressed the need for protection of file-level snapshot of a logical point means creating a logical point of time read-only snapshot of the ROW.

[0124]进一步的,所述接收单元901,还用于接收携带快照名称的快照创建指令; [0124] Further, the receiving unit 901 is further configured to receive the data carried in the name of the snapshot creation instruction snapshot;

[0125]所述创建模块,还用于根据所述接收单元901接收的快照创建指令中携带的快照名称命名所述ROW只读快照。 [0125] The creation module is further configured to create a snapshot instruction carries named after the read-only snapshot ROW The receiving unit 901 receives the snapshot.

[0126] 进一步的,所述接收单元901,还用于在所述快照创建单元创建所述ROW只读快照之后,接收访问所述ROW只读快照的请求; [0126] Further, the receiving unit 901 is further configured to create a snapshot in the ROW unit creates the snapshot request to read-only, read-only snapshot receive an access of the ROW;

[0127] 所述装置还包括: The [0127] apparatus further comprising:

[0128]输出单元,用于输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性中的快照级别的值相等的文件。 [0128] The output unit, the same value for the output level of the snapshot file snapshot file level attribute value and the read-only snapshot of the read-only snapshot ROW level attribute.

[0129]进一步的,所述接收单元901,还用于接收所述文件系统中指定文件的修改数据; [0129] Further, the receiving unit 901 is further configured to receive the modified data file specified in the file system;

[0130] 所述装置还包括: [0130] The apparatus further comprises:

[0131]修改模块,用于根据所述接收单元901接收的修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置; [0131] modification means for modifying the data file specified by the receiving unit 901 receives the modification data, and save the new data to the specified file modified to a new disk location;

[0132]判断模块,用于在所述修改模块将修改后的所述指定文件的新数据保存到新的磁盘位置之后,判断已创建的所述文件系统的ROW只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的ROW只读快照; After the [0132] determination module, configured to save the new location in the disk file of the designated modifying module to modify the new data, the ROW read-only snapshot of the file system has been created is determined whether there is only ROW equal to the value of the read level attribute file snapshot snapshot snapshot level attribute value of the designated class file is read-only snapshot;

[0133]根模块,用于在所述判断模块判断存只读快照级别属性与所述指定文件的文件快照级别属性相匹配的ROW只读快照时,将所述ROW只读快照的根指向所述指定文件的旧数据; [0133] The root module, for determining when said read-only snapshot ROW-level snapshot file attribute read-only snapshot memory module determines the level of the specified file attribute matches, the read-only snapshot root ROW pointing said old data of the specified file;

[0134]删除模块,用于在所述判断模块判断不存只读快照级别属性与所述指定文件的文件快照级别属性相匹配的ROW只读快照时,删除所述指定文件修改前的旧数据。 When [0134] deleting module configured to read-only snapshot ROW determining module determines that the read-only snapshot level attribute does not exist with the designated snapshot file level attributes match, deleting the old data before the modifications specified file .

[0135]本实施例存储数据的保护装置,通过增加文件的文件快照级别属性,对该文件快照级别属性进行设置,可以将不同的文件设置成不同的快照级别,同时在对系统文件创建ROW只读快照时指定该ROW只读快照需要保护的文件的快照级别,从而让ROW只读快照只保护那些需要保护的重要文件。 [0135] protection device according to the present embodiment stores the data, to the file attribute-level snapshot provided by increasing the level of the snapshot file attributes can be set different snapshot files into different levels, while creating only file system ROW Specifies the level of the ROW snapshot read snapshot read-only snapshot of the file to be protected, so that only read-only snapshot ROW protect important files that need to be protected. 在此基础上也可让用户参与到ROW只读快照的控制,由用户根据应用场景去决定该为FS的哪些文件创建快照,尽可能控制快照的使用空间,降低ROW只读快照占用的FS的空间,使位于关键路径的FS尽可能可用,提升产品的竞争力。 On this basis, also allows users to participate in read-only snapshot of the ROW control by the user depending on the application scenario to decide which files to create a snapshot of the FS is possible to control the use of space snapshots, reduce ROW read-only snapshot of occupied FS space, located in the critical path of the FS can be used as much as possible, to enhance the competitiveness of their products.

[0136] 实施例五 [0136] Embodiment V

[0137]请参阅图10,本实施例提供了一种存储数据的保护装置,该装置包括: [0137] Referring to FIG. 10, the present embodiment provides a protection device for storing data, the apparatus comprising:

[0138]接收机1001,用于接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性; [0138] The receiver 1001 for receiving a command property, the property instruction request is provided a snapshot of the file system file-level properties file;

[0139]处理器1002,用于根据所述接收机接收的属性设置指令设置所述文件的文件快照级别属性; [0139] The processor 1002, is used to set the property file according to instructions received by the receiver level snapshot file attributes;

[014O ]所述接收机1 OI,还用于接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数; [014O] The receiver 1 OI, further configured to receive a snapshot creation command, a snapshot of the snapshot creation file level attribute parameters required to carry the protected file command;

[0141]所述处理器1002,还用于根据所述接收机1001接收的快照创建指令为所述文件系统创建ROW只读快照,根据所述文件快照级别属性参数设置所述ROW只读快照的只读快照级别属性;以及用于在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已仓Ij建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 [0141] The processor 1002 is further configured to create, according to the command receiver 1001 receives the snapshot of the file system creation ROW read-only snapshot, the snapshot file according to the parameter level attribute read-only snapshot of the ROW read-only snapshot level attribute; if and when used to modify a specified file, determines the designated level snapshot file attributes have built ROW Ij cartridge read-only snapshot of the read-only snapshot level attribute match and match protection before writing the specified file according to the ROW read-only snapshot has been created.

[0142]进一步的,所述处理器1002,还用于通过与所述文件系统共享根的方式创建所述ROW只读快照;根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性,以及根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 [0142] Further, the processor 1002 is further configured to create shared by the ROW read-only snapshot of the file system root mode; snapshot according to the file attribute set the level of the read-only read-only snapshot ROW snapshot property level, and setting system snapshot of the file system in accordance with the read-only snapshot level attribute level attribute.

[0143]进一步的,所述处理器1002,还用于将所述系统快照级别属性记录为包括[快照级另IJ-逻辑时间点]对的集合,其中所述快照级别表示创建的所述ROW只读快照的快照级别,逻辑时间点表示创建所述ROW只读快照的逻辑时间点;将所述只读快照级别属性记录为包括[快照级别-逻辑时间点]对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 [0143] Further, the processor 1002 is further configured to attribute to the record level for the snapshot system comprises [snapshot stage another logical point IJ-] set of pairs, wherein the level represents the creation of the snapshot ROW read-only snapshot of the snapshot level, logical point represents a point in time to create a logical read-only snapshot of the ROW; the attribute is recorded as read-only snapshot level comprises [snapshot level - logical point] of the set, wherein said snapshot level indicates the need to protect the file-level snapshot of a logical point means creating a logical point of time read-only snapshot of the ROW.

[0144]进一步的,所述接收机,还用于接收携带快照名称的快照创建指令; [0144] Further, the receiver further configured to receive a snapshot of carrying the name of the snapshot creation instruction;

[0145]所述处理器,还用于根据所述接收机接收的快照创建指令中携带的快照名称命名所述ROW只读快照。 [0145] The processor is further configured to create a snapshot instruction carries ROW named after the read-only snapshot of the receiver according to the received snapshot.

[0146] 进一步的,所述接收机1001,还用于在所述处理器1002创建所述ROW只读快照之后,接收访问所述ROW只读快照的请求; [0146] Further, the receiver 1001, 1002 is further configured to, after creating the ROW read-only snapshot of the processor, receiving an access request of the read-only snapshot ROW;

[0147] 所述装置还包括: The [0147] apparatus further comprising:

[0148]发送机,用于根据所述接收机1002接收的请求输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性中的快照级别的值相等的文件。 [0148] a transmitter, for an equal level of a snapshot in accordance with a request value of the output of the receiver 1002 receives the file level attribute snapshots with the read-only snapshot of the read-only snapshot ROW level attribute file.

[0149]进一步的,所述接收机1001,还用于接收对所述文件系统中指定文件的进行修改的修改数据; [0149] Further, the receiver 1001 is further configured to receive the modified file system performs the specified file modification data;

[0150]所述处理器1002,还用于根据所述接收机接收的修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置;判断已创建的所述文件系统的ROW只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的ROW只读快照,若存在,则保留所述指定文件修改前的旧数据,并将所述ROW只读快照的根指向所述指定文件的旧数据,若不存在,则删除所述指定文件修改前的旧数据。 [0150] The processor 1002 is further configured to modify said specified data file according to the modification of the data received by the receiver, new data stored in the designated file and modified to a new disk location; Analyzing has ROW same value read-only snapshot of the snapshot file attributes ROW-level read-only snapshot of the file system is created, whether there is a read-only snapshot of the snapshot level attribute value and the level of the specified file, if present, the reservations old data before modifying said specified file, and the read-only snapshot root ROW data of the specified point to the old file, if not, deleting the old data before the specified file modifications.

[0151]本实施例提供的存储数据的保护装置,通过增加文件的文件快照级别属性,对该文件快照级别属性进行设置,可以将不同的文件设置成不同的快照级别,同时在对系统文件创建ROW只读快照时指定该ROW只读快照需要保护的文件的快照级别,从而让ROW只读快照只保护那些需要保护的重要文件,可有效降低ROW只读快照占用的FS的空间,使位于关键路径的FS尽可能可用,提升产品的竞争力。 [0151] This stored data protection apparatus according to an embodiment, to the file attribute-level snapshot file provided by increasing the level of snapshots attributes can be set different snapshot files into different levels, while creating a file system snapshot specified level when the ROW ROW read-only snapshot read-only snapshot of the file to be protected, so that ROW read-only snapshot protects only those who need to protect important documents, which can effectively reduce the space occupied by the FS ROW read-only snapshot of the key located FS path as possible available to enhance the competitiveness of their products.

[0152]综上所述,本发明实施例提供的存储数据的保护方法及装置,为文件系统中的文件增加了文件快照级别属性,通过对文件快照级别属性进行设置,将不同的文件设置成不同的快照级别,并且可以在对系统文件创建ROW只读快照时指定需要保护的文件的快照级别,当对文件进行修改时,根据被修改的文件的文件快照级别属性是否与创建的ROW只读快照的只读快照级别属性是否匹配确定是否对该文件进行快照保护,如果匹配则保留该文件修改前的旧数据,否则删除该文件修改前的旧数据,从而能够让用户参与到ROW只读快照的控制,由用户根据应用场景去决定该为FS的哪些文件创建快照,尽可能控制快照的使用空间,降低ROW只读快照占用的FS的空间,使位于关键路径的FS尽可能可用,提升产品的竞争力。 [0152] In summary, protection method and device for storing data according to an embodiment of the present invention, the snapshot file increased level attributes for the file in a file system, a snapshot of the file level by setting attributes will be set to a different file different levels of snapshots, and you can specify a snapshot of the level of protection required file when creating ROW read-only snapshot of the file system, when the file is modified, and whether a read-only file created from the ROW-level properties are modified snapshot file read-only snapshot level attribute snapshot of matches to determine whether the file is a snapshot of protection, if the match before the old data file modification is retained, or delete the old data before the file is modified to enable users to participate in read-only snapshot ROW controlled by the user depending on the application scenario to decide which files to create a snapshot of FS, or to control the use of space snapshot, reducing the space occupied by the FS ROW read-only snapshot of the FS is located in the critical path as possible available to enhance product competitiveness.

[0153]需要说明的是:上述实施例提供的存储数据的保护装置,在实现对存储数据的保护时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。 [0153] Note that: the protective device for storing data provided by the above-described embodiment, when implementing the protection of stored data, only the division of the functional modules is illustrated practical application, the above may be necessary function assigned to different functional modules, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above. 另外,上述实施例提供的存储数据的保护装置与存储数据的保护方法实施属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。 Further, the data stored in the above-described embodiments provide a method for protecting stored data protection apparatus of the same conception of the embodiment, the specific embodiments of the method implementation process will not be repeated here.

[0154]上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。 Embodiment [0154] The present invention No. merely for description, the embodiments do not represent the merits embodiment.

[0155]本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。 [0155] Those of ordinary skill in the art may understand that the above embodiments all or part of the steps may be implemented by hardware, by a program instruction may be relevant hardware, the program may be stored in a computer-readable storage medium in the above-mentioned storage medium may be a read-only memory, magnetic or optical disk.

[0156]以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 [0156] The foregoing is only preferred embodiments of the present invention, not intended to limit the present invention within the spirit and principle of the present invention, any modification, equivalent replacement, or improvement, it should be included in the present within the scope of the invention.

Claims (12)

  1. 1.一种存储数据的保护方法,其特征在于,所述方法包括: 接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性; 根据所述属性设置指令设置所述文件的文件快照级别属性; 接收快照创建指令,所述快照创建指令中携带文件快照级别属性参数,用以指示创建的只读快照需要保护的文件; 根据所述快照创建指令为所述文件系统创建采用写时重定向ROW技术的ROW只读快照,所述ROW只读快照的只读快照级别属性根据所述文件快照级别属性参数设置; 在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 1. A method of protecting method of storing data, wherein, the method comprising: receiving a command property, the property instruction request snapshot files in the file system level property file; setting instruction set according to the attribute of the file snapshot level attribute file; receiving the snapshot creation instruction, said snapshot creation carries snapshot file level attribute parameter in the instruction, to indicate the read-only snapshot created files to be protected; the snapshot creation instruction to the file system is created according to ROW ROW using read-only snapshot technology redirection write, read-only snapshot of the ROW-level read-only snapshot of the snapshot of the file attribute is set according to the parameter level attribute; when changes to the specified file, determine whether the specified file snapshots level attributes that have been created with the ROW read-only snapshot of the read-only snapshot level attributes match, and the match ROW specified file when the read-only snapshot has been created according to pre-write protection.
  2. 2.根据权利要求1所述的方法,其特征在于,所述根据所述快照创建指令为所述文件系统创建ROW只读快照,包括: 通过与所述文件系统共享根的方式创建所述ROW只读快照; 根据所述文件快照级别属性参数设置所述ROW只读快照的只读快照级别属性; 根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 2. The method according to claim 1, wherein the snapshot is created according to the instructions of the read-only snapshot file system creation ROW, including: creating the ROW shared by the file system root way read-only snapshot; snapshot file according to the parameter level attribute read-only snapshot of the read-only snapshot ROW level attribute; settings system snapshot of the file system in accordance with the read-only snapshot level attribute level attribute.
  3. 3.根据权利要求2所述的方法,其特征在于, 所述系统快照级别属性包括快照级别-逻辑时间点对的集合,其中所述快照级别表示所述ROW只读快照保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点; 所述只读快照级别属性包括快照级别-逻辑时间点对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 Snapshot file level logical point of collection of the snapshot wherein the read-only snapshot ROW indicating the level of protection - 3. The method according to claim 2, characterized in that the system comprises a snapshot of the snapshot level attribute level the logical point represents a point in time to create a logical read-only snapshot of the ROW; read-only snapshot of the snapshot level level attribute comprising - a collection of logical point pairs, wherein the level represents a snapshot of the snapshot files requiring protection level the logical point represents a point in time to create a logical read-only snapshot of the ROW.
  4. 4.根据权利要求1所述的方法,其特征在于,所述快照创建指令还携带快照名称; 所述根据所述快照创建指令为所述文件系统创建ROW只读快照之后,还包括: 根据所述快照名称命名所述ROW只读快照。 4. The method according to claim 1, wherein said snapshot creation command further carries the name of the snapshot; after the snapshot is created according to the instructions of the read-only snapshot file system is created ROW, further comprising: based on the said snapshot ROW named after the read-only snapshot.
  5. 5.根据权利要求3所述的方法,其特征在于,所述根据所述快照创建指令为所述文件系统创建ROW只读快照之后,还包括: 接收访问所述ROW只读快照的请求; 输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性的快照级别的值相等的文件。 5. The method according to claim 3, wherein said snapshot is created according to the instruction of the file system after creating read-only snapshot ROW, further comprising: receiving an access request of the read-only snapshot ROW; output snapshot file level attribute value and the read-only snapshot ROW value equal level attribute file read-only snapshot of the snapshot level.
  6. 6.根据权利要求3所述的方法,其特征在于,所述在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护,包括: 接收所述指定文件的修改数据; 根据所述修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置; 判断已创建的所述文件系统的ROW只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的ROW只读快照; 若存在,保留所述指定文件修改前的旧数据,并将所述ROW只读快照的根指向所述指定文件的旧数据;否则,删除所述指定文件修改前的旧数据。 6. The method according to claim 3, wherein, when the specified file to modify, determine whether the specified file and the snapshot level attribute ROW created read-only snapshot of the level attribute is read-only snapshot match, and the write protection before, including the specified file at the matching ROW read-only snapshot that has been created according to: receive the modified data in the specified file; modifying the designated data file according to the modification, save the new data of the specified file and the changes to the new disk location; the ROW read-only snapshot of the file system has been created in the determination whether there is a read-only snapshot of the snapshot level attribute value of the designated level equal to the value ROW snapshot file level attribute read-only snapshot file; if present, to retain the old data before modification of the specified file and the designated file points to the old data of the read-only snapshot root ROW; otherwise, delete the specified file before modifying old data.
  7. 7.一种存储数据的保护装置,其特征在于,包括: 接收单元,用于接收属性设置指令,所述属性设置指令请求设置文件系统中文件的文件快照级别属性,以及用于接收快照创建指令,所述快照创建指令中携带需要保护的文件的文件快照级别属性参数; 设置单元,用于根据所述接收单元接收的属性设置指令设置所述文件的文件快照级别属性; 快照创建单元,用于根据所述接收单元接收的快照创建指令为所述文件系统创建ROW只读快照,根据所述文件快照级别属性参数设置所述ROW只读快照的只读快照级别属性;文件保护单元,用于在对指定文件进行修改时,判断所述指定文件的文件快照级别属性与已创建的ROW只读快照的只读快照级别属性是否匹配,并在匹配时根据所述已创建的ROW只读快照对所述指定文件进行写前保护。 A protective device for storing data, characterized by comprising: receiving means for receiving a command property, the property instruction request snapshot file system file-level property files, and means for receiving a snapshot creation instruction the snapshot creation snapshot file level attribute parameters required to carry the protected file command; setting unit for setting the attribute of the file according to the setting instruction receiving unit receives the snapshot file-level properties; snapshot creation unit is configured to ROW create read-only snapshot of the receiving unit receives the snapshot creation instruction according to the file system, the ROW parameter setting read-only snapshot of the read-only snapshot level attribute according to the file attribute-level snapshot; file protection means for when changes to the specified file, determine whether the specified file attributes ROW level of snapshots created read-only snapshot of the read-only snapshot level attributes match, and when a match has been created according to the ROW read-only snapshot of their said specified file protection before writing.
  8. 8.根据权利要求7所述的装置,其特征在于,所述快照创建单元包括: 创建模块,用于通过与所述文件系统共享根的方式创建所述ROW只读快照; 设置模块,用于在所述创建模块创建所述ROW只读快照之后,根据所述文件快照级别属性设置所述ROW只读快照的只读快照级别属性,以及根据所述只读快照级别属性设置所述文件系统的系统快照级别属性。 8. The apparatus according to claim 7, wherein said snapshot creation unit comprises: creating means for creating the ROW read-only snapshot of the file system by sharing the root mode; setting module, for after the creation module creates the read-only snapshot ROW, the ROW provided read-only snapshot of the read-only snapshot level attribute, and setting the read-only snapshot of the file system level in accordance with attributes according to the file attribute-level snapshot system snapshot level attributes.
  9. 9.根据权利要求8所述的装置,其特征在于,所述设置模块,还用于将所述系统快照级另Ij属性记录为包括快照级另Ij-逻辑时间点对的集合,其中所述快照级别表示创建的所述ROW只读快照保护的文件的快照级别的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点;将所述只读快照级别属性记录为包括快照级别-逻辑时间点对的集合,其中所述快照级别表示需要保护的文件的快照级别,所述逻辑时间点表示创建所述ROW只读快照的逻辑时间点。 9. The apparatus according to claim 8, wherein the setting module is further configured to the system-level snapshot of another attribute record Ij stage comprising a set of snapshots Ij- another logical point pairs, wherein said level snapshot read-only snapshot of the snapshot of the file protection level indicates the created snapshot ROW level, the logical point represents a point in time to create a logical read-only snapshot of the ROW; the level attribute is recorded as read-only snapshot comprises snapshots level - on the set of logical time point, wherein the level represents a snapshot of a snapshot of the level of protection required documents, the logical point means creating a logical point of time read-only snapshot of the ROW.
  10. 10.根据权利要求7所述的装置,其特征在于, 所述接收单元,还用于接收携带快照名称的快照创建指令; 所述装置还包括: 创建模块,用于根据所述接收单元接收的快照创建指令中携带的快照名称命名所述ROW只读快照。 10. The apparatus according to claim 7, wherein the receiving unit is further configured to receive a snapshot of carrying the name of the snapshot creation instruction; said apparatus further comprising: a creation module, a receiving unit according to the received snapshot creation instruction carries snapshot named after the ROW read-only snapshot.
  11. 11.根据权利要求9所述的装置,其特征在于, 所述接收单元,还用于在所述快照创建单元创建所述ROW只读快照之后,接收访问所述ROW只读快照的请求; 所述装置还包括: 输出单元,用于根据所述接收单元接收的请求输出文件快照级别属性的值与所述ROW只读快照的只读快照级别属性中的快照级别的值相等的文件。 11. The apparatus according to claim 9, wherein the receiving unit is further configured to, after the snapshot creation unit creates the read-only snapshot of the ROW, ROW read-only snapshot of the received access request; the said apparatus further comprising: an output unit, according to a value equal to the value of the level snapshot of the snapshot file request output level attribute of the receiving unit receives the read-only snapshot of the read-only snapshot ROW level attribute file.
  12. 12.根据权利要求7至11任一项所述的装置,其特征在于, 所述接收单元,还用于接收所述文件系统中指定文件的修改数据; 所述文件保护单元还包括: 修改模块,用于根据所述接收单元接收的修改数据修改所述指定文件的数据,并将修改后的所述指定文件的新数据保存到新的磁盘位置; 判断模块,用于在所述修改模块将修改后的所述指定文件的新数据保存到新的磁盘位置之后,判断已创建的所述文件系统的ROW只读快照中,是否存在只读快照级别属性的快照级别的值与所述指定文件的文件快照级别属性的值相等的ROW只读快照; 根模块,用于在所述判断模块判断存在只读快照级别属性与所述指定文件的文件快照级别属性相匹配的ROW只读快照时,将所述ROW只读快照的根指向所述指定文件的旧数据;删除模块,用于在所述判断模块判断不存在只读快照级别 12. The apparatus according to any one of 7-1 according to claim 11, wherein the receiving unit is further configured to receive the modified data file specified in the file system; the file protection unit further comprises: a modification module , for modifying the designated data file according to a modification of the receiving unit receives the data and stores the new data in the designated file modified to a new disk location; determining means for modifying said module snapshots level after saving the new value of the specified data file modified to the new disk location, ROW read-only snapshot of the file system has been created to determine whether there is a read-only snapshot level attribute with the specified file ROW equal to the value of the file read-only snapshot of the snapshot level attribute; root module, for determining when the ROW module determines the presence of read-only snapshot of the level attribute specifies the snapshot file level attribute read-only snapshot match, the ROW read-only snapshot of the designated file points to the root of the old data; deleting module, the judging module determines that the read-only snapshot level is not present 性与所述指定文件的文件快照级别属性相匹配的ROW只读快照时,删除所述指定文件修改前的旧数据。 When the snapshot file level attributes of the specified file that matches the ROW read-only snapshot, delete the old data before the specified file modifications.
CN 201310744238 2013-12-30 2013-12-30 Protection method and apparatus for storing data CN103729265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310744238 CN103729265B (en) 2013-12-30 2013-12-30 Protection method and apparatus for storing data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 201310744238 CN103729265B (en) 2013-12-30 2013-12-30 Protection method and apparatus for storing data
PCT/CN2014/088940 WO2015101083A1 (en) 2013-12-30 2014-10-20 Method and device for protecting stored data

Publications (2)

Publication Number Publication Date
CN103729265A true CN103729265A (en) 2014-04-16
CN103729265B true CN103729265B (en) 2017-01-04

Family

ID=50453348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310744238 CN103729265B (en) 2013-12-30 2013-12-30 Protection method and apparatus for storing data

Country Status (2)

Country Link
CN (1) CN103729265B (en)
WO (1) WO2015101083A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729265B (en) * 2013-12-30 2017-01-04 华为技术有限公司 Protection method and apparatus for storing data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183383A (en) * 2007-12-17 2008-05-21 中国科学院计算技术研究所 Snapshot system and method of use thereof
CN101246458A (en) * 2008-02-29 2008-08-20 中国科学院计算技术研究所 Hard disk data protection method and system
CN103473277A (en) * 2013-08-27 2013-12-25 华为技术有限公司 Snapshot method and device for file systems

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7010553B2 (en) * 2002-03-19 2006-03-07 Network Appliance, Inc. System and method for redirecting access to a remote mirrored snapshot
KR100439675B1 (en) * 2002-10-24 2004-07-14 한국전자통신연구원 An efficient snapshot technique for shated large storage
CN101661415B (en) * 2009-09-21 2012-07-11 中兴通讯股份有限公司 Method for memorizing snapshot data and system for memorizing snapshot
CN103729265B (en) * 2013-12-30 2017-01-04 华为技术有限公司 Protection method and apparatus for storing data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183383A (en) * 2007-12-17 2008-05-21 中国科学院计算技术研究所 Snapshot system and method of use thereof
CN101246458A (en) * 2008-02-29 2008-08-20 中国科学院计算技术研究所 Hard disk data protection method and system
CN103473277A (en) * 2013-08-27 2013-12-25 华为技术有限公司 Snapshot method and device for file systems

Also Published As

Publication number Publication date Type
WO2015101083A1 (en) 2015-07-09 application
CN103729265A (en) 2014-04-16 application

Similar Documents

Publication Publication Date Title
US20090300079A1 (en) Integrated remote replication in hierarchical storage systems
US20100228795A1 (en) Download management of discardable files
US20060277226A1 (en) System and method for controlling storage of electronic files
US20080244199A1 (en) Computer system preventing storage of duplicate files
US20070179990A1 (en) Primary stub file retention and secondary retention coordination in a hierarchical storage system
US7146388B2 (en) Method, system, and program for archiving files
US20080208917A1 (en) Apparatus and a method to make data sets conform to data management policies
US20090177721A1 (en) Management of quality of services in storage systems
US20090276471A1 (en) Automatically Capturing and Maintaining Versions of Documents
US8392479B1 (en) Method and apparatus for optimizing storage space allocation for computer data
US8515911B1 (en) Methods and apparatus for managing multiple point in time copies in a file system
US7933936B2 (en) Method and system for automatic management of storage space
US20120150799A1 (en) Data synchronization among file storages using stub files
US20080208927A1 (en) Storage system and management method thereof
US20120054152A1 (en) Managing data access requests after persistent snapshots
US20080104081A1 (en) Tiered storage system with single instance function
CN101178677A (en) Computer system for protecting software and method for protecting software
US7469327B2 (en) System and method for restricting access to logical volumes
US20090276470A1 (en) Data Processing System And Method
JPH11120057A (en) File backup method
US20070156778A1 (en) File indexer
US20120066183A1 (en) File cloning across different filesets
US20070061540A1 (en) Data storage system using segmentable virtual volumes
US7533133B1 (en) Externally managed file versions
US8639665B2 (en) Hybrid backup and restore of very large file system using metadata image backup and traditional backup

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model