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

Method for distributing and reclaiming idle blocks of file

A technology of allocation method and recovery method, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve the problems of waste of disk space, time-consuming, large space occupied by the continuous area of ​​the file header, etc., and save storage space. , the initialization process is fast, the effect of saving memory

Active Publication Date: 2010-04-07
SHANGHAI BAOSIGHT SOFTWARE CO LTD
View PDF7 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In this method, after the blocks in the file have been released and allocated many times, 0 and 1 will be mixed together. At this time, it will be time-consuming to find a free block from the continuous area of ​​the file; at the same time, as the file continues to Filled with data, the later the free block appears in the continuous area of ​​the file header, the longer it will take to query the continuous area of ​​​​the file header to obtain a free block; moreover, this method is applied to large files, because the file header The space occupied by the internal continuous area is relatively large, which will cause a lot of waste of disk space.

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 for distributing and reclaiming idle blocks of file
  • Method for distributing and reclaiming idle blocks of file
  • Method for distributing and reclaiming idle blocks of file

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0047]A method for allocating free blocks of a file. The file is divided into N file blocks according to a preset size, and the file blocks are numbered. K of the N file blocks are used as index blocks. The index blocks are connected by a two-way linked list, and the index blocks are Stores the index block number of the index block, the index block number of the index block and the number of free blocks managed by the index block, according to the order of the index block in the doubly linked list, the free blocks managed by the index block are allocated in turn, and the index is modified accordingly The information stored in the block.

[0048] Wherein, a reserved block is set among the N file blocks, and the sequence number of the previous index block in the first index block and the sequence number of the post index block in the last index block among the index blocks are the sequence numbers of the reserved blocks.

[0049] Wherein, when there is no managed free block in t...

Embodiment 2

[0062] A method for reclaiming free blocks of a file. The file is divided into N file blocks according to a preset size, and the file blocks are numbered. K of the N file blocks are used as index blocks. The index blocks are connected by a two-way linked list, and the index blocks are Stores the index block number of the index block, the index block number of the index block and the number of free blocks managed by the index block, according to the order of the index block in the doubly linked list, the index block reclaims the free block in turn, and modifies the index block accordingly information stored in .

[0063] Wherein, a reserved block is set in the N file blocks, and the index blocks are connected by a doubly linked list, the sequence number of the front index block in the first index block in the index block and the rear index block in the last index block The sequence number is the sequence number of the reserved block.

[0064] Wherein, when the index block is f...

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 distributing and reclaiming idle blocks of a file. The distributing method comprises the following steps: dividing the file into N file blocks according to the preset size, and numbering the file blocks; using K file blocks in the N file blocks as index blocks, and connecting the index blocks by adopting a bidirectional link table; storing a previous index block sequence number of the index block, a rear index block sequence number and the number of the idle blocks managed by the index block into the index blocks; and distributing the idle blocks managed by the index block in turn according to the order of the index blocks in the bidirectional link table, and correspondingly modifying information stored in the index blocks. The reclaiming method comprises the following steps: reclaiming the idle blocks in turn by the index blocks according to the order of the index blocks in the bidirectional link table, and correspondingly modifying the information stored in the index blocks. The method is particularly suitable for application situations with high real-time requirements. The method can save a large amount of storage space in the storage of mass historical data of the real-time database, and meanwhile can ensure the real-time response of the real-time database to the data due to extremely high idle block distribution speed.

Description

technical field [0001] The invention belongs to the technical field of data storage and management, in particular to a method for allocating and reclaiming free blocks of files. Background technique [0002] In the field of data storage and management, data is usually written into files in blocks of a certain size, and then data indexes are established for data blocks. For example, operating systems and databases usually use B+ trees or Hash functions to establish data indexes for data blocks. The above process requires a file free block management system. When data is to be written to the file, the free block management system allocates a free block to the user, and the user writes the data into the obtained free block, and then adds the address of the block to the data index; When the user wants to release a certain data block, the address of the data block is removed from the data index, and the removed data block is handed over to the free block management system for rec...

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 SHANGHAI BAOSIGHT SOFTWARE 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