CN106855790A - Document handling method, device and equipment - Google Patents
Document handling method, device and equipment Download PDFInfo
- Publication number
- CN106855790A CN106855790A CN201611187887.5A CN201611187887A CN106855790A CN 106855790 A CN106855790 A CN 106855790A CN 201611187887 A CN201611187887 A CN 201611187887A CN 106855790 A CN106855790 A CN 106855790A
- Authority
- CN
- China
- Prior art keywords
- file
- files
- conditions
- target
- database
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
- G06F3/0611—Improving I/O performance in relation to response time
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开是关于一种文件处理方法、装置和设备,该方法包括:获取文件的筛选条件;根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;对所述目标文件进行Raid处理。本公开提供的文件处理方法、装置和设备,能够提高分布式多副本文件系统的存储空间利用率,减少访问损坏文件时的时间延迟。
The present disclosure relates to a file processing method, device and equipment. The method includes: obtaining screening conditions of files; screening files in a database according to the screening conditions to obtain target files; performing Raid processing on the target files. The file processing method, device and equipment provided by the present disclosure can improve the storage space utilization rate of a distributed multi-copy file system and reduce the time delay when accessing damaged files.
Description
技术领域technical field
本公开涉及数据处理技术领域,尤其涉及一种文件处理方法、装置和设备。The present disclosure relates to the technical field of data processing, and in particular to a file processing method, device and equipment.
背景技术Background technique
在分布式多副本文件系统中,为了保证数据的可用性,数据会在多个节点上保留多个副本.这样做会导致系统存储空间的占用率呈几何倍数增长。In a distributed multi-copy file system, in order to ensure the availability of data, multiple copies of data will be kept on multiple nodes. Doing so will cause the occupancy rate of system storage space to increase geometrically.
现有技术中,为了降低存储空间的消耗,一般会对文件做Raid处理,.所谓Raid,就是对同一个文件的不同数据块进行编码形成一些冗余块,等到文件的数据块丢失时,可以通过这些冗余块重新解码出原始数据块,通过Raid处理可以达到与多副本同样的数据可靠性,但是只需要很少的存储空间。以6+3的编码为例,raid可以对文件的6个数据块编码,形成3个冗余数据块,后续这9个数据块中的任何3个块损坏,都可以通过这些数据块重新解码出来,而如果单纯通过数据多副本,要达到能容忍任意3个数据块损坏的目标,需要为每个数据块保存4个副本,则总共需要消耗24个数据块.而通过raid方式则只需要消耗9个数据块。In the prior art, in order to reduce the consumption of storage space, the files are generally subjected to Raid processing. The so-called Raid is to encode different data blocks of the same file to form some redundant blocks. When the data blocks of the file are lost, it can be The original data blocks are re-decoded through these redundant blocks, and the same data reliability as multiple copies can be achieved through Raid processing, but only a small amount of storage space is required. Taking the encoding of 6+3 as an example, raid can encode 6 data blocks of the file to form 3 redundant data blocks, and any 3 blocks in the subsequent 9 data blocks are damaged, and can be re-decoded through these data blocks However, to achieve the goal of being able to tolerate the damage of any 3 data blocks simply through multiple copies of data, it is necessary to save 4 copies for each data block, and a total of 24 data blocks need to be consumed. However, through the raid method, only Consumes 9 data blocks.
但是在现有Raid方案中,都是对系统的所有文件或某些固定目录的文件做Raid处理,被编码的文件如果真的损坏,则在读取时就需要较长的时间等待解码,用户访问延迟较大。However, in the existing Raid scheme, Raid processing is performed on all files in the system or files in certain fixed directories. If the encoded file is really damaged, it will take a long time to wait for decoding when reading. The access delay is large.
发明内容Contents of the invention
本公开提供一种文件处理方法、装置和设备,用以提高分布式多副本文件系统的存储空间利用率,减少访问损坏文件时的时间延迟。The present disclosure provides a file processing method, device and equipment, which are used to improve the storage space utilization rate of a distributed multi-copy file system and reduce the time delay when accessing damaged files.
根据本公开实施例的第一方面,提供一种文件处理方法,包括:According to a first aspect of an embodiment of the present disclosure, a file processing method is provided, including:
获取文件的筛选条件;Filter conditions for obtaining files;
根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;Filtering the files in the database according to the filtering conditions to obtain the target file;
对所述目标文件进行Raid处理。Raid processing is performed on the target file.
该技术方案可以包括以下有益效果:通过从数据库中筛选出符合特定筛选条件的文件作为目标文件,并对目标文件进行Raid处理,能够降低进行Raid处理的文件的数量,从而缩短了Raid处理的耗时,减少了对系统资源的占用。并且,由于进行Raid处理的文件仅是符合特定筛选条件的文件,而不是系统的所有文件,因此,经过Raid处理后,生成的冗余数据块的数量就减少了,节约了系统的存储空间。而且用户在访问损坏文件时,也会因为冗余数据块的减少,减少等待的时间。The technical solution may include the following beneficial effects: by filtering out files meeting specific screening conditions from the database as target files, and performing Raid processing on the target files, the number of files for Raid processing can be reduced, thereby shortening the consumption of Raid processing. , reducing the occupancy of system resources. Moreover, since the files that undergo Raid processing are only files that meet specific filtering conditions, rather than all files in the system, after Raid processing, the number of redundant data blocks generated is reduced, saving the storage space of the system. Moreover, when the user accesses the damaged file, the waiting time will also be reduced due to the reduction of redundant data blocks.
在第一方面的第一种可能的实现方式中,所述获取文件的筛选条件,包括:In a first possible implementation manner of the first aspect, the filtering conditions for obtaining files include:
从数据库中获取预先存储的筛选条件,或者;Get pre-stored filter criteria from the database, or;
从用户交互界面上获取用户输入的筛选条件。Obtain the filtering conditions entered by the user from the user interface.
该技术方案可以包括以下有益效果:通过从数据库中获取预先设置的筛选条件或者直接从用户交互界面上获取用户实时输入的筛选条件,能够实现文件筛选的个性化。同时又能避免由于对所有文件进行Raid处理所导致的存储空间浪费的问题,提高了存储空间的利用率。The technical solution may include the following beneficial effects: by obtaining the pre-set filtering conditions from the database or directly obtaining the filtering conditions input by the user in real time from the user interaction interface, the personalization of file screening can be realized. At the same time, the problem of waste of storage space caused by performing Raid processing on all files can be avoided, and the utilization rate of storage space is improved.
根据第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述筛选条件包括如下条件中的至少一种:文件类型、文件属性、文件名称、文件内容;According to the first aspect or the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the filtering conditions include at least one of the following conditions: file type, file attribute, file name, file content;
所述根据所述筛选条件对数据库中的文件进行筛选,获得目标文件,包括:Said filtering the files in the database according to the filtering conditions to obtain the target files includes:
从数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。The files meeting the at least one condition are selected from the database as target files.
根据第一方面的第二中可能的实现方式,在第一方面的第三中可能的实现方式中,所述从数据库中筛选出同时符合所述至少一种条件的文件作为目标文件,包括:According to the second possible implementation manner of the first aspect, in the third possible implementation manner of the first aspect, the filtering out the files meeting the at least one condition from the database as the target file includes:
采用标准深度优选遍历方法或广度优先遍历方法,周期性的从所述数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。A standard depth-first traversal method or a breadth-first traversal method is used to periodically filter out files that meet the at least one condition from the database as target files.
该技术方案可以包括以下有益效果:通过设置多个筛选的条件,能够实现对目标文件的准确定位,并且能够进一步的缩小目标文件的范围和数量,达到节约存储空间,提高存储空间利用率的目的。且由于Raid处理的文件的减少,能够有效减少用户访问损坏文件的等待时间,提高了用户体验。并且通过周期性筛选的方式,能够避免符合筛选条件的文件被漏掉,提高了系统的可靠性。The technical solution may include the following beneficial effects: by setting multiple filtering conditions, the accurate positioning of the target file can be realized, and the scope and quantity of the target file can be further reduced, so as to save storage space and improve storage space utilization . In addition, due to the reduction of files processed by the Raid, the waiting time for users to access damaged files can be effectively reduced, thereby improving user experience. And through periodic screening, files meeting the screening conditions can be avoided from being missed, which improves the reliability of the system.
根据本公开实施例的第二方面,提供一种文件处理装置,包括:According to a second aspect of an embodiment of the present disclosure, a file processing device is provided, including:
获取模块,被配置为获取文件的筛选条件;The acquisition module is configured to acquire the filter conditions of the file;
筛选模块,被配置为根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;A screening module configured to screen files in the database according to the screening conditions to obtain target files;
处理模块,被配置为对所述目标文件进行Raid处理。The processing module is configured to perform Raid processing on the target file.
该技术方案可以包括以下有益效果:通过从数据库中筛选出符合特定筛选条件的文件作为目标文件,并对目标文件进行Raid处理,能够降低进行Raid处理的文件的数量,从而缩短了Raid处理的耗时,减少了对系统资源的占用。并且,由于进行Raid处理的文件仅是符合特定筛选条件的文件,而不是系统的所有文件,因此,经过Raid处理后,生成的冗余数据块的数量就减少了,节约了系统的存储空间。而且用户在访问损坏文件时,也会因为冗余数据块的减少,减少等待的时间。The technical solution may include the following beneficial effects: by filtering out files meeting specific screening conditions from the database as target files, and performing Raid processing on the target files, the number of files for Raid processing can be reduced, thereby shortening the consumption of Raid processing. , reducing the occupancy of system resources. Moreover, since the files that undergo Raid processing are only files that meet specific filtering conditions, rather than all files in the system, after Raid processing, the number of redundant data blocks generated is reduced, saving the storage space of the system. Moreover, when the user accesses the damaged file, the waiting time will also be reduced due to the reduction of redundant data blocks.
在第二方面的第一种可能的实现方式中,所述获取模块包括:In a first possible implementation manner of the second aspect, the obtaining module includes:
第一获取子模块,被配置为从数据库中获取预先存储的筛选条件。或者,The first obtaining submodule is configured to obtain pre-stored filter conditions from the database. or,
第二获取子模块,被配置为从用户交互界面上获取用户输入的筛选条件。The second acquiring submodule is configured to acquire the filtering conditions input by the user from the user interaction interface.
该技术方案可以包括以下有益效果:通过从数据库中获取预先设置的筛选条件或者直接从用户交互界面上获取用户实时输入的筛选条件,能够实现文件筛选的个性化。同时又能避免由于对所有文件进行Raid处理所导致的存储空间浪费的问题,提高了存储空间的利用率。The technical solution may include the following beneficial effects: by obtaining the pre-set filtering conditions from the database or directly obtaining the filtering conditions input by the user in real time from the user interaction interface, the personalization of file screening can be realized. At the same time, the problem of waste of storage space caused by performing Raid processing on all files can be avoided, and the utilization rate of storage space is improved.
根据第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述筛选条件包括如下条件中的至少一种:文件类型、文件属性、文件名称、文件内容;According to the first aspect or the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the filtering conditions include at least one of the following conditions: file type, file attribute, file name, file content;
所述筛选模块包括:The screening modules include:
第一筛选子模块,被配置为从数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。The first screening submodule is configured to filter out files meeting the at least one condition from the database as target files.
根据第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,所述第一筛选子模块,还被配置为采用标准深度优选遍历方法或广度优先遍历方法,周期性的从所述数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。According to the second possible implementation of the first aspect, in the third possible implementation of the first aspect, the first screening submodule is further configured to adopt a standard depth-first traversal method or a breadth-first traversal method , periodically filter out files that meet the at least one condition from the database as target files.
该技术方案可以包括以下有益效果:通过设置多个筛选的条件,能够实现对目标文件的准确定位,并且能够进一步的缩小目标文件的范围和数量,达到节约存储空间,提高存储空间利用率的目的。且由于Raid处理的文件的减少,能够有效减少用户访问损坏文件的等待时间,提高了用户体验。并且通过周期性筛选的方式,能够避免符合筛选条件的文件被漏掉,提高了系统的可靠性。The technical solution may include the following beneficial effects: by setting multiple filtering conditions, the accurate positioning of the target file can be realized, and the scope and quantity of the target file can be further reduced, so as to save storage space and improve storage space utilization . In addition, due to the reduction of files processed by the Raid, the waiting time for users to access damaged files can be effectively reduced, thereby improving user experience. And through periodic screening, files meeting the screening conditions can be avoided from being missed, which improves the reliability of the system.
根据本公开实施例的第三方面,提供一种文件处理设备,包括:According to a third aspect of an embodiment of the present disclosure, there is provided a file processing device, including:
处理器;processor;
被配置为存储处理器可执行指令的存储器;memory configured to store processor-executable instructions;
其中,所述处理器被配置为:Wherein, the processor is configured as:
获取文件的筛选条件;Filter conditions for obtaining files;
根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;Filtering the files in the database according to the filtering conditions to obtain the target file;
对所述目标文件进行Raid处理。Raid processing is performed on the target file.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
图1是根据一示例性实施例示出的一种文件处理方法实施例一的流程图;Fig. 1 is a flow chart of Embodiment 1 of a file processing method shown according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种文件处理方法实施例二的流程图;Fig. 2 is a flow chart of Embodiment 2 of a file processing method according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种文件处理装置实施例一的框图;Fig. 3 is a block diagram of Embodiment 1 of a file processing device according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种文件处理装置实施例二的框图;Fig. 4 is a block diagram of Embodiment 2 of a file processing device according to an exemplary embodiment;
图5是根据一示例性实施例示出的一种文件处理设备的框图。Fig. 5 is a block diagram of a file processing device according to an exemplary embodiment.
通过上述附图,已示出本公开明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本公开构思的范围,而是通过参考特定实施例为本领域技术人员说明本公开的概念。By means of the above-mentioned drawings, certain embodiments of the present disclosure have been shown and will be described in more detail hereinafter. These drawings and written description are not intended to limit the scope of the disclosed concept in any way, but to illustrate the disclosed concept for those skilled in the art by referring to specific embodiments.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present disclosure as recited in the appended claims.
图1是根据一示例性实施例示出的一种文件处理方法实施例一的流程图,该方法可以由文件处理装置来执行,该文件处理装置可以集成在服务器等文件处理设备中,如图1所示,该方法包括以下步骤:Fig. 1 is a flow chart of Embodiment 1 of a file processing method according to an exemplary embodiment, the method can be executed by a file processing device, and the file processing device can be integrated in a file processing device such as a server, as shown in Fig. 1 As shown, the method includes the following steps:
在步骤101中,获取文件的筛选条件。In step 101, filter conditions of files are obtained.
本公开实施例中所涉及的文件可以被具体为分布式多副本文件系统(以下简称系统)中的文件。The files involved in the embodiments of the present disclosure may be specifically referred to as files in a distributed multi-copy file system (hereinafter referred to as the system).
筛选条件是用户根据实际需要或对文件的理解所设定的,用于筛选出某些符合特定特征的文件的条件。实际应用中,筛选条件可以是预先设定并存储在数据库中的。当对系统文件进行筛选时,直接从数据库中调用。筛选条件也可以是用户通过文件处理设备上的人机交互界面实时输入的。当用户触发输入时,文件处理装置从人机交互界面上获取用户输入的筛选条件。Filtering conditions are set by users according to actual needs or understanding of files, and are used to filter out certain files that meet certain characteristics. In practical applications, the filter conditions may be preset and stored in the database. When filtering system files, it is called directly from the database. The filtering conditions may also be input by the user in real time through the human-computer interaction interface on the file processing device. When the user triggers the input, the file processing device acquires the filtering conditions input by the user from the man-machine interaction interface.
本实施例中,筛选条件包括如下条件中的至少一种:文件类型,比如,压缩文件、归档备份文件等;文件属性,比如文件的最后一次修改时间,文件的大小等;文件名称;文件内容,比如在文件头部是某特定内容的文件,或者在文件结尾是某特定内容的文件等。当然此处仅为示例说明而不是对本公开的唯一限定。In this embodiment, the screening conditions include at least one of the following conditions: file type, such as compressed files, archived backup files, etc.; file attributes, such as the last modification time of the file, the size of the file, etc.; file name; file content , such as a file with a specific content at the head of the file, or a file with a specific content at the end of the file, etc. Of course, what is here is only an example rather than a sole limitation to the present disclosure.
在步骤101中通过从数据库中获取预先设置的筛选条件或者直接从用户交互界面上获取用户实时输入的筛选条件,能够实现文件筛选的个性化。同时又能避免由于对所有文件进行Raid处理所导致的存储空间浪费的问题,提高了存储空间的利用率。In step 101, by obtaining the pre-set filtering conditions from the database or directly obtaining the filtering conditions input by the user in real time from the user interaction interface, the personalization of file screening can be realized. At the same time, the problem of waste of storage space caused by performing Raid processing on all files can be avoided, and the utilization rate of storage space is improved.
在步骤102中,根据所述筛选条件对数据库中的文件进行筛选,获得目标文件。In step 102, the files in the database are screened according to the screening conditions to obtain the target file.
本实施例中,目标文件是指待进行Raid处理的文件。In this embodiment, the target file refers to a file to be subjected to Raid processing.
举例来说,假设用户设定的筛选条件为文件类型、文件属性和文件内容,其中文件类型包括压缩文件、文件属性包括文件大小的指定范围(25kb,100kb)。在获得该筛选条件后,文件处理装置从系统的数据库中选择同时符合上述文件属性条件和文件类型条件的文件作为目标文件,比如,一压缩文件,其大小为80kb,则将该文件作为目标文件,以此类推,直至从系统数据库中筛选出所有符合条件的文件为止。For example, assume that the filtering conditions set by the user are file type, file attribute, and file content, wherein the file type includes compressed files, and the file attribute includes a specified range of file size (25kb, 100kb). After obtaining the screening conditions, the file processing device selects from the database of the system the files that meet the above-mentioned file attribute conditions and file type conditions at the same time as the target file, for example, a compressed file whose size is 80kb, then this file is used as the target file , and so on, until all qualified files are filtered out from the system database.
在步骤103中,对所述目标文件进行Raid处理。In step 103, Raid processing is performed on the target file.
Raid处理的目的是对目标文件的数据块进行编码,生成预设个数的冗余数据块。当目标文件中的某个或某些数据块损坏时,可以根据该些数据块和冗余数据块重新编码获得完好的数据块。本公开实施例中,对目标文件进行Raid处理的方法与现有技术类似,在这里不再赘述。The purpose of Raid processing is to encode the data blocks of the target file to generate a preset number of redundant data blocks. When one or some data blocks in the target file are damaged, good data blocks can be obtained by re-encoding according to these data blocks and redundant data blocks. In the embodiment of the present disclosure, the method for performing Raid processing on the target file is similar to the prior art, and will not be repeated here.
本实施例中,通过从数据库中筛选出符合特定筛选条件的文件作为目标文件,并对目标文件进行Raid处理,能够降低进行Raid处理的文件的数量,从而缩短了Raid处理的耗时,减少了对系统资源的占用。并且,由于进行Raid处理的文件仅是符合特定筛选条件的文件,而不是系统的所有文件,因此,经过Raid处理后,生成的冗余数据块的数量就减少了,节约了系统的存储空间。而且用户在访问损坏文件时,也会因为冗余数据块的减少,减少等待的时间。In this embodiment, by screening out the files that meet the specific screening conditions from the database as the target files, and performing Raid processing on the target files, the number of files for Raid processing can be reduced, thereby shortening the time-consuming of Raid processing and reducing the occupancy of system resources. Moreover, since the files that undergo Raid processing are only files that meet specific filtering conditions, rather than all files in the system, after Raid processing, the number of redundant data blocks generated is reduced, saving the storage space of the system. Moreover, when the user accesses the damaged file, the waiting time will also be reduced due to the reduction of redundant data blocks.
图2是根据一示例性实施例示出的一种文件处理方法实施例二的流程图,如图2所示,该方法可以包括如下的步骤:Fig. 2 is a flow chart of Embodiment 2 of a file processing method according to an exemplary embodiment. As shown in Fig. 2, the method may include the following steps:
在步骤201中,获取文件的筛选条件,其中,所述筛选条件包括如下条件中的至少一种:文件类型、文件属性、文件名称、文件内容。In step 201, filter conditions of files are acquired, wherein the filter conditions include at least one of the following conditions: file type, file attribute, file name, and file content.
本公开实施例中所涉及的文件可以被具体为分布式多副本文件系统(以下简称系统)中的文件。The files involved in the embodiments of the present disclosure may be specifically referred to as files in a distributed multi-copy file system (hereinafter referred to as the system).
筛选条件是用户根据实际需要或对文件的理解所设定的,用于筛选出某些符合特定特征的文件的条件。实际应用中,筛选条件可以是预先设定并存储在数据库中的。当对系统文件进行筛选时,直接从数据库中调用。筛选条件也可以是用户通过文件处理设备上的人机交互界面实时输入的。当用户触发输入时,文件处理装置从人机交互界面上获取用户输入的筛选条件。Filtering conditions are set by users according to actual needs or understanding of files, and are used to filter out certain files that meet certain characteristics. In practical applications, the filter conditions may be preset and stored in the database. When filtering system files, it is called directly from the database. The filtering conditions may also be input by the user in real time through the human-computer interaction interface on the file processing device. When the user triggers the input, the file processing device acquires the filtering conditions input by the user from the man-machine interaction interface.
本实施例中,筛选条件包括如下条件中的至少一种:文件类型,比如,压缩文件、归档备份文件等;文件属性,比如文件的最后一次修改时间,文件的大小等;文件名称;文件内容,比如在文件头部是某特定内容的文件,或者在文件结尾是某特定内容的文件等。当然此处仅为示例说明而不是对本公开的唯一限定。In this embodiment, the screening conditions include at least one of the following conditions: file type, such as compressed files, archived backup files, etc.; file attributes, such as the last modification time of the file, the size of the file, etc.; file name; file content , such as a file with a specific content at the head of the file, or a file with a specific content at the end of the file, etc. Of course, what is here is only an example rather than a sole limitation to the present disclosure.
在步骤201中通过从数据库中获取预先设置的筛选条件或者直接从用户交互界面上获取用户实时输入的筛选条件,能够实现文件筛选的个性化。同时又能避免由于对所有文件进行Raid处理所导致的存储空间浪费的问题,提高了存储空间的利用率。In step 201, by obtaining the preset filtering conditions from the database or directly obtaining the filtering conditions input by the user in real time from the user interaction interface, the personalization of file screening can be realized. At the same time, the problem of waste of storage space caused by performing Raid processing on all files can be avoided, and the utilization rate of storage space is improved.
在步骤202中,从数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。In step 202, files meeting the at least one condition are screened out from the database as target files.
本实施例中,目标文件是指待进行Raid处理的文件。In this embodiment, the target file refers to a file to be subjected to Raid processing.
实际应用中,可以采用标准深度优先遍历的方法或广度优先遍历的方法,对数据库中的文件进行遍历,并将符合所有筛选条件的文件作为目标文件。其中,上述遍历可以是周期性的,也可以是按照人为设定的策略执行的,本实施例中不做限定。举例来说,假设用户设定的筛选条件为文件类型、文件属性和文件内容,其中文件类型包括压缩文件、文件属性包括文件大小的指定范围(25kb,100kb)。在获得该筛选条件后,文件处理装置从系统的数据库中选择同时符合上述文件属性条件和文件类型条件的文件作为目标文件,比如,一压缩文件,其大小为80kb,则将该文件作为目标文件,以此类推,直至从系统数据库中筛选出所有符合条件的文件为止。In practical applications, the standard depth-first traversal method or the breadth-first traversal method can be used to traverse the files in the database, and the files meeting all the filter conditions can be used as target files. Wherein, the above-mentioned traversal may be performed periodically or according to an artificially set strategy, which is not limited in this embodiment. For example, assume that the filtering conditions set by the user are file type, file attribute, and file content, wherein the file type includes compressed files, and the file attribute includes a specified range of file size (25kb, 100kb). After obtaining the screening conditions, the file processing device selects from the database of the system the files that meet the above-mentioned file attribute conditions and file type conditions at the same time as the target file, for example, a compressed file whose size is 80kb, then this file is used as the target file , and so on, until all qualified files are filtered out from the system database.
在步骤203中,对所述目标文件进行Raid处理。In step 203, Raid processing is performed on the target file.
Raid处理的目的是对目标文件的数据块进行编码,生成预设个数的冗余数据块。当目标文件中的某个或某些数据块损坏时,可以根据该些数据块和冗余数据块重新编码获得完好的数据块。本公开实施例中,对目标文件进行Raid处理的方法与现有技术类似,在这里不再赘述。The purpose of Raid processing is to encode the data blocks of the target file to generate a preset number of redundant data blocks. When one or some data blocks in the target file are damaged, good data blocks can be obtained by re-encoding according to these data blocks and redundant data blocks. In the embodiment of the present disclosure, the method for performing Raid processing on the target file is similar to the prior art, and will not be repeated here.
本实施例中,通过设置多个筛选的条件,能够实现对目标文件的准确定位,并且能够进一步的缩小目标文件的范围和数量,达到节约存储空间,提高存储空间利用率的目的。且由于Raid处理的文件的减少,能够有效减少用户访问损坏文件的等待时间,提高了用户体验。并且通过周期性筛选的方式,能够避免符合筛选条件的文件被漏掉,提高了系统的可靠性。In this embodiment, by setting multiple screening conditions, accurate positioning of the target file can be realized, and the scope and quantity of the target file can be further reduced, so as to save storage space and improve storage space utilization. In addition, due to the reduction of files processed by the Raid, the waiting time for users to access damaged files can be effectively reduced, thereby improving user experience. And through periodic screening, files meeting the screening conditions can be avoided from being missed, which improves the reliability of the system.
图3是根据一示例性实施例示出的一种文件处理装置实施例一的框图,如图3所示,该装置包括:Fig. 3 is a block diagram of Embodiment 1 of a file processing device according to an exemplary embodiment. As shown in Fig. 3 , the device includes:
获取模块11,被配置为获取文件的筛选条件;The obtaining module 11 is configured to obtain the filter conditions of the file;
筛选模块12,被配置为根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;The screening module 12 is configured to screen the files in the database according to the screening conditions to obtain the target file;
处理模块13,被配置为对所述目标文件进行Raid处理。The processing module 13 is configured to perform Raid processing on the target file.
其中,所述获取模块11包括:Wherein, the acquisition module 11 includes:
第一获取子模块111,被配置为从数据库中获取预先存储的筛选条件。The first obtaining submodule 111 is configured to obtain pre-stored filter conditions from a database.
第二获取子模块112,被配置为从用户交互界面上获取用户输入的筛选条件。The second obtaining sub-module 112 is configured to obtain the filter condition input by the user from the user interaction interface.
本实施例提供的文件处理装置可以用于执行图1所示方法实施例的技术方案,其执行方式和有益效果类似,在这里不再赘述。The file processing device provided in this embodiment can be used to execute the technical solution of the method embodiment shown in FIG. 1 , and its execution mode and beneficial effects are similar, and details are not repeated here.
图4是根据一示例性实施例示出的一种文件处理装置实施例二的框图,如图4所示,在图3所示实施例的基础上,所述所述筛选条件包括如下条件中的至少一种:文件类型、文件属性、文件名称、文件内容。Fig. 4 is a block diagram of Embodiment 2 of a file processing device according to an exemplary embodiment. As shown in Fig. 4, on the basis of the embodiment shown in Fig. 3, the filtering conditions include the following conditions At least one of: file type, file attribute, file name, file content.
所述筛选模块12包括:Described screening module 12 comprises:
第一筛选子模块121,被配置为从数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。The first screening submodule 121 is configured to filter out files meeting the at least one condition from the database as target files.
其中,所述第一筛选子模块121,还被配置为采用标准深度优先遍历方法或广度优先遍历方法,周期性的从所述数据库中筛选出同时符合所述至少一种条件的文件作为目标文件。Wherein, the first screening sub-module 121 is further configured to use a standard depth-first traversal method or a breadth-first traversal method to periodically filter out files that meet the at least one condition from the database as target files .
本实施例提供的文件处理装置可以用于执行图2所示方法实施例的技术方案,其执行方式和有益效果类似,在这里不再赘述。The file processing device provided in this embodiment can be used to execute the technical solution of the method embodiment shown in FIG. 2 , and its execution mode and beneficial effect are similar, and details are not repeated here.
关于上述实施例中的文件处理装置,其中各个模块、子模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。With regard to the file processing apparatus in the above embodiments, the specific manners of performing operations by various modules and sub-modules have been described in detail in the embodiments related to the method, and will not be described in detail here.
以上描述了文件处理装置的内部功能和结构,如图5所示,实际中,该文件处理装置可实现为服务器等文件处理设备,包括:The internal functions and structure of the file processing device have been described above, as shown in Figure 5, in practice, the file processing device can be implemented as a file processing device such as a server, including:
处理器;processor;
被配置为存储处理器可执行指令的存储器;memory configured to store processor-executable instructions;
其中,所述处理器被配置为:Wherein, the processor is configured as:
获取文件的筛选条件;Filter conditions for obtaining files;
根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;Filtering the files in the database according to the filtering conditions to obtain the target file;
对所述目标文件进行Raid处理。Raid processing is performed on the target file.
本实施例中,通过从数据库中筛选出符合特定筛选条件的文件作为目标文件,并对目标文件进行Raid处理,能够降低进行Raid处理的文件的数量,从而缩短了Raid处理的耗时,减少了对系统资源的占用。并且,由于进行Raid处理的文件仅是符合特定筛选条件的文件,而不是系统的所有文件,因此,经过Raid处理后,生成的冗余数据块的数量就减少了,节约了系统的存储空间。而且用户在访问损坏文件时,也会因为冗余数据块的减少,减少等待的时间。In this embodiment, by screening out the files that meet the specific screening conditions from the database as the target files, and performing Raid processing on the target files, the number of files for Raid processing can be reduced, thereby shortening the time-consuming of Raid processing and reducing the occupancy of system resources. Moreover, since the files that undergo Raid processing are only files that meet specific filtering conditions, rather than all files in the system, after Raid processing, the number of redundant data blocks generated is reduced, saving the storage space of the system. Moreover, when the user accesses the damaged file, the waiting time will also be reduced due to the reduction of redundant data blocks.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括存储指令的存储器,上述指令可由文件处理设备的处理器执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory storing instructions, which can be executed by a processor of the file processing device to implement the above method. For example, the non-transitory computer readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
一种非临时性计算机可读存储介质,当所述存储介质中的指令由文件处理设备的处理器执行时,使得文件处理设备能够执行一种文件处理方法,所述方法包括:A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of the file processing device, the file processing device can execute a file processing method, the method comprising:
获取文件的筛选条件;Filter conditions for obtaining files;
根据所述筛选条件对数据库中的文件进行筛选,获得目标文件;Filtering the files in the database according to the filtering conditions to obtain the target file;
对所述目标文件进行Raid处理。Raid processing is performed on the target file.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, and these modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The specification and examples are to be considered exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611187887.5A CN106855790A (en) | 2016-12-20 | 2016-12-20 | Document handling method, device and equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611187887.5A CN106855790A (en) | 2016-12-20 | 2016-12-20 | Document handling method, device and equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106855790A true CN106855790A (en) | 2017-06-16 |
Family
ID=59126435
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201611187887.5A Pending CN106855790A (en) | 2016-12-20 | 2016-12-20 | Document handling method, device and equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106855790A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109254731A (en) * | 2018-08-29 | 2019-01-22 | 郑州云海信息技术有限公司 | A kind of method and apparatus of memory space processing |
| CN116340268A (en) * | 2023-02-28 | 2023-06-27 | 上海安博通信息科技有限公司 | File traversal method and device and processing equipment |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102024059A (en) * | 2010-12-31 | 2011-04-20 | 成都市华为赛门铁克科技有限公司 | Method and device for protecting redundant array of independent disk in file system |
| CN102737031A (en) * | 2011-04-06 | 2012-10-17 | 鸿富锦精密工业(深圳)有限公司 | Test data report arranging system and method |
| CN104462349A (en) * | 2014-12-05 | 2015-03-25 | 曙光信息产业(北京)有限公司 | File processing method and file processing device |
| CN105183768A (en) * | 2015-07-31 | 2015-12-23 | 华为数字技术(成都)有限公司 | File management method, apparatus and terminal device |
-
2016
- 2016-12-20 CN CN201611187887.5A patent/CN106855790A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102024059A (en) * | 2010-12-31 | 2011-04-20 | 成都市华为赛门铁克科技有限公司 | Method and device for protecting redundant array of independent disk in file system |
| CN102737031A (en) * | 2011-04-06 | 2012-10-17 | 鸿富锦精密工业(深圳)有限公司 | Test data report arranging system and method |
| CN104462349A (en) * | 2014-12-05 | 2015-03-25 | 曙光信息产业(北京)有限公司 | File processing method and file processing device |
| CN105183768A (en) * | 2015-07-31 | 2015-12-23 | 华为数字技术(成都)有限公司 | File management method, apparatus and terminal device |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109254731A (en) * | 2018-08-29 | 2019-01-22 | 郑州云海信息技术有限公司 | A kind of method and apparatus of memory space processing |
| CN116340268A (en) * | 2023-02-28 | 2023-06-27 | 上海安博通信息科技有限公司 | File traversal method and device and processing equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104866497B (en) | The metadata updates method, apparatus of distributed file system column storage, host | |
| US20120303905A1 (en) | Method and apparatus for implementing cache | |
| WO2020215689A1 (en) | Query method and apparatus for column-oriented files | |
| CN113419824A (en) | Data processing method, device, system and computer storage medium | |
| US9836516B2 (en) | Parallel scanners for log based replication | |
| CN107562915A (en) | Read the method, apparatus and equipment and computer-readable recording medium of small documents | |
| WO2021051578A1 (en) | Method and device for performance feature dimensionality reduction, electronic device, and storage medium | |
| CN104199784B (en) | A kind of data migration method and device based on classification storage | |
| CN103020255A (en) | Hierarchical storage method and hierarchical storage device | |
| WO2020233046A1 (en) | Cache file management method and apparatus, computer device, and storage medium | |
| CN104156381A (en) | Copy access method and device of Hadoop distributed file system and Hadoop distributed file system | |
| CN106446155A (en) | Method and device for cleansingdata in cloud storage system | |
| CN113901057A (en) | Data playback method and device, computer equipment and storage medium | |
| CN105930537A (en) | Page storing method and electronic equipment | |
| US8385414B2 (en) | Multimedia size reduction for database optimization | |
| CN106227769B (en) | Date storage method and device | |
| CN106855790A (en) | Document handling method, device and equipment | |
| CN111752941B (en) | Data storage and access method and device, server and storage medium | |
| CN110222046B (en) | List data processing method, device, server and storage medium | |
| CN104598554B (en) | Webpage loading method and device | |
| CN113946274B (en) | Data processing methods, devices, equipment and media | |
| CN107329832A (en) | A kind of data receiver method and device | |
| CN117591018A (en) | A request processing method and device in a distributed object storage system | |
| CN107665224A (en) | Scan the mthods, systems and devices of HDFS cold datas | |
| CN110019448B (en) | Data interaction method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170616 |