Data writing method, device and medium of a block device
A data writing and block device technology, applied in the field of data writing to block devices, can solve problems affecting the service life of block devices, increasing overall system overhead, affecting performance, etc., to ensure performance, reduce overall system overhead, and reduce usage Effects of Lifespan Impact
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0041] figure 1 It is a flow chart of a data writing method for a block device provided by an embodiment of the present invention. Please refer to figure 1 , the specific steps of the data writing method of the block device include:
[0042] Step S10: Obtain the data to be written and the total amount of data.
[0043] It should be noted that since the data needs to be written into the block device, it is necessary to know the total amount of data in advance, and then in the subsequent steps, the block device will open up a corresponding storage space for data storage.
[0044] Step S11: Apply for a storage space whose capacity corresponds to the total amount of data in the block device, and write the data into the storage space in blocks.
[0045] It can be understood that this step is to apply for a storage space corresponding to the total amount of data to be written in the block device, and then directly write the data into the storage space to implement data storage to...
Embodiment 2
[0052] figure 2 It is a flow chart of another method for writing data to a block device provided by an embodiment of the present invention. figure 2 In steps S10 and S12 and figure 1 Same, no more details here.
[0053] Such as figure 2 As shown, as a preferred implementation manner, before applying for storage space in the block device with a capacity corresponding to the total amount of data, the method further includes:
[0054] Step S20: Build a B+ tree, and record the available space in the block device through the B+ tree.
[0055] Correspondingly, step S11 is specifically:
[0056] Step S21: Select the available space according to the B+ tree to apply for storage space in the block device.
[0057] It should be noted that since the traversal efficiency of data in the B+ tree is higher, the use of the B+ tree to record the available space of the block device can traverse the available space of the block device more quickly, thereby improving the overall writing o...
Embodiment 3
[0071] The embodiment of the method for writing data to a block device has been described in detail above, and the present invention also provides a device for writing data to a block device corresponding to the method. Since the embodiment of the device part and the implementation of the method part The examples correspond to each other, so for the embodiments of the device part, please refer to the description of the embodiments of the method part, and details will not be repeated here.
[0072] image 3 It is a structural diagram of a data writing device of a block device provided by an embodiment of the present invention. The data writing device of the block device provided by the embodiment of the present invention specifically includes:
[0073] The acquisition calculation module 10 is configured to acquire the data to be written and the total amount of data.
[0074] The block device writing module 11 is configured to apply for a storage space whose capacity correspon...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com