Data writing method and device of block equipment and medium
A data writing and block device technology, applied in the field of data writing to block devices, can solve the problems of affecting the service life of block devices, increasing the overall system overhead, occupying the system, etc., to ensure performance, reduce the overall system overhead, and avoid writing Magnified effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Example Embodiment
[0040] Example one
[0041] figure 1 This is a flowchart of a method for writing data to a block device according to an embodiment of the present invention. Please refer to figure 1 , The specific steps of the block device data writing method include:
[0042] Step S10: Obtain the data to be written and the total amount of data.
[0043] It should be noted that since data needs to be written into the block device, the total amount of data needs to be known in advance, and then the block device will open up corresponding storage space for data storage in subsequent steps.
[0044] Step S11: Apply for a storage space whose capacity meets the total amount of data in the block device, and write the data into the storage space in blocks.
[0045] It is understandable that this step is to apply for a storage space in the block device that corresponds to the total amount of data to be written, and then write the data directly into the storage space to store the data in the block device. It s...
Example Embodiment
[0051] Example two
[0052] figure 2 This is a flowchart of another method for writing data to a block device according to an embodiment of the present invention. figure 2 Steps S10 and S12 and figure 1 The same, I won't repeat them here.
[0053] Such as figure 2 As shown, as a preferred embodiment, before applying for a storage space whose capacity meets the total amount of data in the block device, 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 in the B+ tree to apply for storage space in the block device.
[0057] It should be noted that because the traversal efficiency of the data in the B+ tree is higher, the use of the B+ tree to record the available space of the block device can more quickly traverse the available space of the block device, thereby improving the overall data writing effectiv...
Example Embodiment
[0070] Example three
[0071] In the above, the embodiment of the data writing method of the block device is described in detail. The present invention also provides a data writing device of the block device corresponding to the method, due to the embodiment of the device part and the implementation of the method part The examples correspond to each other, so please refer to the description of the embodiment of the method part for the embodiment of the device part, which will not be repeated here.
[0072] image 3 It is a structural diagram of a data writing apparatus for a block device provided by an embodiment of the present invention. The data writing apparatus of the block device provided by the embodiment of the present invention specifically includes:
[0073] The obtaining calculation module 10 is used to obtain the data to be written and the total amount of data.
[0074] The block device writing module 11 is used to apply for a storage space with a capacity in accordance w...
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.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap