Method, device and system for writing data

A technology for writing data and metadata, applied in the field of distributed file systems, it can solve the problems of chaotic and disordered file data and the inability to guarantee the correctness of written data, and achieve the effect of ensuring orderliness

Active Publication Date: 2012-08-01
TENCENT CLOUD COMPUTING BEIJING CO LTD
View PDF5 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] When multiple user processes concurrently append and write data to the same file, the control process directly returns the current file tail offset. When a user process has not yet completed the write data operation, the file tail offset will not be rewritten, so much Two user processes write data after the same end-of-file offset, causing the file data to be chaotic and out of order, so that the correctness of the written data cannot be guaranteed.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, device and system for writing data
  • Method, device and system for writing data
  • Method, device and system for writing data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] The embodiment of the present invention provides a method for writing data, see figure 1 , the method includes:

[0032] 101: Receive write request information from a user process, where the write request information includes at least the identifier of the target file and the length of data expected to be written;

[0033] Distributed file system includes user process, control process and file server. When the user process needs to add data (write data) to the system, at first the user process sends the write request information to the control process. The write request information includes the file name, the length of the data to be written, the file attributes and other information.

[0034] 102: Modify the file tail offset of the target file according to the expected written data length;

[0035] According to the file name specified in the write request information, the control process retrieves the memory metadata of the file and obtains the metadata corresponding...

Embodiment 2

[0040] The embodiment of the present invention provides a method for writing data, see figure 2 , the method includes:

[0041] 201: Receive write request information from a user process, where the write request information includes at least the identifier of the target file and the length of data expected to be written;

[0042] Distributed file system includes user process, control process and file server. When the user process needs to add data (write data) to the system, at first the user process sends a write request to the control process. The write request information includes the file name, the length of the data to be written, the file attributes and other information.

[0043] The control process performs further operations according to the received write request information.

[0044] 202: Modify the file tail offset of the target file according to the expected written data length;

[0045] According to the file name specified in the write request information, th...

Embodiment 3

[0076] An embodiment of the present invention provides a device for writing data, see Figure 3-Figure 6 , the device consists of:

[0077] The receiving module 300 is configured to receive the write request information of the user process, the write request information at least includes the identification of the target file and the length of data expected to be written;

[0078] An offset modifying module 310, configured to modify the file tail offset of the target file according to the expected written data length;

[0079] A control writing module 320, configured to control the user process to write the data desired to be written into the target file.

[0080] Control writing module 320 includes:

[0081] The metadata construction unit 321 is configured to calculate the number of required data blocks according to the length of data to be written, and construct a metadata for each data block, the metadata at least includes: the file start corresponding to the data block O...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for writing data and belongs to the technical field of computers. The method comprises receiving user-process write-request information at least comprising identification of an object file and lengths of data which users expect to write in; modifying offset of a file end of the object file according to the lengths of the data which the users expect to write in; and controlling user processes to write the data which the users expect to write in into the object file. The invention further discloses a device and a system for writing the data. When concurrent data of a plurality of user processes are added, the offset of the file end is pre-modified, a network token is combined, orderliness and correctness of data are achieved when summarization of the concurrent data of the plurality of user processes is operated, consistency of each counterpart version is guaranteed and control procedure processing logic is simplified when counterparts are distributed, physical consistency of a main file and the counterpart is guaranteed through a file server, and loads of modules are balanced.

Description

technical field [0001] The invention relates to a distributed file system, in particular to a method, device and system for writing data by a multi-user process. Background technique [0002] Distributed file system includes user process, control process and file server. When the user process needs to add data to the system, the user process first sends a write request to the control process, and the control process generates a response packet according to the write request and returns it to the user process, and the user process notifies the file server to complete the data addition. [0003] There are multiple user processes in the distributed file system. These user processes are responsible for application access and are called multi-user processes. The multi-user processes interact with the file server through the control process. [0004] In a distributed file system, if multiple user processes want to write data to a file, first these multi-user processes obtain the ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 王雨刘致远吴健张毕林潘璐
Owner TENCENT CLOUD COMPUTING BEIJING CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products