[go: up one dir, main page]

CN110109884A - A kind of file reading, device, equipment and medium - Google Patents

A kind of file reading, device, equipment and medium Download PDF

Info

Publication number
CN110109884A
CN110109884A CN201910434286.7A CN201910434286A CN110109884A CN 110109884 A CN110109884 A CN 110109884A CN 201910434286 A CN201910434286 A CN 201910434286A CN 110109884 A CN110109884 A CN 110109884A
Authority
CN
China
Prior art keywords
file
target
preset threshold
mds
data size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910434286.7A
Other languages
Chinese (zh)
Inventor
张端
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910434286.7A priority Critical patent/CN110109884A/en
Publication of CN110109884A publication Critical patent/CN110109884A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种文件读取方法、装置、设备及介质,该方法的步骤包括:根据文件读取需求在MDS中读取相应的目标元数据,并获取记录于目标元数据中的目标文件的目标数据大小;当目标数据大小在预设阈值内或等于预设阈值时,在MDS中读取目标文件;其中,数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS。本方法通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。此外,本发明还提供一种文件读取装置、设备及介质,有益效果同上所述。

The invention discloses a file reading method, device, equipment and medium. The steps of the method include: reading the corresponding target metadata in the MDS according to the file reading requirement, and obtaining the target file recorded in the target metadata The target data size; when the target data size is within the preset threshold or equal to the preset threshold, the target file is read in the MDS; wherein, the files whose data size is within the preset threshold or equal to the preset threshold are pre-stored in the MDS. This method can relatively reduce the occupancy of OSD communication resources by pre-storing files with a data size within a certain threshold range in the MDS, relatively avoiding the delay and blocking of the OSD in the data communication process, and thus ensuring file reading. take the stability of the process. In addition, the present invention also provides a document reading device, equipment and medium, and the beneficial effects are the same as those described above.

Description

一种文件读取方法、装置、设备及介质A file reading method, device, equipment and medium

技术领域technical field

本发明涉及数据通信领域,特别是涉及一种文件读取方法、装置、设备及介质。The invention relates to the field of data communication, in particular to a file reading method, device, equipment and medium.

背景技术Background technique

随着计算机的普及和互联网技术的发展,数据文件正在海量且迅速地增长,这些数据文件通常被保存于计算机存储系统中以便用户对数据文件进行检索、分析。With the popularization of computers and the development of Internet technology, data files are growing massively and rapidly. These data files are usually stored in computer storage systems so that users can retrieve and analyze data files.

为了实现对文件读取的整体可靠性,当前通常采用分布式文件系统对数据文件进行存储,具体实现上是通过多台存储节点共同提供文件系统所需的存储空间,因此为了更加准确的在分布式文件系统中进行数据文件的读取,当前通常采用元数据(Metadata)对存储于存储节点的数据文件的相关信息进行记录,元数据,又称中介数据、中继数据,为描述数据的数据(data about data),主要是描述数据属性(property)的信息,用来支持如指示存储位置、历史数据、资源查找、文件记录等功能。为了更好的对元数据进行维护,在当前的使用场景中,元数据往往被单独存储于MDS(Metadata Server,元数据服务器)中,而数据文件被存储于OSD(Object Storage Device,对象存储设备)中,由于当前的数据文件的总数据量往往较庞大,因此通常预先被划分并存储于多个OSD中,进而分布式文件系统的客户端在访问某一个数据文件时,需要先访问MDS以获取到该数据文件的元数据,进而再根据元数据在多个OSD,或OSD的多个路径中获取相应的数据文件片段,最终组合为完整的数据文件,在这一过程中涉及到分布式文件系统的客户端与OSD的频繁交互,需要占用较多的通信资源,在此基础上,当分布式文件系统的客户端访问数据量较小且无需经过划分即可存储至OSD中的数据文件时,仍然需要遵照上述的操作过程,最终通过分布式文件系统的客户端与OSD进行交互以获取该数据文件,这将进一步加剧了对OSD的通信资源的占用,可能导致数据通信过程产生延时以及阻塞等异常情况,难以确保文件读取过程的稳定性。In order to achieve the overall reliability of file reading, the current distributed file system is usually used to store data files. The specific implementation is to provide the storage space required by the file system through multiple storage nodes. To read data files in a file system, metadata is usually used to record the relevant information of data files stored in storage nodes. Metadata, also known as intermediary data and relay data, is data describing data (data about data), mainly describes the information of data attributes (property), used to support functions such as indicating storage location, historical data, resource search, file recording, etc. In order to better maintain metadata, in current usage scenarios, metadata is often stored separately in MDS (Metadata Server, metadata server), while data files are stored in OSD (Object Storage Device, object storage device) ), because the total data volume of the current data file is often large, it is usually divided and stored in multiple OSDs in advance, and then when the client of the distributed file system accesses a data file, it needs to access the MDS first and then Obtain the metadata of the data file, and then obtain the corresponding data file fragments in multiple OSDs or multiple paths of the OSD according to the metadata, and finally combine them into a complete data file. In this process, distributed The frequent interaction between the client of the file system and the OSD needs to occupy more communication resources. On this basis, when the client of the distributed file system accesses a small amount of data and can be stored in the data file in the OSD without partitioning At the same time, it is still necessary to follow the above operation process, and finally interact with the OSD through the client of the distributed file system to obtain the data file, which will further increase the occupation of OSD communication resources and may cause delays in the data communication process And abnormal conditions such as blocking, it is difficult to ensure the stability of the file reading process.

由此可见,提供一种文件读取方法,以相对减少对OSD通信资源的占用,相对避免在数据通信过程中产生延时及阻塞,进而确保文件读取过程的稳定性,是本领域技术人员需要解决的问题。It can be seen that providing a file reading method to relatively reduce the occupancy of OSD communication resources, relatively avoid delay and blockage in the data communication process, and then ensure the stability of the file reading process is a matter for those skilled in the art. issues that need resolving.

发明内容Contents of the invention

本发明的目的是提供一种文件读取方法、装置、设备及介质,以相对减少对OSD通信资源的占用,相对避免在数据通信过程中产生延时及阻塞,进而确保文件读取过程的稳定性。The purpose of the present invention is to provide a file reading method, device, equipment and medium to relatively reduce the occupation of OSD communication resources, relatively avoid delay and blockage in the data communication process, and then ensure the stability of the file reading process sex.

为解决上述技术问题,本发明提供一种文件读取方法,包括:In order to solve the above technical problems, the present invention provides a file reading method, comprising:

根据文件读取需求在MDS中读取相应的目标元数据,并获取记录于目标元数据中的目标文件的目标数据大小;Read the corresponding target metadata in the MDS according to the file reading requirements, and obtain the target data size of the target file recorded in the target metadata;

当目标数据大小在预设阈值内或等于预设阈值时,在MDS中读取目标文件;其中,数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS。When the target data size is within or equal to the preset threshold, the target file is read in the MDS; wherein, the files whose data size is within the preset threshold or equal to the preset threshold are pre-stored in the MDS.

优选的,数据大小在预设阈值内的文件预先存储于MDS包括:Preferably, the files whose data size is within the preset threshold are stored in the MDS in advance, including:

数据大小在预设阈值内的文件预先作为元数据的扩展属性存储在MDS。Files whose data size is within the preset threshold are pre-stored in MDS as extended attributes of metadata.

优选的,该方法进一步包括:Preferably, the method further comprises:

当对目标文件进行追加写数据操作后导致目标文件的目标数据大小大于预设阈值时,在目标元数据的扩展属性中读取目标文件,并将目标文件存储至OSD。When the target data size of the target file is greater than a preset threshold after the additional data writing operation is performed on the target file, the target file is read from the extended attribute of the target metadata, and the target file is stored in the OSD.

优选的,该方法进一步包括:Preferably, the method further comprises:

当目标数据大小大于预设阈值时,根据目标元数据在OSD中读取目标文件。When the target data size is greater than the preset threshold, the target file is read in the OSD according to the target metadata.

此外,本发明还提供一种文件读取装置,包括:In addition, the present invention also provides a document reading device, including:

元数据读取模块,用于根据文件读取需求在MDS中读取相应的目标元数据,并获取记录于目标元数据中的目标文件的目标数据大小;The metadata reading module is used to read the corresponding target metadata in the MDS according to the file reading requirements, and obtain the target data size of the target file recorded in the target metadata;

小文件读取模块,用于当目标数据大小在预设阈值内或等于预设阈值时,在MDS中读取目标文件;其中,数据大小在预设阈值内的文件预先存储于MDS。The small file reading module is used to read the target file in the MDS when the target data size is within or equal to the preset threshold; wherein, the files whose data size is within the preset threshold are pre-stored in the MDS.

优选的,该装置进一步包括:Preferably, the device further comprises:

大文件读取模块,用于当目标数据大小大于预设阈值时,根据目标元数据在OSD中读取目标文件。The large file reading module is used to read the target file in the OSD according to the target metadata when the target data size is greater than a preset threshold.

此外,本发明还提供一种文件读取设备,包括:In addition, the present invention also provides a file reading device, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行计算机程序时实现如上述的文件读取方法的步骤。The processor is configured to realize the steps of the above-mentioned file reading method when executing the computer program.

此外,本发明还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的文件读取方法的步骤。In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned file reading method are realized.

本发明所提供的文件读取方法,将数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS,在执行文件读取操作时首先根据文件读取需求在MDS中读取相应的目标元数据,进而获取记录于目标元数据中的目标文件的目标数据大小,当目标数据大小在预设阈值内或等于预设阈值时,直接在MDS中读取目标文件。可见,本方法通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,进而当用户获取数据大小在该阈值范围内的目标文件时,则无需与OSD进行交互,因此能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。此外,本发明还提供一种文件读取装置、设备及介质,有益效果同上所述。In the file reading method provided by the present invention, the files whose data size is within or equal to the preset threshold are pre-stored in the MDS. The target metadata, and then obtain the target data size of the target file recorded in the target metadata, and when the target data size is within or equal to the preset threshold, directly read the target file in the MDS. It can be seen that this method pre-stores the files whose data size is within a certain threshold range in the MDS, and then when the user obtains the target file whose data size is within the threshold range, there is no need to interact with the OSD, so it can relatively reduce The occupancy of OSD communication resources relatively avoids the delay and blocking of OSD in the data communication process, thereby ensuring the stability of the file reading process. In addition, the present invention also provides a document reading device, equipment and medium, and the beneficial effects are the same as those described above.

附图说明Description of drawings

为了更清楚地说明本发明实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the embodiments of the present invention more clearly, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. As far as people are concerned, other drawings can also be obtained based on these drawings on the premise of not paying creative work.

图1为本发明实施例提供的一种文件读取方法的流程图;FIG. 1 is a flowchart of a file reading method provided by an embodiment of the present invention;

图2为本发明实施例提供的一种文件读取装置的结构图。Fig. 2 is a structural diagram of a document reading device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明的核心是提供一种文件读取方法,以相对减少对OSD通信资源的占用,相对避免在数据通信过程中产生延时及阻塞,进而确保文件读取过程的稳定性。本发明的另一核心是提供一种文件读取装置、设备及介质。The core of the present invention is to provide a file reading method to relatively reduce the occupancy of OSD communication resources, relatively avoid delay and blockage in the data communication process, and ensure the stability of the file reading process. Another core of the present invention is to provide a file reading device, device and medium.

为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

实施例一Embodiment one

图1为本发明实施例提供的一种文件读取方法的流程图。请参考图1,文件读取方法的具体步骤包括:FIG. 1 is a flowchart of a file reading method provided by an embodiment of the present invention. Please refer to Figure 1, the specific steps of the file reading method include:

步骤S10:根据文件读取需求在MDS中读取相应的目标元数据,并获取记录于目标元数据中的目标文件的目标数据大小。Step S10: Read the corresponding target metadata in the MDS according to the file reading requirement, and obtain the target data size of the target file recorded in the target metadata.

需要说明的是,本方法的执行主体可以为分布式文件系统中除MDS及OSD以外的分布式文件系统的客户端,该客户端由用户控制,根据用户需求与MDS及OSD进行相应的交互并获取相应的文件。本步骤即根据用户的文件读取需求在用于存储元数据的MDS中读取与用户所需文件相应的目标元数据,进而在目标元数据中获取到用户所需文件的相关属性信息,即目标文件的目标数据大小,此处的目标数据大小是指目标文件在OSD设备中所占的数据空间。It should be noted that the execution subject of this method can be a client of a distributed file system other than MDS and OSD in the distributed file system, the client is controlled by the user, and interacts with the MDS and OSD according to the user's needs and Get the corresponding file. This step is to read the target metadata corresponding to the file required by the user in the MDS used to store metadata according to the file reading requirements of the user, and then obtain the relevant attribute information of the file required by the user in the target metadata, namely The target data size of the target file, where the target data size refers to the data space occupied by the target file in the OSD device.

步骤S11:当目标数据大小在预设阈值内或等于预设阈值时,在MDS中读取目标文件。Step S11: When the target data size is within or equal to the preset threshold, read the target file in the MDS.

其中,数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS。Wherein, the files whose data size is within or equal to the preset threshold are pre-stored in the MDS.

在本步骤中,当获取到的目标数据大小在预设阈值内或等于预设阈值时,说明具有该目标数据大小的相应文件符合预设的目标文件类型,而该类型的目标文件预先被存储于MDS中。由于本步骤当目标数据大小在预设阈值内或等于预设阈值时,在MDS中获取目标文件,因此预先存储在MDS中的目标文件是分布式文件系统中数据大小相对较小的文件,预先将数据大小相对较小的文件存储在MDS中,可以在用户访问该文件时直接在MDS中获取到,无需分布式文件系统的客户端与OSD设备进行交互。本步骤中的预设阈值应根据分布式文件系统的实际使用场景而定,例如MDS设备的数据容量、以及MDS设备中的元数据量等,应保证MDS能够正常向客户端提供元数据。In this step, when the obtained target data size is within or equal to the preset threshold, it means that the corresponding file with the target data size conforms to the preset target file type, and the target file of this type is stored in advance in the MDS. In this step, when the target data size is within or equal to the preset threshold, the target file is obtained in the MDS, so the target file pre-stored in the MDS is a file with a relatively small data size in the distributed file system. A file with a relatively small data size is stored in the MDS, which can be directly obtained in the MDS when the user accesses the file, without requiring the client of the distributed file system to interact with the OSD device. The preset threshold in this step should be determined according to the actual usage scenario of the distributed file system, such as the data capacity of the MDS device and the amount of metadata in the MDS device, etc., and it should be ensured that the MDS can normally provide metadata to the client.

本发明所提供的文件读取方法,将数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS,在执行文件读取操作时首先根据文件读取需求在MDS中读取相应的目标元数据,进而获取记录于目标元数据中的目标文件的目标数据大小,当目标数据大小在预设阈值内或等于预设阈值时,直接在MDS中读取目标文件。可见,本方法通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,进而当用户获取数据大小在该阈值范围内的目标文件时,则无需与OSD进行交互,因此能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。In the file reading method provided by the present invention, the files whose data size is within or equal to the preset threshold are pre-stored in the MDS. The target metadata, and then obtain the target data size of the target file recorded in the target metadata, and when the target data size is within or equal to the preset threshold, directly read the target file in the MDS. It can be seen that this method pre-stores the files whose data size is within a certain threshold range in the MDS, and then when the user obtains the target file whose data size is within the threshold range, there is no need to interact with the OSD, so it can relatively reduce The occupancy of OSD communication resources relatively avoids the delay and blocking of OSD in the data communication process, thereby ensuring the stability of the file reading process.

实施例二Embodiment two

在上述实施例的基础上,本发明还提供以下一系列优选的实施方式。On the basis of the above embodiments, the present invention also provides the following series of preferred implementation manners.

作为一种优选的实施方式,数据大小在预设阈值内的文件预先存储于MDS包括:As a preferred implementation, pre-storing files whose data size is within the preset threshold in the MDS includes:

数据大小在预设阈值内的文件预先作为元数据的扩展属性存储在MDS。Files whose data size is within the preset threshold are pre-stored in MDS as extended attributes of metadata.

需要说明的是,由于考虑到在元数据的数据结构中预先设置有用于增加数据项的扩展属性,因此在本实施方式中,采用将文件预先存储在元数据中的扩展属性中,以此实现将文件存储于MDS中的目的,由于元数据的数据结构具有数据存储的稳定性,能够相对确保文件在MDS中存储时的可靠性。It should be noted that, considering that the data structure of the metadata is pre-set with extended attributes for adding data items, in this embodiment, files are pre-stored in the extended attributes of the metadata to achieve The purpose of storing files in MDS is to relatively ensure the reliability of files stored in MDS because the data structure of metadata has the stability of data storage.

在上述实施方式的基础上,作为一种优选的实施方式,该方法进一步包括:On the basis of the foregoing embodiments, as a preferred embodiment, the method further includes:

当对目标文件进行追加写数据操作后导致目标文件的目标数据大小大于预设阈值时,在目标元数据的扩展属性中读取目标文件,并将目标文件存储至OSD。When the target data size of the target file is greater than a preset threshold after the additional data writing operation is performed on the target file, the target file is read from the extended attribute of the target metadata, and the target file is stored in the OSD.

需要说明的是,本实施方式是考虑到存在对目标文件进行数据的追加写的情况时,目标文件的数据大小会不断增加,进而可能存在目标文件的目标数据大小超过预设阈值的情况,在此情况下,为了确保对目标文件的存储不对MDS的空间造成过度的占用,本实施方式当对目标文件进行追加写数据操作后导致目标文件的目标数据大小大于预设阈值时,在目标元数据的扩展属性中将目标文件读取出来,进而将目标文件存储至OSD中,以此避免了因目标文件的数据量不断增加而对MDS空间造成的过度占用,保证元数据能够正常存储在MDS中,进而确保了MDS能够正常向客户端提供元数据服务。It should be noted that this embodiment considers that when additional data is written to the target file, the data size of the target file will continue to increase, and there may be a situation where the target data size of the target file exceeds a preset threshold. In this case, in order to ensure that the storage of the target file does not cause excessive occupation of the MDS space, in this embodiment, when the target data size of the target file is greater than the preset threshold after the additional data writing operation is performed on the target file, the target metadata Read the target file from the extended attribute of the target file, and then store the target file in the OSD, so as to avoid the excessive occupation of the MDS space caused by the continuous increase of the data volume of the target file, and ensure that the metadata can be stored in the MDS normally , thus ensuring that the MDS can normally provide metadata services to the client.

在上述一系列实施方式的基础上,作为一种优选的实施方式,该方法进一步包括:On the basis of the series of implementations above, as a preferred implementation, the method further includes:

当目标数据大小大于预设阈值时,根据目标元数据在OSD中读取目标文件。When the target data size is greater than the preset threshold, the target file is read in the OSD according to the target metadata.

需要说明的是,在本实施方式中,预先将目标数据大小大于预设阈值的目标文件直接存储至OSD中,进而当目标数据大小大于预设阈值时,根据目标元数据在OSD中读取目标文件,相对避免了因将目标数据大小相对较大的目标文件存储至MDS中而对MDS空间造成的过度占用,进而保证了元数据能够正常存储在MDS中,确保MDS能够正常向客户端提供元数据服务。It should be noted that, in this embodiment, the target file whose target data size is greater than the preset threshold is directly stored in the OSD in advance, and then when the target data size is greater than the preset threshold, the target file is read from the OSD according to the target metadata. file, which relatively avoids excessive occupation of MDS space caused by storing target files with relatively large target data size in MDS, thereby ensuring that metadata can be stored in MDS normally, and ensuring that MDS can normally provide metadata to clients. data service.

实施例三Embodiment Three

在上文中对于文件读取方法的实施例进行了详细的描述,本发明还提供一种与该方法对应的文件读取装置,由于装置部分的实施例与方法部分的实施例相互对应,因此装置部分的实施例请参见方法部分的实施例的描述,这里暂不赘述。The embodiment of the file reading method has been described in detail above, and the present invention also provides a file reading device corresponding to the method. Since the embodiment of the device part corresponds to the embodiment of the method part, the device For some embodiments, please refer to the description of the embodiments in the method part, which will not be repeated here.

图2为本发明实施例提供的一种文件读取装置的结构图。本发明实施例提供的文件读取装置,包括:Fig. 2 is a structural diagram of a document reading device provided by an embodiment of the present invention. The file reading device provided by the embodiment of the present invention includes:

元数据读取模块10,用于根据文件读取需求在MDS中读取相应的目标元数据,并获取记录于目标元数据中的目标文件的目标数据大小。The metadata reading module 10 is configured to read the corresponding target metadata in the MDS according to the file reading requirement, and obtain the target data size of the target file recorded in the target metadata.

小文件读取模块11,用于当目标数据大小在预设阈值内或等于预设阈值时,在MDS中读取目标文件;其中,数据大小在预设阈值内的文件预先存储于MDS。The small file reading module 11 is used to read the target file in the MDS when the target data size is within or equal to the preset threshold; wherein, the files whose data size is within the preset threshold are pre-stored in the MDS.

本发明所提供的文件读取装置,将数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS,在执行文件读取操作时首先根据文件读取需求在MDS中读取相应的目标元数据,进而获取记录于目标元数据中的目标文件的目标数据大小,当目标数据大小在预设阈值内或等于预设阈值时,直接在MDS中读取目标文件。可见,本装置通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,进而当用户获取数据大小在该阈值范围内的目标文件时,则无需与OSD进行交互,因此能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。The file reading device provided by the present invention pre-stores files whose data size is within or equal to the preset threshold in the MDS, and first reads the corresponding The target metadata, and then obtain the target data size of the target file recorded in the target metadata, and when the target data size is within or equal to the preset threshold, directly read the target file in the MDS. It can be seen that this device pre-stores the files whose data size is within a certain threshold range in the MDS, and then when the user obtains the target file whose data size is within the threshold range, there is no need to interact with the OSD, so it can relatively reduce The occupancy of OSD communication resources relatively avoids the delay and blocking of OSD in the data communication process, thereby ensuring the stability of the file reading process.

在实施例三的基础上,该装置还包括:On the basis of embodiment three, the device also includes:

大文件读取模块,用于当目标数据大小大于预设阈值时,根据目标元数据在OSD中读取目标文件。The large file reading module is used to read the target file in the OSD according to the target metadata when the target data size is greater than a preset threshold.

实施例四Embodiment Four

此外,本发明还提供一种文件读取设备,包括:In addition, the present invention also provides a file reading device, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行计算机程序时实现如上述的文件读取方法的步骤。The processor is configured to realize the steps of the above-mentioned file reading method when executing the computer program.

本发明所提供的文件读取设备,将数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS,在执行文件读取操作时首先根据文件读取需求在MDS中读取相应的目标元数据,进而获取记录于目标元数据中的目标文件的目标数据大小,当目标数据大小在预设阈值内或等于预设阈值时,直接在MDS中读取目标文件。可见,本设备通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,进而当用户获取数据大小在该阈值范围内的目标文件时,则无需与OSD进行交互,因此能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。The file reading device provided by the present invention pre-stores files whose data size is within or equal to the preset threshold in the MDS, and first reads the corresponding The target metadata, and then obtain the target data size of the target file recorded in the target metadata, and when the target data size is within or equal to the preset threshold, directly read the target file in the MDS. It can be seen that this device pre-stores the files whose data size is within a certain threshold range in the MDS, and then when the user obtains the target file whose data size is within the threshold range, there is no need to interact with the OSD, so it can relatively reduce The occupancy of OSD communication resources relatively avoids the delay and blocking of OSD in the data communication process, thereby ensuring the stability of the file reading process.

此外,本发明还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的文件读取方法的步骤。In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned file reading method are implemented.

本发明所提供的计算机可读存储介质,将数据大小在预设阈值内或等于预设阈值的文件预先存储于MDS,在执行文件读取操作时首先根据文件读取需求在MDS中读取相应的目标元数据,进而获取记录于目标元数据中的目标文件的目标数据大小,当目标数据大小在预设阈值内或等于预设阈值时,直接在MDS中读取目标文件。可见,本计算机可读存储介质通过预先将数据大小在一定阈值范围内的文件预先存储于MDS中,进而当用户获取数据大小在该阈值范围内的目标文件时,则无需与OSD进行交互,因此能够相对减少对OSD通信资源的占用,相对避免了OSD在数据通信过程中产生延时及阻塞,进而确保了文件读取过程的稳定性。The computer-readable storage medium provided by the present invention pre-stores files whose data size is within or equal to the preset threshold in the MDS, and first reads the corresponding files in the MDS according to the file reading requirements when executing the file reading operation. The target metadata, and then obtain the target data size of the target file recorded in the target metadata, and when the target data size is within or equal to the preset threshold, the target file is directly read in the MDS. It can be seen that the computer-readable storage medium pre-stores files with a data size within a certain threshold range in the MDS in advance, and then when the user obtains a target file with a data size within the threshold range, there is no need to interact with the OSD, so It can relatively reduce the occupancy of OSD communication resources, relatively avoid the delay and blocking of OSD in the data communication process, and thus ensure the stability of the file reading process.

以上对本发明所提供的一种文件读取方法、装置、设备及介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The file reading method, device, equipment and medium provided by the present invention have been introduced in detail above. Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is no such actual relationship or order between the operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

Claims (8)

1. a kind of file reading characterized by comprising
Demand is read according to file and reads corresponding target metadata in MDS, and is obtained and be recorded in the target metadata File destination target data size;
When the target data size is in preset threshold or is equal to the preset threshold, the mesh is read in the MDS Mark file;Wherein, size of data is pre-stored within described in the preset threshold or equal to the file of the preset threshold MDS。
2. the method according to claim 1, wherein file of the size of data in the preset threshold is pre- Being first stored in the MDS includes:
File of the size of data in the preset threshold is used as the extended attribute of metadata to be stored in the MDS in advance.
3. according to the method described in claim 2, it is characterized in that, this method further comprises:
The target data size of the file destination is caused to be greater than institute after carrying out additional data writing operation to the file destination When stating preset threshold, the file destination is read in the extended attribute of the target metadata, and the file destination is deposited It stores up to OSD.
4. according to claim 1 to method described in 3, which is characterized in that this method further comprises:
When the target data size is greater than the preset threshold, the mesh is read in OSD according to the target metadata Mark file.
5. a kind of document reading apparatus characterized by comprising
Metadata read module reads corresponding target metadata for reading demand according to file in MDS, and obtains record The target data size of file destination in the target metadata;
Small documents read module is used for when the target data size in preset threshold or when being equal to the preset threshold, The file destination is read in the MDS;Wherein, file of the size of data in the preset threshold is pre-stored within described MDS。
6. device according to claim 5, which is characterized in that the device further comprises:
Big file read module is used for when the target data size is greater than the preset threshold, according to the target element number According to reading the file destination in OSD.
7. a kind of file reads equipment characterized by comprising
Memory, for storing computer program;
Processor realizes such as Claims 1-4 described in any item file readings when for executing the computer program The step of.
8. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program is realized when the computer program is executed by processor such as the described in any item file readings of Claims 1-4 Step.
CN201910434286.7A 2019-05-23 2019-05-23 A kind of file reading, device, equipment and medium Pending CN110109884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910434286.7A CN110109884A (en) 2019-05-23 2019-05-23 A kind of file reading, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910434286.7A CN110109884A (en) 2019-05-23 2019-05-23 A kind of file reading, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN110109884A true CN110109884A (en) 2019-08-09

Family

ID=67491832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910434286.7A Pending CN110109884A (en) 2019-05-23 2019-05-23 A kind of file reading, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110109884A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112738270A (en) * 2021-01-07 2021-04-30 苏州浪潮智能科技有限公司 File transmission method, device, equipment and storage medium
CN113961968A (en) * 2021-12-22 2022-01-21 北京安华金和科技有限公司 Method and device for carrying out data desensitization interrupt post-processing on file

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141685A (en) * 2015-08-18 2015-12-09 浪潮(北京)电子信息产业有限公司 File read-write system and meta data memory thereof as well as method and device for reading and writing files

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105141685A (en) * 2015-08-18 2015-12-09 浪潮(北京)电子信息产业有限公司 File read-write system and meta data memory thereof as well as method and device for reading and writing files

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李孟等: "《基于Hadoop的小文件存储优化方案》", 《电子科技大学学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112738270A (en) * 2021-01-07 2021-04-30 苏州浪潮智能科技有限公司 File transmission method, device, equipment and storage medium
CN112738270B (en) * 2021-01-07 2022-12-30 苏州浪潮智能科技有限公司 File transmission method, device, equipment and storage medium
US11792258B1 (en) 2021-01-07 2023-10-17 Inspur Suzhou Intelligent Technology Co., Ltd. File transmission method and apparatus, device, and storage medium
CN113961968A (en) * 2021-12-22 2022-01-21 北京安华金和科技有限公司 Method and device for carrying out data desensitization interrupt post-processing on file

Similar Documents

Publication Publication Date Title
US12197292B2 (en) Tiered cloud storage for different availability and performance requirements
US12333173B2 (en) Transparent data movement between a private cloud and storage ecosystem and another storage system
CN109947668B (en) Method and device for storing data
US20100325199A1 (en) Client, brokerage server and method for providing cloud storage
US9594677B2 (en) Computer system, data management method, and recording medium for storing program
CN103959264A (en) Using deduplication in a storage cloud to manage immutable redundant files
US20120173486A1 (en) System and method for dynamically selecting storage locations of replicas in cloud storage system
JP2006114045A (en) Mapping of schema data into data structure
JP2012526320A (en) Method and system for search using search engine indexing and index
CN107103011B (en) Method and device for realizing terminal data search
CN108563743A (en) A kind of file read/write method, system and equipment and storage medium
US10262024B1 (en) Providing consistent access to data objects transcending storage limitations in a non-relational data store
CN110546633A (en) Named entity based category tag addition for documents
CN110147203A (en) A file management method, device, electronic device and storage medium
CN107918527A (en) Memory allocation method and device and file memory method and device
US9716666B2 (en) Process cage providing attraction to distributed storage
CN110109884A (en) A kind of file reading, device, equipment and medium
EP2686791B1 (en) Variants of files in a file system
CN101483668A (en) Network storage and access method, device and system for hot spot data
CN112783887A (en) Data processing method and device based on data warehouse
CN107276833A (en) A kind of node information management method and device
CN107526530B (en) Data processing method and device
US8725765B2 (en) Hierarchical registry federation
CN116049238B (en) Node information query method, device, equipment, medium and program product
EP2819028A2 (en) Content management system

Legal Events

Date Code Title Description
PB01 Publication
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

Application publication date: 20190809

RJ01 Rejection of invention patent application after publication