WO2017036308A1 - File uploading method, access method, device and apparatus - Google Patents

File uploading method, access method, device and apparatus Download PDF

Info

Publication number
WO2017036308A1
WO2017036308A1 PCT/CN2016/095856 CN2016095856W WO2017036308A1 WO 2017036308 A1 WO2017036308 A1 WO 2017036308A1 CN 2016095856 W CN2016095856 W CN 2016095856W WO 2017036308 A1 WO2017036308 A1 WO 2017036308A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
target
subfile
attribute information
Prior art date
Application number
PCT/CN2016/095856
Other languages
French (fr)
Chinese (zh)
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
Application filed by 阿里巴巴集团控股有限公司, 王银瓶, 蔡瀛 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017036308A1 publication Critical patent/WO2017036308A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to a file uploading method, an access method, an apparatus, and a device.
  • an uploading device for uploading real-time files and a distributed file system for saving files are included, and the distributed file system includes multiple storage servers, and the user terminal can be in a distributed file system.
  • the file is accessed.
  • When uploading a device to upload a target file to a distributed file system it is necessary to add meta (meta) information at the end of the target file, and when the user terminal accesses the target file from the distributed file system, by reading The meta information parses the target file.
  • the uploading device may divide the file data into several sub-files, and add corresponding meta information at the end of each sub-file.
  • the number of files in the distributed file system is increased, and a large amount of meta information needs to be maintained in the distributed file system.
  • the subfiles in the distributed file system are synthesized into target files, and the user cannot access the synthetic operation.
  • the application provides a file uploading method, an access method, a device and a device, so as to solve the problem that the existing file uploading method increases the number of files in the system, and the synthetic file consumes system processing resources, which is inconvenient for access.
  • a file uploading method is provided, where the method is applied to an uploading device that uploads a file to a distributed file system in real time, and the method includes:
  • the update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  • a file access method is provided, and the method is used to access a file uploaded to a distributed file system by using the foregoing file uploading method, where the method includes:
  • the file data to be accessed read from the target subfile is provided to the client device.
  • a file uploading apparatus is provided, where the apparatus is applied to an uploading device that uploads a file to a distributed file system in real time, and the apparatus includes:
  • An obtaining unit configured to acquire target file data of the target file
  • a packaging unit configured to encapsulate the target file data into a subfile
  • a uploading unit configured to write at least one of the subfiles to a data file of the target file in the distributed file system, and write update meta information of the data file after the at least one subfile
  • the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  • a file accessing device for accessing a file uploaded to a distributed file system by using the foregoing file uploading device, the device comprising:
  • a receiving unit configured to receive a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
  • a obtaining unit configured to obtain, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
  • an access unit configured to provide the to-be-accessed file data read from the target sub-file to the client device.
  • a file uploading apparatus including:
  • processor a memory for storing the processor executable instructions
  • processor is configured to:
  • the update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  • a storage server including:
  • processor a memory for storing the processor executable instructions
  • processor is configured to:
  • the file data to be accessed read from the target subfile is provided to the client device.
  • the sub-file is not directly uploaded to the distributed file system, but the sub-file is written to the data file of the target file.
  • the update meta information includes attribute information of all subfiles of the target file that has been written to the distributed file system, only one update meta information needs to be maintained.
  • the client device can directly access any of the data files according to the updated metadata information of the current data file.
  • the subfile of the uploaded target file so that the client device can read the file data of the target file in the distributed file system at any time.
  • FIG. 1 is a schematic structural diagram of a system for implementing file uploading and accessing by applying an embodiment of the present application
  • FIG. 2A is a flowchart of an embodiment of a method for uploading a file according to the present application
  • 2B is a schematic structural diagram of a data file uploaded by applying an embodiment of the file uploading method of the present application
  • FIG. 3 is a flowchart of an embodiment of a method for accessing a file according to the present application
  • 4A is a hardware structural diagram of a device where an embodiment of a file uploading apparatus is located;
  • 4B is a hardware structural diagram of a device where an embodiment of a file access device of the present application is located;
  • Figure 5 is a block diagram of an embodiment of the file uploading apparatus of the present application.
  • FIG. 6 is a block diagram of an embodiment of a file access device of the present application.
  • first, second, third, etc. may be used to describe various information in this application, such information should not be limited to these terms. These terms are only used to refer to the same type of information. This area is separate.
  • the first information may also be referred to as the second information without departing from the scope of the present application.
  • the second information may also be referred to as the first information.
  • the word "if” as used herein may be interpreted as "when” or “when” or "in response to a determination.”
  • FIG. 1 a schematic diagram of a system architecture for implementing file uploading and accessing by applying the embodiment of the present application:
  • the system shown in FIG. 1 includes: a file uploading device, a distributed file system including N storage servers, and a client device.
  • the file uploading device is configured to upload the target file to the distributed file system
  • the client device is configured to access the uploaded target file from the distributed file system.
  • the file uploading device when uploading the target file, encapsulates the file data of the target file into a subfile, and then writes the subfile to the data file of the target file, and then writes the data file after the subfile.
  • Update metadata information which includes attribute information of all subfiles of the target file that have been written to the distributed file system, that is, each time the current subfile is written and the current subfile is included on the basis of the original data file.
  • Attribute information of all uploaded sub-files when the client device wants to access the target file, it can directly access the sub-file of any uploaded target file according to the update meta-information of the current data file, thereby ensuring the client
  • the device reads the file data of the target file in the distributed file system at any time.
  • FIG. 2A is a flowchart of an embodiment of a method for uploading a file according to the present application.
  • the embodiment may be applied to an uploading device for uploading files to a distributed file system in real time, including the following steps:
  • Step 201 Acquire target file data of the target file.
  • the uploading device can obtain the file data of the target file through the real-time data channel, and the file data of each target file cannot be obtained in one time, so the time period can be set in advance, and the file data is obtained according to the time period, and each The file data acquired during the time period is called the target file data, and the target file data is usually saved in the memory of the uploading device.
  • the uploading device may determine whether a preset time period is reached. If the time period is reached, the file data received during the time may be obtained from the memory as the target file data of the target file. .
  • the target file is the electronic novel "Deer" to be uploaded. Ding Ji, the electronic novel has 508 pages, the file data is all the bytes corresponding to the text content of the electronic novel; assuming the preset time period is 1 minute, the uploading device obtains 10 pages of text content in 1 minute. , all the bytes corresponding to the 10 pages of text content are the target file data acquired by the uploading device within 1 minute.
  • Step 202 Encapsulate the target file data into a subfile.
  • the saved target file data may be packaged in the sub-file encapsulation format in the memory, and the corresponding meta information is added after the target file data, thereby generating a sub- A file in which meta information of a subfile is information for parsing a subfile.
  • Step 203 Write at least one subfile to the data file of the target file in the distributed file system.
  • the entire sub-file of the uploaded target file is referred to as the data file of the target file, and when the sub-file of the target file is uploaded, at least one sub-fold is uploaded each time according to the generation order of the sub-file.
  • the file therefore, the data file of the target file is a file that dynamically changes as the subfile is uploaded (this data file can also be referred to as an otar file in this embodiment).
  • the at least one subfile is written to the end of the data file of the target file in the distributed file system, and the end of the data file includes data before the at least one subfile is written Meta-information of a file including attribute information of all sub-files of the target file that have been written to the data file before the at least one sub-file.
  • the append command in the java language may be used, and the append command may be used to insert the specified content at the end of the selected element.
  • the append command may be used.
  • At least one subfile is inserted at the end of the data file, and subsequent update meta information of the data file can be inserted after the at least one subfile by the append command.
  • Step 204 Write update meta information of the data file after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the written target file.
  • the historical meta information of the data file before the at least one subfile is written to the data file, and the historical meta information includes attributes of all subfiles of the target file written before the at least one subfile.
  • Information then generating attribute information of the uploaded at least one subfile in the data file, and generating update metadata information of the data file according to the attribute information of the subfile included in the historical meta information and the attribute information of the at least one subfile, and finally
  • the generated update meta information is written after the at least one subfile in the data file, that is, the meta information of the data file written after the at least one subfile includes attribute information of all subfiles of the written target file. .
  • the history information of the data file includes the attribute information of the n subfiles of the subfile 0 to the subfile n
  • the update meta information written at the end of the data file is included. Attribute information of sub-file 0 to n+1 sub-files of sub-file n+1.
  • the attribute information of the subfile may include: offset information of the subfile in the data file (File offset in otar), length of the subfile (File size in otar), and number of data rows included in the subfile (Record) Count), and other attribute information (Other info) of the subfile, for example, statistical information, or custom information.
  • 2B is a schematic diagram of a structure of a data file uploaded by applying an embodiment of the file uploading method of the present application.
  • the structure of the data file is described below in conjunction with a sub-file uploading process.
  • each sub-file encapsulated by the uploading device is consistent with the prior art, and includes file data of the sub-file and meta-information of the sub-file, and the sub-file encapsulation process is not further described later, and the encapsulated sub-process is directly The file is described.
  • First upload Upload the device to complete the first subfile 0 of the target file, upload the subfile 0 to the distributed file system, and add all subfiles of the uploaded target file at the end of subfile 0.
  • the attribute information at this time, only the attribute information of the subfile 0 is included as the update meta information of the data file 1;
  • Second upload uploads the second subfile 1 of the device package completion target file, uploads the subfile 1 to the data file 1 in the distributed file system, and adds the uploaded target at the end of the subfile 1.
  • the attribute information of all the subfiles of the file, at this time including the attribute information of the subfile 0 and the subfile 1, as the update meta information of the data file 2;
  • the meta information of the data file of the dynamically generated target file includes attribute information of all uploaded subfiles, and the attribute information may include subfile offset, subfile length, and subfile data. The number of rows, other attribute information of the subfile, and so on.
  • the embodiment does not directly upload the subfile to the distributed file system, but writes the subfile to the data file of the target file.
  • the update meta information includes attribute information of all subfiles of the target file that has been written to the distributed file system, only one update meta information needs to be maintained. Yes, the meta information of each subfile is separately maintained, and the subfiles are not synthesized into the target file, thereby saving the storage resources and maintenance resources of the system.
  • FIG. 3 is a flowchart of an embodiment of a file access method of the present application.
  • the embodiment may be applied to a storage server of a distributed file system, and used to implement uploading and distributing the file uploading method embodiment shown in FIG. 2A.
  • File access in the file system :
  • Step 301 Receive a file access command of a data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed.
  • the file access command of the data file is sent to the distributed file system, and the file access command may include the attribute information of the file data to be accessed, which is referred to in this embodiment.
  • the target attribute information for example, the target attribute information may be the number of lines of the file data to be accessed in the target file.
  • Step 302 Obtain a target sub-file corresponding to the file data to be accessed in the data file according to the target attribute information and the update meta-information of the data file.
  • the update meta-information at the end of the data file of the target file includes attribute information of all uploaded sub-files, and thus can be based on the target genus.
  • the sexual information is sequentially matched with the attribute information of each subfile in the updated meta information. For example, when the target attribute information is the number of rows, the row number information in the attribute information of each subfile can be matched, when from each subfile.
  • the subfile corresponding to the target attribute information may be determined as the target subfile.
  • Step 303 Provide the to-be-accessed file data read from the target sub-file to the client device.
  • the file data of the target subfile may be parsed according to the meta information of the target subfile, and the file data to be accessed is read from the parsed file data according to the target attribute information, and then the file is accessed to the client.
  • the device transmits the read file data to be accessed.
  • the target attribute information included in the received file access command is the target line number information, the target line number information and the meta information of the data file 3 (Otar Meta(File0, File1, File2, File3))
  • the number of lines in the attribute information of the neutron file 0 to the subfile 3 is matched, and the subfile to which the target line number information belongs is determined as the target subfile, and if the target subfile is the subfile 1, the further According to the offset information and the length information in the attribute information of the subfile 1, the subfile 1 is obtained from the data file 3, and the subfile 1 is parsed according to the meta information (File1Meta) of the subfile 1, so that the subfile is obtained from the subfile.
  • the file data to be accessed is read from the file data of 1.
  • the client device can directly access the subfile of any uploaded target file according to the updated meta information of the current data file, thereby ensuring the client.
  • the end device reads the file data of the target file in the distributed file system at any time.
  • the embodiment of the file uploading apparatus can be applied to a file uploading device, and an embodiment of the file accessing apparatus can be applied to a storage server.
  • the device embodiment may be implemented by software, or may be implemented by hardware or a combination of hardware and software. Taking the software implementation as an example, as a logical means, the processor of the device in which it is located reads the corresponding computer program instructions in the non-volatile memory into the memory. From the hardware level, as shown in FIG. 4A and FIG. 4B, respectively, the hardware structure diagram of the device where the file uploading device and the file access device are located, except for the processor, the memory, the network interface, and the non-display shown in FIG. 4A and FIG. 4B. Beyond volatile memory, real The device in which the device is located in the embodiment may also include other hardware according to the actual function of the device, which is not shown in FIG. 4A and FIG. 4B.
  • FIG. 5 it is a block diagram of an embodiment of a file uploading apparatus of the present application, which may be applied to an uploading device that uploads files in real time to a distributed file system:
  • the file uploading device includes an obtaining unit 510, a packaging unit 520, and an uploading unit 530.
  • the obtaining unit 510 is configured to acquire target file data of the target file.
  • a packaging unit 520 configured to encapsulate the target file data into a subfile
  • the uploading unit 530 is configured to write at least one of the subfiles to a data file of the target file in the distributed file system, and write an update element of the data file after the at least one subfile Information, the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  • the obtaining unit 510 may include (not shown in FIG. 5):
  • a period determining subunit configured to determine whether a preset time period is reached
  • a data obtaining subunit configured to acquire file data of the target file received in the time period if the time period is reached, and use the acquired file data as the target file data.
  • the package unit 520 can include (not shown in FIG. 5):
  • a data writing subunit configured to package the target file data that has been written into the memory according to a subfile encapsulation format
  • the meta information adding subunit is configured to generate the subfile after adding the meta information of the target file data after the target file data.
  • the uploading unit 530 can include (not shown in FIG. 5):
  • a historical meta information obtaining subunit configured to acquire historical meta information of the data file before the at least one subfile is written into the data file, where the historical meta information is included in the at least Attribute information of a subfile of the target file written before a subfile;
  • An attribute information generating subunit configured to generate attribute information of the at least one subfile in the data file
  • An update meta information generating subunit configured to generate updated meta information of the data file according to attribute information of the subfile included in the historical meta information and attribute information of the at least one subfile;
  • the update meta information is written to the subunit for writing the update meta information after at least one subfile in the data file.
  • the attribute information of the subfile may include:
  • the offset information of the subfile in the data file the length of the subfile, and the number of data rows included in the subfile.
  • FIG. 6 a block diagram of an embodiment of a file access device for accessing a file uploaded to a distributed file system using the device shown in FIG. 5 is used:
  • the file access device includes a receiving unit 610, an obtaining unit 620, and an access unit 630.
  • the receiving unit 610 is configured to receive a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed.
  • the obtaining unit 620 is configured to obtain, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
  • the access unit 630 is configured to provide the to-be-accessed file data read from the target sub-file to the client device.
  • the obtaining unit 620 may include (not shown in FIG. 6):
  • An attribute information matching subunit configured to match attribute information of each subfile in the update meta information according to the target attribute information
  • the subfile determining subunit is configured to determine, as the target subfile, a subfile corresponding to the target attribute information when the target attribute information is matched from the attribute information of each of the subfiles.
  • the access unit 630 can include (not shown in FIG. 6):
  • a subfile parsing subunit configured to parse file data of the target subfile according to meta information of the target subfile
  • a file data reading subunit configured to read the to-be-accessed file data from the parsed file data according to the target attribute information
  • a file data transmission subunit configured to transmit the to-be-accessed file data to the client device.
  • the device embodiment since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present application. Those of ordinary skill in the art can understand and implement without any creative effort.
  • the one piece updates the meta information, avoids maintaining the meta information of each subfile separately, and does not need to synthesize the subfile into the target file, thereby saving the storage resource and maintenance resources of the system; based on the data file of the foregoing upload target file, due to the client
  • the end device can directly access the subfile of any uploaded target file according to the update meta information of the current data file, so that the client device can read the file data of the target file in the distributed file system at any time.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present application discloses a file uploading method, access method, device and apparatus. The file uploading method comprises: receiving target file data of a target file; packaging the target file data as sub-files; writing at least one of the sub-files in a data file of the target file in a distributed file system; and appending update meta-information of the data file to said at least one sub-file, wherein the update meta-information of the data file comprises attribute information of all sub-files of the target file that are written. In an embodiment of the present application, only one piece of update meta-information comprising attribute information of all sub-files is maintained during a file upload, thereby preventing separate maintenance operation of meta-information for each sub-file, and saving a storage resource and maintenance resource of the system accordingly. In addition, synthesizing sub-files into a target file is not necessary, thus allowing a client device to read file data of a target file in a distributed file system at any time.

Description

文件上传方法、访问方法、装置及设备File uploading method, access method, device and device 技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及文件上传方法、访问方法、装置及设备。The present application relates to the field of data processing technologies, and in particular, to a file uploading method, an access method, an apparatus, and a device.
背景技术Background technique
在云存储网络架构中,通常包括用于上传实时文件的上传设备,以及用于保存文件的分布式文件系统,该分布式文件系统中包括多台存储服务器,用户终端可以对分布式文件系统中的文件进行访问。在上传设备将某个目标文件上传到分布式文件系统中时,需要在该目标文件的结尾处添加meta(元)信息,当用户终端从分布式文件系统中访问该目标文件时,通过读取meta信息对目标文件进行解析。In the cloud storage network architecture, an uploading device for uploading real-time files and a distributed file system for saving files are included, and the distributed file system includes multiple storage servers, and the user terminal can be in a distributed file system. The file is accessed. When uploading a device to upload a target file to a distributed file system, it is necessary to add meta (meta) information at the end of the target file, and when the user terminal accesses the target file from the distributed file system, by reading The meta information parses the target file.
现有技术中,为满足用户终端可以尽快访问目标文件的文件数据的目的,上传设备可以将文件数据分成若干子文件上传,每个子文件的结尾处都要添加相应的meta信息,这种上传方式增加了分布式文件系统中的文件数量,需要在分布式文件系统中维护大量meta信息;后续还需要定期将分布式文件系统中的子文件合成为目标文件,在执行合成操作时,用户无法访问到文件数据,并且由于需要频繁读写子文件,因此耗费大量的系统处理资源。In the prior art, in order to satisfy the purpose that the user terminal can access the file data of the target file as soon as possible, the uploading device may divide the file data into several sub-files, and add corresponding meta information at the end of each sub-file. The number of files in the distributed file system is increased, and a large amount of meta information needs to be maintained in the distributed file system. Subsequently, the subfiles in the distributed file system are synthesized into target files, and the user cannot access the synthetic operation. To file data, and because of the need to frequently read and write sub-files, it consumes a lot of system processing resources.
发明内容Summary of the invention
本申请提供文件上传方法、访问方法、装置及设备,以解决现有文件上传方式增加系统中的文件数量,导致合成文件耗费系统处理资源,不便于用于访问的问题。The application provides a file uploading method, an access method, a device and a device, so as to solve the problem that the existing file uploading method increases the number of files in the system, and the synthetic file consumes system processing resources, which is inconvenient for access.
根据本申请实施例的第一方面,提供一种文件上传方法,所述方法应用在向分布式文件系统实时上传文件的上传设备上,所述方法包括:According to a first aspect of the embodiments of the present application, a file uploading method is provided, where the method is applied to an uploading device that uploads a file to a distributed file system in real time, and the method includes:
获取目标文件的目标文件数据; Obtain target file data of the target file;
将所述目标文件数据封装为子文件;Encapsulating the target file data into a subfile;
将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上;Writing at least one of the subfiles to a data file of the target file in the distributed file system;
在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。The update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
根据本申请实施例的第二方面,提供一种文件访问方法,所述方法用于对采用前述文件上传方法上传到分布式文件系统中的文件进行访问,所述方法包括:According to a second aspect of the embodiments of the present application, a file access method is provided, and the method is used to access a file uploaded to a distributed file system by using the foregoing file uploading method, where the method includes:
接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;Receiving a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;Obtaining, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。The file data to be accessed read from the target subfile is provided to the client device.
根据本申请实施例的第三方面,提供一种文件上传装置,所述装置应用在向分布式文件系统实时上传文件的上传设备上,所述装置包括:According to a third aspect of the embodiments of the present application, a file uploading apparatus is provided, where the apparatus is applied to an uploading device that uploads a file to a distributed file system in real time, and the apparatus includes:
获取单元,用于获取目标文件的目标文件数据;An obtaining unit, configured to acquire target file data of the target file;
封装单元,用于将所述目标文件数据封装为子文件;a packaging unit, configured to encapsulate the target file data into a subfile;
上传单元,用于将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上,并在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。a uploading unit, configured to write at least one of the subfiles to a data file of the target file in the distributed file system, and write update meta information of the data file after the at least one subfile The update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
根据本申请实施例的第四方面,提供一种文件访问装置,所述装置用于对采用前述文件上传装置上传到分布式文件系统中的文件进行访问,所述装置包括:According to a fourth aspect of the embodiments of the present application, there is provided a file accessing device, the device for accessing a file uploaded to a distributed file system by using the foregoing file uploading device, the device comprising:
接收单元,用于接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息; a receiving unit, configured to receive a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
获得单元,用于根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;a obtaining unit, configured to obtain, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
访问单元,用于将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。And an access unit, configured to provide the to-be-accessed file data read from the target sub-file to the client device.
根据本申请实施例的第五方面,提供一种文件上传设备,包括:According to a fifth aspect of the embodiments of the present application, a file uploading apparatus is provided, including:
处理器;用于存储所述处理器可执行指令的存储器;a processor; a memory for storing the processor executable instructions;
其中,所述处理器被配置为:Wherein the processor is configured to:
获取目标文件的目标文件数据;Obtain target file data of the target file;
将所述目标文件数据封装为子文件;Encapsulating the target file data into a subfile;
将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上;Writing at least one of the subfiles to a data file of the target file in the distributed file system;
在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。The update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
根据本申请实施例的第六方面,提供一种存储服务器,包括:According to a sixth aspect of the embodiments of the present application, a storage server is provided, including:
处理器;用于存储所述处理器可执行指令的存储器;a processor; a memory for storing the processor executable instructions;
其中,所述处理器被配置为:Wherein the processor is configured to:
接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;Receiving a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;Obtaining, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。The file data to be accessed read from the target subfile is provided to the client device.
应用本申请实施例上传文件时,在将目标文件的文件数据封装为子文件后,并不直接向分布式文件系统上传子文件,而是将子文件写入到目标文件的数据文件上后,在该子文件之后写入数据文件的更新元信息,由于该更新元信息中包含了已写入分布式文件系统的目标文件的所有子文件的属性信息,因此只需要维护该一条更新元信息即可,避免对每个子文件的元信息分别维 护,也无需将子文件合成目标文件,从而节省了系统的存储资源和维护资源;基于前述上传目标文件的数据文件,由于客户端设备可以直接根据当前数据文件的更新元信息访问到任一已上传的目标文件的子文件,因此可以保证客户端设备在任意时间对分布式文件系统中目标文件的文件数据进行读取。When the file is uploaded in the embodiment of the present application, after the file data of the target file is encapsulated into a sub-file, the sub-file is not directly uploaded to the distributed file system, but the sub-file is written to the data file of the target file. After the subfile is written to the update meta information of the data file, since the update meta information includes attribute information of all subfiles of the target file that has been written to the distributed file system, only one update meta information needs to be maintained. Yes, avoid the separate dimension of the meta information of each subfile Protection, there is no need to synthesize the sub-file into the target file, thereby saving the storage resources and maintenance resources of the system; based on the data file of the foregoing upload target file, the client device can directly access any of the data files according to the updated metadata information of the current data file. The subfile of the uploaded target file, so that the client device can read the file data of the target file in the distributed file system at any time.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。The above general description and the following detailed description are intended to be illustrative and not restrictive.
附图说明DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The drawings herein are incorporated in and constitute a part of the specification,
图1为应用本申请实施例实现文件上传及访问的系统架构示意图;1 is a schematic structural diagram of a system for implementing file uploading and accessing by applying an embodiment of the present application;
图2A为本申请文件上传方法的一个实施例流程图;2A is a flowchart of an embodiment of a method for uploading a file according to the present application;
图2B为应用本申请文件上传方法实施例上传的数据文件结构示意图;2B is a schematic structural diagram of a data file uploaded by applying an embodiment of the file uploading method of the present application;
图3为本申请文件访问方法的一个实施例流程图;FIG. 3 is a flowchart of an embodiment of a method for accessing a file according to the present application; FIG.
图4A为本申请文件上传装置实施例所在设备的一种硬件结构图;4A is a hardware structural diagram of a device where an embodiment of a file uploading apparatus is located;
图4B为本申请文件访问装置实施例所在设备的一种硬件结构图;4B is a hardware structural diagram of a device where an embodiment of a file access device of the present application is located;
图5为本申请文件上传装置的一个实施例框图;Figure 5 is a block diagram of an embodiment of the file uploading apparatus of the present application;
图6为本申请文件访问装置的一个实施例框图。FIG. 6 is a block diagram of an embodiment of a file access device of the present application.
具体实施方式detailed description
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the present application is for the purpose of describing particular embodiments, and is not intended to be limiting. The singular forms "a", "the" and "the" It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼 此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used to describe various information in this application, such information should not be limited to these terms. These terms are only used to refer to the same type of information. This area is separate. For example, the first information may also be referred to as the second information without departing from the scope of the present application. Similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination."
参见图1,为应用本申请实施例实现文件上传及访问的系统架构示意图:Referring to FIG. 1 , a schematic diagram of a system architecture for implementing file uploading and accessing by applying the embodiment of the present application:
图1示出的系统中包括:文件上传设备、包括N个存储服务器的分布式文件系统、以及客户端设备。其中,文件上传设备用于将目标文件上传到分布式文件系统,客户端设备用于从分布式文件系统中访问已上传的目标文件。The system shown in FIG. 1 includes: a file uploading device, a distributed file system including N storage servers, and a client device. The file uploading device is configured to upload the target file to the distributed file system, and the client device is configured to access the uploaded target file from the distributed file system.
本申请实施例中,文件上传设备在上传目标文件时,将目标文件的文件数据封装为子文件后,将子文件写入到目标文件的数据文件上后,在该子文件之后写入数据文件的更新元信息,该更新元信息中包含了已写入分布式文件系统的目标文件的所有子文件的属性信息,即每次都在原数据文件基础上写入当前子文件以及包括该当前子文件在内的所有已上传子文件的属性信息;当客户端设备要访问目标文件时,可以直接根据当前数据文件的更新元信息访问到任一已上传的目标文件的子文件,因此可以保证客户端设备在任意时间对分布式文件系统中目标文件的文件数据进行读取。下面将结合具体的实施例对申请进行详细描述。In the embodiment of the present application, when uploading the target file, the file uploading device encapsulates the file data of the target file into a subfile, and then writes the subfile to the data file of the target file, and then writes the data file after the subfile. Update metadata information, which includes attribute information of all subfiles of the target file that have been written to the distributed file system, that is, each time the current subfile is written and the current subfile is included on the basis of the original data file. Attribute information of all uploaded sub-files; when the client device wants to access the target file, it can directly access the sub-file of any uploaded target file according to the update meta-information of the current data file, thereby ensuring the client The device reads the file data of the target file in the distributed file system at any time. The application will be described in detail below in conjunction with specific embodiments.
参见图2A,为本申请为本申请文件上传方法的一个实施例流程图,该实施例可以应用在向分布式文件系统实时上传文件的上传设备上,包括以下步骤:2A is a flowchart of an embodiment of a method for uploading a file according to the present application. The embodiment may be applied to an uploading device for uploading files to a distributed file system in real time, including the following steps:
步骤201:获取目标文件的目标文件数据。Step 201: Acquire target file data of the target file.
本实施例中,上传设备可以通过实时数据通道获取到目标文件的文件数据,每个目标文件的文件数据通常无法一次性获取,因此可以预先设置时间周期,按照该时间周期获取文件数据,每个时间周期内获取的文件数据称为目标文件数据,目标文件数据通常保存在上传设备的内存中。In this embodiment, the uploading device can obtain the file data of the target file through the real-time data channel, and the file data of each target file cannot be obtained in one time, so the time period can be set in advance, and the file data is obtained according to the time period, and each The file data acquired during the time period is called the target file data, and the target file data is usually saved in the memory of the uploading device.
因此在一个可选的实施方式中,上传设备可以判断是否到达预设的时间周期,如果到达该时间周期,则可以从内存中获取在该时间内接收到的文件数据作为目标文件的目标文件数据。例如,目标文件为待上传的电子小说《鹿 鼎记》,该电子小说共有508页,文件数据即为组成该电子小说的文字内容对应的所有字节;假设预设的时间周期为1分钟,上传设备在1分钟内获取到10页文字内容,则该10页文字内容对应的所有字节即为上传设备在1分钟内获取的目标文件数据。Therefore, in an optional implementation manner, the uploading device may determine whether a preset time period is reached. If the time period is reached, the file data received during the time may be obtained from the memory as the target file data of the target file. . For example, the target file is the electronic novel "Deer" to be uploaded. Ding Ji, the electronic novel has 508 pages, the file data is all the bytes corresponding to the text content of the electronic novel; assuming the preset time period is 1 minute, the uploading device obtains 10 pages of text content in 1 minute. , all the bytes corresponding to the 10 pages of text content are the target file data acquired by the uploading device within 1 minute.
步骤202:将目标文件数据封装为子文件。Step 202: Encapsulate the target file data into a subfile.
本步骤中,在获取到任一时间周期内的目标文件数据后,可以在内存中按照子文件封装格式打包已保存的目标文件数据,并在目标文件数据后添加对应的元信息,从而生成子文件,其中,子文件的元信息为用于解析子文件的信息。上述将目标文件封装为子文件的具体过程与现有技术一致,在此不再赘述。In this step, after obtaining the target file data in any time period, the saved target file data may be packaged in the sub-file encapsulation format in the memory, and the corresponding meta information is added after the target file data, thereby generating a sub- A file in which meta information of a subfile is information for parsing a subfile. The specific process of encapsulating the object file into a sub-file is consistent with the prior art, and details are not described herein again.
步骤203:将至少一个子文件写入到分布式文件系统中该目标文件的数据文件上。Step 203: Write at least one subfile to the data file of the target file in the distributed file system.
本申请实施例中为了便于描述,将已上传的目标文件的子文件的整体称为目标文件的数据文件,由于在上传目标文件的子文件时,按照子文件的生成顺序每次上传至少一个子文件,因此可知目标文件的数据文件是一个随着子文件上传而动态变化的文件(本实施例中也可将该数据文件称为otar文件)。在每次写入至少一个子文件时,将该至少一个子文件写入到分布式文件系统中该目标文件的数据文件的结尾,在写入该至少一个子文件前,数据文件的结尾包括数据文件的元信息,该元信息中包括在该至少一个子文件之前已写入到数据文件中的目标文件的所有子文件的属性信息。For the convenience of description, the entire sub-file of the uploaded target file is referred to as the data file of the target file, and when the sub-file of the target file is uploaded, at least one sub-fold is uploaded each time according to the generation order of the sub-file. The file, therefore, the data file of the target file is a file that dynamically changes as the subfile is uploaded (this data file can also be referred to as an otar file in this embodiment). Each time at least one subfile is written, the at least one subfile is written to the end of the data file of the target file in the distributed file system, and the end of the data file includes data before the at least one subfile is written Meta-information of a file including attribute information of all sub-files of the target file that have been written to the data file before the at least one sub-file.
在一个可选的例子中,在上传至少一个子文件时,可以采用java语言中的append命令,append命令可以用于在被选元素的结尾插入指定内容,本实施例中,利用append命令可以将至少一个子文件插入到数据文件的结尾处,以及后续可以利用append命令在该至少一个子文件后插入数据文件的更新元信息等。In an optional example, when uploading at least one subfile, the append command in the java language may be used, and the append command may be used to insert the specified content at the end of the selected element. In this embodiment, the append command may be used. At least one subfile is inserted at the end of the data file, and subsequent update meta information of the data file can be inserted after the at least one subfile by the append command.
步骤204:在至少一个子文件后写入数据文件的更新元信息,该数据文件的更新元信息中包括已写入的目标文件的所有子文件的属性信息。 Step 204: Write update meta information of the data file after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the written target file.
本步骤中,可以先获取该至少一个子文件写入到数据文件之前,数据文件的历史元信息,该历史元信息中包括在该至少一个子文件之前写入的目标文件的所有子文件的属性信息;然后生成已上传的至少一个子文件在数据文件中的属性信息,并根据历史元信息中包含的子文件的属性信息和该至少一个子文件的属性信息生成数据文件的更新元信息,最后在数据文件中该至少一个子文件后写入生成的更新元信息,即在该至少一个子文件后写入的数据文件的元信息中包含了已写入的目标文件的所有子文件的属性信息。例如,假设数据文件的历史元信息中包括子文件0至子文件n的n个子文件的属性信息,则在写入子文件n+1后,在数据文件的结尾写入的更新元信息中包括子文件0至子文件n+1的n+1个子文件的属性信息。In this step, the historical meta information of the data file before the at least one subfile is written to the data file, and the historical meta information includes attributes of all subfiles of the target file written before the at least one subfile. Information; then generating attribute information of the uploaded at least one subfile in the data file, and generating update metadata information of the data file according to the attribute information of the subfile included in the historical meta information and the attribute information of the at least one subfile, and finally The generated update meta information is written after the at least one subfile in the data file, that is, the meta information of the data file written after the at least one subfile includes attribute information of all subfiles of the written target file. . For example, if the history information of the data file includes the attribute information of the n subfiles of the subfile 0 to the subfile n, after the subfile n+1 is written, the update meta information written at the end of the data file is included. Attribute information of sub-file 0 to n+1 sub-files of sub-file n+1.
本实施例中,子文件的属性信息可以包括:子文件在数据文件中的偏移信息(File offset in otar)、子文件的长度(File size in otar)、子文件包含的数据行数(Record count)、以及子文件的其他属性信息(Other info),例如,统计信息,或者自定义信息等。In this embodiment, the attribute information of the subfile may include: offset information of the subfile in the data file (File offset in otar), length of the subfile (File size in otar), and number of data rows included in the subfile (Record) Count), and other attribute information (Other info) of the subfile, for example, statistical information, or custom information.
参见图2B,为应用本申请文件上传方法实施例上传的数据文件结构示意图,下面结合子文件上传过程对该数据文件结构进行描述。2B is a schematic diagram of a structure of a data file uploaded by applying an embodiment of the file uploading method of the present application. The structure of the data file is described below in conjunction with a sub-file uploading process.
本实施例中,上传设备封装的每个子文件的文件结构与现有技术一致,均包含子文件的文件数据和子文件的元信息,后续不再赘述子文件的封装过程,直接对封装后的子文件进行描述。In this embodiment, the file structure of each sub-file encapsulated by the uploading device is consistent with the prior art, and includes file data of the sub-file and meta-information of the sub-file, and the sub-file encapsulation process is not further described later, and the encapsulated sub-process is directly The file is described.
第一次上传(append):上传设备封装完成目标文件的第一个子文件0,将子文件0上传到分布式文件系统,并在子文件0的结尾添加已上传的目标文件的所有子文件的属性信息,此时只包括子文件0的属性信息,作为数据文件1的更新元信息;First upload (append): Upload the device to complete the first subfile 0 of the target file, upload the subfile 0 to the distributed file system, and add all subfiles of the uploaded target file at the end of subfile 0. The attribute information, at this time, only the attribute information of the subfile 0 is included as the update meta information of the data file 1;
第二次上传(append):上传设备封装完成目标文件的第二个子文件1,将子文件1上传到分布式文件系统中的数据文件1后,并在子文件1的结尾添加已上传的目标文件的所有子文件的属性信息,此时包括子文件0和子文件1的属性信息,作为数据文件2的更新元信息; Second upload (append): uploads the second subfile 1 of the device package completion target file, uploads the subfile 1 to the data file 1 in the distributed file system, and adds the uploaded target at the end of the subfile 1. The attribute information of all the subfiles of the file, at this time including the attribute information of the subfile 0 and the subfile 1, as the update meta information of the data file 2;
第三次上传(append):上传设备封装完成目标文件的第三个子文件2和第四个子文件3,将子文件2和子文件3上传到分布式文件系统中的数据文件2后,并在子文件3的结尾添加已上传目标文件的所有子文件的属性信息,此时包括子文件0、子文件1、子文件2和子文件3的属性信息,作为数据文件3的更新元信息。The third upload (append): upload the device to complete the third subfile 2 and the fourth subfile 3 of the target file, upload the subfile 2 and the subfile 3 to the data file 2 in the distributed file system, and then The attribute information of all the subfiles of the uploaded target file is added at the end of the file 3, and the attribute information of the subfile 0, the subfile 1, the subfile 2, and the subfile 3 is included as the update meta information of the data file 3.
结合图2B可知,在每一次动态生成的目标文件的数据文件的元信息中,包含了所有已上传的子文件的属性信息,该属性信息可以包括子文件偏移、子文件长度、子文件数据行数、子文件的其他属性信息等。As shown in FIG. 2B, the meta information of the data file of the dynamically generated target file includes attribute information of all uploaded subfiles, and the attribute information may include subfile offset, subfile length, and subfile data. The number of rows, other attribute information of the subfile, and so on.
由上述实施例可见,该实施例在将目标文件的文件数据封装为子文件后,并不直接向分布式文件系统上传子文件,而是将子文件写入到目标文件的数据文件上后,在该子文件之后写入数据文件的更新元信息,由于该更新元信息中包含了已写入分布式文件系统的目标文件的所有子文件的属性信息,因此只需要维护该一条更新元信息即可,避免对每个子文件的元信息分别维护,也无需将子文件合成目标文件,从而节省了系统的存储资源和维护资源。As can be seen from the above embodiment, after the file data of the target file is encapsulated into a subfile, the embodiment does not directly upload the subfile to the distributed file system, but writes the subfile to the data file of the target file. After the subfile is written to the update meta information of the data file, since the update meta information includes attribute information of all subfiles of the target file that has been written to the distributed file system, only one update meta information needs to be maintained. Yes, the meta information of each subfile is separately maintained, and the subfiles are not synthesized into the target file, thereby saving the storage resources and maintenance resources of the system.
参见图3,为本申请文件访问方法的一个实施例流程图,该实施例可以应用在分布式文件系统的存储服务器上,用于实现对前述图2A所示文件上传方法实施例上传到分布式文件系统中的文件进行访问:3 is a flowchart of an embodiment of a file access method of the present application. The embodiment may be applied to a storage server of a distributed file system, and used to implement uploading and distributing the file uploading method embodiment shown in FIG. 2A. File access in the file system:
步骤301:接收客户端设备发送的数据文件的文件访问命令,该文件访问命令中包括待访问文件数据的目标属性信息。Step 301: Receive a file access command of a data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed.
本步骤中,当客户端设备要访问目标文件的数据文件时,向分布式文件系统发送数据文件的文件访问命令,该文件访问命令中可以包括待访问文件数据的属性信息,本实施例中称为目标属性信息,例如,该目标属性信息可以为待访问文件数据在目标文件中的行数。In this step, when the client device accesses the data file of the target file, the file access command of the data file is sent to the distributed file system, and the file access command may include the attribute information of the file data to be accessed, which is referred to in this embodiment. For the target attribute information, for example, the target attribute information may be the number of lines of the file data to be accessed in the target file.
步骤302:根据目标属性信息和数据文件的更新元信息,获得待访问文件数据在数据文件中对应的目标子文件。Step 302: Obtain a target sub-file corresponding to the file data to be accessed in the data file according to the target attribute information and the update meta-information of the data file.
结合图2A和图2B示出的实施例可知,在目标文件的数据文件的结尾的更新元信息中,包含了所有已上传子文件的属性信息,因此可以根据目标属 性信息依次与更新元信息中每个子文件的属性信息进行匹配,例如,目标属性信息为行数时,则可以与每个子文件的属性信息中的行数信息进行匹配,当从每个子文件的属性信息中匹配到目标属性信息时,则可以将与目标属性信息对应的子文件确定为目标子文件。2A and 2B, the update meta-information at the end of the data file of the target file includes attribute information of all uploaded sub-files, and thus can be based on the target genus. The sexual information is sequentially matched with the attribute information of each subfile in the updated meta information. For example, when the target attribute information is the number of rows, the row number information in the attribute information of each subfile can be matched, when from each subfile. When the attribute information is matched to the target attribute information, the subfile corresponding to the target attribute information may be determined as the target subfile.
步骤303:将从目标子文件中读取的待访问文件数据提供给客户端设备。Step 303: Provide the to-be-accessed file data read from the target sub-file to the client device.
本步骤中,在获得了目标子文件后,可以按照目标子文件的元信息解析目标子文件的文件数据,根据目标属性信息从解析出的文件数据中读取待访问文件数据,然后向客户端设备传输读取到的待访问文件数据。In this step, after obtaining the target subfile, the file data of the target subfile may be parsed according to the meta information of the target subfile, and the file data to be accessed is read from the parsed file data according to the target attribute information, and then the file is accessed to the client. The device transmits the read file data to be accessed.
结合图2B的示例,假设接收到的文件访问命令中包括的目标属性信息为目标行数信息,则可以将该目标行数信息与数据文件3的元信息(Otar Meta(File0,File1,File2,File3))中子文件0至子文件3的属性信息中的行数信息进行匹配,将该目标行数信息所属的子文件确定为目标子文件,假设目标子文件为子文件1,则可以进一步根据子文件1的属性信息中的偏移信息和长度信息,从数据文件3中获取到该子文件1,并根据子文件1的元信息(File1Meta)对子文件1进行解析,从而从子文件1的文件数据中读取到待访问文件数据。With reference to the example of FIG. 2B, assuming that the target attribute information included in the received file access command is the target line number information, the target line number information and the meta information of the data file 3 (Otar Meta(File0, File1, File2, File3)) The number of lines in the attribute information of the neutron file 0 to the subfile 3 is matched, and the subfile to which the target line number information belongs is determined as the target subfile, and if the target subfile is the subfile 1, the further According to the offset information and the length information in the attribute information of the subfile 1, the subfile 1 is obtained from the data file 3, and the subfile 1 is parsed according to the meta information (File1Meta) of the subfile 1, so that the subfile is obtained from the subfile. The file data to be accessed is read from the file data of 1.
由上述实施例可见,基于分布式文件系统中已上传目标文件的数据文件,客户端设备可以直接根据当前数据文件的更新元信息访问到任一已上传的目标文件的子文件,因此可以保证客户端设备在任意时间对分布式文件系统中目标文件的文件数据进行读取。It can be seen from the above embodiment that, based on the data file of the target file uploaded in the distributed file system, the client device can directly access the subfile of any uploaded target file according to the updated meta information of the current data file, thereby ensuring the client. The end device reads the file data of the target file in the distributed file system at any time.
本申请文件上传装置的实施例可以应用在文件上传设备上,文件访问装置的实施例可以应用在存储服务器上。其中,装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图4A和图4B所示,分别为文件上传装置和文件访问装置所在设备的硬件结构图,除了图4A和图4B所示的处理器、内存、网络接口、以及非易失性存储器之外,实 施例中装置所在的设备通常根据该设备的实际功能,还可以包括其他硬件,图4A和图4B中不再一一示出。The embodiment of the file uploading apparatus can be applied to a file uploading device, and an embodiment of the file accessing apparatus can be applied to a storage server. The device embodiment may be implemented by software, or may be implemented by hardware or a combination of hardware and software. Taking the software implementation as an example, as a logical means, the processor of the device in which it is located reads the corresponding computer program instructions in the non-volatile memory into the memory. From the hardware level, as shown in FIG. 4A and FIG. 4B, respectively, the hardware structure diagram of the device where the file uploading device and the file access device are located, except for the processor, the memory, the network interface, and the non-display shown in FIG. 4A and FIG. 4B. Beyond volatile memory, real The device in which the device is located in the embodiment may also include other hardware according to the actual function of the device, which is not shown in FIG. 4A and FIG. 4B.
参见图5,为本申请文件上传装置的一个实施例框图,所述装置可以应用在向分布式文件系统实时上传文件的上传设备上:Referring to FIG. 5, it is a block diagram of an embodiment of a file uploading apparatus of the present application, which may be applied to an uploading device that uploads files in real time to a distributed file system:
该文件上传装置包括:获取单元510、封装单元520和上传单元530。The file uploading device includes an obtaining unit 510, a packaging unit 520, and an uploading unit 530.
其中,获取单元510,用于获取目标文件的目标文件数据;The obtaining unit 510 is configured to acquire target file data of the target file.
封装单元520,用于将所述目标文件数据封装为子文件;a packaging unit 520, configured to encapsulate the target file data into a subfile;
上传单元530,用于将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上,并在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。The uploading unit 530 is configured to write at least one of the subfiles to a data file of the target file in the distributed file system, and write an update element of the data file after the at least one subfile Information, the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
在一个可选的实现方式中:In an optional implementation:
所述获取单元510可以包括(图5中未示出):The obtaining unit 510 may include (not shown in FIG. 5):
周期判断子单元,用于判断是否到达预设的时间周期;a period determining subunit, configured to determine whether a preset time period is reached;
数据获取子单元,用于如果到达所述时间周期,则获取在所述时间周期内接收到的目标文件的文件数据,将获取到的所述文件数据作为所述目标文件数据。And a data obtaining subunit, configured to acquire file data of the target file received in the time period if the time period is reached, and use the acquired file data as the target file data.
在另一个可选的实现方式中:In another alternative implementation:
所述封装单元520可以包括(图5中未示出):The package unit 520 can include (not shown in FIG. 5):
数据写入子单元,用于按照子文件封装格式打包已写入内存中的所述目标文件数据;a data writing subunit, configured to package the target file data that has been written into the memory according to a subfile encapsulation format;
元信息添加子单元,用于在所述目标文件数据后添加所述目标文件数据的元信息后,生成所述子文件。The meta information adding subunit is configured to generate the subfile after adding the meta information of the target file data after the target file data.
在另一个可选的实现方式中:In another alternative implementation:
所述上传单元530可以包括(图5中未示出):The uploading unit 530 can include (not shown in FIG. 5):
历史元信息获取子单元,用于获取所述至少一个子文件写入到所述数据文件之前,所述数据文件的历史元信息,所述历史元信息中包括在所述至少 一个子文件之前写入的所述目标文件的子文件的属性信息;a historical meta information obtaining subunit, configured to acquire historical meta information of the data file before the at least one subfile is written into the data file, where the historical meta information is included in the at least Attribute information of a subfile of the target file written before a subfile;
属性信息生成子单元,用于生成所述至少一个子文件在所述数据文件中的属性信息;An attribute information generating subunit, configured to generate attribute information of the at least one subfile in the data file;
更新元信息生成子单元,用于根据所述历史元信息中包含的子文件的属性信息和所述至少一个子文件的属性信息生成所述数据文件的更新元信息;An update meta information generating subunit, configured to generate updated meta information of the data file according to attribute information of the subfile included in the historical meta information and attribute information of the at least one subfile;
更新元信息写入子单元,用于在所述数据文件中至少一个子文件后写入所述更新元信息。The update meta information is written to the subunit for writing the update meta information after at least one subfile in the data file.
在另一个可选的实现方式中:In another alternative implementation:
子文件的属性信息可以包括:The attribute information of the subfile may include:
所述子文件在所述数据文件中的偏移信息、所述子文件的长度、所述子文件包含的数据行数。The offset information of the subfile in the data file, the length of the subfile, and the number of data rows included in the subfile.
参见图6,为本申请文件访问装置的一个实施例框图,该装置用于对采用如图5所示装置上传到分布式文件系统中的文件进行访问:Referring to FIG. 6, a block diagram of an embodiment of a file access device for accessing a file uploaded to a distributed file system using the device shown in FIG. 5 is used:
该文件访问装置包括:接收单元610、获得单元620和访问单元630。The file access device includes a receiving unit 610, an obtaining unit 620, and an access unit 630.
其中,接收单元610,用于接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;The receiving unit 610 is configured to receive a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed.
获得单元620,用于根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;The obtaining unit 620 is configured to obtain, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
访问单元630,用于将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。The access unit 630 is configured to provide the to-be-accessed file data read from the target sub-file to the client device.
在一个可选的实现方式中:In an optional implementation:
所述获得单元620可以包括(图6中未示出):The obtaining unit 620 may include (not shown in FIG. 6):
属性信息匹配子单元,用于根据所述目标属性信息匹配所述更新元信息中每个子文件的属性信息;An attribute information matching subunit, configured to match attribute information of each subfile in the update meta information according to the target attribute information;
子文件确定子单元,用于当从所述每个子文件的属性信息中匹配到所述目标属性信息时,将与所述目标属性信息对应的子文件确定为所述目标子文件。 The subfile determining subunit is configured to determine, as the target subfile, a subfile corresponding to the target attribute information when the target attribute information is matched from the attribute information of each of the subfiles.
在另一个可选的实现方式中:In another alternative implementation:
所述访问单元630可以包括(图6中未示出):The access unit 630 can include (not shown in FIG. 6):
子文件解析子单元,用于按照所述目标子文件的元信息解析所述目标子文件的文件数据;a subfile parsing subunit, configured to parse file data of the target subfile according to meta information of the target subfile;
文件数据读取子单元,用于根据所述目标属性信息从解析出的文件数据中读取所述待访问文件数据;a file data reading subunit, configured to read the to-be-accessed file data from the parsed file data according to the target attribute information;
文件数据传输子单元,用于向所述客户端设备传输所述待访问文件数据。a file data transmission subunit, configured to transmit the to-be-accessed file data to the client device.
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。The implementation process of the function and the function of each unit in the foregoing device is specifically described in the implementation process of the corresponding steps in the foregoing method, and details are not described herein again.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present application. Those of ordinary skill in the art can understand and implement without any creative effort.
由上述实施例可见,应用本申请实施例上传文件时,在将目标文件的文件数据封装为子文件后,并不直接向分布式文件系统上传子文件,而是将子文件写入到目标文件的数据文件上后,在该子文件之后写入数据文件的更新元信息,由于该更新元信息中包含了已写入分布式文件系统的目标文件的所有子文件的属性信息,因此只需要维护该一条更新元信息即可,避免对每个子文件的元信息分别维护,也无需将子文件合成目标文件,从而节省了系统的存储资源和维护资源;基于前述上传目标文件的数据文件,由于客户端设备可以直接根据当前数据文件的更新元信息访问到任一已上传的目标文件的子文件,因此可以保证客户端设备在任意时间对分布式文件系统中目标文件的文件数据进行读取。It can be seen from the above embodiment that when the file is uploaded in the embodiment of the present application, after the file data of the target file is encapsulated into a subfile, the subfile is not directly uploaded to the distributed file system, but the subfile is written to the target file. After the data file is written, the update meta information of the data file is written after the subfile, and since the update meta information contains the attribute information of all the subfiles of the target file that has been written to the distributed file system, only maintenance is required. The one piece updates the meta information, avoids maintaining the meta information of each subfile separately, and does not need to synthesize the subfile into the target file, thereby saving the storage resource and maintenance resources of the system; based on the data file of the foregoing upload target file, due to the client The end device can directly access the subfile of any uploaded target file according to the update meta information of the current data file, so that the client device can read the file data of the target file in the distributed file system at any time.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本 申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate the present invention after considering the specification and practicing the invention disclosed herein. Other embodiments of the application. The application is intended to cover any variations, uses, or adaptations of the application, which are in accordance with the general principles of the application and include common general knowledge or common technical means in the art that are not disclosed herein. . The specification and examples are to be regarded as illustrative only,
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。 It is to be understood that the invention is not limited to the details of the details and The scope of the present application is limited only by the accompanying claims.

Claims (18)

  1. 一种文件上传方法,其特征在于,所述方法应用在向分布式文件系统实时上传文件的上传设备上,所述方法包括:A method for uploading a file, the method is applied to an uploading device that uploads a file to a distributed file system in real time, and the method includes:
    获取目标文件的目标文件数据;Obtain target file data of the target file;
    将所述目标文件数据封装为子文件;Encapsulating the target file data into a subfile;
    将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上;Writing at least one of the subfiles to a data file of the target file in the distributed file system;
    在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。The update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  2. 根据权利要求1所述的方法,其特征在于,所述获取目标文件的目标文件数据,包括:The method according to claim 1, wherein the obtaining target file data of the target file comprises:
    判断是否到达预设的时间周期;Determining whether a preset time period has elapsed;
    如果到达所述时间周期,则获取在所述时间周期内接收到的目标文件的文件数据,将获取到的所述文件数据作为所述目标文件数据。If the time period is reached, the file data of the target file received in the time period is acquired, and the acquired file data is used as the target file data.
  3. 根据权利要求1所述的方法,其特征在于,所述将所述目标文件数据封装为子文件,包括:The method according to claim 1, wherein the encapsulating the target file data into a subfile comprises:
    按照子文件封装格式打包已写入内存中的所述目标文件数据;Packaging the target file data that has been written into the memory according to the subfile encapsulation format;
    在所述目标文件数据后添加所述目标文件数据的元信息后,生成所述子文件。After the meta information of the target file data is added after the target file data, the subfile is generated.
  4. 根据权利要求1所述的方法,其特征在于,所述在所述至少一个子文件后写入所述数据文件的更新元信息,包括:The method according to claim 1, wherein the writing of the updated meta information of the data file after the at least one subfile comprises:
    获取所述至少一个子文件写入到所述数据文件之前,所述数据文件的历史元信息,所述历史元信息中包括在所述至少一个子文件之前写入的所述目标文件的子文件的属性信息;Acquiring historical meta information of the data file before the at least one subfile is written to the data file, where the historical meta information includes a subfile of the target file written before the at least one subfile Attribute information;
    生成所述至少一个子文件在所述数据文件中的属性信息;Generating attribute information of the at least one subfile in the data file;
    根据所述历史元信息中包含的子文件的属性信息和所述至少一个子文件 的属性信息生成所述数据文件的更新元信息;And attribute information of the subfile included in the historical meta information and the at least one subfile The attribute information generates updated meta information of the data file;
    在所述数据文件中所述至少一个子文件后写入所述更新元信息。Writing the update meta information after the at least one subfile in the data file.
  5. 根据权利要求1至4任一所述的方法,其特征在于,子文件的属性信息包括:The method according to any one of claims 1 to 4, characterized in that the attribute information of the subfile comprises:
    所述子文件在所述数据文件中的偏移信息、所述子文件的长度、所述子文件包含的数据行数。The offset information of the subfile in the data file, the length of the subfile, and the number of data rows included in the subfile.
  6. 一种文件访问方法,其特征在于,所述方法用于对采用如权利要求1至5任一方法上传到分布式文件系统中的文件进行访问,所述方法包括:A file access method, characterized in that the method is used for accessing a file uploaded to a distributed file system by using the method of any one of claims 1 to 5, the method comprising:
    接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;Receiving a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
    根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;Obtaining, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
    将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。The file data to be accessed read from the target subfile is provided to the client device.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件,包括:The method according to claim 6, wherein the obtaining, according to the target attribute information and the updated meta information of the data file, the target subfile corresponding to the file data to be accessed in the data file, include:
    根据所述目标属性信息匹配所述更新元信息中每个子文件的属性信息;Matching attribute information of each subfile in the update meta information according to the target attribute information;
    当从所述每个子文件的属性信息中匹配到所述目标属性信息时,将与所述目标属性信息对应的子文件确定为所述目标子文件。When the target attribute information is matched from the attribute information of each of the subfiles, the subfile corresponding to the target attribute information is determined as the target subfile.
  8. 根据权利要求6所述的方法,其特征在于,所述将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备,包括:The method according to claim 6, wherein the providing the file data to be accessed read from the target subfile to the client device comprises:
    按照所述目标子文件的元信息解析所述目标子文件的文件数据;Parsing file data of the target subfile according to meta information of the target subfile;
    根据所述目标属性信息从解析出的文件数据中读取所述待访问文件数据;Reading the to-be-accessed file data from the parsed file data according to the target attribute information;
    向所述客户端设备传输所述待访问文件数据。Transmitting the file data to be accessed to the client device.
  9. 一种文件上传装置,其特征在于,所述装置应用在向分布式文件系统实时上传文件的上传设备上,所述装置包括: A file uploading device, wherein the device is applied to an uploading device that uploads a file in real time to a distributed file system, the device comprising:
    获取单元,用于获取目标文件的目标文件数据;An obtaining unit, configured to acquire target file data of the target file;
    封装单元,用于将所述目标文件数据封装为子文件;a packaging unit, configured to encapsulate the target file data into a subfile;
    上传单元,用于将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上,并在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。a uploading unit, configured to write at least one of the subfiles to a data file of the target file in the distributed file system, and write update meta information of the data file after the at least one subfile The update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  10. 根据权利要求9所述的装置,其特征在于,所述获取单元包括:The device according to claim 9, wherein the obtaining unit comprises:
    周期判断子单元,用于判断是否到达预设的时间周期;a period determining subunit, configured to determine whether a preset time period is reached;
    数据获取子单元,用于如果到达所述时间周期,则获取在所述时间周期内接收到的目标文件的文件数据,将获取到的所述文件数据作为所述目标文件数据。And a data obtaining subunit, configured to acquire file data of the target file received in the time period if the time period is reached, and use the acquired file data as the target file data.
  11. 根据权利要求9所述的装置,其特征在于,所述封装单元包括:The device according to claim 9, wherein the package unit comprises:
    数据写入子单元,用于按照子文件封装格式打包已写入内存中的所述目标文件数据;a data writing subunit, configured to package the target file data that has been written into the memory according to a subfile encapsulation format;
    元信息添加子单元,用于在所述目标文件数据后添加所述目标文件数据的元信息后,生成所述子文件。The meta information adding subunit is configured to generate the subfile after adding the meta information of the target file data after the target file data.
  12. 根据权利要求9所述的装置,其特征在于,所述上传单元包括:The device according to claim 9, wherein the uploading unit comprises:
    历史元信息获取子单元,用于获取所述至少一个子文件写入到所述数据文件之前,所述数据文件的历史元信息,所述历史元信息中包括在所述至少一个子文件之前写入的所述目标文件的子文件的属性信息;a historical meta information obtaining subunit, configured to acquire historical meta information of the data file before the at least one subfile is written to the data file, where the historical meta information includes writing before the at least one subfile Attribute information of the subfile of the target file that is entered;
    属性信息生成子单元,用于生成所述至少一个子文件在所述数据文件中的属性信息;An attribute information generating subunit, configured to generate attribute information of the at least one subfile in the data file;
    更新元信息生成子单元,用于根据所述历史元信息中包含的子文件的属性信息和所述至少一个子文件的属性信息生成所述数据文件的更新元信息;An update meta information generating subunit, configured to generate updated meta information of the data file according to attribute information of the subfile included in the historical meta information and attribute information of the at least one subfile;
    更新元信息写入子单元,用于在所述数据文件中至少一个子文件后写入所述更新元信息。The update meta information is written to the subunit for writing the update meta information after at least one subfile in the data file.
  13. 根据权利要求9至12任一所述的装置,其特征在于,子文件的属性 信息包括:Apparatus according to any one of claims 9 to 12, characterized in that the attributes of the subfiles Information includes:
    所述子文件在所述数据文件中的偏移信息、所述子文件的长度、所述子文件包含的数据行数。The offset information of the subfile in the data file, the length of the subfile, and the number of data rows included in the subfile.
  14. 一种文件访问装置,其特征在于,所述装置用于对采用如权利要求9至13任一装置上传到分布式文件系统中的文件进行访问,所述装置包括:A file access device, wherein the device is configured to access a file uploaded to a distributed file system by using the device of any one of claims 9 to 13, the device comprising:
    接收单元,用于接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;a receiving unit, configured to receive a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
    获得单元,用于根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;a obtaining unit, configured to obtain, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
    访问单元,用于将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。And an access unit, configured to provide the to-be-accessed file data read from the target sub-file to the client device.
  15. 根据权利要求14所述的装置,其特征在于,所述获得单元包括:The apparatus according to claim 14, wherein said obtaining unit comprises:
    属性信息匹配子单元,用于根据所述目标属性信息匹配所述更新元信息中每个子文件的属性信息;An attribute information matching subunit, configured to match attribute information of each subfile in the update meta information according to the target attribute information;
    子文件确定子单元,用于当从所述每个子文件的属性信息中匹配到所述目标属性信息时,将与所述目标属性信息对应的子文件确定为所述目标子文件。The subfile determining subunit is configured to determine, as the target subfile, a subfile corresponding to the target attribute information when the target attribute information is matched from the attribute information of each of the subfiles.
  16. 根据权利要求14所述的装置,其特征在于,所述访问单元包括:The device according to claim 14, wherein the access unit comprises:
    子文件解析子单元,用于按照所述目标子文件的元信息解析所述目标子文件的文件数据;a subfile parsing subunit, configured to parse file data of the target subfile according to meta information of the target subfile;
    文件数据读取子单元,用于根据所述目标属性信息从解析出的文件数据中读取所述待访问文件数据;a file data reading subunit, configured to read the to-be-accessed file data from the parsed file data according to the target attribute information;
    文件数据传输子单元,用于向所述客户端设备传输所述待访问文件数据。a file data transmission subunit, configured to transmit the to-be-accessed file data to the client device.
  17. 一种文件上传设备,其特征在于,包括:A file uploading device, comprising:
    处理器;用于存储所述处理器可执行指令的存储器;a processor; a memory for storing the processor executable instructions;
    其中,所述处理器被配置为:Wherein the processor is configured to:
    获取目标文件的目标文件数据; Obtain target file data of the target file;
    将所述目标文件数据封装为子文件;Encapsulating the target file data into a subfile;
    将至少一个所述子文件写入到所述分布式文件系统中所述目标文件的数据文件上;Writing at least one of the subfiles to a data file of the target file in the distributed file system;
    在所述至少一个子文件后写入所述数据文件的更新元信息,所述数据文件的更新元信息中包括已写入的所述目标文件的所有子文件的属性信息。The update meta information of the data file is written after the at least one subfile, and the update meta information of the data file includes attribute information of all subfiles of the target file that have been written.
  18. 一种存储服务器,其特征在于,包括:A storage server, comprising:
    处理器;用于存储所述处理器可执行指令的存储器;a processor; a memory for storing the processor executable instructions;
    其中,所述处理器被配置为:Wherein the processor is configured to:
    接收客户端设备发送的数据文件的文件访问命令,所述文件访问命令中包括待访问文件数据的目标属性信息;Receiving a file access command of the data file sent by the client device, where the file access command includes target attribute information of the file data to be accessed;
    根据所述目标属性信息和所述数据文件的更新元信息,获得所述待访问文件数据在所述数据文件中对应的目标子文件;Obtaining, according to the target attribute information and the updated meta information of the data file, a target subfile corresponding to the to-be-accessed file data in the data file;
    将从所述目标子文件中读取的所述待访问文件数据提供给所述客户端设备。 The file data to be accessed read from the target subfile is provided to the client device.
PCT/CN2016/095856 2015-08-31 2016-08-18 File uploading method, access method, device and apparatus WO2017036308A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510549840.8 2015-08-31
CN201510549840.8A CN106487855B (en) 2015-08-31 2015-08-31 File uploading method, file accessing method, file uploading device, file accessing device and equipment

Publications (1)

Publication Number Publication Date
WO2017036308A1 true WO2017036308A1 (en) 2017-03-09

Family

ID=58186661

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/095856 WO2017036308A1 (en) 2015-08-31 2016-08-18 File uploading method, access method, device and apparatus

Country Status (2)

Country Link
CN (1) CN106487855B (en)
WO (1) WO2017036308A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414339A (en) * 2020-03-13 2020-07-14 浙江大华技术股份有限公司 File processing method, system, device, equipment and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401723A (en) * 2019-08-16 2019-11-01 北京浪潮数据技术有限公司 Method, system, equipment and the storage medium of OVA file upload services device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102238434A (en) * 2011-07-22 2011-11-09 中兴通讯股份有限公司 Method and system for segmenting internet protocol television (IPTV) stream media file virtually
CN103118049A (en) * 2011-11-17 2013-05-22 中兴通讯股份有限公司 Method and system downloading files through network caching
US20140280400A1 (en) * 2013-03-15 2014-09-18 Stephane G. Legay System and method for improved data accessibility
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050227218A1 (en) * 2004-03-06 2005-10-13 Dinesh Mehta Learning system based on metadata framework and indexed, distributed and fragmented content
CN103686203A (en) * 2013-12-04 2014-03-26 深圳市融创天下科技股份有限公司 Video transcoding method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102238434A (en) * 2011-07-22 2011-11-09 中兴通讯股份有限公司 Method and system for segmenting internet protocol television (IPTV) stream media file virtually
CN103118049A (en) * 2011-11-17 2013-05-22 中兴通讯股份有限公司 Method and system downloading files through network caching
US20140280400A1 (en) * 2013-03-15 2014-09-18 Stephane G. Legay System and method for improved data accessibility
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414339A (en) * 2020-03-13 2020-07-14 浙江大华技术股份有限公司 File processing method, system, device, equipment and medium
CN111414339B (en) * 2020-03-13 2023-04-25 浙江大华技术股份有限公司 File processing method, system, device, equipment and medium

Also Published As

Publication number Publication date
CN106487855A (en) 2017-03-08
CN106487855B (en) 2020-01-03

Similar Documents

Publication Publication Date Title
US11232080B2 (en) Systems and methods for providing access to a data file stored at a data storage system
WO2018076952A1 (en) Method and apparatus for storage and playback positioning of video file
CN111143462B (en) Method, apparatus, computer device and storage medium for data export
CN102882974B (en) Method for saving website access resource by website identification version number
CN110336871A (en) A kind of document handling method, device, storage medium and electronic equipment
US20080281944A1 (en) Method and system for extending the capabilities of embedded devices through network clients
US20140122658A1 (en) Systems and Methods for Accelerating Remote Data Retrieval Via Peer Nodes
US10491672B2 (en) Data transfer device, data receiving system and data receiving method
JP2016500190A (en) Information presentation method, apparatus, program, and recording medium
TW202040387A (en) Method for constructing index of data record
JP2018506936A (en) Method and system for an end-to-end solution for distributing content in a network
CN111125017B (en) Data storage method and device based on tree structure and computer equipment
WO2020034729A1 (en) Data processing method, related device, and computer storage medium
CN112559463B (en) Compressed file processing method and device
US20160042087A1 (en) Method, System And Front -End Device For Posting User Generated Content
US20090024640A1 (en) Apparatus and method for improving efficiency of content rule checking in a content management system
US20210240353A1 (en) Resource management method and apparatus
WO2017036308A1 (en) File uploading method, access method, device and apparatus
US10437849B2 (en) Method and apparatus for implementing storage of file in IP disk
US11233844B2 (en) Distribution network providing customized content at delivery
CN112187921B (en) Object file downloading method, device, system, server and storage medium
CN109298899A (en) A kind of file automating application method of juvenile's game configuration and electronic equipment
US10915270B2 (en) Random file I/O and chunked data upload
US9621424B2 (en) Providing a common interface for accessing and presenting component configuration settings
US20140068006A1 (en) Method, apparatus and system for providing content

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16840737

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16840737

Country of ref document: EP

Kind code of ref document: A1