Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A 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: 2016-12-14
TENCENT CLOUD COMPUTING BEIJING CO LTD
View PDF5 Cites 0 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
  • A method, device and system for writing data
  • A method, device and system for writing data
  • A method, device and system for writing data

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

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

[0034] 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;

[0035] 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.

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

[0037] 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

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

[0043] 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;

[0044] 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.

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

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

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

Embodiment 3

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

[0079] 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;

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

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

[0082] Control writing module 320 includes:

[0083] 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, which belongs to the technical field of computers. The method includes: receiving the write request information of the user process, the write request information at least including the identification of the target file and the length of data expected to be written; according to the length of the data expected to be written, modifying the end of the file of the target file Offset: controlling the user process to write the data expected to be written into the target file. The present invention also discloses a device for writing data and a system for writing data. The present invention pre-modifies the file tail offset when multiple user processes concurrently append data, and at the same time combines network tokens to realize When multi-user processes perform concurrent data aggregation operations, the orderliness and correctness of data, the consistency of each copy version during copy distribution, and the simplification of the control process processing logic, the file server ensures the physical consistency of the master file and the copy, and balances each module load.

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 Patents(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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products